From 326b7da03fd492855d4b12980bf2372e4dd618b4 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Fri, 26 Dec 2014 11:34:20 +0000 Subject: [PATCH] Combined summary and general messages cards. Removed their card item from the sidebar, and added a "Home" icon button to the top that navigates to their card. Also added a divider above the content filter to distinguish it from the tabbed content, and changed the refresh content icon. --- resources/report/css/style.css | 10 +++++----- resources/report/js/filters.js | 4 ++-- resources/report/js/l10n.js | 7 +------ resources/report/js/script.js | 14 +++++++------- resources/report/report.html | 33 ++++++++++++--------------------- 5 files changed, 27 insertions(+), 41 deletions(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 1e08cbc4..515b8aaa 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -133,6 +133,9 @@ core-toolbar, div[drawer] > div:first-child { color: white; height: 56px; } +core-toolbar > a { + color: white; +} #mainToolbar { box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); z-index: 1; @@ -140,9 +143,9 @@ core-toolbar, div[drawer] > div:first-child { #gameMenu { margin-top: -0.5em; } -#applySortButton, #cancelSortButton { +#drawerToggle, #applySortButton, #cancelSortButton { position: relative; - top: -4px; + top: -3px; } #applySortButton { color: #64B5F6; @@ -157,9 +160,6 @@ div[drawer] { div[drawer] > * { border-right: 1px rgba(0, 0, 0, 0.12) solid; } -#cardsNav { - overflow: auto; -} paper-item > a { -webkit-user-drag: none; color: inherit; diff --git a/resources/report/js/filters.js b/resources/report/js/filters.js index 67781288..a7018a07 100644 --- a/resources/report/js/filters.js +++ b/resources/report/js/filters.js @@ -154,7 +154,7 @@ function setFilteredUIData(evt) { getConflictingPluginsFromFilter().then(function(conflicts) { filters.conflicts = conflicts; var filtered = filters.applyPluginFilters(loot.game.plugins); - document.getElementById('cardsNav').lastElementChild.data = filtered; + document.getElementById('cardsNav').data = filtered; document.getElementById('main').lastElementChild.data = filtered; /* Also run message filters on the current card elements. */ @@ -163,4 +163,4 @@ function setFilteredUIData(evt) { cards[i].onMessagesChange(); // Calls Plugin.getUIMessages(), which calls filters.applyMessageFilters(). } }); -} \ No newline at end of file +} diff --git a/resources/report/js/l10n.js b/resources/report/js/l10n.js index 686593a3..c051e491 100644 --- a/resources/report/js/l10n.js +++ b/resources/report/js/l10n.js @@ -177,8 +177,6 @@ document.getElementById('cancelSortButton').textContent = l10n.translate("Cancel").fetch(); /* Nav items */ - document.getElementById('cardsNav').firstElementChild.firstElementChild.textContent = l10n.translate("Summary").fetch(); - document.getElementById('cardsNav').firstElementChild.nextElementSibling.firstElementChild.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 or click outside the input to set the filter.").fetch(); @@ -196,7 +194,7 @@ document.getElementById('hiddenMessagesTxt').textContent = l10n.translate("Hidden messages:").fetch(); /* Summary */ - document.getElementById('summary').firstElementChild.textContent = l10n.translate("Summary").fetch(); + document.getElementById('summary').firstElementChild.textContent = l10n.translate("Summary & General Messages").fetch(); document.getElementById('masterlistRevision').previousElementSibling.textContent = l10n.translate("Masterlist Revision").fetch(); document.getElementById('masterlistDate').previousElementSibling.textContent = l10n.translate("Masterlist Date").fetch(); document.getElementById('totalWarningNo').previousElementSibling.textContent = l10n.translate("Warnings").fetch(); @@ -206,9 +204,6 @@ document.getElementById('dirtyPluginNo').previousElementSibling.textContent = l10n.translate("Dirty Plugins").fetch(); document.getElementById('totalPluginNo').previousElementSibling.textContent = l10n.translate("Total Plugins").fetch(); - /* General messages */ - document.getElementById('generalMessages').firstElementChild.textContent = l10n.translate("General Messages").fetch(); - /* Settings dialog */ document.getElementById('settingsDialog').heading = l10n.translate("Settings").fetch(); diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 22e7d6ac..774777ee 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -237,7 +237,7 @@ var loot = { }); /* Remove old messages from UI. */ - var generalMessagesList = document.getElementById('generalMessages').getElementsByTagName('ul')[0]; + var generalMessagesList = document.getElementById('summary').getElementsByTagName('ul')[0]; while (generalMessagesList.firstElementChild) { generalMessagesList.removeChild(generalMessagesList.firstElementChild); } @@ -451,7 +451,7 @@ function changeGame(evt) { /* Clear the UI of all existing game-specific data. Also clear the card and li variables for each plugin object. */ - var globalMessages = document.getElementById('generalMessages').getElementsByTagName('ul')[0]; + var globalMessages = document.getElementById('summary').getElementsByTagName('ul')[0]; while (globalMessages.firstElementChild) { globalMessages.removeChild(globalMessages.firstElementChild); } @@ -465,7 +465,7 @@ function changeGame(evt) { loot.game.plugins = gameInfo.plugins; /* Reset virtual list positions. */ - document.getElementById('cardsNav').lastElementChild.scrollToItem(0); + document.getElementById('cardsNav').scrollToItem(0); document.getElementById('main').lastElementChild.scrollToItem(0); /* Now update virtual lists. */ @@ -711,7 +711,7 @@ function copyContent(evt) { }); } } else { - var message = document.getElementById('generalMessagesList').getElementsByTagName('ul')[0].firstElementChild; + var message = document.getElementById('summary').getElementsByTagName('ul')[0].firstElementChild; if (message) { messages.push({ type: 'error', @@ -1097,7 +1097,7 @@ function initVars() { loot.query('getInitErrors').then(JSON.parse).then(function(result){ if (result) { - var generalMessagesList = document.getElementById('generalMessages').getElementsByTagName('ul')[0]; + var generalMessagesList = document.getElementById('summary').getElementsByTagName('ul')[0]; result.forEach(function(message){ var li = document.createElement('li'); @@ -1174,11 +1174,11 @@ function initVars() { loot.game.masterlist = game.masterlist; loot.game.globalMessages = game.globalMessages; loot.game.plugins = game.plugins; - document.getElementById('cardsNav').lastElementChild.data = loot.game.plugins; + document.getElementById('cardsNav').data = loot.game.plugins; document.getElementById('main').lastElementChild.data = loot.game.plugins; setTimeout(function() { - document.getElementById('cardsNav').lastElementChild.updateSize(); + document.getElementById('cardsNav').updateSize(); closeProgressDialog(); }, 100); diff --git a/resources/report/report.html b/resources/report/report.html index 5b8695d8..beadfaad 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -51,22 +51,14 @@
- + + + +
@@ -86,6 +78,7 @@
+
@@ -94,6 +87,7 @@
+ @@ -123,7 +117,7 @@ Copy Content - + Refresh Content
@@ -155,7 +149,7 @@
-

Summary

+

Summary & General Messages

@@ -200,9 +194,6 @@
-
-
-

General Messages