]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
write QWEBIRC_DEBUG to debug pages
authorChris Porter <redacted>
Fri, 3 Jan 2014 09:47:48 +0000 (09:47 +0000)
committerChris Porter <redacted>
Fri, 3 Jan 2014 09:47:48 +0000 (09:47 +0000)
run java using the shell

bin/compile.py
bin/pagegen.py
js/sound.js

index 151c1ec7cb81f9a9f87e1ad092f335e7dbd76522..2fdc759f89cce6a9876bbd6da6a49dfde63b2065 100644 (file)
@@ -11,7 +11,7 @@ class MinifyException(Exception):
   
 def jarit(src):
   try:
-    p = subprocess.Popen(["java", "-jar", "bin/yuicompressor-2.4.2.jar", src], stdout=subprocess.PIPE)
+    p = subprocess.Popen(["java", "-jar", "bin/yuicompressor-2.4.2.jar", src], stdout=subprocess.PIPE, shell=True)
   except Exception, e:
     if hasattr(e, "errno") and e.errno == 2:
       raise MinifyException, "unable to run java"
@@ -50,6 +50,7 @@ def jmerge_files(prefix, suffix, output, files, *args, **kwargs):
     
   f = open(os.path.join(prefix, "static", suffix, output), "wb")
   f.write(COPYRIGHT)
+  f.write("QWEBIRC_DEBUG = false;")
 
   if kwargs.get("file_prefix"):
     f.write(kwargs.get("file_prefix"))
@@ -107,7 +108,7 @@ def main(outputdir=".", produce_debug=True):
     for y in value["uifiles"]:
       alljs.append(os.path.join("js", "ui", "frontends", y + ".js"))
     jmerge_files(outputdir, "js", uiname + "-" + ID, alljs, file_prefix="QWEBIRC_BUILD=\"" + ID + "\";\n")
-    
+
   os.rmdir(coutputdir)
   
   f = open(".compiled", "w")
index 6dc20604c5fb4478d1dda11b3105f6444d57ef33..4bd950d8841b6929503f20889daeadfb5287f4cf 100755 (executable)
@@ -62,6 +62,12 @@ def producehtml(name, debug):
   div = ui.get("div", "")
   customjs = ui.get("customjs", "")
 
+  if debug:
+    customjs = """<script type="text/javascript">
+QWEBIRC_DEBUG = true;
+</script>
+""" + customjs
+
   return """%s
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
index f2043824a0bd760eb7f3abd49fc3ab514ebc3b22..ccd1c50d05a8b78af413d290132f976f5a916228 100644 (file)
@@ -28,10 +28,10 @@ qwebirc.sound.SoundPlayer = new Class({
       return;
     }
     
-    var debugMode = false;
-    qwebirc.util.importJS(qwebirc.global.staticBaseURL + "js/" + (debugMode?"soundmanager2":"soundmanager2-nodebug-jsmin") + ".js", "soundManager", function() {
+    qwebirc.util.importJS(qwebirc.global.staticBaseURL + "js/" + (QWEBIRC_DEBUG?"soundmanager2":"soundmanager2-nodebug-jsmin") + ".js", "soundManager", function() {
       soundManager.url = qwebirc.global.staticBaseURL + "sound/";
-      
+
+      var debugMode = false;
       soundManager.debugMode = debugMode;
       soundManager.useConsole = debugMode;
       soundManager.onload = function() {