diff --git a/src/Filtering/Filter.coffee b/src/Filtering/Filter.coffee
index 8ac6e18c9..70feefb3b 100644
--- a/src/Filtering/Filter.coffee
+++ b/src/Filtering/Filter.coffee
@@ -206,7 +206,7 @@ Filter =
el = $.el 'a',
href: 'javascript:;'
textContent: text
- el.setAttribute 'data-type', type
+ el.dataset.type = type
$.on el, 'click', Filter.menu.makeFilter
return {
diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee
index cd2ea2960..92b6677a1 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.setAttribute 'data-fullid', thread.fullID
+ a.dataset.fullid = thread.fullID
$.on a, 'click', ThreadHiding.toggle
a
diff --git a/src/General/Clone.coffee b/src/General/Clone.coffee
index 178c1dc86..abb51c327 100644
--- a/src/General/Clone.coffee
+++ b/src/General/Clone.coffee
@@ -60,4 +60,4 @@ class Clone extends Post
@isDead = true if origin.isDead
@isClone = true
index = origin.clones.push(@) - 1
- root.setAttribute 'data-clone', index
+ root.dataset.clone = index
diff --git a/src/General/Header.coffee b/src/General/Header.coffee
index abb3468d8..5ba74529f 100644
--- a/src/General/Header.coffee
+++ b/src/General/Header.coffee
@@ -140,7 +140,7 @@ Header =
a.textContent
if m = t.match /-(index|catalog)/
- a.setAttribute 'data-only', m[1]
+ a.dataset.only = m[1]
a.href = "//boards.4chan.org/#{board}/"
a.href += 'catalog' if m[1] is 'catalog'
diff --git a/src/General/Post.coffee b/src/General/Post.coffee
index 6f2a8369c..23a0dac0c 100644
--- a/src/General/Post.coffee
+++ b/src/General/Post.coffee
@@ -194,5 +194,5 @@ class Post
rmClone: (index) ->
@clones.splice index, 1
for clone in @clones[index..]
- clone.nodes.root.setAttribute 'data-clone', index++
+ clone.nodes.root.dataset.clone = index++
return
diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee
index 68ce01c77..e98c6dfe4 100644
--- a/src/General/Settings.coffee
+++ b/src/General/Settings.coffee
@@ -458,9 +458,9 @@ Settings =
td.innerHTML = ''
select = td.firstElementChild
unless select.disabled = length is 1
- # XXX GM can't into datasets
- select.setAttribute 'data-boardid', boardID
- select.setAttribute 'data-type', type
+ $.extend select.dataset,
+ boardid: boardID
+ type: type
$.on select, 'change', Settings.saveSelectedArchive
$.add select, options
else
diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee
index cff961806..37a19ce56 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.setAttribute 'data-fullid', post.fullID
+ el.dataset.fullid = post.fullID
$.add d.body, el
UI.hover
root: @
diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee
index 0acd189f9..808eedbca 100644
--- a/src/Quotelinks/Quotify.coffee
+++ b/src/Quotelinks/Quotify.coffee
@@ -44,9 +44,10 @@ Quotify =
className: 'quotelink deadlink'
target: '_blank'
textContent: "#{quote}\u00A0(Dead)"
- a.setAttribute 'data-boardid', boardID
- a.setAttribute 'data-threadid', post.thread.ID
- a.setAttribute 'data-postid', postID
+ $.extend a.dataset,
+ boardid: boardID
+ threadid: post.thread.ID
+ postid: postID
else if redirect = Redirect.to 'thread', {boardID, threadID: 0, postID}
# Replace the .deadlink span if we can redirect.
a = $.el 'a',
@@ -56,9 +57,10 @@ Quotify =
textContent: "#{quote}\u00A0(Dead)"
if Redirect.to 'post', {boardID, postID}
# Make it function as a normal quote if we can fetch the post.
- $.addClass a, 'quotelink'
- a.setAttribute 'data-boardid', boardID
- a.setAttribute 'data-postid', postID
+ $.addClass a, 'quotelink'
+ $.extend a.dataset,
+ boardid: boardID
+ postid: postID
unless quoteID in @quotes
@quotes.push quoteID