....
This commit is contained in:
parent
4269ea2894
commit
d7e54c9d87
File diff suppressed because one or more lines are too long
@ -157,7 +157,7 @@ function _extend(child, parent, proto) {
|
|||||||
child.prototype = childProto;
|
child.prototype = childProto;
|
||||||
child.parent = parent ? parent.prototype : null;
|
child.parent = parent ? parent.prototype : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _json(text) {
|
function _json(text) {
|
||||||
var match;
|
var match;
|
||||||
if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) {
|
if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) {
|
||||||
@ -317,9 +317,9 @@ K.options = {
|
|||||||
|
|
||||||
|
|
||||||
var _useCapture = false;
|
var _useCapture = false;
|
||||||
|
|
||||||
var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222');
|
var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222');
|
||||||
var _CURSORMOVE_KEY_MAP = _toMap('33..40');
|
var _CURSORMOVE_KEY_MAP = _toMap('33..40');
|
||||||
var _CHANGE_KEY_MAP = {};
|
var _CHANGE_KEY_MAP = {};
|
||||||
_each(_INPUT_KEY_MAP, function(key, val) {
|
_each(_INPUT_KEY_MAP, function(key, val) {
|
||||||
_CHANGE_KEY_MAP[key] = val;
|
_CHANGE_KEY_MAP[key] = val;
|
||||||
@ -327,14 +327,14 @@ _each(_INPUT_KEY_MAP, function(key, val) {
|
|||||||
_each(_CURSORMOVE_KEY_MAP, function(key, val) {
|
_each(_CURSORMOVE_KEY_MAP, function(key, val) {
|
||||||
_CHANGE_KEY_MAP[key] = val;
|
_CHANGE_KEY_MAP[key] = val;
|
||||||
});
|
});
|
||||||
|
|
||||||
function _bindEvent(el, type, fn) {
|
function _bindEvent(el, type, fn) {
|
||||||
if (el.addEventListener){
|
if (el.addEventListener){
|
||||||
el.addEventListener(type, fn, _useCapture);
|
el.addEventListener(type, fn, _useCapture);
|
||||||
} else if (el.attachEvent){
|
} else if (el.attachEvent){
|
||||||
el.attachEvent('on' + type, fn);
|
el.attachEvent('on' + type, fn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _unbindEvent(el, type, fn) {
|
function _unbindEvent(el, type, fn) {
|
||||||
if (el.removeEventListener){
|
if (el.removeEventListener){
|
||||||
el.removeEventListener(type, fn, _useCapture);
|
el.removeEventListener(type, fn, _useCapture);
|
||||||
@ -345,7 +345,7 @@ function _unbindEvent(el, type, fn) {
|
|||||||
var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' +
|
var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' +
|
||||||
'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' +
|
'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' +
|
||||||
'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(',');
|
'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(',');
|
||||||
|
|
||||||
function KEvent(el, event) {
|
function KEvent(el, event) {
|
||||||
this.init(el, event);
|
this.init(el, event);
|
||||||
}
|
}
|
||||||
@ -902,7 +902,7 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
|
|||||||
html = html.replace(/\n\s*\n/g, '\n');
|
html = html.replace(/\n\s*\n/g, '\n');
|
||||||
html = html.replace(/<span id="__kindeditor_pre_newline__">\n/g, '\n');
|
html = html.replace(/<span id="__kindeditor_pre_newline__">\n/g, '\n');
|
||||||
return _trim(html);
|
return _trim(html);
|
||||||
}
|
}
|
||||||
function _clearMsWord(html, htmlTags) {
|
function _clearMsWord(html, htmlTags) {
|
||||||
html = html.replace(/<meta[\s\S]*?>/ig, '')
|
html = html.replace(/<meta[\s\S]*?>/ig, '')
|
||||||
.replace(/<![\s\S]*?>/ig, '')
|
.replace(/<![\s\S]*?>/ig, '')
|
||||||
@ -915,7 +915,7 @@ function _clearMsWord(html, htmlTags) {
|
|||||||
return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1');
|
return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1');
|
||||||
});
|
});
|
||||||
return _formatHtml(html, htmlTags);
|
return _formatHtml(html, htmlTags);
|
||||||
}
|
}
|
||||||
function _mediaType(src) {
|
function _mediaType(src) {
|
||||||
if (/\.(rm|rmvb)(\?|$)/i.test(src)) {
|
if (/\.(rm|rmvb)(\?|$)/i.test(src)) {
|
||||||
return 'audio/x-pn-realaudio-plugin';
|
return 'audio/x-pn-realaudio-plugin';
|
||||||
@ -936,7 +936,7 @@ function _mediaType(src) {
|
|||||||
return 'video/webm';
|
return 'video/webm';
|
||||||
}
|
}
|
||||||
return 'video/x-ms-asf-plugin';
|
return 'video/x-ms-asf-plugin';
|
||||||
}
|
}
|
||||||
function _mediaClass(type) {
|
function _mediaClass(type) {
|
||||||
if (/realaudio/i.test(type)) {
|
if (/realaudio/i.test(type)) {
|
||||||
return 'ke-rm';
|
return 'ke-rm';
|
||||||
@ -960,7 +960,7 @@ function _mediaEmbed(attrs) {
|
|||||||
if (val=='video/webm') video = true;
|
if (val=='video/webm') video = true;
|
||||||
});
|
});
|
||||||
html += '/>';
|
html += '/>';
|
||||||
|
|
||||||
if (video) {
|
if (video) {
|
||||||
html = '<video ';
|
html = '<video ';
|
||||||
_each(attrs, function(key, val){
|
_each(attrs, function(key, val){
|
||||||
@ -971,12 +971,12 @@ function _mediaEmbed(attrs) {
|
|||||||
html += "loop=\"loop\"";
|
html += "loop=\"loop\"";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html += key + '="' + val +'" ';
|
html += key + '="' + val +'" ';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
html += "controls=\"controls\">您的浏览器太老了,不支持html5视频播放!请更换新的浏览器!</video>";
|
html += "controls=\"controls\">您的浏览器太老了,不支持html5视频播放!请更换新的浏览器!</video>";
|
||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
function _mediaImg(blankPath, attrs) {
|
function _mediaImg(blankPath, attrs) {
|
||||||
@ -1002,7 +1002,9 @@ function _mediaImg(blankPath, attrs) {
|
|||||||
html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />';
|
html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />';
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _tmpl(str, data) {
|
function _tmpl(str, data) {
|
||||||
var fn = new Function("obj",
|
var fn = new Function("obj",
|
||||||
"var p=[],print=function(){p.push.apply(p,arguments);};" +
|
"var p=[],print=function(){p.push.apply(p,arguments);};" +
|
||||||
@ -1339,7 +1341,7 @@ function _getScrollPos(doc) {
|
|||||||
}
|
}
|
||||||
return {x : x, y : y};
|
return {x : x, y : y};
|
||||||
}
|
}
|
||||||
|
|
||||||
function KNode(node) {
|
function KNode(node) {
|
||||||
this.init(node);
|
this.init(node);
|
||||||
}
|
}
|
||||||
@ -1975,7 +1977,7 @@ function _copyAndDelete(range, isCopy, isDelete) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isCopy ? frag : range;
|
return isCopy ? frag : range;
|
||||||
}
|
}
|
||||||
function _moveToElementText(range, el) {
|
function _moveToElementText(range, el) {
|
||||||
var node = el;
|
var node = el;
|
||||||
while (node) {
|
while (node) {
|
||||||
@ -1988,7 +1990,7 @@ function _moveToElementText(range, el) {
|
|||||||
try {
|
try {
|
||||||
range.moveToElementText(el);
|
range.moveToElementText(el);
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
function _getStartEnd(rng, isStart) {
|
function _getStartEnd(rng, isStart) {
|
||||||
var doc = rng.parentElement().ownerDocument,
|
var doc = rng.parentElement().ownerDocument,
|
||||||
pointRange = rng.duplicate();
|
pointRange = rng.duplicate();
|
||||||
@ -2053,7 +2055,7 @@ function _getStartEnd(rng, isStart) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {node: startNode, offset: startPos};
|
return {node: startNode, offset: startPos};
|
||||||
}
|
}
|
||||||
function _getEndRange(node, offset) {
|
function _getEndRange(node, offset) {
|
||||||
var doc = node.ownerDocument || node,
|
var doc = node.ownerDocument || node,
|
||||||
range = doc.body.createTextRange();
|
range = doc.body.createTextRange();
|
||||||
@ -2110,7 +2112,7 @@ function _getEndRange(node, offset) {
|
|||||||
range.moveStart('character', offset);
|
range.moveStart('character', offset);
|
||||||
K(dummy).remove();
|
K(dummy).remove();
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
function _toRange(rng) {
|
function _toRange(rng) {
|
||||||
var doc, range;
|
var doc, range;
|
||||||
function tr2td(start) {
|
function tr2td(start) {
|
||||||
@ -2143,7 +2145,7 @@ function _toRange(rng) {
|
|||||||
range.setEnd(rng.endContainer, rng.endOffset);
|
range.setEnd(rng.endContainer, rng.endOffset);
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
function KRange(doc) {
|
function KRange(doc) {
|
||||||
this.init(doc);
|
this.init(doc);
|
||||||
}
|
}
|
||||||
@ -2561,12 +2563,12 @@ K.START_TO_END = _START_TO_END;
|
|||||||
K.END_TO_END = _END_TO_END;
|
K.END_TO_END = _END_TO_END;
|
||||||
K.END_TO_START = _END_TO_START;
|
K.END_TO_START = _END_TO_START;
|
||||||
|
|
||||||
|
|
||||||
function _nativeCommand(doc, key, val) {
|
function _nativeCommand(doc, key, val) {
|
||||||
try {
|
try {
|
||||||
doc.execCommand(key, false, val);
|
doc.execCommand(key, false, val);
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
function _nativeCommandValue(doc, key) {
|
function _nativeCommandValue(doc, key) {
|
||||||
var val = '';
|
var val = '';
|
||||||
try {
|
try {
|
||||||
@ -2576,11 +2578,11 @@ function _nativeCommandValue(doc, key) {
|
|||||||
val = '';
|
val = '';
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
function _getSel(doc) {
|
function _getSel(doc) {
|
||||||
var win = _getWin(doc);
|
var win = _getWin(doc);
|
||||||
return _IERANGE ? doc.selection : win.getSelection();
|
return _IERANGE ? doc.selection : win.getSelection();
|
||||||
}
|
}
|
||||||
function _getRng(doc) {
|
function _getRng(doc) {
|
||||||
var sel = _getSel(doc), rng;
|
var sel = _getSel(doc), rng;
|
||||||
try {
|
try {
|
||||||
@ -2594,7 +2596,7 @@ function _getRng(doc) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return rng;
|
return rng;
|
||||||
}
|
}
|
||||||
function _singleKeyMap(map) {
|
function _singleKeyMap(map) {
|
||||||
var newMap = {}, arr, v;
|
var newMap = {}, arr, v;
|
||||||
_each(map, function(key, val) {
|
_each(map, function(key, val) {
|
||||||
@ -2605,7 +2607,7 @@ function _singleKeyMap(map) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return newMap;
|
return newMap;
|
||||||
}
|
}
|
||||||
function _hasAttrOrCss(knode, map) {
|
function _hasAttrOrCss(knode, map) {
|
||||||
return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map);
|
return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map);
|
||||||
}
|
}
|
||||||
@ -2636,7 +2638,7 @@ function _hasAttrOrCssByKey(knode, map, mapKey) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function _removeAttrOrCss(knode, map) {
|
function _removeAttrOrCss(knode, map) {
|
||||||
if (knode.type != 1) {
|
if (knode.type != 1) {
|
||||||
return;
|
return;
|
||||||
@ -2674,20 +2676,23 @@ function _removeAttrOrCssByKey(knode, map, mapKey) {
|
|||||||
if (allFlag) {
|
if (allFlag) {
|
||||||
knode.remove(true);
|
knode.remove(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _getInnerNode(knode) {
|
function _getInnerNode(knode) {
|
||||||
var inner = knode;
|
var inner = knode;
|
||||||
while (inner.first()) {
|
while (inner.first()) {
|
||||||
inner = inner.first();
|
inner = inner.first();
|
||||||
}
|
}
|
||||||
return inner;
|
return inner;
|
||||||
}
|
}
|
||||||
function _isEmptyNode(knode) {
|
function _isEmptyNode(knode) {
|
||||||
if (knode.type != 1 || knode.isSingle()) {
|
if (knode.type != 1 || knode.isSingle()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return knode.html().replace(/<[^>]+>/g, '') === '';
|
return knode.html().replace(/<[^>]+>/g, '') === '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _mergeWrapper(a, b) {
|
function _mergeWrapper(a, b) {
|
||||||
a = a.clone(true);
|
a = a.clone(true);
|
||||||
var lastA = _getInnerNode(a), childA = a, merged = false;
|
var lastA = _getInnerNode(a), childA = a, merged = false;
|
||||||
@ -2706,7 +2711,7 @@ function _mergeWrapper(a, b) {
|
|||||||
b = b.first();
|
b = b.first();
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
function _wrapNode(knode, wrapper) {
|
function _wrapNode(knode, wrapper) {
|
||||||
wrapper = wrapper.clone(true);
|
wrapper = wrapper.clone(true);
|
||||||
if (knode.type == 3) {
|
if (knode.type == 3) {
|
||||||
@ -2730,7 +2735,7 @@ function _wrapNode(knode, wrapper) {
|
|||||||
}
|
}
|
||||||
nodeWrapper.replaceWith(wrapper);
|
nodeWrapper.replaceWith(wrapper);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
function _mergeAttrs(knode, attrs, styles) {
|
function _mergeAttrs(knode, attrs, styles) {
|
||||||
_each(attrs, function(key, val) {
|
_each(attrs, function(key, val) {
|
||||||
if (key !== 'style') {
|
if (key !== 'style') {
|
||||||
@ -2740,7 +2745,7 @@ function _mergeAttrs(knode, attrs, styles) {
|
|||||||
_each(styles, function(key, val) {
|
_each(styles, function(key, val) {
|
||||||
knode.css(key, val);
|
knode.css(key, val);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function _inPreElement(knode) {
|
function _inPreElement(knode) {
|
||||||
while (knode && knode.name != 'body') {
|
while (knode && knode.name != 'body') {
|
||||||
if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) {
|
if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) {
|
||||||
@ -2749,7 +2754,7 @@ function _inPreElement(knode) {
|
|||||||
knode = knode.parent();
|
knode = knode.parent();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function KCmd(range) {
|
function KCmd(range) {
|
||||||
this.init(range);
|
this.init(range);
|
||||||
}
|
}
|
||||||
@ -3433,7 +3438,7 @@ function _drag(options) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function KWidget(options) {
|
function KWidget(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -3673,7 +3678,7 @@ function _elementVal(knode, val) {
|
|||||||
}
|
}
|
||||||
return knode.html(val);
|
return knode.html(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
function KEdit(options) {
|
function KEdit(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -3934,7 +3939,7 @@ function _selectToolbar(name, fn) {
|
|||||||
fn(knode);
|
fn(knode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function KToolbar(options) {
|
function KToolbar(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4054,7 +4059,7 @@ function _toolbar(options) {
|
|||||||
K.ToolbarClass = KToolbar;
|
K.ToolbarClass = KToolbar;
|
||||||
K.toolbar = _toolbar;
|
K.toolbar = _toolbar;
|
||||||
|
|
||||||
|
|
||||||
function KMenu(options) {
|
function KMenu(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4137,7 +4142,7 @@ function _menu(options) {
|
|||||||
K.MenuClass = KMenu;
|
K.MenuClass = KMenu;
|
||||||
K.menu = _menu;
|
K.menu = _menu;
|
||||||
|
|
||||||
|
|
||||||
function KColorPicker(options) {
|
function KColorPicker(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4319,7 +4324,7 @@ function _createButton(arg) {
|
|||||||
span.append(btn);
|
span.append(btn);
|
||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
function KDialog(options) {
|
function KDialog(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4518,7 +4523,7 @@ function _loadScript(url, fn) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function _chopQuery(url) {
|
function _chopQuery(url) {
|
||||||
var index = url.indexOf('?');
|
var index = url.indexOf('?');
|
||||||
return index > 0 ? url.substr(0, index) : url;
|
return index > 0 ? url.substr(0, index) : url;
|
||||||
@ -4614,7 +4619,7 @@ function _lang(mixed, langType) {
|
|||||||
_language[langType][obj.ns][obj.key] = val;
|
_language[langType][obj.ns][obj.key] = val;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getImageFromRange(range, fn) {
|
function _getImageFromRange(range, fn) {
|
||||||
if (range.collapsed) {
|
if (range.collapsed) {
|
||||||
return;
|
return;
|
||||||
@ -4825,7 +4830,8 @@ function _addBookmarkToStack(stack, bookmark) {
|
|||||||
stack.push(bookmark);
|
stack.push(bookmark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function _undoToRedo(fromStack, toStack) {
|
function _undoToRedo(fromStack, toStack) {
|
||||||
var self = this, edit = self.edit,
|
var self = this, edit = self.edit,
|
||||||
body = edit.doc.body,
|
body = edit.doc.body,
|
||||||
@ -5584,7 +5590,7 @@ K.appendHtml = function(expr, val) {
|
|||||||
this.appendHtml(val);
|
this.appendHtml(val);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_IE && _V < 7) {
|
if (_IE && _V < 7) {
|
||||||
_nativeCommand(document, 'BackgroundImageCache', true);
|
_nativeCommand(document, 'BackgroundImageCache', true);
|
||||||
}
|
}
|
||||||
@ -5594,7 +5600,7 @@ K.create = _create;
|
|||||||
K.instances = _instances;
|
K.instances = _instances;
|
||||||
K.plugin = _plugin;
|
K.plugin = _plugin;
|
||||||
K.lang = _lang;
|
K.lang = _lang;
|
||||||
|
|
||||||
_plugin('core', function(K) {
|
_plugin('core', function(K) {
|
||||||
var self = this,
|
var self = this,
|
||||||
shortcutKeys = {
|
shortcutKeys = {
|
||||||
@ -6495,7 +6501,7 @@ KindEditor.plugin('baidumap', function(K) {
|
|||||||
* @site http://www.kindsoft.net/
|
* @site http://www.kindsoft.net/
|
||||||
* @licence http://www.kindsoft.net/license.php
|
* @licence http://www.kindsoft.net/license.php
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
KindEditor.plugin('map', function(K) {
|
KindEditor.plugin('map', function(K) {
|
||||||
var self = this, name = 'map', lang = self.lang(name + '.');
|
var self = this, name = 'map', lang = self.lang(name + '.');
|
||||||
self.clickToolbar(name, function() {
|
self.clickToolbar(name, function() {
|
||||||
@ -6655,7 +6661,8 @@ KindEditor.plugin('clearhtml', function(K) {
|
|||||||
* @site http://www.kindsoft.net/
|
* @site http://www.kindsoft.net/
|
||||||
* @licence http://www.kindsoft.net/license.php
|
* @licence http://www.kindsoft.net/license.php
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
KindEditor.plugin('code', function(K) {
|
KindEditor.plugin('code', function(K) {
|
||||||
var self = this, name = 'code';
|
var self = this, name = 'code';
|
||||||
self.clickToolbar(name, function() {
|
self.clickToolbar(name, function() {
|
||||||
|
|||||||
@ -156,7 +156,7 @@ function _extend(child, parent, proto) {
|
|||||||
child.prototype = childProto;
|
child.prototype = childProto;
|
||||||
child.parent = parent ? parent.prototype : null;
|
child.parent = parent ? parent.prototype : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _json(text) {
|
function _json(text) {
|
||||||
var match;
|
var match;
|
||||||
if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) {
|
if ((match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text))) {
|
||||||
@ -316,9 +316,9 @@ K.options = {
|
|||||||
|
|
||||||
|
|
||||||
var _useCapture = false;
|
var _useCapture = false;
|
||||||
|
|
||||||
var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222');
|
var _INPUT_KEY_MAP = _toMap('8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222');
|
||||||
var _CURSORMOVE_KEY_MAP = _toMap('33..40');
|
var _CURSORMOVE_KEY_MAP = _toMap('33..40');
|
||||||
var _CHANGE_KEY_MAP = {};
|
var _CHANGE_KEY_MAP = {};
|
||||||
_each(_INPUT_KEY_MAP, function(key, val) {
|
_each(_INPUT_KEY_MAP, function(key, val) {
|
||||||
_CHANGE_KEY_MAP[key] = val;
|
_CHANGE_KEY_MAP[key] = val;
|
||||||
@ -326,14 +326,14 @@ _each(_INPUT_KEY_MAP, function(key, val) {
|
|||||||
_each(_CURSORMOVE_KEY_MAP, function(key, val) {
|
_each(_CURSORMOVE_KEY_MAP, function(key, val) {
|
||||||
_CHANGE_KEY_MAP[key] = val;
|
_CHANGE_KEY_MAP[key] = val;
|
||||||
});
|
});
|
||||||
|
|
||||||
function _bindEvent(el, type, fn) {
|
function _bindEvent(el, type, fn) {
|
||||||
if (el.addEventListener){
|
if (el.addEventListener){
|
||||||
el.addEventListener(type, fn, _useCapture);
|
el.addEventListener(type, fn, _useCapture);
|
||||||
} else if (el.attachEvent){
|
} else if (el.attachEvent){
|
||||||
el.attachEvent('on' + type, fn);
|
el.attachEvent('on' + type, fn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _unbindEvent(el, type, fn) {
|
function _unbindEvent(el, type, fn) {
|
||||||
if (el.removeEventListener){
|
if (el.removeEventListener){
|
||||||
el.removeEventListener(type, fn, _useCapture);
|
el.removeEventListener(type, fn, _useCapture);
|
||||||
@ -344,7 +344,7 @@ function _unbindEvent(el, type, fn) {
|
|||||||
var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' +
|
var _EVENT_PROPS = ('altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,' +
|
||||||
'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' +
|
'data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,' +
|
||||||
'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(',');
|
'pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which').split(',');
|
||||||
|
|
||||||
function KEvent(el, event) {
|
function KEvent(el, event) {
|
||||||
this.init(el, event);
|
this.init(el, event);
|
||||||
}
|
}
|
||||||
@ -901,7 +901,7 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
|
|||||||
html = html.replace(/\n\s*\n/g, '\n');
|
html = html.replace(/\n\s*\n/g, '\n');
|
||||||
html = html.replace(/<span id="__kindeditor_pre_newline__">\n/g, '\n');
|
html = html.replace(/<span id="__kindeditor_pre_newline__">\n/g, '\n');
|
||||||
return _trim(html);
|
return _trim(html);
|
||||||
}
|
}
|
||||||
function _clearMsWord(html, htmlTags) {
|
function _clearMsWord(html, htmlTags) {
|
||||||
html = html.replace(/<meta[\s\S]*?>/ig, '')
|
html = html.replace(/<meta[\s\S]*?>/ig, '')
|
||||||
.replace(/<![\s\S]*?>/ig, '')
|
.replace(/<![\s\S]*?>/ig, '')
|
||||||
@ -914,7 +914,7 @@ function _clearMsWord(html, htmlTags) {
|
|||||||
return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1');
|
return full.replace(/border-bottom:([#\w\s]+)/ig, 'border:$1');
|
||||||
});
|
});
|
||||||
return _formatHtml(html, htmlTags);
|
return _formatHtml(html, htmlTags);
|
||||||
}
|
}
|
||||||
function _mediaType(src) {
|
function _mediaType(src) {
|
||||||
if (/\.(rm|rmvb)(\?|$)/i.test(src)) {
|
if (/\.(rm|rmvb)(\?|$)/i.test(src)) {
|
||||||
return 'audio/x-pn-realaudio-plugin';
|
return 'audio/x-pn-realaudio-plugin';
|
||||||
@ -923,7 +923,7 @@ function _mediaType(src) {
|
|||||||
return 'application/x-shockwave-flash';
|
return 'application/x-shockwave-flash';
|
||||||
}
|
}
|
||||||
return 'video/x-ms-asf-plugin';
|
return 'video/x-ms-asf-plugin';
|
||||||
}
|
}
|
||||||
function _mediaClass(type) {
|
function _mediaClass(type) {
|
||||||
if (/realaudio/i.test(type)) {
|
if (/realaudio/i.test(type)) {
|
||||||
return 'ke-rm';
|
return 'ke-rm';
|
||||||
@ -967,7 +967,9 @@ function _mediaImg(blankPath, attrs) {
|
|||||||
html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />';
|
html += 'data-ke-tag="' + escape(srcTag) + '" alt="" />';
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _tmpl(str, data) {
|
function _tmpl(str, data) {
|
||||||
var fn = new Function("obj",
|
var fn = new Function("obj",
|
||||||
"var p=[],print=function(){p.push.apply(p,arguments);};" +
|
"var p=[],print=function(){p.push.apply(p,arguments);};" +
|
||||||
@ -1304,7 +1306,7 @@ function _getScrollPos(doc) {
|
|||||||
}
|
}
|
||||||
return {x : x, y : y};
|
return {x : x, y : y};
|
||||||
}
|
}
|
||||||
|
|
||||||
function KNode(node) {
|
function KNode(node) {
|
||||||
this.init(node);
|
this.init(node);
|
||||||
}
|
}
|
||||||
@ -1940,7 +1942,7 @@ function _copyAndDelete(range, isCopy, isDelete) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isCopy ? frag : range;
|
return isCopy ? frag : range;
|
||||||
}
|
}
|
||||||
function _moveToElementText(range, el) {
|
function _moveToElementText(range, el) {
|
||||||
var node = el;
|
var node = el;
|
||||||
while (node) {
|
while (node) {
|
||||||
@ -1953,7 +1955,7 @@ function _moveToElementText(range, el) {
|
|||||||
try {
|
try {
|
||||||
range.moveToElementText(el);
|
range.moveToElementText(el);
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
function _getStartEnd(rng, isStart) {
|
function _getStartEnd(rng, isStart) {
|
||||||
var doc = rng.parentElement().ownerDocument,
|
var doc = rng.parentElement().ownerDocument,
|
||||||
pointRange = rng.duplicate();
|
pointRange = rng.duplicate();
|
||||||
@ -2018,7 +2020,7 @@ function _getStartEnd(rng, isStart) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {node: startNode, offset: startPos};
|
return {node: startNode, offset: startPos};
|
||||||
}
|
}
|
||||||
function _getEndRange(node, offset) {
|
function _getEndRange(node, offset) {
|
||||||
var doc = node.ownerDocument || node,
|
var doc = node.ownerDocument || node,
|
||||||
range = doc.body.createTextRange();
|
range = doc.body.createTextRange();
|
||||||
@ -2075,7 +2077,7 @@ function _getEndRange(node, offset) {
|
|||||||
range.moveStart('character', offset);
|
range.moveStart('character', offset);
|
||||||
K(dummy).remove();
|
K(dummy).remove();
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
function _toRange(rng) {
|
function _toRange(rng) {
|
||||||
var doc, range;
|
var doc, range;
|
||||||
function tr2td(start) {
|
function tr2td(start) {
|
||||||
@ -2108,7 +2110,7 @@ function _toRange(rng) {
|
|||||||
range.setEnd(rng.endContainer, rng.endOffset);
|
range.setEnd(rng.endContainer, rng.endOffset);
|
||||||
return range;
|
return range;
|
||||||
}
|
}
|
||||||
|
|
||||||
function KRange(doc) {
|
function KRange(doc) {
|
||||||
this.init(doc);
|
this.init(doc);
|
||||||
}
|
}
|
||||||
@ -2526,12 +2528,12 @@ K.START_TO_END = _START_TO_END;
|
|||||||
K.END_TO_END = _END_TO_END;
|
K.END_TO_END = _END_TO_END;
|
||||||
K.END_TO_START = _END_TO_START;
|
K.END_TO_START = _END_TO_START;
|
||||||
|
|
||||||
|
|
||||||
function _nativeCommand(doc, key, val) {
|
function _nativeCommand(doc, key, val) {
|
||||||
try {
|
try {
|
||||||
doc.execCommand(key, false, val);
|
doc.execCommand(key, false, val);
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
function _nativeCommandValue(doc, key) {
|
function _nativeCommandValue(doc, key) {
|
||||||
var val = '';
|
var val = '';
|
||||||
try {
|
try {
|
||||||
@ -2541,11 +2543,11 @@ function _nativeCommandValue(doc, key) {
|
|||||||
val = '';
|
val = '';
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
function _getSel(doc) {
|
function _getSel(doc) {
|
||||||
var win = _getWin(doc);
|
var win = _getWin(doc);
|
||||||
return _IERANGE ? doc.selection : win.getSelection();
|
return _IERANGE ? doc.selection : win.getSelection();
|
||||||
}
|
}
|
||||||
function _getRng(doc) {
|
function _getRng(doc) {
|
||||||
var sel = _getSel(doc), rng;
|
var sel = _getSel(doc), rng;
|
||||||
try {
|
try {
|
||||||
@ -2559,7 +2561,7 @@ function _getRng(doc) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return rng;
|
return rng;
|
||||||
}
|
}
|
||||||
function _singleKeyMap(map) {
|
function _singleKeyMap(map) {
|
||||||
var newMap = {}, arr, v;
|
var newMap = {}, arr, v;
|
||||||
_each(map, function(key, val) {
|
_each(map, function(key, val) {
|
||||||
@ -2570,7 +2572,7 @@ function _singleKeyMap(map) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return newMap;
|
return newMap;
|
||||||
}
|
}
|
||||||
function _hasAttrOrCss(knode, map) {
|
function _hasAttrOrCss(knode, map) {
|
||||||
return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map);
|
return _hasAttrOrCssByKey(knode, map, '*') || _hasAttrOrCssByKey(knode, map);
|
||||||
}
|
}
|
||||||
@ -2601,7 +2603,7 @@ function _hasAttrOrCssByKey(knode, map, mapKey) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function _removeAttrOrCss(knode, map) {
|
function _removeAttrOrCss(knode, map) {
|
||||||
if (knode.type != 1) {
|
if (knode.type != 1) {
|
||||||
return;
|
return;
|
||||||
@ -2639,20 +2641,23 @@ function _removeAttrOrCssByKey(knode, map, mapKey) {
|
|||||||
if (allFlag) {
|
if (allFlag) {
|
||||||
knode.remove(true);
|
knode.remove(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function _getInnerNode(knode) {
|
function _getInnerNode(knode) {
|
||||||
var inner = knode;
|
var inner = knode;
|
||||||
while (inner.first()) {
|
while (inner.first()) {
|
||||||
inner = inner.first();
|
inner = inner.first();
|
||||||
}
|
}
|
||||||
return inner;
|
return inner;
|
||||||
}
|
}
|
||||||
function _isEmptyNode(knode) {
|
function _isEmptyNode(knode) {
|
||||||
if (knode.type != 1 || knode.isSingle()) {
|
if (knode.type != 1 || knode.isSingle()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return knode.html().replace(/<[^>]+>/g, '') === '';
|
return knode.html().replace(/<[^>]+>/g, '') === '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _mergeWrapper(a, b) {
|
function _mergeWrapper(a, b) {
|
||||||
a = a.clone(true);
|
a = a.clone(true);
|
||||||
var lastA = _getInnerNode(a), childA = a, merged = false;
|
var lastA = _getInnerNode(a), childA = a, merged = false;
|
||||||
@ -2671,7 +2676,7 @@ function _mergeWrapper(a, b) {
|
|||||||
b = b.first();
|
b = b.first();
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
function _wrapNode(knode, wrapper) {
|
function _wrapNode(knode, wrapper) {
|
||||||
wrapper = wrapper.clone(true);
|
wrapper = wrapper.clone(true);
|
||||||
if (knode.type == 3) {
|
if (knode.type == 3) {
|
||||||
@ -2695,7 +2700,7 @@ function _wrapNode(knode, wrapper) {
|
|||||||
}
|
}
|
||||||
nodeWrapper.replaceWith(wrapper);
|
nodeWrapper.replaceWith(wrapper);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
function _mergeAttrs(knode, attrs, styles) {
|
function _mergeAttrs(knode, attrs, styles) {
|
||||||
_each(attrs, function(key, val) {
|
_each(attrs, function(key, val) {
|
||||||
if (key !== 'style') {
|
if (key !== 'style') {
|
||||||
@ -2705,7 +2710,7 @@ function _mergeAttrs(knode, attrs, styles) {
|
|||||||
_each(styles, function(key, val) {
|
_each(styles, function(key, val) {
|
||||||
knode.css(key, val);
|
knode.css(key, val);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function _inPreElement(knode) {
|
function _inPreElement(knode) {
|
||||||
while (knode && knode.name != 'body') {
|
while (knode && knode.name != 'body') {
|
||||||
if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) {
|
if (_PRE_TAG_MAP[knode.name] || knode.name == 'div' && knode.hasClass('ke-script')) {
|
||||||
@ -2714,7 +2719,7 @@ function _inPreElement(knode) {
|
|||||||
knode = knode.parent();
|
knode = knode.parent();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function KCmd(range) {
|
function KCmd(range) {
|
||||||
this.init(range);
|
this.init(range);
|
||||||
}
|
}
|
||||||
@ -3398,7 +3403,7 @@ function _drag(options) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function KWidget(options) {
|
function KWidget(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -3638,7 +3643,7 @@ function _elementVal(knode, val) {
|
|||||||
}
|
}
|
||||||
return knode.html(val);
|
return knode.html(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
function KEdit(options) {
|
function KEdit(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -3899,7 +3904,7 @@ function _selectToolbar(name, fn) {
|
|||||||
fn(knode);
|
fn(knode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function KToolbar(options) {
|
function KToolbar(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4019,7 +4024,7 @@ function _toolbar(options) {
|
|||||||
K.ToolbarClass = KToolbar;
|
K.ToolbarClass = KToolbar;
|
||||||
K.toolbar = _toolbar;
|
K.toolbar = _toolbar;
|
||||||
|
|
||||||
|
|
||||||
function KMenu(options) {
|
function KMenu(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4102,7 +4107,7 @@ function _menu(options) {
|
|||||||
K.MenuClass = KMenu;
|
K.MenuClass = KMenu;
|
||||||
K.menu = _menu;
|
K.menu = _menu;
|
||||||
|
|
||||||
|
|
||||||
function KColorPicker(options) {
|
function KColorPicker(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4284,7 +4289,7 @@ function _createButton(arg) {
|
|||||||
span.append(btn);
|
span.append(btn);
|
||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
function KDialog(options) {
|
function KDialog(options) {
|
||||||
this.init(options);
|
this.init(options);
|
||||||
}
|
}
|
||||||
@ -4483,7 +4488,7 @@ function _loadScript(url, fn) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function _chopQuery(url) {
|
function _chopQuery(url) {
|
||||||
var index = url.indexOf('?');
|
var index = url.indexOf('?');
|
||||||
return index > 0 ? url.substr(0, index) : url;
|
return index > 0 ? url.substr(0, index) : url;
|
||||||
@ -4579,7 +4584,7 @@ function _lang(mixed, langType) {
|
|||||||
_language[langType][obj.ns][obj.key] = val;
|
_language[langType][obj.ns][obj.key] = val;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getImageFromRange(range, fn) {
|
function _getImageFromRange(range, fn) {
|
||||||
if (range.collapsed) {
|
if (range.collapsed) {
|
||||||
return;
|
return;
|
||||||
@ -4790,7 +4795,8 @@ function _addBookmarkToStack(stack, bookmark) {
|
|||||||
stack.push(bookmark);
|
stack.push(bookmark);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function _undoToRedo(fromStack, toStack) {
|
function _undoToRedo(fromStack, toStack) {
|
||||||
var self = this, edit = self.edit,
|
var self = this, edit = self.edit,
|
||||||
body = edit.doc.body,
|
body = edit.doc.body,
|
||||||
@ -5411,6 +5417,9 @@ KEditor.prototype = {
|
|||||||
if (_IE && self.cmd) {
|
if (_IE && self.cmd) {
|
||||||
self.cmd.select();
|
self.cmd.select();
|
||||||
}
|
}
|
||||||
|
console.log(e)
|
||||||
|
e.preventDefault();
|
||||||
|
$(".ui-tooltip").remove()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
options.noBtn = _undef(options.noBtn, {
|
options.noBtn = _undef(options.noBtn, {
|
||||||
@ -5420,6 +5429,7 @@ KEditor.prototype = {
|
|||||||
if (_IE && self.cmd) {
|
if (_IE && self.cmd) {
|
||||||
self.cmd.select();
|
self.cmd.select();
|
||||||
}
|
}
|
||||||
|
$(".ui-tooltip").remove()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (self.dialogAlignType != 'page') {
|
if (self.dialogAlignType != 'page') {
|
||||||
@ -5549,7 +5559,7 @@ K.appendHtml = function(expr, val) {
|
|||||||
this.appendHtml(val);
|
this.appendHtml(val);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_IE && _V < 7) {
|
if (_IE && _V < 7) {
|
||||||
_nativeCommand(document, 'BackgroundImageCache', true);
|
_nativeCommand(document, 'BackgroundImageCache', true);
|
||||||
}
|
}
|
||||||
@ -5559,7 +5569,7 @@ K.create = _create;
|
|||||||
K.instances = _instances;
|
K.instances = _instances;
|
||||||
K.plugin = _plugin;
|
K.plugin = _plugin;
|
||||||
K.lang = _lang;
|
K.lang = _lang;
|
||||||
|
|
||||||
_plugin('core', function(K) {
|
_plugin('core', function(K) {
|
||||||
var self = this,
|
var self = this,
|
||||||
shortcutKeys = {
|
shortcutKeys = {
|
||||||
@ -6297,6 +6307,7 @@ KindEditor.plugin('anchor', function(K) {
|
|||||||
yesBtn : {
|
yesBtn : {
|
||||||
name : self.lang('yes'),
|
name : self.lang('yes'),
|
||||||
click : function(e) {
|
click : function(e) {
|
||||||
|
$(".ui-tooltip").remove()
|
||||||
self.insertHtml('<a name="' + nameBox.val() + '">').hideDialog().focus();
|
self.insertHtml('<a name="' + nameBox.val() + '">').hideDialog().focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6459,7 +6470,7 @@ KindEditor.plugin('baidumap', function(K) {
|
|||||||
* @site http://www.kindsoft.net/
|
* @site http://www.kindsoft.net/
|
||||||
* @licence http://www.kindsoft.net/license.php
|
* @licence http://www.kindsoft.net/license.php
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
KindEditor.plugin('map', function(K) {
|
KindEditor.plugin('map', function(K) {
|
||||||
var self = this, name = 'map', lang = self.lang(name + '.');
|
var self = this, name = 'map', lang = self.lang(name + '.');
|
||||||
self.clickToolbar(name, function() {
|
self.clickToolbar(name, function() {
|
||||||
@ -6619,7 +6630,8 @@ KindEditor.plugin('clearhtml', function(K) {
|
|||||||
* @site http://www.kindsoft.net/
|
* @site http://www.kindsoft.net/
|
||||||
* @licence http://www.kindsoft.net/license.php
|
* @licence http://www.kindsoft.net/license.php
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
KindEditor.plugin('code', function(K) {
|
KindEditor.plugin('code', function(K) {
|
||||||
var self = this, name = 'code';
|
var self = this, name = 'code';
|
||||||
self.clickToolbar(name, function() {
|
self.clickToolbar(name, function() {
|
||||||
|
|||||||
@ -221,7 +221,7 @@
|
|||||||
var editFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
var editFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
||||||
var delFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
var delFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
||||||
var columns = [
|
var columns = [
|
||||||
{checkbox: true },
|
{checkbox: true},
|
||||||
{field: 'id', title: '案例编号', align : "center"},
|
{field: 'id', title: '案例编号', align : "center"},
|
||||||
//{field: 'title', title: '标题', align : "center", width: "155"},
|
//{field: 'title', title: '标题', align : "center", width: "155"},
|
||||||
{field: 'title', title: '标题', align : "center", formatter: function(value, row, index) {
|
{field: 'title', title: '标题', align : "center", formatter: function(value, row, index) {
|
||||||
|
|||||||
@ -92,6 +92,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">附件:</label>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<label class="btn btn-info" for="attachment_file" style="color:white;vertical-align:top;">上传</label>
|
||||||
|
<input type="file" id="attachment_file" name="file" style="display: none;">
|
||||||
|
<input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">
|
||||||
|
<div style="height: 20px; line-height: 20px;">
|
||||||
|
<a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label"><font color="red">*</font> 封面图:</label>
|
<label class="col-sm-2 control-label"><font color="red">*</font> 封面图:</label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
@ -101,16 +113,6 @@
|
|||||||
|
|
||||||
<span><img style="display:none;" id="img_listicon" th:src="${listicon}" width="70px" height="70px"></span>
|
<span><img style="display:none;" id="img_listicon" th:src="${listicon}" width="70px" height="70px"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="col-sm-5 control-label">附件:</label>
|
|
||||||
<div class="col-sm-2">
|
|
||||||
<label class="btn btn-info" for="attachment_file" style="color:white;vertical-align:top;">上传</label>
|
|
||||||
<input type="file" id="attachment_file" name="file" style="display: none;">
|
|
||||||
<input type="hidden" id="attachment" name="attachment" th:value="${attachment}" style="display: none;">
|
|
||||||
<div style="height: 20px; line-height: 20px;">
|
|
||||||
<a class="a_viewfile" href="javascript:;" target="_blank" title="点击下载" style="height: 34px; line-height: 34px;"></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--<div class="form-group img-group" style="display: '';">
|
<!--<div class="form-group img-group" style="display: '';">
|
||||||
@ -158,7 +160,7 @@
|
|||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var caseType = [[${caseType}]];
|
var caseType = [[${caseType}]];
|
||||||
</script>
|
</script>
|
||||||
<script charset="utf-8" type="text/javascript" th:src="@{/libs/kindeditor/kindeditor-all-custom-min.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{/libs/kindeditor/kindeditor-all.js}"></script>
|
||||||
<script charset="utf-8" type="text/javascript" th:src="@{/libs/kindeditor/lang/zh-CN.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{/libs/kindeditor/lang/zh-CN.js}"></script>
|
||||||
<script charset="utf-8" type="text/javascript" th:src="@{/libs/jquery.form/jquery.form.min.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{/libs/jquery.form/jquery.form.min.js}"></script>
|
||||||
<script charset="utf-8" type="text/javascript" th:src="@{/js/cases/content.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{/js/cases/content.js}"></script>
|
||||||
@ -178,10 +180,28 @@ var caseType = [[${caseType}]];
|
|||||||
afterUpload: function(){this.sync();}, // 图片上传后,将上传内容同步到textarea中
|
afterUpload: function(){this.sync();}, // 图片上传后,将上传内容同步到textarea中
|
||||||
afterBlur: function(){this.sync();}, // 失去焦点时,将上传内容同步到textarea中
|
afterBlur: function(){this.sync();}, // 失去焦点时,将上传内容同步到textarea中
|
||||||
afterCreate: function(){
|
afterCreate: function(){
|
||||||
|
console.log("xxx")
|
||||||
|
console.log($( ".ke-dialog-content" ))
|
||||||
|
$( ".ke-dialog-simple" ).tooltip( "disable" );
|
||||||
|
$( ".ke-dialog" ).tooltip( "disable" );
|
||||||
|
$( ".ke-dialog" ).tooltip({
|
||||||
|
disabled: true
|
||||||
|
});
|
||||||
|
$( ".ke-dialog" ).tooltip( "option", "hide" );
|
||||||
|
// $(".ke-toolbar").tooltip();
|
||||||
// console.log('after Create');
|
// console.log('after Create');
|
||||||
// let _styles = '<style> .ke-content img{max-width:100%;} </style>'
|
// let _styles = '<style> .ke-content img{max-width:100%;} </style>'
|
||||||
// $(".ke-edit-iframe").contents().find("body").append(_styles);
|
// $(".ke-edit-iframe").contents().find("body").append(_styles);
|
||||||
},
|
},
|
||||||
|
afterDialogCreate: function (){
|
||||||
|
console.log($(".ke-dialog-icon-close"))
|
||||||
|
$(".ke-dialog-icon-close").bind("click",function(){
|
||||||
|
alert("我的id为text,你点击时触发");
|
||||||
|
});
|
||||||
|
// $(".ke-dialog-icon-close").click(function (){
|
||||||
|
// alert("jjsjjs")
|
||||||
|
// })
|
||||||
|
},
|
||||||
resizeMode: 1
|
resizeMode: 1
|
||||||
});
|
});
|
||||||
// editor.ready(function() {
|
// editor.ready(function() {
|
||||||
@ -287,7 +307,6 @@ var caseType = [[${caseType}]];
|
|||||||
|
|
||||||
// 上传附件
|
// 上传附件
|
||||||
function uploadAttrFile() {
|
function uploadAttrFile() {
|
||||||
alert(111)
|
|
||||||
$('#newsForm').ajaxSubmit({
|
$('#newsForm').ajaxSubmit({
|
||||||
url: '[[@{/console/tool/oss/uploadFile}]]?category=attachment&caseType=[[${caseType}]]',
|
url: '[[@{/console/tool/oss/uploadFile}]]?category=attachment&caseType=[[${caseType}]]',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
@ -474,7 +493,6 @@ var caseType = [[${caseType}]];
|
|||||||
if($("#result").val() > 0){
|
if($("#result").val() > 0){
|
||||||
$("#btn_save").hide();
|
$("#btn_save").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
initLoad();
|
initLoad();
|
||||||
|
|
||||||
$('#tagNames').tagsInput({
|
$('#tagNames').tagsInput({
|
||||||
@ -622,4 +640,12 @@ var caseType = [[${caseType}]];
|
|||||||
-webkit-box-pack: justify;
|
-webkit-box-pack: justify;
|
||||||
justify-content: space-between;!important;
|
justify-content: space-between;!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.btn-info{
|
||||||
|
background-color: #48a4f7!important;
|
||||||
|
border-color: #48a4f7!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -220,7 +220,7 @@
|
|||||||
var editFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
var editFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
||||||
var delFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
var delFlag = "[[${@perms.hasPerm('cases-h5')}]]";
|
||||||
var columns = [
|
var columns = [
|
||||||
{checkbox: true },
|
{checkbox: true},
|
||||||
{field: 'id', title: '案例编号', align : "center"},
|
{field: 'id', title: '案例编号', align : "center"},
|
||||||
//{field: 'title', title: '标题', align : "left", width: "155"},
|
//{field: 'title', title: '标题', align : "left", width: "155"},
|
||||||
{field: 'title', title: '标题', align : "center", formatter: function(value, row, index) {
|
{field: 'title', title: '标题', align : "center", formatter: function(value, row, index) {
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<link rel="stylesheet" th:href="@{/libs/treegrid/jquery.treegrid.css}"/>
|
<link rel="stylesheet" th:href="@{/libs/treegrid/jquery.treegrid.css}"/>
|
||||||
<link rel="stylesheet" th:href="@{/libs/ztree/css/ztree-bootstrap.css}"/>
|
<link rel="stylesheet" th:href="@{/libs/ztree/css/ztree-bootstrap.css}"/>
|
||||||
<!-- tagsinput引用css -->
|
<!-- tagsinput引用css -->
|
||||||
<link rel="stylesheet" th:href="@{https://s0.pstatp.com/cdn/expire-1-M/jqueryui/1.12.1/jquery-ui.min.css}"/>
|
<link rel="stylesheet" th:href="@{/libs/jquery.ui/jquery-ui.min.css}"/>
|
||||||
<link rel="stylesheet" th:href="@{https://s0.pstatp.com/cdn/expire-1-M/jquery-tagsinput/1.3.6/jquery.tagsinput.min.css}"/>
|
<link rel="stylesheet" th:href="@{https://s0.pstatp.com/cdn/expire-1-M/jquery-tagsinput/1.3.6/jquery.tagsinput.min.css}"/>
|
||||||
<!-- <link rel="stylesheet" th:href="@{https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css}"/>-->
|
<!-- <link rel="stylesheet" th:href="@{https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css}"/>-->
|
||||||
<link rel="stylesheet" th:href="@{/libs/select2/select2.min.css}"/>
|
<link rel="stylesheet" th:href="@{/libs/select2/select2.min.css}"/>
|
||||||
@ -47,17 +47,13 @@
|
|||||||
<script th:src="@{/libs/ztree/js/jquery.ztree.excheck.js}"></script>
|
<script th:src="@{/libs/ztree/js/jquery.ztree.excheck.js}"></script>
|
||||||
<script th:src="@{/libs/ztree/js/jquery.ztree.exedit.js}"></script>
|
<script th:src="@{/libs/ztree/js/jquery.ztree.exedit.js}"></script>
|
||||||
<!-- tagsinput引用JS -->
|
<!-- tagsinput引用JS -->
|
||||||
<script charset="utf-8" type="text/javascript" th:src="@{https://s0.pstatp.com/cdn/expire-1-M/jqueryui/1.12.1/jquery-ui.min.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{/libs/jquery.ui/jquery-ui.min.js}"></script>
|
||||||
<script charset="utf-8" type="text/javascript" th:src="@{https://s0.pstatp.com/cdn/expire-1-M/jquery-tagsinput/1.3.6/jquery.tagsinput.min.js}"></script>
|
<script charset="utf-8" type="text/javascript" th:src="@{https://s0.pstatp.com/cdn/expire-1-M/jquery-tagsinput/1.3.6/jquery.tagsinput.min.js}"></script>
|
||||||
<!-- 引入 echarts.js -->
|
<!-- 引入 echarts.js -->
|
||||||
<script th:src="@{https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js}"></script>
|
<script th:src="@{https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.min.js}"></script>
|
||||||
<script th:src="@{/js/core.js}"></script>
|
<script th:src="@{/js/core.js}"></script>
|
||||||
</head>
|
</head>
|
||||||
<style>
|
|
||||||
.ui-tooltip{
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<body class="hold-transition skin-blue-light sidebar-mini fixed" onhashchange="loadContent()">
|
<body class="hold-transition skin-blue-light sidebar-mini fixed" onhashchange="loadContent()">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div th:replace="fragments/navbar :: navbar"></div>
|
<div th:replace="fragments/navbar :: navbar"></div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user