change: preview in same tab with back button
This commit is contained in:
parent
2ba071e361
commit
22e0065507
49
note.php
49
note.php
|
@ -27,7 +27,7 @@
|
|||
}
|
||||
else if (isset($_POST['preview']))
|
||||
{
|
||||
header("Location: note.php?preview=1&title=" . $title);
|
||||
header("Location: note.php?preview=true&title=" . $title);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
@ -87,26 +87,35 @@
|
|||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<form action="note.php" method="POST" <? if(isset($_GET['preview'])) echo 'hidden'; ?>>
|
||||
<div>
|
||||
<input type="submit" name="home" value="home" accesskey="h">
|
||||
<input type="submit" name="save" value="save" accesskey="s">
|
||||
<input type="submit" name="preview" value="preview" accesskey="p" formtarget="_bbn_preview">
|
||||
<input type="submit" name="download" value="download" accesskey="d">
|
||||
<input type="submit" name="delete" value="delete">
|
||||
<input hidden name="lastchanged" value="<? echo $lastchanged; ?>">
|
||||
<div><input autocomplete="off" class="title" name="title" value="<? echo $title; ?>"></div>
|
||||
</div>
|
||||
<div class="editor">
|
||||
<textarea rows="<? echo $rows; ?>" autofocus name="content" spellcheck="false"><? echo $content; ?></textarea>
|
||||
</div>
|
||||
<input hidden name="previoustitle" value="<? echo $title; ?>">
|
||||
<?php
|
||||
echo '<div class="grey">' . $lines . ' ' . $words . ' ' . $chars . ' ' . $title . '.md</div>';
|
||||
echo linksdiv($content);
|
||||
?>
|
||||
</form>
|
||||
<!-- editor -->
|
||||
<div <? if(isset($_GET['preview'])) echo 'hidden'; ?>>
|
||||
<form action="note.php" method="POST">
|
||||
<div>
|
||||
<input type="submit" name="home" value="home" accesskey="h">
|
||||
<input type="submit" name="save" value="save" accesskey="s">
|
||||
<input type="submit" name="preview" value="preview" accesskey="p">
|
||||
<input type="submit" name="download" value="download" accesskey="d">
|
||||
<input type="submit" name="delete" value="delete">
|
||||
<input hidden name="lastchanged" value="<? echo $lastchanged; ?>">
|
||||
<div><input autocomplete="off" class="title" name="title" value="<? echo $title; ?>"></div>
|
||||
</div>
|
||||
<div class="editor">
|
||||
<textarea rows="<? echo $rows; ?>" autofocus name="content" spellcheck="false"><? echo $content; ?></textarea>
|
||||
</div>
|
||||
<input hidden name="previoustitle" value="<? echo $title; ?>">
|
||||
<?php
|
||||
echo '<div class="grey">' . $lines . ' ' . $words . ' ' . $chars . ' ' . $title . '.md</div>';
|
||||
echo linksdiv($content);
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- preview -->
|
||||
<div <? if(!isset($_GET['preview'])) echo 'hidden'; ?>>
|
||||
<form action="note.php" method="GET">
|
||||
<input type="submit" value="back">
|
||||
<input hidden name="title" value="<? echo $title; ?>">
|
||||
</form>
|
||||
<?
|
||||
echo computepreview($title, $content);
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue