mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-31 12:23:48 +01:00
remove dead favourites on 404 pages
This commit is contained in:
parent
4b3e33c5b0
commit
037d392e1f
13
404.php
13
404.php
@ -29,6 +29,19 @@ $page = <<<EOT
|
||||
<div class="ban">
|
||||
<p style="text-align:center"><img src="/static/404/{$errorimage}" style="width:100%"></p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
if (localStorage.favorites) {
|
||||
var faves = JSON.parse(localStorage.favorites);
|
||||
|
||||
$.each(faves, function(k, v) {
|
||||
if (window.location.pathname === '/' + v + '/') {
|
||||
faves.pop(v);
|
||||
localStorage.favorites = JSON.stringify(faves);
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
EOT;
|
||||
|
||||
echo Element("page.html", array("config" => $config, "body" => $errorimage ? $page : "", "title" => "404 Not Found"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user