mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-10-01 05:05:19 +00:00
Fixed issue with "Save" button and "Show text = 0". Hide "Preview" button when "Show text = 0".
This commit is contained in:
parent
4af237d43a
commit
3c6435e3a8
@ -70,15 +70,18 @@ function asend() {
|
|||||||
|
|
||||||
// get all form fields
|
// get all form fields
|
||||||
var f = new FormData(document.form1);
|
var f = new FormData(document.form1);
|
||||||
|
var t;
|
||||||
|
|
||||||
// append text for CKEDITOR and textarea, respectively
|
// append text for CKEDITOR and textarea, respectively
|
||||||
if (typeof f.delete == 'function') // not avalable in all browsers
|
if (typeof f.delete == 'function') // not avalable in all browsers
|
||||||
f.delete("Text");
|
f.delete("Text");
|
||||||
if (typeof(CKEDITOR) != 'undefined')
|
if (typeof(CKEDITOR) != 'undefined')
|
||||||
t = CKEDITOR.instances.Text.getData();
|
t = CKEDITOR.instances.Text.getData();
|
||||||
else
|
else if (document.form1.Text != undefined)
|
||||||
t = document.form1.Text.value;
|
t = document.form1.Text.value;
|
||||||
f.append("Text", t);
|
|
||||||
|
if (t != undefined)
|
||||||
|
f.append("Text", t);
|
||||||
|
|
||||||
// add jcmd
|
// add jcmd
|
||||||
f.append("jcmd", "Save");
|
f.append("jcmd", "Save");
|
||||||
|
|||||||
@ -10435,7 +10435,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
loc("Submit"));
|
loc("Submit"));
|
||||||
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return save_draft();\">\n",
|
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return save_draft();\">\n",
|
||||||
loc("Save"));
|
loc("Save"));
|
||||||
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
|
||||||
|
if (!getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1)
|
||||||
|
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
||||||
loc("Preview"));
|
loc("Preview"));
|
||||||
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
||||||
loc("Back"));
|
loc("Back"));
|
||||||
@ -11948,8 +11950,11 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
loc("Submit"));
|
loc("Submit"));
|
||||||
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return save_draft();\">\n",
|
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return save_draft();\">\n",
|
||||||
loc("Save"));
|
loc("Save"));
|
||||||
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
|
||||||
|
if (!getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1)
|
||||||
|
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
||||||
loc("Preview"));
|
loc("Preview"));
|
||||||
|
|
||||||
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
rsprintf("<input type=\"submit\" name=\"cmd\" value=\"%s\" onClick=\"return mark_submitted();\">\n",
|
||||||
loc("Back"));
|
loc("Back"));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user