From 57b1c0c7d80a50bd5420799b9c07f5d7a95ef29d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 17:02:50 +0800 Subject: [PATCH 01/11] =?UTF-8?q?at=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=88=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 ++++ config/settings.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0650db1cf..c4bbc4ebb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2727,6 +2727,10 @@ int main(int argc, char** argv){ opt = {enable_at: false, prettify: false, init_activity: false}.merge default_opt ss = '' + unless Setting.at_enabled? + opt[:enable_at] = false + end + ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg') if opt[:enable_at] ss += javascript_include_tag('/assets/kindeditor/at/jquery.caret.min.js', '/assets/kindeditor/at/jquery.atwho.js', '/assets/kindeditor/at/config.js') diff --git a/config/settings.yml b/config/settings.yml index 4286e0930..611ba8138 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -279,3 +279,5 @@ plugin_redmine_ckeditor: toolbar_can_collapse: '0' toolbar_location: top toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor +at_enabled: + default: 1 From 108448cf4d3dbb49634eec3fa177b7ec423a359d Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 17:28:47 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 1 + app/views/boards/_course_show.html.erb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 3545a8a22..0c3236d4e 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -153,6 +153,7 @@ class BoardsController < ApplicationController end end + @page = params[:page] ? params[:page].to_i + 1 : 0 @message = Message.new(:board => @board) #modify by nwb respond_to do |format| diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 4dcdb7749..de3b038e6 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -31,4 +31,5 @@ <%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %> <% end %> <% end %> - <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %> + <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %> + From 9dea58c921454484acfaaceacfb909170a3c49da Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 17:41:14 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E5=B0=86contentEditable=E6=94=B9?= =?UTF-8?q?=E4=B8=BAenable=5Fat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/at/config.js | 9 +++++---- public/assets/kindeditor/at/jquery.atwho.js | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/public/assets/kindeditor/at/config.js b/public/assets/kindeditor/at/config.js index f26685f00..45e7c3195 100644 --- a/public/assets/kindeditor/at/config.js +++ b/public/assets/kindeditor/at/config.js @@ -10,10 +10,11 @@ var enableAt = function(_editor) { var ifr = editor.edit.iframe[0]; var doc = ifr.contentDocument || iframe.contentWindow.document; var ifrBody = doc.body; - ifrBody.contentEditable = true; + //ifrBody.contentEditable = false; + $(ifrBody).attr('enable_at', 'true'); console.log("enable at"); - $.fn.atwho.debug = true; + //$.fn.atwho.debug = true; var names = []; @@ -41,6 +42,6 @@ var enableAt = function(_editor) { }; $inputor = $(ifrBody).atwho(at_config); - $inputor.caret('pos', 47); - $inputor.focus().atwho('run'); + //$inputor.caret('pos', 47); + //$inputor.focus().atwho('run'); }; diff --git a/public/assets/kindeditor/at/jquery.atwho.js b/public/assets/kindeditor/at/jquery.atwho.js index 1e6c8ec25..cd2caf6ca 100644 --- a/public/assets/kindeditor/at/jquery.atwho.js +++ b/public/assets/kindeditor/at/jquery.atwho.js @@ -97,7 +97,7 @@ App = (function() { App.prototype.reg = function(flag, setting) { var base, controller; - controller = (base = this.controllers)[flag] || (base[flag] = this.$inputor.is('[contentEditable]') ? new EditableController(this, flag) : new TextareaController(this, flag)); + controller = (base = this.controllers)[flag] || (base[flag] = this.$inputor.is('[enable_at]') ? new EditableController(this, flag) : new TextareaController(this, flag)); if (setting.alias) { this.aliasMaps[setting.alias] = flag; } @@ -1110,7 +1110,7 @@ $.fn.atwho = function(method) { var _args, result; _args = arguments; result = null; - this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function() { + this.filter('textarea, input, [contenteditable=""], [contenteditable=true], [enable_at=true]').each(function() { var $this, app; if (!(app = ($this = $(this)).data("atwho"))) { $this.data('atwho', (app = new App(this))); From 714dfdc2d54011360b12ec790340410af8fbb90e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 18 Dec 2015 17:51:22 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE=E7=82=B9=E5=87=BB=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=B5=84=E6=BA=90=E6=B2=A1=E5=8F=8D=E5=BA=94=E7=9A=84?= =?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/files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 68f7cc9cb..121cd3a42 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -24,7 +24,7 @@ class FilesController < ApplicationController before_filter :auth_login1, :only => [:index] before_filter :logged_user_by_apptoken,:only => [:index] before_filter :find_project_by_project_id#, :except => [:getattachtype] - before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment] + before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment,:search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache,:search_files_in_subfield] helper :sort include SortHelper From 009dc089f04de802e7455fe750c1e830003b725c Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 18 Dec 2015 17:55:15 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_resource.html.erb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/users/user_resource.html.erb b/app/views/users/user_resource.html.erb index ae17eb733..418809917 100644 --- a/app/views/users/user_resource.html.erb +++ b/app/views/users/user_resource.html.erb @@ -148,6 +148,10 @@ $("#resources_list").mousedown(function(e) { //如果是右键的话 if (3 == e.which) { + if( $("#res_name").length != 0 || $("#ajax-indicator").is(":hidden") == false){ //其他ajax在执行的时候阻止操作 + e.preventDefault(); + return ; + } document.oncontextmenu = function() {return false;} pageX = e.clientX; pageY = e.clientY; @@ -195,6 +199,9 @@ //隐藏右键菜单 //e.preventDefault(); $("#contextMenu").hide(); + if( $("#ajax-indicator").is(":hidden") == false && $("#res_name").length != 0 ){ //其他ajax在执行的时候或者res_name仍然存在阻止操作 + return ; + } document.oncontextmenu = function() {return true;} //如果当前行为空,那么要将当前行的拿到 var ele; @@ -363,7 +370,8 @@ res_link = line.children().eq(1).html(); line.children().eq(1).html( ' '); $("#res_name").focus(); @@ -401,7 +409,7 @@ type:'get', success:function (data) { - if (data != 'fail') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变 + if (data != 'fail' && name != undefined && name != 'undefined') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变 last_line.children().eq(1).html(res_link); last_line.children().eq(1).children().attr('title', name); last_line.children().eq(1).children().attr('href', data); From a657a5b98d0f195b4e0be84a75f4fd4eb63d41ad Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Fri, 18 Dec 2015 18:09:20 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80=20?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/words/_new_respond_course.html.erb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/words/_new_respond_course.html.erb b/app/views/words/_new_respond_course.html.erb index a939a55d4..5bd2a9f3c 100644 --- a/app/views/words/_new_respond_course.html.erb +++ b/app/views/words/_new_respond_course.html.erb @@ -1,4 +1,4 @@ -<%= form_tag(words_create_reply_path, :remote => true) do %> +<%= form_tag(words_create_reply_path, :remote => true,:id=>"form_#{journal.id}") do %> <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', :style => "resize: none;overflow: hidden;",:rows => 4, :placeholder => l(:label_feedback_respond_content)#, @@ -13,6 +13,20 @@
<%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "reply_btn"%> + :class => "reply_btn" ,:onclick=>"form_sub_#{ journal.id}($(this),event)"%> -<% end %> \ No newline at end of file +<% end %> + From 6a563d4256956301893c0c0091887354fca3c2f8 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 18:47:36 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E5=8F=AF=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E6=88=AA=E6=AD=A2=E6=97=A5=E6=9C=9F=EF=BC=8C=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=8F=91=E5=B8=83=E5=90=8E=E4=B8=8D=E5=8F=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=8F=91=E5=B8=83=E6=97=A5?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 265118def..a060cf386 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -26,14 +26,18 @@ <% end %>
- <%= calendar_for('homework_end_time')%> + <% if homework.homework_detail_manual.comment_status.to_i < 3 %> + <%= calendar_for('homework_end_time')%> + <% end %>
<% if edit_mode %> <% end %>
- <%= calendar_for('homework_publish_time')%> + <% if homework.homework_detail_manual.comment_status.to_i == 0 %> + <%= calendar_for('homework_publish_time')%> + <% end %>
From 08cd3808ad2226412b1bbcd7bc8084313d8c479e Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 18 Dec 2015 19:47:06 +0800 Subject: [PATCH 08/11] =?UTF-8?q?ke=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_newfeedback.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 30ba54b28..f53983228 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -1,6 +1,6 @@ <%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> - <%= javascript_include_tag "user" %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> + <%= javascript_include_tag "init_KindEditor","user" %> <% end %>