From 934f54302af412a8b7b0c59c7470a959adff9470 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 21 Sep 2014 13:04:43 -0700 Subject: [PATCH] Remove thread pinning. --- src/General/Build.coffee | 1 - src/General/Index.coffee | 40 +-------------------------------- src/General/css/style.css | 2 -- src/General/lib/databoard.class | 2 +- src/General/lib/thread.class | 8 ------- 5 files changed, 2 insertions(+), 51 deletions(-) diff --git a/src/General/Build.coffee b/src/General/Build.coffee index d0af8afdb..3f56a1eb3 100755 --- a/src/General/Build.coffee +++ b/src/General/Build.coffee @@ -352,7 +352,6 @@ Build = ) %> root.dataset.fullID = thread.fullID - $.addClass root, 'pinned' if thread.isPinned $.addClass root, thread.OP.highlights... if thread.OP.highlights for quotelink in $$ '.quotelink, .deadlink', root.lastElementChild diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 198f29fac..ba1bac15e 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -10,10 +10,6 @@ Index = @board = "#{g.BOARD}" - @db = new DataBoard 'pinnedThreads' - Thread.callbacks.push - name: 'Thread Pinning' - cb: @threadNode CatalogThread.callbacks.push name: 'Catalog Features' cb: @catalogNode @@ -160,25 +156,6 @@ Index = $.on @el, 'click', @cb 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: -> $.on @nodes.thumb.parentNode, 'click', Index.onClick onClick: (e) -> @@ -186,8 +163,6 @@ Index = thread = g.threads[@parentNode.dataset.fullID] if e.shiftKey Index.toggleHide thread - else if e.altKey - Index.togglePin thread else return e.preventDefault() @@ -200,19 +175,6 @@ Index = else ThreadHiding.hide 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: toggleHiddenThreads: -> @@ -547,7 +509,7 @@ Index = # Sticky threads Index.sortOnTop (thread) -> thread.isSticky # Highlighted threads - Index.sortOnTop (thread) -> thread.isOnTop or thread.isPinned + Index.sortOnTop (thread) -> thread.isOnTop # Non-hidden threads Index.sortOnTop((thread) -> !thread.isHidden) if Conf['Anchor Hidden Threads'] diff --git a/src/General/css/style.css b/src/General/css/style.css index a328ca8e6..1a3ccc647 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -861,7 +861,6 @@ span.hide-announcement { :root.werkTyme .catalog-thread > a { text-align: center; } -.pinned .werkTyme-filename, .filter-highlight .werkTyme-filename { border: 2px solid rgba(255, 0, 0, .5); } @@ -883,7 +882,6 @@ span.hide-announcement { .filter-highlight > .reply { box-shadow: -5px 0 rgba(255, 0, 0, .5); } -.pinned .catalog-thumb, .filter-highlight .catalog-thumb { border: 2px solid rgba(255, 0, 0, .5); } diff --git a/src/General/lib/databoard.class b/src/General/lib/databoard.class index f0567d78d..3545b5469 100755 --- a/src/General/lib/databoard.class +++ b/src/General/lib/databoard.class @@ -1,5 +1,5 @@ class DataBoard - @keys = ['pinnedThreads', 'hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads'] + @keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads'] constructor: (@key, sync, dontClean) -> @data = Conf[key] diff --git a/src/General/lib/thread.class b/src/General/lib/thread.class index 0b5273c5f..8e847ca7a 100755 --- a/src/General/lib/thread.class +++ b/src/General/lib/thread.class @@ -8,7 +8,6 @@ class Thread @isDead = false @isHidden = false @isOnTop = false - @isPinned = false @isSticky = false @isClosed = false @isArchived = false @@ -66,13 +65,6 @@ class Thread return unless @catalogView (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: -> @isDead = true