|
|
@ -83107,7 +83107,7 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { |
|
|
|
$(image).addClass("rich-editor-param"); |
|
|
|
$(image).addClass("rich-editor-param"); |
|
|
|
$(image).attr("style", attrs.style); |
|
|
|
$(image).attr("style", attrs.style); |
|
|
|
$(image).attr("name", name); |
|
|
|
$(image).attr("name", name); |
|
|
|
this.options.editor.insertHTML($("<div>").append(image).html()); |
|
|
|
instance.insertHTML($("<div>").append(image).html()); |
|
|
|
// var sel = this._get$Sel();
|
|
|
|
// var sel = this._get$Sel();
|
|
|
|
// var wrapper = o.editor.instance.getElm().element;
|
|
|
|
// var wrapper = o.editor.instance.getElm().element;
|
|
|
|
// if (wrapper.find(sel).length <= 0) {
|
|
|
|
// if (wrapper.find(sel).length <= 0) {
|
|
|
@ -83354,6 +83354,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** |
|
|
|
// return false;
|
|
|
|
// return false;
|
|
|
|
} |
|
|
|
} |
|
|
|
if (this.instance.checkToolbar(t)) { |
|
|
|
if (this.instance.checkToolbar(t)) { |
|
|
|
|
|
|
|
this.instance.saveRng(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} while (t = t.parentNode); |
|
|
|
} while (t = t.parentNode); |
|
|
@ -83501,10 +83502,21 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
saveRng: function () { |
|
|
|
saveRng: function () { |
|
|
|
this.savedRange = this.getRng(); |
|
|
|
var range = this.getRng(); |
|
|
|
|
|
|
|
if (!this._isChildOf(this.getSelectionContainerElem(range), this.element[0])) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.savedRange = range; |
|
|
|
this.savedSel = this.getSel(); |
|
|
|
this.savedSel = this.getSel(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getSelectionContainerElem: function (range) { |
|
|
|
|
|
|
|
if (range) { |
|
|
|
|
|
|
|
var elem = range.commonAncestorContainer; |
|
|
|
|
|
|
|
return elem.nodeType === 1 ? elem : elem.parentNode; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setFocus: function (el) { |
|
|
|
setFocus: function (el) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
el.focus(); |
|
|
|
el.focus(); |
|
|
@ -83619,7 +83631,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
insertHTML: function (html) { |
|
|
|
insertHTML: function (html) { |
|
|
|
var range = this.getRng(); |
|
|
|
var range = this.savedRange || this.getRng(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
// w3c
|
|
|
|
// w3c
|
|
|
@ -83650,6 +83662,20 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/** |
|
|
|
|
|
|
|
|
|
|
|
nicCommand: function (cmd, args) { |
|
|
|
nicCommand: function (cmd, args) { |
|
|
|
document.execCommand(cmd, false, args); |
|
|
|
document.execCommand(cmd, false, args); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_isChildOf: function(child, parent) { |
|
|
|
|
|
|
|
var parentNode; |
|
|
|
|
|
|
|
if(child && parent) { |
|
|
|
|
|
|
|
parentNode = child.parentNode; |
|
|
|
|
|
|
|
while(parentNode) { |
|
|
|
|
|
|
|
if(parent === parentNode) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
parentNode = parentNode.parentNode; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}()); |
|
|
|
}()); |
|
|
@ -84102,7 +84128,11 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { |
|
|
|
this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { |
|
|
|
self.doCommand(this.getValue()); |
|
|
|
var value = this.getValue(); |
|
|
|
|
|
|
|
// 用span代替font
|
|
|
|
|
|
|
|
document.execCommand('styleWithCSS', null, true); |
|
|
|
|
|
|
|
self.doCommand(this.getValue() || "inherit"); |
|
|
|
|
|
|
|
document.execCommand('styleWithCSS', null, false); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|