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 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); 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 %> + 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)));