]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add CUSTOM_CSS option and allow it to interact with LOGO_URL
authorChris Porter <redacted>
Wed, 26 Jul 2017 20:30:33 +0000 (21:30 +0100)
committerChris Porter <redacted>
Wed, 26 Jul 2017 20:30:33 +0000 (21:30 +0100)
bin/optionsgen.py
bin/pagegen.py
config.py.example
js/ui/panes/connect.js

index d8e85a6801de7932ef87fd3ffe14b78777ac47c3..2ae41272cb8c4f70ea0760255291b3514c778949 100644 (file)
@@ -24,7 +24,7 @@ def get_options():
   if hasattr(config, "HELP_URL") and config.HELP_URL:
     options["helpURL"] = config.HELP_URL
 
-  if hasattr(config, "LOGO_URL") and config.LOGO_URL:
+  if hasattr(config, "LOGO_URL"):
     options["logoURL"] = config.LOGO_URL
 
   if hasattr(config, "ACCOUNT_WHOIS_COMMAND") and config.ACCOUNT_WHOIS_COMMAND:
index 7509d2565dfcc43491ff752708e0cb14bb763dcc..b05cd6ec52218f61f1d32a98bfb9a7fa04e490e7 100755 (executable)
@@ -20,10 +20,13 @@ def csslist(name, debug, gen=False):
   nocss = ui.get("nocss")
   if not debug:
     return ["css/%s-%s.css" % (name, getgitid())]
-  css = pages.flatten([ui.get("extracss", []), "colours", "dialogs"])
+  css = list(pages.flatten([ui.get("extracss", []), "colours", "dialogs"]))
   if not nocss:
-    css = list(css) + [name]
-  return list("css/%s%s.css" % ("debug/" if gen else "", x) for x in css)
+    css+=[name]
+  css = ["%s.css" % x for x in css]
+  if hasattr(config, "CUSTOM_CSS"):
+    css+=[config.CUSTOM_CSS]
+  return list("css/%s%s" % ("debug/" if gen else "", x) for x in css)
 
 def _getgitid():
   try:
index 7535e6c140e8141ea8a745ea3fab1b240588d4ac..03c3c738b06a06c76a6004441683515524a23d6b 100644 (file)
@@ -98,10 +98,17 @@ BASE_URL = "http://foo.foo.org/"
 NETWORK_NAME = "FooNet"
 
 # OPTION: LOGO_URL
-#         URL to your logo (max height 68 pixels).
+#         URL (relative or absolute) to your logo (max height 68 pixels).
 #         If not set the default network name will shown in text.
+#         Can be set to "" to display the logo box without setting the
+#         logo (for use with CUSTOM_CSS)
 #LOGO_URL="images/logo.png"
 
+# OPTION: CUSTOM_CSS
+#         Filename of custom css to include.
+#         Must be in the css directory.
+#CUSTOM_CSS="mynetwork.css"
+
 # OPTION: ANALYTICS_HTML
 #         If you have an analytics service, you can paste the HTML
 #         between the triple quotes.
index 2504dc984fd57538adbe98ef1e9cdca6d3b5fd2b..02d1b5a72d734af03f35c9b45360811f2d94b1a5 100644 (file)
@@ -23,9 +23,11 @@ qwebirc.ui.ConnectPane = new Class({
       exec("[name=" + box + "box]", util.setVisible(true));
 
       if(!autoConnect) {
-        if(uiOptions.logoURL) {
+        if($defined(uiOptions.logoURL)) {
           var logoBar = parent.getElement("[class=bar-logo]");
-          logoBar.setAttribute("style", "background: url(" + uiOptions.logoURL + ") no-repeat center top; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + uiOptions.logoURL + "',sizingMethod='crop');");
+          if(uiOptions.logoURL)
+            logoBar.setAttribute("style", "background: url(" + uiOptions.logoURL + ") no-repeat center top; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + uiOptions.logoURL + "',sizingMethod='crop');");
+
           util.makeVisible(parent.getElement("[name=loginheader]"));
         } else {
           util.makeVisible(parent.getElement("[name=nologologinheader]"));