From a4456af3e63cffe0ecb12055e48902ee32682740 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 2 Apr 2015 13:48:56 +0200 Subject: [PATCH] Cosmetics --- src/elogd.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 419c0e8a..ca2770e0 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -76,7 +76,7 @@ char rem_host[256]; char rem_host_ip[256]; int _sock; BOOL use_keepalive, enable_execute = FALSE; -BOOL fckedit_exist, image_magick_exist; +BOOL ckedit_exist, image_magick_exist; int _verbose_level, _current_message_id; int _logging_level, _ssl_flag; @@ -10245,7 +10245,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL if (/*enc_selected != 2 && */ !getcfg(lbs->name, "Message height", str, sizeof(str)) && !getcfg(lbs->name, "Message width", str, sizeof(str))) { /* javascript for resizing edit box */ - rsprintf("\nfunction init_resize()\n"); + rsprintf("function init_resize()\n"); rsprintf("{\n"); rsprintf(" window.onresize = resize_textarea;\n"); rsprintf(" resize_textarea();\n"); @@ -10323,7 +10323,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL show_text = !getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1; fixed_text = getcfg(lbs->name, "Fix text", str, sizeof(str)) && atoi(str) == 1 && bedit && message_id; - if (enc_selected == 2 && fckedit_exist && show_text && !fixed_text) { + if (enc_selected == 2 && ckedit_exist && show_text && !fixed_text) { rsprintf("\n"); } @@ -10332,16 +10332,18 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL rsprintf("\n"); /* drag-and-drip script */ - rsprintf("\n\n"); + rsprintf("\n"); + /* CKEDITOR */ + if (enc_selected == 2 && ckedit_exist && show_text && !fixed_text) + rsprintf("\n"); + /* external script if requested */ if (isparam("js")) { rsprintf("\n\n"); } - rsprintf("\n"); - script_onload[0] = 0; script_onfocus[0] = 0; if ((isparam("inlineatt") && *getparam("inlineatt")) || bpreview) @@ -10357,8 +10359,6 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL } else strcat(script_onload, "elKeyInit();"); strcat(script_onfocus, "elKeyInit();"); - } else if (enc_selected == 2 && fckedit_exist && show_text && !fixed_text) { - rsprintf("\n"); } else if (enc_selected == 1) { if (!getcfg(lbs->name, "Message height", str, sizeof(str)) && !getcfg(lbs->name, "Message width", str, sizeof(str))) @@ -10370,7 +10370,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL if (getcfg(lbs->name, "Use Lock", str, sizeof(str)) && atoi(str) == 1) strcat(script_onunload, "unload();"); + rsprintf("\n\n"); rsprintf("\n"); } else { sprintf(ref, "%d", message_id); - strlcpy(script, "OnLoad=\"document.onkeypress = browse\";", sizeof(script)); + strlcpy(script, "OnLoad=\"document.onkeypress=browse;\"", sizeof(script)); if (str[0]) show_standard_header(lbs, TRUE, str, ref, FALSE, NULL, script, 0); else @@ -28600,8 +28602,8 @@ int process_http_request(const char *request, int i_conn) *strchr(global_cmd, '\r') = 0; } - /* redirect image request from inside FCKeditor */ - if (strieq(logbook, "fckeditor")) { + /* redirect image request from inside CKeditor */ + if (strieq(logbook, "ckeditor")) { if (strstr(url, "?lb=")) { strlcpy(logbook, strstr(url, "?lb=") + 4, sizeof(logbook)); if (strchr(logbook, '&')) @@ -28796,7 +28798,7 @@ int process_http_request(const char *request, int i_conn) for (i = 0; *p && *p != '/' && *p != '?'; p++); while (*p && *p == '/') p++; - if (strncmp(p, "editor/", 7) == 0) // fix for image request inside FCKeditor + if (strncmp(p, "editor/", 7) == 0) // fix for image request inside CKeditor p += 7; /* decode command and return answer */ decode_get(logbook, p); @@ -29383,13 +29385,13 @@ void server_loop(void) /* load initial configuration */ check_config(); - /* check for FCKedit */ + /* check for CKedit */ strlcpy(str, resource_dir, sizeof(str)); strlcat(str, "scripts", sizeof(str)); strlcat(str, DIR_SEPARATOR_STR, sizeof(str)); strlcat(str, "ckeditor/ckeditor.js", sizeof(str)); - fckedit_exist = exist_file(str); - if (fckedit_exist) + ckedit_exist = exist_file(str); + if (ckedit_exist) eprintf("CKeditor detected\n"); else eprintf("CKeditor NOT detected\n");