More Linkify

* Add Linkify.node to ExpandComment.callbacks
* Add $.toggleClass, which allows the embedder to work.
This commit is contained in:
Zixaphir 2013-03-15 19:59:02 -07:00
parent 8801be953e
commit 07e7dc7380
3 changed files with 11 additions and 0 deletions

View File

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

View File

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

View File

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