mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user