Skip to content

Commit 6bef370

Browse files
authored
Use modernized waitMe plugin (#3213)
2 parents c23315d + 621ec80 commit 6bef370

File tree

7 files changed

+239
-965
lines changed

7 files changed

+239
-965
lines changed

package-lock.json

Lines changed: 231 additions & 946 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"nprogress": "0.2.0",
5151
"qrious": "4.0.2",
5252
"select2": "4.0.13",
53-
"waitme": "1.19.0"
53+
"modernized-waitme": "1.0.0"
5454
},
5555
"devDependencies": {
5656
"autoprefixer": "^10.4.21",

scripts/js/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* This file is copyright under the latest version of the EUPL.
66
* Please see LICENSE file for your rights under this license. */
77

8-
/* global moment:false, apiUrl: false, apiFailure: false, updateFtlInfo: false, NProgress:false */
8+
/* global moment:false, apiUrl: false, apiFailure: false, updateFtlInfo: false, NProgress:false, WaitMe:false */
99

1010
$(function () {
1111
// CSRF protection for AJAX requests, this has to be configured globally
@@ -635,6 +635,7 @@ function listAlert(type, items, data) {
635635
);
636636
}
637637

638+
let waitMe = null;
638639
// Callback function for the loading overlay timeout
639640
function loadingOverlayTimeoutCallback(reloadAfterTimeout) {
640641
// Try to ping FTL to see if it finished restarting
@@ -650,7 +651,7 @@ function loadingOverlayTimeoutCallback(reloadAfterTimeout) {
650651
if (reloadAfterTimeout) {
651652
location.reload();
652653
} else {
653-
$(".wrapper").waitMe("hide");
654+
waitMe.hideAll();
654655
}
655656
})
656657
.fail(function () {
@@ -661,7 +662,7 @@ function loadingOverlayTimeoutCallback(reloadAfterTimeout) {
661662

662663
function loadingOverlay(reloadAfterTimeout = false) {
663664
NProgress.start();
664-
$(".wrapper").waitMe({
665+
waitMe = new WaitMe(".wrapper", {
665666
effect: "bounce",
666667
text: "Pi-hole is currently applying your changes...",
667668
bg: "rgba(0,0,0,0.7)",

scripts/lua/header.lp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ is_authenticated = mg.request_info.is_authenticated
9999
<link rel="stylesheet" href="<?=pihole.fileversion('vendor/daterangepicker/daterangepicker.min.css')?>">
100100
<link rel="stylesheet" href="<?=pihole.fileversion('vendor/bootstrap-toggle/bootstrap-toggle.min.css')?>">
101101
<? end ?>
102-
<link rel="stylesheet" href="<?=pihole.fileversion('vendor/waitMe/waitMe.min.css')?>">
102+
<link rel="stylesheet" href="<?=pihole.fileversion('vendor/waitMe-js/waitMe.min.css')?>">
103103
<link rel="stylesheet" href="<?=pihole.fileversion('vendor/select2/select2.min.css')?>">
104104
<link rel="stylesheet" href="<?=pihole.fileversion('vendor/adminLTE/AdminLTE.min.css')?>">
105105

@@ -119,6 +119,6 @@ is_authenticated = mg.request_info.is_authenticated
119119
<script defer src="<?=pihole.fileversion('vendor/bootstrap/js/bootstrap.min.js')?>"></script>
120120
<script defer src="<?=pihole.fileversion('vendor/adminLTE/adminlte.min.js')?>"></script>
121121
<script defer src="<?=pihole.fileversion('vendor/bootstrap-notify/bootstrap-notify.min.js')?>"></script>
122-
<script defer src="<?=pihole.fileversion('vendor/waitMe/waitMe.min.js')?>"></script>
122+
<script defer src="<?=pihole.fileversion('vendor/waitMe-js/modernized-waitme-min.js')?>"></script>
123123
<script defer src="<?=pihole.fileversion('vendor/nprogress/nprogress.min.js')?>"></script>
124124
<script defer src="<?=pihole.fileversion('scripts/js/utils.js')?>"></script>

vendor/waitMe-js/modernized-waitme-min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

vendor/waitMe/waitMe.min.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)