From 07e7dc73809649c9233d6834a436429b8393cd43 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Fri, 15 Mar 2013 19:59:02 -0700 Subject: [PATCH] More Linkify * Add Linkify.node to ExpandComment.callbacks * Add $.toggleClass, which allows the embedder to work. --- 4chan_x.user.js | 6 ++++++ lib/$.coffee | 2 ++ src/features.coffee | 3 +++ 3 files changed, 11 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index 0df2b8613..901abe7cf 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -838,6 +838,9 @@ rmClass: function(el, className) { return el.classList.remove(className); }, + toggleClass: function(el, className) { + return el.classList.toggle(className); + }, hasClass: function(el, className) { return el.classList.contains(className); }, @@ -5996,6 +5999,9 @@ if (g.VIEW === 'catalog' || !Conf['Linkify']) { return; } + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } return Post.prototype.callbacks.push({ name: 'Linkify', cb: this.node diff --git a/lib/$.coffee b/lib/$.coffee index 4f3748c57..941d1008a 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -138,6 +138,8 @@ $.extend $, el.classList.add className rmClass: (el, className) -> el.classList.remove className + toggleClass: (el, className) -> + el.classList.toggle className hasClass: (el, className) -> el.classList.contains className rm: (el) -> diff --git a/src/features.coffee b/src/features.coffee index f5245d461..8b83398ba 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -4111,6 +4111,9 @@ Linkify = init: -> return if g.VIEW is 'catalog' or not Conf['Linkify'] + if Conf['Comment Expansion'] + ExpandComment.callbacks.push @node + Post::callbacks.push name: 'Linkify' cb: @node