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

BrowserWindow.bjs
BrowserWindow.vala

index 5424b06..c0e7d6a 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 = 25;\n\t  GLib.Timeout.add_seconds(1, () => { \n\t\tcd--;\n\t\tprint(\"timeout 25 seconds :%d\", 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 25 seconds :%d\", 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 08643e8..119623c 100644 (file)
@@ -55,10 +55,10 @@ public class BrowserWindow : Object
                
                print("loading url %s\n",blog); 
                this.view.el.load_uri(blog);
-               
+                
                // if we have not finished in 25 seconds
                // call printit...
-               var cd = 25;
+               var cd = webkitpdf.opt_delay > 25 ? webkitpdf.opt_delay : 25;
                  GLib.Timeout.add_seconds(1, () => { 
                        cd--;
                        print("timeout 25 seconds :%d", cd);