Skip to content

Commit

Permalink
fix ether#377: add favicon url as optional settings.json parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikinaut committed Nov 4, 2012
1 parent 0fa2526 commit c92b528
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/node/hooks/express/specialpages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/node/utils/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">

<link rel="shortcut icon" href="favicon.ico">
<link rel="shortcut icon" href="<%=settings.favicon%>">

<style>
html, body {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/pad.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">

<link rel="shortcut icon" href="../favicon.ico">
<link rel="shortcut icon" href="<%=settings.favicon%>">

<% e.begin_block("styles"); %>
<link href="../static/css/pad.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion src/templates/timeslider.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="shortcut icon" href="../../favicon.ico">
<link rel="shortcut icon" href="<%=settings.favicon%>">
<link rel="stylesheet" href="../../static/css/pad.css">
<link rel="stylesheet" href="../../static/css/timeslider.css">
<link rel="stylesheet" href="../../static/custom/timeslider.css">
Expand Down

0 comments on commit c92b528

Please sign in to comment.