summaryrefslogtreecommitdiff
path: root/Plugins/skins/SkinLib/V8Script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/skins/SkinLib/V8Script.cpp')
-rw-r--r--Plugins/skins/SkinLib/V8Script.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/Plugins/skins/SkinLib/V8Script.cpp b/Plugins/skins/SkinLib/V8Script.cpp
index b18bdf2..2df8cad 100644
--- a/Plugins/skins/SkinLib/V8Script.cpp
+++ b/Plugins/skins/SkinLib/V8Script.cpp
@@ -1,7 +1,7 @@
#include "globals.h"
#include "V8Script.h"
-#include "utf8_helpers.h"
+#include <utf8_helpers.h>
using namespace v8;
@@ -65,9 +65,17 @@ bool V8Script::compile(const TCHAR *source, Dialog *dlg)
HandleScope handle_scope;
Handle<ObjectTemplate> global = ObjectTemplate::New();
+
global->Set(String::New("IsEmpty"), FunctionTemplate::New(&IsEmptyCallback));
global->Set(String::New("RGB"), FunctionTemplate::New(&RGBCallback));
+ global->Set(String::New("NUMBER"), String::New("NUMBER"));
+ global->Set(String::New("CHECKBOX"), String::New("CHECKBOX"));
+ global->Set(String::New("TEXT"), String::New("TEXT"));
+ global->Set(String::New("LEFT"), String::New("LEFT"));
+ global->Set(String::New("CENTER"), String::New("CENTER"));
+ global->Set(String::New("RIGHT"), String::New("RIGHT"));
+
context = Context::New(NULL, global);
Context::Scope context_scope(context);
@@ -172,10 +180,6 @@ std::pair<SkinOptions *,DialogState *> V8Script::configure(Dialog *dlg)
wrappers.fillWrapper(get(global, field->getField()->getName()), field);
}
- global->Set(String::New("NUMBER"), String::New("NUMBER"));
- global->Set(String::New("CHECKBOX"), String::New("CHECKBOX"));
- global->Set(String::New("TEXT"), String::New("TEXT"));
-
TryCatch try_catch;
Handle<Value> result = configure->Call(global, 0, NULL);
if (result.IsEmpty())