"id" -> "ID" in dataset suffixes.

This commit is contained in:
Mayhem 2013-07-14 19:01:14 +02:00
parent ddbec61e1b
commit 33d3518e76
5 changed files with 11 additions and 19 deletions

View File

@ -96,7 +96,7 @@ ThreadHiding =
className: "#{type}-thread-button"
innerHTML: "<span>[&nbsp;#{if type is 'hide' then '-' else '+'}&nbsp;]</span>"
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

View File

@ -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

View File

@ -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></select>'
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) ->

View File

@ -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'

View File

@ -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