- Migrated from https://github.com/Yetangitu/owncloud-apps
- substantial bit rot accrued in 4 years of non-maintenance which made Reader unusable - Reader now works reliably on public pages - or at least it _Works For Me™_ - Refactored a substantial part of the code to comply to the "current" (ha ha) Nextcloud API - Dropped Owncloud compatibility for lack of a testing installation - Dropped IE (<11) support - Dropped compatibility with older (<20) Nextcloud versions - Dropped app-specific ajax code, now handled by SettingsController - Updated dependencies where applicable
This commit is contained in:
parent
16afbe45fe
commit
b190e180ef
137 changed files with 30984 additions and 2 deletions
57
vendor/pdfjs/controllers/progress_controller.js
vendored
Normal file
57
vendor/pdfjs/controllers/progress_controller.js
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
PDFJS.reader.ProgressController = function() {
|
||||
var reader = this,
|
||||
settings = reader.settings,
|
||||
percentage = 0;
|
||||
|
||||
var $progress = $("#progress"),
|
||||
$bar = $(".bar"),
|
||||
$download_icon = $("#download_icon"),
|
||||
$message = $(".message-text");
|
||||
|
||||
var show = function () {
|
||||
$progress.removeClass("hide");
|
||||
};
|
||||
|
||||
var hide = function () {
|
||||
$progress.addClass("hide");
|
||||
};
|
||||
|
||||
var setSize = function (size) {
|
||||
settings.fileSize = size;
|
||||
};
|
||||
|
||||
var setProgress = function (progress) {
|
||||
|
||||
if (percentage < 1)
|
||||
$download_icon.addClass("active");
|
||||
|
||||
percentage = Math.floor((progress.loaded / progress.total) * 100);
|
||||
$bar.css("width", percentage + "%");
|
||||
|
||||
if (percentage === 100)
|
||||
$download_icon.removeClass("active").addClass("ok");
|
||||
};
|
||||
|
||||
var reset = function() {
|
||||
$bar.css("width", 0);
|
||||
};
|
||||
|
||||
var setMessage = function (text, category, state) {
|
||||
|
||||
var $category_icon = $("#" + category + "_icon");
|
||||
|
||||
$message.text(text);
|
||||
|
||||
$category_icon[0].classList.remove("ok", "active", "error");
|
||||
$category_icon.addClass(state);
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
"show": show,
|
||||
"hide": hide,
|
||||
"setSize": setSize,
|
||||
"setProgress": setProgress,
|
||||
"setMessage": setMessage
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue