summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-01-28 16:21:39 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-01-28 16:21:39 +0100
commit6035eb334bae7ec2081fe3328d4aa08e2d920593 (patch)
treeb1544788c62ec0611372e18d4cee01b33b3cb87c /lib/exe
parenta499671a776efa773c3ef1efe2521ee815fe76bc (diff)
downloadrpg-6035eb334bae7ec2081fe3328d4aa08e2d920593.tar.gz
rpg-6035eb334bae7ec2081fe3328d4aa08e2d920593.tar.bz2
Pagelocks are now refreshed in the background
An AJAX call is used to refresh the pagelock when keypresses in the textarea are detected (With a minimum wait of one minute between calls). darcs-hash:20060128152139-7ad00-66d64326bcf04c9b8d49285ac736137e9dd48249.gz
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/ajax.php15
-rw-r--r--lib/exe/js.php2
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 8c93bcdab..e52d5d378 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -60,5 +60,20 @@ function ajax_qsearch(){
print '</ul>';
}
+/**
+ * Refresh a page lock
+ *
+ * Andreas Gohr <andi@splitbrain.org>
+ */
+function ajax_lock(){
+ $id = cleanID($_POST['id']);
+ if(empty($id)) return;
+
+ if(!checklock($id)){
+ lock($id);
+ print 1;
+ }
+}
+
//Setup VIM: ex: et ts=2 enc=utf-8 :
?>
diff --git a/lib/exe/js.php b/lib/exe/js.php
index 79d846ed8..223917fc8 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -93,7 +93,7 @@ function js_out(){
js_runonstart("initChangeCheck('".js_escape($lang['notsavedyet'])."')");
// add lock timer
- js_runonstart("init_locktimer(".($conf['locktime']-60).",'".js_escape($lang['willexpire'])."')");
+ js_runonstart("locktimer.init(".($conf['locktime'] - 60).",'".js_escape($lang['willexpire'])."')");
// load spell checker
if($conf['spellchecker']){