summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-01-11 03:58:02 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-01-11 03:58:02 +0100
commitedaffd8c21daf939e63ebe67219caa0c458001cc (patch)
treeb72976fe31b15adf13a89a562d4f2db1b3163207
parent783c4546d4b6910addd4aee01a77a6894d502968 (diff)
downloadep_global_view-master.tar.gz
ep_global_view-master.tar.bz2
ep_global_view-master.zip
Add userinterfaceHEADmaster
-rw-r--r--ep.json2
-rw-r--r--index.js11
-rw-r--r--locales/en.json3
-rw-r--r--static/css/global_view.css5
-rw-r--r--templates/globalSettings.ejs16
-rw-r--r--templates/globalSettings_styles.ejs1
6 files changed, 38 insertions, 0 deletions
diff --git a/ep.json b/ep.json
index f16cf49..7017477 100644
--- a/ep.json
+++ b/ep.json
@@ -6,6 +6,8 @@
},
"hooks": {
"clientVars": "ep_global_view/index",
+ "eejsBlock_globalSettings": "ep_global_view/index",
+ "eejsBlock_styles": "ep_global_view/index",
"handleMessage": "ep_global_view/index"
}
}
diff --git a/index.js b/index.js
index 6e7e0cd..7bdf1e5 100644
--- a/index.js
+++ b/index.js
@@ -1,4 +1,5 @@
var ERR = require("async-stacktrace");
+var eejs = require('ep_etherpad-lite/node/eejs/');
var padMessage = require("ep_etherpad-lite/node/handler/PadMessageHandler.js");
var padManager = require("ep_etherpad-lite/node/db/PadManager.js");
@@ -16,6 +17,16 @@ exports.clientVars = function(hook, context, callback)
return callback({ "globalViewInfo": globalViewInfo });
};
+exports.eejsBlock_globalSettings = function (hook_name, args, cb) {
+ args.content = args.content + eejs.require("ep_global_view/templates/globalSettings.ejs");
+ return cb();
+}
+
+exports.eejsBlock_styles = function (hook_name, args, cb) {
+ args.content = args.content + eejs.require("ep_global_view/templates/globalSettings_styles.ejs");
+ return cb();
+}
+
exports.handleMessage = function(hook_name, context, cb) {
if ( context.message.type == "COLLABROOM" && context.message.data.type == "GLOBAL_VIEW") {
var client = context.client;
diff --git a/locales/en.json b/locales/en.json
new file mode 100644
index 0000000..48fef80
--- /dev/null
+++ b/locales/en.json
@@ -0,0 +1,3 @@
+{
+ "pad.settings.globalView.warning": "Warning: This will effect everyones view of this pad."
+}
diff --git a/static/css/global_view.css b/static/css/global_view.css
new file mode 100644
index 0000000..5d6cb13
--- /dev/null
+++ b/static/css/global_view.css
@@ -0,0 +1,5 @@
+#globalViewWarning {
+ color: #959595;
+ font-weight: bold;
+ font-size: 10px;
+}
diff --git a/templates/globalSettings.ejs b/templates/globalSettings.ejs
new file mode 100644
index 0000000..1ecb8d6
--- /dev/null
+++ b/templates/globalSettings.ejs
@@ -0,0 +1,16 @@
+<p>
+ <input type="checkbox" id="options-global-colorscheck">
+ <label for="options-global-colorscheck" data-l10n-id="pad.settings.colorcheck"></label>
+</p>
+<p>
+ <input type="checkbox" id="options-global-linenoscheck" checked>
+ <label for="options-global-linenoscheck" data-l10n-id="pad.settings.linenocheck"></label>
+</p>
+
+<label for="global-viewfontmenu" data-l10n-id="pad.settings.fontType"></label>
+<select id="global-viewfontmenu">
+ <option value="normal" data-l10n-id="pad.settings.fontType.normal"></option>
+ <option value="monospace" data-l10n-id="pad.settings.fontType.monospaced"></option>
+</select>
+
+<p data-l10n-id="pad.settings.globalView.warning" id="globalViewWarning"></p>
diff --git a/templates/globalSettings_styles.ejs b/templates/globalSettings_styles.ejs
new file mode 100644
index 0000000..f78bc17
--- /dev/null
+++ b/templates/globalSettings_styles.ejs
@@ -0,0 +1 @@
+<link href="/static/plugins/ep_global_view/static/css/global_view.css" rel="stylesheet">