From 3b20dcd435166a22b4502b7f42c174b8c700223d Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 17 Aug 2017 14:34:22 +0200 Subject: [PATCH] add optional cache-busting to favicon --- www/common/notify.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/www/common/notify.js b/www/common/notify.js index caf9b16af..7ce087b63 100644 --- a/www/common/notify.js +++ b/www/common/notify.js @@ -1,4 +1,11 @@ (function () { + var Mod = function (ApiConfig) { + var requireConf; + if (ApiConfig && ApiConfig.requireConf) { + requireConf = ApiConfig.requireConf; + } + var urlArgs = typeof(requireConf.urlArgs) === 'string'? '?' + urlArgs: ''; + var Module = {}; var isSupported = Module.isSupported = function () { @@ -41,8 +48,8 @@ } }; - var DEFAULT_MAIN = '/customize/main-favicon.png'; - var DEFAULT_ALT = '/customize/alt-favicon.png'; + var DEFAULT_MAIN = '/customize/main-favicon.png' + urlArgs; + var DEFAULT_ALT = '/customize/alt-favicon.png' + urlArgs; var createFavicon = function () { console.log("creating favicon"); @@ -110,13 +117,13 @@ cancel: cancel, }; }; + return Module; + }; if (typeof(module) !== 'undefined' && module.exports) { module.exports = Module; } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { - define(function () { - return Module; - }); + define(['/api/config'], Mod); } else { window.Visible = Module; }