change: preview in same tab with back button

This commit is contained in:
quenousimporte 2024-10-07 17:57:18 +02:00
parent 2ba071e361
commit 22e0065507
1 changed files with 29 additions and 20 deletions

View File

@ -27,7 +27,7 @@
} }
else if (isset($_POST['preview'])) else if (isset($_POST['preview']))
{ {
header("Location: note.php?preview=1&title=" . $title); header("Location: note.php?preview=true&title=" . $title);
exit; exit;
} }
else else
@ -87,11 +87,13 @@
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
</head> </head>
<body> <body>
<form action="note.php" method="POST" <? if(isset($_GET['preview'])) echo 'hidden'; ?>> <!-- editor -->
<div <? if(isset($_GET['preview'])) echo 'hidden'; ?>>
<form action="note.php" method="POST">
<div> <div>
<input type="submit" name="home" value="home" accesskey="h"> <input type="submit" name="home" value="home" accesskey="h">
<input type="submit" name="save" value="save" accesskey="s"> <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="preview" value="preview" accesskey="p">
<input type="submit" name="download" value="download" accesskey="d"> <input type="submit" name="download" value="download" accesskey="d">
<input type="submit" name="delete" value="delete"> <input type="submit" name="delete" value="delete">
<input hidden name="lastchanged" value="<? echo $lastchanged; ?>"> <input hidden name="lastchanged" value="<? echo $lastchanged; ?>">
@ -106,7 +108,14 @@
echo linksdiv($content); echo linksdiv($content);
?> ?>
</form> </form>
</div>
<!-- preview -->
<div <? if(!isset($_GET['preview'])) echo 'hidden'; ?>> <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); echo computepreview($title, $content);
?> ?>