]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
[PR-210] some tidying up of the webui debug option.
authorAdam Sutton <dev@adamsutton.me.uk>
Tue, 8 Jan 2013 13:30:11 +0000 (13:30 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Tue, 8 Jan 2013 13:30:11 +0000 (13:30 +0000)
src/webui/extjs.c
src/webui/webui.c

index 7291e66b9ead3741583392462a9e3431791e1303..f1bd1e47503afcd77dfbf5e5bbaa20cbad959085 100644 (file)
@@ -86,34 +86,19 @@ extjs_root(http_connection_t *hc, const char *remain, void *opaque)
   htsbuf_queue_t *hq = &hc->hc_reply;
 
 #define EXTJSPATH "static/extjs"
-
   htsbuf_qprintf(hq, "<html>\n");
   
-  if(webui_debug) {
-    htsbuf_qprintf(hq, "<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base-debug.js\"></script>\n"
-                       "<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all-debug.js\"></script>\n"
-                       "<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all-notheme.css\">\n");
-    tvhlog(LOG_INFO, "webui", "Running web interface in debug mode");
-  }
-  else {
-    htsbuf_qprintf(hq, "<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base.js\"></script>\n"
-                       "<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all.js\"></script>\n"
-                       "<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all-notheme-min.css\">\n");
-  }
-  
-  htsbuf_qprintf(hq, "<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/xtheme-blue.css\">\n"
+  htsbuf_qprintf(hq, "<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base%s.js\"></script>\n"
+                     "<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all%s.js\"></script>\n"
+                     "<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all-notheme%s.css\">\n"
+                     "<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/xtheme-blue.css\">\n"
                      "<link rel=\"stylesheet\" type=\"text/css\" href=\"static/livegrid/resources/css/ext-ux-livegrid.css\">\n"
-                     "<link rel=\"stylesheet\" type=\"text/css\" href=\"static/app/ext.css\">\n");
-
-  extjs_exec(hq, "Ext.BLANK_IMAGE_URL = "
-            "'"EXTJSPATH"/resources/images/default/s.gif';");
-
-#if 0
-  htsbuf_qprintf(hq, 
-                "<script type='text/javascript' "
-                "src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>");
-#endif
-
+                     "<link rel=\"stylesheet\" type=\"text/css\" href=\"static/app/ext.css\">\n",
+                     webui_debug ? "-debug" : "",
+                     webui_debug ? "-debug" : "",
+                     webui_debug ? ""       : "-min");
+  
+  extjs_exec(hq, "Ext.BLANK_IMAGE_URL = " "'"EXTJSPATH"/resources/images/default/s.gif';");
 
   /**
    * Load extjs extensions
index 69ccadf0e6326b9311fc6efd36ecfdcc5707a1a5..90ffc6f4573ddc4311da76fb795666915249b600 100644 (file)
@@ -939,6 +939,9 @@ int page_statedump(http_connection_t *hc, const char *remain, void *opaque);
 void
 webui_init(void)
 {
+  if (webui_debug)
+    tvhlog(LOG_INFO, "webui", "Running web interface in debug mode");
+
   http_path_add("", NULL, page_root2, ACCESS_WEB_INTERFACE);
   http_path_add("/", NULL, page_root, ACCESS_WEB_INTERFACE);