Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
small status popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Bloemendaal committed Jan 16, 2020
1 parent c095e08 commit 72f1021
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
28 changes: 25 additions & 3 deletions extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(function() {
'use strict';

var version = 1.80;
var version = 1.81;
var tab = false;
var hidenav = false;
var lang = 0;
Expand Down Expand Up @@ -71,17 +71,39 @@
setPage(0);
},
fab: function () {

$('#download-1 > .uk-spinner').show();
$('#download-2 > .material-icons, #download-3 > .material-icons').show().css('opacity', 0);
$('#download-2 > .uk-spinner, #download-3 > .uk-spinner, #download-1 > .material-icons').hide();
var modalDownload = UIkit.modal('#modal-download');
modalDownload.show();

var currentPath = preparePath(false);
var courseID = currentPath[1].split('-');
var subFolder = currentPath.length > 2 ? currentPath[currentPath.length - 1] : -1;
getFolderContents(courseID[courseID.length - 1], subFolder)
.then(async (result) => {
console.log(result);

$('#download-1 > .uk-spinner, #download-2 > .material-icons').hide();
$('#download-2 > .uk-spinner, #download-1 > .material-icons').show();

var zip = new JSZip();
await generateZip(result, zip);

$('#download-2 > .uk-spinner, #download-3 > .material-icons').hide();
$('#download-3 > .uk-spinner, #download-2 > .material-icons').show().css('opacity', 1);

zip.generateAsync({type:"blob"})
.then((content) => {

$('#download-3 > .uk-spinner').hide();
$('#download-3 > .material-icons').show().css('opacity', 1);

saveAs(content, $('#title').text() + ".zip");

setTimeout(function () {
modalDownload.hide();
}, 500);
});
});
}
Expand Down Expand Up @@ -1253,7 +1275,7 @@
}

