From 3b1ea392af03413de2f8c8fb211510bcfbd910d9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 16 Mar 2015 11:00:31 +0800 Subject: [PATCH 001/175] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=9A=84gem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 34e81cef6..835857625 100644 --- a/Gemfile +++ b/Gemfile @@ -27,8 +27,8 @@ group :development do gem 'grape-swagger' #gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git' #gem 'puma' - gem 'pry-rails' - gem 'pry-byebug' + # gem 'pry-rails' + # gem 'pry-byebug' gem 'better_errors', path: 'lib/better_errors' gem 'rack-mini-profiler', path: 'lib/rack-mini-profiler' end From 747a109638bd564f4f65a2ab39c8901498ef9f5f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 16 Mar 2015 11:51:12 +0800 Subject: [PATCH 002/175] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0CSS?= =?UTF-8?q?=E6=96=87=E4=BB=B6=202=E3=80=81=E8=B0=83=E6=95=B4=E9=A6=96?= =?UTF-8?q?=E9=A1=B5HTML=203=E3=80=81=E5=8E=BB=E6=8E=89base=5Fheader?= =?UTF-8?q?=E4=B8=AD=E6=B2=A1=E7=94=A8=E7=9A=84erb=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_header.html.erb | 33 ------ app/views/layouts/base.html.erb | 74 ++++++------ app/views/layouts/base_welcome.html.erb | 49 ++++++++ public/stylesheets/courses.css | 49 ++++++++ public/stylesheets/leftside.css | 59 ++++++++++ public/stylesheets/public.css | 150 ++++++++++++++++++++++++ 6 files changed, 346 insertions(+), 68 deletions(-) create mode 100644 app/views/layouts/base_welcome.html.erb create mode 100644 public/stylesheets/courses.css create mode 100644 public/stylesheets/leftside.css create mode 100644 public/stylesheets/public.css diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 445a5abf4..75c39a407 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -1,32 +1,3 @@ -<% - request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil? - realUrl = request.original_url - if (realUrl.match(/.*forge\.trustie\.net\/*/)) - #@nav_dispaly_project_label = 1 - #@nav_dispaly_forum_label = 1 - elsif (realUrl.match(/.*course\.trustie\.net\/*/)) - #@nav_dispaly_course_all_label = 1 - #@nav_dispaly_forum_label = 1 - #@nav_dispaly_course_label = nil - #@nav_dispaly_store_all_label = 1 - elsif (realUrl.match(/.*user\.trustie\.net\/*/)) - #@nav_dispaly_home_path_label = 1 - #@nav_dispaly_main_course_label = 1 - #@nav_dispaly_main_project_label = 1 - #@nav_dispaly_main_contest_label = 1 - elsif (realUrl.match(/.*contest\.trustie\.net\/*/)) - #@nav_dispaly_contest_label = 1 - #@nav_dispaly_store_all_label = 1 - else - #@nav_dispaly_project_all_label = 1 - #@nav_dispaly_course_all_label = 1 - #@nav_dispaly_forum_label = 1 - #@nav_dispaly_bid_label = 1 - #@nav_dispaly_contest_label = 1 - #@nav_dispaly_store_all_label = 1 - #@nav_dispaly_user_label = 1 - end -%> <%= render :partial => "layouts/base_feedback" %>
<% end -%> - <%#= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> <%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%> - <%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定, 全局搜索即可发现 %>
-
-
- <%= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get) do %> - <%= text_field_tag 'name', params[:name], :size => 20, :style => "float:left" %> - - <%= l(:label_search)%> - -
- - <%#= submit_tag l(:label_search), :class => "ButtonColor m3p10", :name => nil, :style => "float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" %> - <% end %> - - - - - - -

- <%= link_to l(:field_homepage), home_path %> - > - - <%=l(:label_courses_management_platform)%> - - > - <%= link_to @course.name, nil %> -

- - - - - - - -
-
- -
- <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
- - -
- -<%= render :partial => 'layouts/base_footer' %> - - - + + <%= call_hook :view_layouts_base_body_bottom %> +<%= render :partial => 'layouts/new_feedback' %> \ No newline at end of file diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 60719753d..947103ea8 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -104,6 +104,15 @@ module Redmine links.empty? ? nil : content_tag('ul', links.join("\n").html_safe) end + #重新写个方法,专门给header用 sw + def header_render_menu (menu, project=nil) + links = [] + menu_items_for(menu, project) do |node| + links << render_menu_node(node, project) + end + links.empty? ? nil : links.join("\n").html_safe + end + def bootstrap_render_menu(menu, project=nil) links = [] menu_items_for(menu, project) do |node| @@ -122,8 +131,7 @@ module Redmine else caption, url, selected = extract_node_details(node, project) unless url.to_s.include?( 'code_review') - return content_tag('li', - render_single_menu_node(node, caption, url, selected)) + return content_tag('li',render_single_menu_node(node, caption, url, selected),:class => 'fr') end end end diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js new file mode 100644 index 000000000..56d1c296f --- /dev/null +++ b/public/javascripts/feedback.js @@ -0,0 +1,47 @@ +(function($){ + $.fn.fix = function(options){ + var defaults = { + float : 'right', + minStatue : true, + skin : 'blue', + durationTime : 1000 + }; + var options = $.extend(defaults, options); + + this.each(function(){ + var thisBox = $(this), + closeBtn = thisBox.find('.close_btn' ), + show_btn = thisBox.find('.show_btn' ), + sideContent = thisBox.find('.side_content'), + sideList = thisBox.find('.side_list') + ; + var defaultTop = thisBox.offset().top; + + thisBox.css(options.float, 0); + if(options.minStatue == "true"){ + $(".show_btn").css("float", options.float); + sideContent.css('width', 0); + show_btn.css('width', 25); + + } + closeBtn.bind("click",function(){ + sideContent.animate({width: '0px'},"fast"); + show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); + cookiesave('minStatue','false','','',''); + }); + show_btn.bind("click",function() { + $(this).animate({width: '0px'},"fast"); + sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); + cookiesave('minStatue','false','','',''); + }); + }); + }; +})(jQuery); + +$(function() { + $("#scrollsidebar").fix({ + float : 'right', //default.left or right + //minStatue : true, + durationTime : 600 + }); +}); \ No newline at end of file diff --git a/public/javascripts/header.js b/public/javascripts/header.js new file mode 100644 index 000000000..e5363f8d5 --- /dev/null +++ b/public/javascripts/header.js @@ -0,0 +1,41 @@ +function addSlipMenu () { + var loggedas = $('#current_user_li:first'); + var sub_menu = $('#user_sub_menu'); + loggedas.mouseenter(function(event) { + sub_menu.show(); + }); + sub_menu.mouseleave(function(event) { + sub_menu.hide(); + }); +} + +function addProjectSlipMenu () { + var loggedas = $('#my_projects_li'); + var project_sub_menu = $('#my_projects_ul'); + var course_sub_menu = $('#my_courses_ul'); + loggedas.mouseenter(function(event) { + course_sub_menu.hide(); + project_sub_menu.show(); + }); + loggedas.mouseleave(function(event) { + project_sub_menu.hide(); + }); +} +function addCourseSlipMenu () { + var loggedas = $('#my_courses_li'); + var project_sub_menu = $('#my_projects_ul'); + var course_sub_menu = $('#my_courses_ul'); + loggedas.mouseenter(function(event) { + project_sub_menu.hide(); + course_sub_menu.show(); + }); + loggedas.mouseleave(function(event) { + course_sub_menu.hide(); + }); +} + +$(document).ready(function () { + addSlipMenu(); + addProjectSlipMenu (); + addCourseSlipMenu(); +}); \ No newline at end of file diff --git a/public/javascripts/polls.js b/public/javascripts/polls.js deleted file mode 100644 index c10bf6d1f..000000000 --- a/public/javascripts/polls.js +++ /dev/null @@ -1,65 +0,0 @@ -function add_MC(){ - var now = new Date().getTime(); - $("#poll_content").append("
"+ - "
"+ - "
" + - "
" + - "
" + - "" + - "" + - "" + - "" + - "" + - "
" + - "
" + - "
    " + - "
  • " + - "" + - "" + - "" + - "" + - "
  • " + - "
    " + - "
  • " + - "" + - "" + - "" + - "" + - "
  • " + - "
    " + - "
  • " + - "" + - "" + - "" + - "" + - "
  • " + - "
    " + - "
