guy 7 years ago
parent
commit
c418d2db83
  1. 7
      bi/base.js
  2. 7
      docs/base.js

7
bi/base.js

@ -17784,7 +17784,11 @@ BI.CodeEditor = BI.inherit(BI.Single, {
var from = this.editor.getCursor();
this.editor.replaceSelection(param);
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'param', atomic: true});
var options = {className: 'param', atomic: true};
if(BI.isNotNull(param.match(/<!.*!>/))){
options.className = 'error-param';
}
this.editor.markText(from, to, options);
this.editor.replaceSelection(" ");
this.editor.focus();
},
@ -17801,6 +17805,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "param":
case "error-param":
var fieldNameLength = i.to - i.from;
value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length);
num += 3;

7
docs/base.js

@ -17784,7 +17784,11 @@ BI.CodeEditor = BI.inherit(BI.Single, {
var from = this.editor.getCursor();
this.editor.replaceSelection(param);
var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'param', atomic: true});
var options = {className: 'param', atomic: true};
if(BI.isNotNull(param.match(/<!.*!>/))){
options.className = 'error-param';
}
this.editor.markText(from, to, options);
this.editor.replaceSelection(" ");
this.editor.focus();
},
@ -17801,6 +17805,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
_.forEach(line.markedSpans, function (i, ms) {
switch (i.marker.className) {
case "param":
case "error-param":
var fieldNameLength = i.to - i.from;
value = value.substr(0, i.from + num) + "$\{" + value.substr(i.from + num, fieldNameLength) + "\}" + value.substr(i.to + num, value.length);
num += 3;

Loading…
Cancel
Save