Browse Source

BI-26037

r语言编辑器不需要分析匹配,容易与R语言的语法冲突
es6
MrErHu 6 years ago
parent
commit
7502956bd7
  1. 60
      dist/_fineui.min.js
  2. 12
      dist/base.js
  3. 29
      dist/bundle.js
  4. 2
      dist/bundle.min.css
  5. 64
      dist/bundle.min.js
  6. 17
      dist/case.js
  7. 29
      dist/fineui.js
  8. 2
      dist/fineui.min.css
  9. 60
      dist/fineui.min.js
  10. 9
      src/base/single/editor/editor.code.js

60
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

12
dist/base.js vendored

@ -18121,6 +18121,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
lineHeight: 2, lineHeight: 2,
readOnly: false, readOnly: false,
lineNumbers: false, lineNumbers: false,
paramMatch: true, // 用来判断是否需要在代码中匹配参数,默认为true, R语言是不需要匹配参数
// 参数显示值构造函数 // 参数显示值构造函数
paramFormatter: function (v) { paramFormatter: function (v) {
return v; return v;
@ -18133,7 +18134,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
var conf = { var conf = {
textWrapping: true, textWrapping: true,
lineWrapping: true, lineWrapping: true,
lineNumbers: false, lineNumbers: o.lineNumbers,
readOnly: o.readOnly, readOnly: o.readOnly,
// 解决插入字段由括号或其他特殊字符包围时分裂的bug // 解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
@ -18274,9 +18275,10 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var self = this, result; var self = this, o = this.options, result;
this.refresh(); this.refresh();
self.editor.setValue(""); self.editor.setValue("");
if(o.paramMatch) {
result = this._analyzeContent(v || ""); result = this._analyzeContent(v || "");
BI.each(result, function (i, item) { BI.each(result, function (i, item) {
var fieldRegx = /\$[\{][^\}]*[\}]/; var fieldRegx = /\$[\{][^\}]*[\}]/;
@ -18287,6 +18289,9 @@ BI.CodeEditor = BI.inherit(BI.Single, {
self.insertString(item); self.insertString(item);
} }
}); });
}else {
self.editor.setValue(v);
}
this._checkWaterMark(); this._checkWaterMark();
}, },
@ -18317,7 +18322,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR"; BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR";
BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS"; BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.code_editor", BI.CodeEditor);/** BI.shortcut("bi.code_editor", BI.CodeEditor);
/**
* Created by GUY on 2015/4/15. * Created by GUY on 2015/4/15.
* @class BI.Editor * @class BI.Editor
* @extends BI.Single * @extends BI.Single

29
dist/bundle.js vendored

@ -53892,6 +53892,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
lineHeight: 2, lineHeight: 2,
readOnly: false, readOnly: false,
lineNumbers: false, lineNumbers: false,
paramMatch: true, // 用来判断是否需要在代码中匹配参数,默认为true, R语言是不需要匹配参数
// 参数显示值构造函数 // 参数显示值构造函数
paramFormatter: function (v) { paramFormatter: function (v) {
return v; return v;
@ -53904,7 +53905,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
var conf = { var conf = {
textWrapping: true, textWrapping: true,
lineWrapping: true, lineWrapping: true,
lineNumbers: false, lineNumbers: o.lineNumbers,
readOnly: o.readOnly, readOnly: o.readOnly,
// 解决插入字段由括号或其他特殊字符包围时分裂的bug // 解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
@ -54045,9 +54046,10 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var self = this, result; var self = this, o = this.options, result;
this.refresh(); this.refresh();
self.editor.setValue(""); self.editor.setValue("");
if(o.paramMatch) {
result = this._analyzeContent(v || ""); result = this._analyzeContent(v || "");
BI.each(result, function (i, item) { BI.each(result, function (i, item) {
var fieldRegx = /\$[\{][^\}]*[\}]/; var fieldRegx = /\$[\{][^\}]*[\}]/;
@ -54058,6 +54060,9 @@ BI.CodeEditor = BI.inherit(BI.Single, {
self.insertString(item); self.insertString(item);
} }
}); });
}else {
self.editor.setValue(v);
}
this._checkWaterMark(); this._checkWaterMark();
}, },
@ -54088,7 +54093,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR"; BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR";
BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS"; BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.code_editor", BI.CodeEditor);/** BI.shortcut("bi.code_editor", BI.CodeEditor);
/**
* Created by GUY on 2015/4/15. * Created by GUY on 2015/4/15.
* @class BI.Editor * @class BI.Editor
* @extends BI.Single * @extends BI.Single
@ -83174,11 +83180,6 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
editor: o.editor editor: o.editor
}); });
})); }));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
@ -83300,6 +83301,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return this.instance.getContent(); return this.instance.getContent();
}, },
getContentHeight: function () {
return this.instance.getContentHeight();
},
getInstance: function () { getInstance: function () {
return this.instance; return this.instance;
}, },
@ -83509,6 +83514,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return this.content; return this.content;
}, },
getContentHeight: function () {
return this.elm.element.height();
},
setContent: function (e) { setContent: function (e) {
this.content = e; this.content = e;
this.ne.fireEvent("set"); this.ne.fireEvent("set");
@ -84274,6 +84283,10 @@ BI.RichEditor = BI.inherit(BI.Widget, {
getValue: function () { getValue: function () {
return this.editor.getValue(); return this.editor.getValue();
},
getContentHeight: function () {
return this.editor.getContentHeight();
} }
}); });
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

64
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

17
dist/case.js vendored

@ -10673,11 +10673,6 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
editor: o.editor editor: o.editor
}); });
})); }));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
@ -10799,6 +10794,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return this.instance.getContent(); return this.instance.getContent();
}, },
getContentHeight: function () {
return this.instance.getContentHeight();
},
getInstance: function () { getInstance: function () {
return this.instance; return this.instance;
}, },
@ -11008,6 +11007,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return this.content; return this.content;
}, },
getContentHeight: function () {
return this.elm.element.height();
},
setContent: function (e) { setContent: function (e) {
this.content = e; this.content = e;
this.ne.fireEvent("set"); this.ne.fireEvent("set");
@ -11773,6 +11776,10 @@ BI.RichEditor = BI.inherit(BI.Widget, {
getValue: function () { getValue: function () {
return this.editor.getValue(); return this.editor.getValue();
},
getContentHeight: function () {
return this.editor.getContentHeight();
} }
}); });
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";

29
dist/fineui.js vendored

@ -54141,6 +54141,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
lineHeight: 2, lineHeight: 2,
readOnly: false, readOnly: false,
lineNumbers: false, lineNumbers: false,
paramMatch: true, // 用来判断是否需要在代码中匹配参数,默认为true, R语言是不需要匹配参数
// 参数显示值构造函数 // 参数显示值构造函数
paramFormatter: function (v) { paramFormatter: function (v) {
return v; return v;
@ -54153,7 +54154,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
var conf = { var conf = {
textWrapping: true, textWrapping: true,
lineWrapping: true, lineWrapping: true,
lineNumbers: false, lineNumbers: o.lineNumbers,
readOnly: o.readOnly, readOnly: o.readOnly,
// 解决插入字段由括号或其他特殊字符包围时分裂的bug // 解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
@ -54294,9 +54295,10 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var self = this, result; var self = this, o = this.options, result;
this.refresh(); this.refresh();
self.editor.setValue(""); self.editor.setValue("");
if(o.paramMatch) {
result = this._analyzeContent(v || ""); result = this._analyzeContent(v || "");
BI.each(result, function (i, item) { BI.each(result, function (i, item) {
var fieldRegx = /\$[\{][^\}]*[\}]/; var fieldRegx = /\$[\{][^\}]*[\}]/;
@ -54307,6 +54309,9 @@ BI.CodeEditor = BI.inherit(BI.Single, {
self.insertString(item); self.insertString(item);
} }
}); });
}else {
self.editor.setValue(v);
}
this._checkWaterMark(); this._checkWaterMark();
}, },
@ -54337,7 +54342,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.CodeEditor.EVENT_CHANGE = "EVENT_CHANGE";
BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR"; BI.CodeEditor.EVENT_BLUR = "EVENT_BLUR";
BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS"; BI.CodeEditor.EVENT_FOCUS = "EVENT_FOCUS";
BI.shortcut("bi.code_editor", BI.CodeEditor);/** BI.shortcut("bi.code_editor", BI.CodeEditor);
/**
* Created by GUY on 2015/4/15. * Created by GUY on 2015/4/15.
* @class BI.Editor * @class BI.Editor
* @extends BI.Single * @extends BI.Single
@ -83423,11 +83429,6 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
editor: o.editor editor: o.editor
}); });
})); }));
this.element.mousedown(function (e) {
BI.each(buttons, function (i, btn) {
btn.hideIf(e);
});
});
BI.createWidget({ BI.createWidget({
type: "bi.left", type: "bi.left",
element: this, element: this,
@ -83549,6 +83550,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return this.instance.getContent(); return this.instance.getContent();
}, },
getContentHeight: function () {
return this.instance.getContentHeight();
},
getInstance: function () { getInstance: function () {
return this.instance; return this.instance;
}, },
@ -83758,6 +83763,10 @@ BI.shortcut("bi.rich_editor_text_toolbar", BI.RichEditorTextToolbar);/**
return this.content; return this.content;
}, },
getContentHeight: function () {
return this.elm.element.height();
},
setContent: function (e) { setContent: function (e) {
this.content = e; this.content = e;
this.ne.fireEvent("set"); this.ne.fireEvent("set");
@ -84523,6 +84532,10 @@ BI.RichEditor = BI.inherit(BI.Widget, {
getValue: function () { getValue: function () {
return this.editor.getValue(); return this.editor.getValue();
},
getContentHeight: function () {
return this.editor.getContentHeight();
} }
}); });
BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW"; BI.RichEditor.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

60
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

9
src/base/single/editor/editor.code.js

@ -13,6 +13,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
lineHeight: 2, lineHeight: 2,
readOnly: false, readOnly: false,
lineNumbers: false, lineNumbers: false,
paramMatch: true, // 用来判断是否需要在代码中匹配参数,默认为true, R语言是不需要匹配参数
// 参数显示值构造函数 // 参数显示值构造函数
paramFormatter: function (v) { paramFormatter: function (v) {
return v; return v;
@ -25,7 +26,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
var conf = { var conf = {
textWrapping: true, textWrapping: true,
lineWrapping: true, lineWrapping: true,
lineNumbers: false, lineNumbers: o.lineNumbers,
readOnly: o.readOnly, readOnly: o.readOnly,
// 解决插入字段由括号或其他特殊字符包围时分裂的bug // 解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
@ -166,9 +167,10 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}, },
setValue: function (v) { setValue: function (v) {
var self = this, result; var self = this, o = this.options, result;
this.refresh(); this.refresh();
self.editor.setValue(""); self.editor.setValue("");
if(o.paramMatch) {
result = this._analyzeContent(v || ""); result = this._analyzeContent(v || "");
BI.each(result, function (i, item) { BI.each(result, function (i, item) {
var fieldRegx = /\$[\{][^\}]*[\}]/; var fieldRegx = /\$[\{][^\}]*[\}]/;
@ -179,6 +181,9 @@ BI.CodeEditor = BI.inherit(BI.Single, {
self.insertString(item); self.insertString(item);
} }
}); });
}else {
self.editor.setValue(v);
}
this._checkWaterMark(); this._checkWaterMark();
}, },

Loading…
Cancel
Save