From cdca6fd83d4d752347f9d96fa191ad25a458595c Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 12 Nov 2014 19:28:55 +0000 Subject: [PATCH 01/63] Started to update for Polymer 0.5.0. So much broken... I suspect that dropdown menus can't be in shadow DOM for the , and doesn't seem to work either for some reason. --- resources/report/bower.json | 26 +++++++------- resources/report/css/overrides.css | 8 +++-- resources/report/css/style.css | 14 +++----- resources/report/html/editable-table.html | 2 +- resources/report/html/loot-dialog.html | 13 +++---- resources/report/html/loot-dropdown-menu.html | 23 +++++++++--- resources/report/html/loot-plugin-card.html | 22 ++++++++---- resources/report/js/l10n.js | 2 +- resources/report/js/script.js | 35 +++++++++++-------- resources/report/report.html | 29 ++++++++------- 10 files changed, 100 insertions(+), 74 deletions(-) diff --git a/resources/report/bower.json b/resources/report/bower.json index ebcd74df..42792a13 100644 --- a/resources/report/bower.json +++ b/resources/report/bower.json @@ -13,19 +13,19 @@ "tests" ], "dependencies": { - "polymer": "Polymer/polymer#~0.4.2", - "paper-icon-button": "Polymer/paper-icon-button#~0.4.2", - "paper-dropdown-menu": "Polymer/paper-dropdown-menu#~0.4.2", - "core-toolbar": "Polymer/core-toolbar#~0.4.2", - "core-icons": "Polymer/core-icons#~0.4.2", - "core-tooltip": "Polymer/core-tooltip#~0.4.2", - "core-drawer-panel": "Polymer/core-drawer-panel#~0.4.2", - "paper-input": "Polymer/paper-input#~0.4.2", - "paper-tabs": "Polymer/paper-tabs#~0.4.2", - "core-menu": "Polymer/core-menu#~0.4.2", - "paper-checkbox": "Polymer/paper-checkbox#~0.4.2", - "paper-dialog": "Polymer/paper-dialog#~0.4.2", - "paper-menu-button": "Polymer/paper-menu-button#~0.4.2", + "polymer": "Polymer/polymer#~0.5.0", + "paper-icon-button": "Polymer/paper-icon-button#~0.5.0", + "paper-dropdown-menu": "Polymer/paper-dropdown-menu#~0.5.0", + "core-toolbar": "Polymer/core-toolbar#~0.5.0", + "core-icons": "Polymer/core-icons#~0.5.0", + "core-tooltip": "Polymer/core-tooltip#~0.5.0", + "core-drawer-panel": "Polymer/core-drawer-panel#~0.5.0", + "paper-input": "Polymer/paper-input#~0.5.0", + "paper-tabs": "Polymer/paper-tabs#~0.5.0", + "core-menu": "Polymer/core-menu#~0.5.0", + "paper-checkbox": "Polymer/paper-checkbox#~0.5.0", + "paper-dialog": "Polymer/paper-dialog#~0.5.0", + "paper-menu-button": "Polymer/paper-menu-button#~0.5.0", "Jed": "SlexAxton/Jed#a9d03e1bbca9211a8b29a93a298a7ee9ddb353f0", "marked": "chjj/marked#~0.3.2", "requirejs": "jrburke/requirejs-bower#~2.1.15" diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index 8bb282f9..fee7158f 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -12,10 +12,12 @@ } /* These overrides change the colour of the game menu's text and underline. */ -#gameMenu::shadow #control { - color: white; +#gameMenu { border-bottom-color: #f1f1f1; } +#gameMenu::shadow #label, #gameMenu::shadow #arrow { + color: white; +} #gameMenu::shadow #menu { color: black; } @@ -54,7 +56,7 @@ loot-plugin-item::shadow ::content > a { } /* This override change the positioning of the progress dialog to adapt to content changes. */ -#progressDialog { +html /deep/ paper-dialog#progressDialog { position: inherit !important; margin: 0 auto; top: 0; diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 203ff73c..fe2c50bd 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -38,21 +38,15 @@ noscript { } #mainToolbar { background: #4285f4; - /*font-size: 1em; - height: 3em;*/ - color: white; + color: white; +} +#mainToolbar paper-dropdown { + color: black; } -/*#mainToolbar > * { - top: -1em; -}*/ #gameMenu { background: inherit; } -#filtersToggle > span { - margin-right: 1em; -} - div[drawer] > core-tooltip { width: 100%; margin: 0 12px; diff --git a/resources/report/html/editable-table.html b/resources/report/html/editable-table.html index 04ce34d6..68649b89 100644 --- a/resources/report/html/editable-table.html +++ b/resources/report/html/editable-table.html @@ -182,7 +182,7 @@ td paper-icon-button.hidden { for (var j = 0; j < classMask.length; ++j) { if (inputs[i].classList.contains(classMask[j])) { if (inputs[i].tagName == 'PAPER-INPUT') { - inputs[i].readonly = readOnly; + inputs[i].disabled = readOnly; } else { inputs[i].readOnly = readOnly; } diff --git a/resources/report/html/loot-dialog.html b/resources/report/html/loot-dialog.html index 76abee47..641a1736 100644 --- a/resources/report/html/loot-dialog.html +++ b/resources/report/html/loot-dialog.html @@ -9,9 +9,9 @@ Still missing compared to are: --> - + - + diff --git a/resources/report/html/loot-dropdown-menu.html b/resources/report/html/loot-dropdown-menu.html index 5f3bad62..3c47e393 100644 --- a/resources/report/html/loot-dropdown-menu.html +++ b/resources/report/html/loot-dropdown-menu.html @@ -8,26 +8,39 @@ it a -like API. This means: - + From bfa52e155c1a68d4e6be664125d89a1c02f67df2 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 12 Nov 2014 20:33:19 +0000 Subject: [PATCH 03/63] Fixed . The issues seem to have been due to the layered attribute being true by default in Polymer 0.5.0. The layering complicates matters (it moves dialogs into shadow DOM), and I don't think I need it, so it's been disabled. I also removed the open property, as it conflicts with an existing function name. --- resources/report/html/loot-dialog.html | 17 +++++------------ resources/report/js/script.js | 4 ++-- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/resources/report/html/loot-dialog.html b/resources/report/html/loot-dialog.html index 641a1736..19dc5227 100644 --- a/resources/report/html/loot-dialog.html +++ b/resources/report/html/loot-dialog.html @@ -11,30 +11,23 @@ Still missing compared to are: - + diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 9848b014..24920f12 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -686,14 +686,14 @@ function showProgress(message) { if (message) { progressDialog.getElementsByTagName('h1')[0].textContent = message; } - if (!progressDialog.open) { + if (!progressDialog.opened) { progressDialog.showModal(); progressDialog.querySelector('.progress').classList.toggle('running'); } } function closeProgressDialog() { var progressDialog = document.getElementById('progressDialog'); - if (progressDialog.open) { + if (progressDialog.opened) { progressDialog.close(); progressDialog.querySelector('.progress').classList.toggle('running'); } From 1933f583d7341c4f11dc4df9f49f99adf1303e5f Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 12 Nov 2014 20:39:46 +0000 Subject: [PATCH 04/63] Fixed . It was missing a dependency, and being populated too late. Also changed an ID to a class to avoid possible conflict. --- resources/report/html/loot-message-dialog.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/report/html/loot-message-dialog.html b/resources/report/html/loot-message-dialog.html index 01e52b22..5e7c32e6 100644 --- a/resources/report/html/loot-message-dialog.html +++ b/resources/report/html/loot-message-dialog.html @@ -13,6 +13,7 @@ was pressed. --> + @@ -50,15 +51,15 @@ was pressed. showModal: function(title, text, closeCallback) { this.heading = title; - this.querySelector('#message').textContent = text; + this.querySelector('.message').textContent = text; this.closeCallback = closeCallback; this.super(); }, - ready: function() { + created: function() { var p = document.createElement('p'); - p.id = 'message'; + p.className = 'message'; this.appendChild(p); var accept = document.createElement('paper-button'); From 57ec6a1f1135a8681823d1e9b6e0314204b17ec8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 12 Nov 2014 20:49:14 +0000 Subject: [PATCH 05/63] Fixed translation script for HTML imports. --- resources/report/js/l10n.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/report/js/l10n.js b/resources/report/js/l10n.js index 9153c9f3..0aef32f1 100644 --- a/resources/report/js/l10n.js +++ b/resources/report/js/l10n.js @@ -139,7 +139,7 @@ /* Message row template */ var messageRow = document.querySelector('link[rel="import"][href$="editable-table.html"]'); if (messageRow) { - messageRow = messageRow.querySelector('#messageRow').content; + messageRow = messageRow.import.querySelector('#messageRow').content; } else { messageRow = document.querySelector('#messageRow').content; } @@ -150,7 +150,7 @@ /* Tag row template */ var tagRow = document.querySelector('link[rel="import"][href$="editable-table.html"]'); if (tagRow) { - tagRow = tagRow.querySelector('#tagRow').content; + tagRow = tagRow.import.querySelector('#tagRow').content; } else { tagRow = document.querySelector('#tagRow').content; } From 2625c14f922fdcbbab88142e4033284f032779b9 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 12 Nov 2014 21:01:29 +0000 Subject: [PATCH 06/63] More misc fixes. --- resources/report/css/overrides.css | 2 +- resources/report/html/loot-plugin-card.html | 6 +++--- resources/report/js/script.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index fe56e2e5..07ea90cf 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -18,7 +18,7 @@ #gameMenu::shadow > paper-dropdown-menu::shadow #label, #gameMenu::shadow > paper-dropdown-menu::shadow #arrow { color: white; } -#gameMenu::shadow > paper-dropdown-menu::shadow #menu { +#gameMenu { color: black; } diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index b9d05bee..2ff52c67 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -199,9 +199,9 @@ loot-clear-metadata - + - + @@ -512,7 +512,7 @@ loot-clear-metadata }, onShowEditor: function(evt) { - var card = evt.target.parentElement.parentElement.parentElement.parentNode.host; + var card = evt.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentNode.host; /* Fire an open event, so that the UI can enter edit mode. */ card.dispatchEvent(new CustomEvent('loot-editor-open', { diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 24920f12..aacbe53b 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -1458,6 +1458,6 @@ window.addEventListener('polymer-ready', function(e) { sanitize: true }); setupEventHandlers(); - //initVars(); + initVars(); }); }, false); \ No newline at end of file From 672ba6bd9dea0a4bb33449b81ce409a641c4776a Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 12 Nov 2014 21:24:51 +0000 Subject: [PATCH 07/63] Some attempts at speeding things up. Adding plugin cards and list items is **incredibly** slow, and it wasn't like this in Polymer 0.4.2. I'm not sure if I'm not doing something right... --- resources/report/bower.json | 3 ++- resources/report/css/style.css | 23 ++----------------- resources/report/js/plugin.js | 40 ++++++++++++++++------------------ resources/report/js/script.js | 19 +++++----------- resources/report/report.html | 10 +++------ 5 files changed, 32 insertions(+), 63 deletions(-) diff --git a/resources/report/bower.json b/resources/report/bower.json index 42792a13..e2837e5e 100644 --- a/resources/report/bower.json +++ b/resources/report/bower.json @@ -28,6 +28,7 @@ "paper-menu-button": "Polymer/paper-menu-button#~0.5.0", "Jed": "SlexAxton/Jed#a9d03e1bbca9211a8b29a93a298a7ee9ddb353f0", "marked": "chjj/marked#~0.3.2", - "requirejs": "jrburke/requirejs-bower#~2.1.15" + "requirejs": "jrburke/requirejs-bower#~2.1.15", + "paper-progress": "Polymer/paper-progress#~0.5.0" } } diff --git a/resources/report/css/style.css b/resources/report/css/style.css index fe2c50bd..80d83e8f 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -261,27 +261,8 @@ progress, .progress { display: block; margin: 0 auto; } -#progressDialog > h1 { - font-size: 1.5em; -} - -@-webkit-keyframes indeterminate { - 0% { width: 0% } - 100% { width: 100% } -} - -progress::-webkit-progress-bar, .progress.bar { - background-color: #eee; - border-radius: 2px; - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset; -} -progress::-webkit-progress-value, .progress .value { - height: 100%; - background-color: green; - -webkit-animation: indeterminate 2s linear 0 infinite alternate paused; -} -.progress.running > .value { - -webkit-animation-play-state: running; +#progressDialog > paper-progress { + width: 100%; } :host > span { diff --git a/resources/report/js/plugin.js b/resources/report/js/plugin.js index afc69798..dcb391bd 100644 --- a/resources/report/js/plugin.js +++ b/resources/report/js/plugin.js @@ -133,21 +133,20 @@ function Plugin(obj) { } Plugin.prototype.createCard = function() { - var card = document.createElement('loot-plugin-card'); - this.card = card; + this.card = document.createElement('loot-plugin-card'); - card.id = this.id; + this.card.id = this.id; - card.setAttribute('data-active', this.isActive); - card.setAttribute('data-dummy', this.isDummy); - card.setAttribute('data-bsa', this.loadsBSA); - card.setAttribute('data-edits', this.userlist != undefined); + this.card.setAttribute('data-active', this.isActive); + this.card.setAttribute('data-dummy', this.isDummy); + this.card.setAttribute('data-bsa', this.loadsBSA); + this.card.setAttribute('data-edits', this.userlist != undefined); /* Fill in name, version, CRC. */ - card.getElementsByTagName('h1')[0].textContent = this.name; - card.getElementsByClassName('version')[0].textContent = this.version; + this.card.getElementsByTagName('h1')[0].textContent = this.name; + this.card.getElementsByClassName('version')[0].textContent = this.version; if (this.crc != 0) { - card.getElementsByClassName('crc')[0].textContent = this.crc.toString(16).toUpperCase(); + this.card.getElementsByClassName('crc')[0].textContent = this.crc.toString(16).toUpperCase(); } /* Fill in Bash Tag suggestions. */ @@ -156,23 +155,22 @@ function Plugin(obj) { /* Fill in messages. */ this.updateCardMessages(); - document.getElementById('main').appendChild(card); + document.getElementById('main').appendChild(this.card); } Plugin.prototype.createListItem = function() { - var li = document.createElement('loot-plugin-item'); - this.li = li; + this.li = document.createElement('loot-plugin-item'); - li.label = this.name; - li.setLink('#' + this.id); - li.setPriority(this.getPriorityString()); + this.li.label = this.name; + this.li.setLink('#' + this.id); + this.li.setPriority(this.getPriorityString()); - li.setAttribute('data-dummy', this.isDummy); - li.setAttribute('data-bsa', this.loadsBSA); - li.setAttribute('data-edits', this.userlist != undefined); - li.setAttribute('data-global-priority', this.isGlobalPriority); + this.li.setAttribute('data-dummy', this.isDummy); + this.li.setAttribute('data-bsa', this.loadsBSA); + this.li.setAttribute('data-edits', this.userlist != undefined); + this.li.setAttribute('data-global-priority', this.isGlobalPriority); - document.getElementById('cardsNav').appendChild(li); + document.getElementById('cardsNav').appendChild(this.li); } Plugin.prototype.observer = function(changes) { diff --git a/resources/report/js/script.js b/resources/report/js/script.js index aacbe53b..76c4ef0c 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -684,18 +684,16 @@ function sortUIElements(pluginNames) { function showProgress(message) { var progressDialog = document.getElementById('progressDialog'); if (message) { - progressDialog.getElementsByTagName('h1')[0].textContent = message; + progressDialog.getElementsByTagName('p')[0].textContent = message; } if (!progressDialog.opened) { progressDialog.showModal(); - progressDialog.querySelector('.progress').classList.toggle('running'); } } function closeProgressDialog() { var progressDialog = document.getElementById('progressDialog'); if (progressDialog.opened) { progressDialog.close(); - progressDialog.querySelector('.progress').classList.toggle('running'); } } function sortPlugins(evt) { @@ -1340,16 +1338,11 @@ function initVars() { }); } else { promise = loot.query('getGameData').then(function(result){ - try { - var game = JSON.parse(result, jsonToPlugin); - loot.game.folder = game.folder; - loot.game.masterlist = game.masterlist; - loot.game.globalMessages = game.globalMessages; - loot.game.plugins = game.plugins; - } catch (e) { - console.log(e); - console.log('getGameData response: ' + result); - } + var game = JSON.parse(result, jsonToPlugin); + loot.game.folder = game.folder; + loot.game.masterlist = game.masterlist; + loot.game.globalMessages = game.globalMessages; + loot.game.plugins = game.plugins; applySavedFilters(); closeProgressDialog(); diff --git a/resources/report/report.html b/resources/report/report.html index 46e2c45c..830db5a2 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -33,6 +33,7 @@ + @@ -234,13 +235,8 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>. - -
-
-
-

