1aa3ca8bf78bc1fcad3497ab802c865280e1dc0f
[app.Builder.js] / src / Builder4 / DialogPluginWebkit.bjs
1 {
2  "name" : "DialogPluginWebkit",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/DialogPluginWebkit.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "items" : [
9   {
10    "listeners" : {
11     "delete_event" : "(self, event) => {\n    this.el.hide();\n    return true; \n    //test  \n}\n "
12    },
13    "id" : "DialogPluginWebkit",
14    "utf8 title" : "Add / Edit Component",
15    "gint default_height" : 500,
16    "gboolean deletable" : true,
17    "xtype" : "Dialog",
18    "| string show" : " (Gtk.Window ?parent, string text) {// JsRender.Node node) {\n \n    if (parent  != null) {\n        this.el.set_transient_for(parent);\n        this.el.modal = true;\n    }\n    \n    _this.webview.el.load_html( text , \n            //fixme - should be a config option!\n            // or should we catch stuff and fix it up..\n            \"xhttp://localhost/app.Builder/\"\n    );\n        \n    \n    this.el.show_all();\n     var   ret = \"\";\n    while (true) {\n        var response_id = this.el.run();\n        if (response_id < 1) {\n            this.el.hide();\n             return \"\";\n        }\n        // keep showing...?\n        break;\n    }\n    \n    // now we save it..\n    this.el.hide();\n    \n    return ret;\n    \n    \n    \n}\n",
19    "$ xns" : "Gtk",
20    "gint default_width" : 500,
21    "gboolean modal" : true,
22    "items" : [
23     {
24      "xtype" : "VBox",
25      "$ pack" : "get_content_area().add",
26      "gboolean homogeneous" : false,
27      "$ xns" : "Gtk",
28      "items" : [
29       {
30        "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
31        "* pack" : "pack_start,false,true,3",
32        "xtype" : "ScrolledWindow",
33        "$ xns" : "Gtk",
34        "items" : [
35         {
36          "id" : "webview",
37          "* init" : " {\n    // this may not work!?\n    var settings =  this.el.get_settings();\n    \n     \n    //var fs= new FakeServer(this.el);\n    //fs.ref();\n    // this was an attempt to change the url perms.. did not work..\n    // settings.enable_file_access_from_file_uris = true;\n    // settings.enable_offline_web_application_cache - true;\n    // settings.enable_universal_access_from_file_uris = true;\n   \n     \n    \n    \n    \n\n     // FIXME - base url of script..\n     // we need it so some of the database features work.\n    this.el.load_html( \"Render not ready\" , \n            //fixme - should be a config option!\n            // or should we catch stuff and fix it up..\n            \"xhttp://localhost/app.Builder/\"\n    );\n        \n        \n    \n    \n}\n",
38          "xtype" : "WebView",
39          "* pack" : "add",
40          "$ xns" : "WebKit"
41         }
42        ]
43       }
44      ]
45     },
46     {
47      "label" : "Cancel",
48      "xtype" : "Button",
49      "* pack" : "add_action_widget,0",
50      "$ xns" : "Gtk"
51     },
52     {
53      "label" : "OK",
54      "xtype" : "Button",
55      "* pack" : "add_action_widget,1",
56      "$ xns" : "Gtk"
57     }
58    ]
59   }
60  ]
61 }