Browse Source

BI-20382

master
guy 7 years ago
parent
commit
d347495f62
  1. 4
      dist/_fineui.min.js
  2. 98
      dist/bundle.js
  3. 12
      dist/bundle.min.js
  4. 98
      dist/case.js
  5. 98
      dist/fineui.js
  6. 4
      dist/fineui.min.js
  7. 61
      src/case/richeditor/bar/action.richeditor.param.js
  8. 37
      src/case/richeditor/niceditor/niceditor.js

4
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

98
dist/bundle.js vendored

@ -82900,29 +82900,29 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_createBlankNode: function () { // _createBlankNode: function () {
return $("<span>").html("&nbsp;"); // return $("<span>").html("&nbsp;");
}, // },
_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 () { // _addBlank: function ($param) {
var o = this.options; // var o = this.options;
var instance = o.editor.selectedInstance; // var instance = o.editor.selectedInstance;
var sel = $(instance.selElm()); // var next = $param.next();
return sel; // 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) { addParam: function (param) {
var o = this.options; var o = this.options;
@ -82933,14 +82933,15 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
image.alt = param; image.alt = param;
image.style = attrs.style; image.style = attrs.style;
$(image).addClass("rich-editor-param"); $(image).addClass("rich-editor-param");
var sel = this._get$Sel(); this.options.editor.insertHTML($("<div>").append(image).html());
var wrapper = o.editor.instance.getElm().element; // var sel = this._get$Sel();
if (wrapper.find(sel).length <= 0) { // var wrapper = o.editor.instance.getElm().element;
wrapper.append(image); // if (wrapper.find(sel).length <= 0) {
} else { // wrapper.append(image);
sel.after(image); // } else {
} // sel.after(image);
this._addBlank($(image)); // }
// this._addBlank($(image));
} }
}); });
@ -83159,6 +83160,18 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return newInstance; 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) { nicCommand: function (cmd, args) {
if (this.selectedInstance) { if (this.selectedInstance) {
this.selectedInstance.nicCommand(cmd, args); this.selectedInstance.nicCommand(cmd, args);
@ -83401,6 +83414,31 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
this.elm.element.html(this.content); 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) { nicCommand: function (cmd, args) {
document.execCommand(cmd, false, args); document.execCommand(cmd, false, args);
} }

12
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

98
dist/case.js vendored

@ -10427,29 +10427,29 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_createBlankNode: function () { // _createBlankNode: function () {
return $("<span>").html("&nbsp;"); // return $("<span>").html("&nbsp;");
}, // },
_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 () { // _addBlank: function ($param) {
var o = this.options; // var o = this.options;
var instance = o.editor.selectedInstance; // var instance = o.editor.selectedInstance;
var sel = $(instance.selElm()); // var next = $param.next();
return sel; // 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) { addParam: function (param) {
var o = this.options; var o = this.options;
@ -10460,14 +10460,15 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
image.alt = param; image.alt = param;
image.style = attrs.style; image.style = attrs.style;
$(image).addClass("rich-editor-param"); $(image).addClass("rich-editor-param");
var sel = this._get$Sel(); this.options.editor.insertHTML($("<div>").append(image).html());
var wrapper = o.editor.instance.getElm().element; // var sel = this._get$Sel();
if (wrapper.find(sel).length <= 0) { // var wrapper = o.editor.instance.getElm().element;
wrapper.append(image); // if (wrapper.find(sel).length <= 0) {
} else { // wrapper.append(image);
sel.after(image); // } else {
} // sel.after(image);
this._addBlank($(image)); // }
// this._addBlank($(image));
} }
}); });
@ -10686,6 +10687,18 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return newInstance; 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) { nicCommand: function (cmd, args) {
if (this.selectedInstance) { if (this.selectedInstance) {
this.selectedInstance.nicCommand(cmd, args); this.selectedInstance.nicCommand(cmd, args);
@ -10928,6 +10941,31 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
this.elm.element.html(this.content); 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) { nicCommand: function (cmd, args) {
document.execCommand(cmd, false, args); document.execCommand(cmd, false, args);
} }

98
dist/fineui.js vendored

@ -83143,29 +83143,29 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_createBlankNode: function () { // _createBlankNode: function () {
return $("<span>").html("&nbsp;"); // return $("<span>").html("&nbsp;");
}, // },
_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 () { // _addBlank: function ($param) {
var o = this.options; // var o = this.options;
var instance = o.editor.selectedInstance; // var instance = o.editor.selectedInstance;
var sel = $(instance.selElm()); // var next = $param.next();
return sel; // 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) { addParam: function (param) {
var o = this.options; var o = this.options;
@ -83176,14 +83176,15 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
image.alt = param; image.alt = param;
image.style = attrs.style; image.style = attrs.style;
$(image).addClass("rich-editor-param"); $(image).addClass("rich-editor-param");
var sel = this._get$Sel(); this.options.editor.insertHTML($("<div>").append(image).html());
var wrapper = o.editor.instance.getElm().element; // var sel = this._get$Sel();
if (wrapper.find(sel).length <= 0) { // var wrapper = o.editor.instance.getElm().element;
wrapper.append(image); // if (wrapper.find(sel).length <= 0) {
} else { // wrapper.append(image);
sel.after(image); // } else {
} // sel.after(image);
this._addBlank($(image)); // }
// this._addBlank($(image));
} }
}); });
@ -83402,6 +83403,18 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return newInstance; 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) { nicCommand: function (cmd, args) {
if (this.selectedInstance) { if (this.selectedInstance) {
this.selectedInstance.nicCommand(cmd, args); this.selectedInstance.nicCommand(cmd, args);
@ -83644,6 +83657,31 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
this.elm.element.html(this.content); 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) { nicCommand: function (cmd, args) {
document.execCommand(cmd, false, args); document.execCommand(cmd, false, args);
} }

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

61
src/case/richeditor/bar/action.richeditor.param.js

@ -17,29 +17,29 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
BI.RichEditorParamAction.superclass._init.apply(this, arguments); BI.RichEditorParamAction.superclass._init.apply(this, arguments);
}, },
_createBlankNode: function () { // _createBlankNode: function () {
return $("<span>").html("&nbsp;"); // return $("<span>").html("&nbsp;");
}, // },
_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 () { // _addBlank: function ($param) {
var o = this.options; // var o = this.options;
var instance = o.editor.selectedInstance; // var instance = o.editor.selectedInstance;
var sel = $(instance.selElm()); // var next = $param.next();
return sel; // 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) { addParam: function (param) {
var o = this.options; var o = this.options;
@ -50,14 +50,15 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
image.alt = param; image.alt = param;
image.style = attrs.style; image.style = attrs.style;
$(image).addClass("rich-editor-param"); $(image).addClass("rich-editor-param");
var sel = this._get$Sel(); this.options.editor.insertHTML($("<div>").append(image).html());
var wrapper = o.editor.instance.getElm().element; // var sel = this._get$Sel();
if (wrapper.find(sel).length <= 0) { // var wrapper = o.editor.instance.getElm().element;
wrapper.append(image); // if (wrapper.find(sel).length <= 0) {
} else { // wrapper.append(image);
sel.after(image); // } else {
} // sel.after(image);
this._addBlank($(image)); // }
// this._addBlank($(image));
} }
}); });

37
src/case/richeditor/niceditor/niceditor.js

@ -41,6 +41,18 @@
return newInstance; 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) { nicCommand: function (cmd, args) {
if (this.selectedInstance) { if (this.selectedInstance) {
this.selectedInstance.nicCommand(cmd, args); this.selectedInstance.nicCommand(cmd, args);
@ -283,6 +295,31 @@
this.elm.element.html(this.content); 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) { nicCommand: function (cmd, args) {
document.execCommand(cmd, false, args); document.execCommand(cmd, false, args);
} }

Loading…
Cancel
Save