Remove thread pinning.
This commit is contained in:
parent
2d6b08ff41
commit
934f54302a
@ -352,7 +352,6 @@ Build =
|
|||||||
) %>
|
) %>
|
||||||
|
|
||||||
root.dataset.fullID = thread.fullID
|
root.dataset.fullID = thread.fullID
|
||||||
$.addClass root, 'pinned' if thread.isPinned
|
|
||||||
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
$.addClass root, thread.OP.highlights... if thread.OP.highlights
|
||||||
|
|
||||||
for quotelink in $$ '.quotelink, .deadlink', root.lastElementChild
|
for quotelink in $$ '.quotelink, .deadlink', root.lastElementChild
|
||||||
|
|||||||
@ -10,10 +10,6 @@ Index =
|
|||||||
|
|
||||||
@board = "#{g.BOARD}"
|
@board = "#{g.BOARD}"
|
||||||
|
|
||||||
@db = new DataBoard 'pinnedThreads'
|
|
||||||
Thread.callbacks.push
|
|
||||||
name: 'Thread Pinning'
|
|
||||||
cb: @threadNode
|
|
||||||
CatalogThread.callbacks.push
|
CatalogThread.callbacks.push
|
||||||
name: 'Catalog Features'
|
name: 'Catalog Features'
|
||||||
cb: @catalogNode
|
cb: @catalogNode
|
||||||
@ -160,25 +156,6 @@ Index =
|
|||||||
$.on @el, 'click', @cb
|
$.on @el, 'click', @cb
|
||||||
true
|
true
|
||||||
|
|
||||||
Menu.menu.addEntry
|
|
||||||
el: $.el 'a', href: 'javascript:;'
|
|
||||||
order: 6
|
|
||||||
open: ({thread}) ->
|
|
||||||
return false if Conf['Index Mode'] isnt 'catalog'
|
|
||||||
@el.textContent = if thread.isPinned
|
|
||||||
'Unpin thread'
|
|
||||||
else
|
|
||||||
'Pin thread'
|
|
||||||
$.off @el, 'click', @cb if @cb
|
|
||||||
@cb = ->
|
|
||||||
$.event 'CloseMenu'
|
|
||||||
Index.togglePin thread
|
|
||||||
$.on @el, 'click', @cb
|
|
||||||
true
|
|
||||||
|
|
||||||
threadNode: ->
|
|
||||||
return unless Index.db.get {boardID: @board.ID, threadID: @ID}
|
|
||||||
@pin()
|
|
||||||
catalogNode: ->
|
catalogNode: ->
|
||||||
$.on @nodes.thumb.parentNode, 'click', Index.onClick
|
$.on @nodes.thumb.parentNode, 'click', Index.onClick
|
||||||
onClick: (e) ->
|
onClick: (e) ->
|
||||||
@ -186,8 +163,6 @@ Index =
|
|||||||
thread = g.threads[@parentNode.dataset.fullID]
|
thread = g.threads[@parentNode.dataset.fullID]
|
||||||
if e.shiftKey
|
if e.shiftKey
|
||||||
Index.toggleHide thread
|
Index.toggleHide thread
|
||||||
else if e.altKey
|
|
||||||
Index.togglePin thread
|
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ -200,19 +175,6 @@ Index =
|
|||||||
else
|
else
|
||||||
ThreadHiding.hide thread
|
ThreadHiding.hide thread
|
||||||
ThreadHiding.saveHiddenState thread
|
ThreadHiding.saveHiddenState thread
|
||||||
togglePin: (thread) ->
|
|
||||||
data =
|
|
||||||
boardID: thread.board.ID
|
|
||||||
threadID: thread.ID
|
|
||||||
if thread.isPinned
|
|
||||||
thread.unpin()
|
|
||||||
Index.db.delete data
|
|
||||||
else
|
|
||||||
thread.pin()
|
|
||||||
data.val = true
|
|
||||||
Index.db.set data
|
|
||||||
Index.sort()
|
|
||||||
Index.buildIndex()
|
|
||||||
|
|
||||||
cb:
|
cb:
|
||||||
toggleHiddenThreads: ->
|
toggleHiddenThreads: ->
|
||||||
@ -547,7 +509,7 @@ Index =
|
|||||||
# Sticky threads
|
# Sticky threads
|
||||||
Index.sortOnTop (thread) -> thread.isSticky
|
Index.sortOnTop (thread) -> thread.isSticky
|
||||||
# Highlighted threads
|
# Highlighted threads
|
||||||
Index.sortOnTop (thread) -> thread.isOnTop or thread.isPinned
|
Index.sortOnTop (thread) -> thread.isOnTop
|
||||||
# Non-hidden threads
|
# Non-hidden threads
|
||||||
Index.sortOnTop((thread) -> !thread.isHidden) if Conf['Anchor Hidden Threads']
|
Index.sortOnTop((thread) -> !thread.isHidden) if Conf['Anchor Hidden Threads']
|
||||||
|
|
||||||
|
|||||||
@ -861,7 +861,6 @@ span.hide-announcement {
|
|||||||
:root.werkTyme .catalog-thread > a {
|
:root.werkTyme .catalog-thread > a {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.pinned .werkTyme-filename,
|
|
||||||
.filter-highlight .werkTyme-filename {
|
.filter-highlight .werkTyme-filename {
|
||||||
border: 2px solid rgba(255, 0, 0, .5);
|
border: 2px solid rgba(255, 0, 0, .5);
|
||||||
}
|
}
|
||||||
@ -883,7 +882,6 @@ span.hide-announcement {
|
|||||||
.filter-highlight > .reply {
|
.filter-highlight > .reply {
|
||||||
box-shadow: -5px 0 rgba(255, 0, 0, .5);
|
box-shadow: -5px 0 rgba(255, 0, 0, .5);
|
||||||
}
|
}
|
||||||
.pinned .catalog-thumb,
|
|
||||||
.filter-highlight .catalog-thumb {
|
.filter-highlight .catalog-thumb {
|
||||||
border: 2px solid rgba(255, 0, 0, .5);
|
border: 2px solid rgba(255, 0, 0, .5);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
class DataBoard
|
class DataBoard
|
||||||
@keys = ['pinnedThreads', 'hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads']
|
@keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads']
|
||||||
|
|
||||||
constructor: (@key, sync, dontClean) ->
|
constructor: (@key, sync, dontClean) ->
|
||||||
@data = Conf[key]
|
@data = Conf[key]
|
||||||
|
|||||||
@ -8,7 +8,6 @@ class Thread
|
|||||||
@isDead = false
|
@isDead = false
|
||||||
@isHidden = false
|
@isHidden = false
|
||||||
@isOnTop = false
|
@isOnTop = false
|
||||||
@isPinned = false
|
|
||||||
@isSticky = false
|
@isSticky = false
|
||||||
@isClosed = false
|
@isClosed = false
|
||||||
@isArchived = false
|
@isArchived = false
|
||||||
@ -66,13 +65,6 @@ class Thread
|
|||||||
return unless @catalogView
|
return unless @catalogView
|
||||||
(if type is 'Sticky' and @isClosed then $.prepend else $.add) @catalogView.nodes.icons, icon.cloneNode()
|
(if type is 'Sticky' and @isClosed then $.prepend else $.add) @catalogView.nodes.icons, icon.cloneNode()
|
||||||
|
|
||||||
pin: ->
|
|
||||||
@isPinned = true
|
|
||||||
$.addClass @catalogView.nodes.root, 'pinned' if @catalogView
|
|
||||||
unpin: ->
|
|
||||||
@isPinned = false
|
|
||||||
$.rmClass @catalogView.nodes.root, 'pinned' if @catalogView
|
|
||||||
|
|
||||||
kill: ->
|
kill: ->
|
||||||
@isDead = true
|
@isDead = true
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user