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

Commit

Permalink
Merge pull request #24 from ThomasIAm/master
Browse files Browse the repository at this point in the history
Hide progess bar when not uploading and change color to white
  • Loading branch information
Bloemendaal authored Apr 3, 2020
2 parents 72f1021 + 27b07e3 commit d5ab9d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ ul.mdc-list:not(.mdc-list--non-interactive) .mdc-list-item {
.darktheme .mdc-linear-progress__buffer {
background: rgba(0,0,0,.12);
}

.darktheme .mdc-linear-progress__bar-inner {
background: rgb(255, 255, 255);
}

.darktheme #drawer, .darktheme .mdc-fab, .darktheme .mdc-menu-surface, .darktheme #handin-upload, .darktheme #handin-review, .darktheme {
background: #333;
}
Expand Down
8 changes: 8 additions & 0 deletions extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
var upload;
var snackbar;
var progressBar;
var progressBarParent;

var favoriteCourses = localStorage.getItem("favoriteCourses") == "-1" ? -1 : 0;
var pages = [
Expand Down Expand Up @@ -1079,6 +1080,7 @@
if (submit) {
dProperties = prepareItemType(data.HANDIN_URL, data.HANDIN_TYPE, 'handin');

progressBarParent.addClass('mdc-linear-progress--closed');
progressBar.css('transform', 'scaleX(1)');
sbtn.hide();
doc.show();
Expand All @@ -1090,11 +1092,13 @@
assignment: data.ID
};

progressBarParent.addClass('mdc-linear-progress--closed');
progressBar.css('transform', 'scaleX(1)');
sbtn.show();
doc.show();
doc.children('div').html(prepareHandinHTML(data.INITIAL_DOCUMENT_URL, data.INITIAL_DOCUMENT_NAME, dProperties));
} else {
progressBarParent.addClass('mdc-linear-progress--closed');
progressBar.css('transform', 'scaleX(0)');
doc.hide();
sbtn.hide();
Expand Down Expand Up @@ -1516,17 +1520,21 @@

// File upload
progressBar = $('#handin-progress > .mdc-linear-progress__bar.mdc-linear-progress__primary-bar');
progressBarParent = $('#handin-progress');
upload = UIkit.upload('#handin-upload', {
url: '/Services/Assignment.asmx/UploadTempFile',
multiple: true,
concurrent: 1,
loadStart: function (e) {
progressBarParent.removeClass('mdc-linear-progress--closed');
progressBar.css('transform', 'scaleX(0)');
},
progress: function (e) {
progressBarParent.removeClass('mdc-linear-progress--closed');
progressBar.css('transform', 'scaleX('+(e.loaded/e.total).toFixed(2)+')');
},
loadEnd: function (e) {
progressBarParent.removeClass('mdc-linear-progress--closed');
progressBar.css('transform', 'scaleX(1)');
},
completeAll: function() {
Expand Down

0 comments on commit d5ab9d5

Please sign in to comment.