Browse Source

switch to jquery.toast

Davide Alberani 4 years ago
parent
commit
be87d1f78c

+ 3 - 3
dist/index.html

@@ -5,10 +5,10 @@
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
-  <link rel="stylesheet" type="text/css" href="/static/css/iziToast.min.css">
+  <link rel="stylesheet" type="text/css" href="/static/css/jquery.toast.min.css">
   <script src="/static/js/jquery-3.4.1.min.js"></script>
   <script src="/static/js/bootstrap.min.js"></script>
-  <script src="/static/js/iziToast.min.js"></script>
+  <script src="/static/js/jquery.toast.min.js"></script>
   <script src="/static/js/httprint.js"></script>
   <title>HTTPrint</title>
 </head>
@@ -19,7 +19,7 @@
         <div class="jumbotron jumbotron-fluid">
           <div class="container">
             <h1 class="display-4">HTTPrint</h1>
-            <p class="lead">Upload and print a file.</p>
+            <p class="lead">Upload and print a <strong>PDF file</strong>. The maximum number of pages that can be printed is <strong>10</strong>.</p>
             Instructions:
             <ol>
               <li>Upload a file, select the number of copies and click the "print" button</li>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/jquery.toast.min.css


+ 27 - 17
dist/static/js/httprint.js

@@ -12,31 +12,41 @@ function uploadFile() {
         })
         .then(function(reply) {
             if (reply && !reply.error) {
-                iziToast.success({
-                    title: "DONE!",
-                    message: reply.message || "file sent to printer",
-                    position: "topCenter",
-                    timeout: false,
-                    closeOnEscape: true,
-                    layout: 2
+                $.toast({
+                    text: reply.message || "file sent to printer",
+                    heading: "DONE!",
+                    icon: "success",
+                    showHideTransition: "fade",
+                    allowToastClose: true,
+                    hideAfter: false,
+                    stack: 5,
+                    position: "top-center"
                 });
             } else {
-                iziToast.error({
-                    title: "ERROR!",
-                    message: reply.message || "unable to print file",
-                    position: "topCenter",
-                    layout: 2
+                $.toast({
+                    text: reply.message || "unable to print file",
+                    heading: "ERROR!",
+                    icon: "error",
+                    showHideTransition: "fade",
+                    allowToastClose: true,
+                    hideAfter: 5000,
+                    stack: 5,
+                    position: "top-center"
                 });
             }
             uploadField.value = null;
         })
         .catch(function(err) {
             console.log(err);
-            iziToast.error({
-                title: "ERROR!",
-                message: "failed to send file",
-                position: "topCenter",
-                layout: 2
+            $.toast({
+                text: "failed to send file",
+                heading: "ERROR!",
+                icon: "error",
+                showHideTransition: "fade",
+                allowToastClose: true,
+                hideAfter: 5000,
+                stack: 5,
+                position: "top-center"
             });
             uploadField.value = null;
         });

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/jquery.toast.min.js


Some files were not shown because too many files changed in this diff