Switch document class names when switching between views

This commit is contained in:
Zixaphir 2014-01-09 14:49:05 -07:00
parent 259529b6dd
commit ab8607710b
6 changed files with 37 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -204,7 +204,7 @@ Index =
update: (pageNum) -> update: (pageNum) ->
return unless navigator.onLine return unless navigator.onLine
unless d.readyState is 'loading' or Index.root.parentElement unless d.readyState is 'loading' or Index.root.parentElement
$.replace $ '.board', Index.root $.replace $('.board'), Index.root
Index.req?.abort() Index.req?.abort()
Index.notice?.close() Index.notice?.close()

View File

@ -356,6 +356,11 @@ Main =
return return
updateContext: (view) ->
$.rmClass doc, g.VIEW
$.addClass doc, view
g.VIEW = view
navigate: (e) -> navigate: (e) ->
return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org' return if @hostname isnt 'boards.4chan.org' or window.location.hostname is 'rs.4chan.org'
@ -376,7 +381,7 @@ Main =
if view isnt g.VIEW if view isnt g.VIEW
Main.disconnect() Main.disconnect()
Main.clean() Main.clean()
g.VIEW = view Main.updateContext view
if view is 'index' if view is 'index'
Main.updateBoard boardID unless boardID is g.BOARD.ID Main.updateBoard boardID unless boardID is g.BOARD.ID

View File

@ -486,7 +486,17 @@ div.center:not(.ad-cnt) {
.summary { .summary {
text-decoration: none; text-decoration: none;
} }
.thread #index-last-refresh,
.thread #index-search-clear,
.thread #index-search {
display: none;
}
#index-last-refresh::before {
content: '[';
}
#index-last-refresh::after {
content: ']';
}
/* Announcement Hiding */ /* Announcement Hiding */
:root.hide-announcement #globalMessage { :root.hide-announcement #globalMessage {

View File

@ -1,4 +1,4 @@
[<a href="./catalog">Catalog</a>]&nbsp; [<a href="./catalog">Catalog</a>]&nbsp;
[<time id="index-last-refresh" title="Last index refresh">...</time>]&nbsp; <time id="index-last-refresh" title="Last index refresh">...</time>&nbsp;
<input type="search" id="index-search" class="field" placeholder="Search"> <input type="search" id="index-search" class="field" placeholder="Search">
<a id="index-search-clear" href="javascript:;" title="Clear search">×</a> <a id="index-search-clear" href="javascript:;" title="Clear search">×</a>