1 static Xcls_DialogPluginWebkit _DialogPluginWebkit;
3 public class Xcls_DialogPluginWebkit : Object
6 private Xcls_DialogPluginWebkit _this;
8 public static Xcls_DialogPluginWebkit singleton()
10 if (_DialogPluginWebkit == null) {
11 _DialogPluginWebkit= new Xcls_DialogPluginWebkit();
13 return _DialogPluginWebkit;
15 public Xcls_webview webview;
20 public Xcls_DialogPluginWebkit()
23 this.el = new Gtk.Dialog();
28 this.el.title = "Add / Edit Component";
29 this.el.default_height = 500;
30 this.el.default_width = 500;
31 this.el.deletable = true;
33 var child_0 = new Xcls_VBox2( _this );
35 this.el.get_content_area().add ( child_0.el );
36 var child_1 = new Xcls_Button5( _this );
38 this.el.add_action_widget ( child_1.el , 0 );
39 var child_2 = new Xcls_Button6( _this );
41 this.el.add_action_widget ( child_2.el , 1 );
44 this.el.delete_event.connect( (self, event) => {
51 // user defined functions
52 public string show (Gtk.Window ?parent, string text) {// JsRender.Node node) {
55 this.el.set_transient_for(parent);
60 var runhtml = "<script type=\"text/javascript\">\n" ;
64 GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
66 runhtml += builderhtml + "\n";
67 runhtml += "</script>\n" ;
69 // fix to make sure they are the same..
71 // need to modify paths
75 GLib.FileUtils.get_contents(
76 BuilderApplication.configDirectory() + "/resources/roo.builder.html"
81 string js_src = js + "\n" +
82 "Roo.onReady(function() {\n" +
83 "if (" + _this.file.name +".show) " + _this.file.name +".show({});\n" +
84 "Roo.XComponent.build();\n" +
88 //var fc = FakeServerCache.factory_with_data(js_src);
89 //this.runjs = fc.fname;
91 var html = inhtml.replace("</head>", runhtml + // + this.runhtml +
93 // "<script type=\"text/javascript\" src=\"xhttp://localhost" + fc.fname + "\"></script>" +
94 // "<script type=\"text/javascript\">\n" +
99 //print("LOAD HTML " + html);
101 //var rootURL = _this.file.project.rootURL;
105 this.el.load_html( html ,
106 //fixme - should be a config option!
107 "xhttp://localhost/app.Builder.js/"
115 var response_id = this.el.run();
116 if (response_id < 1) {
132 public class Xcls_VBox2 : Object
135 private Xcls_DialogPluginWebkit _this;
141 public Xcls_VBox2(Xcls_DialogPluginWebkit _owner )
144 this.el = new Gtk.VBox( false, 0 );
148 // set gobject values
149 var child_0 = new Xcls_ScrolledWindow3( _this );
151 this.el.pack_start ( child_0.el , false,true,3 );
154 // user defined functions
156 public class Xcls_ScrolledWindow3 : Object
158 public Gtk.ScrolledWindow el;
159 private Xcls_DialogPluginWebkit _this;
165 public Xcls_ScrolledWindow3(Xcls_DialogPluginWebkit _owner )
168 this.el = new Gtk.ScrolledWindow( null, null );
172 // set gobject values
173 this.el.expand = true;
174 var child_0 = new Xcls_webview( _this );
176 this.el.add ( child_0.el );
180 this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
183 // user defined functions
185 public class Xcls_webview : Object
187 public WebKit.WebView el;
188 private Xcls_DialogPluginWebkit _this;
194 public Xcls_webview(Xcls_DialogPluginWebkit _owner )
197 _this.webview = this;
198 this.el = new WebKit.WebView();
202 // set gobject values
207 // this may not work!?
208 var settings = this.el.get_settings();
211 //var fs= new FakeServer(this.el);
213 // this was an attempt to change the url perms.. did not work..
214 // settings.enable_file_access_from_file_uris = true;
215 // settings.enable_offline_web_application_cache - true;
216 // settings.enable_universal_access_from_file_uris = true;
223 // FIXME - base url of script..
224 // we need it so some of the database features work.
225 this.el.load_html( "Render not ready" ,
226 //fixme - should be a config option!
227 // or should we catch stuff and fix it up..
228 "xhttp://localhost/app.Builder/"
237 // user defined functions
239 public class Xcls_Button5 : Object
241 public Gtk.Button el;
242 private Xcls_DialogPluginWebkit _this;
248 public Xcls_Button5(Xcls_DialogPluginWebkit _owner )
251 this.el = new Gtk.Button();
255 // set gobject values
256 this.el.label = "Cancel";
259 // user defined functions
261 public class Xcls_Button6 : Object
263 public Gtk.Button el;
264 private Xcls_DialogPluginWebkit _this;
270 public Xcls_Button6(Xcls_DialogPluginWebkit _owner )
273 this.el = new Gtk.Button();
277 // set gobject values
278 this.el.label = "OK";
281 // user defined functions