]> git.mjollnir.org Git - s9y.git/commitdiff
Jay Bertrandts patch for fixup multi-spawened WYSIWYG controls.
authorgarvinhicking <garvinhicking>
Tue, 11 Apr 2006 07:08:23 +0000 (07:08 +0000)
committergarvinhicking <garvinhicking>
Tue, 11 Apr 2006 07:08:23 +0000 (07:08 +0000)
HUGE thanks!

include/functions_entries_admin.inc.php

index 4effa9f59af78cdce52110cf5781b49c9ddab50c..b47438f1c35adc7277606d03c0ef62545414a723 100644 (file)
@@ -518,10 +518,18 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
     // Thanks to Randall for pointing this out!
 
     // HTMLArea.loadPlugin("SpellChecker"); // [SPELLCHECK]
+       <?php if($spawnMulti) { ?>
+       // when spawning multiple editors at once, keep track of instances in this array
+    var htmlarea_editors = new Array();
+       <?php } else  { ?>
     var editor<?php echo $jsname; ?> = null; var config<?php echo $jsname; ?> = null;
+       <?php } // end if ?>
     function Spawn<?php echo $jsname; ?>(<?php echo $spawnMulti ? 'id' : ''; ?>) {
-        var editor<?php echo $jsname; ?>    = new HTMLArea("<?php echo $item; ?>"<?php echo $spawnMulti ? ' + id' : ''; ?>);
-        var config<?php echo $jsname; ?>    = editor<?php echo $jsname; ?>.config;
+               editor<?php echo $jsname; ?> = new HTMLArea("<?php echo $item; ?>"<?php echo $spawnMulti ? ' + id' : ''; ?>);
+        <?php if($spawnMulti) { ?>
+               htmlarea_editors["<?php echo $item; ?>"<?php echo $spawnMulti ? ' + id' : ''; ?>] = editor<?php echo $jsname; ?>;
+               <?php } // end if ?>
+        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');