false let widgetGroup = CustomizableUI.getWidget(this.getAttribute("id")); let widget = widgetGroup.forWindow(window); this.inMenuPanel = widgetGroup.areaType == CustomizableUI.TYPE_MENU_PANEL; if (this.inMenuPanel) { widget.node.setAttribute("noautoclose", "true"); return document.getElementById("PanelUI-socialapi"); } return document.getAnonymousElementByAttribute(this, "anonid", "panel"); return this.content.contentWindow; return this.content.contentDocument; return Social._getProviderFromOrigin(this.getAttribute("origin")); return this._isMarked; { this.isMarked = isMarked; }); } this.content.setAttribute("origin", provider.origin); if (!this.inMenuPanel) { let panel = this.panel; // if customization is currently happening, we may not have a panel // that we can hide if (panel.hidePopup) { panel.hidePopup(); panel.hidden = true; } } this.pageData = null; ]]> { if (event.target != this.contentDocument) return; this._loading = false; this.content.removeEventListener("DOMContentLoaded", DOMContentLoaded, true); // add our resizer after the dom is ready if (!this.inMenuPanel) { let DynamicResizeWatcher = Cu.import("resource:///modules/Social.jsm", {}).DynamicResizeWatcher; this._dynamicResizer = new DynamicResizeWatcher(); this._dynamicResizer.start(this.panel, this.content); } else if (this._dynamicResizer) { this._dynamicResizer.stop(); this._dynamicResizer = null; } // send the opengraph data let evt = this.contentDocument.createEvent("CustomEvent"); evt.initCustomEvent("OpenGraphData", true, true, JSON.stringify(this.pageData)); this.contentDocument.documentElement.dispatchEvent(evt); let contentWindow = this.contentWindow; let markUpdate = function(event) { // update the annotation based on this event, then update the // icon as well this.isMarked = JSON.parse(event.detail).marked; let uri = Services.io.newURI(this.pageData.url, null, null); if (this.isMarked) { Social.markURI(provider.origin, uri); } else { Social.unmarkURI(provider.origin, uri, () => { this.update(); }); } }.bind(this); contentWindow.addEventListener("socialMarkUpdate", markUpdate); contentWindow.addEventListener("unload", function unload() { contentWindow.removeEventListener("unload", unload); contentWindow.removeEventListener("socialMarkUpdate", markUpdate); }); } this.content.addEventListener("DOMContentLoaded", DOMContentLoaded, true); this._loading = true; this.content.setAttribute("src", endpoint); ]]>