Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Disqus have public events to attach to?

I need to perform some re-calculations after disqus form gets an update. A new comment, error message just to name a few. In essence any event that causes the Disqus iframe to expand vertically. Checked the API, but didn't find any public events. Seems like the events are not publicly accessibly atm. So the first question is – does Disqus have any public events to attach to?

The second would be – if I have no way to attach to events from Disqus I wonder would MutationEvent do the trick for me taking into account that Disqus stuff is within an iFrame?

like image 495
spliter Avatar asked Jul 01 '12 18:07

spliter


1 Answers

Best I have come up with so far

function disqus_config() {
    this.callbacks.onNewComment = [function() { trackComment(); }];
}

from here: http://help.disqus.com/customer/portal/articles/466258-how-can-i-capture-disqus-commenting-activity-in-my-own-analytics-tool-

Doing a console.log(DISQUS) in the chrome console shows the disqus object, and there are other callbacks mentioned

_callbacks: Object
  switches.changed: Array[2]
  window.click: Array[2]
  window.hashchange: Array[2]
  window.resize: Array[2]
  window.scroll: Array[2]

and on and trigger methods

like image 88
CodeMonkey Avatar answered Sep 25 '22 17:09

CodeMonkey