From 1835c1f296c1b476119331c1573914c0d825a448 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 14 Aug 2006 08:54:35 +0000 Subject: [PATCH] Fix WYSIWYG issue, by Jay Bertrandt --- deployment/serendipity_editor.js | 11 ++++++----- docs/NEWS | 4 ++++ include/functions_entries.inc.php | 3 ++- include/functions_entries_admin.inc.php | 2 +- serendipity_editor.js | 11 ++++++----- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/deployment/serendipity_editor.js b/deployment/serendipity_editor.js index 12713f3..3a68838 100644 --- a/deployment/serendipity_editor.js +++ b/deployment/serendipity_editor.js @@ -244,14 +244,15 @@ function serendipity_imageSelector_done(textarea) block = insert; } - if (self.opener.editorref) { - self.opener.editorref.surroundHTML(block, ''); + if (typeof(self.opener.htmlarea_editors) != 'undefined' && typeof(self.opener.htmlarea_editors[textarea] != 'undefined')) { + self.opener.htmlarea_editors[textarea].surroundHTML(block, ''); + } else if (parent.self.opener.editorref) { + parent.self.opener.editorref.surroundHTML(block, ''); } else { - - self.opener.serendipity_imageSelector_addToBody(block, textarea); + parent.self.opener.serendipity_imageSelector_addToBody(block, textarea); } - self.close(); + parent.self.close(); } // --> diff --git a/docs/NEWS b/docs/NEWS index 088f795..3832cb7 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 1.0.1 () ------------------------------------------------------------------------ + * Fix problem on newer Firefox versions, where insertion of images + in the WYSIWYG editor did not work. It might be necessary to + purge your browsers cache for this to properly work. (Jay Bertrandt) + * Fix utf8 iconv conversion failing on some older PHP setups. Thanks to Matthias Leisi! diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index d320e2e..c6d59a6 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -431,7 +431,8 @@ function serendipity_fetchEntryData(&$ret) { FROM {$serendipity['dbPrefix']}category AS c LEFT JOIN {$serendipity['dbPrefix']}entrycat AS ec ON ec.categoryid = c.categoryid - WHERE " . serendipity_db_in_sql('ec.entryid', $search_ids); + WHERE " . serendipity_db_in_sql('ec.entryid', $search_ids) . " + ORDER BY c.category_name ASC"; $search_ret = serendipity_db_query($query, false, 'assoc'); diff --git a/include/functions_entries_admin.inc.php b/include/functions_entries_admin.inc.php index 78e8148..1bbea8b 100644 --- a/include/functions_entries_admin.inc.php +++ b/include/functions_entries_admin.inc.php @@ -525,7 +525,7 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) { config = editor.config; config.registerButton('image_selector', '', 'htmlarea/images/ed_s9yimage.gif', false, function(editor, id) { - window.open('serendipity_admin_image_selector.php?serendipity[textarea]=', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1'); + window.open('serendipity_admin_image_selector.php?serendipity[textarea]=', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1'); editorref = editor; } ); diff --git a/serendipity_editor.js b/serendipity_editor.js index 12713f3..907d878 100644 --- a/serendipity_editor.js +++ b/serendipity_editor.js @@ -244,14 +244,15 @@ function serendipity_imageSelector_done(textarea) block = insert; } - if (self.opener.editorref) { - self.opener.editorref.surroundHTML(block, ''); + if (block == 'x' && typeof(self.opener.htmlarea_editors) != 'undefined' && typeof(self.opener.htmlarea_editors[textarea] != 'undefined')) { + self.opener.htmlarea_editors[textarea].surroundHTML(block, ''); + } else if (parent.self.opener.editorref) { + parent.self.opener.editorref.surroundHTML(block, ''); } else { - - self.opener.serendipity_imageSelector_addToBody(block, textarea); + parent.self.opener.serendipity_imageSelector_addToBody(block, textarea); } - self.close(); + parent.self.close(); } // --> -- 2.39.5