Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21818
Modified Files:
NEWS htaccess.rewrite.tpl serendipity_config_local.tpl
serendipity_editor.js serendipity_functions.inc.php
Log Message:
Upgrade to latest HTMLArea.
Finally get our image manager implemented there. Made WYSIWYG-editor default
as it works on most browsers and cross-platform. s9y should look great
out-of-the-box, and advanced users who directly type their html-code should
be advanced enough to turn it off.
Index: serendipity_editor.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- serendipity_editor.js 8 Jul 2003 13:51:19 -0000 1.6
+++ serendipity_editor.js 23 Mar 2004 15:49:25 -0000 1.7
@@ -165,7 +165,12 @@
insert = img;
}
- self.opener.serendipity_imageSelector_addToBody(insert);
+ if (self.opener.editorref) {
+ self.opener.editorref.surroundHTML(insert, '');
+ } else {
+ self.opener.serendipity_imageSelector_addToBody(insert);
+ }
+
self.close();
}
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.234
retrieving revision 1.235
diff -u -d -r1.234 -r1.235
--- serendipity_functions.inc.php 22 Mar 2004 17:17:45 -0000 1.234
+++ serendipity_functions.inc.php 23 Mar 2004 15:49:25 -0000 1.235
@@ -2074,12 +2074,12 @@
</form>
<?php
if ($serendipity['wysiwyg']) {
- serendipity_emit_htmlarea_code('document.forms[\'serendipityEntry\'][\'serendipity[body]\']');
- serendipity_emit_htmlarea_code('document.forms[\'serendipityEntry\'][\'serendipity[extended]\']');
- } else {
- echo ' <script type="text/javascript" language="JavaScript" src="serendipity_define.js.php"></script>';
- echo ' <script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>';
+ serendipity_emit_htmlarea_code('serendipity[body]');
+ serendipity_emit_htmlarea_code('serendipity[extended]');
}
+
+ echo ' <script type="text/javascript" language="JavaScript" src="serendipity_define.js.php"></script>';
+ echo ' <script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>';
}
function serendipity_authenticate_author($username = '', $password = '') {
@@ -2302,14 +2302,44 @@
if (!$init) {
?>
+ <script type="text/javascript">
+ _editor_url = "<?php echo $serendipity['serendipityHTTPPath'] . 'htmlarea/'; ?>";
+ _editor_lang = "<?php echo $serendipity['lang']; ?>";
+ </script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
- <script type="text/javascript" src="htmlarea/htmlarea-lang-en.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>
+ <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,
+ 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;
+ }
+ );
+ 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" ],
+
+ [ "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" ]
+ ];
+ </script>
<?php
}
- echo '<script defer="defer">(new HTMLArea(' . $item . ')).generate();</script>';
+ echo '<script defer="defer">HTMLArea.replace("' . $item . '", config);</script>';
}
$init = true;
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- NEWS 22 Mar 2004 17:17:45 -0000 1.95
+++ NEWS 23 Mar 2004 15:49:24 -0000 1.96
@@ -3,6 +3,9 @@
Version 0.6 ()
------------------------------------------------------------------------
+ * Updated WYSIWYG-Editor (htmlarea) to latest version. Integrated
+ s9y image manager in htmlarea window. (garvinhicking)
+
* Templates: New CSS classes for better customization
- 'serendipity_entry_body_folded' for the entry body on the
weblog index page
Index: htaccess.rewrite.tpl
===================================================================
RCS file: /cvsroot/php-blog/serendipity/htaccess.rewrite.tpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- htaccess.rewrite.tpl 21 Mar 2004 16:26:56 -0000 1.5
+++ htaccess.rewrite.tpl 23 Mar 2004 15:49:24 -0000 1.6
@@ -14,6 +14,7 @@
RewriteRule ^{PAT_CATEGORIES} {indexFile}?url={PATH_ARCHIVE}/$1 [L,QSA]
RewriteRule ^{PAT_FEED} rss.php?file=$1&ext=$2
RewriteRule ^index\.(html?|php.?) {indexFile}?url=index.html [L,QSA]
+RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) {indexFile}?url=/$1 [L,QSA]
<Files *.tpl>
Index: serendipity_config_local.tpl
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- serendipity_config_local.tpl 26 Feb 2004 11:37:42 -0000 1.33
+++ serendipity_config_local.tpl 23 Mar 2004 15:49:25 -0000 1.34
@@ -33,7 +33,7 @@
// Appearance and options
# Customize how Serendipity looks and feels
$serendipity['extCSS'] = '{External Stylesheet|extCSS|string|none}'; // You can define a stylesheet uri here, aditionally to the settings adjustable in the admin interface (enter 'none' if you don't need this)
-$serendipity['wysiwyg'] = '{Use WYSIWYG editor|wysiwyg|bool|0}'; // Do you want to use the experimental WYSIWYG editor?
+$serendipity['wysiwyg'] = '{Use WYSIWYG editor|wysiwyg|bool|1}'; // Do you want to use the WYSIWYG editor? (Only works on IE5+, Mozilla 1.3+)
$serendipity['XHTML11'] = '{Force XHTML 1.1 compliance|XHTML11|bool|0}'; // Do you want to force XHTML 1.1 compliance (may cause problems for back-/frontend on older 4th generation browsers)
$serendipity['embed'] = '{Is serendipity embedded?|embed|bool|0}'; // If you want to embed serendipity within a regular page, set to true to discard any headers and just print the contents. You can make use of the indexFile option to use a wrapper class where you put your normal webpage headers. See the INSTALL file for more information!
$serendipity['blockReferer'] = '{Blocked Referers|blockReferer|string|;}'; // Are there any special hosts you want not to show up in the referers list? Separate the list of hostnames with ';' and note that the host is blocked by substring matches!
|