]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - bin/pagegen.py
Merge.
[irc/quakenet/qwebirc.git] / bin / pagegen.py
index 1c042d02206c2960ff725d1f3ccfa4f43660b2aa..7423a2bd7e2ffb2403ef3d57a9ef2bdfe7e03cbb 100755 (executable)
@@ -27,7 +27,7 @@ def csslist(name, debug, gen=False):
 
 def _gethgid():
   try:
-    p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE)
+    p = subprocess.Popen(["hg", "id"], stdout=subprocess.PIPE, shell=os.name == "nt")
   except Exception, e:
     if hasattr(e, "errno") and e.errno == 2:
       raise HGException, "unable to execute"
@@ -56,6 +56,9 @@ def producehtml(name, debug):
   csshtml = "\n".join("  <link rel=\"stylesheet\" href=\"%s%s\" type=\"text/css\"/>" % (config.STATIC_BASE_URL, x) for x in css)
   jshtml = "\n".join("  <script type=\"text/javascript\" src=\"%s%s\"></script>" % ("" if x.startswith("//") else config.STATIC_BASE_URL, x) for x in js)
 
+  if hasattr(config, "ANALYTICS_HTML"):
+    jshtml+="\n" + config.ANALYTICS_HTML
+
   div = ui.get("div", "")
   customjs = ui.get("customjs", "")
 
@@ -65,8 +68,9 @@ def producehtml(name, debug):
   <base />
   <title>%s (qwebirc)</title>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
+  <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
   <link rel="shortcut icon" type="image/png" href="%simages/favicon.png"/>
-%s%s
+%s<script type="text/javascript">QWEBIRC_DEBUG=%s;</script>%s
 %s
   <script type="text/javascript">
     var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.%s, %s);
@@ -80,7 +84,7 @@ def producehtml(name, debug):
   </div>
 </body>
 </html>
-""" % (ui["doctype"], config.APP_TITLE, config.STATIC_BASE_URL, csshtml, customjs, jshtml, ui["class"], optionsgen.get_options(), div)
+""" % (ui["doctype"], config.APP_TITLE, config.STATIC_BASE_URL, csshtml, debug and "true" or "false", customjs, jshtml, ui["class"], optionsgen.get_options(), div)
 
 def main(outputdir=".", produce_debug=True):
   p = os.path.join(outputdir, "static")