|
|
|
@ -82900,29 +82900,29 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
|
|
|
|
|
BI.RichEditorParamAction.superclass._init.apply(this, arguments); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_createBlankNode: function () { |
|
|
|
|
return $("<span>").html(" "); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_addBlank: function ($param) { |
|
|
|
|
var o = this.options; |
|
|
|
|
var instance = o.editor.selectedInstance; |
|
|
|
|
var next = $param.next(); |
|
|
|
|
if (next.length === 0) { |
|
|
|
|
var nextNode = this._createBlankNode(); |
|
|
|
|
$param.after(nextNode); |
|
|
|
|
instance.setFocus(nextNode[0]); |
|
|
|
|
} else { |
|
|
|
|
instance.setFocus(next[0]); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_get$Sel: function () { |
|
|
|
|
var o = this.options; |
|
|
|
|
var instance = o.editor.selectedInstance; |
|
|
|
|
var sel = $(instance.selElm()); |
|
|
|
|
return sel; |
|
|
|
|
}, |
|
|
|
|
// _createBlankNode: function () {
|
|
|
|
|
// return $("<span>").html(" ");
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
// _addBlank: function ($param) {
|
|
|
|
|
// var o = this.options;
|
|
|
|
|
// var instance = o.editor.selectedInstance;
|
|
|
|
|
// var next = $param.next();
|
|
|
|
|
// if (next.length === 0) {
|
|
|
|
|
// var nextNode = this._createBlankNode();
|
|
|
|
|
// $param.after(nextNode);
|
|
|
|
|
// instance.setFocus(nextNode[0]);
|
|
|
|
|
// } else {
|
|
|
|
|
// instance.setFocus(next[0]);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
//
|
|
|
|
|
// _get$Sel: function () {
|
|
|
|
|
// var o = this.options;
|
|
|
|
|
// var instance = o.editor.selectedInstance;
|
|
|
|
|
// var sel = $(instance.selElm());
|
|
|
|
|
// return sel;
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
addParam: function (param) { |
|
|
|
|
var o = this.options; |
|
|
|
@ -82933,14 +82933,15 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
|
|
|
|
|
image.alt = param; |
|
|
|
|
image.style = attrs.style; |
|
|
|
|
$(image).addClass("rich-editor-param"); |
|
|
|
|
var sel = this._get$Sel(); |
|
|
|
|
var wrapper = o.editor.instance.getElm().element; |
|
|
|
|
if (wrapper.find(sel).length <= 0) { |
|
|
|
|
wrapper.append(image); |
|
|
|
|
} else { |
|
|
|
|
sel.after(image); |
|
|
|
|
} |
|
|
|
|
this._addBlank($(image)); |
|
|
|
|
this.options.editor.insertHTML($("<div>").append(image).html()); |
|
|
|
|
// var sel = this._get$Sel();
|
|
|
|
|
// var wrapper = o.editor.instance.getElm().element;
|
|
|
|
|
// if (wrapper.find(sel).length <= 0) {
|
|
|
|
|
// wrapper.append(image);
|
|
|
|
|
// } else {
|
|
|
|
|
// sel.after(image);
|
|
|
|
|
// }
|
|
|
|
|
// this._addBlank($(image));
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -83153,12 +83154,24 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
|
|
|
|
|
} else { |
|
|
|
|
console.error("不支持此浏览器"); |
|
|
|
|
} |
|
|
|
|
if(o.readOnly) { |
|
|
|
|
if (o.readOnly) { |
|
|
|
|
newInstance.disable(); |
|
|
|
|
} |
|
|
|
|
return newInstance; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
insertElem: function ($elem) { |
|
|
|
|
if (this.selectedInstance) { |
|
|
|
|
this.selectedInstance.insertElem($elem); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
insertHTML: function (html) { |
|
|
|
|
if (this.selectedInstance) { |
|
|
|
|
this.selectedInstance.insertHTML(html); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
nicCommand: function (cmd, args) { |
|
|
|
|
if (this.selectedInstance) { |
|
|
|
|
this.selectedInstance.nicCommand(cmd, args); |
|
|
|
@ -83401,6 +83414,31 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
|
|
|
|
|
this.elm.element.html(this.content); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
insertElem: function ($elem) { |
|
|
|
|
var range = this.getRng(); |
|
|
|
|
|
|
|
|
|
if (range.insertNode) { |
|
|
|
|
range.deleteContents(); |
|
|
|
|
range.insertNode($elem); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
insertHTML: function (html) { |
|
|
|
|
var range = this.getRng(); |
|
|
|
|
|
|
|
|
|
if (document.queryCommandState("insertHTML")) { |
|
|
|
|
// W3C
|
|
|
|
|
this.nicCommand("insertHTML", html); |
|
|
|
|
} else if (range.insertNode) { |
|
|
|
|
// IE
|
|
|
|
|
range.deleteContents(); |
|
|
|
|
range.insertNode($(html)[0]); |
|
|
|
|
} else if (range.pasteHTML) { |
|
|
|
|
// IE <= 10
|
|
|
|
|
range.pasteHTML(html); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
nicCommand: function (cmd, args) { |
|
|
|
|
document.execCommand(cmd, false, args); |
|
|
|
|
} |
|
|
|
|