From 30f9565911217d38cefda3920f55d183d8f6e219 Mon Sep 17 00:00:00 2001 From: pescuma Date: Mon, 5 Jan 2009 02:30:47 +0000 Subject: Some refactors Changed project settings Added align git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@123 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/skins/SkinLib/V8Script.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Plugins/skins/SkinLib/V8Script.cpp') 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 using namespace v8; @@ -65,9 +65,17 @@ bool V8Script::compile(const TCHAR *source, Dialog *dlg) HandleScope handle_scope; Handle 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 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 result = configure->Call(global, 0, NULL); if (result.IsEmpty()) -- cgit v1.2.3