diff --git a/src/elogd.c b/src/elogd.c index 198cb018..a194ea8b 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -428,7 +428,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command); char *loc(char *orig); void strencode(char *text); int scan_attributes(char *logbook); -int is_inline_attachment(int message_id, char *text, int i); +int is_inline_attachment(char *encoding, int message_id, char *text, int i, char *att); int setgroup(char *str); int setuser(char *str); int setegroup(char *str); @@ -8814,8 +8814,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL attr_index[MAX_N_ATTR], enc_selected, show_smileys, show_text, n_moptions, display_inline, allowed_encoding; char str[2 * NAME_LENGTH], preset[2 * NAME_LENGTH], *p, *pend, star[80], comment[10000], reply_string[256], - list[MAX_N_ATTR][NAME_LENGTH], file_name[256], *buffer, format[256], date[80], script[256], - attrib[MAX_N_ATTR][NAME_LENGTH], *text, orig_tag[80], reply_tag[MAX_REPLY_TO * 10], + list[MAX_N_ATTR][NAME_LENGTH], file_name[256], *buffer, format[256], date[80], script_onload[256], + script_onfocus[256], attrib[MAX_N_ATTR][NAME_LENGTH], *text, orig_tag[80], reply_tag[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], encoding[80], slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH], owner[256], locked_by[256], class_value[80], class_name[80], ua[NAME_LENGTH], mid[80], title[256], login_name[256], full_name[256], cookie[256], orig_author[256], @@ -9532,25 +9532,34 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n"); - script[0] = 0; + script_onload[0] = 0; + script_onfocus[0] = 0; if ((isparam("inlineatt") && *getparam("inlineatt")) || bpreview) - strcpy(script, " OnLoad=\"document.form1.Text.focus();\""); + strcpy(script_onload, "document.form1.Text.focus();"); if (enc_selected == 0) { if (!getcfg(lbs->name, "Message height", str, sizeof(str)) && - !getcfg(lbs->name, "Message width", str, sizeof(str))) - strcat(script, " OnLoad=\"elKeyInit(); init_resize();\" OnFocus=\"elKeyInit();\""); - else - strcat(script, " OnLoad=\"elKeyInit();\" OnFocus=\"elKeyInit();\""); + !getcfg(lbs->name, "Message width", str, sizeof(str))) { + + strcat(script_onload, "elKeyInit();init_resize();"); + strcat(script_onfocus, "elKeyInit();"); + } else + strcat(script_onload, "elKeyInit();"); + strcat(script_onfocus, "elKeyInit();"); } else if (enc_selected == 2 && fckedit_exist) { - strcat(script, " OnLoad=\"initFCKedit();\""); + strcat(script_onload, "initFCKedit();"); } else - strcat(script, " OnLoad=\"init_resize();\""); + strcat(script_onload, "init_resize();"); if (getcfg(lbs->name, "Use Lock", str, sizeof(str)) && atoi(str) == 1) - rsprintf("
\n", script); - else - rsprintf("\n", script); + strcat(script_onload, "unload();"); + + rsprintf("\n"); show_top_text(lbs); rsprintf("