From 6bdabd1ec6a28597bf85562c07a14d0ff85aa944 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 8 Nov 2014 11:29:14 +0000 Subject: [PATCH] Polymerised first-run and progress dialogs. I decided not to use paper-progress as it's less simple to animate. --- resources/report/css/style.css | 6 +---- resources/report/js/script.js | 42 ++++++++++++++++------------------ resources/report/report.html | 13 +++++------ 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/resources/report/css/style.css b/resources/report/css/style.css index 1ef57244..60bd7fd3 100644 --- a/resources/report/css/style.css +++ b/resources/report/css/style.css @@ -330,7 +330,7 @@ progress::-webkit-progress-value, .progress .value { background-color: green; -webkit-animation: indeterminate 2s linear 0 infinite alternate paused; } -#progressDialog[open] > .progress > .value { +.progress.running > .value { -webkit-animation-play-state: running; } @@ -343,10 +343,6 @@ progress::-webkit-progress-value, .progress .value { list-style-type: disc; padding-left: 40px; } -#firstRun > button { - display: block; - margin: 0 auto; -} #firstRun .tag { margin: 0; } diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 439733fa..9e64fb42 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -779,8 +779,9 @@ function sortUIElements(pluginNames) { } function openProgressDialog() { var progressDialog = document.getElementById('progressDialog'); - if (!progressDialog.open) { - progressDialog.showModal(); + if (!progressDialog.opened) { + progressDialog.opened = true; + progressDialog.querySelector('.progress').classList.toggle('running'); } } function updateProgressDialog(message) { @@ -789,8 +790,9 @@ function updateProgressDialog(message) { } function closeProgressDialog() { var progressDialog = document.getElementById('progressDialog'); - if (progressDialog.open) { - progressDialog.close(); + if (progressDialog.opened) { + progressDialog.opened = false; + progressDialog.querySelector('.progress').classList.toggle('running'); } } function sortPlugins(evt) { @@ -1176,9 +1178,6 @@ function focusSearch(evt) { document.getElementById('searchBox').focus(); } } -function closeFirstRunDialog(evt) { - evt.target.parentElement.close(); -} function handleUnappliedChangesClose() { showMessageDialog('Unapplied Sorting Changes', 'You have not yet applied or cancelled your sorted load order. Apply your load order before quitting?', function(result){ if (result) { @@ -1230,9 +1229,6 @@ function setupEventHandlers() { settings.getElementsByClassName('accept')[0].addEventListener('click', closeSettingsDialog, false); settings.getElementsByClassName('cancel')[0].addEventListener('click', closeSettingsDialog, false); - /* Set up event handler for closing the first-run dialog. */ - document.getElementById('firstRun').getElementsByTagName('button')[0].addEventListener('click', closeFirstRunDialog, false); - /* Set up event handler for hover text. */ var hoverTargets = document.querySelectorAll('[title]'); for (var i = 0; i < hoverTargets.length; ++i) { @@ -1379,7 +1375,7 @@ function initVars() { } if (!loot.settings.lastVersion || loot.settings.lastVersion != loot.version) { - document.getElementById('firstRun').showModal(); + document.getElementById('firstRun').opened = true; } }).catch(processCefError); @@ -1464,15 +1460,17 @@ function onFocus(evt) { require.config({ baseUrl: "js", }); -require(['marked', 'l10n', 'plugin'], function(markedResponse, l10nResponse) { - marked = markedResponse; - l10n = l10nResponse; - /* Make sure settings are what I want. */ - marked.setOptions({ - gfm: true, - tables: true, - sanitize: true +window.addEventListener('polymer-ready', function(e) { + require(['marked', 'l10n', 'plugin'], function(markedResponse, l10nResponse) { + marked = markedResponse; + l10n = l10nResponse; + /* Make sure settings are what I want. */ + marked.setOptions({ + gfm: true, + tables: true, + sanitize: true + }); + setupEventHandlers(); + initVars(); }); - setupEventHandlers(); - initVars(); -}); +}, false); \ No newline at end of file diff --git a/resources/report/report.html b/resources/report/report.html index 06d5bb75..b5a31991 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -247,7 +247,7 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>. - + @@ -255,10 +255,9 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>.

Calculating the last digit of π...

-
+ - -

First-Time Tips

+

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

  • As well as messages, LOOT displays plugin version numbers, CRCs and Bash Tag suggestions for addition and removal.
  • @@ -268,8 +267,8 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>.
  • Plugins can be drag and dropped from the sidebar into editors' load after, requirements and incompatibility tables.
  • Many interface elements have tooltips. If you don't know what something is, try hovering your mouse over it to find out.
-

See LOOT's documentation, accessed through the Help menu, for further details.

- -
+

See LOOT's documentation, accessed through the toolbar menu, for further details.

+ OK + \ No newline at end of file