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

include/functions_entries_admin.inc.php

index 4a15052cf89881a3a206de0c4daa4e5801096f2a..78e8148aa2dc42a1db3a67874b85cf600b732cff 100644 (file)
@@ -511,9 +511,17 @@ 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' : ''; ?>) {
-        editor<?php echo $jsname; ?>    = new HTMLArea("<?php echo $item; ?>"<?php echo $spawnMulti ? ' + id' : ''; ?>);
+               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) {