From: Alan Knowles Date: Tue, 10 Apr 2018 08:47:04 +0000 (+0800) Subject: BrowserWindow.bjs X-Git-Url: http://git.roojs.org/?p=app.webkitpdf;a=commitdiff_plain;h=e92d17491ea02b61bb10f4225d98e7a034012b6e BrowserWindow.bjs BrowserWindow.vala --- diff --git a/BrowserWindow.bjs b/BrowserWindow.bjs index b7d9e20..bc6c6e6 100644 --- a/BrowserWindow.bjs +++ b/BrowserWindow.bjs @@ -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", diff --git a/BrowserWindow.vala b/BrowserWindow.vala index e700e74..52fbca0 100644 --- a/BrowserWindow.vala +++ b/BrowserWindow.vala @@ -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();