Added progress dialog.

Early days yet, and for some reason CEF refuses to play the progress
animation if I override the styling. Part of #246.
This commit is contained in:
WrinklyNinja
2014-08-26 22:41:17 +01:00
parent 81da6c4d0b
commit e1a186b8ac
3 changed files with 40 additions and 0 deletions
+21
View File
@@ -419,3 +419,24 @@ input:valid {
box-shadow:0 0 3px 0px rgba(0,0,0,0.5);
padding: 2px 5px;
}
progress {
/* Reset the default appearance */
-webkit-appearance: none;
width: 250px;
height: 20px;
display: block;
}
@-webkit-keyframes indeterminate {
0% { width: 0% }
100% { width: 100% }
}
progress::-webkit-progress-bar {
background-color: #eee;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
progress::-webkit-progress-value {
-webkit-animation: indeterminate 5s linear 0 infinite alternate;
}
+15
View File
@@ -746,7 +746,21 @@ function sortUIElements(pluginNames) {
lastCard = card;
});
}
function toggleProgressDialog() {
var progressDialog = document.getElementById('progressDialog');
if (progressDialog.open) {
progressDialog.close();
} else {
progressDialog.showModal();
}
}
function updateProgressDialog(message) {
var progressDialog = document.getElementById('progressDialog');
progressDialog.getElementsByTagName('h1')[0].textContent = message;
}
function sortPlugins(evt) {
updateProgressDialog('LOOT Working...');
toggleProgressDialog();
if (loot.settings.updateMasterlist) {
updateMasterlist(evt);
}
@@ -786,6 +800,7 @@ function sortPlugins(evt) {
hideElement(document.getElementById('sortButton'));
showElement(document.getElementById('applySortButton'));
showElement(document.getElementById('cancelSortButton'));
toggleProgressDialog();
}
}).catch(processCefError);
}
+4
View File
@@ -565,6 +565,10 @@ along with LOOT. If not, see <http://www.gnu.org/licenses/>.
</dialog>
<div id="hoverText" class="hidden"></div>
<dialog id="progressDialog">
<progress></progress>
<h1></h1>
</dialog>
<script src="js/script.js"></script>
</body>