Merge branch 'develop' of github.com:Pita/etherpad-lite into develop

This commit is contained in:
johnyma22 2012-11-01 18:31:02 +00:00
commit 1da39d3d1a
3 changed files with 22 additions and 2 deletions

11
doc/custom_static.md Normal file
View File

@ -0,0 +1,11 @@
# Custom static files
Etherpad Lite allows you to include your own static files in the browser, by modifying the files in `static/custom`.
* `index.js` Javascript that'll be run in `/`
* `index.css` Stylesheet affecting `/`
* `pad.js` Javascript that'll be run in `/p/:padid`
* `pad.css` Stylesheet affecting `/p/:padid`
* `timeslider.js` Javascript that'll be run in `/p/:padid/timeslider`
* `timeslider.css` Stylesheet affecting `/p/:padid/timeslider`
* `favicon.ico` Overrides the default favicon.
* `robots.txt` Overrides the default `robots.txt`.

View File

@ -1,4 +1,5 @@
@include documentation
@include cusotm_static
@include api/api
@include plugins
@include database

View File

@ -12,8 +12,16 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//serve robots.txt
args.app.get('/robots.txt', function(req, res)
{
var filePath = path.normalize(__dirname + "/../../../static/robots.txt");
res.sendfile(filePath);
var filePath = path.normalize(__dirname + "/../../../static/custom/robots.txt");
res.sendfile(filePath, function(err)
{
//there is no custom favicon, send the default robots.txt which dissallows all
if(err)
{
filePath = path.normalize(__dirname + "/../../../static/robots.txt");
res.sendfile(filePath);
}
});
});
//serve favicon.ico