From 309d594a9a0fee38bb4f62da8ad6b39801714282 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Thu, 19 May 2011 22:46:19 +0100 Subject: [PATCH] The pad default text is now configurable in the settings file --- node/Models/Pad.js | 5 ++--- node/settings.js | 1 + settings.json | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/node/Models/Pad.js b/node/Models/Pad.js index 812d27bd1..b7f9bb95b 100644 --- a/node/Models/Pad.js +++ b/node/Models/Pad.js @@ -2,8 +2,7 @@ var Changeset = require("../Changeset"); var AttributePoolFactory = require("../AttributePoolFactory"); var db = require("../db").db; var async = require("async"); - -exports.startText = "Welcome to Etherpad Lite. This pad text is synchronized as you type, so that everyone viewing this page sees the same text."; +var settings = require('../settings'); /** * Copied from the Etherpad source code, don't know what its good for @@ -130,7 +129,7 @@ Class('Pad', { //this pad doesn't exist, so create it else { - var firstChangeset = Changeset.makeSplice("\n", 0, 0, exports.cleanText(exports.startText)); + var firstChangeset = Changeset.makeSplice("\n", 0, 0, exports.cleanText(settings.defaultPadText)); _this.appendRevision(firstChangeset, ''); } diff --git a/node/settings.js b/node/settings.js index afa622c5a..ec3216229 100644 --- a/node/settings.js +++ b/node/settings.js @@ -21,6 +21,7 @@ exports.port = 9001; exports.dbType = "sqlite"; exports.dbSettings = { "filename" : "../var/sqlite.db" }; exports.logHTTP = true; +exports.defaultPadText = "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n"; //read the settings sync var settingsStr = fs.readFileSync("../settings.json").toString(); diff --git a/settings.json b/settings.json index cd79943e9..0aa5455bb 100644 --- a/settings.json +++ b/settings.json @@ -21,5 +21,9 @@ This file must be valid JSON. But comments are allowed } */ - "logHTTP" : true + //if true, every http request will be loged to stdout + "logHTTP" : true, + + //the default text of a pad + "defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n" }