Calculating the last digit of π...

+ +

Calculating the last digit of π...

From b3f1457eb4aea64e89be4e03d90eec8e47b6fcf8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 01:08:29 +0000 Subject: [PATCH 08/63] Updated for Polymer 0.5.1. Which removed the label and icon attributes from paper-item elements. --- resources/report/css/style.css | 6 ++- resources/report/html/loot-plugin-card.html | 15 ++++-- resources/report/html/loot-plugin-item.html | 60 ++++++--------------- resources/report/js/l10n.js | 28 +++++----- resources/report/js/plugin.js | 3 +- resources/report/js/script.js | 6 +-- resources/report/report.html | 50 ++++++++++++----- 7 files changed, 87 insertions(+), 81 deletions(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 80d83e8f..74ef7b40 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -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; diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 2ff52c67..9f008cd5 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -206,9 +206,18 @@ loot-clear-metadata - - - + + + Edit Metadata + + + + Copy Metadata As Text + + + + Clear User Metadata +
diff --git a/resources/report/html/loot-plugin-item.html b/resources/report/html/loot-plugin-item.html index 5a0f4258..c537b9c3 100644 --- a/resources/report/html/loot-plugin-item.html +++ b/resources/report/html/loot-plugin-item.html @@ -4,7 +4,7 @@ - + diff --git a/resources/report/js/l10n.js b/resources/report/js/l10n.js index 0aef32f1..0da9cf20 100644 --- a/resources/report/js/l10n.js +++ b/resources/report/js/l10n.js @@ -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(); diff --git a/resources/report/js/plugin.js b/resources/report/js/plugin.js index dcb391bd..2c57d175 100644 --- a/resources/report/js/plugin.js +++ b/resources/report/js/plugin.js @@ -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); diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 76c4ef0c..b564dbb7 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -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'); diff --git a/resources/report/report.html b/resources/report/report.html index 830db5a2..302ac78d 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -44,16 +44,40 @@ - - - - + + + Redate Plugins + + + + Clear All User Metadata + + + + Copy Content As Text + + + + Refresh Content + - + + + Settings + - - - + + + View Documentation + + + + Open Debug Log Location + + + + About +
@@ -77,11 +101,11 @@ Filters - - + + Summary - - + + General Messages @@ -191,7 +215,7 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>.
Default Game
- + Autodetect
From 1841ee89f07fc0207feb3c7bc6e012df05ba56c8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 03:46:31 +0000 Subject: [PATCH 09/63] Fixed editor toolbars not being initialised correctly. --- resources/report/html/loot-plugin-card.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 9f008cd5..7d40e03e 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -397,14 +397,6 @@ loot-clear-metadata this.shadowRoot.getElementById('clearMetadata').addEventListener('click', this.onClearMetadata, false); }, - ready: function() { - var editor = this.shadowRoot.getElementById('editor'); - - editor.querySelector('h1').textContent = this.querySelector('h1').textContent; - editor.querySelector('.version').textContent = this.querySelector('.version').textContent; - editor.querySelector('.crc').textContent = this.querySelector('.crc').textContent; - }, - getName: function() { return this.getElementsByTagName('h1')[0].textContent; }, @@ -523,6 +515,12 @@ loot-clear-metadata onShowEditor: function(evt) { var card = evt.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentNode.host; + /* Fill in editor toolbar. */ + var editor = card.shadowRoot.getElementById('editor'); + editor.querySelector('h1').textContent = card.querySelector('h1').textContent; + editor.querySelector('.version').textContent = card.querySelector('.version').textContent; + editor.querySelector('.crc').textContent = card.querySelector('.crc').textContent; + /* Fire an open event, so that the UI can enter edit mode. */ card.dispatchEvent(new CustomEvent('loot-editor-open', { bubbles: true, From 198b310f4b4b4d55b2e9c8de1fb78da9a1bf799d Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 03:52:05 +0000 Subject: [PATCH 10/63] Fixed menu icon spacing. --- resources/report/css/style.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 74ef7b40..b6253942 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -110,7 +110,9 @@ dialog[data-type=warn] > span:first-child { dialog button { margin: 0.5em; } - +paper-item > core-icon { + margin-right: 0.5em; +} From 411610ea200030e902875f28ef16fce6823af131 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 03:52:23 +0000 Subject: [PATCH 11/63] Removed plugin card menu hack. --- resources/report/html/loot-plugin-card.html | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 7d40e03e..2fbc113e 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -173,14 +173,6 @@ loot-clear-metadata #editor > div { padding: 1em; } - paper-menu-button paper-item:first-child { - padding: 0; - } - #showOnlyConflicts { - height: 48px; - line-height: 48px; - padding: 0 16px; - }
@@ -507,11 +499,6 @@ loot-clear-metadata } }, - onTransitionEnd: function(evt) { - evt.target.removeEventListener('transitionend', evt.target.onTransitionEnd, false); - evt.target.shadowRoot.getElementById('editMetadata').parentElement.shadowRoot.getElementById('dropdown').style.display = 'none'; - }, - onShowEditor: function(evt) { var card = evt.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentNode.host; @@ -526,10 +513,6 @@ loot-clear-metadata bubbles: true, })); - /* There's a bug where the hiding of the front panel interferes somehow with the - menu getting hidden, so do that manually once the transition ends. */ - card.addEventListener('transitionend', card.onTransitionEnd, false); - /* Now show editor. */ card.classList.toggle('flip'); }, From 9bf755f931ebdbe59c645b217fea646738f55624 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 04:00:43 +0000 Subject: [PATCH 12/63] Implemented scrollable tabs in plugin editor. --- resources/report/html/loot-plugin-card.html | 24 ++++++++------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 2fbc113e..5b62eed5 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -242,11 +242,15 @@ loot-clear-metadata
Priority Value
-
- +
+ Load After Requirements Incompatibilities + Messages + Bash Tags + Dirty Info + Locations @@ -275,15 +279,7 @@ loot-clear-metadata
Add new row...
-
-
- - Messages - Bash Tags - Dirty Info - Locations - - +
@@ -351,8 +347,7 @@ loot-clear-metadata }, attached: function() { - this.shadowRoot.getElementById('fileTabs').firstElementChild.addEventListener('core-select', this.onShowEditorTable, false); - this.shadowRoot.getElementById('miscTabs').firstElementChild.addEventListener('core-select', this.onShowEditorTable, false); + this.shadowRoot.getElementById('tableTabs').firstElementChild.addEventListener('core-select', this.onShowEditorTable, false); this.shadowRoot.getElementById('accept').addEventListener('click', this.onHideEditor, false); this.shadowRoot.getElementById('cancel').addEventListener('click', this.onHideEditor, false); @@ -377,8 +372,7 @@ loot-clear-metadata }, detached: function() { - this.shadowRoot.getElementById('fileTabs').firstElementChild.removeEventListener('core-select', this.onShowEditorTable, false); - this.shadowRoot.getElementById('miscTabs').firstElementChild.removeEventListener('core-select', this.onShowEditorTable, false); + this.shadowRoot.getElementById('tableTabs').firstElementChild.removeEventListener('core-select', this.onShowEditorTable, false); this.shadowRoot.getElementById('accept').removeEventListener('click', this.onHideEditor, false); this.shadowRoot.getElementById('cancel').removeEventListener('click', this.onHideEditor, false); From 9a247d0cf858b92d418d6e59c727f4cff479288e Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 04:58:28 +0000 Subject: [PATCH 13/63] Implemented animated tab page changes. The tab pages in the editor are zero-height though, I couldn't figure out how to solve that, so I'll just go back to it later. The Polymer elements are in, and that's what matters at this stage. --- resources/report/bower.json | 3 +- resources/report/css/overrides.css | 5 + resources/report/html/loot-plugin-card.html | 139 ++++++++++---------- resources/report/js/script.js | 4 +- resources/report/report.html | 58 ++++---- 5 files changed, 107 insertions(+), 102 deletions(-) diff --git a/resources/report/bower.json b/resources/report/bower.json index e2837e5e..35893e89 100644 --- a/resources/report/bower.json +++ b/resources/report/bower.json @@ -29,6 +29,7 @@ "Jed": "SlexAxton/Jed#a9d03e1bbca9211a8b29a93a298a7ee9ddb353f0", "marked": "chjj/marked#~0.3.2", "requirejs": "jrburke/requirejs-bower#~2.1.15", - "paper-progress": "Polymer/paper-progress#~0.5.0" + "paper-progress": "Polymer/paper-progress#~0.5.0", + "core-animated-pages": "Polymer/core-animated-pages#~0.5.1" } } diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index 07ea90cf..68c6815a 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -63,4 +63,9 @@ html /deep/ paper-dialog#progressDialog { left: 0; bottom: 0; right: 0; +} + +/* This stops transitions from overflowing onto other elements. */ +html /deep/ core-animated-pages { + overflow: hidden; } \ No newline at end of file diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 5b62eed5..645e1383 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -29,6 +29,8 @@ loot-clear-metadata + + @@ -252,69 +254,71 @@ loot-clear-metadata Dirty Info Locations - - - - - - - - -
FilenameDisplay NameCondition
Add new row...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + +
FilenameDisplay NameCondition
Add new row...
+ + + + + + + + +
FilenameDisplay NameCondition
Add new row...
+ + + + + + + + +
FilenameDisplay NameCondition
Add new row...
+ + + + + + + + +
TypeContentConditionLanguage
Add new row...
+ + + + + + + + +
Add/RemoveBash TagCondition
Add new row...
+ + + + + + + + +
CRCITM CountDeleted ReferencesDeleted NavmeshesCleaning Utility
Add new row...
+ + + + + + + + +
URLVersion
Add new row...
+
Apply @@ -388,14 +392,7 @@ loot-clear-metadata }, onShowEditorTable: function(evt) { - var tables = evt.target.parentElement.getElementsByTagName('table'); - for (var i = 0; i < tables.length; ++i) { - if (tables[i].id != evt.target.selected) { - tables[i].classList.toggle('hidden', true); - } else { - tables[i].classList.toggle('hidden', false); - } - } + evt.target.nextElementSibling.selected = evt.target.selected; }, readFromEditor: function(oldData) { diff --git a/resources/report/js/script.js b/resources/report/js/script.js index b564dbb7..1f197952 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -919,9 +919,7 @@ function openMenu(evt) { } } function switchSidebarTab(evt) { - var isFirstSelected = evt.target.selected == 0; - evt.target.nextElementSibling.classList.toggle('hidden', !isFirstSelected); - evt.target.nextElementSibling.nextElementSibling.classList.toggle('hidden', isFirstSelected); + evt.target.nextElementSibling.selected = evt.target.selected; } function showAboutDialog(evt) { diff --git a/resources/report/report.html b/resources/report/report.html index 302ac78d..7f394d26 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -21,6 +21,8 @@ + + @@ -100,33 +102,35 @@ Plugins Filters - - - Summary - - - General Messages - - - - + + + + Summary + + + General Messages + + + + + + + + + + + + +
+
Hidden plugins:
+
0 / 0
+
+
+
Hidden messages:
+
0 / 0
+
+
+
From 2dcc1fdedcd0145993d698aa66164944d346608c Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 05:06:59 +0000 Subject: [PATCH 14/63] Added header overlay back in. For disabling the toolbar use during editing. --- resources/report/css/style.css | 10 +++++----- resources/report/report.html | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index b6253942..6b7727e5 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -220,16 +220,16 @@ td input { text-overflow: ellipsis; } -body.editMode header { - color: #999; +.editMode core-toolbar { + opacity: 0.7 } -body.editMode header #headerOverlay { +.editMode #headerOverlay { z-index: 3; - width: 100%; - height: 100%; position: absolute; top: 0; left: 0; + bottom: 0; + right: 0; } [draggable] { -webkit-user-select: none; diff --git a/resources/report/report.html b/resources/report/report.html index 7f394d26..dea9527f 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -42,6 +42,7 @@ +
From e96124c72ecaa57e265fcb7af99994f99362eae3 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 05:40:06 +0000 Subject: [PATCH 15/63] Added toasts for feedback, removed dead function. --- resources/report/bower.json | 3 ++- resources/report/js/script.js | 39 ++++++++++++++++++----------------- resources/report/report.html | 12 +++++------ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/resources/report/bower.json b/resources/report/bower.json index 35893e89..4775b0a0 100644 --- a/resources/report/bower.json +++ b/resources/report/bower.json @@ -30,6 +30,7 @@ "marked": "chjj/marked#~0.3.2", "requirejs": "jrburke/requirejs-bower#~2.1.15", "paper-progress": "Polymer/paper-progress#~0.5.0", - "core-animated-pages": "Polymer/core-animated-pages#~0.5.1" + "core-animated-pages": "Polymer/core-animated-pages#~0.5.1", + "paper-toast": "Polymer/paper-toast#~0.5.1" } } diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 1f197952..f8ae7790 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -808,7 +808,9 @@ function redatePlugins(evt) { showMessageDialog('Redate Plugins', 'This feature is provided so that modders using the Creation Kit may set the load order it uses. A side-effect is that any subscribed Steam Workshop mods will be re-downloaded by Steam. Do you wish to continue?', false, function(result){ if (result) { loot.query('redatePlugins').then(function(response){ - showMessageBox('Redate Plugins', 'Plugins were successfully redated.'); + var toast = document.getElementById('toast'); + toast.text = 'Plugins were successfully redated.'; + toast.show(); }).catch(processCefError); } }); @@ -834,6 +836,10 @@ function clearAllMetadata(evt) { } } }); + + var toast = document.getElementById('toast'); + toast.text = 'All user-added metadata has been cleared.'; + toast.show(); } }).catch(processCefError); } @@ -889,7 +895,11 @@ function copyContent(evt) { }] }); - loot.query(request).catch(processCefError); + loot.query(request).then(function(){ + var toast = document.getElementById('toast'); + toast.text = "LOOT's content has been copied to the clipboard."; + toast.show(); + }).catch(processCefError); } function areSettingsValid() { /* Validate inputs individually. */ @@ -902,22 +912,6 @@ function areSettingsValid() { } return true; } -function openMenu(evt) { - if (!isVisible(evt.currentTarget.firstElementChild)) { - showElement(evt.currentTarget.firstElementChild) - - /* To prevent the click event closing this menu just after it was - opened, stop the current event and send off a new one. */ - evt.stopPropagation(); - - document.body.dispatchEvent(new CustomEvent('click', { - bubbles: true, - detail: { - newMenu: evt.currentTarget.firstElementChild - } - })); - } -} function switchSidebarTab(evt) { evt.target.nextElementSibling.selected = evt.target.selected; } @@ -1124,7 +1118,11 @@ function handleCopyMetadata(evt) { ] }); - loot.query(request).catch(processCefError); + loot.query(request).then(function(){ + var toast = document.getElementById('toast'); + toast.text = 'The metadata for ' + evt.target.getName() + ' has been copied to the clipboard.'; + toast.show(); + }).catch(processCefError); } function handleClearMetadata(evt) { showMessageDialog('Clear Plugin Metadata', 'Are you sure you want to clear all existing user-added metadata from "' + evt.target.getName() + '"?', false, function(result){ @@ -1155,6 +1153,9 @@ function handleClearMetadata(evt) { break; } } + var toast = document.getElementById('toast'); + toast.text = 'The user-added metadata for ' + evt.target.getName() + ' has been cleared.'; + toast.show(); } }).catch(processCefError); } diff --git a/resources/report/report.html b/resources/report/report.html index dea9527f..2f5fc4ec 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -36,6 +36,7 @@ + @@ -193,6 +194,11 @@
+ + + +

