Chart.min.js
7 months ago
bulk-conversion.js
7 months ago
bulk-optimization.js
7 months ago
calculate-attachments.js
1 year ago
index.php
3 years ago
meta-migrations.js
3 years ago
modals.js
7 months ago
notices.js
3 months ago
restore-backup.js
7 months ago
settings-premium.js
7 months ago
single-optimization.js
7 months ago
statistic.js
7 months ago
sweetalert2.js
3 years ago
wrio-license-manager.js
7 months ago
modals.js
58 lines
| 1 | /** |
| 2 | * A set of tools for creating pop-ups. You can create a popup |
| 3 | * using a global method call. |
| 4 | * |
| 5 | * @version 1.0 |
| 6 | */ |
| 7 | |
| 8 | |
| 9 | (function($) { |
| 10 | 'use strict'; |
| 11 | |
| 12 | if( !$.wrio_modal ) { |
| 13 | $.wrio_modal = {}; |
| 14 | } |
| 15 | |
| 16 | $.wrio_modal = $.wrio_popup || { |
| 17 | |
| 18 | showErrorModal: function(text) { |
| 19 | if( !text ) { |
| 20 | console.log('[Error]: Text required.'); |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | swal({ |
| 25 | title: 'Error', |
| 26 | text: text, |
| 27 | type: 'error', |
| 28 | customClass: 'wrio-modal wrio-modal-error', |
| 29 | width: 500, |
| 30 | confirmButtonText: 'OK', |
| 31 | }); |
| 32 | }, |
| 33 | |
| 34 | showWarningModal: function(text, callback) { |
| 35 | if( !text ) { |
| 36 | console.log('[Error]: Text required.'); |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | swal({ |
| 41 | title: 'Warning', |
| 42 | text: text, |
| 43 | type: 'warning', |
| 44 | customClass: 'wrio-modal wrio-modal-warning', |
| 45 | width: 500, |
| 46 | showCancelButton: true, |
| 47 | showCloseButton: true, |
| 48 | confirmButtonText: 'OK', |
| 49 | }).then(function(result) { |
| 50 | if( callback ) { |
| 51 | callback(); |
| 52 | } |
| 53 | }).catch(swal.noop); |
| 54 | }, |
| 55 | }; |
| 56 | |
| 57 | })(jQuery); |
| 58 |