editor修改
This commit is contained in:
parent
505d1b5546
commit
1809a93770
|
@ -1,5 +1,5 @@
|
||||||
<%= content_for(:header_tags) do %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%= import_ke(enable_at: true) %>
|
<%= import_ke(enable_at: false) %>
|
||||||
<%= javascript_include_tag 'create_kindeditor'%>
|
<%= javascript_include_tag 'create_kindeditor'%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -13,9 +13,7 @@ issue_desc_editor = KindEditor.create('#issue_description',
|
||||||
"resizeType":0,
|
"resizeType":0,
|
||||||
"no_label":true,
|
"no_label":true,
|
||||||
"autoHeightMode":true,
|
"autoHeightMode":true,
|
||||||
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\"),$(this.toolbar.div).hide();})",
|
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})",
|
||||||
"afterFocus":"eval(function(){$(this.toolbar.div).show();})",
|
|
||||||
"afterBlur":"eval(function(){$(this.toolbar.div).hide();})",
|
|
||||||
"emotionsBasePath":"http://localhost:3000","height":300,
|
"emotionsBasePath":"http://localhost:3000","height":300,
|
||||||
"allowFileManager":true,
|
"allowFileManager":true,
|
||||||
"uploadJson":"/kindeditor/upload",
|
"uploadJson":"/kindeditor/upload",
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
module RailsKindeditor
|
module RailsKindeditor
|
||||||
module Helper
|
module Helper
|
||||||
EVAL_STR = %Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin("autoheight"),$(this.toolbar.div).hide();})|
|
EVAL_STR = %Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin("autoheight")})|
|
||||||
EVAL_STR_AFTER_FOCUS = %Q|eval(function(){$(this.toolbar.div).show();})|
|
|
||||||
EVAL_STR_AFTER_BLUR = %Q|eval(function(){$(this.toolbar.div).hide();})|
|
|
||||||
|
|
||||||
def kindeditor_tag(name, content = nil, options = {})
|
def kindeditor_tag(name, content = nil, options = {})
|
||||||
id = sanitize_to_id(name)
|
id = sanitize_to_id(name)
|
||||||
|
@ -13,8 +11,6 @@ module RailsKindeditor
|
||||||
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
|
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
|
||||||
:autoHeightMode=>true,
|
:autoHeightMode=>true,
|
||||||
afterCreate: EVAL_STR,
|
afterCreate: EVAL_STR,
|
||||||
afterFocus:EVAL_STR_AFTER_FOCUS,
|
|
||||||
afterBlur:EVAL_STR_AFTER_BLUR,
|
|
||||||
emotionsBasePath: 'http://' + Setting.host_name
|
emotionsBasePath: 'http://' + Setting.host_name
|
||||||
)))
|
)))
|
||||||
end
|
end
|
||||||
|
@ -28,8 +24,6 @@ module RailsKindeditor
|
||||||
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
|
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
|
||||||
:autoHeightMode=>true,
|
:autoHeightMode=>true,
|
||||||
afterCreate: EVAL_STR,
|
afterCreate: EVAL_STR,
|
||||||
afterFocus:EVAL_STR_AFTER_FOCUS,
|
|
||||||
afterBlur:EVAL_STR_AFTER_BLUR,
|
|
||||||
emotionsBasePath: 'http://' + Setting.host_name
|
emotionsBasePath: 'http://' + Setting.host_name
|
||||||
)))
|
)))
|
||||||
end
|
end
|
||||||
|
|
|
@ -3932,9 +3932,7 @@ _extend(KToolbar, KWidget, {
|
||||||
pdiv = $("#define",container);
|
pdiv = $("#define",container);
|
||||||
}else if(!$("#full",container).is(':hidden')){
|
}else if(!$("#full",container).is(':hidden')){
|
||||||
pdiv = $("#full",container);
|
pdiv = $("#full",container);
|
||||||
}else if($("#full",container).is(':hidden') && $("#define",container).is(':hidden')){ //都隐藏的情况下
|
}
|
||||||
pdiv = $("#define", container);
|
|
||||||
}
|
|
||||||
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
|
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
|
||||||
},
|
},
|
||||||
select : function(name) {
|
select : function(name) {
|
||||||
|
@ -4731,21 +4729,15 @@ function _bindTabEvent() {
|
||||||
}
|
}
|
||||||
function _bindFocusEvent() {
|
function _bindFocusEvent() {
|
||||||
var self = this;
|
var self = this;
|
||||||
K(self.edit.textarea[0], self.edit.win).focus(function(e) {
|
K(self.edit.textarea[0], self.edit.win).focus(function(e) {
|
||||||
if(typeof self.afterFocus == 'string'){
|
if (self.afterFocus) {
|
||||||
self.afterFocus = eval(self.afterFocus);
|
self.afterFocus.call(self, e);
|
||||||
}
|
}
|
||||||
if ( typeof self.afterFocus == 'function') {
|
}).blur(function(e) {
|
||||||
self.afterFocus.call(self, e);
|
if (self.afterBlur) {
|
||||||
}
|
self.afterBlur.call(self, e);
|
||||||
}).blur(function(e) {
|
}
|
||||||
if(typeof self.afterBlur == 'string'){
|
});
|
||||||
self.afterBlur = eval(self.afterBlur);
|
|
||||||
}
|
|
||||||
if ( typeof self.afterBlur == 'function') {
|
|
||||||
self.afterBlur.call(self, e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function _removeBookmarkTag(html) {
|
function _removeBookmarkTag(html) {
|
||||||
return _trim(html.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, ''));
|
return _trim(html.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig, ''));
|
||||||
|
|
|
@ -1081,4 +1081,5 @@ img.date-trigger {
|
||||||
.proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
|
.proInfoP{color:#000000 !important; float:left; width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
|
||||||
|
|
||||||
a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
|
a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
|
||||||
a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
|
a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
|
||||||
|
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
|
Loading…
Reference in New Issue