Calculating the last digit of π...

+

Version (build )

@@ -262,12 +268,6 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>. Cancel
- - - -

Calculating the last digit of π...

-
-

This appears to be the first time you have run LOOT v. Here are some tips to help you get started with the interface.

    From 62f67ae8aa8b1d9c55575a6837c9fd2d724fd397 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 05:40:47 +0000 Subject: [PATCH 16/63] The last selected menu item shouldn't stand out. --- resources/report/css/overrides.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index 68c6815a..9b54d5b0 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -68,4 +68,10 @@ html /deep/ paper-dialog#progressDialog { /* This stops transitions from overflowing onto other elements. */ html /deep/ core-animated-pages { overflow: hidden; +} + +/* This stops menus keeping the last item clicked highlighted. */ + +paper-item.core-selected { + background: white; } \ No newline at end of file From e37059ebc423fbd4cf6798553c97ea7f861675c1 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 05:49:11 +0000 Subject: [PATCH 17/63] Removed some unnecessary CSS overrides. There's an attribute for that. --- resources/report/css/overrides.css | 11 ----------- resources/report/report.html | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index 9b54d5b0..e9f2052f 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -1,16 +1,5 @@ /* These styles override Polymer's own internal styling for certain elements. */ -/* The following 3 rules are for setting the sizes of the drawer and panel. */ -#container::shadow #main { - left: 33% !important; -} -#container::shadow .narrow-layout #main { - left: 0 !important; -} -#container::shadow #drawer { - width: 33% !important; -} - /* These overrides change the colour of the game menu's text and underline. */ #gameMenu::shadow > paper-dropdown-menu { border-bottom-color: #f1f1f1; diff --git a/resources/report/report.html b/resources/report/report.html index 2f5fc4ec..cf0fcf91 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -98,7 +98,7 @@ - +
    Plugins From a349f0ea9930ee20852d864c45b602f62a4bfda0 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 06:18:09 +0000 Subject: [PATCH 18/63] Implemented narrow mode drawer button. However, the z-index values of the cards make them appear on top. --- resources/report/css/overrides.css | 7 ++++- resources/report/css/style.css | 43 +++++++++++------------------- resources/report/js/script.js | 5 ++++ resources/report/report.html | 1 + 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index e9f2052f..e9b7c79f 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -1,5 +1,11 @@ /* These styles override Polymer's own internal styling for certain elements. */ +/* The following is for setting the size of the drawer in narrow mode. */ +#container::shadow .narrow-layout #drawer { + width: 50% !important; + background: white; +} + /* These overrides change the colour of the game menu's text and underline. */ #gameMenu::shadow > paper-dropdown-menu { border-bottom-color: #f1f1f1; @@ -60,7 +66,6 @@ html /deep/ core-animated-pages { } /* This stops menus keeping the last item clicked highlighted. */ - paper-item.core-selected { background: white; } \ No newline at end of file diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 6b7727e5..c34ccbd4 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -206,10 +206,6 @@ li.warn{ paper-checkbox { padding: 0.5em 1em; } -loot-dropdown-menu { - padding-left: 2em; - top: -0.25em; -} input[readonly] { border: none; @@ -252,34 +248,27 @@ input:valid { background-color: white; color: black; } -#hoverText { - position: fixed; - z-index: 5; - background: white; - box-shadow:0 0 3px 0px rgba(0,0,0,0.5); - padding: 2px 5px; -} -progress, .progress { - /* Reset the default appearance */ - -webkit-appearance: none; - width: 250px; - height: 20px; - display: block; - margin: 0 auto; -} -#progressDialog > paper-progress { +paper-progress { width: 100%; } - -:host > span { - display: inline-block; - width: 1.2em; -} - #firstRun > ul { list-style-type: disc; padding-left: 40px; } #firstRun .tag { margin: 0; -} \ No newline at end of file +} + + +/* This animates the drawer toggle appearing in narrow view. */ +#drawerToggle { + opacity: 0; + visibility: hidden; + transition: opacity 0.5s; +} +@media screen and (max-width: 640px) { + #drawerToggle { + opacity: 1; + visibility: visible; + } +} diff --git a/resources/report/js/script.js b/resources/report/js/script.js index f8ae7790..dcc290e6 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -1161,6 +1161,9 @@ function handleClearMetadata(evt) { } }); } +function toggleDrawer(evt) { + document.getElementById('container').togglePanel(); +} function setupEventHandlers() { var elements; /*Set up filter value and CSS setting storage read/write handlers.*/ @@ -1211,6 +1214,8 @@ function setupEventHandlers() { document.body.addEventListener('loot-editor-close', handleEditorClose, false); document.body.addEventListener('loot-copy-metadata', handleCopyMetadata, false); document.body.addEventListener('loot-clear-metadata', handleClearMetadata, false); + + document.getElementById('drawerToggle').addEventListener('click', toggleDrawer, false); } function initVars() { loot.query('getVersion').then(function(result){ diff --git a/resources/report/report.html b/resources/report/report.html index cf0fcf91..1dc332df 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -85,6 +85,7 @@ + From 371a3fc24c4e4f9f332278291ba8881e5b2a9f22 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 06:21:37 +0000 Subject: [PATCH 19/63] Fixed progress bar layout change. Happened when updating to Polymer 0.5. --- resources/report/css/overrides.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/report/css/overrides.css b/resources/report/css/overrides.css index e9b7c79f..5887224e 100644 --- a/resources/report/css/overrides.css +++ b/resources/report/css/overrides.css @@ -51,7 +51,7 @@ loot-plugin-item::shadow ::content > a { } /* This override change the positioning of the progress dialog to adapt to content changes. */ -html /deep/ paper-dialog#progressDialog { +#progressDialog { position: inherit !important; margin: 0 auto; top: 0; From 8aab542cf713572337834bb64cfc0e126439c4c8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 11:02:30 +0000 Subject: [PATCH 20/63] Fixed search crash. --- resources/report/js/script.js | 2 +- resources/report/report.html | 5 ++++- src/gui/handler.cpp | 10 ++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/resources/report/js/script.js b/resources/report/js/script.js index dcc290e6..f6fdc158 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -992,7 +992,7 @@ function startSearch(evt) { var request = JSON.stringify({ name: 'find', args: [ - evt.target.inputValue, + evt.target.value, findNext ] }); diff --git a/resources/report/report.html b/resources/report/report.html index 1dc332df..285133b3 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -30,6 +30,7 @@ + @@ -135,7 +136,9 @@ - + + +
    diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index b49c22dd..7bf9e033 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -198,8 +198,14 @@ namespace loot { if (requestName == "find") { // Has one arg, which is the search string. - Find(browser, request["args"][0].as(), request["args"][1].as()); - callback->Success(""); + try { + Find(browser, request["args"][0].as(), request["args"][1].as()); + callback->Success(""); + } + catch (std::exception& e) { + BOOST_LOG_TRIVIAL(error) << "Failed to perform search. Details: " << e.what(); + callback->Failure(-1, string("Failed to perform search. Details: ") + e.what()); + } return true; } else if (requestName == "changeGame") { From f9ed7a08818fc88cc65314c7f68e7b72e5f49a2e Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 11:19:47 +0000 Subject: [PATCH 21/63] Fixed priority input broken with Polymer 0.5.1. --- resources/report/html/loot-plugin-card.html | 5 ++++- resources/report/js/l10n.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/report/html/loot-plugin-card.html b/resources/report/html/loot-plugin-card.html index 645e1383..76faaf6e 100644 --- a/resources/report/html/loot-plugin-card.html +++ b/resources/report/html/loot-plugin-card.html @@ -25,6 +25,7 @@ loot-clear-metadata + @@ -242,7 +243,9 @@ loot-clear-metadata
    Priority Value
    - + + +
    diff --git a/resources/report/js/l10n.js b/resources/report/js/l10n.js index 0da9cf20..73ef8a43 100644 --- a/resources/report/js/l10n.js +++ b/resources/report/js/l10n.js @@ -69,7 +69,7 @@ pluginCard.getElementById('enableEdits').label = l10n.translate("Enable Edits").fetch(); pluginCard.getElementById('globalPriority').parentElement.label = l10n.translate("Global priorities are compared against all other plugins. Normal priorities are compared against only conflicting plugins.").fetch(); pluginCard.getElementById('globalPriority').label = l10n.translate("Global Priority").fetch(); - pluginCard.getElementById('priorityValue').previousElementSibling.textContent = l10n.translate("Priority Value").fetch(); + pluginCard.getElementById('priorityValue').parentElement.previousElementSibling.textContent = l10n.translate("Priority Value").fetch(); pluginCard.getElementById('fileTabs').querySelector('[data-for=loadAfter]').textContent = l10n.translate("Load After").fetch(); pluginCard.getElementById('fileTabs').querySelector('[data-for=req]').textContent = l10n.translate("Requirements").fetch(); From cfb05a3a56b6cd1f7e63f92261417108a83fbad4 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 11:25:49 +0000 Subject: [PATCH 22/63] Fixed search placeholder text. --- resources/report/report.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/report/report.html b/resources/report/report.html index 285133b3..49092289 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -136,7 +136,7 @@ - + From 0bbccb61ceba453ab26120db268fd8d65f096f9f Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 11:25:56 +0000 Subject: [PATCH 23/63] Removed dead CSS. --- resources/report/css/style.css | 39 ---------------------------------- 1 file changed, 39 deletions(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index c34ccbd4..ab3a50f1 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -30,12 +30,6 @@ body { background:#f8f8f8; height: 100%; } -noscript { - background:#c00; - display:block; - padding:10px 5px; - color:white; -} #mainToolbar { background: #4285f4; color: white; @@ -43,17 +37,10 @@ noscript { #mainToolbar paper-dropdown { color: black; } -#gameMenu { - background: inherit; -} div[drawer] > core-tooltip { - width: 100%; margin: 0 12px; } -#searchBox { - width: calc(100% - 24px); -} #main { overflow: auto; position: relative; @@ -89,27 +76,6 @@ section { box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 4px, rgba(0, 0, 0, 0.0980392) 0px 0px 3px; } -dialog { - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 6px; - box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); - overflow:hidden; - padding: 2em; - top: 3em; - max-width: 40em; - max-height: calc(100% - 8em); - overflow: auto; -} -dialog > h1 { - font-weight: normal; - text-align: center; -} -dialog[data-type=warn] > span:first-child { - color: gold; -} -dialog button { - margin: 0.5em; -} paper-item > core-icon { margin-right: 0.5em; } @@ -153,11 +119,6 @@ section h1 { text-align:left; padding-left:0; } -input[type='checkbox'] { - position:relative; - top:0.15em; - margin-left:0.5em; -} ul { margin-top:0.5em; margin-bottom:0; From 9d674c3940bd435f08687b01f451e70cddb73b00 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 12:04:53 +0000 Subject: [PATCH 24/63] Fixed inline checkboxes in settings. --- resources/report/css/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index ab3a50f1..c08f92c9 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -233,3 +233,6 @@ paper-progress { visibility: visible; } } +#settingsDialog > paper-checkbox { + display: block; +} \ No newline at end of file From e2ea71d51ef8e7a336addc441539892e8c5c979b Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 13 Nov 2014 12:05:11 +0000 Subject: [PATCH 25/63] Dropdown menus can now be disabled. --- resources/report/html/loot-dropdown-menu.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/report/html/loot-dropdown-menu.html b/resources/report/html/loot-dropdown-menu.html index 7485f230..df5395b7 100644 --- a/resources/report/html/loot-dropdown-menu.html +++ b/resources/report/html/loot-dropdown-menu.html @@ -14,7 +14,7 @@ it a