X-Git-Url: http://git.roojs.org/?p=app.webkitpdf;a=blobdiff_plain;f=BrowserWindow.bjs;h=c0e7d6a78b731ff7446245d89620e46423ba9579;hp=5424b06c935c8b058d103ba382c45986bb82ccbb;hb=26e5c5d6ffd7c5ac88810199bdeca9947e071fa7;hpb=e5bf6e8fd08a88cebf4f67512d98c354c829451b diff --git a/BrowserWindow.bjs b/BrowserWindow.bjs index 5424b06..c0e7d6a 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 = 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",