Browse Source

Merge pull request #525 in VISUAL/fineui from ~FAY/fineui:master to master

* commit '206a80f9ae66660f23ef34b4c08dad88bbc1ea44':
  字体自动和透明样式设置
  update
  update
  update
  update
es6
imp 6 years ago
parent
commit
783d7d0d7f
  1. 2
      Gruntfile.js
  2. 36
      dist/_fineui.min.js
  3. 8
      dist/base.css
  4. 8
      dist/bundle.css
  5. 38
      dist/bundle.js
  6. 2
      dist/bundle.min.css
  7. 37
      dist/bundle.min.js
  8. 38
      dist/case.js
  9. 8
      dist/fineui.css
  10. 38
      dist/fineui.js
  11. 2
      dist/fineui.min.css
  12. 36
      dist/fineui.min.js
  13. 3
      dist/resource.css
  14. 2
      src/case/richeditor/bar/action.richeditor.param.js
  15. 30
      src/case/richeditor/niceditor/niceditor.js
  16. 6
      src/case/richeditor/plugins/combo.colorchooser.js
  17. 8
      src/css/base/richeditor/niceditor/niceditor.css
  18. 3
      src/css/resource/size.css
  19. 5
      src/less/base/richeditor/niceditor/niceditor.less
  20. 1
      src/less/resource/size.less

2
Gruntfile.js

@ -291,7 +291,7 @@ module.exports = function (grunt) {
open: true,
livereload: 35729,
// Change this to '0.0.0.0' to access the server from outside
hostname: "localhost"
hostname: "0.0.0.0"
},
server: {
options: {

36
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

8
dist/base.css vendored

@ -1062,6 +1062,14 @@ li.CodeMirror-hint-active {
.bi-pane {
min-height: 25px;
}
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;

8
dist/bundle.css vendored

@ -2908,6 +2908,14 @@ li.CodeMirror-hint-active {
.bi-pane {
min-height: 25px;
}
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;

38
dist/bundle.js vendored

@ -83107,7 +83107,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) {
@ -83354,6 +83354,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);
@ -83501,10 +83502,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();
@ -83619,7 +83631,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
@ -83650,6 +83662,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;
}
});
}());
@ -84102,7 +84128,11 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}
});
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);
});
},

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

37
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

38
dist/case.js vendored

@ -10552,7 +10552,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) {
@ -10799,6 +10799,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);
@ -10946,10 +10947,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();
@ -11064,7 +11076,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
@ -11095,6 +11107,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;
}
});
}());
@ -11547,7 +11573,11 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}
});
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);
});
},

8
dist/fineui.css vendored

@ -2908,6 +2908,14 @@ li.CodeMirror-hint-active {
.bi-pane {
min-height: 25px;
}
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}
.bi-rich-editor .rich-editor-param {
-webkit-border-radius: 12px;
-moz-border-radius: 12px;

38
dist/fineui.js vendored

@ -83356,7 +83356,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) {
@ -83603,6 +83603,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);
@ -83750,10 +83751,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();
@ -83868,7 +83880,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
@ -83899,6 +83911,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;
}
});
}());
@ -84351,7 +84377,11 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}
});
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);
});
},

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

36
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

3
dist/resource.css vendored

@ -1799,6 +1799,9 @@ textarea::-webkit-scrollbar-thumb:hover {
.icon-size-24 .b-font {
font-size: 24px;
}
.icon-size-40 .b-font {
font-size: 40px;
}
.icon-size-50 .b-font {
font-size: 50px;
}

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;
}
});
}());

6
src/case/richeditor/plugins/combo.colorchooser.js

@ -30,7 +30,11 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
}
});
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);
});
},

8
src/css/base/richeditor/niceditor/niceditor.css

@ -0,0 +1,8 @@
.bi-nic-editor {
-webkit-user-select: text;
-khtml-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
-o-user-select: text;
user-select: text;
}

3
src/css/resource/size.css

@ -7,6 +7,9 @@
.icon-size-24 .b-font {
font-size: 24px;
}
.icon-size-40 .b-font {
font-size: 40px;
}
.icon-size-50 .b-font {
font-size: 50px;
}

5
src/less/base/richeditor/niceditor/niceditor.less

@ -0,0 +1,5 @@
@import "../../../index";
.bi-nic-editor {
.user-select-enable();
}

1
src/less/resource/size.less

@ -4,5 +4,6 @@
.iconSize(icon-size-12, @font-size-12);
.iconSize(icon-size-16, @font-size-16);
.iconSize(icon-size-24, @font-size-24);
.iconSize(icon-size-40, @font-size-40);
.iconSize(icon-size-50, @font-size-50);
.iconSize(icon-size-70, @font-size-70);
Loading…
Cancel
Save