PK ܅7content/PK ܅7content/fission/PK *{7~?content/fission/fission.css@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* :::::::: new address bar binding ::::::::::::::: */ #urlbar { -moz-binding: url(chrome://fission/content/fission.xml#fission-urlbar); } .autocomplete-textbox-container-fission { -moz-box-align: center; } /* :::::::: default styles ::::::::::::::: */ /* ........ "Fusion" .............. */ #urlbar[fission="fusion"] > #statusbar-icon { -moz-appearance: none; padding: 0px; border: none; background-color: transparent; } #urlbar[fission="fusion"] > #statusbar-icon > .progress-bar { -moz-appearance: none; background-color: #B6BDD2; /* Fission blue */ } #urlbar[fission="fusion"] > #statusbar-icon[value="100"], #urlbar[fission="fusion"] > #statusbar-icon[value="0"] { visibility: collapse; } /* ........ "Icon" .............. */ #urlbar[fission="icon"] #statusbar-icon { -moz-margin-end: 2px; height: 16px; } #urlbar[fission="icon"] #statusbar-icon[value="100"], #urlbar[fission="icon"] #statusbar-icon[value="0"] { display: none; } /* :::::::: link target ::::::::::::::: */ #urlbar[fission-link] #page-proxy-deck { background: url(data:image/gif;base64,R0lGODlhEAAQALMAAAAAAP///7i4uPf39/39/fDw8Onp6dzc3PPz8////wAAAAAAAAAAAAAAAAAAAP8AgCH5BAEAAA8ALAAAAAAQABAAAwQ38MlJq704632B9xZAAUEJjqJEBsPnfiohy6/7AEM+HPUJIIUgDzUBFAxIQUo1OgieykyPQ61mIgA7); } #urlbar[fission-link] #page-proxy-deck image { visibility: hidden; } /* :::::::: status text ::::::::::::::: */ #fission-status { -moz-user-focus: ignore; padding-top: 1px; margin-bottom: -1px; } #urlbar[fission="icon"][progress]:not([progress="0"]):not([progress="100"]) #fission-status, #fission-status[value=""] { display: none; } /* :::::::: options dialog ::::::::::::::: */ #FissionOptions #colorpickBox { -moz-margin-end: 4px; } #FissionOptions #colorpickBox + button { visibility: hidden; -moz-user-focus: ignore; } #FissionOptions #urlbar #statusbar-icon { margin: 0px; } PK Y7wzcontent/fission/fission.jsconst Fission = { mPrefBranch: Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.fission.").QueryInterface(Components.interfaces.nsIPrefBranch2), /* ........ (Un)initialization .............. */ onLoad: function() { if (!window.gProgressMeterPanel) { setTimeout(function() { Fission.onLoad(); }, 100); return; } this.init(); document.getElementById("cmd_CustomizeToolbars").addEventListener("DOMAttrModified", this.onDOMAttrModified_command, false); this.mPrefBranch.addObserver("", this, false); }, onUnload: function() { document.getElementById("cmd_CustomizeToolbars").removeEventListener("DOMAttrModified", this.onDOMAttrModified_command, false); this.mPrefBranch.removeObserver("", this); this.uninit(); this.mProgressPanel = null; this.mProgressBar = null; this.mText = null; }, init: function() { if (!this.mProgressPanel) { this.mProgressPanel = gProgressMeterPanel; } if (!gURLBar && !((gURLBar = document.getElementById("urlbar")))) { return; } this.mProgressBar = document.getElementById("statusbar-icon"); var iconize = this.mPrefBranch.getBoolPref("iconize"); if (iconize) { var iconBox = document.getElementById("urlbar-icons") || document.getElementById("lock-icon").parentNode; iconBox.insertBefore(this.mProgressBar, iconBox.firstChild); } else { gURLBar.appendChild(this.mProgressBar); } if (this.mPrefBranch.getBoolPref("textify")) { this.textify(); } if (this.mPrefBranch.getBoolPref("linkify")) { this.linkify(); } this.updateBackgroundColor(); gProgressMeterPanel.hidden = true; gProgressMeterPanel = this; gURLBar.setAttribute("fission", iconize ? "icon" : "fusion"); gURLBar.addEventListener("ValueChange", this.onValueChange_urlbar, true); if (this.mLinkified || this.mText && this.mText.parentNode) { gURLBar.addEventListener("focus", this.onFocusBlur_urlbar, true); gURLBar.addEventListener("blur", this.onFocusBlur_urlbar, true); } this.mLoaded = true; }, textify: function() { if (!this.mText) { this.mText = document.createElement("label"); this.mText.setAttribute("id", "fission-status"); this.mText.setAttribute("crop", "right"); eval("nsBrowserStatusHandler.prototype.updateStatusField = " + nsBrowserStatusHandler.prototype.updateStatusField.toString().replace(/{/, "$& Fission.updateStatusField(this.status || this.defaultStatus);")); } var iconBox = document.getElementById("urlbar-icons") || document.getElementById("lock-icon").parentNode; iconBox.insertBefore(this.mText, iconBox.firstChild); }, linkify: function() { if (!/Fission/.test(nsBrowserStatusHandler.prototype.setOverLink)) { eval("nsBrowserStatusHandler.prototype.setOverLink = " + nsBrowserStatusHandler.prototype.setOverLink.toString().replace(/{/, "$& link = Fission.setOverLink(link);")); } this.mLinkified = true; }, uninit: function() { if (!this.mLoaded) { return; } this.updateBackgroundColor(true); gProgressMeterPanel = this.mProgressPanel; gProgressMeterPanel.appendChild(this.mProgressBar); gProgressMeterPanel.hidden = false; gURLBar.setAttribute("fission", ""); gURLBar.removeEventListener("ValueChange", this.onValueChange_urlbar, true); if (this.mLinkified || this.mText && this.mText.parentNode) { gURLBar.removeEventListener("focus", this.onFocusBlur_urlbar, true); gURLBar.removeEventListener("blur", this.onFocusBlur_urlbar, true); } if (this.mText && this.mText.parentNode) { this.mText.parentNode.removeChild(this.mText); } this.mLinkified = false; this.mLoaded = false; }, /* ........ State Change Observers .............. */ set collapsed(aValue) { if (aValue && this.mProgressBar.value != 100) { this.mProgressBar.value = 100; } }, onValueChange_urlbar: function(aEvent) { if (aEvent.originalTarget == Fission.mProgressBar) { this.setAttribute("progress", Fission.mProgressBar.value); } }, onFocusBlur_urlbar: function(aEvent) { if (!(Fission.mURLBar_focused = aEvent.type == "focus") && "mPendingOverLink" in Fission) { Fission.setOverLink(Fission.mPendingOverLink); delete Fission.mPendingOverLink; } if (Fission.mText) { Fission.mText.hidden = Fission.mURLBar_focused; } }, onDOMAttrModified_command: function(aEvent) { if (aEvent.attrName == "disabled") { Fission[aEvent.newValue != "true" ? "init" : "uninit"](); } }, observe: function(aSubject, aTopic, aData) { if (aTopic == "nsPref:changed" && this.mLoaded) { switch (aData) { case "color": this.updateBackgroundColor(); break; case "iconize": case "textify": case "linkify": setTimeout(function() { Fission.uninit(); Fission.init(); }, 0); break; } } }, /* ........ Auxiliary Functions .............. */ updateStatusField: function(aString) { if (this.mText && this.mText.parentNode) { aString = aString != gNavigatorBundle.getString("nv_done") ? aString : ""; if (this.mText.value != aString) { this.mText.value = aString; } } }, setOverLink: function(aLink) { if (this.mURLBar_focused) { this.mPendingOverLink = aLink; return this.mLinkified ? "" : aLink; } if (this.mLinkified && aLink && content.location.href != "about:blank") { if (!this.mURLBar_value) { this.mURLBar_value = "@" + gURLBar.value; } if (gURLBar.getAttribute("fission-link") != aLink) { gURLBar.setAttribute("fission-link", (gURLBar.value = aLink)); } return ""; } if (this.mURLBar_value) { if (gURLBar.value == gURLBar.getAttribute("fission-link")) { gURLBar.value = this.mURLBar_value.substr(1); } delete this.mURLBar_value; gURLBar.removeAttribute("fission-link"); } return aLink; }, updateBackgroundColor: function(aReset) { document.getAnonymousElementByAttribute(this.mProgressBar, "class", "progress-bar").style.background = !aReset ? this.mPrefBranch.getCharPref("color").replace(/^(url\(.+\)) #[0-9A-F]{6}$/, "$1 transparent") : ""; } }; window.addEventListener("load", function() { Fission.onLoad(); }, false); window.addEventListener("unload", function() { Fission.onUnload(); }, false); PK F{7MҎ++content/fission/fission.xml PK .sp7content/fission/fission.xul