Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20590
Modified Files:
NEWS serendipity_admin_image_selector.php
serendipity_editor.js serendipity_functions.inc.php
Log Message:
* When in non-WYSIWYG we hide the Extended body textarea, and allow authors to toggle it on/off
* Make the non-WYSIWYG tools work in the extended body textarea (can't believe nobody ever complained about this)
Index: serendipity_editor.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- serendipity_editor.js 14 Jul 2004 10:21:05 -0000 1.12
+++ serendipity_editor.js 16 Jul 2004 22:50:57 -0000 1.13
@@ -137,13 +137,13 @@
document.getElementById(el).focus();
}
-function serendipity_imageSelector_addToBody (str)
+function serendipity_imageSelector_addToBody (str, textarea)
{
- document.forms['serendipityEntry']['serendipity[body]'].value += str;
- document.forms['serendipityEntry']['serendipity[body]'].focus();
+ document.forms['serendipityEntry']['serendipity['+ textarea +']'].value += str;
+ document.forms['serendipityEntry']['serendipity['+ textarea +']'].focus();
}
-function serendipity_imageSelector_done()
+function serendipity_imageSelector_done(textarea)
{
var insert = '';
var img = '';
@@ -216,7 +216,7 @@
if (self.opener.editorref) {
self.opener.editorref.surroundHTML(block, '');
} else {
- self.opener.serendipity_imageSelector_addToBody(block);
+ self.opener.serendipity_imageSelector_addToBody(block, textarea);
}
self.close();
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.338
retrieving revision 1.339
diff -u -d -r1.338 -r1.339
--- serendipity_functions.inc.php 16 Jul 2004 22:23:03 -0000 1.338
+++ serendipity_functions.inc.php 16 Jul 2004 22:50:57 -0000 1.339
@@ -2752,6 +2752,18 @@
?>
<a style="border:0; text-decoration: none" href="#" onclick="showItem('categoryselector'); return false" title="<?php echo TOGGLE_OPTION; ?>"><img src="pixel/plus.png" id="option_categoryselector" alt="+/-" border="0" /></a> <b><?php echo CATEGORY; ?>:</b> <?php echo $cat_list ; ?>
<script type="text/javascript" language="JavaScript">
+
+ function toggle(id, imgid) {
+ if ( document.getElementById(id).style.display == 'none' ) {
+ document.getElementById(id).style.display = '';
+ document.getElementById(imgid).src = 'pixel/minus.png';
+ } else {
+ document.getElementById(id).style.display = 'none';
+ document.getElementById(imgid).src = 'pixel/plus.png';
+ }
+
+ }
+
var selector_toggle = new Array();
var selector_store = new Array();
var selector_restore = new Array();
@@ -2846,7 +2858,7 @@
<input type="button" name="insB" value="B" accesskey="i" style="font-weight: bold" onclick="wrapSelection(document.forms['serendipityEntry']['serendipity[body]'],'<b>','</b>')" />
<input type="button" name="insU" value="U" accesskey="u" style="text-decoration: underline;" onclick="wrapSelection(document.forms['serendipityEntry']['serendipity[body]'],'<u>','</u>')" />
<input type="button" name="insJ" value="img" accesskey="j" onclick="wrapInsImage(document.forms['serendipityEntry']['serendipity[body]'])" />
- <input type="button" name="insImage" value="<?php echo IMAGE ; ?>" style="" onclick="window.open('serendipity_admin_image_selector.php', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');" />
+ <input type="button" name="insImage" value="<?php echo IMAGE ; ?>" style="" onclick="window.open('serendipity_admin_image_selector.php?serendipity[textarea]=body', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');" />
<input type="button" name="insU" value="URL" accesskey="l" style="color: blue; text-decoration: underline;" onclick="wrapSelectionWithLink(document.forms['serendipityEntry']['serendipity[body]'])" />
<?php
/* Do the "old" non-WYSIWYG editor */
@@ -2894,12 +2906,39 @@
</tr>
<tr>
- <td colspan="3"><b><?php echo EXTENDED_BODY; ?></b></td>
+ <td colspan="2">
+<?php if (!$serendipity['wysiwyg']) { ?>
+ <a style="border:0; text-decoration: none" href="#" onclick="toggle('serendipity[extended]', 'option_extended');" title="<?php echo TOGGLE_OPTION; ?>"><img src="pixel/plus.png" id="option_extended" alt="+/-" border="0" /></a>
+<?php } ?> <b><?php echo EXTENDED_BODY; ?></b></td>
+ <td align="right">
+ <?php
+ /* Since the user has WYSIWYG editor disabled, we want to check if we should use the "better" non-WYSIWYG editor */
+ if (!$serendipity['wysiwyg'] && eregi($serendipity['EditorBrowsers'], $_SERVER['HTTP_USER_AGENT']) ) {
+?>
+ <input type="button" name="insI" value="I" accesskey="i" style="font-style: italic" onclick="wrapSelection(document.forms['serendipityEntry']['serendipity[extended]'],'<i>','</i>')" />
+ <input type="button" name="insB" value="B" accesskey="i" style="font-weight: bold" onclick="wrapSelection(document.forms['serendipityEntry']['serendipity[extended]'],'<b>','</b>')" />
+ <input type="button" name="insU" value="U" accesskey="u" style="text-decoration: underline;" onclick="wrapSelection(document.forms['serendipityEntry']['serendipity[extended]'],'<u>','</u>')" />
+ <input type="button" name="insJ" value="img" accesskey="j" onclick="wrapInsImage(document.forms['serendipityEntry']['serendipity[extended]'])" />
+ <input type="button" name="insImage" value="<?php echo IMAGE ; ?>" style="" onclick="window.open('serendipity_admin_image_selector.php?serendipity[textarea]=extended', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');" />
+ <input type="button" name="insU" value="URL" accesskey="l" style="color: blue; text-decoration: underline;" onclick="wrapSelectionWithLink(document.forms['serendipityEntry']['serendipity[extended]'])" />
+<?php
+ /* Do the "old" non-WYSIWYG editor */
+ } elseif (!$serendipity['wysiwyg']) { ?>
+ <input type="button" value=" B " onclick="serendipity_insBasic(document.forms['serendipityEntry']['serendipity[extended]'], 'b')">
+ <input type="button" value=" U " onclick="serendipity_insBasic(document.forms['serendipityEntry']['serendipity[extended]'], 'u')">
+ <input type="button" value=" I " onclick="serendipity_insBasic(document.forms['serendipityEntry']['serendipity[extended]'], 'i')">
+ <input type="button" value="<img>" onclick="serendipity_insImage(document.forms['serendipityEntry']['serendipity[extended]'])">
+ <input type="button" value="<?php echo IMAGE; ?>" onclick="window.open('serendipity_admin_image_selector.php', 'ImageSel', 'width=800,height=600,toolbar=no');">
+ <input type="button" value="Link" onclick="serendipity_insLink(document.forms['serendipityEntry']['serendipity[extended]'])">
+<?php
+ }
+?>
+ </td>
</tr>
<tr>
<td colspan="3">
- <textarea style="width: 100%" name="serendipity[extended]" id="serendipity[extended]" cols="80" rows="20"><?php echo isset($entry['extended']) ? htmlspecialchars($entry['extended']) : ''; ?></textarea>
+ <textarea style="width: 100%;<?php echo (!$serendipity['wysiwyg']) ? 'display: none;' : '' ?>" name="serendipity[extended]" id="serendipity[extended]" cols="80" rows="20"><?php echo isset($entry['extended']) ? htmlspecialchars($entry['extended']) : ''; ?></textarea>
</td>
</tr>
Index: serendipity_admin_image_selector.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_image_selector.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- serendipity_admin_image_selector.php 15 Jul 2004 13:31:57 -0000 1.25
+++ serendipity_admin_image_selector.php 16 Jul 2004 22:50:57 -0000 1.26
@@ -93,7 +93,7 @@
<?php } ?>
<input type="button" value="<?php echo BACK; ?>" onclick="history.go(-1);" />
- <input type="button" value="<?php echo DONE; ?>" onclick="serendipity_imageSelector_done()" />
+ <input type="button" value="<?php echo DONE; ?>" onclick="serendipity_imageSelector_done('<?php echo $serendipity['GET']['textarea'] ?>')" />
</div>
</form>
</p>
@@ -144,7 +144,7 @@
isset($serendipity['GET']['end']) ? $serendipity['GET']['end'] : 8,
4,
false,
- '?serendipity[step]=1' . $add_url
+ '?serendipity[step]=1' . $add_url . '&serendipity[textarea]='. $serendipity['GET']['textarea']
);
}
?>
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -d -r1.175 -r1.176
--- NEWS 16 Jul 2004 22:17:23 -0000 1.175
+++ NEWS 16 Jul 2004 22:50:57 -0000 1.176
@@ -3,6 +3,12 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * Make the non-WYSIWYG link-insertion and text-formatters work in
+ the extended entry textarea (tomsommer)
+
+ * Allow authors to toggle the extended entry textarea in the entry
+ composer when using the non-WYSIWYG editor (tomsommer)
+
* Better handling of unsubscriptions from entries, only show message
if the user was indeed unsubscribed (tomsommer)
|