Ver Fonte

added script api configuration "hx" for hx files

Nicolas Cannasse há 6 anos atrás
pai
commit
4d933c431d
3 ficheiros alterados com 3 adições e 3 exclusões
  1. 1 1
      bin/defaultProps.json
  2. 1 1
      hide/comp/ScriptEditor.hx
  3. 1 1
      hide/view/Script.hx

+ 1 - 1
bin/defaultProps.json

@@ -72,7 +72,7 @@
 	"script.api.files" : [],
 	"script.cdbPackage" : "",
 	"script.api" : {
-		"TableName.fieldName" : {
+		"hx _or_ TableName.fieldName" : {
 			"globals" : { "this" : "ThisClass" },
 			"events" : "EventType",
 			"context" : "ContextClass",

+ 1 - 1
hide/comp/ScriptEditor.hx

@@ -52,7 +52,7 @@ class ScriptChecker {
 					var fields = [];
 					while( path.length > 0 ) {
 						var name = path.join(".");
-						if( constants.exists(name) ) {
+						if( constants != null && constants.exists(name) ) {
 							var value : Dynamic = constants.get(name);
 							for( f in fields )
 								value = Reflect.field(value, f);

+ 1 - 1
hide/view/Script.hx

@@ -17,7 +17,7 @@ class Script extends FileView {
 		}
 		originData = sys.io.File.getContent(getPath());
 		if( extension == "hx" ) {
-			script = new hide.comp.ScriptEditor(originData, element);
+			script = new hide.comp.ScriptEditor(originData, new hide.comp.ScriptEditor.ScriptChecker(config,"hx"), element);
 			script.onSave = function() onSave(script.code);
 			script.onChanged = function() {
 				modified = script.code != originData;