diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 92b6677a1..49d3607f3 100644 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -96,7 +96,7 @@ ThreadHiding = className: "#{type}-thread-button" innerHTML: "[ #{if type is 'hide' then '-' else '+'} ]" href: 'javascript:;' - a.dataset.fullid = thread.fullID + a.dataset.fullID = thread.fullID $.on a, 'click', ThreadHiding.toggle a @@ -117,7 +117,7 @@ ThreadHiding = toggle: (thread) -> unless thread instanceof Thread - thread = g.threads[@dataset.fullid] + thread = g.threads[@dataset.fullID] if thread.isHidden ThreadHiding.show thread else diff --git a/src/General/Get.coffee b/src/General/Get.coffee index 7c8d84cb1..5e9cfbbcf 100644 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -28,9 +28,8 @@ Get = threadID = path[3] postID = link.hash[2..] else # resurrected quote - boardID = link.dataset.boardid - threadID = link.dataset.threadid or 0 - postID = link.dataset.postid + {boardID, threadID, postID} = link.dataset + threadID or= 0 return { boardID: boardID threadID: +threadID diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index e98c6dfe4..d0360db9e 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -443,7 +443,7 @@ Settings = $.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) -> for boardID, data of selectedArchives for type, uid of data - if option = $ "select[data-boardid='#{boardID}'][data-type='#{type}'] > option[value='#{uid}']", section + if option = $ "select[data-board-i-d='#{boardID}'][data-type='#{type}'] > option[value='#{uid}']", section option.selected = true return addArchiveCell: (row, boardID, data, type) -> @@ -458,9 +458,7 @@ Settings = td.innerHTML = '' select = td.firstElementChild unless select.disabled = length is 1 - $.extend select.dataset, - boardid: boardID - type: type + $.extend select.dataset, {boardID, type} $.on select, 'change', Settings.saveSelectedArchive $.add select, options else @@ -468,7 +466,7 @@ Settings = $.add row, td saveSelectedArchive: -> $.get 'selectedArchives', Conf['selectedArchives'], ({selectedArchives}) => - (selectedArchives[@dataset.boardid] or= {})[@dataset.type] = +@value + (selectedArchives[@dataset.boardID] or= {})[@dataset.type] = +@value $.set 'selectedArchives', selectedArchives keybinds: (section) -> diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index 37a19ce56..50745f51b 100644 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -13,7 +13,7 @@ ImageHover = el = $.el 'img', id: 'ihover' src: post.file.URL - el.dataset.fullid = post.fullID + el.dataset.fullID = post.fullID $.add d.body, el UI.hover root: @ @@ -24,7 +24,7 @@ ImageHover = $.on el, 'error', ImageHover.error error: -> return unless doc.contains @ - post = g.posts[@dataset.fullid] + post = g.posts[@dataset.fullID] src = @src.split '/' if src[2] is 'images.4chan.org' diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index 808eedbca..c0d9dada9 100644 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -44,10 +44,7 @@ Quotify = className: 'quotelink deadlink' target: '_blank' textContent: "#{quote}\u00A0(Dead)" - $.extend a.dataset, - boardid: boardID - threadid: post.thread.ID - postid: postID + $.extend a.dataset, {boardID, threadID: post.thread.ID, postID} else if redirect = Redirect.to 'thread', {boardID, threadID: 0, postID} # Replace the .deadlink span if we can redirect. a = $.el 'a', @@ -58,9 +55,7 @@ Quotify = if Redirect.to 'post', {boardID, postID} # Make it function as a normal quote if we can fetch the post. $.addClass a, 'quotelink' - $.extend a.dataset, - boardid: boardID - postid: postID + $.extend a.dataset, {boardID, postID} unless quoteID in @quotes @quotes.push quoteID