Removed location ver key, added name key.

Closes #457.
This commit is contained in:
Oliver Hamlet
2015-07-14 19:28:09 +01:00
parent f5204d3e0d
commit 0dcf2e99fd
7 changed files with 43 additions and 76 deletions
+1 -1
View File
@@ -77,7 +77,7 @@
<template id="locationRow">
<tr>
<td><loot-validated-input error="A link is required." class="link" required></loot-validated-input></td>
<td><paper-input class="ver"></paper-input></td>
<td><paper-input class="name"></paper-input></td>
<td>
<core-tooltip label="Delete Row" noarrow position="left">
<paper-icon-button class="delete" icon="delete"></paper-icon-button>
+3 -21
View File
@@ -238,7 +238,7 @@ loot-editor-close
<div id="locations">
<table is="editable-table" data-template="locationRow">
<thead>
<tr><th>URL</th><th>Version</th><th></th></tr>
<tr><th>URL</th><th>Name</th><th></th></tr>
</thead>
<tbody>
<!-- Location rows go here. -->
@@ -360,16 +360,6 @@ loot-editor-close
});
plugin.userlist.dirty = rowsData;
} else if (tables[j].parentElement.id == 'locations') {
rowsData.forEach(function(value, index, arr){
/* User metadata can only specify one version, but it should be a list. */
if (value.ver.length > 0) {
arr[index].ver = [
value.ver
];
} else {
delete arr[index].ver;
}
});
plugin.userlist.url = rowsData;
}
}
@@ -539,21 +529,13 @@ loot-editor-close
if (newData.masterlist && newData.masterlist.url) {
newData.masterlist.url.forEach(function(location) {
var temp = location;
if (temp.ver) {
temp.ver = temp.ver[0];
}
var row = tables[j].addRow(temp);
var row = tables[j].addRow(location);
tables[j].setReadOnly(row);
});
}
if (tempData.userlist && tempData.userlist.url) {
tempData.userlist.url.forEach(function(location) {
var temp = location;
if (temp.ver) {
temp.ver = temp.ver[0];
}
tables[j].addRow(temp);
tables[j].addRow(location);
});
}
}
+1 -1
View File
@@ -124,7 +124,7 @@
pluginEditor.getElementById('dirty').querySelector('th:nth-child(5)').textContent = l10n.translate("Cleaning Utility").fetch();
pluginEditor.getElementById('locations').querySelector('th:first-child').textContent = l10n.translate("URL").fetch();
pluginEditor.getElementById('locations').querySelector('th:nth-child(2)').textContent = l10n.translate("Version").fetch();
pluginEditor.getElementById('locations').querySelector('th:nth-child(2)').textContent = l10n.translate("Name").fetch();
pluginEditor.getElementById('accept').parentElement.setAttribute('label', l10n.translate("Apply").fetch());
pluginEditor.getElementById('cancel').parentElement.setAttribute('label', l10n.translate("Cancel").fetch());