guy 7 years ago
parent
commit
29fbb72ad3
  1. 6
      demo/js/base/editor/demo.rich_editor.js
  2. 35
      dist/bundle.js
  3. 82
      dist/bundle.min.js
  4. 14
      dist/case.js
  5. 21
      dist/core.js
  6. 6
      dist/demo.js
  7. 35
      dist/fineui.js
  8. 82
      dist/fineui.min.js
  9. 14
      src/case/richeditor/bar/action.richeditor.param.js
  10. 21
      src/core/func/function.js

6
demo/js/base/editor/demo.rich_editor.js

@ -19,7 +19,11 @@ Demo.RichEditor = BI.inherit(BI.Widget, {
},
mounted: function () {
this.editor.setValue("这是一条<font size=\"4\" color=\"#009de3\">测试</font>数据");
var image = BI.DOM.getImage("测试");
var src = image.src;
var style = image.style;
this.editor.setValue("<div>这是一条<font size=\"4\" color=\"#009de3\">测试</font>数据<img width='" + image.width + "' height='" + image.height + "' src='" + src + "' style='" + style + "' /></div>");
}
});
BI.shortcut("demo.rich_editor", Demo.RichEditor);

35
dist/bundle.js vendored

@ -27751,6 +27751,27 @@ BI.extend(BI.DOM, {
ul.destroy();
}
return this._scrollWidth;
},
getImage: function (param) {
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
$(canvas).destroy();
return {
width: w,
height: 16,
src: canvas.toDataURL("image/png"),
style: "background-color: #3f8ce8; vertical-align: sub; margin: 0 3px;",
alt: param
};
}
});(function () {
var constantInjection = {};
@ -79737,20 +79758,12 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options;
var instance = o.editor.instance;
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
image.src = canvas.toDataURL("image/png");
var attrs = BI.DOM.getImage(param);
image.src = attrs.src;
image.alt = param;
$(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
image.style = attrs.style;
instance.getElm().element.append(image);
this._addBlank($(image));
$(canvas).destroy();
}
});

82
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

14
dist/case.js vendored

@ -9956,20 +9956,12 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options;
var instance = o.editor.instance;
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
image.src = canvas.toDataURL("image/png");
var attrs = BI.DOM.getImage(param);
image.src = attrs.src;
image.alt = param;
$(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
image.style = attrs.style;
instance.getElm().element.append(image);
this._addBlank($(image));
$(canvas).destroy();
}
});

21
dist/core.js vendored

@ -27751,6 +27751,27 @@ BI.extend(BI.DOM, {
ul.destroy();
}
return this._scrollWidth;
},
getImage: function (param) {
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
$(canvas).destroy();
return {
width: w,
height: 16,
src: canvas.toDataURL("image/png"),
style: "background-color: #3f8ce8; vertical-align: sub; margin: 0 3px;",
alt: param
};
}
});(function () {
var constantInjection = {};

6
dist/demo.js vendored

@ -869,7 +869,11 @@ BI.shortcut("demo.multifile_editor", Demo.CodeEditor);Demo.RichEditor = BI.inher
},
mounted: function () {
this.editor.setValue("这是一条<font size=\"4\" color=\"#009de3\">测试</font>数据");
var image = BI.DOM.getImage("测试");
var src = image.src;
var style = image.style;
this.editor.setValue("<div>这是一条<font size=\"4\" color=\"#009de3\">测试</font>数据<img width='" + image.width + "' height='" + image.height + "' src='" + src + "' style='" + style + "' /></div>");
}
});
BI.shortcut("demo.rich_editor", Demo.RichEditor);/**

35
dist/fineui.js vendored

@ -27952,6 +27952,27 @@ BI.extend(BI.DOM, {
ul.destroy();
}
return this._scrollWidth;
},
getImage: function (param) {
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
$(canvas).destroy();
return {
width: w,
height: 16,
src: canvas.toDataURL("image/png"),
style: "background-color: #3f8ce8; vertical-align: sub; margin: 0 3px;",
alt: param
};
}
});(function () {
var constantInjection = {};
@ -81501,20 +81522,12 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options;
var instance = o.editor.instance;
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
image.src = canvas.toDataURL("image/png");
var attrs = BI.DOM.getImage(param);
image.src = attrs.src;
image.alt = param;
$(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
image.style = attrs.style;
instance.getElm().element.append(image);
this._addBlank($(image));
$(canvas).destroy();
}
});

82
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

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

@ -34,20 +34,12 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, {
var o = this.options;
var instance = o.editor.instance;
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
canvas.width = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
image.src = canvas.toDataURL("image/png");
var attrs = BI.DOM.getImage(param);
image.src = attrs.src;
image.alt = param;
$(image).css({"background-color": "#3f8ce8", "vertical-align": "sub", "margin": "0 3px;"});
image.style = attrs.style;
instance.getElm().element.append(image);
this._addBlank($(image));
$(canvas).destroy();
}
});

21
src/core/func/function.js

@ -298,5 +298,26 @@ BI.extend(BI.DOM, {
ul.destroy();
}
return this._scrollWidth;
},
getImage: function (param) {
var image = new Image();
var canvas = document.createElement("canvas");
$("body").append(canvas);
var w = BI.DOM.getTextSizeWidth(param, 14) + 6;
canvas.width = w;
canvas.height = 16;
var ctx = canvas.getContext("2d");
ctx.font = "14px Georgia";
ctx.fillStyle = "#ffffff";
ctx.fillText(param, 3, 14);
$(canvas).destroy();
return {
width: w,
height: 16,
src: canvas.toDataURL("image/png"),
style: "background-color: #3f8ce8; vertical-align: sub; margin: 0 3px;",
alt: param
};
}
});
Loading…
Cancel
Save