fay 6 years ago
parent
commit
4c3d937b48
  1. 46
      dist/_fineui.min.js
  2. 39
      dist/bundle.js
  3. 48
      dist/bundle.min.js
  4. 39
      dist/case.js
  5. 39
      dist/fineui.js
  6. 46
      dist/fineui.min.js
  7. 7
      src/case/colorchooser/colorchooser.js
  8. 2
      src/case/richeditor/bar/action.richeditor.param.js
  9. 30
      src/case/richeditor/niceditor/niceditor.js

46
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

39
dist/bundle.js vendored

@ -76270,6 +76270,9 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
eventName: BI.ColorChooserPopup.EVENT_VALUE_CHANGE,
action: function () {
fn();
if (!self._isRGBColor(self.colorPicker.getValue())) {
self.combo.hideView();
}
}
}, {
eventName: BI.ColorChooserPopup.EVENT_CHANGE,
@ -76304,6 +76307,10 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
});
},
_isRGBColor: function (color) {
return BI.isNotEmptyString(color) && color !== "transparent";
},
isViewVisible: function () {
return this.combo.isViewVisible();
},
@ -83159,7 +83166,7 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
$(image).addClass("rich-editor-param");
$(image).attr("style", attrs.style);
$(image).attr("name", name);
this.options.editor.insertHTML($("<div>").append(image).html());
instance.insertHTML($("<div>").append(image).html());
// var sel = this._get$Sel();
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
@ -83406,6 +83413,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
// return false;
}
if (this.instance.checkToolbar(t)) {
this.instance.saveRng();
return;
}
} while (t = t.parentNode);
@ -83553,10 +83561,21 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
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();
},
getSelectionContainerElem: function (range) {
if (range) {
var elem = range.commonAncestorContainer;
return elem.nodeType === 1 ? elem : elem.parentNode;
}
},
setFocus: function (el) {
try {
el.focus();
@ -83671,7 +83690,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
insertHTML: function (html) {
var range = this.getRng();
var range = this.savedRange || this.getRng();
try {
// w3c
@ -83702,6 +83721,20 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
nicCommand: function (cmd, 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;
}
});
}());

48
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

39
dist/case.js vendored

@ -3661,6 +3661,9 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
eventName: BI.ColorChooserPopup.EVENT_VALUE_CHANGE,
action: function () {
fn();
if (!self._isRGBColor(self.colorPicker.getValue())) {
self.combo.hideView();
}
}
}, {
eventName: BI.ColorChooserPopup.EVENT_CHANGE,
@ -3695,6 +3698,10 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
});
},
_isRGBColor: function (color) {
return BI.isNotEmptyString(color) && color !== "transparent";
},
isViewVisible: function () {
return this.combo.isViewVisible();
},
@ -10550,7 +10557,7 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
$(image).addClass("rich-editor-param");
$(image).attr("style", attrs.style);
$(image).attr("name", name);
this.options.editor.insertHTML($("<div>").append(image).html());
instance.insertHTML($("<div>").append(image).html());
// var sel = this._get$Sel();
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
@ -10797,6 +10804,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
// return false;
}
if (this.instance.checkToolbar(t)) {
this.instance.saveRng();
return;
}
} while (t = t.parentNode);
@ -10944,10 +10952,21 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
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();
},
getSelectionContainerElem: function (range) {
if (range) {
var elem = range.commonAncestorContainer;
return elem.nodeType === 1 ? elem : elem.parentNode;
}
},
setFocus: function (el) {
try {
el.focus();
@ -11062,7 +11081,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
insertHTML: function (html) {
var range = this.getRng();
var range = this.savedRange || this.getRng();
try {
// w3c
@ -11093,6 +11112,20 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
nicCommand: function (cmd, 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;
}
});
}());

39
dist/fineui.js vendored

@ -76519,6 +76519,9 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
eventName: BI.ColorChooserPopup.EVENT_VALUE_CHANGE,
action: function () {
fn();
if (!self._isRGBColor(self.colorPicker.getValue())) {
self.combo.hideView();
}
}
}, {
eventName: BI.ColorChooserPopup.EVENT_CHANGE,
@ -76553,6 +76556,10 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
});
},
_isRGBColor: function (color) {
return BI.isNotEmptyString(color) && color !== "transparent";
},
isViewVisible: function () {
return this.combo.isViewVisible();
},
@ -83408,7 +83415,7 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
$(image).addClass("rich-editor-param");
$(image).attr("style", attrs.style);
$(image).attr("name", name);
this.options.editor.insertHTML($("<div>").append(image).html());
instance.insertHTML($("<div>").append(image).html());
// var sel = this._get$Sel();
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {
@ -83655,6 +83662,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
// return false;
}
if (this.instance.checkToolbar(t)) {
this.instance.saveRng();
return;
}
} while (t = t.parentNode);
@ -83802,10 +83810,21 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
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();
},
getSelectionContainerElem: function (range) {
if (range) {
var elem = range.commonAncestorContainer;
return elem.nodeType === 1 ? elem : elem.parentNode;
}
},
setFocus: function (el) {
try {
el.focus();
@ -83920,7 +83939,7 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
},
insertHTML: function (html) {
var range = this.getRng();
var range = this.savedRange || this.getRng();
try {
// w3c
@ -83951,6 +83970,20 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
nicCommand: function (cmd, 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;
}
});
}());

46
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

7
src/case/colorchooser/colorchooser.js

@ -42,6 +42,9 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
eventName: BI.ColorChooserPopup.EVENT_VALUE_CHANGE,
action: function () {
fn();
if (!self._isRGBColor(self.colorPicker.getValue())) {
self.combo.hideView();
}
}
}, {
eventName: BI.ColorChooserPopup.EVENT_CHANGE,
@ -76,6 +79,10 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
});
},
_isRGBColor: function (color) {
return BI.isNotEmptyString(color) && color !== "transparent";
},
isViewVisible: function () {
return this.combo.isViewVisible();
},

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

@ -52,7 +52,7 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
$(image).addClass("rich-editor-param");
$(image).attr("style", attrs.style);
$(image).attr("name", name);
this.options.editor.insertHTML($("<div>").append(image).html());
instance.insertHTML($("<div>").append(image).html());
// var sel = this._get$Sel();
// var wrapper = o.editor.instance.getElm().element;
// if (wrapper.find(sel).length <= 0) {

30
src/case/richeditor/niceditor/niceditor.js

@ -66,6 +66,7 @@
// return false;
}
if (this.instance.checkToolbar(t)) {
this.instance.saveRng();
return;
}
} while (t = t.parentNode);
@ -213,10 +214,21 @@
},
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();
},
getSelectionContainerElem: function (range) {
if (range) {
var elem = range.commonAncestorContainer;
return elem.nodeType === 1 ? elem : elem.parentNode;
}
},
setFocus: function (el) {
try {
el.focus();
@ -331,7 +343,7 @@
},
insertHTML: function (html) {
var range = this.getRng();
var range = this.savedRange || this.getRng();
try {
// w3c
@ -362,6 +374,20 @@
nicCommand: function (cmd, 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;
}
});
}());

Loading…
Cancel
Save