зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1452624 - Part 2 - Remove the "filefield" binding. r=bgrins
MozReview-Commit-ID: GQRrmvIna4m --HG-- extra : rebase_source : bd91518f591d3c671ec9237b9601773f7b72370c
This commit is contained in:
Родитель
3ee3699485
Коммит
1c8a193ac6
|
@ -74,7 +74,6 @@ toolkit.jar:
|
|||
content/global/bindings/datetimebox.css (widgets/datetimebox.css)
|
||||
* content/global/bindings/dialog.xml (widgets/dialog.xml)
|
||||
content/global/bindings/editor.xml (widgets/editor.xml)
|
||||
content/global/bindings/filefield.xml (widgets/filefield.xml)
|
||||
* content/global/bindings/findbar.xml (widgets/findbar.xml)
|
||||
content/global/bindings/general.xml (widgets/general.xml)
|
||||
content/global/bindings/groupbox.xml (widgets/groupbox.xml)
|
||||
|
|
|
@ -1,93 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- 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="filefieldBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="filefield" extends="chrome://global/content/bindings/general.xml#basetext">
|
||||
<resources>
|
||||
<stylesheet src="chrome://global/skin/filefield.css"/>
|
||||
</resources>
|
||||
<content>
|
||||
<xul:stringbundle anonid="bundle" src="chrome://global/locale/filefield.properties"/>
|
||||
<xul:hbox class="fileFieldContentBox" align="center" flex="1" xbl:inherits="disabled">
|
||||
<xul:image class="fileFieldIcon" xbl:inherits="src=image,disabled"/>
|
||||
<xul:textbox class="fileFieldLabel" xbl:inherits="value=label,disabled,accesskey,tabindex,aria-labelledby" flex="1" readonly="true"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
<implementation implements="nsIDOMXULLabeledControlElement">
|
||||
<property name="label" onget="return this.getAttribute('label');">
|
||||
<setter>
|
||||
this.setAttribute("label", val);
|
||||
var elt = document.getAnonymousElementByAttribute(this, "class", "fileFieldLabel");
|
||||
return (elt.value = val);
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<field name="_file">null</field>
|
||||
<property name="file" onget="return this._file">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
this._file = val;
|
||||
if (val) {
|
||||
this.image = this._getIconURLForFile(val);
|
||||
this.label = this._getDisplayNameForFile(val);
|
||||
} else {
|
||||
this.removeAttribute("image");
|
||||
var bundle = document.getAnonymousElementByAttribute(this, "anonid", "bundle");
|
||||
this.label = bundle.getString("downloadHelperNoneSelected");
|
||||
}
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<method name="_getDisplayNameForFile">
|
||||
<parameter name="aFile"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (/Win/.test(navigator.platform)) {
|
||||
var lfw = aFile.QueryInterface(Ci.nsILocalFileWin);
|
||||
try {
|
||||
return lfw.getVersionInfoField("FileDescription");
|
||||
} catch (e) {
|
||||
// fall through to the filename
|
||||
}
|
||||
} else if (/Mac/.test(navigator.platform)) {
|
||||
var lfm = aFile.QueryInterface(Ci.nsILocalFileMac);
|
||||
try {
|
||||
return lfm.bundleDisplayName;
|
||||
} catch (e) {
|
||||
// fall through to the file name
|
||||
}
|
||||
}
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
var url = ios.newFileURI(aFile).QueryInterface(Ci.nsIURL);
|
||||
return url.fileName;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_getIconURLForFile">
|
||||
<parameter name="aFile"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!aFile)
|
||||
return "";
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
var fph = ios.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
var urlspec = fph.getURLSpecFromFile(aFile);
|
||||
return "moz-icon://" + urlspec + "?size=16";
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -962,12 +962,6 @@ findbar {
|
|||
-moz-binding: url("chrome://global/content/bindings/findbar.xml#findbar-textbox");
|
||||
}
|
||||
|
||||
|
||||
/*********** filefield ************/
|
||||
filefield {
|
||||
-moz-binding: url("chrome://global/content/bindings/filefield.xml#filefield");
|
||||
}
|
||||
|
||||
/*********** tabmodalprompt ************/
|
||||
tabmodalprompt {
|
||||
-moz-binding: url("chrome://global/content/tabprompts.xml#tabmodalprompt");
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# 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/.
|
||||
|
||||
#### Change Action
|
||||
|
||||
downloadHelperNoneSelected=None Selected
|
|
@ -40,7 +40,6 @@
|
|||
#endif
|
||||
locale/@AB_CD@/global/extensions.properties (%chrome/global/extensions.properties)
|
||||
locale/@AB_CD@/global/fallbackMenubar.properties (%chrome/global/fallbackMenubar.properties)
|
||||
locale/@AB_CD@/global/filefield.properties (%chrome/global/filefield.properties)
|
||||
locale/@AB_CD@/global/filepicker.properties (%chrome/global/filepicker.properties)
|
||||
#ifndef MOZ_FENNEC
|
||||
locale/@AB_CD@/global/findbar.dtd (%chrome/global/findbar.dtd)
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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/.
|
||||
*/
|
||||
|
||||
.fileFieldIcon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.fileFieldIcon[disabled="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
filefield {
|
||||
margin: 4px;
|
||||
margin-inline-start: 27px;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.fileFieldContentBox {
|
||||
margin: -3px;
|
||||
background-color: rgba(230, 230, 230, 0.6);
|
||||
color: -moz-DialogText;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-inline-start: 5px;
|
||||
padding-inline-end: 3px;
|
||||
}
|
||||
|
||||
.fileFieldLabel {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
margin: 0 4px;
|
||||
}
|
|
@ -12,7 +12,6 @@ toolkit.jar:
|
|||
skin/classic/global/commonDialog.css
|
||||
skin/classic/global/dialog.css
|
||||
skin/classic/global/dropmarker.css
|
||||
skin/classic/global/filefield.css
|
||||
* skin/classic/global/findBar.css
|
||||
* skin/classic/global/global.css
|
||||
skin/classic/global/groupbox.css
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
*
|
||||
* It works like this:
|
||||
* For every combination of two different widgets (where widget is one of
|
||||
* label, radio, checkbox, button, textbox, menulist, menulist[editable="true"] or
|
||||
* filefield), there's a stack with two layers. The back layer in the stack is
|
||||
* label, radio, checkbox, button, textbox, menulist, menulist[editable="true"]),
|
||||
* there's a stack with two layers. The back layer in the stack is
|
||||
* just a vertically centered label with a bunch of underscores. This is the
|
||||
* baseline that the text on the widgets should hit.
|
||||
* On the foreground layer in the stack we've placed the pair of widgets we're
|
||||
|
@ -130,18 +130,13 @@ function createEditableMenulist(v) {
|
|||
list.setAttribute("editable", "true");
|
||||
return list;
|
||||
}
|
||||
function createFileField(v) {
|
||||
let field = elWithValue("filefield", v);
|
||||
field.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUEBAAAEBLCjf2dK8NsKrCaTT51nAoFAIBAIBAKB4MoCtVsCPjrGuiwAAAAASUVORK5CYII=");
|
||||
return field;
|
||||
}
|
||||
function loaded() {
|
||||
let template = document.getElementById("template");
|
||||
["regular", "small"].forEach(function(size) {
|
||||
let wrapper = document.querySelectorAll("#wrapper > ." + size)[0];
|
||||
allPairs([
|
||||
createLabel, createRadio, createCheckbox, createButton, createMenulist, createTextField,
|
||||
/* createEditableMenulist, createFileField, */ /* These don't inherit "color" properly */
|
||||
/* createEditableMenulist, */ /* These don't inherit "color" properly */
|
||||
]).forEach(function(elemList) {
|
||||
let newBox = template.cloneNode(true);
|
||||
newBox.className = "spacer";
|
||||
|
|
|
@ -746,45 +746,6 @@ xul|*.radio-label-box {
|
|||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
/* File fields */
|
||||
|
||||
xul|filefield {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
xul|*.fileFieldContentBox {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
xul|*.fileFieldIcon {
|
||||
margin-inline-start: 10px;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
xul|*.fileFieldLabel {
|
||||
margin-inline-start: -26px;
|
||||
padding-inline-start: 36px;
|
||||
}
|
||||
|
||||
xul|*.fileFieldLabel:-moz-locale-dir(rtl),
|
||||
xul|filefield + xul|button:-moz-locale-dir(ltr) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
xul|*.fileFieldLabel:-moz-locale-dir(ltr),
|
||||
xul|filefield + xul|button:-moz-locale-dir(rtl) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
xul|filefield + xul|button {
|
||||
border-inline-start: none;
|
||||
}
|
||||
|
||||
/* List boxes */
|
||||
|
||||
html|select[size][multiple],
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include jar.inc.mn
|
||||
|
||||
skin/classic/global/dialog.css (../../windows/global/dialog.css)
|
||||
skin/classic/global/filefield.css (../../windows/global/filefield.css)
|
||||
skin/classic/global/progressmeter.css (../../windows/global/progressmeter.css)
|
||||
skin/classic/global/resizer.css (../../windows/global/resizer.css)
|
||||
skin/classic/global/richlistbox.css (../../windows/global/richlistbox.css)
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# 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/.
|
||||
*/
|
||||
|
||||
/* File Field Widget */
|
||||
filefield {
|
||||
margin: 2px 4px;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.fileFieldContentBox {
|
||||
background-color: -moz-Dialog;
|
||||
}
|
||||
|
||||
.fileFieldIcon[disabled="true"] {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.fileFieldIcon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
margin-inline-start: 1px;
|
||||
margin-inline-end: 4px;
|
||||
}
|
||||
|
||||
.fileFieldLabel {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
margin: 0px;
|
||||
}
|
Загрузка…
Ссылка в новой задаче