Type.registerNamespace('MoMATool'); var disqus_developer = 0; var disqus_url = ''; var disqus_title = ''; var disqus_message = ''; var disqus_container_id = "disqus_thread"; var disqus_identifier = ''; MoMATool.DisqusControl = function(element) { MoMATool.DisqusControl.initializeBase(this, [element]); this._disqusForum = null; } MoMATool.DisqusControl.prototype = { initialize: function() { MoMATool.DisqusControl.callBaseMethod(this, 'initialize'); $addHandlers(this.get_element(), {}, this); }, dispose: function() { $clearHandlers(this.get_element()); MoMATool.DisqusControl.callBaseMethod(this, 'dispose'); }, get_disqusForum: function() { return this._disqusForum; }, set_disqusForum: function(value) { if (this._disqusForum !== value) { this._disqusForum = value; this.raisePropertyChanged('disqusForum'); } }, get_disqusDeveloper: function() { return disqus_developer; }, set_disqusDeveloper: function(value) { if (disqus_developer !== value) { disqus_developer = value; this.raisePropertyChanged('disqusDeveloper'); } }, get_disqusContainerId: function() { return disqus_container_id; }, set_disqusContainerId: function(value) { if (value != null && disqus_container_id !== value) { disqus_container_id = value; this.raisePropertyChanged('disqusContainerId'); } }, get_disqusURL: function() { return disqus_url; }, set_disqusURL: function(value) { if (disqus_url !== value) { disqus_url = value; this.raisePropertyChanged('disqusURL'); } }, get_disqusTitle: function() { return disqus_title; }, set_disqusTitle: function(value) { if (disqus_title !== value) { disqus_title = value; this.raisePropertyChanged('disqusTitle'); } }, get_disqusMessage: function() { return disqus_message; }, set_disqusMessage: function(value) { if (disqus_message !== value) { disqus_message = value; this.raisePropertyChanged('disqusMessage'); } }, get_disqusIdentifier: function() { return disqus_identifier; }, set_disqusIdentifier: function(value) { if (disqus_identifier !== value) { disqus_identifier = value; this.raisePropertyChanged('disqusIdentifier'); } }, get_update: function() {}, set_update: function(value) { if (disqus_identifier !== null && disqus_message != null && disqus_title != null) { // call the thread creation proxy service to make sure the correct disqus thread gets // created on demand, and load the iframe when the proxy returns var forum = this._disqusForum; // makes it easier to reference in the EnsureThreadCreated closure DisqusProxy.EnsureThreadCreated(disqus_title, disqus_message, disqus_identifier, function(success) { var disqus_control_iframe = document.getElementById(value); var doc = disqus_control_iframe.contentDocument; if (doc == undefined || doc == null) { doc = disqus_control_iframe.contentWindow.document; } doc.open(); // The doctype is needed for IE to load the stylesheet contained inside embed.js. Except something // seems to have broken it again. @%ing IE. Workaround by ripping the CSS out of embed.js and // referencing it directly. The 'disqus_no_style' setting is needed for firefox when the CSS is // directly referenced. var iframe_html = '\n' + '\n' + '
\n' + '