summaryrefslogtreecommitdiff
path: root/lib/scripts/locktimer.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scripts/locktimer.js')
-rw-r--r--lib/scripts/locktimer.js28
1 files changed, 22 insertions, 6 deletions
diff --git a/lib/scripts/locktimer.js b/lib/scripts/locktimer.js
index 857002abf..96f963c08 100644
--- a/lib/scripts/locktimer.js
+++ b/lib/scripts/locktimer.js
@@ -6,17 +6,33 @@ var dw_locktimer = {
draft: false,
timerID: null,
lasttime: null,
- msg: '',
+ msg: LANG.willexpire,
pageid: '',
/**
* Initialize the lock timer
*
- * @param int timeout Lenght of timeout in seconds
- * @param bool draft save drafts
+ * @param int timeout Length of timeout in seconds
+ * @param string msg Deprecated; The expiry message
+ * @param bool draft Whether to save drafts
+ * @param string edid Optional; ID of an edit object which has to be present
*/
- init: function(timeout,draft){ //FIXME which elements to pass here?
- var $edit = jQuery('#wiki__text');
+ init: function(timeout,msg,draft,edid){
+ var $edit;
+
+ switch (arguments.length) {
+ case 4:
+ DEPRECATED('Setting the locktimer expiry message is deprecated');
+ dw_locktimer.msg = msg;
+ break;
+ case 3:
+ edid = draft;
+ case 2:
+ draft = msg;
+ }
+ edid = edid || 'wiki__text';
+
+ $edit = jQuery('#' + edid);
if($edit.length === 0 || $edit.attr('readonly')) {
return;
}
@@ -50,7 +66,7 @@ var dw_locktimer = {
*/
warning: function(){
dw_locktimer.clear();
- alert(LANG.willexpire.replace(/\\n/,"\n"));
+ alert(fixtxt(dw_locktimer.msg));
},
/**