forked from GithubBackups/vichan
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">
|
<div class="ban">
|
||||||
<p style="text-align:center"><img src="/static/404/{$errorimage}" style="width:100%"></p>
|
<p style="text-align:center"><img src="/static/404/{$errorimage}" style="width:100%"></p>
|
||||||
</div>
|
</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;
|
EOT;
|
||||||
|
|
||||||
echo Element("page.html", array("config" => $config, "body" => $errorimage ? $page : "", "title" => "404 Not Found"));
|
echo Element("page.html", array("config" => $config, "body" => $errorimage ? $page : "", "title" => "404 Not Found"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user