"Instant Preview" added to Advanced Editing form.

git-svn-id: https://develop.svn.wordpress.org/trunk@1762 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Donncha O Caoimh 2004-10-08 16:33:10 +00:00
parent 8254105bef
commit 62332983cf
2 changed files with 34 additions and 3 deletions

View File

@ -94,7 +94,21 @@ window.onload = focusit;
<legend><a href="http://wordpress.org/docs/reference/post/#excerpt" title="<?php _e('Help with excerpts') ?>"><?php _e('Excerpt') ?></a></legend>
<div><textarea rows="1" cols="40" name="excerpt" tabindex="4" id="excerpt"><?php echo $excerpt ?></textarea></div>
</fieldset>
<script type="text/javascript">
<!--
function ReloadTextDiv()
{
var UseInstantPreview = document.getElementById("use_instant_preview").checked;
if( UseInstantPreview == true )
{
var NewText = document.getElementById("content").value;
splitText = NewText.split(/\n/).join("<br />");
var DivElement = document.getElementById("TextDisplay");
DivElement.innerHTML = splitText;
}
}
// -->
</script>
<fieldset id="postdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend>
<?php the_quicktags(); ?>
@ -104,7 +118,12 @@ window.onload = focusit;
$rows = 10;
}
?>
<div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="5" id="content"><?php echo $content ?></textarea></div>
<div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="5" onkeyup="ReloadTextDiv();" id="content"><?php echo $content ?></textarea></div>
<input onclick='ReloadTextDiv();' name="use_instant_preview" type="checkbox" id="use_instant_preview" value="1" checked /> <label for='use_instant_preview'>Use Instant Preview</label> <br />
</fieldset>
<fieldset id="previewdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post" title="Help with post field">Preview</a></legend>
<div><p id="TextDisplay"></p></div>
</fieldset>
<?php

View File

@ -487,4 +487,16 @@ textarea, input, select {
#wphead h1 span {
font-size: .4em;
}
}
#TextDisplay{
border-left: solid 1px #666666;
border-right: solid 1px #000000;
border-top: solid 1px #666666;
border-bottom: solid 1px #000000;
background:#f2f9a5;
margin:10px 30px 10px 30px;
padding:3px;
font-size: 11px;
font-family:verdana;
}