" + - "
" + - "" + - "
" + - "
" + - "
" + - "
" + - "
"); -} -function add_MCQ(){$("#poll_content").append("<%= escape_javascript(render :partial => 'new_MCQ') %>");} -function add_single(){$("#poll_content").append("<%= escape_javascript(render :partial => 'new_single') %>");} -function add_mulit(){$("#poll_content").append("<%= escape_javascript(render :partial => 'new_mulit') %>");} -//问卷头 -function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();} -function pollsEdit(){$("#polls_head_edit").show();$("#polls_head_show").hide();} -//单选题 -function add_single_answer(doc) -{ - doc.parent().after("
  • " + - ""+ - "
  • "); -} -function remove_single_answer(doc) -{ - if(doc.parent().siblings("li").length == 0){doc.parent().parent().parent().parent().parent().parent().remove();}else{doc.parent().remove();} -} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 0ee806159..d44c10161 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -121,10 +121,10 @@ a:hover.c_blue02{color: #0781b4;} .footlogo{ width:580px; margin:0 auto;height:50px; } /*意见反馈*/ html{ overflow-x:hidden;} -.scrollsidebar{ position:absolute;top:1px; right:1px; background:none; } +.scrollsidebar{ position:fixed;bottom:1px; right:1px; background:none; } .side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content .side_list {width:154px;overflow:hidden;} -.show_btn{ width:0; height:112px; overflow:hidden; float:left; cursor:pointer;} +.show_btn{ width:0; height:112px; overflow:hidden; float:left;margin-top: 200px; cursor:pointer;} .show_btn span { display:none;} .close_btn{width:24px;height:24px;cursor:pointer;} .side_title,.side_bottom,.close_btn,.show_btn {background:url(../images/sidebar_bg.png) no-repeat; } From d2c7861706d7a137c328cebc71b81a88d4b10f8f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 17 Mar 2015 15:57:09 +0800 Subject: [PATCH 004/175] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E5=9B=BE=E7=89=87=202=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E5=8F=8D=E9=A6=88=E6=A1=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=E5=85=B3=E9=97=AD=203=E3=80=81=E4=BF=AE=E6=94=B9css?= =?UTF-8?q?=E4=B8=AD=E9=83=A8=E5=88=86=E5=9B=BE=E7=89=87=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 2 +- public/images/pic_headnav.png | Bin 0 -> 210 bytes public/javascripts/feedback.js | 45 ++++++++++++++++++++-- public/stylesheets/courses.css | 8 ++-- public/stylesheets/leftside.css | 2 +- 5 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 public/images/pic_headnav.png diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index bf6862244..1dc15e481 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -110,7 +110,7 @@ $(function(){ myTips("<%= l(:label_feedback_success) %>","success"); }); -}) +}); function f_submit() { diff --git a/public/images/pic_headnav.png b/public/images/pic_headnav.png new file mode 100644 index 0000000000000000000000000000000000000000..2f59b84c4d265afc7fb81084bf9ba2bf93119435 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJx0U~c5>$3n-oCO|{#S9F5M?jcysy3fAP*5S+ zBgmJ5p-Pp3p`n?9;pcxK{gQ#9)PRBERRRNp)eHs(@%%~gN8NyGBRpLkLn?0NoZHCT z?7-k0*xjc(A;`deNsiO}z)gIz(J3rht4b7}241)`_s1md=xxpFm$YttJh<5OpWeP1 zUXKHelV1dV_THp+Ge|{z_S`Cs1ts3`v~!(gV@w>ToX4QMw5gQu&X%Q~loCICLD BMpXa+ literal 0 HcmV?d00001 diff --git a/public/javascripts/feedback.js b/public/javascripts/feedback.js index 56d1c296f..7ed063b75 100644 --- a/public/javascripts/feedback.js +++ b/public/javascripts/feedback.js @@ -32,16 +32,55 @@ show_btn.bind("click",function() { $(this).animate({width: '0px'},"fast"); sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); - cookiesave('minStatue','false','','',''); + cookiesave('minStatue','true','','',''); }); }); }; })(jQuery); +function cookiesave(n, v, mins, dn, path) +{ + if(n) + { + if(!mins) mins = 365 * 24 * 60; + if(!path) path = "/"; + var date = new Date(); + date.setTime(date.getTime() + (mins * 60 * 1000)); + var expires = "; expires=" + date.toGMTString(); + if(dn) dn = "domain=" + dn + "; "; + document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path; + } +} + +function cookieget(n) +{ + var name = n + "="; + var ca = document.cookie.split(';'); + for(var i=0;i","success"); + }); +}); + +function f_submit() +{ + $("#new_memo").submit(); +} \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index b403a5984..042e7caae 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -7,10 +7,10 @@ .more:hover{ color:#64bdd9;} .project_box_ul{ padding:0 10px;} .project_box_list{ padding:10px 0; border-bottom:1px dashed #e2e1e1; padding-left:30px; color:#6f6c6c;} -.img_problem{ background:url(../images/img_project.png) 0 -20px no-repeat;} -.img_talk{ background:url(../images/img_project.png) 0 -62px no-repeat;} -.img_ziyuan{ background:url(../images/img_project.png) 0 -115px no-repeat;} -.img_edition{ background:url(../images/img_project.png) 0 -167px no-repeat;} +.img_problem{ background:url(../images/new_project/img_project.png) 0 -20px no-repeat;} +.img_talk{ background:url(../images/new_project/img_project.png) 0 -62px no-repeat;} +.img_ziyuan{ background:url(../images/new_project/img_project.png) 0 -115px no-repeat;} +.img_edition{ background:url(../images/new_project/img_project.png) 0 -167px no-repeat;} .project_name{ color:#058c42;} .project_name:hover{ color:#016f33;} .project_txt{ color:#0781b4; width:445px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} diff --git a/public/stylesheets/leftside.css b/public/stylesheets/leftside.css index 4c2a1ef0f..12d0f2c4f 100644 --- a/public/stylesheets/leftside.css +++ b/public/stylesheets/leftside.css @@ -14,7 +14,7 @@ .pr_info_score{ font-size:14px; color:#3e4040; } .pr_info_score a{ color:#ff7143;} .pr_info_score a:hover{ color:#64bdd9;} -.img_private{ background:url(../images/img_project.png) 0 0 no-repeat; width:32px; height:16px; color:#fff; font-size:12px; padding-left:7px; } +.img_private{ background:url(../images/new_project/img_project.png) 0 0 no-repeat; width:32px; height:16px; color:#fff; font-size:12px; padding-left:7px; } .info_foot_num{ color:#3ca5c6; } .pr_info_foot{ color:#7f7f7f; margin-top:5px; } .info_foot_num:hover{ color:#2390b2;} From 4c482e1facdd0ada4cd69a3d10911e975815e0f7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 17 Mar 2015 16:19:31 +0800 Subject: [PATCH 005/175] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8F=8D=E9=A6=88=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_new_feedback.html.erb | 33 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index ec113d413..4f7e650eb 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -1,27 +1,38 @@ <%= javascript_include_tag "feedback" %> +
    -
    - -
    - 提  交 + <% get_memo %> + <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> + <%= f.text_area :subject, :class => "opnionText", :placeholder => l(:label_feedback_tips) %> + <%= f.hidden_field :content, :required => true , :value => l(:label_feedback_value) %> + + <%= l(:label_submit)%> + + <% end %>
    -
    在线客服
    -
    \ No newline at end of file + From 4d60a6dabcab093f8c5fae6ca08de1912d61ef97 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 17 Mar 2015 17:04:18 +0800 Subject: [PATCH 006/175] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E7=89=88?= =?UTF-8?q?=E6=9D=83=202=E3=80=81=E5=A2=9E=E5=8A=A0footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_footer.html.erb | 24 +++++++++++++++----- app/views/layouts/_new_footer.html.erb | 29 +++++++++++++++++++++++++ app/views/layouts/base_courses.html.erb | 2 ++ config/locales/contacts/zh.yml | 2 +- 4 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 app/views/layouts/_new_footer.html.erb diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index 0c7cca7d5..322fae0e3 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -22,14 +22,26 @@

    diff --git a/app/views/layouts/_new_footer.html.erb b/app/views/layouts/_new_footer.html.erb new file mode 100644 index 000000000..06f8c61e3 --- /dev/null +++ b/app/views/layouts/_new_footer.html.erb @@ -0,0 +1,29 @@ + +
    \ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index af03ba9ca..84e0e288d 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -24,6 +24,8 @@
    <%= render :partial => 'layouts/new_header' %> + <%= render :partial => 'layouts/new_footer' %> + diff --git a/app/views/tags/_new_tag_name.html.erb b/app/views/tags/_new_tag_name.html.erb index a1fb3fa46..6d8d58adb 100644 --- a/app/views/tags/_new_tag_name.html.erb +++ b/app/views/tags/_new_tag_name.html.erb @@ -9,9 +9,21 @@ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %> - <%= link_to('x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag) if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %> + <%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %> <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> + +<% if User.current.logged?%> + <%= l(:label_add_tag)%> + +<% end%> \ No newline at end of file diff --git a/app/views/tags/remove_tag.js.erb b/app/views/tags/remove_tag.js.erb index dbad80f96..b102776d5 100644 --- a/app/views/tags/remove_tag.js.erb +++ b/app/views/tags/remove_tag.js.erb @@ -6,8 +6,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false, :object_flag => @object_flag}) %>'); -<% else %> +<% elsif @object_flag == '9'%> + $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% else%> $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); - <% end %> \ No newline at end of file From 3bd0bf3c4962f3bc6857f7c667ee4a5988403a58 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 19 Mar 2015 16:20:32 +0800 Subject: [PATCH 027/175] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E6=A0=87?= =?UTF-8?q?=E7=AD=BEurl=E4=BF=AE=E6=94=B9=202=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=98=AFjs=E9=A1=B5=E9=9D=A2=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_new_tag_name.html.erb | 2 +- app/views/tags/tag_save.js.erb | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/views/tags/_new_tag_name.html.erb b/app/views/tags/_new_tag_name.html.erb index 6d8d58adb..3e8c2c021 100644 --- a/app/views/tags/_new_tag_name.html.erb +++ b/app/views/tags/_new_tag_name.html.erb @@ -19,7 +19,7 @@ <% if User.current.logged?%> <%= l(:label_add_tag)%>
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()), + title = titleBox.val(); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if (K.trim(title) === '') { + title = url; + } + clickFn.call(self, url, title); + } + } + }), + div = dialog.div; + + var urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + titleBox = K('[name="title"]', div); + + if (allowFileUpload) { + var uploadbutton = K.uploadbutton({ + button : K('.ke-upload-button', div)[0], + fieldName : filePostName, + url : K.addParam(uploadJson, 'dir=file'), + extraParams : extraParams, + afterUpload : function(data) { + dialog.hideLoading(); + if (data.error === 0) { + var url = data.url; + if (formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if (self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError : function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + if (allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType : 'LIST', + dirName : 'file', + clickFn : function(url, title) { + if (self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if (self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + urlBox.val(fileUrl); + titleBox.val(fileTitle); + urlBox[0].focus(); + urlBox[0].select(); + }; + self.clickToolbar(name, function() { + self.plugin.fileDialog({ + clickFn : function(url, title) { + var html = '' + title + ''; + self.insertHtml(html).hideDialog().focus(); + } + }); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/lineheight/lineheight.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/lineheight/lineheight.js new file mode 100644 index 000000000..ae679d788 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/lineheight/lineheight.js @@ -0,0 +1,38 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('lineheight', function(K) { + var self = this, name = 'lineheight', lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'}); + if (commonNode) { + curVal = commonNode.css('line-height'); + } + var menu = self.createMenu({ + name : name, + width : 150 + }); + K.each(lang.lineHeight, function(i, row) { + K.each(row, function(key, val) { + menu.addItem({ + title : val, + checked : curVal === key, + click : function() { + self.cmd.toggle('', { + span : '.line-height=' + key + }); + self.updateState(); + self.addBookmark(); + self.hideMenu(); + } + }); + }); + }); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/link/link.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/link/link.js new file mode 100644 index 000000000..352fa3c64 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/link/link.js @@ -0,0 +1,66 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('link', function(K) { + var self = this, name = 'link'; + self.plugin.link = { + edit : function() { + var lang = self.lang(name + '.'), + html = '
    ' + + //url + '
    ' + + '' + + '
    ' + + //type + '
    ' + + '' + + '' + + '
    ' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + self.exec('createlink', url, typeBox.val()).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('input[name="url"]', div), + typeBox = K('select[name="type"]', div); + urlBox.val('http://'); + typeBox[0].options[0] = new Option(lang.newWindow, '_blank'); + typeBox[0].options[1] = new Option(lang.selfWindow, ''); + self.cmd.selection(); + var a = self.plugin.getSelectedLink(); + if (a) { + self.cmd.range.selectNode(a[0]); + self.cmd.select(); + urlBox.val(a.attr('data-ke-src')); + typeBox.val(a.attr('target')); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete' : function() { + self.exec('unlink', null); + } + }; + self.clickToolbar(name, self.plugin.link.edit); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/map/map.html b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/map/map.html new file mode 100644 index 000000000..1a9ad7d7b --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/map/map.html @@ -0,0 +1,57 @@ + + + + + + + + + +
    + + \ No newline at end of file diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/map/map.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/map/map.js new file mode 100644 index 000000000..529087525 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/map/map.js @@ -0,0 +1,137 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +// Google Maps: http://code.google.com/apis/maps/index.html + +KindEditor.plugin('map', function(K) { + var self = this, name = 'map', lang = self.lang(name + '.'); + self.clickToolbar(name, function() { + var html = ['
    ', + '
    ', + lang.address + ' ', + '', + '', + '', + '
    ', + '
    ', + '
    '].join(''); + var dialog = self.createDialog({ + name : name, + width : 600, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var geocoder = win.geocoder, + map = win.map, + center = map.getCenter().lat() + ',' + map.getCenter().lng(), + zoom = map.getZoom(), + maptype = map.getMapTypeId(), + url = 'http://maps.googleapis.com/maps/api/staticmap'; + url += '?center=' + encodeURIComponent(center); + url += '&zoom=' + encodeURIComponent(zoom); + url += '&size=558x360'; + url += '&maptype=' + encodeURIComponent(maptype); + url += '&markers=' + encodeURIComponent(center); + url += '&language=' + self.langType; + url += '&sensor=false'; + self.exec('insertimage', url).hideDialog().focus(); + } + }, + beforeRemove : function() { + searchBtn.remove(); + if (doc) { + doc.write(''); + } + iframe.remove(); + } + }); + var div = dialog.div, + addressBox = K('[name="address"]', div), + searchBtn = K('[name="searchBtn"]', div), + win, doc; + var iframeHtml = ['', + '', + '', + '', + '', + '', + '', + '
    ', + ''].join('\n'); + // TODO:用doc.write(iframeHtml)方式加载时,在IE6上第一次加载报错,暂时使用src方式 + var iframe = K(''); + function ready() { + win = iframe[0].contentWindow; + doc = K.iframeDoc(iframe); + //doc.open(); + //doc.write(iframeHtml); + //doc.close(); + } + iframe.bind('load', function() { + iframe.unbind('load'); + if (K.IE) { + ready(); + } else { + setTimeout(ready, 0); + } + }); + K('.ke-map', div).replaceWith(iframe); + // search map + searchBtn.click(function() { + win.search(addressBox.val()); + }); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/media/media.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/media/media.js new file mode 100644 index 000000000..58034662a --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/media/media.js @@ -0,0 +1,170 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('media', function(K) { + var self = this, name = 'media', lang = self.lang(name + '.'), + allowMediaUpload = K.undef(self.allowMediaUpload, true), + allowFileManager = K.undef(self.allowFileManager, false), + formatUploadUrl = K.undef(self.formatUploadUrl, true), + extraParams = K.undef(self.extraFileUploadParams, {}), + filePostName = K.undef(self.filePostName, 'imgFile'), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'); + self.plugin.media = { + edit : function() { + var html = [ + '
    ', + //url + '
    ', + '', + '  ', + '  ', + '', + '', + '', + '
    ', + //width + '
    ', + '', + '', + '
    ', + //height + '
    ', + '', + '', + '
    ', + //autostart + '
    ', + '', + ' ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 450, + height : 230, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var url = K.trim(urlBox.val()), + width = widthBox.val(), + height = heightBox.val(); + if (url == 'http://' || K.invalidUrl(url)) { + alert(self.lang('invalidUrl')); + urlBox[0].focus(); + return; + } + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + var html = K.mediaImg(self.themesPath + 'common/blank.gif', { + src : url, + type : K.mediaType(url), + width : width, + height : height, + autostart : autostartBox[0].checked ? 'true' : 'false', + loop : 'true' + }); + self.insertHtml(html).hideDialog().focus(); + } + } + }), + div = dialog.div, + urlBox = K('[name="url"]', div), + viewServerBtn = K('[name="viewServer"]', div), + widthBox = K('[name="width"]', div), + heightBox = K('[name="height"]', div), + autostartBox = K('[name="autostart"]', div); + urlBox.val('http://'); + + if (allowMediaUpload) { + var uploadbutton = K.uploadbutton({ + button : K('.ke-upload-button', div)[0], + fieldName : filePostName, + extraParams : extraParams, + url : K.addParam(uploadJson, 'dir=media'), + afterUpload : function(data) { + dialog.hideLoading(); + if (data.error === 0) { + var url = data.url; + if (formatUploadUrl) { + url = K.formatUrl(url, 'absolute'); + } + urlBox.val(url); + if (self.afterUpload) { + self.afterUpload.call(self, url, data, name); + } + alert(self.lang('uploadSuccess')); + } else { + alert(data.message); + } + }, + afterError : function(html) { + dialog.hideLoading(); + self.errorDialog(html); + } + }); + uploadbutton.fileBox.change(function(e) { + dialog.showLoading(self.lang('uploadLoading')); + uploadbutton.submit(); + }); + } else { + K('.ke-upload-button', div).hide(); + } + + if (allowFileManager) { + viewServerBtn.click(function(e) { + self.loadPlugin('filemanager', function() { + self.plugin.filemanagerDialog({ + viewType : 'LIST', + dirName : 'media', + clickFn : function(url, title) { + if (self.dialogs.length > 1) { + K('[name="url"]', div).val(url); + if (self.afterSelectFile) { + self.afterSelectFile.call(self, url); + } + self.hideDialog(); + } + } + }); + }); + }); + } else { + viewServerBtn.hide(); + } + + var img = self.plugin.getSelectedMedia(); + if (img) { + var attrs = K.mediaAttrs(img.attr('data-ke-tag')); + urlBox.val(attrs.src); + widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0); + heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0); + autostartBox[0].checked = (attrs.autostart === 'true'); + } + urlBox[0].focus(); + urlBox[0].select(); + }, + 'delete' : function() { + self.plugin.getSelectedMedia().remove(); + // [IE] 删除图片后立即点击图片按钮出错 + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.media.edit); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/image.png b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/image.png new file mode 100644 index 0000000000000000000000000000000000000000..fe79cf0ad566d774635ae23fcd10722361d4b56d GIT binary patch literal 1862 zcmc(f`#aMM9LMK=7m`llBuQEGxF#wI8y0iig)z6yEs@eC)1J_|U(_~CZeK2J9jtC{CU-FN+GxpbW7t+8 zp=pQMM9ZYT3Z(&Yv=?`2HQ46t)ari!Du7VY6H#5^Sq|W+T_KgZPSk^l;=<6v4h)6j z`=~9rARYGTAmBlvS5cf#PAe+A!8CWzKPwTHneIWZaw5?@$s~s?EFwGTCOO(JrOr0h zAAYyWg7DNSF3vuVWI;e%$9vl1f?<(`#@I45e3%*5!#wQXwQ%1n;f@9vieW&G0S05@ zA8m|=TOytHy@`6>2m>z*h*J>62?n-DoU^%J>usrbI7%YU$=(@sIK%&^2GN)0gKvYCHIxxgf%_<}c9TO21hE+q{RMXeh zHB5`9je0mRX!Uk996+Y?FcPkq3KhX6;CnhH9XMtLusWYn^@08bdd+Q{K ztqHD2MwL}=35t2;%y&v%Nr-&8ppc-iyM2tlrunqwey#k-zYY?&!)_}ol4v788;S= zsqvo6$)w@E-37LT#Tg_be=e+OKG@MHt8C=yL&xbS6w$=kbj6% z!DGzXd;^@eT9*13m5w>t?fO0j3Hqo&Ve(Wfn=EiZvHeWJkyD>z=?_|V(8Z-<74)>N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W z^E*CQx9(;7W$?>v-D?Qj#%pZdo2>dX<4v~iEmr-h@fKV62CM$Wc!RBbg;jrSyu#MK z&Z<8$UMChkE+}#VDH8MlrxyMI^G6o=YVifvzqDnnxDN8Ir*22&>caol!vE25cDAn6 zs+E?jG*%sG*?|yI{YkY8+g%+3vBA09zf0Wx#9Z?3!DJ&8NJnuFX;pGvO7COxI->Vp z@m9khX+!J1bk+Sbe2a72{j#_LAL@OC<-`SX??ZxG>)nkb!c*ABkFfCLc%13x!yb4@?FNzZ-jC&v|vFo-a?N%_$JJfKJKiLm(Y*V{xdb$=OH9S zekP(g3rc6kEdl|VrGgAQH@wY7i$lh+!M5e@Ax#>yI +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + + +(function(K) { + +function KSWFUpload(options) { + this.init(options); +} +K.extend(KSWFUpload, { + init : function(options) { + var self = this; + options.afterError = options.afterError || function(str) { + alert(str); + }; + self.options = options; + self.progressbars = {}; + // template + self.div = K(options.container).html([ + '
    ', + '
    ', + '
    ', + '', + '
    ', + '
    ' + options.uploadDesc + '
    ', + '', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')); + self.bodyDiv = K('.ke-swfupload-body', self.div); + + function showError(itemDiv, msg) { + K('.ke-status > div', itemDiv).hide(); + K('.ke-message', itemDiv).addClass('ke-error').show().html(K.escape(msg)); + } + + var settings = { + debug : false, + upload_url : options.uploadUrl, + flash_url : options.flashUrl, + file_post_name : options.filePostName, + button_placeholder : K('.ke-swfupload-button > input', self.div)[0], + button_image_url: options.buttonImageUrl, + button_width: options.buttonWidth, + button_height: options.buttonHeight, + button_cursor : SWFUpload.CURSOR.HAND, + file_types : options.fileTypes, + file_types_description : options.fileTypesDesc, + file_upload_limit : options.fileUploadLimit, + file_size_limit : options.fileSizeLimit, + post_params : options.postParams, + file_queued_handler : function(file) { + file.url = self.options.fileIconUrl; + self.appendFile(file); + }, + file_queue_error_handler : function(file, errorCode, message) { + var errorName = ''; + switch (errorCode) { + case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED: + errorName = options.queueLimitExceeded; + break; + case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: + errorName = options.fileExceedsSizeLimit; + break; + case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE: + errorName = options.zeroByteFile; + break; + case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: + errorName = options.invalidFiletype; + break; + default: + errorName = options.unknownError; + break; + } + K.DEBUG && alert(errorName); + }, + upload_start_handler : function(file) { + var self = this; + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv); + K('.ke-status > div', itemDiv).hide(); + K('.ke-progressbar', itemDiv).show(); + }, + upload_progress_handler : function(file, bytesLoaded, bytesTotal) { + var percent = Math.round(bytesLoaded * 100 / bytesTotal); + var progressbar = self.progressbars[file.id]; + progressbar.bar.css('width', Math.round(percent * 80 / 100) + 'px'); + progressbar.percent.html(percent + '%'); + }, + upload_error_handler : function(file, errorCode, message) { + if (file && file.filestatus == SWFUpload.FILE_STATUS.ERROR) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + showError(itemDiv, self.options.errorMessage); + } + }, + upload_success_handler : function(file, serverData) { + var itemDiv = K('div[data-id="' + file.id + '"]', self.bodyDiv).eq(0); + var data = {}; + try { + data = K.json(serverData); + } catch (e) { + self.options.afterError.call(this, '' + serverData + ''); + } + if (data.error !== 0) { + showError(itemDiv, K.DEBUG ? data.message : self.options.errorMessage); + return; + } + file.url = data.url; + K('.ke-img', itemDiv).attr('src', file.url).attr('data-status', file.filestatus).data('data', data); + K('.ke-status > div', itemDiv).hide(); + } + }; + self.swfu = new SWFUpload(settings); + + K('.ke-swfupload-startupload input', self.div).click(function() { + self.swfu.startUpload(); + }); + }, + getUrlList : function() { + var list = []; + K('.ke-img', self.bodyDiv).each(function() { + var img = K(this); + var status = img.attr('data-status'); + if (status == SWFUpload.FILE_STATUS.COMPLETE) { + list.push(img.data('data')); + } + }); + return list; + }, + removeFile : function(fileId) { + var self = this; + self.swfu.cancelUpload(fileId); + var itemDiv = K('div[data-id="' + fileId + '"]', self.bodyDiv); + K('.ke-photo', itemDiv).unbind(); + K('.ke-delete', itemDiv).unbind(); + itemDiv.remove(); + }, + removeFiles : function() { + var self = this; + K('.ke-item', self.bodyDiv).each(function() { + self.removeFile(K(this).attr('data-id')); + }); + }, + appendFile : function(file) { + var self = this; + var itemDiv = K('
    '); + self.bodyDiv.append(itemDiv); + var photoDiv = K('
    ') + .mouseover(function(e) { + K(this).addClass('ke-on'); + }) + .mouseout(function(e) { + K(this).removeClass('ke-on'); + }); + itemDiv.append(photoDiv); + + var img = K('' + file.name + ''); + photoDiv.append(img); + K('').appendTo(photoDiv).click(function() { + self.removeFile(file.id); + }); + var statusDiv = K('
    ').appendTo(photoDiv); + // progressbar + K(['
    ', + '
    ', + '
    0%
    '].join('')).hide().appendTo(statusDiv); + // message + K('
    ' + self.options.pendingMessage + '
    ').appendTo(statusDiv); + + itemDiv.append('
    ' + file.name + '
    '); + + self.progressbars[file.id] = { + bar : K('.ke-progressbar-bar-inner', photoDiv), + percent : K('.ke-progressbar-percent', photoDiv) + }; + }, + remove : function() { + this.removeFiles(); + this.swfu.destroy(); + this.div.html(''); + } +}); + +K.swfupload = function(element, options) { + return new KSWFUpload(element, options); +}; + +})(KindEditor); + +KindEditor.plugin('multiimage', function(K) { + var self = this, name = 'multiimage', + formatUploadUrl = K.undef(self.formatUploadUrl, true), + uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'), + imgPath = self.pluginsPath + 'multiimage/images/', + imageSizeLimit = K.undef(self.imageSizeLimit, '1MB'), + imageFileTypes = K.undef(self.imageFileTypes, '*.jpg;*.gif;*.png'), + imageUploadLimit = K.undef(self.imageUploadLimit, 20), + filePostName = K.undef(self.filePostName, 'imgFile'), + lang = self.lang(name + '.'); + + self.plugin.multiImageDialog = function(options) { + var clickFn = options.clickFn, + uploadDesc = K.tmpl(lang.uploadDesc, {uploadLimit : imageUploadLimit, sizeLimit : imageSizeLimit}); + var html = [ + '
    ', + '
    ', + '
    ', + '
    ' + ].join(''); + var dialog = self.createDialog({ + name : name, + width : 650, + height : 510, + title : self.lang(name), + body : html, + previewBtn : { + name : lang.insertAll, + click : function(e) { + clickFn.call(self, swfupload.getUrlList()); + } + }, + yesBtn : { + name : lang.clearAll, + click : function(e) { + swfupload.removeFiles(); + } + }, + beforeRemove : function() { + // IE9 bugfix: https://github.com/kindsoft/kindeditor/issues/72 + if (!K.IE || K.V <= 8) { + swfupload.remove(); + } + } + }), + div = dialog.div; + + var swfupload = K.swfupload({ + container : K('.swfupload', div), + buttonImageUrl : imgPath + (self.langType == 'zh_CN' ? 'select-files-zh_CN.png' : 'select-files-en.png'), + buttonWidth : self.langType == 'zh_CN' ? 72 : 88, + buttonHeight : 23, + fileIconUrl : imgPath + 'image.png', + uploadDesc : uploadDesc, + startButtonValue : lang.startUpload, + uploadUrl : K.addParam(uploadJson, 'dir=image'), + flashUrl : imgPath + 'swfupload.swf', + filePostName : filePostName, + fileTypes : '*.jpg;*.jpeg;*.gif;*.png;*.bmp', + fileTypesDesc : 'Image Files', + fileUploadLimit : imageUploadLimit, + fileSizeLimit : imageSizeLimit, + postParams : K.undef(self.extraFileUploadParams, {}), + queueLimitExceeded : lang.queueLimitExceeded, + fileExceedsSizeLimit : lang.fileExceedsSizeLimit, + zeroByteFile : lang.zeroByteFile, + invalidFiletype : lang.invalidFiletype, + unknownError : lang.unknownError, + pendingMessage : lang.pending, + errorMessage : lang.uploadError, + afterError : function(html) { + self.errorDialog(html); + } + }); + + return dialog; + }; + self.clickToolbar(name, function() { + self.plugin.multiImageDialog({ + clickFn : function (urlList) { + if (urlList.length === 0) { + return; + } + K.each(urlList, function(i, data) { + if (self.afterUpload) { + self.afterUpload.call(self, data.url, data, 'multiimage'); + } + self.exec('insertimage', data.url, data.title, data.width, data.height, data.border, data.align); + }); + // Bugfix: [Firefox] 上传图片后,总是出现正在加载的样式,需要延迟执行hideDialog + setTimeout(function() { + self.hideDialog().focus(); + }, 0); + } + }); + }); +}); + + +/** + * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com + * + * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/ + * + * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilz閚 and Mammon Media and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ + + +/* ******************* */ +/* Constructor & Init */ +/* ******************* */ + +(function() { + +window.SWFUpload = function (settings) { + this.initSWFUpload(settings); +}; + +SWFUpload.prototype.initSWFUpload = function (settings) { + try { + this.customSettings = {}; // A container where developers can place their own settings associated with this instance. + this.settings = settings; + this.eventQueue = []; + this.movieName = "KindEditor_SWFUpload_" + SWFUpload.movieCount++; + this.movieElement = null; + + + // Setup global control tracking + SWFUpload.instances[this.movieName] = this; + + // Load the settings. Load the Flash movie. + this.initSettings(); + this.loadFlash(); + this.displayDebugInfo(); + } catch (ex) { + delete SWFUpload.instances[this.movieName]; + throw ex; + } +}; + +/* *************** */ +/* Static Members */ +/* *************** */ +SWFUpload.instances = {}; +SWFUpload.movieCount = 0; +SWFUpload.version = "2.2.0 2009-03-25"; +SWFUpload.QUEUE_ERROR = { + QUEUE_LIMIT_EXCEEDED : -100, + FILE_EXCEEDS_SIZE_LIMIT : -110, + ZERO_BYTE_FILE : -120, + INVALID_FILETYPE : -130 +}; +SWFUpload.UPLOAD_ERROR = { + HTTP_ERROR : -200, + MISSING_UPLOAD_URL : -210, + IO_ERROR : -220, + SECURITY_ERROR : -230, + UPLOAD_LIMIT_EXCEEDED : -240, + UPLOAD_FAILED : -250, + SPECIFIED_FILE_ID_NOT_FOUND : -260, + FILE_VALIDATION_FAILED : -270, + FILE_CANCELLED : -280, + UPLOAD_STOPPED : -290 +}; +SWFUpload.FILE_STATUS = { + QUEUED : -1, + IN_PROGRESS : -2, + ERROR : -3, + COMPLETE : -4, + CANCELLED : -5 +}; +SWFUpload.BUTTON_ACTION = { + SELECT_FILE : -100, + SELECT_FILES : -110, + START_UPLOAD : -120 +}; +SWFUpload.CURSOR = { + ARROW : -1, + HAND : -2 +}; +SWFUpload.WINDOW_MODE = { + WINDOW : "window", + TRANSPARENT : "transparent", + OPAQUE : "opaque" +}; + +// Private: takes a URL, determines if it is relative and converts to an absolute URL +// using the current site. Only processes the URL if it can, otherwise returns the URL untouched +SWFUpload.completeURL = function(url) { + if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) { + return url; + } + + var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); + + var indexSlash = window.location.pathname.lastIndexOf("/"); + if (indexSlash <= 0) { + path = "/"; + } else { + path = window.location.pathname.substr(0, indexSlash) + "/"; + } + + return /*currentURL +*/ path + url; + +}; + + +/* ******************** */ +/* Instance Members */ +/* ******************** */ + +// Private: initSettings ensures that all the +// settings are set, getting a default value if one was not assigned. +SWFUpload.prototype.initSettings = function () { + this.ensureDefault = function (settingName, defaultValue) { + this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName]; + }; + + // Upload backend settings + this.ensureDefault("upload_url", ""); + this.ensureDefault("preserve_relative_urls", false); + this.ensureDefault("file_post_name", "Filedata"); + this.ensureDefault("post_params", {}); + this.ensureDefault("use_query_string", false); + this.ensureDefault("requeue_on_error", false); + this.ensureDefault("http_success", []); + this.ensureDefault("assume_success_timeout", 0); + + // File Settings + this.ensureDefault("file_types", "*.*"); + this.ensureDefault("file_types_description", "All Files"); + this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited" + this.ensureDefault("file_upload_limit", 0); + this.ensureDefault("file_queue_limit", 0); + + // Flash Settings + this.ensureDefault("flash_url", "swfupload.swf"); + this.ensureDefault("prevent_swf_caching", true); + + // Button Settings + this.ensureDefault("button_image_url", ""); + this.ensureDefault("button_width", 1); + this.ensureDefault("button_height", 1); + this.ensureDefault("button_text", ""); + this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;"); + this.ensureDefault("button_text_top_padding", 0); + this.ensureDefault("button_text_left_padding", 0); + this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES); + this.ensureDefault("button_disabled", false); + this.ensureDefault("button_placeholder_id", ""); + this.ensureDefault("button_placeholder", null); + this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW); + this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW); + + // Debug Settings + this.ensureDefault("debug", false); + this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API + + // Event Handlers + this.settings.return_upload_start_handler = this.returnUploadStart; + this.ensureDefault("swfupload_loaded_handler", null); + this.ensureDefault("file_dialog_start_handler", null); + this.ensureDefault("file_queued_handler", null); + this.ensureDefault("file_queue_error_handler", null); + this.ensureDefault("file_dialog_complete_handler", null); + + this.ensureDefault("upload_start_handler", null); + this.ensureDefault("upload_progress_handler", null); + this.ensureDefault("upload_error_handler", null); + this.ensureDefault("upload_success_handler", null); + this.ensureDefault("upload_complete_handler", null); + + this.ensureDefault("debug_handler", this.debugMessage); + + this.ensureDefault("custom_settings", {}); + + // Other settings + this.customSettings = this.settings.custom_settings; + + // Update the flash url if needed + if (!!this.settings.prevent_swf_caching) { + this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime(); + } + + if (!this.settings.preserve_relative_urls) { + //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it + this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); + this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url); + } + + delete this.ensureDefault; +}; + +// Private: loadFlash replaces the button_placeholder element with the flash movie. +SWFUpload.prototype.loadFlash = function () { + var targetElement, tempParent; + + // Make sure an element with the ID we are going to use doesn't already exist + if (document.getElementById(this.movieName) !== null) { + throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"; + } + + // Get the element where we will be placing the flash movie + targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder; + + if (targetElement == undefined) { + throw "Could not find the placeholder element: " + this.settings.button_placeholder_id; + } + + // Append the container and load the flash + tempParent = document.createElement("div"); + tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers) + targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement); + + // Fix IE Flash/Form bug + if (window[this.movieName] == undefined) { + window[this.movieName] = this.getMovieElement(); + } + +}; + +// Private: getFlashHTML generates the object tag needed to embed the flash in to the document +SWFUpload.prototype.getFlashHTML = function () { + // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay + // Fix bug for IE9 + // http://www.kindsoft.net/view.php?bbsid=7&postid=5825&pagenum=1 + var classid = ''; + if (KindEditor.IE && KindEditor.V > 8) { + classid = ' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'; + } + return ['', + '', + '', + '', + '', + '', + '', + ''].join(""); +}; + +// Private: getFlashVars builds the parameter string that will be passed +// to flash in the flashvars param. +SWFUpload.prototype.getFlashVars = function () { + // Build a string from the post param object + var paramString = this.buildParamString(); + var httpSuccessString = this.settings.http_success.join(","); + + // Build the parameter string + return ["movieName=", encodeURIComponent(this.movieName), + "&uploadURL=", encodeURIComponent(this.settings.upload_url), + "&useQueryString=", encodeURIComponent(this.settings.use_query_string), + "&requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), + "&httpSuccess=", encodeURIComponent(httpSuccessString), + "&assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), + "&params=", encodeURIComponent(paramString), + "&filePostName=", encodeURIComponent(this.settings.file_post_name), + "&fileTypes=", encodeURIComponent(this.settings.file_types), + "&fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), + "&fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), + "&fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), + "&fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), + "&debugEnabled=", encodeURIComponent(this.settings.debug_enabled), + "&buttonImageURL=", encodeURIComponent(this.settings.button_image_url), + "&buttonWidth=", encodeURIComponent(this.settings.button_width), + "&buttonHeight=", encodeURIComponent(this.settings.button_height), + "&buttonText=", encodeURIComponent(this.settings.button_text), + "&buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), + "&buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), + "&buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), + "&buttonAction=", encodeURIComponent(this.settings.button_action), + "&buttonDisabled=", encodeURIComponent(this.settings.button_disabled), + "&buttonCursor=", encodeURIComponent(this.settings.button_cursor) + ].join(""); +}; + +// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload +// The element is cached after the first lookup +SWFUpload.prototype.getMovieElement = function () { + if (this.movieElement == undefined) { + this.movieElement = document.getElementById(this.movieName); + } + + if (this.movieElement === null) { + throw "Could not find Flash element"; + } + + return this.movieElement; +}; + +// Private: buildParamString takes the name/value pairs in the post_params setting object +// and joins them up in to a string formatted "name=value&name=value" +SWFUpload.prototype.buildParamString = function () { + var postParams = this.settings.post_params; + var paramStringPairs = []; + + if (typeof(postParams) === "object") { + for (var name in postParams) { + if (postParams.hasOwnProperty(name)) { + paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString())); + } + } + } + + return paramStringPairs.join("&"); +}; + +// Public: Used to remove a SWFUpload instance from the page. This method strives to remove +// all references to the SWF, and other objects so memory is properly freed. +// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state. +// Credits: Major improvements provided by steffen +SWFUpload.prototype.destroy = function () { + try { + // Make sure Flash is done before we try to remove it + this.cancelUpload(null, false); + + + // Remove the SWFUpload DOM nodes + var movieElement = null; + movieElement = this.getMovieElement(); + + if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE + // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround) + for (var i in movieElement) { + try { + if (typeof(movieElement[i]) === "function") { + movieElement[i] = null; + } + } catch (ex1) {} + } + + // Remove the Movie Element from the page + try { + movieElement.parentNode.removeChild(movieElement); + } catch (ex) {} + } + + // Remove IE form fix reference + window[this.movieName] = null; + + // Destroy other references + SWFUpload.instances[this.movieName] = null; + delete SWFUpload.instances[this.movieName]; + + this.movieElement = null; + this.settings = null; + this.customSettings = null; + this.eventQueue = null; + this.movieName = null; + + + return true; + } catch (ex2) { + return false; + } +}; + + +// Public: displayDebugInfo prints out settings and configuration +// information about this SWFUpload instance. +// This function (and any references to it) can be deleted when placing +// SWFUpload in production. +SWFUpload.prototype.displayDebugInfo = function () { + this.debug( + [ + "---SWFUpload Instance Info---\n", + "Version: ", SWFUpload.version, "\n", + "Movie Name: ", this.movieName, "\n", + "Settings:\n", + "\t", "upload_url: ", this.settings.upload_url, "\n", + "\t", "flash_url: ", this.settings.flash_url, "\n", + "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n", + "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n", + "\t", "http_success: ", this.settings.http_success.join(", "), "\n", + "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n", + "\t", "file_post_name: ", this.settings.file_post_name, "\n", + "\t", "post_params: ", this.settings.post_params.toString(), "\n", + "\t", "file_types: ", this.settings.file_types, "\n", + "\t", "file_types_description: ", this.settings.file_types_description, "\n", + "\t", "file_size_limit: ", this.settings.file_size_limit, "\n", + "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n", + "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n", + "\t", "debug: ", this.settings.debug.toString(), "\n", + + "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n", + + "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n", + "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n", + "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n", + "\t", "button_width: ", this.settings.button_width.toString(), "\n", + "\t", "button_height: ", this.settings.button_height.toString(), "\n", + "\t", "button_text: ", this.settings.button_text.toString(), "\n", + "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n", + "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n", + "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n", + "\t", "button_action: ", this.settings.button_action.toString(), "\n", + "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n", + + "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n", + "Event Handlers:\n", + "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n", + "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n", + "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n", + "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n", + "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n", + "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n", + "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n", + "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n", + "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n", + "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n" + ].join("") + ); +}; + +/* Note: addSetting and getSetting are no longer used by SWFUpload but are included + the maintain v2 API compatibility +*/ +// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used. +SWFUpload.prototype.addSetting = function (name, value, default_value) { + if (value == undefined) { + return (this.settings[name] = default_value); + } else { + return (this.settings[name] = value); + } +}; + +// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found. +SWFUpload.prototype.getSetting = function (name) { + if (this.settings[name] != undefined) { + return this.settings[name]; + } + + return ""; +}; + + + +// Private: callFlash handles function calls made to the Flash element. +// Calls are made with a setTimeout for some functions to work around +// bugs in the ExternalInterface library. +SWFUpload.prototype.callFlash = function (functionName, argumentArray) { + argumentArray = argumentArray || []; + + var movieElement = this.getMovieElement(); + var returnValue, returnString; + + // Flash's method if calling ExternalInterface methods (code adapted from MooTools). + try { + returnString = movieElement.CallFunction('' + __flash__argumentsToXML(argumentArray, 0) + ''); + returnValue = eval(returnString); + } catch (ex) { + throw "Call to " + functionName + " failed"; + } + + // Unescape file post param values + if (returnValue != undefined && typeof returnValue.post === "object") { + returnValue = this.unescapeFilePostParams(returnValue); + } + + return returnValue; +}; + +/* ***************************** + -- Flash control methods -- + Your UI should use these + to operate SWFUpload + ***************************** */ + +// WARNING: this function does not work in Flash Player 10 +// Public: selectFile causes a File Selection Dialog window to appear. This +// dialog only allows 1 file to be selected. +SWFUpload.prototype.selectFile = function () { + this.callFlash("SelectFile"); +}; + +// WARNING: this function does not work in Flash Player 10 +// Public: selectFiles causes a File Selection Dialog window to appear/ This +// dialog allows the user to select any number of files +// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names. +// If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around +// for this bug. +SWFUpload.prototype.selectFiles = function () { + this.callFlash("SelectFiles"); +}; + + +// Public: startUpload starts uploading the first file in the queue unless +// the optional parameter 'fileID' specifies the ID +SWFUpload.prototype.startUpload = function (fileID) { + this.callFlash("StartUpload", [fileID]); +}; + +// Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index. +// If you do not specify a fileID the current uploading file or first file in the queue is cancelled. +// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter. +SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) { + if (triggerErrorEvent !== false) { + triggerErrorEvent = true; + } + this.callFlash("CancelUpload", [fileID, triggerErrorEvent]); +}; + +// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue. +// If nothing is currently uploading then nothing happens. +SWFUpload.prototype.stopUpload = function () { + this.callFlash("StopUpload"); +}; + +/* ************************ + * Settings methods + * These methods change the SWFUpload settings. + * SWFUpload settings should not be changed directly on the settings object + * since many of the settings need to be passed to Flash in order to take + * effect. + * *********************** */ + +// Public: getStats gets the file statistics object. +SWFUpload.prototype.getStats = function () { + return this.callFlash("GetStats"); +}; + +// Public: setStats changes the SWFUpload statistics. You shouldn't need to +// change the statistics but you can. Changing the statistics does not +// affect SWFUpload accept for the successful_uploads count which is used +// by the upload_limit setting to determine how many files the user may upload. +SWFUpload.prototype.setStats = function (statsObject) { + this.callFlash("SetStats", [statsObject]); +}; + +// Public: getFile retrieves a File object by ID or Index. If the file is +// not found then 'null' is returned. +SWFUpload.prototype.getFile = function (fileID) { + if (typeof(fileID) === "number") { + return this.callFlash("GetFileByIndex", [fileID]); + } else { + return this.callFlash("GetFile", [fileID]); + } +}; + +// Public: addFileParam sets a name/value pair that will be posted with the +// file specified by the Files ID. If the name already exists then the +// exiting value will be overwritten. +SWFUpload.prototype.addFileParam = function (fileID, name, value) { + return this.callFlash("AddFileParam", [fileID, name, value]); +}; + +// Public: removeFileParam removes a previously set (by addFileParam) name/value +// pair from the specified file. +SWFUpload.prototype.removeFileParam = function (fileID, name) { + this.callFlash("RemoveFileParam", [fileID, name]); +}; + +// Public: setUploadUrl changes the upload_url setting. +SWFUpload.prototype.setUploadURL = function (url) { + this.settings.upload_url = url.toString(); + this.callFlash("SetUploadURL", [url]); +}; + +// Public: setPostParams changes the post_params setting +SWFUpload.prototype.setPostParams = function (paramsObject) { + this.settings.post_params = paramsObject; + this.callFlash("SetPostParams", [paramsObject]); +}; + +// Public: addPostParam adds post name/value pair. Each name can have only one value. +SWFUpload.prototype.addPostParam = function (name, value) { + this.settings.post_params[name] = value; + this.callFlash("SetPostParams", [this.settings.post_params]); +}; + +// Public: removePostParam deletes post name/value pair. +SWFUpload.prototype.removePostParam = function (name) { + delete this.settings.post_params[name]; + this.callFlash("SetPostParams", [this.settings.post_params]); +}; + +// Public: setFileTypes changes the file_types setting and the file_types_description setting +SWFUpload.prototype.setFileTypes = function (types, description) { + this.settings.file_types = types; + this.settings.file_types_description = description; + this.callFlash("SetFileTypes", [types, description]); +}; + +// Public: setFileSizeLimit changes the file_size_limit setting +SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) { + this.settings.file_size_limit = fileSizeLimit; + this.callFlash("SetFileSizeLimit", [fileSizeLimit]); +}; + +// Public: setFileUploadLimit changes the file_upload_limit setting +SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) { + this.settings.file_upload_limit = fileUploadLimit; + this.callFlash("SetFileUploadLimit", [fileUploadLimit]); +}; + +// Public: setFileQueueLimit changes the file_queue_limit setting +SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) { + this.settings.file_queue_limit = fileQueueLimit; + this.callFlash("SetFileQueueLimit", [fileQueueLimit]); +}; + +// Public: setFilePostName changes the file_post_name setting +SWFUpload.prototype.setFilePostName = function (filePostName) { + this.settings.file_post_name = filePostName; + this.callFlash("SetFilePostName", [filePostName]); +}; + +// Public: setUseQueryString changes the use_query_string setting +SWFUpload.prototype.setUseQueryString = function (useQueryString) { + this.settings.use_query_string = useQueryString; + this.callFlash("SetUseQueryString", [useQueryString]); +}; + +// Public: setRequeueOnError changes the requeue_on_error setting +SWFUpload.prototype.setRequeueOnError = function (requeueOnError) { + this.settings.requeue_on_error = requeueOnError; + this.callFlash("SetRequeueOnError", [requeueOnError]); +}; + +// Public: setHTTPSuccess changes the http_success setting +SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) { + if (typeof http_status_codes === "string") { + http_status_codes = http_status_codes.replace(" ", "").split(","); + } + + this.settings.http_success = http_status_codes; + this.callFlash("SetHTTPSuccess", [http_status_codes]); +}; + +// Public: setHTTPSuccess changes the http_success setting +SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) { + this.settings.assume_success_timeout = timeout_seconds; + this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]); +}; + +// Public: setDebugEnabled changes the debug_enabled setting +SWFUpload.prototype.setDebugEnabled = function (debugEnabled) { + this.settings.debug_enabled = debugEnabled; + this.callFlash("SetDebugEnabled", [debugEnabled]); +}; + +// Public: setButtonImageURL loads a button image sprite +SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) { + if (buttonImageURL == undefined) { + buttonImageURL = ""; + } + + this.settings.button_image_url = buttonImageURL; + this.callFlash("SetButtonImageURL", [buttonImageURL]); +}; + +// Public: setButtonDimensions resizes the Flash Movie and button +SWFUpload.prototype.setButtonDimensions = function (width, height) { + this.settings.button_width = width; + this.settings.button_height = height; + + var movie = this.getMovieElement(); + if (movie != undefined) { + movie.style.width = width + "px"; + movie.style.height = height + "px"; + } + + this.callFlash("SetButtonDimensions", [width, height]); +}; +// Public: setButtonText Changes the text overlaid on the button +SWFUpload.prototype.setButtonText = function (html) { + this.settings.button_text = html; + this.callFlash("SetButtonText", [html]); +}; +// Public: setButtonTextPadding changes the top and left padding of the text overlay +SWFUpload.prototype.setButtonTextPadding = function (left, top) { + this.settings.button_text_top_padding = top; + this.settings.button_text_left_padding = left; + this.callFlash("SetButtonTextPadding", [left, top]); +}; + +// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button +SWFUpload.prototype.setButtonTextStyle = function (css) { + this.settings.button_text_style = css; + this.callFlash("SetButtonTextStyle", [css]); +}; +// Public: setButtonDisabled disables/enables the button +SWFUpload.prototype.setButtonDisabled = function (isDisabled) { + this.settings.button_disabled = isDisabled; + this.callFlash("SetButtonDisabled", [isDisabled]); +}; +// Public: setButtonAction sets the action that occurs when the button is clicked +SWFUpload.prototype.setButtonAction = function (buttonAction) { + this.settings.button_action = buttonAction; + this.callFlash("SetButtonAction", [buttonAction]); +}; + +// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button +SWFUpload.prototype.setButtonCursor = function (cursor) { + this.settings.button_cursor = cursor; + this.callFlash("SetButtonCursor", [cursor]); +}; + +/* ******************************* + Flash Event Interfaces + These functions are used by Flash to trigger the various + events. + + All these functions a Private. + + Because the ExternalInterface library is buggy the event calls + are added to a queue and the queue then executed by a setTimeout. + This ensures that events are executed in a determinate order and that + the ExternalInterface bugs are avoided. +******************************* */ + +SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + if (argumentArray == undefined) { + argumentArray = []; + } else if (!(argumentArray instanceof Array)) { + argumentArray = [argumentArray]; + } + + var self = this; + if (typeof this.settings[handlerName] === "function") { + // Queue the event + this.eventQueue.push(function () { + this.settings[handlerName].apply(this, argumentArray); + }); + + // Execute the next queued event + setTimeout(function () { + self.executeNextEvent(); + }, 0); + + } else if (this.settings[handlerName] !== null) { + throw "Event handler " + handlerName + " is unknown or is not a function"; + } +}; + +// Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout +// we must queue them in order to garentee that they are executed in order. +SWFUpload.prototype.executeNextEvent = function () { + // Warning: Don't call this.debug inside here or you'll create an infinite loop + + var f = this.eventQueue ? this.eventQueue.shift() : null; + if (typeof(f) === "function") { + f.apply(this); + } +}; + +// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have +// properties that contain characters that are not valid for JavaScript identifiers. To work around this +// the Flash Component escapes the parameter names and we must unescape again before passing them along. +SWFUpload.prototype.unescapeFilePostParams = function (file) { + var reg = /[$]([0-9a-f]{4})/i; + var unescapedPost = {}; + var uk; + + if (file != undefined) { + for (var k in file.post) { + if (file.post.hasOwnProperty(k)) { + uk = k; + var match; + while ((match = reg.exec(uk)) !== null) { + uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16))); + } + unescapedPost[uk] = file.post[k]; + } + } + + file.post = unescapedPost; + } + + return file; +}; + +// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working) +SWFUpload.prototype.testExternalInterface = function () { + try { + return this.callFlash("TestExternalInterface"); + } catch (ex) { + return false; + } +}; + +// Private: This event is called by Flash when it has finished loading. Don't modify this. +// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded. +SWFUpload.prototype.flashReady = function () { + // Check that the movie element is loaded correctly with its ExternalInterface methods defined + var movieElement = this.getMovieElement(); + + if (!movieElement) { + this.debug("Flash called back ready but the flash movie can't be found."); + return; + } + + this.cleanUp(movieElement); + + this.queueEvent("swfupload_loaded_handler"); +}; + +// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE. +// This function is called by Flash each time the ExternalInterface functions are created. +SWFUpload.prototype.cleanUp = function (movieElement) { + // Pro-actively unhook all the Flash functions + try { + if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE + this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)"); + for (var key in movieElement) { + try { + if (typeof(movieElement[key]) === "function") { + movieElement[key] = null; + } + } catch (ex) { + } + } + } + } catch (ex1) { + + } + + // Fix Flashes own cleanup code so if the SWFMovie was removed from the page + // it doesn't display errors. + window["__flash__removeCallback"] = function (instance, name) { + try { + if (instance) { + instance[name] = null; + } + } catch (flashEx) { + + } + }; + +}; + + +/* This is a chance to do something before the browse window opens */ +SWFUpload.prototype.fileDialogStart = function () { + this.queueEvent("file_dialog_start_handler"); +}; + + +/* Called when a file is successfully added to the queue. */ +SWFUpload.prototype.fileQueued = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queued_handler", file); +}; + + +/* Handle errors that occur when an attempt to queue a file fails. */ +SWFUpload.prototype.fileQueueError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("file_queue_error_handler", [file, errorCode, message]); +}; + +/* Called after the file dialog has closed and the selected files have been queued. + You could call startUpload here if you want the queued files to begin uploading immediately. */ +SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) { + this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]); +}; + +SWFUpload.prototype.uploadStart = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("return_upload_start_handler", file); +}; + +SWFUpload.prototype.returnUploadStart = function (file) { + var returnValue; + if (typeof this.settings.upload_start_handler === "function") { + file = this.unescapeFilePostParams(file); + returnValue = this.settings.upload_start_handler.call(this, file); + } else if (this.settings.upload_start_handler != undefined) { + throw "upload_start_handler must be a function"; + } + + // Convert undefined to true so if nothing is returned from the upload_start_handler it is + // interpretted as 'true'. + if (returnValue === undefined) { + returnValue = true; + } + + returnValue = !!returnValue; + + this.callFlash("ReturnUploadStart", [returnValue]); +}; + + + +SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]); +}; + +SWFUpload.prototype.uploadError = function (file, errorCode, message) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_error_handler", [file, errorCode, message]); +}; + +SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_success_handler", [file, serverData, responseReceived]); +}; + +SWFUpload.prototype.uploadComplete = function (file) { + file = this.unescapeFilePostParams(file); + this.queueEvent("upload_complete_handler", file); +}; + +/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the + internal debug console. You can override this event and have messages written where you want. */ +SWFUpload.prototype.debug = function (message) { + this.queueEvent("debug_handler", message); +}; + + +/* ********************************** + Debug Console + The debug console is a self contained, in page location + for debug message to be sent. The Debug Console adds + itself to the body if necessary. + + The console is automatically scrolled as messages appear. + + If you are using your own debug handler or when you deploy to production and + have debug disabled you can remove these functions to reduce the file size + and complexity. +********************************** */ + +// Private: debugMessage is the default debug_handler. If you want to print debug messages +// call the debug() function. When overriding the function your own function should +// check to see if the debug setting is true before outputting debug information. +SWFUpload.prototype.debugMessage = function (message) { + if (this.settings.debug) { + var exceptionMessage, exceptionValues = []; + + // Check for an exception object and print it nicely + if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") { + for (var key in message) { + if (message.hasOwnProperty(key)) { + exceptionValues.push(key + ": " + message[key]); + } + } + exceptionMessage = exceptionValues.join("\n") || ""; + exceptionValues = exceptionMessage.split("\n"); + exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: "); + SWFUpload.Console.writeLine(exceptionMessage); + } else { + SWFUpload.Console.writeLine(message); + } + } +}; + +SWFUpload.Console = {}; +SWFUpload.Console.writeLine = function (message) { + var console, documentForm; + + try { + console = document.getElementById("SWFUpload_Console"); + + if (!console) { + documentForm = document.createElement("form"); + document.getElementsByTagName("body")[0].appendChild(documentForm); + + console = document.createElement("textarea"); + console.id = "SWFUpload_Console"; + console.style.fontFamily = "monospace"; + console.setAttribute("wrap", "off"); + console.wrap = "off"; + console.style.overflow = "auto"; + console.style.width = "700px"; + console.style.height = "350px"; + console.style.margin = "5px"; + documentForm.appendChild(console); + } + + console.value += message + "\n"; + + console.scrollTop = console.scrollHeight - console.clientHeight; + } catch (ex) { + alert("Exception: " + ex.name + " Message: " + ex.message); + } +}; + +})(); + +(function() { +/* + Queue Plug-in + + Features: + *Adds a cancelQueue() method for cancelling the entire queue. + *All queued files are uploaded when startUpload() is called. + *If false is returned from uploadComplete then the queue upload is stopped. + If false is not returned (strict comparison) then the queue upload is continued. + *Adds a QueueComplete event that is fired when all the queued files have finished uploading. + Set the event handler with the queue_complete_handler setting. + + */ + +if (typeof(SWFUpload) === "function") { + SWFUpload.queue = {}; + + SWFUpload.prototype.initSettings = (function (oldInitSettings) { + return function () { + if (typeof(oldInitSettings) === "function") { + oldInitSettings.call(this); + } + + this.queueSettings = {}; + + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + + this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler; + this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler; + this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler; + this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler; + + this.settings.queue_complete_handler = this.settings.queue_complete_handler || null; + }; + })(SWFUpload.prototype.initSettings); + + SWFUpload.prototype.startUpload = function (fileID) { + this.queueSettings.queue_cancelled_flag = false; + this.callFlash("StartUpload", [fileID]); + }; + + SWFUpload.prototype.cancelQueue = function () { + this.queueSettings.queue_cancelled_flag = true; + this.stopUpload(); + + var stats = this.getStats(); + while (stats.files_queued > 0) { + this.cancelUpload(); + stats = this.getStats(); + } + }; + + SWFUpload.queue.uploadStartHandler = function (file) { + var returnValue; + if (typeof(this.queueSettings.user_upload_start_handler) === "function") { + returnValue = this.queueSettings.user_upload_start_handler.call(this, file); + } + + // To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value. + returnValue = (returnValue === false) ? false : true; + + this.queueSettings.queue_cancelled_flag = !returnValue; + + return returnValue; + }; + + SWFUpload.queue.uploadCompleteHandler = function (file) { + var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler; + var continueUpload; + + if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) { + this.queueSettings.queue_upload_count++; + } + + if (typeof(user_upload_complete_handler) === "function") { + continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true; + } else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) { + // If the file was stopped and re-queued don't restart the upload + continueUpload = false; + } else { + continueUpload = true; + } + + if (continueUpload) { + var stats = this.getStats(); + if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) { + this.startUpload(); + } else if (this.queueSettings.queue_cancelled_flag === false) { + this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]); + this.queueSettings.queue_upload_count = 0; + } else { + this.queueSettings.queue_cancelled_flag = false; + this.queueSettings.queue_upload_count = 0; + } + } + }; +} + +})(); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/pagebreak/pagebreak.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/pagebreak/pagebreak.js new file mode 100644 index 000000000..dfa883afc --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/pagebreak/pagebreak.js @@ -0,0 +1,27 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('pagebreak', function(K) { + var self = this; + var name = 'pagebreak'; + var pagebreakHtml = K.undef(self.pagebreakHtml, '
    '); + + self.clickToolbar(name, function() { + var cmd = self.cmd, range = cmd.range; + self.focus(); + var tail = self.newlineTag == 'br' || K.WEBKIT ? '' : ''; + self.insertHtml(pagebreakHtml + tail); + if (tail !== '') { + var p = K('#__kindeditor_tail_tag__', self.edit.doc); + range.selectNodeContents(p[0]); + p.removeAttr('id'); + cmd.select(); + } + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/plainpaste/plainpaste.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/plainpaste/plainpaste.js new file mode 100644 index 000000000..8f7bed803 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/plainpaste/plainpaste.js @@ -0,0 +1,41 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('plainpaste', function(K) { + var self = this, name = 'plainpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + lang.comment + '
    ' + + '' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var html = textarea.val(); + html = K.escape(html); + html = html.replace(/ {2}/g, '  '); + if (self.newlineTag == 'p') { + html = html.replace(/^/, '

    ').replace(/$/, '

    ').replace(/\n/g, '

    '); + } else { + html = html.replace(/\n/g, '
    $&'); + } + self.insertHtml(html).hideDialog().focus(); + } + } + }), + textarea = K('textarea', dialog.div); + textarea[0].focus(); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/preview/preview.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/preview/preview.js new file mode 100644 index 000000000..ef6e2cf16 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/preview/preview.js @@ -0,0 +1,31 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('preview', function(K) { + var self = this, name = 'preview', undefined; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '

    ' + + '' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 750, + title : self.lang(name), + body : html + }), + iframe = K('iframe', dialog.div), + doc = K.iframeDoc(iframe); + doc.open(); + doc.write(self.fullHtml()); + doc.close(); + K(doc.body).css('background-color', '#FFF'); + iframe[0].contentWindow.focus(); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/quickformat/quickformat.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/quickformat/quickformat.js new file mode 100644 index 000000000..5b98c7227 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/quickformat/quickformat.js @@ -0,0 +1,81 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('quickformat', function(K) { + var self = this, name = 'quickformat', + blockMap = K.toMap('blockquote,center,div,h1,h2,h3,h4,h5,h6,p'); + function getFirstChild(knode) { + var child = knode.first(); + while (child && child.first()) { + child = child.first(); + } + return child; + } + self.clickToolbar(name, function() { + self.focus(); + var doc = self.edit.doc, + range = self.cmd.range, + child = K(doc.body).first(), next, + nodeList = [], subList = [], + bookmark = range.createBookmark(true); + while(child) { + next = child.next(); + var firstChild = getFirstChild(child); + if (!firstChild || firstChild.name != 'img') { + if (blockMap[child.name]) { + child.html(child.html().replace(/^(\s| | )+/ig, '')); + child.css('text-indent', '2em'); + } else { + subList.push(child); + } + if (!next || (blockMap[next.name] || blockMap[child.name] && !blockMap[next.name])) { + if (subList.length > 0) { + nodeList.push(subList); + } + subList = []; + } + } + child = next; + } + K.each(nodeList, function(i, subList) { + var wrapper = K('

    ', doc); + subList[0].before(wrapper); + K.each(subList, function(i, knode) { + wrapper.append(knode); + }); + }); + range.moveToBookmark(bookmark); + self.addBookmark(); + }); +}); + +/** +-------------------------- +abcd
    +1234
    + +to + +

    + abcd
    + 1234
    +

    + +-------------------------- + +  abcd1233 +

    1234

    + +to + +

    abcd1233

    +

    1234

    + +-------------------------- +*/ \ No newline at end of file diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/table/table.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/table/table.js new file mode 100644 index 000000000..4033b6ae3 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/table/table.js @@ -0,0 +1,712 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('table', function(K) { + var self = this, name = 'table', lang = self.lang(name + '.'), zeroborder = 'ke-zeroborder'; + // 设置颜色 + function _setColor(box, color) { + color = color.toUpperCase(); + box.css('background-color', color); + box.css('color', color === '#000000' ? '#FFFFFF' : '#000000'); + box.html(color); + } + // 初始化取色器 + var pickerList = []; + function _initColorPicker(dialogDiv, colorBox) { + colorBox.bind('click,mousedown', function(e){ + e.stopPropagation(); + }); + function removePicker() { + K.each(pickerList, function() { + this.remove(); + }); + pickerList = []; + K(document).unbind('click,mousedown', removePicker); + dialogDiv.unbind('click,mousedown', removePicker); + } + colorBox.click(function(e) { + removePicker(); + var box = K(this), + pos = box.pos(); + var picker = K.colorpicker({ + x : pos.x, + y : pos.y + box.height(), + z : 811214, + selectedColor : K(this).html(), + colors : self.colorTable, + noColor : self.lang('noColor'), + shadowMode : self.shadowMode, + click : function(color) { + _setColor(box, color); + removePicker(); + } + }); + pickerList.push(picker); + K(document).bind('click,mousedown', removePicker); + dialogDiv.bind('click,mousedown', removePicker); + }); + } + // 取得下一行cell的index + function _getCellIndex(table, row, cell) { + var rowSpanCount = 0; + for (var i = 0, len = row.cells.length; i < len; i++) { + if (row.cells[i] == cell) { + break; + } + rowSpanCount += row.cells[i].rowSpan - 1; + } + return cell.cellIndex - rowSpanCount; + } + self.plugin.table = { + //insert or modify table + prop : function(isInsert) { + var html = [ + '
    ', + //rows, cols + '
    ', + '', + lang.rows + '   ', + lang.cols + ' ', + '
    ', + //width, height + '
    ', + '', + lang.width + '   ', + '   ', + lang.height + '   ', + '', + '
    ', + //space, padding + '
    ', + '', + lang.padding + '   ', + lang.spacing + ' ', + '
    ', + //align + '
    ', + '', + '', + '
    ', + //border + '
    ', + '', + lang.borderWidth + '   ', + lang.borderColor + ' ', + '
    ', + //background color + '
    ', + '', + '', + '
    ', + '
    ' + ].join(''); + var bookmark = self.cmd.range.createBookmark(); + var dialog = self.createDialog({ + name : name, + width : 500, + title : self.lang(name), + body : html, + beforeRemove : function() { + colorBox.unbind(); + }, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var rows = rowsBox.val(), + cols = colsBox.val(), + width = widthBox.val(), + height = heightBox.val(), + widthType = widthTypeBox.val(), + heightType = heightTypeBox.val(), + padding = paddingBox.val(), + spacing = spacingBox.val(), + align = alignBox.val(), + border = borderBox.val(), + borderColor = K(colorBox[0]).html() || '', + bgColor = K(colorBox[1]).html() || ''; + if (rows == 0 || !/^\d+$/.test(rows)) { + alert(self.lang('invalidRows')); + rowsBox[0].focus(); + return; + } + if (cols == 0 || !/^\d+$/.test(cols)) { + alert(self.lang('invalidRows')); + colsBox[0].focus(); + return; + } + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + if (!/^\d*$/.test(padding)) { + alert(self.lang('invalidPadding')); + paddingBox[0].focus(); + return; + } + if (!/^\d*$/.test(spacing)) { + alert(self.lang('invalidSpacing')); + spacingBox[0].focus(); + return; + } + if (!/^\d*$/.test(border)) { + alert(self.lang('invalidBorder')); + borderBox[0].focus(); + return; + } + //modify table + if (table) { + if (width !== '') { + table.width(width + widthType); + } else { + table.css('width', ''); + } + if (table[0].width !== undefined) { + table.removeAttr('width'); + } + if (height !== '') { + table.height(height + heightType); + } else { + table.css('height', ''); + } + if (table[0].height !== undefined) { + table.removeAttr('height'); + } + table.css('background-color', bgColor); + if (table[0].bgColor !== undefined) { + table.removeAttr('bgColor'); + } + if (padding !== '') { + table[0].cellPadding = padding; + } else { + table.removeAttr('cellPadding'); + } + if (spacing !== '') { + table[0].cellSpacing = spacing; + } else { + table.removeAttr('cellSpacing'); + } + if (align !== '') { + table[0].align = align; + } else { + table.removeAttr('align'); + } + if (border !== '') { + table.attr('border', border); + } else { + table.removeAttr('border'); + } + if (border === '' || border === '0') { + table.addClass(zeroborder); + } else { + table.removeClass(zeroborder); + } + if (borderColor !== '') { + table.attr('borderColor', borderColor); + } else { + table.removeAttr('borderColor'); + } + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + return; + } + //insert new table + var style = ''; + if (width !== '') { + style += 'width:' + width + widthType + ';'; + } + if (height !== '') { + style += 'height:' + height + heightType + ';'; + } + if (bgColor !== '') { + style += 'background-color:' + bgColor + ';'; + } + var html = '') + ''; + } + html += ''; + } + html += ''; + if (!K.IE) { + html += '
    '; + } + self.insertHtml(html); + self.select().hideDialog().focus(); + self.addBookmark(); + } + } + }), + div = dialog.div, + rowsBox = K('[name="rows"]', div).val(3), + colsBox = K('[name="cols"]', div).val(2), + widthBox = K('[name="width"]', div).val(100), + heightBox = K('[name="height"]', div), + widthTypeBox = K('[name="widthType"]', div), + heightTypeBox = K('[name="heightType"]', div), + paddingBox = K('[name="padding"]', div).val(2), + spacingBox = K('[name="spacing"]', div).val(0), + alignBox = K('[name="align"]', div), + borderBox = K('[name="border"]', div).val(1), + colorBox = K('.ke-input-color', div); + _initColorPicker(div, colorBox.eq(0)); + _initColorPicker(div, colorBox.eq(1)); + _setColor(colorBox.eq(0), '#000000'); + _setColor(colorBox.eq(1), ''); + // foucs and select + rowsBox[0].focus(); + rowsBox[0].select(); + var table; + if (isInsert) { + return; + } + //get selected table node + table = self.plugin.getSelectedTable(); + if (table) { + rowsBox.val(table[0].rows.length); + colsBox.val(table[0].rows.length > 0 ? table[0].rows[0].cells.length : 0); + rowsBox.attr('disabled', true); + colsBox.attr('disabled', true); + var match, + tableWidth = table[0].style.width || table[0].width, + tableHeight = table[0].style.height || table[0].height; + if (tableWidth !== undefined && (match = /^(\d+)((?:px|%)*)$/.exec(tableWidth))) { + widthBox.val(match[1]); + widthTypeBox.val(match[2]); + } else { + widthBox.val(''); + } + if (tableHeight !== undefined && (match = /^(\d+)((?:px|%)*)$/.exec(tableHeight))) { + heightBox.val(match[1]); + heightTypeBox.val(match[2]); + } + paddingBox.val(table[0].cellPadding || ''); + spacingBox.val(table[0].cellSpacing || ''); + alignBox.val(table[0].align || ''); + borderBox.val(table[0].border === undefined ? '' : table[0].border); + _setColor(colorBox.eq(0), K.toHex(table.attr('borderColor') || '')); + _setColor(colorBox.eq(1), K.toHex(table[0].style.backgroundColor || table[0].bgColor || '')); + widthBox[0].focus(); + widthBox[0].select(); + } + }, + //modify cell + cellprop : function() { + var html = [ + '
    ', + //width, height + '
    ', + '', + lang.width + '   ', + '   ', + lang.height + '   ', + '', + '
    ', + //align + '
    ', + '', + lang.textAlign + ' ', + lang.verticalAlign + ' ', + '
    ', + //border + '
    ', + '', + lang.borderWidth + '   ', + lang.borderColor + ' ', + '
    ', + //background color + '
    ', + '', + '', + '
    ', + '
    ' + ].join(''); + var bookmark = self.cmd.range.createBookmark(); + var dialog = self.createDialog({ + name : name, + width : 500, + title : self.lang('tablecell'), + body : html, + beforeRemove : function() { + colorBox.unbind(); + }, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var width = widthBox.val(), + height = heightBox.val(), + widthType = widthTypeBox.val(), + heightType = heightTypeBox.val(), + padding = paddingBox.val(), + spacing = spacingBox.val(), + textAlign = textAlignBox.val(), + verticalAlign = verticalAlignBox.val(), + border = borderBox.val(), + borderColor = K(colorBox[0]).html() || '', + bgColor = K(colorBox[1]).html() || ''; + if (!/^\d*$/.test(width)) { + alert(self.lang('invalidWidth')); + widthBox[0].focus(); + return; + } + if (!/^\d*$/.test(height)) { + alert(self.lang('invalidHeight')); + heightBox[0].focus(); + return; + } + if (!/^\d*$/.test(border)) { + alert(self.lang('invalidBorder')); + borderBox[0].focus(); + return; + } + cell.css({ + width : width !== '' ? (width + widthType) : '', + height : height !== '' ? (height + heightType) : '', + 'background-color' : bgColor, + 'text-align' : textAlign, + 'vertical-align' : verticalAlign, + 'border-width' : border, + 'border-style' : border !== '' ? 'solid' : '', + 'border-color' : borderColor + }); + self.hideDialog().focus(); + self.cmd.range.moveToBookmark(bookmark); + self.cmd.select(); + self.addBookmark(); + } + } + }), + div = dialog.div, + widthBox = K('[name="width"]', div).val(100), + heightBox = K('[name="height"]', div), + widthTypeBox = K('[name="widthType"]', div), + heightTypeBox = K('[name="heightType"]', div), + paddingBox = K('[name="padding"]', div).val(2), + spacingBox = K('[name="spacing"]', div).val(0), + textAlignBox = K('[name="textAlign"]', div), + verticalAlignBox = K('[name="verticalAlign"]', div), + borderBox = K('[name="border"]', div).val(1), + colorBox = K('.ke-input-color', div); + _initColorPicker(div, colorBox.eq(0)); + _initColorPicker(div, colorBox.eq(1)); + _setColor(colorBox.eq(0), '#000000'); + _setColor(colorBox.eq(1), ''); + // foucs and select + widthBox[0].focus(); + widthBox[0].select(); + // get selected cell + var cell = self.plugin.getSelectedCell(); + var match, + cellWidth = cell[0].style.width || cell[0].width || '', + cellHeight = cell[0].style.height || cell[0].height || ''; + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellWidth))) { + widthBox.val(match[1]); + widthTypeBox.val(match[2]); + } else { + widthBox.val(''); + } + if ((match = /^(\d+)((?:px|%)*)$/.exec(cellHeight))) { + heightBox.val(match[1]); + heightTypeBox.val(match[2]); + } + textAlignBox.val(cell[0].style.textAlign || ''); + verticalAlignBox.val(cell[0].style.verticalAlign || ''); + var border = cell[0].style.borderWidth || ''; + if (border) { + border = parseInt(border); + } + borderBox.val(border); + _setColor(colorBox.eq(0), K.toHex(cell[0].style.borderColor || '')); + _setColor(colorBox.eq(1), K.toHex(cell[0].style.backgroundColor || '')); + widthBox[0].focus(); + widthBox[0].select(); + }, + insert : function() { + this.prop(true); + }, + 'delete' : function() { + var table = self.plugin.getSelectedTable(); + self.cmd.range.setStartBefore(table[0]).collapse(true); + self.cmd.select(); + table.remove(); + self.addBookmark(); + }, + colinsert : function(offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + index = cell.cellIndex + offset; + // 取得第一行的index + index += table.rows[0].cells.length - row.cells.length; + + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.insertCell(index); + newCell.innerHTML = K.IE ? '' : '
    '; + // 调整下一行的单元格index + index = _getCellIndex(table, newRow, newCell); + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colinsertleft : function() { + this.colinsert(0); + }, + colinsertright : function() { + this.colinsert(1); + }, + rowinsert : function(offset) { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0]; + var rowIndex = row.rowIndex; + if (offset === 1) { + rowIndex = row.rowIndex + (cell.rowSpan - 1) + offset; + } + var newRow = table.insertRow(rowIndex); + + for (var i = 0, len = row.cells.length; i < len; i++) { + // 调整cell个数 + if (row.cells[i].rowSpan > 1) { + len -= row.cells[i].rowSpan - 1; + } + var newCell = newRow.insertCell(i); + // copy colspan + if (offset === 1 && row.cells[i].colSpan > 1) { + newCell.colSpan = row.cells[i].colSpan; + } + newCell.innerHTML = K.IE ? '' : '
    '; + } + // 调整rowspan + for (var j = rowIndex; j >= 0; j--) { + var cells = table.rows[j].cells; + if (cells.length > i) { + for (var k = cell.cellIndex; k >= 0; k--) { + if (cells[k].rowSpan > 1) { + cells[k].rowSpan += 1; + } + } + break; + } + } + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + rowinsertabove : function() { + this.rowinsert(0); + }, + rowinsertbelow : function() { + this.rowinsert(1); + }, + rowmerge : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, // 当前行的index + nextRowIndex = rowIndex + cell.rowSpan, // 下一行的index + nextRow = table.rows[nextRowIndex]; // 下一行 + // 最后一行不能合并 + if (table.rows.length <= nextRowIndex) { + return; + } + var cellIndex = cell.cellIndex; // 下一行单元格的index + if (nextRow.cells.length <= cellIndex) { + return; + } + var nextCell = nextRow.cells[cellIndex]; // 下一行单元格 + // 上下行的colspan不一致时不能合并 + if (cell.colSpan !== nextCell.colSpan) { + return; + } + cell.rowSpan += nextCell.rowSpan; + nextRow.deleteCell(cellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colmerge : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex, // 当前行的index + cellIndex = cell.cellIndex, + nextCellIndex = cellIndex + 1; + // 最后一列不能合并 + if (row.cells.length <= nextCellIndex) { + return; + } + var nextCell = row.cells[nextCellIndex]; + // 左右列的rowspan不一致时不能合并 + if (cell.rowSpan !== nextCell.rowSpan) { + return; + } + cell.colSpan += nextCell.colSpan; + row.deleteCell(nextCellIndex); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + rowsplit : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex; + // 不是可分割单元格 + if (cell.rowSpan === 1) { + return; + } + var cellIndex = _getCellIndex(table, row, cell); + for (var i = 1, len = cell.rowSpan; i < len; i++) { + var newRow = table.rows[rowIndex + i], + newCell = newRow.insertCell(cellIndex); + if (cell.colSpan > 1) { + newCell.colSpan = cell.colSpan; + } + newCell.innerHTML = K.IE ? '' : '
    '; + // 调整下一行的单元格index + cellIndex = _getCellIndex(table, newRow, newCell); + } + K(cell).removeAttr('rowSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + colsplit : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + cellIndex = cell.cellIndex; + // 不是可分割单元格 + if (cell.colSpan === 1) { + return; + } + for (var i = 1, len = cell.colSpan; i < len; i++) { + var newCell = row.insertCell(cellIndex + i); + if (cell.rowSpan > 1) { + newCell.rowSpan = cell.rowSpan; + } + newCell.innerHTML = K.IE ? '' : '
    '; + } + K(cell).removeAttr('colSpan'); + self.cmd.range.selectNodeContents(cell).collapse(true); + self.cmd.select(); + self.addBookmark(); + }, + coldelete : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + index = cell.cellIndex; + for (var i = 0, len = table.rows.length; i < len; i++) { + var newRow = table.rows[i], + newCell = newRow.cells[index]; + if (newCell.colSpan > 1) { + newCell.colSpan -= 1; + if (newCell.colSpan === 1) { + K(newCell).removeAttr('colSpan'); + } + } else { + newRow.deleteCell(index); + } + // 跳过不需要删除的行 + if (newCell.rowSpan > 1) { + i += newCell.rowSpan - 1; + } + } + if (row.cells.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + } else { + self.cmd.selection(true); + } + self.addBookmark(); + }, + rowdelete : function() { + var table = self.plugin.getSelectedTable()[0], + row = self.plugin.getSelectedRow()[0], + cell = self.plugin.getSelectedCell()[0], + rowIndex = row.rowIndex; + // 从下到上删除 + for (var i = cell.rowSpan - 1; i >= 0; i--) { + table.deleteRow(rowIndex + i); + } + if (table.rows.length === 0) { + self.cmd.range.setStartBefore(table).collapse(true); + self.cmd.select(); + K(table).remove(); + } else { + self.cmd.selection(true); + } + self.addBookmark(); + } + }; + self.clickToolbar(name, self.plugin.table.prop); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/1.html b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/1.html new file mode 100644 index 000000000..034126b72 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/1.html @@ -0,0 +1,14 @@ + + + + + + +

    + 在此处输入标题 +

    +

    + 在此处输入内容 +

    + + \ No newline at end of file diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/2.html b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/2.html new file mode 100644 index 000000000..dc2584a0d --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/2.html @@ -0,0 +1,42 @@ + + + + + + +

    + 标题 +

    + + + + + + + + + + + + + + + +
    +

    标题1

    +
    +

    标题1

    +
    + 内容1 + + 内容2 +
    + 内容3 + + 内容4 +
    +

    + 表格说明 +

    + + \ No newline at end of file diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/3.html b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/3.html new file mode 100644 index 000000000..873f0c65d --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/html/3.html @@ -0,0 +1,36 @@ + + + + + + +

    + 在此处输入内容 +

    +
      +
    1. + 描述1 +
    2. +
    3. + 描述2 +
    4. +
    5. + 描述3 +
    6. +
    +

    + 在此处输入内容 +

    +
      +
    • + 描述1 +
    • +
    • + 描述2 +
    • +
    • + 描述3 +
    • +
    + + \ No newline at end of file diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/template.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/template.js new file mode 100644 index 000000000..4029e8716 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/template/template.js @@ -0,0 +1,58 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('template', function(K) { + var self = this, name = 'template', lang = self.lang(name + '.'), + htmlPath = self.pluginsPath + name + '/html/'; + function getFilePath(fileName) { + return htmlPath + fileName + '?ver=' + encodeURIComponent(K.DEBUG ? K.TIME : K.VERSION); + } + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + arr = ['
    ', + '
    ', + // left start + '
    ', + lang. selectTemplate + '
    ', + // right start + '
    ', + ' ', + '
    ', + '
    ', + '
    ', + '', + '
    '].join(''); + var dialog = self.createDialog({ + name : name, + width : 500, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var doc = K.iframeDoc(iframe); + self[checkbox[0].checked ? 'html' : 'insertHtml'](doc.body.innerHTML).hideDialog().focus(); + } + } + }); + var selectBox = K('select', dialog.div), + checkbox = K('[name="replaceFlag"]', dialog.div), + iframe = K('iframe', dialog.div); + checkbox[0].checked = true; + iframe.attr('src', getFilePath(selectBox.val())); + selectBox.change(function() { + iframe.attr('src', getFilePath(this.value)); + }); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/wordpaste/wordpaste.js b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/wordpaste/wordpaste.js new file mode 100644 index 000000000..22061e15e --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/plugins/wordpaste/wordpaste.js @@ -0,0 +1,51 @@ +/******************************************************************************* +* KindEditor - WYSIWYG HTML Editor for Internet +* Copyright (C) 2006-2011 kindsoft.net +* +* @author Roddy +* @site http://www.kindsoft.net/ +* @licence http://www.kindsoft.net/license.php +*******************************************************************************/ + +KindEditor.plugin('wordpaste', function(K) { + var self = this, name = 'wordpaste'; + self.clickToolbar(name, function() { + var lang = self.lang(name + '.'), + html = '
    ' + + '
    ' + lang.comment + '
    ' + + '' + + '
    ', + dialog = self.createDialog({ + name : name, + width : 450, + title : self.lang(name), + body : html, + yesBtn : { + name : self.lang('yes'), + click : function(e) { + var str = doc.body.innerHTML; + str = K.clearMsWord(str, self.filterMode ? self.htmlTags : K.options.htmlTags); + self.insertHtml(str).hideDialog().focus(); + } + } + }), + div = dialog.div, + iframe = K('iframe', div), + doc = K.iframeDoc(iframe); + if (!K.IE) { + doc.designMode = 'on'; + } + doc.open(); + doc.write('WordPaste'); + doc.write(''); + if (!K.IE) { + doc.write('
    '); + } + doc.write(''); + doc.close(); + if (K.IE) { + doc.body.contentEditable = 'true'; + } + iframe[0].contentWindow.focus(); + }); +}); diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/anchor.gif b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/anchor.gif new file mode 100644 index 0000000000000000000000000000000000000000..61145ea78138f12df43b666409bcc4b8e3231a60 GIT binary patch literal 371 zcmZ?wbhEHb6krfwxN6QYDW2i~>#Uh+4FA{5|NoTr{}#jK1cv|r8K$Q&OaU@(FieVN zn48I*>dcU0&(ImhkmAVj|0cu#%M2+_4F5kfq&hJ~TQO9G2;_J&L|HM+%VPe&MQ&C) z)BiVF|KBtGUnBJY9mD^(IUOMk|2NBZhcf(sRXQn=;s4jN|DPBp#xP8bXXprI=#FCe zf19B@45+gB{|AQI=^Wh=4F5Ms{Qp)u1*rHM&^`YdZ~(=hEQ|~c<_tO@d61tN*d`p9 zUBIEi)aIe0aDYcB+&yV9KvzU~I(C$-u_p#Ky|bWX>%jt!B=|&dL_YB{V~Gw$?l$E`JVT wW>zLW4P_lBR%X%3<`U-X1)1cSnFM$4@f6r##-+BwLW0RJL(*8l(j literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/blank.gif b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9 GIT binary patch literal 43 mcmZ?wbhEHbWMp7uXkdT>#h)yUAf^t80Ld^gF}W}@SOWlZ0R#L1 literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/flash.gif b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/flash.gif new file mode 100644 index 0000000000000000000000000000000000000000..2cb12b28429f8c2e5294a177e14dfda6f533e6fc GIT binary patch literal 1089 zcmV-H1it%6Nk%w1VITk?0OkMy03afP|W&d}4=YJZZjyvFwT_~zc`k)Er>%FkqZjiIl;5K(o%zrQM3b^te9 zd4`jDi=FT9?{#&eq?= z&Da1aLZ`OBD`bS6tF=*bg7@$DY?G-hUVMa=piygoaD&NUadR3gv@04*cpk2HtAZvUIW`(NU|>7P#~?T>bqX|Nt1v+(S;PTf64}~3U<`K* zQ47$GNYff1*Ai|w>^DYkFnuK@BVh*%D~w4xavESj>TdAhksv{a02d;V89-(NkSuI; z@L1#^M-~tO-3&CsF~bdc0~it*00hhu2Mr1pabN>S0CfZnW|*lULdY2te1viHB@CVg z1qgY7;qQyaf-`3(IU!=e3^X@bV92&33(G+gUc?FW@&?kR8L&(l;AaAlsoK7*fT3iN z0U~q%z!>FW1nj{GBFO03AO)K?31H&ra3iS90S#U0+HDYFh8`v}B6JudMca-!L3sT^ zB4-6QuXZzBP@(6_l|57_pkSd5ND(Cl1R*iu`HMTd2E>>~fPf1Z)vU7t(V(D)Y}#Lv z-%h%q%M}DvqCe@fy0r!+#{ZCzBP6+ZHyZ7Ti2>ch3OeWm$Y^af)1M-T0sfWn#*7#Q z57J1*z<<5vB_D7g$Pfy|HD3m001!hA6j%`4eA$42M_Yq1qe%EK|&)k zXh97SJe+Zc4BqwW9T;;c;l(B#Xc2{!1+=56qF~s7#h|Om(1QYaXaIyvU>PAn5irQv z%OD}Npnx28(D6@68rYBn78UUL=^z+{(1R8VC{e2eSZKkAtFJC1!w^jb+eRKz^lI#< HfdBwIq8;my literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/loading.gif b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..c69e937232b24ea30f01c68bbd2ebc798dcecfcb GIT binary patch literal 2608 zcmdVcdr(tX9tZGC9yiG~=H_*Q-0%n(kWqP*D#hw{AQu8;1%gl-Hrf&{2?48KX;hHy z3Ze*zEz4t3XdUFyLbNPUYlA`|B}P=N1fqtL1*}S;87#|-W9v<#G;ul(e%d3)N(^9c$d2Dz{7}?ErjNd;{EMKkCsk21~b9Gvg zDo<7L=3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Q9onnK?==5hzbkb^r_g>z4#D8mcv8(+XdoszA zCx-qhdgxMNMotj}SiL_6V(tLcsK7(M(r(%u<}QrVfOvyK6_;~NOTlPGfX@M7S5YQF z&*$(ylJMHJt^_aQeu{C6NaTE$G3HNN@_SnN8YcaKn%`)F@~L1x+ah7-gEJPpc6w%3 zyX}r+Qk$4RHZzfH){e~F*qJ{d*L8a6n4;U?+{de0-t)mal#TVxe)3F}^UBh+zd T)6_**#cgp_+?JL9(ew3BlNF>u literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/media.gif b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/media.gif new file mode 100644 index 0000000000000000000000000000000000000000..e1c0e30afb2587f6d4ed4f8bd90bd4f865a98aa6 GIT binary patch literal 1036 zcmV+n1oQhxNk%w1VITk?0OkMy0A@37!Q*M$LcQvWmF_2mBqn_S(Z}jxMfqHi`g}=qph8>ajebfv(>`m;o;&^Lc|^(|NrX%akkXw-P74|0GZ6czP`)p_nDcQGnvdD zc0~XGnV{C}vBAMgeD0s2|`x$DghH8$$U7>xK#;fx3!ne0y#NE=_*_PMt z_y>GB^Uu$Ge1HG_;FiYa=8%l{_V#|d-OC&c_xDxA;Ovc%k|v_lc$J`Bwb{dadH?@r z@x;Xc|NqR)%}29%<|$If5zj<+@0oSRV;#1JEGEmvzHHo zK^dCR=H%o1@9)CL*8l%AwbJdn)bQZ%_W*P=|NlRu%(O41eiycq}AUsoyi)CnB1Zg8JKLBrW4U~m-5(Hdm1!Wys z4Ipt4096R0e^4V_5gm0MWn~S&2w8n^EmxFg1QETHV3Fir9=USl7#n1P3KbeR3g1gYqk`oMXDUdJ zg6G5<1`H+;N>ZXUoIFKRM`?WK43#rR-li^s2Z;d#4Ac+;Q@Vtg4^vcISU~)S9(%L( zWLR^X0f|Bt4oEkWMfidX7Ld;_BBsr40~!n&k?v(lk}OlwTaZ0F{ggZ!u-tZFNROBM zUII+Xg1(6R|5=FP02TxqAjBatc!2^6bG#4?e-QFV2OWA$Py>NjJb?%pb1?XT9|=uC zM+hX6s0SDm@Nvh5H9Uui3Ue%xR$D%Rv0V{DxbVaieAG~bZi-m(VE{u6@xoO;2%!dP z87{~m1CMu*K}ix#5P6jfD)^wrmPuopT&2f}B#@w_3l8kC!dHw;kpcxC zFu_3*$Ei6%4`Fx^L<(@mDTM+`1d)IeE3BYI0zoLDfE0n!l0^toq+n?ZQiPBNEu1nE G2mm`UjPBh4 literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/rm.gif b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/common/rm.gif new file mode 100644 index 0000000000000000000000000000000000000000..d013d551de909a5588a7d81be96aba60089a846b GIT binary patch literal 989 zcmV<310wuKNk%w1VITk?0OkMy0!fO7(d!x1vrw+q9#)Y6nas=J??8L1wang{j*6Pl=&;@Hf}+8--sXvYcn4dU zBZIas|JI-=;-JdPm1R7 z_XtOZ$=c^+!QzqB>;;U(l*HkTz1wT0#bS`RMUul|e~QY(!2kdMA^8La6aaq!EC2ui z03ZM$000O7fPaF6goTEOh>41ei!?V?RW~$@i!&HvFmVtNaWG;SGn9o&UUMfHRWmd+ zGgTNTb6!fKe>V^(Kr~9MGrhVrKqnA4lvV%^Sy?yB%+1LT09K1P0DE**6clA;Of@x3 z+u0O!djQ0UN@EigKM1Af(LLXatAr11&%Z_h6`n=>lNV z^yR^)?+hs*-k51&=*gSwS6oPNys-?J0@t4$no{7-ofRFn=RGLr!Ik$@5FIFD9txBn z7M?WOueJ%1BS+j(!~uzL0pNXFXt9P6FFe80K`&@QMu1!_ase4+D7eNCYj9!J0d{nt zMFeDAKuH55?C?V!b#MU{14O9s!ww@fAW8`zEI@_;P6WUJ16{~Y*f4+wG9-Cp2n1B1!4Q40z(OBGXixzGA!td9AaI}%LI{5N@g@pz LtZAnrfdBwIov+u= literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/default/background.png b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/default/background.png new file mode 100644 index 0000000000000000000000000000000000000000..bbfb056bd3e3bc7e7ada31f2ac3cb6ea37fc58b9 GIT binary patch literal 788 zcmeAS@N?(olHy`uVBq!ia0y~yVAKJ!w{S26Ny&!~?*b|2VkgfK4i1jn5B(nixr+jP zLR|m<|NrmbzrTO~{`vC4eT^vIy=DfX`88q2Zr0pWNp^$=r z0nahU!Y*Mg#l-*7n=jvVs879nXxq7)2X248^7s13rnHY&_+NO&T=H4NctlEJU545< zhK&nmMlc`Ap4DmUuxBBNX$@vBkE{VpsLwh&DeYrxS`x3o{S2}DnPTcD-4~z!J-n=Z z;u;^DJMn#wvNoTY_sd?#Jba_o&DZf|E3Aq(b$z{8_kUCJ+pudJ@5z7Fx4xE_Dm**= z{O{?q+1rDXde#1(?hAF_Hr>?jReaeRDd|qo#uBpGd@zseXN37<2*S8Ln zwba?zw+^Urb)U@Ch~w*jfmzcdE^h~GSf+aI*fFE{LBXNS0A;gW&_3$VbD;2Uw+L;!7@*W4txEcY@d*F`AcdHT8{004J`5a-_{zRQsOk8r#c z;Rb|+ge#jm8vp?I;Y&>e<$toko4e@-UiZjsb8~Zt#$^l!)7;!lsa0=)_~9R4lRg&< zHtm~QyP7Hiu(PvUw_5R-`Jqs#Bs{#-C^tn#SaM-=QO{+t17IRDk}QSv*H>HJX2_H0 z#+cmzy4TA+s2)pAz{0|UpiZM_#p~KH?-J^+JaebKyu88#U8}3BcPIU)+TYuGrd%Fe z9`|ZO1&Gtr(=p?KgJ$XHMs?w(H{;{ueg9Do*C^J*V4GdAqN1Xclat}*G_Smq(#CI1 z?LS1-Y?{7ZI;4*$mwtLO-ZG zmmAAao;6Z=cY6-c?S#jqAc{B6PTn%mQWiGPz0h?jOOHZU|8j6}2%o%{ju|N$F8}PK zfN=tbhleM)h`Mlsnr81}D;ioEp z;DbKv83zE~q@u5zxa>T_H_uTH4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/vendor/assets/javascripts/kindeditor/themes/qq/editor.gif new file mode 100644 index 0000000000000000000000000000000000000000..b256841f3088117a98b969499784042bab41aeca GIT binary patch literal 1449 zcmV;a1y=e;Nk%w1VL$>90M$PLQia8GoX|62nLBW?f~M5g+~Q1v!`Ir}#@Fmee!?zP zh+U1zmb2M1O>e8g;1W5WgsIkUn$Ip`%2$fVXMn^#bhsNcP%c~9LU_GjdBU~IL&`rMETD?m}ueX??hjiOzpp!m?j@drmO88u=IIcuapktQofL6Om9 zlnpU3=)x$aWkr|!ZjLRGtHu(6ln;RftGGxJA%N`& zB3!hPVK$<~K3mqbjTQ**Wh4;j?t!p}uD+aU3*p3)vL@2CO@zgW@33^N#Dz#wk2xug@*QIr;sbl%D3g@yevA{5qO(~K1eoM}ioR&X#O0XO)7 zC>}k1iN$(*CgI+kSUe&`4IOx}g9rC5+2j>lWz-reRe*J%2q`SIzyw-Cq+p#->}Q4# zF}^iMr9Y_9g9^Z^K!X7^1nVmeT%t%#6@roYClqeYl;aaH$uuS}8eNzxIp6R)VWWYR zQ|WoS0bydH7?X}U^)0D=w|T#%%iqME>NYuB9`8x$>wa8RoXF$6%Ydp?LATGHbA zgs*#?s|T{yMQ10C)X~ZW1B4l-Fd9ganG+En>$q9DlM2PI5qYfe0|!A?Q2+)+((phA z2T(9Cy%~)vg?|DJ!LvY8oU&@a2f`vNN+Cy~1s7}h0+)0hWBbIj%qqK#)e#@;#5mlE zV@}s153=!Ol48N~9_(Qu015=H@PGmZ+|16LV>f|q(o0P6!UCwYus~S`I3RezUZ%57 z7JpRs+u;ZkwF~2oSUjubjZ6FlG<~8G$s}!DL~*S;P0PgR6Wdy`=}{=4z+)>k5W)dT zLf%Bn=%v%f#0a?OuKNhJL+FG<6UZREE3X7DdlGu0SN9MABrrh2wOCf3(R2Ag z1jrcz4&fr|GN2ohS30~+PHIoc9OaS_0{~d-2c)yx0d;aK4zBMF69nDZ&}Anikgy3S zNTCW>s6s&~@EkAPN9PRl!5Yc|V;EEe>TJlv9@5YvNOQ@_kmti98u5rnh#?ZO69fP| DK<${p literal 0 HcmV?d00001 diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/qq/qq.css b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/qq/qq.css new file mode 100644 index 000000000..a45e08c69 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/qq/qq.css @@ -0,0 +1,143 @@ +/* container */ +.ke-container-qq { + display: block; + border: 1px solid #c3c3c3; + background-color: #FFF; + overflow: hidden; + margin: 0; + padding: 0; +} +/* toolbar */ +.ke-container-qq .ke-toolbar { + border-bottom: 1px solid #c3c3c3; + background-color: #FFFFFF; + padding: 2px 5px; + text-align: left; + overflow: hidden; + zoom: 1; +} +.ke-toolbar-icon-url { + background-image: url(editor.gif); + width:18px; + *xwidth:20px; + height:18px; + *xheight:20px; +} +.ke-icon-checked{ + background-image: url(../default/default.png); + width:16px; + height:16px; +} +.ke-container-qq .ke-icon-bold{ + background-position: 4px 1px; +} +.ke-container-qq .ke-icon-italic{ + background-position: -27px 1px; +} +.ke-container-qq .ke-icon-italic{ + background-position: -28px 1px; +} +.ke-container-qq .ke-icon-underline{ + background-position: -60px 1px; +} +.ke-container-qq .ke-icon-fontname{ + background-position: -95px 1px; +} +.ke-container-qq .ke-icon-fontsize{ + background-position: -128px 1px; +} +.ke-container-qq .ke-icon-forecolor{ + background-position: -159px 1px; +} +.ke-container-qq .ke-icon-hilitecolor{ + background-position: -190px 1px; +} +.ke-container-qq .ke-icon-plug-align{ + background-position: -223px 1px; +} +.plug-align-justifyleft{ + background-position: -350px 1px; +} +.plug-align-justifycenter{ + background-position: -382px 1px; +} +.plug-align-justifyright{ + background-position: -414px 1px; +} +.plug-order-insertorderedlist{ + background-position: -446px 1px; +} +.plug-order-insertunorderedlist{ + background-position: -477px 1px; +} +.plug-indent-indent{ + background-position: -513px 1px; +} +.plug-indent-outdent{ + background-position: -545px 1px; +} +.ke-container-qq .ke-icon-plug-order{ + background-position: -255px 1px; +} +.ke-container-qq .ke-icon-plug-indent{ + background-position: -287px 1px; +} +.ke-container-qq .ke-icon-link{ + background-position: -319px 1px; +} + +.ke-container-qq .ke-toolbar .ke-outline { + cursor: default; + padding:0px; + border:1px solid #fff; +} +.ke-container-qq .ke-toolbar .ke-on { + border-left:1px solid white; + border-top:1px solid white; + border-right:1px solid gray; + border-bottom:1px solid gray; + background-color: #FFFFFF; +} +.ke-container-qq .ke-toolbar .ke-selected { + border-left:1px solid gray; + border-top:1px solid gray; + border-right:1px solid white; + border-bottom:1px solid white; + background-color: #FFFFFF; +} +.ke-container-qq .ke-toolbar .ke-disabled { + cursor: default; +} + +.ke-colorpicker-qq{ + background:#fff; +} +/* statusbar */ +.ke-container-qq .ke-statusbar { + display:none; +} +/* menu */ +.ke-menu-qq { + border:1px solid #a6a6a6; + position:absolute; + background:#fff; + -moz-box-shadow:2px 2px 4px #DDDDDD; + z-index:999; + left:-400px; + top:-386px; + right:218px; + width:130px; +} +.ke-menu-qq .ke-menu-item { + padding:0px; + background:#fff; +} +.ke-menu-qq .ke-menu-item-on { + border:1px solid #000080;background:#FFEEC2;color:#036; +} +.ke-menu-qq .ke-toolbar .ke-selected { + border:1px solid #9a9afb; +} +.ke-menu-qq .ke-menu-item-left{ + width:auto; +} diff --git a/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/simple/simple.css b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/simple/simple.css new file mode 100644 index 000000000..4c76cf9d7 --- /dev/null +++ b/lib/rails_kindeditor/vendor/assets/javascripts/kindeditor/themes/simple/simple.css @@ -0,0 +1,100 @@ +/* container */ +.ke-container-simple { + display: block; + border: 1px solid #CCC; + background-color: #FFF; + overflow: hidden; +} +/* toolbar */ +.ke-container-simple .ke-toolbar { + border-bottom: 1px solid #CCC; + background-color: #FFF; + padding: 2px 5px; + overflow: hidden; +} +.ke-container-simple .ke-toolbar .ke-outline { + border: 1px solid #FFF; + background-color: transparent; + margin: 1px; + padding: 1px 2px; + font-size: 0; + line-height: 0; + overflow: hidden; + cursor: pointer; +} +.ke-container-simple .ke-toolbar .ke-on { + border: 1px solid #5690D2; +} +.ke-container-simple .ke-toolbar .ke-selected { + border: 1px solid #5690D2; + background-color: #E9EFF6; +} +.ke-container-simple .ke-toolbar .ke-disabled { + cursor: default; +} +/* statusbar */ +.ke-container-simple .ke-statusbar { + position: relative; + background-color: #FFF; + border-top: 1px solid #CCCCCC; + font-size: 0; + line-height: 0; + *height: 12px; + overflow: hidden; + text-align: center; + cursor: s-resize; +} +/* menu */ +.ke-menu-simple { + border: 1px solid #A0A0A0; + background-color: #FFF; + color: #222222; + padding: 2px; + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + text-align: left; + overflow: hidden; +} +.ke-menu-simple .ke-menu-item { + border: 1px solid #FFF; + background-color: #FFF; + color: #222222; + height: 24px; + overflow: hidden; + cursor: pointer; +} +.ke-menu-simple .ke-menu-item-on { + border: 1px solid #5690D2; + background-color: #FFF; +} +/* colorpicker */ +.ke-colorpicker-simple { + border: 1px solid #A0A0A0; + background-color: #FEFEFE; + color: #222222; + padding: 2px; +} +.ke-colorpicker-simple .ke-colorpicker-cell { + font-size: 0; + line-height: 0; + border: 1px solid #FEFEFE; + cursor: pointer; + margin:3px; + padding:0; +} +.ke-colorpicker-simple .ke-colorpicker-cell-top { + font-family: "sans serif",tahoma,verdana,helvetica; + font-size: 12px; + line-height: 24px; + border: 1px solid #FEFEFE; + cursor: pointer; + margin:0; + padding:0; + text-align: center; +} +.ke-colorpicker-simple .ke-colorpicker-cell-on { + border: 1px solid #5690D2; +} +.ke-colorpicker-simple .ke-colorpicker-cell-selected { + border: 1px solid #2446AB; +} diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index e58e4b2be..e39c6e19e 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -258,14 +258,13 @@ K.options = { minChangeSize : 50, zIndex : 811213, items : [ - 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste', + 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', - 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/', + 'superscript', 'quickformat', 'fullscreen','|', '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', - 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage', - 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', - 'anchor', 'link', 'unlink', '|', 'about' + 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak', + 'anchor', 'link', '|' ], noDisableItems : ['source', 'fullscreen'], colorTable : [ @@ -3533,11 +3532,11 @@ function _getInitHtml(themesPath, bodyClass, cssPath, cssData) { (_direction === '' ? '' : ''), '', ' +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
    <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> From c704ba71d9bd15078a26f25d6712426c90d8aec9 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 26 Mar 2015 16:18:34 +0800 Subject: [PATCH 123/175] =?UTF-8?q?=E6=8F=90=E5=87=BA=E6=8C=89ckeditor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 85fa8093a..2f4ec56a0 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -6,13 +6,14 @@ <% if User.current.logged? %> <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
    + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>

    <%= f.text_field :subject, :required => true, :maxlength => 50%>

    - <%= f.text_area :content, :required => true, :id => 'editor02' %> + <%= f.kindeditor :content, :required => true %>

    - +

    (<%= l(:label_memos_max_length) %>)

    From 0de09e3b36294a14335d6d0b02a886ed390132cd Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 26 Mar 2015 16:20:04 +0800 Subject: [PATCH 124/175] =?UTF-8?q?=E5=B0=86editor=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=8C=87=E5=90=91=E6=9C=AC=E5=B7=A5=E7=A8=8Blib=E4=B8=8B?= =?UTF-8?q?=E7=9A=84editor=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 29b2716a9..fb0312d5b 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'ruby-ole' #gem 'email_verifier', path: 'lib/email_verifier' gem 'rufus-scheduler' #gem 'dalli', path: 'lib/dalli-2.7.2' -gem 'rails_kindeditor' +gem 'rails_kindeditor',path:'lib/rails_kindeditor' group :development do gem 'grape-swagger' #gem 'grape-swagger-ui', git: 'https://github.com/guange2015/grape-swagger-ui.git' From 04c064ddc8b687bfd31ba2f1b0247ebf701aceb2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 26 Mar 2015 16:22:16 +0800 Subject: [PATCH 125/175] nothing --- db/schema.rb | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index bad1cf2ae..b676abe7f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150305081132) do +ActiveRecord::Schema.define(:version => 20150324021043) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -422,6 +422,13 @@ ActiveRecord::Schema.define(:version => 20150305081132) do add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id" add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized" + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -631,6 +638,16 @@ ActiveRecord::Schema.define(:version => 20150305081132) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -671,6 +688,17 @@ ActiveRecord::Schema.define(:version => 20150305081132) do t.integer "is_comprehensive_evaluation" end + create_table "kindeditor_assets", :force => true do |t| + t.string "asset" + t.integer "file_size" + t.string "file_type" + t.integer "owner_id" + t.string "asset_type" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "owner_type", :default => 0 + end + create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1041,12 +1069,12 @@ ActiveRecord::Schema.define(:version => 20150305081132) do end create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false + t.string "name", :limit => 90 + t.integer "position" + t.boolean "assignable" + t.integer "builtin" t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false + t.string "issues_visibility", :limit => 90 end create_table "schools", :force => true do |t| From cb1fce32fe85148cea57401505699c34ea9b51e5 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 26 Mar 2015 17:17:31 +0800 Subject: [PATCH 126/175] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 2 + app/views/avatar/_new_avatar_form.html.erb | 26 +++++++++ app/views/courses/settings.html.erb | 63 ++++++++++++++++++++-- public/javascripts/course.js | 8 +++ 4 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 app/views/avatar/_new_avatar_form.html.erb diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 1ec8a0ef0..2010c8252 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -239,6 +239,8 @@ class CoursesService course.time = params[:time] course.term = params[:term] course.class_period = params[:class_period] + params[:course][:is_public] ? course.is_public = 1 : course.is_public = 0 + params[:course][:open_student] ? course.open_student = 1 : course.open_student = 0 if course.save if params[:course][:is_public] == '0' course_status = CourseStatus.find_by_course_id(course.id) diff --git a/app/views/avatar/_new_avatar_form.html.erb b/app/views/avatar/_new_avatar_form.html.erb new file mode 100644 index 000000000..415ec09af --- /dev/null +++ b/app/views/avatar/_new_avatar_form.html.erb @@ -0,0 +1,26 @@ + + <%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%> + +<%= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %> +<%= file_field_tag 'avatar[image]', + :id => nil, + :class => 'upbtn fl', + :size => "1", + :multiple => false, + :onchange => 'addInputAvatar(this);', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :file_type => Redmine::Configuration['pic_types'].to_s, + :type_support_message => l(:error_pic_type), + :upload_path => upload_avatar_path(:format => 'js'), + :description_placeholder => nil ,# l(:label_optional_description) + :source_type => source.class.to_s, + :source_id => source.id.to_s + } %> + +<% content_for :header_tags do %> + <%= javascript_include_tag 'avatars' %> +<% end %> +
    \ No newline at end of file diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index c2030ffec..74c82cf09 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -1,3 +1,60 @@ -

    <%=l(:label_settings)%>

    -<%= render_tabs course_settings_tabs %> -<% html_title(l(:label_settings)) -%> +
    +

    <%= l(:label_course_modify_settings)%>

    +
    +
    +
      + <%= labelled_form_for @course do |f| %> +
    • + <%= render :partial => "avatar/new_avatar_form", :locals => {source: @course} %> +
      +
    • +
    • + + + +
    • +
      +
    • + + + +
    • +
      +
    • + + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> + <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> +
    • +
      +
    • + + +
      + 学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。 +
    • +
    • + + +
      +
    • +
    • + + id="course_is_public" name="course[is_public]" type="checkbox"> + (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。) +
      +
    • +
    • + + id="course_open_student" name="course[open_student]" type="checkbox"/> + (打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表) +
      +
    • +
    • + 提交 + <%= link_to l(:button_cancel), course_path(@course), :class => "blue_btn grey_btn fl c_white" %> +
      +
    • + <% end %> +
    +
    +
    \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 65f45ea62..5e1e138bb 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -90,6 +90,14 @@ function submit_new_course() } } +function submit_edit_course(id) +{ + if(regex_course_name()&®ex_course_class_period()) + { + $("#edit_course_"+id).submit(); + } +} + /////////////////////////////////////////////////////////////// //验证搜索时输入名字 From e1afdab98852d5fda91a6dd75eb54b9fadcf6a27 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 17:41:25 +0800 Subject: [PATCH 127/175] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 6 ++-- app/views/courses/_history.html.erb | 8 ++--- app/views/courses/feedback.html.erb | 5 +-- app/views/words/_journal_reply_items.html.erb | 33 +++++++++---------- app/views/words/_new_respond_course.html.erb | 10 +++--- public/stylesheets/courses.css | 4 ++- 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 680bafb46..385b945d9 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -12,10 +12,10 @@ <% else %> <%= form_for('new_form', :method => :post, :url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%> - <%= f.text_area 'course_message',:id => "leave_meassge", :rows => 3, :cols => 65, + <%= f.text_area 'course_message',:id => "leave_meassge", :placeholder => "#{l(:label_welcome_my_respond)}",:maxlength => 250%> - 取  消 - <%= l(:button_leave_meassge)%> + 取  消 + <%= l(:button_leave_meassge)%> <% end %> <% end %>
    diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb index 23d4909d9..01990602d 100644 --- a/app/views/courses/_history.html.erb +++ b/app/views/courses/_history.html.erb @@ -3,17 +3,15 @@ <% for journal in journals %>
    - - <%= image_tag(url_to_avatar(journal.user),:width => '46',:height => '46') %> - + <%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
    - <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%> + <%= link_to journal.user, user_path(journal.user),:class => 'c_blue fb fl mb10', :target => "_blank"%> - + <%= format_time(journal.created_on) %>
    diff --git a/app/views/courses/feedback.html.erb b/app/views/courses/feedback.html.erb index b7713c4a9..0a8458a22 100644 --- a/app/views/courses/feedback.html.erb +++ b/app/views/courses/feedback.html.erb @@ -1,9 +1,10 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %>
    -

    用户留言

    +

    <%= l(:label_contest_userresponse) %>

    + <%= render :partial => 'courses_jours', :locals => { :contest => @contest, :journals => @jour, :state => false} %> @@ -12,7 +13,7 @@ diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 0d995d095..6069c4a14 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -19,7 +19,7 @@ a:hover.project_name{ color:#016f33;} a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a:hover.project_txt{ color:#066e9a;} .noline{ border-bottom:none;} -.news_description{max-height: 38px;overflow:hidden; } +.news_description{max-height: 60px;overflow:hidden; } .news_description_none{max-height: none;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} From cb498a44a60e13ffd6f9038609e4fe85b6ddca32 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 19:04:47 +0800 Subject: [PATCH 131/175] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E5=B8=83=E9=80=9A=E7=9F=A5=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_news.html.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index a1f94ab27..07e21c52c 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -20,23 +20,23 @@
    -<% if @course && User.current.allowed_to?(:manage_news, @course) %> - <%= link_to(btn_tips, new_course_news_path(@course), +
    <% if @newss.empty? %> From 9a2f572cf4a2b0cbb6f262c4799fc0320fc8ca78 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 26 Mar 2015 19:06:17 +0800 Subject: [PATCH 132/175] =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E5=8A=9F=E8=83=BD=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_new_homework_form.html.erb | 4 ++-- public/javascripts/course.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index 6df06b1a6..4f502b1f6 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -26,9 +26,9 @@ >
    -
  • +
  • - + <%= l(:label_evaluation_description)%>

  • diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 5e1e138bb..bb4127f9a 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -215,11 +215,11 @@ $(function(){ $("#bid_open_anonymous_evaluation").click(function(){ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") { - $("#bid_evaluation_num").slideDown(); + $("#bid_evaluation_num_li").slideDown(); } else { - $("#bid_evaluation_num").slideUp(); + $("#bid_evaluation_num_li").slideUp(); } }); }); From b8ab3770f10923acbf6c1bf2dd5a42def844d119 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 19:10:27 +0800 Subject: [PATCH 133/175] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/_new_respond_course.html.erb | 2 +- public/stylesheets/courses.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index d32f5de85..77e40783d 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -10,6 +10,6 @@ <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %> <%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "sub_btn"%> + :class => "reply_btn"%> <% end %> \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 6069c4a14..812b00866 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -342,8 +342,9 @@ a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; col blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;} .respond-form{display: none;margin: auto;clear: both;} -.sub_btn{display: block;margin-left: 470px;} +.reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} +.reply_btn:hover{ background:#999; color:#fff; } From a99dda837a83c736c91170ce1ecb47f6ddb5c929 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 26 Mar 2015 19:11:06 +0800 Subject: [PATCH 134/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E8=BF=87=E9=95=BF=E8=B6=85=E5=87=BA=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/show.html.erb | 2 +- public/stylesheets/public.css | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 57e4e06cc..c0b2f1eb6 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -15,7 +15,7 @@ <%= l(:label_new_activity) %>: <%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url,:class => "problem_tit c_dblue fl fb"%>
    -

    <%= e.event_description %> +

    <%= e.event_description %>
    <%= l :label_activity_time %> : <%= format_activity_day(day) %><%= format_time(e.event_datetime, false) %>

    diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d5f07dd2a..23e4bbcc0 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -208,6 +208,7 @@ a:hover.close_btn {background-position:-66px 0;} .show_btn {background-position:-119px 0;} .msgserver a {color:#15bccf; } .msgserver a:hover { text-decoration:underline; } +.break_word{word-break: break-all;word-wrap: break-word;} /***** Ajax indicator ******/ #ajax-indicator { position: absolute; /* fixed not supported by IE */ From ddecd61926ff7720ffc7d5af6ed1ef6bd2810014 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 20:17:47 +0800 Subject: [PATCH 135/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E6=97=B6=E6=97=A0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 2 + app/views/files/_course_list.html.erb | 4 +- .../tags/_course_attachment_tag_name.erb | 56 +++++++++++++++++++ app/views/tags/_tag_list.html.erb | 7 ++- app/views/tags/_tag_new.html.erb | 7 +++ app/views/tags/tag_save.js.erb | 6 ++ 6 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 app/views/tags/_course_attachment_tag_name.erb diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 6738d2135..2a0d0445d 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -248,6 +248,8 @@ class TagsController < ApplicationController @obj = OpenSourceProject.find_by_id(@obj_id) when '9' @obj = Course.find_by_id(@obj_id) + when '10' + @obj = Attachment.find_by_id(@obj_id) else @obj = nil end diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 8af369558..7dc047c5e 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -44,8 +44,8 @@
    - <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> - <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %> + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "10"} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "10"} %>
    diff --git a/app/views/tags/_course_attachment_tag_name.erb b/app/views/tags/_course_attachment_tag_name.erb new file mode 100644 index 000000000..699f7208f --- /dev/null +++ b/app/views/tags/_course_attachment_tag_name.erb @@ -0,0 +1,56 @@ + + +<% @tags = obj.reload.tag_list %> +<% if non_list_all and (@tags.size > 0) %> + + <% if @tags.size > Setting.show_tags_length.to_i then %> + <% i = 0 %> + <% until i>Setting.show_tags_length.to_i do %> +
    + <%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %> +
    + <% i += 1 %> + <% end %> + <%= more_tags(obj.id,object_flag)%> + <% else %> + <% @tags.each do |tag| %> +
    + <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> +
    + <% end %> + <% end %> +<% else %> + + <% if @tags.size > 0 %> + <% @tags.each do |tag| %> +
    + + <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> + + <% case object_flag %> + <% when '10' %> + <%# if (User.current.logged? && + User.current.admin? + # && (@project && User.current.member_of?(@project)) + ) + %> + <% if obj.author_id == User.current.id || User.current.admin?%> + + <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, + :taggable_id => obj.id, :taggable_type => object_flag %> + + <% end %> + <% end %> + +
    + <% end %> + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index 549ed1751..e18dafd7d 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -5,7 +5,12 @@ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> <% case object_flag %> - <% when '6' %> + <% when '10' %> + <% if obj.author_id == User.current.id || User.current.admin?%> + <%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag, + :taggable_id => obj.id, :taggable_type => object_flag %> + <% end %> + <% when '6' %> <% if obj.author_id == User.current.id || User.current.admin?%> <%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag, :taggable_id => obj.id, :taggable_type => object_flag %> diff --git a/app/views/tags/_tag_new.html.erb b/app/views/tags/_tag_new.html.erb index eb49005ae..0d5d371e3 100644 --- a/app/views/tags/_tag_new.html.erb +++ b/app/views/tags/_tag_new.html.erb @@ -12,6 +12,13 @@ <% if object_flag == '3' %> + <% elsif object_flag == '10' %> +
    + <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag} %> +
    + <% elsif object_flag == '6' %>
    <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag} %> diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb index b4866bb89..2bef1a3a3 100644 --- a/app/views/tags/tag_save.js.erb +++ b/app/views/tags/tag_save.js.erb @@ -14,6 +14,12 @@ $("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val(""); $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); $('#tags_name').val(""); +<% elsif @obj_flag == '10'%> +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); +//$("#put-tag-form-<%#=@obj.class%>-<%#=@obj.id%>").hide(); +$("#tags_name_<%=@obj.id%>").val(""); <% else%> $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>'); From b3acbec2e1142d92e1fac52a2dd2b7589d9f1b05 Mon Sep 17 00:00:00 2001 From: z9hang Date: Thu, 26 Mar 2015 20:35:40 +0800 Subject: [PATCH 136/175] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_upload_show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 7db9b6b21..ca3eda73c 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -1,5 +1,5 @@ -
    +

    <%= l(:label_upload_files)%>

    From d8da3bb73cb52be0f21041effa018c8f6e9c3d09 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 09:05:43 +0800 Subject: [PATCH 137/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=A4=9A=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_news.html.erb | 4 ++-- public/stylesheets/courses.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index 07e21c52c..aa286b540 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -51,7 +51,7 @@ <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_release_news) %>:<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
    -
    <%= textilizable(news, :description) %>
    <%= l(:label_create_time) %> :<%= format_time(news.created_on) %>
    +

    <%= news.description %>
    <%= l(:label_create_time) %> :<%= format_time(news.created_on) %>

    @@ -92,7 +92,7 @@ }); $(function(){ $('.news_description').each(function () { - if($(this).height() >= 60) + if($(this).height() >= 38) { $('#news_foot_'+$(this).attr('id').replace('news_description_','')).css("display","block"); } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 812b00866..fae52a850 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -19,7 +19,7 @@ a:hover.project_name{ color:#016f33;} a.project_txt02{ color:#0781b4; width:618px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a:hover.project_txt{ color:#066e9a;} .noline{ border-bottom:none;} -.news_description{max-height: 60px;overflow:hidden; } +.news_description{max-height: 38px;overflow:hidden; } .news_description_none{max-height: none;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} @@ -52,7 +52,7 @@ a:hover.problem_new_btn{ background:#ff7143; color:#fff;} .problem_p span{ color:#ff3e00;} a.problem_pic{ display:block; width:42px; height:42px; padding:3px; border:1px solid #e3e3e3;} a:hover.problem_pic{border:1px solid #64bdd9;} -.problem_txt{ width:610px; margin-left:10px; color:#777777;} +.problem_txt{ width:610px; margin-left:10px; color:#777777;word-break: break-all;word-wrap: break-word;} a.problem_name{ color:#ff5722;} a:hover.problem_name{ color:#d33503;} a.problem_tit{ color:#0781b4; width:430px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} From 519c11954333a42b769fa149b1f8f0e9541ad55c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 09:32:13 +0800 Subject: [PATCH 138/175] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_new_form.html.erb | 52 ++++++++++++++++++++++ app/views/bids/_new_homework_form.html.erb | 2 +- public/javascripts/attachments.js | 10 +++-- public/stylesheets/courses.css | 24 +++++++++- public/stylesheets/public.css | 3 ++ 5 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 app/views/attachments/_new_form.html.erb diff --git a/app/views/attachments/_new_form.html.erb b/app/views/attachments/_new_form.html.erb new file mode 100644 index 000000000..d138c529f --- /dev/null +++ b/app/views/attachments/_new_form.html.erb @@ -0,0 +1,52 @@ + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> +<% end %> + +<% project = project %> + + <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn' %> + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js',:project =>project), + :description_placeholder => l(:label_optional_description) + } %> + + <%= l(:label_no_file_uploaded)%> + + (<%= l(:label_max_size) %>: + <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> +<% end %> + + diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index 4f502b1f6..210d96891 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -34,7 +34,7 @@
  • - <%= render :partial => 'attachments/form', :locals => {:container => bid} %> + <%= render :partial => 'attachments/new_form', :locals => {:container => bid} %>
  • <%= l(:button_create)%> diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 8ea71909b..809cf1789 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -22,10 +22,10 @@ function addFile(inputEl, file, eagerUpload) { fileSpan.append( $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), - $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), - $('公开:').attr({ 'class': 'ispublic-label' }) , - $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), - $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload), + $('', { 'type': 'text', 'class': 'description','style':'margin-left: 9px;', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), + $('公开:').attr({ 'class': 'ispublic-label ' ,'style':'margin-left: 15px;'}) , + $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','style':'margin-left: 4px;','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), + $(' ').attr({ 'href': "#", 'class': 'remove-upload ml5','style':'margin-left: 5px;', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload), $('
    ', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} ) ).appendTo('#attachments_fields'); @@ -164,9 +164,11 @@ function addInputFiles(inputEl) { if (inputEl.files) { // upload files using ajax + //alert("11"); uploadAndAttachFiles(inputEl.files, inputEl); // $(inputEl).remove(); } else { + //alert("11"); // browser not supporting the file API, upload on form submission var attachmentId; var aFilename = inputEl.value.split(/\/|\\/); diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 9a315e558..f8f0065e9 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -336,12 +336,34 @@ a:hover.st_add{ color:#ff8e15;} .upload_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto; margin-top:25px; padding-left:20px; padding-top:5px;} .upload_box{ width:430px; margin:15px auto;} -a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; color:#64bdd9; } a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .r_txt_tit{width:500px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;} blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;} +#attachments_fields input.description {margin-left: 4px;width: 100px;} +#attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;} +a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} +#attachments_fields input.filename {border: 0;height: 1.8em;width: 150px;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px 50%;padding-left: 18px;padding-top: 2px;} +span.add_attachment {font-size: 80%;line-height: 2.5em;} +#attachments_fields span {display: block;white-space: nowrap;} +.file_selector{position: relative;opacity: 0;filter: alpha(opacity:0);} +#attachments_fields .ajax-waiting input.filename {background:url(../images/hourglass.png) no-repeat 0px 50%;} +#attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;} + +#attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } +.ui-widget { + font-family: Verdana, sans-serif; + font-size: 1.1em; +} +.ui-widget-content { + border: 1px solid #ddd; + color: #333; +} +.ui-progressbar-value{margin:-1px;height:100%} +.ui-widget-header{border:1px solid #628db6;background:#759fcf url(jquery/images/ui-bg_gloss-wave_35_759fcf_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold} +.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px} +.link_file{ background:url(../images/pic_file.png) 0 7px no-repeat !important; padding-left:20px !important; color:#64bdd9 !important; } diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 23e4bbcc0..f45f49112 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -14,7 +14,10 @@ a:hover,a:active{color:#000;} .f_l{ float:left;} .f_r{ float:right;} .ml2{ margin-left:2px;} +.ml3{ margin-left:3px;} +.ml4{ margin-left:4px;} .ml5{ margin-left:5px;} +.ml8{ margin-left:8px;} .ml10{ margin-left:10px;} .ml15{ margin-left:15px;} .ml20{ margin-left:20px;} From 8c795edf9e0e2811eed11a6aafec571bd66fa75b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 09:33:56 +0800 Subject: [PATCH 139/175] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 840102e79..805abee97 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -342,6 +342,9 @@ a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; col blockquote {background: #eeeeee;padding: 10px;margin-bottom: 10px;} .respond-form{display: none;margin: auto;clear: both;} +.reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} +.reply_btn:hover{ background:#999; color:#fff; } + #attachments_fields input.description {margin-left: 4px;width: 100px;} #attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} From 240fc240e61289853a5b1ca04079a30bbb7c8073 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 09:51:20 +0800 Subject: [PATCH 140/175] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=9B=BE=E7=89=87=20=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/avatar/_new_avatar_form.html.erb | 4 ++-- public/images/avatars/Course/0 | Bin 11934 -> 17114 bytes public/stylesheets/courses.css | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/avatar/_new_avatar_form.html.erb b/app/views/avatar/_new_avatar_form.html.erb index 415ec09af..9c8a63941 100644 --- a/app/views/avatar/_new_avatar_form.html.erb +++ b/app/views/avatar/_new_avatar_form.html.erb @@ -1,10 +1,10 @@ <%= image_tag(url_to_avatar(source), id: "avatar_image", :width =>"60", :height =>"60",:alt=>"上传图片")%> -<%= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %> +<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "upbtn fl" %> <%= file_field_tag 'avatar[image]', :id => nil, - :class => 'upbtn fl', + :class => 'upbtn', :size => "1", :multiple => false, :onchange => 'addInputAvatar(this);', diff --git a/public/images/avatars/Course/0 b/public/images/avatars/Course/0 index 585b4bfc01363247d795bbb5eff31260611ddaee..8eb3d27d5a4129b6afec7ff60902c45be4aa908e 100644 GIT binary patch literal 17114 zcmeHuc|4R~^zbtVBfIP+WGiJ~BTI}uJK3|%3`Q7c#=cc5+7P0ZY+nlbk~KxLMV6#& zQ6WUgUM6PVXGTijzQ5n^eSg2t`~LHGeV%*oIrrRi&pmhXob#L^^^-;z%XLH09spos z0vrGUfDV8`b^=ha1_A#7$S#0}QU?Hc$nGC?Z^-`dG*lpsECA*JANXJ)a+Ep;SdWiI z1JvL9=78l3K(hG>0PJJkDz%Upca)&H7Y2{Pd13qo;Z}-*wrD>jCKw0E$;c|G%F3zA z$P3EKsLIHxDyo1i0O%da=C~vh0NkPa!Qb@`^kM@P4V zj&a8hMm7d|1~yI>Mn)D+9(Hz4c6J^%MoRi#Yy$txAxsPmOw3HI%*?DD%*@Oj}uny56ijbO|QpSY&?R_rT$gX+&i(VtZ(ZX9GjL`+0r-pg$MgtHaT*N=l6GWzW{Z?N zMFl%|w1sl2b(>9;oa579e5>A8u5P9g8{3yi0%C4g=Y5kNDrB}ndLL20H4uTIyGmzd zvGI9?yV}rvYLCTZz0*!mslrnTm_TcIbkcaF*8Xcr%p)&al2rEcJ{dwvh>Ij?g(Vq^ zq>up8i{xYT)B8h@3QTYi~o&bn@MQc(jUdP}u6 zkL!*O-dzgaN5{#rPT z3#L|-8Tbu?Yg+_zMx)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^oIO zDjc5|sC${xk&ljvda1#4l-_+VkCUhgeVq4vN`o`au` zK=M{f56fAQ6a%_#!kq0OKT+gti6TykC%F0zN3(-3HGH3*KI7X=iJ<^WCU0o^_3Aj= zQnPLlCEv!Y#s}u|3f4c)7VU3QRg@@QQ#Q2pOctFaT7F8$IFzqCfaBh-I#!T7mwin? zWwlwVdJ}6zLv1iBuv6IDT=0h^o~xVp?RoIndg-TNX#Q{(>Lh+^>lay9_2j_HF;be#TzvbZHAFX{+1&LSFz)dAK6i5Po;JAuR_)SNmNx+Gt$G1h%jChEn6TZ zP`CA6v1TDrY=vn9uFv@8u`_w%sU*p1)_}{wQ~>sPO>PepD0w%pRqT)LQqanoCn)lwzN{KH$6B4&X4q#Xdan33+4dG5bj4dNih{ m(eUQNU-+|M3F}4x3PjH?_xMLX%OLm(5JW*nS-M)%DEL3IkTRG6 diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 805abee97..52cea851d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -324,8 +324,8 @@ a:hover.st_add{ color:#ff8e15;} .courses_text{ border:1px solid #64bdd9; height:100px;width:532px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;} .upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;} .upimg:hover{ border:1px solid #64bdd9; } -.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;} -.upbtn:hover{border:1px solid #64bdd9; color:#64bdd9;} +.upbtn{ margin:42px 0 0 10px; border: none;} +/*.upbtn:hover{border:1px solid #64bdd9; color:#64bdd9;}*/ /* 功能倒计时*/ .w_img{ float:left; margin:10px 10px 15px 0px;} .w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; } From 15f0058374ef32583de888f2758630b69841d287 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 11:14:49 +0800 Subject: [PATCH 141/175] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=95=8C=E9=9D=A2=E6=90=9C=E7=B4=A2=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 52cea851d..537e67ca5 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -109,7 +109,7 @@ a:hover.grey_btn{ background:#717171; color:#fff;} .re_top input{ float:left;} .re_search{ margin-top:7px; margin-left:5px;} .re_schbox{ width:240px; height:24px; border:1px solid #64bdd9; color:#666666;} -.re_schbtn{ width:60px; height:26px; color:#fff; margin-right:5px; border:none; margin-left:0px; } +.re_schbtn{ width:60px; height:26px; color:#fff; margin-right:5px; border:none; margin-left:0px;padding-left: 0px;} a.re_fabu { display:block; width:90px; height:30px; font-size:14px; color:#fff; text-align:center; padding-top:10px; } a:hover.re_fabu{background:#55a1b9;} .re_con{ margin:5px; width:665px;} From 89a001ad9dd5bfa8a3a7a7b9531996912600fefe Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 27 Mar 2015 11:20:15 +0800 Subject: [PATCH 142/175] =?UTF-8?q?IE8=E6=B5=8F=E8=A7=88=E5=99=A8=E5=8F=8A?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E4=BD=8E=E7=89=88=E6=9C=AC=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 4 +- app/views/layouts/_point_browser.html.erb | 97 +++++++++++++++++------ 2 files changed, 75 insertions(+), 26 deletions(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index d964b788f..719021526 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -85,13 +85,13 @@ show_btn.css('width', 25); } - //close??? + //close closeBtn.bind("click",function(){ sideContent.animate({width: '0px'},"fast"); show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast"); cookiesave('minStatue','true','','',''); }); - //show??? + //show show_btn.bind("click",function() { $(this).animate({width: '0px'},"fast"); sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); diff --git a/app/views/layouts/_point_browser.html.erb b/app/views/layouts/_point_browser.html.erb index e936a6b11..55fedd751 100644 --- a/app/views/layouts/_point_browser.html.erb +++ b/app/views/layouts/_point_browser.html.erb @@ -9,38 +9,87 @@ .update{ border-bottom:1px solid #d7d7d7; color:#fea254; text-align:center; width:100%; font-size:10px; height:30px; background:#fdffd9; padding:2px 0;z-index:1000;} a.green_btn{ padding:2px 10px; background:#3caf3f; font-size:12px;color:#fff;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;} a:hover.green_btn{ background:#289c2b;} - a.close_btn{ background:url(images/floatbox/img_floatbox.png) -20px -35px no-repeat; display:block; width:16px; height:16px; float:right; margin:7px 5px 0 0;} - a:hover.close_btn{ background:url(images/floatbox/img_floatbox.png) -20px -63px no-repeat;} + a.update_close_btn{ background:url(images/floatbox/img_floatbox.png) -20px -35px no-repeat; display:block; width:16px; height:16px; float:right; margin:7px 5px 0 0;} + a:hover.update_close_btn{ background:url(images/floatbox/img_floatbox.png) -20px -63px no-repeat;} + -
    - 您当前使用的是IE8浏览器,建议升级您的浏览器。 - - -
    -
    - +
    - - \ No newline at end of file From 61b220c913dc9a236197dc975fdde9593f64b94d Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 11:28:27 +0800 Subject: [PATCH 143/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E5=88=A0=E9=99=A4=E8=B5=84=E6=BA=90tag=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 4 +++- app/helpers/tags_helper.rb | 2 ++ app/views/tags/remove_tag.js.erb | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 2a0d0445d..bb9a44104 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -382,7 +382,9 @@ class TagsController < ApplicationController when '8' return 'OpenSourceProject' when '9' - return 'Course' + return 'Course' + when '10' + return 'Attachment' else render_error :message => e.message return diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index 17b68c3f6..284ee8c43 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -20,6 +20,8 @@ module TagsHelper @obj= Contest.find_by_id(obj_id) when '9' @obj= Course.find_by_id(obj_id) + when '10' + @obj = Attachment.find_by_id(obj_id) else raise Exception, '[TagsHelper] ===> tag type unknow.' end diff --git a/app/views/tags/remove_tag.js.erb b/app/views/tags/remove_tag.js.erb index b102776d5..b8c65c13e 100644 --- a/app/views/tags/remove_tag.js.erb +++ b/app/views/tags/remove_tag.js.erb @@ -9,6 +9,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n <% elsif @object_flag == '9'%> $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% elsif @object_flag == '10'%> +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name', + :locals => {:obj => @obj,:non_list_all => false, :object_flag => @object_flag}) %>'); <% else%> $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); From 65824be778d49cf6191ae67d1d5ca94cbb5c5fd7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 11:32:13 +0800 Subject: [PATCH 144/175] =?UTF-8?q?=E4=BF=AE=E6=94=B9css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 52cea851d..e2ba02752 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -120,7 +120,7 @@ a:hover.re_select{ background:#ff9900; color:#fff; text-decoration:none;} a.re_open{display:block; width:46px; height:19px; border:1px solid #64bdd9; color:#64bdd9; margin-left:10px;padding-top:3px;} a:hover.re_open{ background:#64bdd9; color:#fff; text-decoration:none;} a.re_de{ color:#6883b6; margin-left:15px;} -a:hover.re_con_box{ border-bottom:1px dashed #dadada; padding-bottom:10px; margin-bottom:10px;} +.re_con_box{ border-bottom:1px dashed #dadada; padding-bottom:10px; margin-bottom:10px;} /****资源库***/ /*.setting{ background:url(../images/setting.jpg) 0 0 no-repeat; width:670px; height:443px;}*/ From bdaf5742661e538faed99754acaee2298099e900 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 11:55:18 +0800 Subject: [PATCH 145/175] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=96=B0=E5=B8=96=EF=BC=8C=E5=8F=91=E5=B8=83=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 69a0850d2..5989eafc7 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -126,7 +126,7 @@
  • <% unless replying %> @@ -70,7 +30,7 @@ <%= text_area :quote,:quote,:style => 'display:none' %> <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
    - +
  • diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb index 4b2792627..4f67c0ce6 100644 --- a/app/views/news/_course_form.html.erb +++ b/app/views/news/_course_form.html.erb @@ -1,69 +1,12 @@ -
  • - +
  • - +
  • diff --git a/public/javascripts/course.js b/public/javascripts/course.js index bb4127f9a..e49ecd828 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -99,7 +99,104 @@ function submit_edit_course(id) } /////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////课程讨论区 +function regexSubject() +{ + var content = $.trim($("#message_subject").val()); + if(content.length ==0) + { + $("#subject_span").text("主题不能为空"); + $("#subject_span").css('color','#ff0000'); + return false; + } + else + { + $("#subject_span").text("填写正确"); + $("#subject_span").css('color','#008000'); + return true; + } + return false; +} +function regexContent() +{ + var content = $.trim($("#message_content").val()); + if(content.length ==0) + { + $("#message_content_span").text("描述不能为空"); + $("#message_content_span").css('color','#ff0000'); + return false; + } + else + { + $("#message_content_span").text("填写正确"); + $("#message_content_span").css('color','#008000'); + return true; + } + return false; +} +function submitCoursesBoard() +{ + if(regexSubject()&®exContent()){$("#message-form").submit();} +} +/////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////// 课程通知 +function regexTitle() +{ + var name = $("#news_title").val(); + if(name.length ==0) + { + $("#title_notice_span").text("标题不能为空"); + $("#title_notice_span").css('color','#ff0000'); + $("#title_notice_span").focus(); + return false; + } + else if(name.length <= 60) + { + $("#title_notice_span").text("填写正确"); + $("#title_notice_span").css('color','#008000'); + return true; + } + else + { + $("#title_notice_span").text("标题超过60个字符"); + $("#title_notice_span").css('color','#ff0000'); + $("#title_notice_span").focus(); + return false; + } +} +function regexDescription() +{ + var name = $("#news_description").val(); + if(name.length ==0) + { + $("#description_notice_span").text("描述不能为空"); + $("#description_notice_span").css('color','#ff0000'); + $("#description_notice_span").focus(); + return false; + } + else + { + $("#description_notice_span").text("填写正确"); + $("#description_notice_span").css('color','#008000'); + return true; + } +} + +function submitNews() +{ + if(regexTitle() && regexDescription()) + { + $("#news-form").submit(); + } +} + +function submitFocus(obj) +{ + $(obj).focus(); +} +/////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////// //验证搜索时输入名字 function regexName(content) { diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index f45f49112..17b193a44 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -22,6 +22,7 @@ a:hover,a:active{color:#000;} .ml15{ margin-left:15px;} .ml20{ margin-left:20px;} .ml45{ margin-left:45px;} +.ml55{ margin-left:55px;} .ml30{ margin-left:30px;} .ml60{ margin-left:60px;} .ml80{ margin-left:80px;} From 9af60424c2782b6c6bab15560fe35056fca77a4f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 14:14:11 +0800 Subject: [PATCH 148/175] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index b1ca39997..ebdb18c08 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -498,7 +498,6 @@ class CoursesController < ApplicationController @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all @course = Course.new - @course.op @course.safe_attributes = params[:course] month = Time.now.month render :layout => 'new_base' From 2ca2f908309217b75a629625fa26dc922e515f33 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 14:21:10 +0800 Subject: [PATCH 149/175] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6js?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/attachments.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 177909d25..4dcc4e744 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -21,15 +21,12 @@ function addFile(inputEl, file, eagerUpload) { var fileSpan = $('', { 'id': 'attachments_' + attachmentId, 'class':'attachment' }); fileSpan.append( + $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) , $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), $('   ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : $(inputEl).data('areYouSure') }).click(removeFile).toggle(!eagerUpload), - $('', { 'type': 'text', 'class': 'description','style':'margin-left: 9px;', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload), - $('公开:').attr({ 'class': 'ispublic-label ' ,'style':'margin-left: 15px;'}) , - $('', { 'type': 'checkbox', 'class': 'is_public_checkbox','style':'margin-left: 4px;','value':1, 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', checked:'checked' } ).toggle(!eagerUpload), - $(' ').attr({ 'href': "#", 'class': 'remove-upload ml5','style':'margin-left: 5px;', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload), $('
    ', { 'class': 'div_attachments', 'name': 'div_'+'attachments_' + attachmentId} ) ).appendTo('#attachments_fields'); From 8ee6f8a6f99cfaa1637b2293f0ab9a52547a0c07 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 14:25:17 +0800 Subject: [PATCH 150/175] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_attachement_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 59f1b66fd..b2ef7742c 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -22,7 +22,7 @@
    - + <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', From e6e1d5342fc9dc1ffda6e70ad39cba687c452bf1 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 14:26:25 +0800 Subject: [PATCH 151/175] =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=A1=86=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 69 ++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 4d30ce369..b00853980 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -372,6 +372,75 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} .link_file{ background:url(../images/pic_file.png) 0 7px no-repeat !important; padding-left:20px !important; color:#64bdd9 !important; } +/* colorbox +*******************************************************************************/ +/* + Colorbox Core Style: + The following CSS is consistent between example themes and should not be altered. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} + +/* + User Style: + Change the following styles to modify the appearance of Colorbox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. +*/ +#cboxOverlay{background:#fff;} +#colorbox{outline:0;} +#cboxTopLeft{width:25px; height:25px; background:url(/images/colorbox/border1.png) no-repeat 0 0;} +#cboxTopCenter{height:25px; background:url(/images/colorbox/border1.png) repeat-x 0 -50px;} +#cboxTopRight{width:25px; height:25px; background:url(/images/colorbox/border1.png) no-repeat -25px 0;} +#cboxBottomLeft{width:25px; height:25px; background:url(/images/colorbox/border1.png) no-repeat 0 -25px;} +#cboxBottomCenter{height:25px; background:url(/images/colorbox/border1.png) repeat-x 0 -75px;} +#cboxBottomRight{width:25px; height:25px; background:url(/images/colorbox/border1.png) no-repeat -25px -25px;} +#cboxMiddleLeft{width:25px; background:url(/images/colorbox/border2.png) repeat-y 0 0;} +#cboxMiddleRight{width:25px; background:url(/images/colorbox/border2.png) repeat-y -25px 0;} +#cboxContent{background:#fff; overflow:hidden;} +.cboxIframe{background:#fff;} +#cboxError{padding:50px; border:1px solid #ccc;} +#cboxLoadedContent{margin-bottom:20px;} +#cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;} +#cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;} +#cboxLoadingOverlay{background:#fff url(/images/colorbox/loading.gif) no-repeat 5px 5px;} + +/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ +#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + +/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ +#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + +#cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;} +#cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;} +#cboxNext{position:absolute; bottom:0px; left:63px; color:#444;} +#cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;} + +/* + The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill + when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9. + See: http://jacklmoore.com/notes/ie-transparency-problems/ +*/ +.cboxIE #cboxTopLeft, +.cboxIE #cboxTopCenter, +.cboxIE #cboxTopRight, +.cboxIE #cboxBottomLeft, +.cboxIE #cboxBottomCenter, +.cboxIE #cboxBottomRight, +.cboxIE #cboxMiddleLeft, +.cboxIE #cboxMiddleRight { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); +} + From 41e372c16a1440f46c50f3e12154b0a1d14f3e1e Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 14:51:59 +0800 Subject: [PATCH 152/175] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form_course.html.erb | 2 +- app/views/files/_attachement_list.html.erb | 2 +- public/javascripts/attachments.js | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/attachments/_form_course.html.erb b/app/views/attachments/_form_course.html.erb index 73b637c22..39c760690 100644 --- a/app/views/attachments/_form_course.html.erb +++ b/app/views/attachments/_form_course.html.erb @@ -38,7 +38,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> -<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn" %> +<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:class =>"sub_btn",:style => ie8? ? 'display:none' : '' %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index b2ef7742c..59f1b66fd 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -22,7 +22,7 @@
  • - + <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 4dcc4e744..ea385ae28 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -21,7 +21,6 @@ function addFile(inputEl, file, eagerUpload) { var fileSpan = $('', { 'id': 'attachments_' + attachmentId, 'class':'attachment' }); fileSpan.append( - $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name), $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 254, 'placeholder': $(inputEl).data('descriptionPlaceholder') } ).toggle(!eagerUpload), $(''+$(inputEl).data('fieldIsPublic')+':').attr({ 'class': 'ispublic-label' }) , From ef7949584c9b36eb8b4af3f396b25ea21b3df5e5 Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 15:02:13 +0800 Subject: [PATCH 153/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90tag?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=9B=9E=E9=80=80=E5=90=8E=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 8 ++++++++ app/views/tags/remove_tag_new.js.erb | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index bb9a44104..e26901320 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -317,6 +317,14 @@ class TagsController < ApplicationController when '8' @obj = OpenSourceProject.find_by_id(obj_id) @obj_pages, @open_source_projects_results, @results_count = for_pagination(get_open_source_projects_by_tag(selected_tags)) + when '10' + @obj = Attachment.find_by_id(obj_id) + + # modifed by Long Jun + # this is used to find the attachments that came from the same project and tagged with the same tag. + #@result = get_attachments_by_project_tag(selected_tags, @obj) + @result = get_attachments_by_tag(selected_tags) + @obj_pages, @attachments_results, @results_count = for_pagination(@result) when '9' then @obj = Course.find_by_id(obj_id) @obj_pages, @courses_results, @results_count = for_pagination(get_courses_by_tag(selected_tags)) diff --git a/app/views/tags/remove_tag_new.js.erb b/app/views/tags/remove_tag_new.js.erb index 24d52a35f..01edf3e1c 100644 --- a/app/views/tags/remove_tag_new.js.erb +++ b/app/views/tags/remove_tag_new.js.erb @@ -1,6 +1,11 @@ //本js使用的新的tag显示方法 <% if @object_flag == "6"%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% end %> +<% if @object_flag == "10"%> +$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); <% end %> \ No newline at end of file From 472ff76c72e5660cbc839dad89336a88cfcd7aa8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 15:13:03 +0800 Subject: [PATCH 154/175] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E6=97=B6=E5=BC=B9=E6=A1=86=E4=BD=8D=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_alert_anonyoms.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index 0361c01b7..6467b3f27 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -4,7 +4,7 @@ 开启匿评功能 -

    <%= l(:label_board) %>

    @@ -108,7 +52,7 @@ <%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %> <%= format_time(message.created_on) %>
    - <%= textilizable message,:content,:attachments => message.attachments %> +

    <%= textilizable message,:content,:attachments => message.attachments %>

    <%= link_to_attachments_course message, :author => false %>
    diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 9ea8159bd..ed6011e29 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -115,7 +115,7 @@
    <%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %><%= format_time(comment.created_on) %>
    - <%= textilizable(comment.comments) %> +

    <%= textilizable(comment.comments) %>

    <%= link_to_if_authorized_course image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> From 54908423bceca3748cf3cc196bffb4895c823c3b Mon Sep 17 00:00:00 2001 From: whimlex Date: Fri, 27 Mar 2015 17:00:23 +0800 Subject: [PATCH 173/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B--=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98;?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA=E9=99=84=E4=BB=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_links.html.erb | 6 ++---- app/views/layouts/base_homework.html.erb | 2 +- config/locales/projects/en.yml | 4 ++++ config/locales/projects/zh.yml | 6 ++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 4c2ee0c8f..02c7ba4dc 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -9,7 +9,7 @@ <% if options[:length] %> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> <% else %> - <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%> + <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true, :length => 32 -%> <% end %> <%if is_float%> @@ -26,9 +26,7 @@ <%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %> - ( - <%= number_to_human_size attachment.filesize %>) - + (<%= number_to_human_size attachment.filesize , :precision => 0 %>) <% if options[:deletable] %> <% if attachment.container_type == 'HomeworkAttach' %> <%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id}, diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index a858c045e..bb7b18a4a 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -178,7 +178,7 @@ - <% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false),:wrap => true,:length => 7} %> + <% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false),:wrap => true,:length => 15} %> <%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %> diff --git a/config/locales/projects/en.yml b/config/locales/projects/en.yml index 94344a8d6..9eadfc46f 100644 --- a/config/locales/projects/en.yml +++ b/config/locales/projects/en.yml @@ -136,7 +136,11 @@ en: # 项目托管平台 # # 问题跟踪 + label_issues_sum: 'Total' + lable_issues_undo: 'Unresolved:' label_successful_create: Successfully created + + # diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 880727bd9..9f1a95201 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -49,8 +49,7 @@ zh: label_issue_tracking: 问题跟踪 label_release_issue: 发布问题 - label_issues_sum: 问题总数: - lable_issues_undo: 未解决: + project_module_boards: 讨论区 project_module_boards_post: 发帖 @@ -144,6 +143,9 @@ zh: # # 问题跟踪 label_successful_create: 创建成功 + label_issues_sum: '问题总数' + lable_issues_undo: '未解决:' + # From 9fcdaee0ccb83801a4f7d1ea4f0be6d5cf9e091a Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 27 Mar 2015 17:42:28 +0800 Subject: [PATCH 174/175] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E5=9B=9E=E5=A4=8D=E5=90=8E=E9=99=84=E4=BB=B6=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/_course_show.html.erb | 6 +++--- app/views/messages/_form_course.html.erb | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 613444c15..58043b077 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -141,9 +141,9 @@ <% end %> <% if !@topic.locked? && authorize_for_course('messages', 'reply') %> @@ -162,7 +162,7 @@ { if(flag) { - $("#message-form").submit(); + $("#message_form").submit(); } } function regexContent() diff --git a/app/views/messages/_form_course.html.erb b/app/views/messages/_form_course.html.erb index e6dc99995..8f806ac97 100644 --- a/app/views/messages/_form_course.html.erb +++ b/app/views/messages/_form_course.html.erb @@ -35,7 +35,9 @@
  • - <%= render :partial => 'attachments/new_form', :locals => {:container => @message,:isReply => @isReply} %> +
    + <%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %> +
  • From 728f2896d8cf8249788bbd9150746567a3aac59a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 27 Mar 2015 17:43:19 +0800 Subject: [PATCH 175/175] =?UTF-8?q?windows=E4=B8=8B=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=93=E6=96=AD=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index fb0312d5b..58373cb06 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ group :development do if RUBY_VERSION >= '2.0.0' gem 'pry-byebug' else - gem 'pry-debugger' + # gem 'pry-debugger' end gem 'pry-stack_explorer' gem 'better_errors', '~> 1.1.0'