add note name in title

This commit is contained in:
quenousimporte 2024-10-01 10:51:28 +02:00
parent 6d87adb4d5
commit a0ade9fb74
1 changed files with 67 additions and 52 deletions

View File

@ -117,22 +117,7 @@
download(); download();
} }
?> $preview = '';
<!DOCTYPE html>
<html>
<head>
<title>bbn</title>
<link rel="manifest" href="manifest.json" />
<meta name="theme-color" content="white" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
if (isset($_GET['clip']) && $_GET['param']) if (isset($_GET['clip']) && $_GET['param'])
{ {
$content = $_GET['param'] . "\r\n" . file_get_contents($dir . '/todo.md'); $content = $_GET['param'] . "\r\n" . file_get_contents($dir . '/todo.md');
@ -175,15 +160,45 @@
} }
$Parsedown = new Parsedown(); $Parsedown = new Parsedown();
$Parsedown->setBreaksEnabled(true); $Parsedown->setBreaksEnabled(true);
echo $Parsedown->text('# ' . $title . "\r\n" . substr($content, $pos)); $preview = $Parsedown->text('# ' . $title . "\r\n" . substr($content, $pos));
$nextpage = ''; $nextpage = 'preview';
} }
else if (isset($_GET['open'])) else if (isset($_GET['open']))
{ {
$nextpage = 'note'; $nextpage = 'note';
$title = $_GET['param']; $title = $_GET['param'];
} }
if ($nextpage == 'note') ?>
<!DOCTYPE html>
<html>
<head>
<title>
<?php
if ($nextpage != 'home' && isset($title))
{
echo $title;
}
else
{
echo 'bbn';
}
?>
</title>
<link rel="manifest" href="manifest.json" />
<meta name="theme-color" content="white" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
if ($nextpage == 'preview')
{
echo $preview;
}
else if ($nextpage == 'note')
{ {
$now = date("Y-m-d H.i.s", time()); $now = date("Y-m-d H.i.s", time());
if (!$title) if (!$title)