fx-compat: Remove unused progress display

This commit is contained in:
Abe Jellinek 2022-07-12 14:50:53 -04:00
parent 5c6837c1fc
commit 5f8a5056f1
3 changed files with 0 additions and 203 deletions

View file

@ -1,183 +0,0 @@
<?xml version="1.0"?>
<!--
***** BEGIN LICENSE BLOCK *****
Copyright © 2012 Center for History and New Media
George Mason University, Fairfax, Virginia, USA
http://zotero.org
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
-->
<?xml-stylesheet href="chrome://zotero/skin/overlay.css" type="text/css"?>
<!DOCTYPE bindings SYSTEM "chrome://zotero/locale/zotero.dtd">
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="file-sync-status">
<implementation>
<property name="data"
onget="return this._data;"
onset="this._data = val; this.refresh();">
</property>
<field name="_libraries">[]</field>
<method name="refresh">
<body>
<![CDATA[
var rows = this._id('rows');
// Get libraries with active downloads or uploads
var newLibraries = [];
for (var libraryID in this._data) {
if ((this._data[libraryID].download
&& !this._data[libraryID].download.finished)
||
(this._data[libraryID].upload
&& !this._data[libraryID].upload.finished)) {
newLibraries.push(parseInt(libraryID));
}
}
// If set of libraries is different, clear and recreate
var toRemove = Zotero.Utilities.arrayDiff(this._libraries, newLibraries);
var toAdd = Zotero.Utilities.arrayDiff(newLibraries, this._libraries);
if (toRemove.length || toAdd.length) {
while (rows.hasChildNodes()) {
rows.removeChild(rows.firstChild);
}
}
this._libraries = newLibraries;
// Update
if (rows.hasChildNodes()) {
for (var libraryID in this._data) {
var libraryStatus = this._data[libraryID];
// Library is finished
if (newLibraries.indexOf(parseInt(libraryID)) == -1) {
continue;
}
var libraryNameRow = this._id('library-name-row-' + libraryID);
var downloadsRow = this._id('downloads-row-' + libraryID);
var uploadsRow = this._id('uploads-row-' + libraryID);
downloadsRow.lastChild.setAttribute('value',
libraryStatus.download
? libraryStatus.download.statusString
: Zotero.getString('sync.storage.none'));
uploadsRow.lastChild.setAttribute('value',
libraryStatus.upload
? libraryStatus.upload.statusString
: Zotero.getString('sync.storage.none'));
}
}
// Build from scratch
else {
// Get ordered list of library names
var libraryNames = [];
for (let libraryID of newLibraries) {
libraryNames.push({
libraryID: libraryID,
name: Zotero.Libraries.getName(libraryID)
});
}
var collation = Zotero.getLocaleCollation();
let userLibraryID = Zotero.Libraries.userLibraryID;
libraryNames.sort(function (a, b) {
if (a.libraryID == userLibraryID) {
return -1;
}
if (b.libraryID == userLibraryID) {
return 1;
}
return collation.compareString(1, a.name, b.name);
});
for (var i in libraryNames) {
var libraryID = libraryNames[i].libraryID;
var libraryStatus = this._data[libraryID];
var label = document.createElement('label');
label.id = 'library-name-row-' + libraryID;
label.setAttribute('value', libraryNames[i].name);
rows.appendChild(label);
var row = this._createRow('download',
libraryStatus.download
? libraryStatus.download.statusString
: false);
row.id = 'downloads-row-' + libraryID;
rows.appendChild(row);
var row = this._createRow('upload',
libraryStatus.upload
? libraryStatus.upload.statusString
: false);
row.id = 'uploads-row-' + libraryID;
rows.appendChild(row);
}
}
]]>
</body>
</method>
<method name="_createRow">
<parameter name="type"/>
<parameter name="value"/>
<body>
<![CDATA[
var row = document.createElement('row');
var label = document.createElement('label');
label.setAttribute('value', Zotero.getString('sync.storage.' + type + 's'));
row.appendChild(label);
label = document.createElement('label');
label.setAttribute('value',
value ? value : Zotero.getString('sync.storage.none'));
row.appendChild(label);
return row;
]]>
</body>
</method>
<method name="_id">
<parameter name="id"/>
<body>
<![CDATA[
return document.getAnonymousNodes(this)[0].getElementsByAttribute('id', id)[0];
]]>
</body>
</method>
</implementation>
<content>
<grid xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1">
<columns>
<column/>
<column/>
</columns>
<rows id="rows"/>
</grid>
</content>
</binding>
</bindings>

View file

@ -861,22 +861,6 @@
tooltiptext="&zotero.sync.stop;"
oncommand="this.hidden = true; Zotero.Sync.Runner.stop()"
hidden="true"/>
<hbox id="zotero-tb-sync-progress-box" hidden="true" align="center">
<!-- TODO: localize -->
<toolbarbutton id="zotero-tb-sync-storage-cancel"
tooltiptext="Stop sync"
oncommand="Zotero.Sync.Runner.stop()"/>
<progressmeter id="zotero-tb-sync-progress" mode="determined"
value="0" tooltip="zotero-tb-sync-progress-tooltip">
</progressmeter>
<tooltip id="zotero-tb-sync-progress-tooltip" noautohide="true">
<hbox id="zotero-tb-sync-progress-tooltip-progress">
<label value="&zotero.sync.storage.progress;"/>
<label/>
</hbox>
<zoterofilesyncstatus id="zotero-tb-sync-progress-status"/>
</tooltip>
</hbox>
</hbox>
<hbox id="zotero-pq-buttons">

View file

@ -73,10 +73,6 @@ zoteroguidancepanel
-moz-binding: url('chrome://zotero/content/bindings/guidancepanel.xml#guidancepanel');
}
zoterofilesyncstatus {
-moz-binding: url('chrome://zotero/content/bindings/filesyncstatus.xml#file-sync-status');
}
richlistitem {
padding: 0.2em 0.4em;
}