src/Builder4/DialogPluginWebkit.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 22 Apr 2015 11:47:16 +0000 (19:47 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 22 Apr 2015 11:47:16 +0000 (19:47 +0800)
src/Builder4/DialogPluginWebkit.vala

src/Builder4/DialogPluginWebkit.vala

index 68f0c2f..f887c62 100644 (file)
@@ -16,6 +16,7 @@ public class Xcls_DialogPluginWebkit : Object
 
         // my vars (def)
     public string tmpjs;
+    public string result_json;
 
     // ctor 
     public Xcls_DialogPluginWebkit()
@@ -59,7 +60,8 @@ public class Xcls_DialogPluginWebkit : Object
             this.el.set_transient_for(parent);
             this.el.modal = true;
         }
-         Palete.RooDatabase db = project.roo_database;
+        this.result_json = "";
+         var  db = project.roo_database;
          
         
          this.el.show_all();
@@ -152,6 +154,7 @@ public class Xcls_DialogPluginWebkit : Object
                         loop.quit();
                     });
                  loop.run();
+                 ret = _this.result_json;
         //           print("LOOP END?");
                  // try and get the resopse...
                 break;
@@ -304,12 +307,18 @@ public class Xcls_DialogPluginWebkit : Object
                     return false;
                 }
                 print("CMD: %s\n",ar[1]);
-                    print("ARGS: %s\n",ar[2]);
+                print("ARGS: %s\n",ar[2]);
                 switch(ar[1]) {
+                
                     case "SAVEHTML":
-                      print("%sw",ar[2]);
-                      //  _this.file.saveHTML(ar[2]);
+                        // print("%sw",ar[2]);
+                        //  _this.file.saveHTML(ar[2]);
+                        return true;
+                        
+                    case "OUT":
+                        _this.result_json = ar[2];
                         return true;
+                        
                     default:
                         return true;
                 }