BrowserWindow.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 10 Apr 2018 08:47:04 +0000 (16:47 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 10 Apr 2018 08:47:04 +0000 (16:47 +0800)
BrowserWindow.vala

BrowserWindow.bjs
BrowserWindow.vala

index b7d9e20..bc6c6e6 100644 (file)
@@ -10,7 +10,7 @@
   {
    "listeners" : {
     "destroy" : "() => {\n    Gtk.main_quit();\n}",
-    "show" : "() => {\n\t\n\tprint(\"resizing window\\n\");\n\tvar w = webkitpdf.opt_width > 0 ?  webkitpdf.opt_width  : 1200;\n\tvar h = webkitpdf.opt_height > 0 ?  webkitpdf.opt_height  :  500;\n\t\t\t\n\t\n\tthis.el.resize(w,h);\n\n\t// we have to do silly stuff with blogspot!!?!?\n\tvar blog = webkitpdf.opt_url;\n\n\n  /* Do not redirect if the domain is .com already */\n  if (/\\.blogspot\\.com/.match(blog)) {\n\t\tvar r =  new Regex (\"\\\\.blogspot\\\\..*?/\");\n\t\tblog = r.replace(blog, blog.length, 0, \".blogspot.com/ncr/\");\n  }\n\t\n\tprint(\"loading url %s\\n\",blog);\t\n\tthis.view.el.load_uri(blog);\n\t \n\t// if we have not finished in 25 seconds\n\t// call printit...\n\tvar cd = webkitpdf.opt_delay > 25 ? webkitpdf.opt_delay : 25;\n\t  GLib.Timeout.add_seconds(1, () => { \n\t\tcd--;\n\t\tprint(\"timeout 25 seconds :%d\", (int)cd);\n\t\tif (cd < 1) {\n\t\t\tprint(\"calling printit - timed out\");\n\t\t\t_this.view.printit();\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\treturn true;\n\n\t});\n\t\n\n}"
+    "show" : "() => {\n\t\n\tprint(\"resizing window\\n\");\n\tvar w = webkitpdf.opt_width > 0 ?  webkitpdf.opt_width  : 1200;\n\tvar h = webkitpdf.opt_height > 0 ?  webkitpdf.opt_height  :  500;\n\t\t\t\n\t\n\tthis.el.resize(w,h);\n\n\t// we have to do silly stuff with blogspot!!?!?\n\tvar blog = webkitpdf.opt_url;\n\n\n  /* Do not redirect if the domain is .com already */\n  if (/\\.blogspot\\.com/.match(blog)) {\n\t\tvar r =  new Regex (\"\\\\.blogspot\\\\..*?/\");\n\t\tblog = r.replace(blog, blog.length, 0, \".blogspot.com/ncr/\");\n  }\n\t\n\tprint(\"loading url %s\\n\",blog);\t\n\tthis.view.el.load_uri(blog);\n\t \n\t// if we have not finished in 25 seconds\n\t// call printit...\n\tvar cd = webkitpdf.opt_delay > 25 ? webkitpdf.opt_delay : 25;\n\t  GLib.Timeout.add_seconds(1, () => { \n\t\tcd--;\n\t\tprint(\"timeout %d seconds :%d\", (int)( webkitpdf.opt_delay > 25 ? webkitpdf.opt_delay : 25), (int)cd);\n\t\tif (cd < 1) {\n\t\t\tprint(\"calling printit - timed out\");\n\t\t\t_this.view.printit();\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\treturn true;\n\n\t});\n\t\n\n}"
    },
    "xtype" : "Window",
    "$ xns" : "Gtk",
index e700e74..52fbca0 100644 (file)
@@ -61,7 +61,7 @@ public class BrowserWindow : Object
                var cd = webkitpdf.opt_delay > 25 ? webkitpdf.opt_delay : 25;
                  GLib.Timeout.add_seconds(1, () => { 
                        cd--;
-                       print("timeout 25 seconds :%d", (int)cd);
+                       print("timeout %d seconds :%d", (int)( webkitpdf.opt_delay > 25 ? webkitpdf.opt_delay : 25), (int)cd);
                        if (cd < 1) {
                                print("calling printit - timed out");
                                _this.view.printit();