]> git.mjollnir.org Git - s9y.git/commitdiff
Fix WYSIWYG issue, by Jay Bertrandt
authorgarvinhicking <garvinhicking>
Mon, 14 Aug 2006 08:54:35 +0000 (08:54 +0000)
committergarvinhicking <garvinhicking>
Mon, 14 Aug 2006 08:54:35 +0000 (08:54 +0000)
deployment/serendipity_editor.js
docs/NEWS
include/functions_entries.inc.php
include/functions_entries_admin.inc.php
serendipity_editor.js

index 12713f35ca019b6ca2f9825474e792f81fda217d..3a68838bc6b009dbb43d2ae13b13e259f4f1593c 100644 (file)
@@ -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();
 }
 
 // -->
index 088f79520e3020d667a28ceb4d8e7278d6115611..3832cb7d11ebf29118ce86734471a780ff21fe6a 100644 (file)
--- 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!
         
index d320e2eb4d065890ae15469c0139174818cfe1ae..c6d59a63af962633c61a2f9a33d67ca6c59961c9 100644 (file)
@@ -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');
 
index 78e8148aa2dc42a1db3a67874b85cf600b732cff..1bbea8b59f7792171340056698f901f490815cbc 100644 (file)
@@ -525,7 +525,7 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
         config<?php echo $jsname; ?>    = editor<?php echo $jsname; ?>.config;
         config<?php echo $jsname; ?>.registerButton('image_selector', '<?PHP echo MANAGE_IMAGES; ?>', '<?php echo $serendipity['serendipityHTTPPath']; ?>htmlarea/images/ed_s9yimage.gif', false,
             function(editor, id) {
-                window.open('<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_admin_image_selector.php?serendipity[textarea]=<?php echo $jsname; ?>', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
+                window.open('<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_admin_image_selector.php?serendipity[textarea]=<?php echo $jsname . ($spawnMulti ? "' + editor._textArea.id + '" : ''); ?>', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
                 editorref = editor<?php echo $jsname; ?>;
             }
         );
index 12713f35ca019b6ca2f9825474e792f81fda217d..907d878a4358e55ac18923b15bad0e800346aa5d 100644 (file)
@@ -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();
 }
 
 // -->