|
@@ -184,7 +184,7 @@ class Cell extends Component {
|
|
editor.isUniqueID(sheet,obj,id) ? v : '<span class="error">#DUP($v)</span>';
|
|
editor.isUniqueID(sheet,obj,id) ? v : '<span class="error">#DUP($v)</span>';
|
|
}
|
|
}
|
|
case TString if( c.kind == Script ):
|
|
case TString if( c.kind == Script ):
|
|
- v == "" ? " " : colorizeScript(c,v);
|
|
|
|
|
|
+ v == "" ? " " : colorizeScript(c,v, sheet.idCol == null ? null : Reflect.field(obj, sheet.idCol.name));
|
|
case TString, TLayer(_):
|
|
case TString, TLayer(_):
|
|
v == "" ? " " : StringTools.htmlEscape(v).split("\n").join("<br/>");
|
|
v == "" ? " " : StringTools.htmlEscape(v).split("\n").join("<br/>");
|
|
case TRef(sname):
|
|
case TRef(sname):
|
|
@@ -316,13 +316,18 @@ class Cell extends Component {
|
|
|
|
|
|
static var KWDS = ["for","if","var","this","while","else","do","break","continue","switch","function","return","new","throw","try","catch","case","default"];
|
|
static var KWDS = ["for","if","var","this","while","else","do","break","continue","switch","function","return","new","throw","try","catch","case","default"];
|
|
static var KWD_REG = new EReg([for( k in KWDS ) "(\\b"+k+"\\b)"].join("|"),"g");
|
|
static var KWD_REG = new EReg([for( k in KWDS ) "(\\b"+k+"\\b)"].join("|"),"g");
|
|
- function colorizeScript( c : cdb.Data.Column, ecode : String ) {
|
|
|
|
|
|
+ function colorizeScript( c : cdb.Data.Column, ecode : String, objID : String ) {
|
|
var code = ecode;
|
|
var code = ecode;
|
|
code = StringTools.htmlEscape(code);
|
|
code = StringTools.htmlEscape(code);
|
|
code = code.split("\n").join("<br/>");
|
|
code = code.split("\n").join("<br/>");
|
|
code = code.split("\t").join(" ");
|
|
code = code.split("\t").join(" ");
|
|
// typecheck
|
|
// typecheck
|
|
- var error = new ScriptEditor.ScriptChecker(editor.config, "cdb."+getDocumentName()+(c == this.column ? "" : "."+ c.name), ["cdb."+table.sheet.name => line.obj]).check(ecode);
|
|
|
|
|
|
+ var error = new ScriptEditor.ScriptChecker(editor.config, "cdb."+getDocumentName()+(c == this.column ? "" : "."+ c.name),
|
|
|
|
+ [
|
|
|
|
+ "cdb."+table.sheet.name => line.obj,
|
|
|
|
+ "cdb.objID" => objID,
|
|
|
|
+ ]
|
|
|
|
+ ).check(ecode);
|
|
if( error != null )
|
|
if( error != null )
|
|
return '<span class="error">'+code+'</span>';
|
|
return '<span class="error">'+code+'</span>';
|
|
// strings
|
|
// strings
|