Updated for Polymer 0.5.1.

Which removed the label and icon attributes from paper-item elements.
This commit is contained in:
Oliver Hamlet
2014-11-13 01:08:29 +00:00
parent 672ba6bd9d
commit b3f1457eb4
7 changed files with 87 additions and 81 deletions
+5 -1
View File
@@ -63,7 +63,11 @@ div[drawer] > core-tooltip {
overflow: auto;
}
#cardsNav > paper-item, #cardsNav > loot-plugin-item {
height: 2em;
/*height: 2em;*/
}
paper-item > a {
text-decoration: none;
color: black;
}
#container {
position: fixed;
+12 -3
View File
@@ -206,9 +206,18 @@ loot-clear-metadata
<paper-item>
<paper-checkbox id="showOnlyConflicts" label="Show Only Conflicts" flex></paper-checkbox>
</paper-item>
<paper-item id="editMetadata" icon="create" label="Edit Metadata"></paper-item>
<paper-item id="copyMetadata" icon="content-copy" label="Copy Metadata As Text"></paper-item>
<paper-item id="clearMetadata" icon="delete" label="Clear User Metadata"></paper-item>
<paper-item id="editMetadata">
<core-icon icon="create"></core-icon>
Edit Metadata
</paper-item>
<paper-item id="copyMetadata">
<core-icon icon="content-copy"></core-icon>
Copy Metadata As Text
</paper-item>
<paper-item id="clearMetadata">
<core-icon icon="delete"></core-icon>
Clear User Metadata
</paper-item>
</core-menu>
</paper-dropdown>
</paper-menu-button>
+15 -45
View File
@@ -4,7 +4,7 @@
<link rel="import" href="../bower_components/core-icon/core-icon.html">
<link rel="import" href="../bower_components/core-icons/core-icons.html">
<polymer-element name="loot-plugin-item" extends="paper-item">
<polymer-element name="loot-plugin-item">
<template>
<style>
:host([data-bsa=false]) #loadsBSA,
@@ -14,50 +14,20 @@
:host #hasPriority:not([label^=Priority]) {
visibility: hidden;
}
:host a {
a {
text-decoration: none;
color: black;
}
:host .hasGlobalPriority, :host #hasPriority {
.hasGlobalPriority, #hasPriority {
display:none;
}
:host-context(body.editMode) #hasGlobalPriority,
:host-context(body.editMode) #hasPriority {
display: inline-block;
}
div {
min-width: 62px;
}
/* The default styling for Polymer's <paper-item>, which seems to be applied in an external stylesheet, so isn't inherited. */
:host::shadow paper-ripple {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
pointer-events: none;
}
:host {
display: block;
position: relative;
font-size: 16px;
-webkit-user-select: none;
cursor: pointer;
box-sizing: border-box;
height: 48px;
padding: 0 16px;
white-space: nowrap;
}
:host::shadow ::content > a {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
<div center horizontal layout>
<paper-item>
<core-tooltip id="dummyPlugin" label="Dummy Plugin">
<core-icon icon="visibility-off"></core-icon>
</core-tooltip>
@@ -73,13 +43,18 @@
<core-tooltip id="hasPriority" label="">
<core-icon icon="star"></core-icon>
</core-tooltip>
</div>
<shadow></shadow>
<a id="link" href=""></a>
</paper-item>
</template>
<script>
Polymer({
setLink: function(url) {
this.getElementsByTagName('a')[0].href = url;
setLink: function(id, name) {
this.shadowRoot.getElementById('link').href = '#' + id;
this.shadowRoot.getElementById('link').textContent = name;
},
getName: function() {
return this.shadowRoot.getElementById('link').textContent;
},
setPriority: function(text) {
@@ -88,12 +63,7 @@
handleDragStart: function(evt) {
evt.dataTransfer.effectAllowed = 'copy';
evt.dataTransfer.setData('text/plain', evt.currentTarget.label);
},
created: function() {
var a = document.createElement('a');
this.appendChild(a);
evt.dataTransfer.setData('text/plain', evt.currentTarget.getName());
},
});
</script>
+14 -14
View File
@@ -120,9 +120,9 @@
pluginCard.getElementById('cancel').textContent = l10n.translate("Cancel").fetch();
pluginCard.getElementById('showOnlyConflicts').label = l10n.translate("Show Only Conflicts").fetch();
pluginCard.getElementById('editMetadata').label = l10n.translate("Edit Metadata").fetch();
pluginCard.getElementById('copyMetadata').label = l10n.translate("Copy Metadata As Text").fetch();
pluginCard.getElementById('clearMetadata').label = l10n.translate("Clear User Metadata").fetch();
pluginCard.getElementById('editMetadata').lastChild.textContent = l10n.translate("Edit Metadata").fetch();
pluginCard.getElementById('copyMetadata').lastChild.textContent = l10n.translate("Copy Metadata As Text").fetch();
pluginCard.getElementById('clearMetadata').lastChild.textContent = l10n.translate("Clear User Metadata").fetch();
/* Plugin List Item Template */
var pluginItem = document.querySelector('link[rel="import"][href$="loot-plugin-item.html"]');
@@ -158,20 +158,20 @@
tagRow.querySelector('.type').children[1].textContent = l10n.translate("Remove").fetch();
/* Toolbar menu */
document.getElementById('redatePluginsButton').label = l10n.translate("Redate Plugins").fetch();
document.getElementById('openLogButton').label = l10n.translate("Open Debug Log Location").fetch();
document.getElementById('wipeUserlistButton').label = l10n.translate("Clear All User Metadata").fetch();
document.getElementById('copyContentButton').label = l10n.translate("Copy Content As Text").fetch();
document.getElementById('refreshContentButton').label = l10n.translate("Refresh Content").fetch();
document.getElementById('helpButton').label = l10n.translate("View Documentation").fetch();
document.getElementById('aboutButton').label = l10n.translate("About").fetch();
document.getElementById('settingsButton').label = l10n.translate("Settings").fetch();
document.getElementById('redatePluginsButton').lastChild.textContent = l10n.translate("Redate Plugins").fetch();
document.getElementById('openLogButton').lastChild.textContent = l10n.translate("Open Debug Log Location").fetch();
document.getElementById('wipeUserlistButton').lastChild.textContent = l10n.translate("Clear All User Metadata").fetch();
document.getElementById('copyContentButton').lastChild.textContent = l10n.translate("Copy Content As Text").fetch();
document.getElementById('refreshContentButton').lastChild.textContent = l10n.translate("Refresh Content").fetch();
document.getElementById('helpButton').lastChild.textContent = l10n.translate("View Documentation").fetch();
document.getElementById('aboutButton').lastChild.textContent = l10n.translate("About").fetch();
document.getElementById('settingsButton').lastChild.textContent = l10n.translate("Settings").fetch();
document.getElementById('applySortButton').textContent = l10n.translate("Apply").fetch();
document.getElementById('cancelSortButton').textContent = l10n.translate("Cancel").fetch();
/* Nav items */
document.getElementById('container').querySelector('div[drawer] > core-menu > paper-item[label=Summary]').label = l10n.translate("Summary").fetch();
document.getElementById('container').querySelector('div[drawer] > core-menu > paper-item[label^=General]').label = l10n.translate("General Messages").fetch();
document.getElementById('container').querySelector('div[drawer] > core-menu > paper-item[label=Summary]').lastChild.textContent = l10n.translate("Summary").fetch();
document.getElementById('container').querySelector('div[drawer] > core-menu > paper-item[label^=General]').lastChild.textContent = l10n.translate("General Messages").fetch();
document.getElementById('sidebarTabs').firstElementChild.textContent = l10n.translate("Plugins").fetch();
document.getElementById('sidebarTabs').firstElementChild.nextElementSibling.textContent = l10n.translate("Filters").fetch();
document.getElementById('searchBox').parentElement.label = l10n.translate("Press Enter when searching to select the next match.").fetch();
@@ -206,7 +206,7 @@
document.getElementById('settingsDialog').heading = l10n.translate("Settings").fetch();
document.getElementById('defaultGameSelect').previousElementSibling.textContent = l10n.translate("Default Game").fetch();
document.getElementById('defaultGameSelect').firstElementChild.label = l10n.translate("Autodetect").fetch();
document.getElementById('defaultGameSelect').firstElementChild.textContent = l10n.translate("Autodetect").fetch();
document.getElementById('languageSelect').previousElementSibling.textContent = l10n.translate("Language").fetch();
+1 -2
View File
@@ -161,8 +161,7 @@ function Plugin(obj) {
Plugin.prototype.createListItem = function() {
this.li = document.createElement('loot-plugin-item');
this.li.label = this.name;
this.li.setLink('#' + this.id);
this.li.setLink(this.id, this.name);
this.li.setPriority(this.getPriorityString());
this.li.setAttribute('data-dummy', this.isDummy);
+3 -3
View File
@@ -174,7 +174,7 @@ var loot = {
this.settings.games.forEach(function(game){
var menuItem = document.createElement('paper-item');
menuItem.setAttribute('value', game.folder);
menuItem.setAttribute('label', game.name);
menuItem.textContent = game.name;
gameMenu.appendChild(menuItem);
gameSelect.appendChild(menuItem.cloneNode());
@@ -656,7 +656,7 @@ function sortUIElements(pluginNames) {
/* Also need to move plugin sidebar entry. */
var li;
for (var i = 0; i < entries.length; ++i) {
if (entries[i].label == name) {
if (entries[i].getName() == name) {
li = entries[i];
}
}
@@ -1251,7 +1251,7 @@ function initVars() {
for (var i = 0; i < loot.languages.length; ++i) {
var settingsItem = document.createElement('paper-item');
settingsItem.setAttribute('value', loot.languages[i].locale);
settingsItem.setAttribute('label', loot.languages[i].name);
settingsItem.textContent = loot.languages[i].name;
settingsLangSelect.appendChild(settingsItem);
var option = document.createElement('option');
+37 -13
View File
@@ -44,16 +44,40 @@
<paper-icon-button icon="menu"></paper-icon-button>
<paper-dropdown class="dropdown">
<core-menu>
<paper-item id="redatePluginsButton" icon="today" label="Redate Plugins"></paper-item>
<paper-item id="wipeUserlistButton" icon="delete" label="Clear All User Metadata"></paper-item>
<paper-item id="copyContentButton" icon="content-copy" label="Copy Content As Text"></paper-item>
<paper-item id="refreshContentButton" icon="cached" label="Refresh Content"></paper-item>
<paper-item id="redatePluginsButton">
<core-icon icon="today"></core-icon>
Redate Plugins
</paper-item>
<paper-item id="wipeUserlistButton">
<core-icon icon="delete"></core-icon>
Clear All User Metadata
</paper-item>
<paper-item id="copyContentButton">
<core-icon icon="content-copy"></core-icon>
Copy Content As Text
</paper-item>
<paper-item id="refreshContentButton">
<core-icon icon="cached"></core-icon>
Refresh Content
</paper-item>
<paper-item separator></paper-item>
<paper-item id="settingsButton" icon="settings" label="Settings"></paper-item>
<paper-item id="settingsButton">
<core-icon icon="settings"></core-icon>
Settings
</paper-item>
<paper-item separator></paper-item>
<paper-item id="helpButton" icon="book" label="View Documentation"></paper-item>
<paper-item id="openLogButton" icon="folder" label="Open Debug Log Location"></paper-item>
<paper-item id="aboutButton" icon="help" label="About"></paper-item>
<paper-item id="helpButton">
<core-icon icon="book"></core-icon>
View Documentation
</paper-item>
<paper-item id="openLogButton">
<core-icon icon="folder"></core-icon>
Open Debug Log Location
</paper-item>
<paper-item id="aboutButton">
<core-icon icon="help"></core-icon>
About
</paper-item>
</core-menu>
</paper-dropdown>
</paper-menu-button>
@@ -77,11 +101,11 @@
<paper-tab>Filters</paper-tab>
</paper-tabs>
<core-menu id="cardsNav" class="tab-content" flex>
<paper-item label="Summary">
<a href="#summary"></a>
<paper-item>
<a href="#summary">Summary</a>
</paper-item>
<paper-item label="General Messages">
<a href="#generalMessages"></a>
<paper-item>
<a href="#generalMessages">General Messages</a>
</paper-item>
<!-- Generated <loot-plugin-item> elements go here, containing # links to each plugin's section in the list. -->
</core-menu>
@@ -191,7 +215,7 @@ along with LOOT. If not, see &lt;http://www.gnu.org/licenses/&gt;.
<div center horizontal layout>
<div>Default Game</div>
<loot-dropdown-menu id="defaultGameSelect">
<paper-item value="auto" label="Autodetect"></paper-item>
<paper-item value="auto">Autodetect</paper-item>
<!-- Game <option> elements go here. -->
</loot-dropdown-menu>
</div>