summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnyma22 <john@mclear.co.uk>2012-11-01 18:31:02 +0000
committerjohnyma22 <john@mclear.co.uk>2012-11-01 18:31:02 +0000
commit1da39d3d1a0cd29e72d42b9a7207afeea6ee41b2 (patch)
tree4ef405a98e16ce0085fd3479e43819104e2e6208
parentd7d2f5de2dd31905460eb1a0a36203055ced922e (diff)
parent2311b0fbb4ae2c34b2bb4f9303bf4064180e2c40 (diff)
downloadetherpad-lite-1da39d3d1a0cd29e72d42b9a7207afeea6ee41b2.zip
Merge branch 'develop' of github.com:Pita/etherpad-lite into develop
-rw-r--r--doc/custom_static.md11
-rw-r--r--doc/index.md (renamed from doc/all.md)1
-rw-r--r--src/node/hooks/express/specialpages.js12
3 files changed, 22 insertions, 2 deletions
diff --git a/doc/custom_static.md b/doc/custom_static.md
new file mode 100644
index 00000000..f646e3ba
--- /dev/null
+++ b/doc/custom_static.md
@@ -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`. \ No newline at end of file
diff --git a/doc/all.md b/doc/index.md
index f1e071a6..db7cefaa 100644
--- a/doc/all.md
+++ b/doc/index.md
@@ -1,4 +1,5 @@
@include documentation
+@include cusotm_static
@include api/api
@include plugins
@include database
diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js
index a5834492..50d27700 100644
--- a/src/node/hooks/express/specialpages.js
+++ b/src/node/hooks/express/specialpages.js
@@ -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