From c92b5283fd08d5c95dd6c45608a657f45602f896 Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Sun, 4 Nov 2012 11:26:17 +0100 Subject: [PATCH] fix #377: add favicon url as optional settings.json parameter --- settings.json.template | 4 ++++ src/node/hooks/express/specialpages.js | 4 ++-- src/node/utils/Settings.js | 5 +++++ src/templates/index.html | 2 +- src/templates/pad.html | 2 +- src/templates/timeslider.html | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/settings.json.template b/settings.json.template index 95ed8c6a6..66192e4b9 100644 --- a/settings.json.template +++ b/settings.json.template @@ -6,6 +6,10 @@ { // Name your instance! "title": "Etherpad Lite", + + // favicon default name + // alternatively, set up a fully specified Url to your own favicon + "favicon": "favicon.ico", //Ip and port which etherpad should bind at "ip": "0.0.0.0", diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index 50d27700a..96bb324fc 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -24,8 +24,8 @@ exports.expressCreateServer = function (hook_name, args, cb) { }); }); - //serve favicon.ico - args.app.get('/favicon.ico', function(req, res) + //serve favicon.ico from all path levels + args.app.get( /\/favicon.ico$/, function(req, res) { var filePath = path.normalize(__dirname + "/../../../static/custom/favicon.ico"); res.sendfile(filePath, function(err) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 38c982875..aa93117aa 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -34,6 +34,11 @@ exports.root = path.normalize(path.join(npm.dir, "..")); */ exports.title = "Etherpad Lite"; +/** + * The app favicon fully specified url, visible e.g. in the browser window + */ +exports.favicon = "favicon.ico"; + /** * The IP ep-lite should listen to */ diff --git a/src/templates/index.html b/src/templates/index.html index 58af9a5ea..23c3c7755 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -32,7 +32,7 @@ - +