Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17619
Modified Files:
serendipity_entries.php serendipity_functions.inc.php
Log Message:
Fix WYSIWYG bug for IE6, where no textarea was displayed.
I am still looking into CSS-styling the editor's content to match with
'serendipity_entry' class...
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -d -r1.235 -r1.236
--- serendipity_functions.inc.php 23 Mar 2004 15:49:25 -0000 1.235
+++ serendipity_functions.inc.php 24 Mar 2004 12:45:23 -0000 1.236
@@ -2028,7 +2028,7 @@
<tr>
<td colspan="3">
- <textarea name="serendipity[body]" id="serendipity[body]" cols="80" rows="20"><?php echo isset($entry['body']) ? htmlentities($entry['body']) : ''; ?></textarea>
+ <textarea style="width: 100%" name="serendipity[body]" id="serendipity[body]" cols="80" rows="20"><?php echo isset($entry['body']) ? htmlentities($entry['body']) : ''; ?></textarea>
</td>
</tr>
@@ -2055,7 +2055,7 @@
<tr>
<td colspan="3">
- <textarea name="serendipity[extended]" id="serendipity[extended]" cols="80" rows="20"><?php echo isset($entry['extended']) ? htmlentities($entry['extended']) : ''; ?></textarea>
+ <textarea style="width: 100%" name="serendipity[extended]" id="serendipity[extended]" cols="80" rows="20"><?php echo isset($entry['extended']) ? htmlentities($entry['extended']) : ''; ?></textarea>
</td>
</tr>
@@ -2074,8 +2074,8 @@
</form>
<?php
if ($serendipity['wysiwyg']) {
- serendipity_emit_htmlarea_code('serendipity[body]');
- serendipity_emit_htmlarea_code('serendipity[extended]');
+ serendipity_emit_htmlarea_code('serendipity[body]', 'body');
+ serendipity_emit_htmlarea_code('serendipity[extended]', 'extended');
}
echo ' <script type="text/javascript" language="JavaScript" src="serendipity_define.js.php"></script>';
@@ -2293,7 +2293,7 @@
echo "</span>";
}
-function serendipity_emit_htmlarea_code($item)
+function serendipity_emit_htmlarea_code($item, $jsname)
{
static $init = false;
global $serendipity;
@@ -2305,41 +2305,46 @@
<script type="text/javascript">
_editor_url = "<?php echo $serendipity['serendipityHTTPPath'] . 'htmlarea/'; ?>";
_editor_lang = "<?php echo $serendipity['lang']; ?>";
+ var editorref = '';
</script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
- <script type="text/javascript" src="htmlarea/lang/<?php echo (file_exists($serendipity['serendipityHTTPPath'] . 'htmlarea/lang/' . $serendipity['lang'] . '.js') ? $serendipity['lang'] : 'en'); ?>.js"></script>
<script type="text/javascript" src="htmlarea/dialog.js"></script>
<style type="text/css">@import url(htmlarea/htmlarea.css);</style>
+<?php
+ }
+?>
<script type="text/javascript">
- var config = new HTMLArea.Config();
- var editorref = '';
- config.registerButton('image_selector', '<?PHP echo MANAGE_IMAGES; ?>', 'htmlarea/images/ed_s9yimage.gif', false,
+ var editor<?php echo $jsname; ?> = null; var config<?php echo $jsname; ?> = null;
+ function Spawn<?php echo $jsname; ?>() {
+ var editor<?php echo $jsname; ?> = new HTMLArea("<?php echo $item; ?>");
+ var config<?php echo $jsname; ?> = editor<?php echo $jsname; ?>.config;
+ config<?php echo $jsname; ?>.registerButton('image_selector', '<?PHP echo MANAGE_IMAGES; ?>', 'htmlarea/images/ed_s9yimage.gif', false,
function(editor, id) {
window.open('serendipity_admin_image_selector.php', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
- editorref = editor;
+ editorref = editor<?php echo $jsname; ?>;
}
);
- config.toolbar.push([ "image_selector"]);
- config.toolbar = [
- [ "fontname", "space",
- "fontsize", "space",
- "formatblock", "space",
- "bold", "italic", "underline", "strikethrough", "separator",
- "subscript", "superscript", "separator",
- "copy", "cut", "paste", "space", "undo", "redo" ],
+ config<?php echo $jsname; ?>.toolbar.push([ "image_selector"]);
+ config<?php echo $jsname; ?>.toolbar = [
+ [ "fontname", "space",
+ "fontsize", "space",
+ "formatblock", "space",
+ "bold", "italic", "underline", "strikethrough", "separator",
+ "subscript", "superscript", "separator",
+ "copy", "cut", "paste", "space", "undo", "redo" ],
- [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
- "lefttoright", "righttoleft", "separator",
- "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
- "forecolor", "hilitecolor", "separator",
- "inserthorizontalrule", "createlink", "insertimage", "image_selector", "inserttable", "htmlmode", "separator",
- "popupeditor", "separator", "showhelp", "about" ]
- ];
+ [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+ "lefttoright", "righttoleft", "separator",
+ "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+ "forecolor", "hilitecolor", "separator",
+ "inserthorizontalrule", "createlink", "insertimage", "image_selector", "inserttable", "htmlmode", "separator",
+ "popupeditor", "separator", "showhelp", "about" ]
+ ];
+ editor<?php echo $jsname; ?>.generate();
+ editor<?php echo $jsname; ?>._textArea.className = 'serendipity_entry';
+ }
</script>
<?php
- }
-
- echo '<script defer="defer">HTMLArea.replace("' . $item . '", config);</script>';
}
$init = true;
Index: serendipity_entries.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_entries.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- serendipity_entries.php 21 Mar 2004 16:35:32 -0000 1.25
+++ serendipity_entries.php 24 Mar 2004 12:45:23 -0000 1.26
@@ -31,7 +31,7 @@
</head>
-<body id="serendipity_admin_entries_page">
+<body id="serendipity_admin_entries_page" onload="if (self.Spawnbody) { Spawnbody(); } if (self.Spawnextended) { Spawnextended(); }">
<div id="serendipity_banner">
<h1><?php echo $serendipity['blogTitle'] ; ?></h1>
<?php
|