mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Stop AJAX request before submitting entry
This commit is contained in:
parent
fc8b35d9fb
commit
c7d1f53594
@ -36,6 +36,9 @@ function asend() {
|
|||||||
var r = XMLHttpRequestGeneric();
|
var r = XMLHttpRequestGeneric();
|
||||||
r.onreadystatechange = function()
|
r.onreadystatechange = function()
|
||||||
{
|
{
|
||||||
|
if (r.readyState==4)
|
||||||
|
in_asend = false;
|
||||||
|
|
||||||
// after successful completion ...
|
// after successful completion ...
|
||||||
if (r.readyState==4 && r.status==200) {
|
if (r.readyState==4 && r.status==200) {
|
||||||
// restore original title
|
// restore original title
|
||||||
@ -85,6 +88,7 @@ function asend() {
|
|||||||
|
|
||||||
// add jcmd
|
// add jcmd
|
||||||
f.append("jcmd", "Save");
|
f.append("jcmd", "Save");
|
||||||
|
in_asend = true;
|
||||||
r.send(f);
|
r.send(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9993,6 +9993,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("var entry_modified = false;\n");
|
rsprintf("var entry_modified = false;\n");
|
||||||
rsprintf("var draft_modified = false;\n");
|
rsprintf("var draft_modified = false;\n");
|
||||||
rsprintf("var last_key = 0;\n\n");
|
rsprintf("var last_key = 0;\n\n");
|
||||||
|
rsprintf("var in_asend = false;\n\n");
|
||||||
|
|
||||||
rsprintf("function chkform()\n");
|
rsprintf("function chkform()\n");
|
||||||
rsprintf("{\n");
|
rsprintf("{\n");
|
||||||
@ -10155,6 +10156,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsprintf(" if (autoSaveTimer != null)\n");
|
||||||
|
rsprintf(" clearTimeout(autoSaveTimer);\n");
|
||||||
|
rsprintf(" while (in_asend);\n"); // wait for any running asynchronous operation
|
||||||
rsprintf(" submitted = true;\n");
|
rsprintf(" submitted = true;\n");
|
||||||
rsprintf(" return true;\n");
|
rsprintf(" return true;\n");
|
||||||
rsprintf("}\n\n");
|
rsprintf("}\n\n");
|
||||||
@ -10164,6 +10168,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
rsprintf("{\n");
|
rsprintf("{\n");
|
||||||
rsprintf(" if (autoSaveTimer != null)\n");
|
rsprintf(" if (autoSaveTimer != null)\n");
|
||||||
rsprintf(" clearTimeout(autoSaveTimer);\n");
|
rsprintf(" clearTimeout(autoSaveTimer);\n");
|
||||||
|
rsprintf(" while (in_asend);\n"); // wait for any running asynchronous operation
|
||||||
rsprintf(" submitted = true;\n"); // don't ask to leave that page
|
rsprintf(" submitted = true;\n"); // don't ask to leave that page
|
||||||
rsprintf(" return true;\n");
|
rsprintf(" return true;\n");
|
||||||
rsprintf("}\n\n");
|
rsprintf("}\n\n");
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<key>IDESourceControlProjectIdentifier</key>
|
<key>IDESourceControlProjectIdentifier</key>
|
||||||
<string>81431534-03C4-4F18-8910-AA341A0BBED2</string>
|
<string>81431534-03C4-4F18-8910-AA341A0BBED2</string>
|
||||||
<key>IDESourceControlProjectName</key>
|
<key>IDESourceControlProjectName</key>
|
||||||
<string>project</string>
|
<string>elogd</string>
|
||||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>4A8AA611133AD3F7E07C7C33DCF50244FB7A1AB5</key>
|
<key>4A8AA611133AD3F7E07C7C33DCF50244FB7A1AB5</key>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<string>bitbucket.org:ritt/elog.git</string>
|
<string>bitbucket.org:ritt/elog.git</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>IDESourceControlProjectPath</key>
|
<key>IDESourceControlProjectPath</key>
|
||||||
<string>xcode/elogd.xcodeproj/project.xcworkspace</string>
|
<string>xcode/elogd.xcodeproj</string>
|
||||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>4A8AA611133AD3F7E07C7C33DCF50244FB7A1AB5</key>
|
<key>4A8AA611133AD3F7E07C7C33DCF50244FB7A1AB5</key>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user