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;
21 public Xcls_DialogPluginWebkit()
24 this.el = new Gtk.Dialog();
29 this.el.title = "Add / Edit Component";
30 this.el.default_height = 500;
31 this.el.default_width = 500;
32 this.el.deletable = true;
34 var child_0 = new Xcls_VBox2( _this );
36 this.el.get_content_area().add ( child_0.el );
37 var child_1 = new Xcls_Button5( _this );
39 this.el.add_action_widget ( child_1.el , 0 );
40 var child_2 = new Xcls_Button6( _this );
42 this.el.add_action_widget ( child_2.el , 1 );
45 this.el.delete_event.connect( (self, event) => {
52 // user defined functions
53 public string show (Gtk.Window ?parent, string text) {// JsRender.Node node) {
56 this.el.set_transient_for(parent);
61 var runhtml = "<script type=\"text/javascript\">\n" ;
65 GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
67 runhtml += builderhtml + "\n";
68 runhtml += "</script>\n" ;
70 // fix to make sure they are the same..
72 // need to modify paths
76 GLib.FileUtils.get_contents(
77 BuilderApplication.configDirectory() + "/resources/roo.builder.html"
82 string js_src = js + "\n" +
83 "Roo.onReady(function() {\n" +
84 "if (" + _this.file.name +".show) " + _this.file.name +".show({});\n" +
85 "Roo.XComponent.build();\n" +
89 var fc = FakeServerCache.factory_with_data(js_src);
90 this.tmpjs = fc.fname;
93 var html = inhtml.replace("</head>", runhtml + // + this.runhtml +
95 // "<script type=\"text/javascript\" src=\"xhttp://localhost" + fc.fname + "\"></script>" +
96 // "<script type=\"text/javascript\">\n" +
101 //print("LOAD HTML " + html);
103 //var rootURL = _this.file.project.rootURL;
107 this.webview.el.load_html( html ,
108 //fixme - should be a config option!
109 "xhttp://localhost/app.Builder.js/"
117 var response_id = this.el.run();
118 if (response_id < 1) {
134 public class Xcls_VBox2 : Object
137 private Xcls_DialogPluginWebkit _this;
143 public Xcls_VBox2(Xcls_DialogPluginWebkit _owner )
146 this.el = new Gtk.VBox( false, 0 );
150 // set gobject values
151 var child_0 = new Xcls_ScrolledWindow3( _this );
153 this.el.pack_start ( child_0.el , false,true,3 );
156 // user defined functions
158 public class Xcls_ScrolledWindow3 : Object
160 public Gtk.ScrolledWindow el;
161 private Xcls_DialogPluginWebkit _this;
167 public Xcls_ScrolledWindow3(Xcls_DialogPluginWebkit _owner )
170 this.el = new Gtk.ScrolledWindow( null, null );
174 // set gobject values
175 this.el.expand = true;
176 var child_0 = new Xcls_webview( _this );
178 this.el.add ( child_0.el );
182 this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
185 // user defined functions
187 public class Xcls_webview : Object
189 public WebKit.WebView el;
190 private Xcls_DialogPluginWebkit _this;
196 public Xcls_webview(Xcls_DialogPluginWebkit _owner )
199 _this.webview = this;
200 this.el = new WebKit.WebView();
204 // set gobject values
209 // this may not work!?
210 var settings = this.el.get_settings();
213 //var fs= new FakeServer(this.el);
215 // this was an attempt to change the url perms.. did not work..
216 // settings.enable_file_access_from_file_uris = true;
217 // settings.enable_offline_web_application_cache - true;
218 // settings.enable_universal_access_from_file_uris = true;
225 // FIXME - base url of script..
226 // we need it so some of the database features work.
227 this.el.load_html( "Render not ready" ,
228 //fixme - should be a config option!
229 // or should we catch stuff and fix it up..
230 "xhttp://localhost/app.Builder/"
239 // user defined functions
241 public class Xcls_Button5 : Object
243 public Gtk.Button el;
244 private Xcls_DialogPluginWebkit _this;
250 public Xcls_Button5(Xcls_DialogPluginWebkit _owner )
253 this.el = new Gtk.Button();
257 // set gobject values
258 this.el.label = "Cancel";
261 // user defined functions
263 public class Xcls_Button6 : Object
265 public Gtk.Button el;
266 private Xcls_DialogPluginWebkit _this;
272 public Xcls_Button6(Xcls_DialogPluginWebkit _owner )
275 this.el = new Gtk.Button();
279 // set gobject values
280 this.el.label = "OK";
283 // user defined functions