Remove Address bar bindings for status/linkover.

This commit is contained in:
Pale Moon
2017-08-08 10:28:37 +02:00
committed by Roy Tam
parent d042e67ff3
commit f6fdc11e6a
12 changed files with 7 additions and 881 deletions
-18
View File
@@ -37,15 +37,6 @@ S4EProgressService.prototype =
toolbar_progress.value = val;
}
if(this._service.progressUrlbar)
{
let urlbar_progress = this._getters.urlbarProgress;
if(urlbar_progress)
{
urlbar_progress.value = val;
}
}
let throbber_progress = this._getters.throbberProgress;
if(throbber_progress)
{
@@ -68,15 +59,6 @@ S4EProgressService.prototype =
toolbar_progress.collapsed = val;
}
if(this._service.progressUrlbar)
{
let urlbar_progress = this._getters.urlbarProgress;
if(urlbar_progress)
{
urlbar_progress.collapsed = val;
}
}
let throbber_progress = this._getters.throbberProgress;
if(throbber_progress)
{
-16
View File
@@ -102,11 +102,6 @@ S4EStatusService.prototype =
if(statusLinkOver)
{
link = link.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g, encodeURIComponent);
if(this._getters.urlbar && this._getters.urlbar._mayTrimURLs)
{
link = this._window.trimURL(link);
}
if(status == statusLinkOver)
{
this._overLink = { val: link, type: "overLink", anchor: aAnchor };
@@ -299,11 +294,6 @@ S4EStatusService.prototype =
status_label.value = "";
}
let urlbar = this._getters.urlbar;
if(urlbar)
{
urlbar.setStatus("");
}
},
setStatusField: function(location, text, allowTooltip)
@@ -337,12 +327,6 @@ S4EStatusService.prototype =
label = this._getters.statusWidgetLabel;
break;
case 2: // URL Bar
let urlbar = this._getters.urlbar;
if(urlbar)
{
urlbar.setStatusType(text.type);
urlbar.setStatus(text.val);
}
break;
case 3: // Popup
default:
+2 -24
View File
@@ -195,8 +195,7 @@ S4EWindowGetters.prototype =
["statusWidgetLabel", "status4evar-status-text"],
["strings", "bundle_status4evar"],
["throbberProgress", "status4evar-throbber-widget"],
["toolbarProgress", "status4evar-progress-bar"],
["urlbarProgress", "urlbar-progress-alt"]
["toolbarProgress", "status4evar-progress-bar"]
],
resetGetters: function()
@@ -214,27 +213,6 @@ S4EWindowGetters.prototype =
});
}, this);
delete this.urlbar;
this.__defineGetter__("urlbar", function()
{
let ub = document.getElementById("urlbar");
if(!ub)
{
return null;
}
["setStatus", "setStatusType", "updateOverLinkLayout"].forEach(function(func)
{
if(!(func in ub))
{
ub[func] = function() {};
}
});
delete this.urlbar;
return this.urlbar = ub;
});
delete this.statusOverlay;
this.__defineGetter__("statusOverlay", function()
{
@@ -257,7 +235,7 @@ S4EWindowGetters.prototype =
delete this[prop];
}, this);
["urlbar", "statusOverlay", "statusOverlay", "_window"].forEach(function(prop)
["statusOverlay", "statusOverlay", "_window"].forEach(function(prop)
{
delete this[prop];
}, this);
@@ -4,20 +4,6 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/*
* Location bar progress
*/
#urlbar
{
-moz-binding: url("chrome://browser/content/statusbar/urlbarBindings.xml#urlbar");
}
#urlbar[s4eforce="true"]
{
-moz-binding: url("chrome://browser/content/statusbar/urlbarBindings.xml#urlbar") !important;
}
/*
* Status Popup
*/
@@ -77,10 +77,6 @@
removable="true" command="S4E:Options" tooltiptext="&status4evar.options.widget.title;" />
</toolbarpalette>
<textbox id="urlbar" pmpack="end">
<progressmeter id="urlbar-progress-alt" mode="normal" value="0" collapsed="true" />
</textbox>
<statusbar id="status-bar" ordinal="1" />
</overlay>
@@ -148,152 +148,6 @@ var status4evarPrefs =
}
},
//
// Location bar status position
//
get urlbarAlignPref()
{
delete this.urlbarAlignPref;
return this.urlbarAlignPref = document.getElementById("status4evar-pref-status-urlbar-align");
},
get urlbarPositionVbox()
{
delete this.urlbarPositionVbox;
return this.urlbarPositionVbox = document.getElementById("status4evar-status-urlbar-position-vbox");
},
urlbarAlignChanged: function()
{
this.urlbarPositionVbox.hidden = (this.urlbarAlignPref.value == 1);
},
urlbarAlignSync: function()
{
this.urlbarAlignChanged();
return undefined;
},
//
// Progress line location management
//
get progressUrlbar()
{
delete this.progressUrlbar;
return this.progressUrlbar = document.getElementById("urlbar");
},
get progressUrlbarProgress()
{
delete this.progressUrlbarProgress;
return this.progressUrlbarProgress = document.getElementById("urlbar-progress-alt");
},
get progressUrlbarPref()
{
delete this.progressUrlbarPref;
return this.progressUrlbarPref = document.getElementById("status4evar-pref-progress-urlbar");
},
get progressUrlbarCheckbox()
{
delete this.progressUrlbarCheckbox;
return this.progressUrlbarCheckbox = document.getElementById("status4evar-progress-urlbar-check");
},
progressUrlbarChanged: function()
{
if(this.progressUrlbarPref.value > 0)
{
this.progressUrlbarPref.disabled = false;
this.progressUrlbarCheckbox.checked = true;
switch(this.progressUrlbarPref.value)
{
case 1:
this.progressUrlbar.setAttribute("pmpack", "end");
break;
case 2:
this.progressUrlbar.setAttribute("pmpack", "begin");
break;
case 3:
this.progressUrlbar.setAttribute("pmpack", "center");
break;
}
this.progressUrlbarProgress.hidden = false;
}
else
{
this.progressUrlbarPref.disabled = true;
this.progressUrlbarCheckbox.checked = false;
this.progressUrlbarProgress.hidden = true;
}
},
progressUrlbarSync: function()
{
this.progressUrlbarChanged();
return undefined;
},
progressUrlbarToggle: function()
{
if(this.progressUrlbarPref.disabled == this.progressUrlbarCheckbox.checked)
{
if(this.progressUrlbarCheckbox.checked)
{
this.progressUrlbarPref.value = 1;
}
else
{
this.progressUrlbarPref.value = 0;
}
}
},
//
// Urlbar progress style management
//
get progressUrlbarStylePref()
{
delete this.progressUrlbarStylePref;
return this.progressUrlbarStylePref = document.getElementById("status4evar-pref-progress-urlbar-style");
},
get progressUrlbarCSSPref()
{
delete this.progressUrlbarCSSPref;
return this.progressUrlbarCSSPref = document.getElementById("status4evar-pref-progress-urlbar-css");
},
progressUrlbarCSSChanged: function()
{
if(!this.progressUrlbarCSSPref.value)
{
this.progressUrlbarCSSPref.value = "#33FF33";
}
this.dynamicProgressStyle.cssRules[1].style.background = this.progressUrlbarCSSPref.value;
},
progressUrlbarStyleChanged: function()
{
this.progressUrlbarCSSChanged();
this.progressUrlbarCSSPref.disabled = !this.progressUrlbarStylePref.value;
if(this.progressUrlbarStylePref.value)
{
this.progressUrlbar.setAttribute("s4estyle", true);
}
else
{
this.progressUrlbar.removeAttribute("s4estyle");
}
},
progressUrlbarStyleSync: function()
{
this.progressUrlbarStyleChanged();
return undefined;
},
//
// Toolbar progress style management
//
@@ -424,12 +278,6 @@ var status4evarPrefs =
//
// Pref Window load
//
get statusUrlbarPositionValue()
{
delete this.statusUrlbarPositionValue;
return this.statusUrlbarPositionValue = document.getElementById("status4evar-status-urlbar-position-value");
},
get downloadButtonActionCommandPref()
{
delete this.downloadButtonActionCommandPref;
@@ -451,11 +299,6 @@ var status4evarPrefs =
this.advancedContinueButton.focus();
}
if(window.getComputedStyle(this.statusUrlbarPositionValue).direction == "ltr")
{
this.statusUrlbarPositionValue.setAttribute("dir", "reverse");
}
if(!this.downloadButtonActionCommandPref.value)
{
this.downloadButtonActionThirdPartyItem.disabled = true;
@@ -46,10 +46,6 @@
<preference id="status4evar-pref-status-linkOver-delay-hide" name="status4evar.status.linkOver.delay.hide" type="int" />
<preference id="status4evar-pref-status-toolbar-maxLength" name="status4evar.status.toolbar.maxLength" type="int"
onchange="status4evarPrefs.textLengthChanged();" />
<preference id="status4evar-pref-status-urlbar-align" name="status4evar.status.urlbar.align" type="int"
onchange="status4evarPrefs.urlbarAlignChanged();" />
<preference id="status4evar-pref-status-urlbar-color" name="status4evar.status.urlbar.color" type="string" />
<preference id="status4evar-pref-status-urlbar-position" name="status4evar.status.urlbar.position" type="int" />
<preference id="status4evar-pref-status-popup-invertMirror" name="status4evar.status.popup.invertMirror" type="bool" />
<preference id="status4evar-pref-status-popup-mouseMirror" name="status4evar.status.popup.mouseMirror" type="bool" />
<preference id="toolkit-pref-dom-status-change" name="dom.disable_window_status_change" type="bool" inverted="true" />
@@ -65,7 +61,6 @@
<tabbox id="status4evar-tabbox-status" flex="1">
<tabs id="status4evar-tabs-status">
<tab id="status4evar-tab-status-general" label="&status4evar.tab.general;" />
<tab id="status4evar-tab-status-urlbar" label="&status4evar.tab.urlbar;" />
<tab id="status4evar-tab-status-toolbar" label="&status4evar.tab.toolbar;" />
<tab id="status4evar-tab-status-popup" label="&status4evar.tab.popup;" />
</tabs>
@@ -81,7 +76,6 @@
<menupopup>
<menuitem label="&status4evar.option.none;" value="0" />
<menuitem label="&status4evar.option.toolbar;" value="1" />
<menuitem label="&status4evar.option.urlbar;" value="2" />
<menuitem label="&status4evar.option.popup;" value="3" />
</menupopup>
</menulist>
@@ -116,7 +110,6 @@
<menupopup>
<menuitem label="&status4evar.option.none;" value="0" />
<menuitem label="&status4evar.option.toolbar;" value="1" />
<menuitem label="&status4evar.option.urlbar;" value="2" />
<menuitem label="&status4evar.option.popup;" value="3" />
</menupopup>
</menulist>
@@ -142,47 +135,6 @@
</groupbox>
</tabpanel>
<tabpanel id="status4evar-tabpanel-status-urlbar" orient="vertical">
<hbox align="center">
<label id="status4evar-status-urlbar-color-label">&status4evar.status.urlbar.color.label;</label>
<colorpicker id="status4evar-status-urlbar-color-picker" preference="status4evar-pref-status-urlbar-color" type="button" />
</hbox>
<hbox align="center">
<label id="status4evar-status-urlbar-align-label">&status4evar.status.urlbar.align.label;</label>
<menulist id="status4evar-status-urlbar-align-menu" preference="status4evar-pref-status-urlbar-align" sizetopopup="always"
onsyncfrompreference="status4evarPrefs.urlbarAlignSync();">
<menupopup>
<menuitem label="&status4evar.option.left;" value="1" />
<menuitem label="&status4evar.option.right;" value="0" />
<menuitem label="&status4evar.option.fixed;" value="2" />
</menupopup>
</menulist>
</hbox>
<vbox id="status4evar-status-urlbar-position-vbox">
<scale id="status4evar-status-urlbar-position-value" preference="status4evar-pref-status-urlbar-position" min="0" max="100"
movetoclick="true" preference-editable="true" />
<hbox align="center">
<hbox pack="start" flex="1">
<label id="status4evar-status-urlbar-position-unit">&status4evar.status.currentUrl;</label>
</hbox>
<hbox pack="end" flex="1">
<label id="status4evar-status-urlbar-position-unit">&status4evar.status.statusText;</label>
</hbox>
</hbox>
</vbox>
<separator/>
<groupbox id="status4evar-status-urlbar-builtin">
<caption label="&status4evar.status.urlbar.firefox.builtin.caption;" />
<checkbox id="browser-urlbar-formatting-enabled-ckeck" preference="browser-pref-urlbar-formatting-enabled" label="&browser.urlbar.formatting.enabled.label;" />
</groupbox>
</tabpanel>
<tabpanel id="status4evar-tabpanel-status-toolbar" orient="vertical">
<hbox align="center">
<checkbox id="status4evar-status-toolbar-maxLength-check" label="&status4evar.status.toolbar.maxLength.label;"
@@ -224,55 +176,10 @@
<tabbox id="status4evar-tabbox-progress" flex="1">
<tabs id="status4evar-tabs-progress">
<tab id="status4evar-tab-progress-urlbar" label="&status4evar.tab.urlbar;" />
<tab id="status4evar-tab-progress-toolbar" label="&status4evar.tab.toolbar;" />
</tabs>
<tabpanels id="status4evar-tabpanels-progress" flex="1">
<tabpanel id="status4evar-tabpanel-progress-urlbar" orient="vertical">
<checkbox id="status4evar-progress-urlbar-check" label="&status4evar.progress.urlbar.enable.label;"
command="status4evar-command-progress-urlbar" />
<hbox align="center" class="indent">
<label id="status4evar-progress-urlbar-label" control="status4evar-progress-urlbar-menu">&status4evar.progress.urlbar.line.label;</label>
<menulist id="status4evar-progress-urlbar-menu" preference="status4evar-pref-progress-urlbar" sizetopopup="always"
onsyncfrompreference="return status4evarPrefs.progressUrlbarSync();">
<menupopup>
<menuitem label="&status4evar.option.none;" value="0" />
<menuitem label="&status4evar.option.bottom;" value="1" />
<menuitem label="&status4evar.option.top;" value="2" />
<menuitem label="&status4evar.option.fill;" value="3" />
</menupopup>
</menulist>
</hbox>
<checkbox id="status4evar-progress-urlbar-style-check" preference="status4evar-pref-progress-urlbar-style" label="&status4evar.progress.style.label;"
onsyncfrompreference="return status4evarPrefs.progressUrlbarStyleSync();" />
<vbox class="css-bg-editor" preference="status4evar-pref-progress-urlbar-css" preference-editable="true" flex="1">
<!-- Mock Nav Bar -->
<toolbox id="navigator-toolbox" flex="1">
<toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar" flex="1">
<toolbaritem id="urlbar-container" align="center" class="chromeclass-location" removable="false" flex="1">
<textbox id="urlbar" pmpack="end" flex="1">
<box id="identity-box" role="button" class="unknownIdentity">
<hbox id="identity-box-inner" align="center">
<stack id="page-proxy-stack">
<image id="page-proxy-favicon" validate="never" pageproxystate="valid"
src="chrome://browser/skin/statusbar/s4e16.png" />
</stack>
</hbox>
</box>
<tooltip id="urlTooltip"/>
<!-- Progress bar preview -->
<progressmeter id="urlbar-progress-alt" mode="normal" value="75" />
</textbox>
</toolbaritem>
</toolbar>
</toolbox>
</vbox>
</tabpanel>
<tabpanel id="status4evar-tabpanel-progress-toolbar" orient="vertical">
<checkbox id="status4evar-progress-toolbar-force-check" preference="status4evar-pref-progress-toolbar-force" label="&status4evar.progress.toolbar.force.label;" />
@@ -397,7 +304,6 @@
<preference id="status4evar-pref-advanced-showWarning" name="status4evar.advanced.showWarning" type="bool" />
<preference id="status4evar-pref-advanced-status-detectFullScreen" name="status4evar.advanced.status.detectFullScreen" type="bool" />
<preference id="status4evar-pref-advanced-status-detectVideo" name="status4evar.advanced.status.detectVideo" type="bool" />
<preference id="status4evar-pref-advanced-urlbar-forceBinding" name="status4evar.advanced.urlbar.forceBinding" type="bool" />
</preferences>
<commandset id="status4evar-commandset-advanced">
@@ -421,15 +327,6 @@
<spacer flex="2" />
</vbox>
<vbox flex="1">
<groupbox id="status4evar-advanced-general">
<caption label="&status4evar.tab.general;" />
<checkbox id="status4evar-advanced-urlbar-forceBinding-check" preference="status4evar-pref-advanced-urlbar-forceBinding" label="&status4evar.advanced.urlbar.forceBinding;" />
<textbox id="status4evar-advanced-urlbar-forceBinding-desc" class="indent" tabindex="-1"
multiline="true" readonly="true" onoverflow="this.height = this.inputField.scrollHeight;"
value="&status4evar.advanced.urlbar.forceBinding.desc;" />
</groupbox>
<groupbox id="status4evar-advanced-status">
<caption label="&status4evar.pane.status;" />
@@ -1,338 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<bindings id="status4evar-bindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="urlbar" extends="chrome://browser/content/urlbarBindings.xml#urlbar">
<content sizetopopup="pref">
<xul:stack anonid="stack" class="progress-stack" flex="1">
<xul:vbox class="urlbar-progress-layer" xbl:inherits="pack=pmpack" flex="1">
<children includes="progressmeter"/>
</xul:vbox>
<xul:hbox anonid="urlbar-input-layer" flex="1">
<xul:hbox anonid="textbox-container" class="autocomplete-textbox-container urlbar-textbox-container" flex="1" xbl:inherits="focused">
<children includes="image|deck|stack|box">
<xul:image class="autocomplete-icon" allowevents="true"/>
</children>
<xul:stack anonid="stack" class="urlbar-stack" flex="1">
<xul:hbox anonid="over-link-layer" class="urlbar-textbox-container urlbar-over-link-layer" xbl:inherits="overlinkstate" flex="1">
<xul:hbox class="urlbar-origin-box" align="center" flex="1">
<xul:label anonid="origin-label" class="urlbar-origin-label" flex="1" crop="end"/>
</xul:hbox>
<xul:hbox anonid="over-link-box" class="urlbar-over-link-box uri-element-right-align" align="center">
<xul:label anonid="over-link-host-label" class="urlbar-over-link-host-label uri-element-right-align"/>
<xul:label anonid="over-link-path-label" class="urlbar-over-link-path-label uri-element-right-align" flex="1"/>
</xul:hbox>
</xul:hbox>
<xul:hbox class="urlbar-textbox-container urlbar-input-layer" xbl:inherits="focused,overlinkstate" flex="1">
<xul:hbox anonid="textbox-input-box" class="textbox-input-box urlbar-input-box" flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
<xul:hbox class="urlbar-input-layer-children" xbl:inherits="overlinkstate">
<children/>
</xul:hbox>
<html:input anonid="input" class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align" allowevents="true"
xbl:inherits="tooltiptext=inputtooltiptext,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
</xul:hbox>
<xul:hbox class="urlbar-input-layer-children" xbl:inherits="overlinkstate">
<children includes="hbox"/>
</xul:hbox>
</xul:hbox>
</xul:stack>
</xul:hbox>
<xul:dropmarker anonid="historydropmarker" class="autocomplete-history-dropmarker urlbar-history-dropmarker"
allowevents="true" xbl:inherits="open,enablehistory,parentfocused=focused"/>
<xul:popupset anonid="popupset" class="autocomplete-result-popupset"/>
<children includes="toolbarbutton"/>
</xul:hbox>
</xul:stack>
</content>
<implementation>
<constructor><![CDATA[
this._overLinkLayer.addEventListener("transitionend", this, false);
]]></constructor>
<destructor><![CDATA[
this._overLinkLayer.removeEventListener("transitionend", this, false);
]]></destructor>
<field name="_overLinkLayer" readonly="true"><![CDATA[
document.getAnonymousElementByAttribute(this, "anonid", "over-link-layer");
]]></field>
<field name="_originLabel" readonly="true"><![CDATA[
document.getAnonymousElementByAttribute(this, "anonid", "origin-label");
]]></field>
<field name="_overLinkBox" readonly="true"><![CDATA[
document.getAnonymousElementByAttribute(this, "anonid", "over-link-box");
]]></field>
<field name="_overLinkHostLabel" readonly="true"><![CDATA[
document.getAnonymousElementByAttribute(this, "anonid", "over-link-host-label");
]]></field>
<field name="_overLinkPathLabel" readonly="true"><![CDATA[
document.getAnonymousElementByAttribute(this, "anonid", "over-link-path-label");
]]></field>
<field name="_status"><![CDATA[
null
]]></field>
<field name="_overLinkHostValue"><![CDATA[
null
]]></field>
<field name="_overLinkPathValue"><![CDATA[
null
]]></field>
<field name="s4espos"><![CDATA[
66
]]></field>
<field name="_overLinkState"><![CDATA[
null
]]></field>
<field name="_pmpack"><![CDATA[
null
]]></field>
<field name="_reOverLinkURL" readonly="true"><![CDATA[
/^((?:[a-z0-9+.-]+:\/\/)?[^\/]+\/?)(.*)$/
]]></field>
<property name="s4esalign">
<setter><![CDATA[
this.setAttribute("s4esalign", val);
return val;
]]></setter>
<getter><![CDATA[
return this.getAttribute("s4esalign");
]]></getter>
</property>
<property name="pmpack">
<setter><![CDATA[
this.setAttribute("pmpack", val);
this._pmpack = val;
return val;
]]></setter>
<getter><![CDATA[
return this.getAttribute("pmpack");
]]></getter>
</property>
<method name="handleEvent">
<parameter name="aEvent"/>
<body><![CDATA[
switch(aEvent.type)
{
case "transitionend":
if(aEvent.target == this._overLinkLayer && aEvent.propertyName == "opacity")
{
if(this._overLinkState == "fade-in")
{
this._setOverLinkState("showing");
}
else if(this._overLinkState == "fade-out")
{
this._setOverLinkState(null);
}
}
break;
default:
Object.getPrototypeOf(Object.getPrototypeOf(this)).handleEvent.call(this, aEvent);
break;
}
]]></body>
</method>
<method name="setStatusType">
<parameter name="aValue"/>
<body><![CDATA[
var overLinkBox = this._overLinkBox;
overLinkBox.setAttribute("previoustype", overLinkBox.getAttribute("type"));
overLinkBox.setAttribute("type", aValue);
]]></body>
</method>
<method name="setStatus">
<parameter name="aURL"/>
<body><![CDATA[
// NOTE: This method is called many times in a row very quickly when
// the user mouses over a bookmarks menu, tabs menu, or long list of
// links in a page, or leaves the cursor over a page with many links
// while scrolling. Therefore it's important that it be fast. Don't
// regress performance when you modify it!
this._status = aURL;
// Hide the over-link immediately if necessary.
if(!aURL && (XULBrowserWindow.hideOverLinkImmediately
|| this._hideOverLinkImmediately))
{
this._setOverLinkState(null);
return;
}
if(aURL)
{
this._updateOverLink(aURL);
this._setOverLinkState("fade-in");
}
else if(this._overLinkState)
{
this._setOverLinkState("fade-out");
}
]]></body>
</method>
<method name="_hideOverLink">
<body><![CDATA[
this._hideOverLinkImmediately = true;
this._setOverLinkState(null);
this._hideOverLinkImmediately = false;
]]></body>
</method>
<method name="_setOverLinkState">
<parameter name="aVal"/>
<body><![CDATA[
if(this._overLinkState == aVal)
{
return;
}
let aValOld = this._overLinkState;
this._overLinkState = aVal;
switch(aVal)
{
case "fade-in":
if(aValOld != "showing")
{
this._clearFormatting();
this.setAttribute("overlinkstate", aVal);
}
break;
case "fade-out":
if(aValOld != null)
{
this.setAttribute("overlinkstate", aVal);
}
break;
case "showing":
this._clearFormatting();
this.setAttribute("overlinkstate", aVal);
break;
default:
this.removeAttribute("overlinkstate");
this.formatValue();
break;
}
]]></body>
</method>
<method name="_updateOverLink">
<parameter name="aURL"/>
<body><![CDATA[
// Determine the pre-path and path of the over-link. Include the
// path's leading slash in the pre-path so that if the path is
// truncated its leading slash is visible.
var match = this._reOverLinkURL.exec(aURL);
this._overLinkHostValue = match ? match[1] : "";
this._overLinkPathValue = match ? match[2] : aURL;
this.updateOverLinkLayout();
]]></body>
</method>
<method name="updateOverLinkLayout">
<body><![CDATA[
// Reset the overlay state
var overLinkHost = this._overLinkHostLabel;
overLinkHost.value = "";
overLinkHost.flex = 0;
overLinkHost.crop = "none";
var overLinkPath = this._overLinkPathLabel;
overLinkPath.value = "";
overLinkPath.crop = "none";
var overLinkBox = this._overLinkBox;
overLinkBox.maxWidth = "";
overLinkBox.minWidth = "";
// Calculate the max-width
var maxWidth = this._overLinkLayer.boxObject.width;
var alignMode = this.s4esalign;
if(alignMode != "left")
{
maxWidth *= (this.s4espos / 100);
}
// Do eet!
overLinkHost.value = this._overLinkHostValue;
overLinkPath.value = this._overLinkPathValue;
overLinkPath.crop = this._overLinkHostValue ? "start" : "end";
if(overLinkHost.boxObject.width > maxWidth)
{
overLinkHost.flex = 1;
overLinkHost.crop = "end";
}
overLinkBox.maxWidth = maxWidth;
if(alignMode == "absolute")
{
overLinkBox.minWidth = maxWidth;
}
]]></body>
</method>
<method name="formatValue">
<body><![CDATA[
if(this._overLinkState)
{
return;
}
Object.getPrototypeOf(Object.getPrototypeOf(this)).formatValue.call(this);
]]></body>
</method>
</implementation>
<handlers>
<handler event="focus" phase="capturing"><![CDATA[
this._hideOverLink();
if(this._pmpack == "center")
{
this.setAttribute("pmpack", "end");
}
]]></handler>
<handler event="blur" phase="capturing"><![CDATA[
this.setAttribute("pmpack", this._pmpack);
if(this._status)
{
this._setOverLinkState("fade-in");
}
]]></handler>
<handler event="ValueChange" phase="capturing"><![CDATA[
this._originLabel.value = this.inputField.value;
]]></handler>
</handlers>
</binding>
</bindings>
-1
View File
@@ -9,7 +9,6 @@ browser.jar:
content/browser/statusbar/prefs.js (content/prefs.js)
content/browser/statusbar/prefs.xml (content/prefs.xml)
content/browser/statusbar/tabbrowser.xml (content/tabbrowser.xml)
content/browser/statusbar/urlbarBindings.xml (content/urlbarBindings.xml)
content/browser/statusbar/overlay.xul (content/overlay.xul)
content/browser/statusbar/prefs.xul (content/prefs.xul)
content/browser/statusbar/overlay.css (content/overlay.css)
+1 -14
View File
@@ -6,7 +6,7 @@
interface nsIDOMWindow;
[scriptable, uuid(13b3595e-7bb5-4cfe-bbfa-82c900a4d7bf)]
[scriptable, uuid(b418cd1b-b172-4ef5-bfc5-fc555c87dbc4)]
interface nsIStatus4Evar : nsISupports
{
readonly attribute boolean addonbarBorderStyle;
@@ -16,7 +16,6 @@ interface nsIStatus4Evar : nsISupports
readonly attribute boolean advancedStatusDetectFullScreen;
readonly attribute boolean advancedStatusDetectVideo;
readonly attribute boolean advancedUrlbarForceBinding;
readonly attribute long downloadButtonAction;
readonly attribute ACString downloadButtonActionCommand;
@@ -38,11 +37,6 @@ interface nsIStatus4Evar : nsISupports
readonly attribute boolean progressToolbarStyle;
readonly attribute boolean progressToolbarStyleAdvanced;
readonly attribute ACString progressUrlbar;
readonly attribute ACString progressUrlbarCSS;
readonly attribute boolean progressUrlbarStyle;
readonly attribute boolean progressUrlbarStyleAdvanced;
readonly attribute long status;
readonly attribute boolean statusDefault;
readonly attribute boolean statusNetwork;
@@ -54,13 +48,6 @@ interface nsIStatus4Evar : nsISupports
readonly attribute long statusToolbarMaxLength;
readonly attribute ACString statusUrlbarAlign;
readonly attribute ACString statusUrlbarColor;
readonly attribute long statusUrlbarPosition;
readonly attribute boolean statusUrlbarInvertMirror;
readonly attribute boolean statusUrlbarMouseMirror;
void resetPrefs();
void updateWindow(in nsIDOMWindow win);
};
+2 -190
View File
@@ -18,7 +18,7 @@ function Status_4_Evar(){}
Status_4_Evar.prototype =
{
classID: Components.ID("{13b3595e-7bb5-4cfe-bbfa-82c900a4d7bf}"),
classID: Components.ID("{b418cd1b-b172-4ef5-bfc5-fc555c87dbc4}"),
QueryInterface: XPCOMUtils.generateQI([
CI.nsISupportsWeakReference,
CI.nsIObserver,
@@ -33,7 +33,6 @@ Status_4_Evar.prototype =
advancedStatusDetectFullScreen: true,
advancedStatusDetectVideo: true,
advancedUrlbarForceBinding: false,
downloadButtonAction: 1,
downloadButtonActionCommand: "",
@@ -53,10 +52,6 @@ Status_4_Evar.prototype =
progressToolbarForce: false,
progressToolbarStyle: false,
progressUrlbar: 1,
progressUrlbarCSS: null,
progressUrlbarStyle: true,
status: 1,
statusDefault: true,
statusNetwork: true,
@@ -67,13 +62,6 @@ Status_4_Evar.prototype =
statusToolbarMaxLength: 0,
statusUrlbarAlign: null,
statusUrlbarColor: null,
statusUrlbarPosition: 33,
statusUrlbarInvertMirror: false,
statusUrlbarMouseMirror: true,
pref_registry:
{
"addonbar.borderStyle":
@@ -136,22 +124,6 @@ Status_4_Evar.prototype =
}
},
"advanced.urlbar.forceBinding":
{
update: function()
{
this.advancedUrlbarForceBinding = this.prefs.getBoolPref("advanced.urlbar.forceBinding");
},
updateWindow: function(win)
{
let urlbar = win.caligon.status4evar.getters.urlbar;
if(urlbar)
{
this.setBoolElementAttribute(urlbar, "s4eforce", this.advancedUrlbarForceBinding);
}
}
},
"download.button.action":
{
update: function()
@@ -327,69 +299,6 @@ Status_4_Evar.prototype =
}
},
"progress.urlbar":
{
update: function()
{
switch(this.prefs.getIntPref("progress.urlbar"))
{
case 0:
this.progressUrlbar = null;
break;
case 1:
this.progressUrlbar = "end";
break;
case 2:
this.progressUrlbar = "begin";
break;
default:
this.progressUrlbar = "center";
break;
}
},
updateWindow: function(win)
{
let urlbar = win.caligon.status4evar.getters.urlbar;
let urlbar_progress = win.caligon.status4evar.getters.urlbarProgress;
if(urlbar && urlbar_progress)
{
if(this.progressUrlbar)
{
urlbar.pmpack = this.progressUrlbar;
}
urlbar_progress.hidden = !this.progressUrlbar;
}
}
},
"progress.urlbar.css":
{
update: function()
{
this.progressUrlbarCSS = this.prefs.getCharPref("progress.urlbar.css");
},
updateDynamicStyle: function(sheet)
{
sheet.cssRules[1].style.background = this.progressUrlbarCSS;
}
},
"progress.urlbar.style":
{
update: function()
{
this.progressUrlbarStyle = this.prefs.getBoolPref("progress.urlbar.style");
},
updateWindow: function(win)
{
let urlbar = win.caligon.status4evar.getters.urlbar;
if(urlbar)
{
this.setBoolElementAttribute(urlbar, "s4estyle", this.progressUrlbarStyle);
}
}
},
"status":
{
update: function()
@@ -464,38 +373,6 @@ Status_4_Evar.prototype =
}
},
"status.popup.invertMirror":
{
update: function()
{
this.statusUrlbarInvertMirror = this.prefs.getBoolPref("status.popup.invertMirror");
},
updateWindow: function(win)
{
let statusOverlay = win.caligon.status4evar.getters.statusOverlay;
if(statusOverlay)
{
statusOverlay.invertMirror = this.statusUrlbarInvertMirror;
}
}
},
"status.popup.mouseMirror":
{
update: function()
{
this.statusUrlbarMouseMirror = this.prefs.getBoolPref("status.popup.mouseMirror");
},
updateWindow: function(win)
{
let statusOverlay = win.caligon.status4evar.getters.statusOverlay;
if(statusOverlay)
{
statusOverlay.mouseMirror = this.statusUrlbarMouseMirror;
}
}
},
"status.timeout":
{
update: function()
@@ -522,73 +399,8 @@ Status_4_Evar.prototype =
status_widget.maxWidth = (this.statusToolbarMaxLength || "");
}
}
},
"status.urlbar.align":
{
update: function()
{
switch(this.prefs.getIntPref("status.urlbar.align"))
{
case 0:
this.statusUrlbarAlign = null;
break;
case 1:
this.statusUrlbarAlign = "left";
break;
default:
this.statusUrlbarAlign = "absolute";
break;
}
},
updateWindow: function(win)
{
let urlbar = win.caligon.status4evar.getters.urlbar;
if(urlbar)
{
urlbar.s4esalign = this.statusUrlbarAlign;
urlbar.updateOverLinkLayout();
}
}
},
"status.urlbar.color":
{
update: function()
{
this.statusUrlbarColor = this.prefs.getCharPref("status.urlbar.color");
},
updateDynamicStyle: function(sheet)
{
sheet.cssRules[3].style.color = this.statusUrlbarColor;
}
},
"status.urlbar.position":
{
update: function()
{
this.statusUrlbarPosition = this.prefs.getIntPref("status.urlbar.position");
if(this.statusUrlbarPosition < 10)
{
this.statusUrlbarPosition = 10;
}
else if(this.statusUrlbarPosition > 90)
{
this.statusUrlbarPosition = 90;
}
},
updateWindow: function(win)
{
let urlbar = win.caligon.status4evar.getters.urlbar;
if(urlbar)
{
urlbar.s4espos = this.statusUrlbarPosition;
urlbar.updateOverLinkLayout();
}
}
}
},
// nsIObserver
@@ -1,3 +1,3 @@
component {13b3595e-7bb5-4cfe-bbfa-82c900a4d7bf} status4evar.js
contract @caligonstudios.com/status4evar;1 {13b3595e-7bb5-4cfe-bbfa-82c900a4d7bf}
component {b418cd1b-b172-4ef5-bfc5-fc555c87dbc4} status4evar.js
contract @caligonstudios.com/status4evar;1 {b418cd1b-b172-4ef5-bfc5-fc555c87dbc4}
category profile-after-change Status-4-Evar @caligonstudios.com/status4evar;1