Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12375
Modified Files:
serendipity_functions.inc.php
Log Message:
* Also toggle tools for extended entry
* Fix invalid table
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.342
retrieving revision 1.343
diff -u -d -r1.342 -r1.343
--- serendipity_functions.inc.php 17 Jul 2004 11:42:32 -0000 1.342
+++ serendipity_functions.inc.php 17 Jul 2004 23:10:12 -0000 1.343
@@ -2753,15 +2753,19 @@
<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';
+ function toggle_extended() {
+ var textarea = document.getElementById('serendipity[extended]');
+ var button = document.getElementById('option_extended');
+ var tools = document.getElementById('tools_extended');
+ if ( textarea.style.display == 'none' ) {
+ textarea.style.display = '';
+ tools.style.display = '';
+ button.src = 'pixel/minus.png';
} else {
- document.getElementById(id).style.display = 'none';
- document.getElementById(imgid).src = 'pixel/plus.png';
+ textarea.style.display = 'none';
+ tools.style.display = 'none';
+ button.src = 'pixel/plus.png';
}
-
}
var selector_toggle = new Array();
@@ -2891,15 +2895,16 @@
<td align="left">
<input id="checkbox_allow_comments" type="checkbox" name="serendipity[allow_comments]" value="true" <?php echo $allow_comments; ?> /><label for="checkbox_allow_comments"><?php echo COMMENTS_ENABLE; ?></label>
</td>
+ <td align="right" rowspan="2" valign="middle">
+ <input type="submit" value="- <?php echo PREVIEW; ?> -" style="font-weight: bold;" onclick="document.forms['serendipityEntry'].elements['serendipity[preview]'].value='true';" />
+ <input type="submit" value="- <?php echo SAVE; ?> -" style="font-weight: bold;" />
+ </td>
+
</tr>
<tr>
<td align="left">
<input id="checkbox_moderate_comments" type="checkbox" name="serendipity[moderate_comments]" value="true" <?php echo $moderate_comments; ?> /><label for="checkbox_moderate_comments"><?php echo COMMENTS_MODERATE; ?></label>
</td>
- <td align="right" rowspan="2">
- <input type="submit" value="- <?php echo PREVIEW; ?> -" style="font-weight: bold;" onclick="document.forms['serendipityEntry'].elements['serendipity[preview]'].value='true';" />
- <input type="submit" value="- <?php echo SAVE; ?> -" style="font-weight: bold;" />
- </td>
</tr>
</table>
</td>
@@ -2908,12 +2913,16 @@
<tr>
<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>
+ <a style="border:0; text-decoration: none" href="#" onclick="toggle_extended(); return false;" 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
+if (!$serendipity['wysiwyg']) {
+?>
+ <div id="tools_extended" style="display: none">
+<?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']) ) {
+ if (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>')" />
@@ -2923,7 +2932,7 @@
<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']) { ?>
+ } else { ?>
<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')">
@@ -2933,6 +2942,8 @@
<?php
}
?>
+ </div>
+<?php } ?>
</td>
</tr>
@@ -2959,7 +2970,7 @@
if (!empty($entry['extended']) && !$serendipity['wysiwyg']) {
?>
<script type="text/javascript" language="JavaScript">
- toggle('serendipity[extended]', 'option_extended');
+ toggle_extended();
</script>
<?php } ?>
<?php
|