function initELO() {
document.write('<!DOCTYPE html><html><head><title>Windesheim ELO</title><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><meta name="author" content="Casper Bloemendaal"><meta name="theme-color" content="#406790"><meta name="msapplication-navbutton-color" content="#406790"><meta name="apple-mobile-web-app-status-bar-style" content="#406790"></head><body><aside id="drawer" class="mdc-drawer mdc-drawer--modal mdc-drawer--prepare"><div class="mdc-drawer__header"><h3 class="mdc-drawer__title uk-text-truncate"></h3><h6 class="mdc-drawer__subtitle uk-text-truncate"></h6></div><div id="nav" class="mdc-drawer__content uk-scrollbar"><ul id="nav-focus" class="mdc-list"><li class="mdc-list-item" tabindex="0"></li></ul><div id="nav-menu"><ul id="nav-menu-list" class="mdc-list"></ul></div><div id="nav-folder"><ul class="mdc-list" data-id="-1"><li id="nav-folder-back" class="mdc-list-item" data-mdc-auto-init="MDCRipple"> <i class="material-icons mdc-list-item__graphic" aria-hidden="true">arrow_back</i> <span class="lang-en">Back</span> <span class="lang-nl">Terug</span> <span class="lang-de">Zur&uuml;ck</span></li></ul><ul id="nav-folder-list" class="mdc-list uk-padding-remove-top"></ul></div></div> </aside><div class="mdc-drawer-scrim"></div><div class="mdc-drawer-app-content"> <header id="top-app-bar" class="mdc-top-app-bar mdc-top-app-bar--fixed"><div class="mdc-top-app-bar__row top-app-bar__main"> <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"> <span class="material-icons mdc-top-app-bar__navigation-icon">menu</span> <span id="title" class="mdc-top-app-bar__title"></span> </section> <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar"> <span id="search-button" uk-toggle="target: #top-app-bar .top-app-bar__search, #top-app-bar .top-app-bar__main; animation: uk-animation-fade" class="material-icons mdc-top-app-bar__action-item" aria-label="Zoeken" alt="Zoeken">search</span> <span id="top-app-bar__more" class="material-icons mdc-top-app-bar__action-item mdc-menu-surface--anchor" aria-label="Meer..." alt="Meer..."> <span>notifications_none</span><div id="top-app-bar__menu" class="mdc-menu mdc-menu-surface"><ul class="mdc-list mdc-list--two-line"></ul></div> </span> </section></div><div class="mdc-top-app-bar__row top-app-bar__search" hidden> <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"> <span id="search-back" uk-toggle="target: #top-app-bar .top-app-bar__search, #top-app-bar .top-app-bar__main; animation: uk-animation-fade" class="material-icons mdc-top-app-bar__navigation-icon">arrow_back</span><div class="uk-search uk-search-navbar uk-width-1-1 uk-light"> <input id="search" class="uk-search-input mdc-top-app-bar__title" type="search" placeholder="Zoeken..." autofocus></div> </section></div> </header><div id="content" class="uk-container uk-container-expand"><div class="mdc-top-app-bar--fixed-adjust"></div><div id="container"><div id="container-iframe"> <iframe src="" width="100%" height="100%"></iframe></div><div id="container-handin"><div id="handin-progress" role="progressbar" class="mdc-linear-progress"><div class="mdc-linear-progress__buffering-dots"></div><div class="mdc-linear-progress__buffer"></div><div class="mdc-linear-progress__bar mdc-linear-progress__primary-bar"> <span class="mdc-linear-progress__bar-inner"></span></div><div class="mdc-linear-progress__bar mdc-linear-progress__secondary-bar"> <span class="mdc-linear-progress__bar-inner"></span></div></div><div id="handin-upload" class="uk-flex uk-flex-column"><div class="handin-load uk-padding uk-scrollbar"></div><div class="uk-text-center uk-padding"> <i class="material-icons uk-text-middle uk-margin-small-right">cloud_upload</i> <span class="uk-text-middle"> <span class="lang-en">Attach binaries by dropping them here or</span> <span class="lang-nl">Upload bestanden door ze hierheen te slepen of</span> <span class="lang-de">Laden Sie Dateien hoch, indem Sie sie hierher ziehen oder</span> </span><div uk-form-custom> <input type="file" multiple> <span class="uk-link"> <span class="lang-en">selecting one</span> <span class="lang-nl">te selecteren</span> <span class="lang-de">ausw&auml;hlen</span> </span></div></div><div class="uk-padding uk-padding-remove-top"><ul class="mdc-list uk-padding-remove"><li class="handin-review mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Review</span> <span class="lang-nl">Beoordeling</span> <span class="lang-de">Rezension</span></h6><div></div></li><li class="handin-start mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Provided document</span> <span class="lang-nl">Meegeleverd document</span> <span class="lang-de">Bereitgestelltes Dokument</span></h6><div></div></li><li class="handin-document mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Uploaded document</span> <span class="lang-nl">Geüpload document</span> <span class="lang-de">Hochgeladenes Dokument</span></h6><div></div></li></ul></div><div id="handin-submit" class="uk-padding uk-padding-remove-top"><div class="uk-grid"><div class="uk-width-expand"> <small class="uk-text-meta uk-text-middle" style="padding-left: 16px"> <span class="lang-en">Note that pressing submit cannot be undone.</span> <span class="lang-nl">Op inleveren klikken kan niet ongedaan gemaakt worden.</span> <span class="lang-de">Beachten Sie, dass das Dr&uuml;cken von "Senden" nicht r&uuml;ckg&auml;ngig gemacht werden kann.</span> </small></div><div class="uk-width-auto"> <button class="mdc-button mdc-button--raised" data-mdc-auto-init="MDCRipple"></button></div></div></div></div><div id="handin-review" class="uk-flex uk-flex-column"><div class="handin-load uk-padding uk-scrollbar"></div><div class="uk-padding"><ul class="mdc-list uk-padding-remove"><li class="handin-review mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Review</span> <span class="lang-nl">Beoordeling</span> <span class="lang-de">Rezension</span></h6><div></div></li><li class="handin-start mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Provided document</span> <span class="lang-nl">Meegeleverd document</span> <span class="lang-de">Bereitgestelltes Dokument</span></h6><div></div></li><li class="handin-document mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Submitted document</span> <span class="lang-nl">Ingezonden document</span> <span class="lang-de">&Uuml;bermitteltes Dokument</span></h6><div></div></li></ul></div></div></div><div id="container-include"></div><div id="container-list"><ul class="mdc-list mdc-list--two-line uk-flex uk-flex-column" aria-orientation="vertical"></ul></div><div id="container-folder"><ul class="mdc-list"></ul></div></div> <button id="FAB" class="mdc-fab fab-hidden material-icons" aria-label="Favorite" data-mdc-auto-init="MDCRipple"> <span class="mdc-fab__icon"></span> </button></div></div><div class="mdc-snackbar" id="snackbar"><div class="mdc-snackbar__surface"><div class="mdc-snackbar__label" role="status" aria-live="polite"></div><div class="mdc-snackbar__actions"><button type="button" class="mdc-button mdc-snackbar__action"></button><button class="mdc-icon-button mdc-snackbar__dismiss material-icons" title="Dismiss">close</button></div></div></div></body></html>');
document.write('<!DOCTYPE html><html><head><title>Windesheim ELO</title><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><meta name="author" content="Casper Bloemendaal"><meta name="theme-color" content="#406790"><meta name="msapplication-navbutton-color" content="#406790"><meta name="apple-mobile-web-app-status-bar-style" content="#406790"></head><body><aside id="drawer" class="mdc-drawer mdc-drawer--modal mdc-drawer--prepare"><div class="mdc-drawer__header"><h3 class="mdc-drawer__title uk-text-truncate"></h3><h6 class="mdc-drawer__subtitle uk-text-truncate"></h6></div><div id="nav" class="mdc-drawer__content uk-scrollbar"><ul id="nav-focus" class="mdc-list"><li class="mdc-list-item" tabindex="0"></li></ul><div id="nav-menu"><ul id="nav-menu-list" class="mdc-list"></ul></div><div id="nav-folder"><ul class="mdc-list" data-id="-1"><li id="nav-folder-back" class="mdc-list-item" data-mdc-auto-init="MDCRipple"> <i class="material-icons mdc-list-item__graphic" aria-hidden="true">arrow_back</i> <span class="lang-en">Back</span> <span class="lang-nl">Terug</span> <span class="lang-de">Zur&uuml;ck</span></li></ul><ul id="nav-folder-list" class="mdc-list uk-padding-remove-top"></ul></div></div> </aside><div class="mdc-drawer-scrim"></div><div class="mdc-drawer-app-content"> <header id="top-app-bar" class="mdc-top-app-bar mdc-top-app-bar--fixed"><div class="mdc-top-app-bar__row top-app-bar__main"> <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"> <span class="material-icons mdc-top-app-bar__navigation-icon">menu</span> <span id="title" class="mdc-top-app-bar__title"></span> </section> <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar"> <span id="search-button" uk-toggle="target: #top-app-bar .top-app-bar__search, #top-app-bar .top-app-bar__main; animation: uk-animation-fade" class="material-icons mdc-top-app-bar__action-item" aria-label="Zoeken" alt="Zoeken">search</span> <span id="top-app-bar__more" class="material-icons mdc-top-app-bar__action-item mdc-menu-surface--anchor" aria-label="Meer..." alt="Meer..."> <span>notifications_none</span><div id="top-app-bar__menu" class="mdc-menu mdc-menu-surface"><ul class="mdc-list mdc-list--two-line"></ul></div> </span> </section></div><div class="mdc-top-app-bar__row top-app-bar__search" hidden> <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"> <span id="search-back" uk-toggle="target: #top-app-bar .top-app-bar__search, #top-app-bar .top-app-bar__main; animation: uk-animation-fade" class="material-icons mdc-top-app-bar__navigation-icon">arrow_back</span><div class="uk-search uk-search-navbar uk-width-1-1 uk-light"> <input id="search" class="uk-search-input mdc-top-app-bar__title" type="search" placeholder="Zoeken..." autofocus></div> </section></div> </header><div id="content" class="uk-container uk-container-expand"><div class="mdc-top-app-bar--fixed-adjust"></div><div id="container"><div id="container-iframe"> <iframe src="" width="100%" height="100%"></iframe></div><div id="container-handin"><div id="handin-progress" role="progressbar" class="mdc-linear-progress"><div class="mdc-linear-progress__buffering-dots"></div><div class="mdc-linear-progress__buffer"></div><div class="mdc-linear-progress__bar mdc-linear-progress__primary-bar"> <span class="mdc-linear-progress__bar-inner"></span></div><div class="mdc-linear-progress__bar mdc-linear-progress__secondary-bar"> <span class="mdc-linear-progress__bar-inner"></span></div></div><div id="handin-upload" class="uk-flex uk-flex-column"><div class="handin-load uk-padding uk-scrollbar"></div><div class="uk-text-center uk-padding"> <i class="material-icons uk-text-middle uk-margin-small-right">cloud_upload</i> <span class="uk-text-middle"> <span class="lang-en">Attach binaries by dropping them here or</span> <span class="lang-nl">Upload bestanden door ze hierheen te slepen of</span> <span class="lang-de">Laden Sie Dateien hoch, indem Sie sie hierher ziehen oder</span> </span><div uk-form-custom> <input type="file" multiple> <span class="uk-link"> <span class="lang-en">selecting one</span> <span class="lang-nl">te selecteren</span> <span class="lang-de">ausw&auml;hlen</span> </span></div></div><div class="uk-padding uk-padding-remove-top"><ul class="mdc-list uk-padding-remove"><li class="handin-review mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Review</span> <span class="lang-nl">Beoordeling</span> <span class="lang-de">Rezension</span></h6><div></div></li><li class="handin-start mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Provided document</span> <span class="lang-nl">Meegeleverd document</span> <span class="lang-de">Bereitgestelltes Dokument</span></h6><div></div></li><li class="handin-document mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Uploaded document</span> <span class="lang-nl">Geüpload document</span> <span class="lang-de">Hochgeladenes Dokument</span></h6><div></div></li></ul></div><div id="handin-submit" class="uk-padding uk-padding-remove-top"><div class="uk-grid"><div class="uk-width-expand"> <small class="uk-text-meta uk-text-middle" style="padding-left: 16px"> <span class="lang-en">Note that pressing submit cannot be undone.</span> <span class="lang-nl">Op inleveren klikken kan niet ongedaan gemaakt worden.</span> <span class="lang-de">Beachten Sie, dass das Dr&uuml;cken von "Senden" nicht r&uuml;ckg&auml;ngig gemacht werden kann.</span> </small></div><div class="uk-width-auto"> <button class="mdc-button mdc-button--raised" data-mdc-auto-init="MDCRipple"></button></div></div></div></div><div id="handin-review" class="uk-flex uk-flex-column"><div class="handin-load uk-padding uk-scrollbar"></div><div class="uk-padding"><ul class="mdc-list uk-padding-remove"><li class="handin-review mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Review</span> <span class="lang-nl">Beoordeling</span> <span class="lang-de">Rezension</span></h6><div></div></li><li class="handin-start mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Provided document</span> <span class="lang-nl">Meegeleverd document</span> <span class="lang-de">Bereitgestelltes Dokument</span></h6><div></div></li><li class="handin-document mdc-list-group"><h6 class="mdc-list-group__subheader"> <span class="lang-en">Submitted document</span> <span class="lang-nl">Ingezonden document</span> <span class="lang-de">&Uuml;bermitteltes Dokument</span></h6><div></div></li></ul></div></div></div><div id="container-include"></div><div id="container-list"><ul class="mdc-list mdc-list--two-line uk-flex uk-flex-column" aria-orientation="vertical"></ul></div><div id="container-folder"><ul class="mdc-list"></ul></div></div> <button id="FAB" class="mdc-fab fab-hidden material-icons" aria-label="Favorite" data-mdc-auto-init="MDCRipple"> <span class="mdc-fab__icon"></span> </button></div></div><div class="mdc-snackbar" id="snackbar"><div class="mdc-snackbar__surface"><div class="mdc-snackbar__label" role="status" aria-live="polite"></div><div class="mdc-snackbar__actions"><button type="button" class="mdc-button mdc-snackbar__action"></button><button class="mdc-icon-button mdc-snackbar__dismiss material-icons" title="Dismiss">close</button></div></div></div><div id="modal-download" uk-modal="bg-close:false;esc-close:false" class="uk-modal"> <div class="uk-modal-dialog mdc-card"> <div class="uk-modal-body"> <ul class="uk-list"> <li class="uk-flex" id="download-1"> <div class="uk-margin-right" uk-spinner="ratio: 0.8"></div><span class="material-icons uk-margin-right uk-text-success">check</span> <span class="lang-en">Retrieving file structure</span> <span class="lang-nl">Mapstructuur ophalen</span> <span class="lang-de">Dateistruktur abrufen</span> </li><li class="uk-flex" id="download-2"> <div class="uk-margin-right" uk-spinner="ratio: 0.8"></div><span class="material-icons uk-margin-right uk-text-success">check</span> <span class="lang-en">Downloading files</span> <span class="lang-nl">Bestanden downloaden</span> <span class="lang-de">Dateien herunterladen</span> </li><li class="uk-flex" id="download-3"> <div class="uk-margin-right" uk-spinner="ratio: 0.8"></div><span class="material-icons uk-margin-right uk-text-success">check</span> <span class="lang-en">Generating ZIP</span> <span class="lang-nl">ZIP genereren</span> <span class="lang-de">ZIP generieren</span> </li></ul> </div></div></div></body></html>');
document.close();

window.onpopstate = readURL;
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"author": "Casper Bloemendaal",
"version": "1.8.0",
"version": "1.8.1",
"icons": {
"16": "icon/icon16.png",
"48": "icon/icon48.png",
Expand Down
29 changes: 29 additions & 0 deletions userscript/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -525,5 +525,34 @@ <h6 class="mdc-list-group__subheader">
</div>
</div>
</div>
<div id="modal-download" uk-modal="bg-close:false;esc-close:false" class="uk-modal">
<div class="uk-modal-dialog mdc-card">
<div class="uk-modal-body">
<ul class="uk-list">
<li class="uk-flex" id="download-1">
<div class="uk-margin-right" uk-spinner="ratio: 0.8"></div>
<span class="material-icons uk-margin-right uk-text-success">check</span>
<span class="lang-en">Retrieving file structure</span>
<span class="lang-nl">Mapstructuur ophalen</span>
<span class="lang-de">Dateistruktur abrufen</span>
</li>
<li class="uk-flex" id="download-2">
<div class="uk-margin-right" uk-spinner="ratio: 0.8"></div>
<span class="material-icons uk-margin-right uk-text-success">check</span>
<span class="lang-en">Downloading files</span>
<span class="lang-nl">Bestanden downloaden</span>
<span class="lang-de">Dateien herunterladen</span>
</li>
<li class="uk-flex" id="download-3">
<div class="uk-margin-right" uk-spinner="ratio: 0.8"></div>
<span class="material-icons uk-margin-right uk-text-success">check</span>
<span class="lang-en">Generating ZIP</span>
<span class="lang-nl">ZIP genereren</span>
<span class="lang-de">ZIP generieren</span>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>

0 comments on commit 72f1021

Please sign in to comment.