aboutsummaryrefslogtreecommitdiffstats
path: root/etherpad/src/etherpad/helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'etherpad/src/etherpad/helpers.js')
-rw-r--r--etherpad/src/etherpad/helpers.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/etherpad/src/etherpad/helpers.js b/etherpad/src/etherpad/helpers.js
index e16c2f7..54bee2d 100644
--- a/etherpad/src/etherpad/helpers.js
+++ b/etherpad/src/etherpad/helpers.js
@@ -77,6 +77,10 @@ function addClientVars(vars) {
});
}
+function getClientVar(name) {
+ return _hd().clientVars[name];
+}
+
function addToHead(stuff) {
_hd().headExtra += stuff;
}
@@ -274,3 +278,29 @@ function rafterTerminationDate() {
return "March 31, 2010";
}
+function updateToUrl(setParams, deleteParams, setPath) {
+ var params = {};
+
+ for (param in request.params)
+ if (deleteParams === undefined || deleteParams.indexOf(param) == -1)
+ params[param] = request.params[param];
+
+ if (setParams !== undefined)
+ for (param in setParams)
+ params[param] = setParams[param];
+
+ var path = request.path;
+ if (setPath !== undefined)
+ path = setPath;
+
+ var paramStr = '';
+ for (param in params) {
+ if (paramStr == '')
+ paramStr += '?';
+ else
+ paramStr += '&';
+ paramStr += param + '=' + params[param];
+ }
+
+ return path + paramStr;
+} \ No newline at end of file