diff options
author | Yorhel <git@yorhel.nl> | 2014-12-01 18:32:21 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2014-12-01 18:33:07 +0100 |
commit | 473b0007bddb1bcd9df1d95a00029b69fa7060e2 (patch) | |
tree | fceeefeb880ad6cf0a3294a02924305ea33d0270 /data | |
parent | 44b11883da3a7e6f1138984ceeba162e0f90dc35 (diff) |
Replace some 'onclick' attributes with JS-generated events
I think this was the last piece of inline JS.
Diffstat (limited to 'data')
-rw-r--r-- | data/script.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/data/script.js b/data/script.js index 5aae0305..ce66bc02 100644 --- a/data/script.js +++ b/data/script.js @@ -2683,6 +2683,11 @@ if(byId('advselect')) { }; } +// Spoiler selection buttons on tag/trait browse pages +if(byId('tagspoil_0')) byId('tagspoil_0').onclick = function() { setCookie('tagspoil', 0); return true; }; +if(byId('tagspoil_1')) byId('tagspoil_1').onclick = function() { setCookie('tagspoil', 1); return true; }; +if(byId('tagspoil_2')) byId('tagspoil_2').onclick = function() { setCookie('tagspoil', 2); return true; }; + // NSFW VN image toggle (/v+) if(byId('nsfw_show')) { var msg = byId('nsfw_show'); @@ -2735,6 +2740,16 @@ if(byId('listsel')) { }; } +// Notification list onclick +if(byId('notifies')) { + var l = byClass(byId('notifies'), 'td', 'clickable'); + for(var i=0; i<l.length; i++) + l[i].onclick = function() { + var baseurl = location.href.replace(/\/u([0-9]+)\/notifies.*$/, '/u$1/notify/'); + location.href = baseurl + this.id.replace(/notify_/, ''); + }; +} + // BBCode spoiler tags { var l = byClass('b', 'spoiler'); |