diff --git a/index.html b/index.html index ea0ca2c..5fb5ac5 100644 --- a/index.html +++ b/index.html @@ -353,6 +353,17 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel +
  • +
    +
    + +
    + +
    +
    +
    +
  • +
  • diff --git a/js/glowingbear.js b/js/glowingbear.js index 2233448..271916a 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -46,6 +46,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', 'readlineBindings': false, 'enableJSEmoji': (utils.isMobileUi() ? false : true), 'enableMathjax': false, + 'customCSS': '', }); $scope.settings = settings; @@ -424,6 +425,24 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', })(); }); + settings.addCallback('customCSS', function(css) { + // We need to delete the old tag and add a new one so that the browser + // notices the change. Thus, first remove old custom CSS. + var old_css = document.getElementById('custom-css-tag'); + if (old_css) { + old_css.parentNode.removeChild(old_css); + } + + // Create new CSS tag + var new_css = document.createElement("style"); + new_css.type = "text/css"; + new_css.id = "custom-css-tag"; + new_css.appendChild(document.createTextNode(css)); + // Append it to the tag + var heads = document.getElementsByTagName("head"); + heads[0].appendChild(new_css); + }); + // Update font family when changed settings.addCallback('fontfamily', function(fontfamily) {