Version Description
- 2019-11-11 =
- Fixed: Compatibility with WordPress 5.3.
- Fixed:
Processor::get_default_email()
always returns empty value when server incorrectly configured.
Download this release
Release Info
Developer | slaFFik |
Plugin | WP Mail SMTP by WPForms |
Version | 1.7.1 |
Comparing to | |
See all releases |
Code changes from version 1.7.0 to 1.7.1
- assets/js/smtp-about.js +19 -10
- assets/js/smtp-about.min.js +1 -1
- assets/languages/wp-mail-smtp.pot +32 -28
- assets/libs/jquery-confirm.min.css +8 -8
- assets/libs/jquery-confirm.min.js +9 -9
- readme.txt +6 -2
- src/Admin/Area.php +1 -0
- src/Admin/Pages/About.php +2 -5
- src/Admin/PluginsInstallSkin.php +2 -25
- src/Admin/PluginsInstallUpgrader.php +576 -0
- src/Processor.php +4 -8
- vendor/google/auth/src/Cache/Item.php +9 -4
- vendor/psr/log/Psr/Log/LoggerInterface.php +2 -0
- vendor/psr/log/Psr/Log/LoggerTrait.php +2 -0
- vendor/psr/log/Psr/Log/NullLogger.php +2 -0
- wp_mail_smtp.php +4 -2
assets/js/smtp-about.js
CHANGED
@@ -120,8 +120,10 @@ WPMailSMTP.Admin.About = WPMailSMTP.Admin.About || (function ( document, window,
|
|
120 |
};
|
121 |
|
122 |
$.post( wp_mail_smtp_about.ajax_url, data, function( res ) {
|
|
|
123 |
|
124 |
if ( res.success ) {
|
|
|
125 |
if ( 'about_plugin_install' === task ) {
|
126 |
$btn.attr( 'data-plugin', res.data.basename );
|
127 |
successText = res.data.msg;
|
@@ -144,25 +146,32 @@ WPMailSMTP.Admin.About = WPMailSMTP.Admin.About || (function ( document, window,
|
|
144 |
.removeClass( 'button button-primary button-secondary disabled' )
|
145 |
.addClass( cssClass ).html( buttonText );
|
146 |
} else {
|
|
|
|
|
147 |
if (
|
148 |
-
res.hasOwnProperty('data') &&
|
149 |
-
res.data.hasOwnProperty(0) &&
|
150 |
-
res.data[0].hasOwnProperty('code') &&
|
151 |
-
res.data[0].code === 'download_failed'
|
152 |
) {
|
153 |
// Specific server-returned error.
|
154 |
-
$plugin.find( '.actions' ).append( '<div class="msg error">'+wp_mail_smtp_about.plugin_install_error+'</div>' );
|
155 |
-
}
|
|
|
156 |
// Generic error.
|
157 |
-
$plugin.find( '.actions' ).append( '<div class="msg error">'+res.data+'</div>' );
|
158 |
}
|
159 |
-
|
|
|
160 |
}
|
161 |
|
162 |
-
|
|
|
|
|
|
|
163 |
|
164 |
// Automatically clear plugin messages after 3 seconds.
|
165 |
-
setTimeout( function() {
|
166 |
$( '.plugin-item .msg' ).remove();
|
167 |
}, 3000 );
|
168 |
|
120 |
};
|
121 |
|
122 |
$.post( wp_mail_smtp_about.ajax_url, data, function( res ) {
|
123 |
+
var is_install_successful;
|
124 |
|
125 |
if ( res.success ) {
|
126 |
+
is_install_successful = true;
|
127 |
if ( 'about_plugin_install' === task ) {
|
128 |
$btn.attr( 'data-plugin', res.data.basename );
|
129 |
successText = res.data.msg;
|
146 |
.removeClass( 'button button-primary button-secondary disabled' )
|
147 |
.addClass( cssClass ).html( buttonText );
|
148 |
} else {
|
149 |
+
is_install_successful = false;
|
150 |
+
|
151 |
if (
|
152 |
+
res.hasOwnProperty( 'data' ) &&
|
153 |
+
res.data.hasOwnProperty( 0 ) &&
|
154 |
+
res.data[ 0 ].hasOwnProperty( 'code' ) &&
|
155 |
+
res.data[ 0 ].code === 'download_failed'
|
156 |
) {
|
157 |
// Specific server-returned error.
|
158 |
+
$plugin.find( '.actions' ).append( '<div class="msg error">' + wp_mail_smtp_about.plugin_install_error + '</div>' );
|
159 |
+
}
|
160 |
+
else {
|
161 |
// Generic error.
|
162 |
+
$plugin.find( '.actions' ).append( '<div class="msg error">' + res.data + '</div>' );
|
163 |
}
|
164 |
+
|
165 |
+
$btn.html( wp_mail_smtp_about.plugin_download_btn );
|
166 |
}
|
167 |
|
168 |
+
if ( is_install_successful ) {
|
169 |
+
$btn.prop( 'disabled', false );
|
170 |
+
}
|
171 |
+
$btn.removeClass( 'loading' );
|
172 |
|
173 |
// Automatically clear plugin messages after 3 seconds.
|
174 |
+
setTimeout( function () {
|
175 |
$( '.plugin-item .msg' ).remove();
|
176 |
}, 3000 );
|
177 |
|
assets/js/smtp-about.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.About=WPMailSMTP.Admin.About||function(a,t,
|
1 |
+
var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.About=WPMailSMTP.Admin.About||function(a,t,p){"use strict";var i={init:function(){p(a).ready(i.ready)},ready:function(){i.pageHolder=p(".wp-mail-smtp-page-about"),i.bindActions(),p(".wp-mail-smtp-page").trigger("WPMailSMTP.Admin.About.ready")},bindActions:function(){jQuery(".wp-mail-smtp-admin-about-plugins .plugin-item .details").matchHeight(),p(a).on("click",".wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button",function(a){a.preventDefault();var i=p(this);if(i.hasClass("disabled")||i.hasClass("loading"))return!1;var s,n,l,o,e,u=i.closest(".plugin-item"),t=i.attr("data-plugin");if(i.prop("disabled",!0).addClass("loading"),i.text(wp_mail_smtp_about.plugin_processing),i.hasClass("status-inactive"))s="about_plugin_activate",n="status-active button button-secondary disabled",l=wp_mail_smtp_about.plugin_active,o=wp_mail_smtp_about.plugin_activated,wp_mail_smtp_about.plugin_activate;else{if(!i.hasClass("status-download"))return;s="about_plugin_install",n="status-active button disabled",l=wp_mail_smtp_about.plugin_active,o=wp_mail_smtp_about.plugin_activated,wp_mail_smtp_about.plugin_activate}var d={action:"wp_mail_smtp_ajax",task:s,nonce:wp_mail_smtp_about.nonce,plugin:t};p.post(wp_mail_smtp_about.ajax_url,d,function(a){var t;a.success?(t=!0,"about_plugin_install"===s?(i.attr("data-plugin",a.data.basename),e=a.data.msg,a.data.is_activated||(n="button",l=wp_mail_smtp_about.plugin_inactive,o=wp_mail_smtp_about.plugin_activate)):e=a.data,u.find(".actions").append('<div class="msg success">'+e+"</div>"),u.find("span.status-label").removeClass("status-active status-inactive status-download").addClass(n).removeClass("button button-primary button-secondary disabled").text(l),i.removeClass("status-active status-inactive status-download").removeClass("button button-primary button-secondary disabled").addClass(n).html(o)):(t=!1,a.hasOwnProperty("data")&&a.data.hasOwnProperty(0)&&a.data[0].hasOwnProperty("code")&&"download_failed"===a.data[0].code?u.find(".actions").append('<div class="msg error">'+wp_mail_smtp_about.plugin_install_error+"</div>"):u.find(".actions").append('<div class="msg error">'+a.data+"</div>"),i.html(wp_mail_smtp_about.plugin_download_btn)),t&&i.prop("disabled",!1),i.removeClass("loading"),setTimeout(function(){p(".plugin-item .msg").remove()},3e3)}).fail(function(a){console.log(a.responseText)})})}};return i}(document,window,jQuery),WPMailSMTP.Admin.About.init();
|
assets/languages/wp-mail-smtp.pot
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: WP Mail SMTP 1.7.
|
4 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n"
|
5 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
6 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
-
"POT-Creation-Date: 2019-
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
12 |
"X-Generator: WP-CLI 2.2.0\n"
|
13 |
"X-Domain: wp-mail-smtp\n"
|
@@ -66,15 +66,15 @@ msgstr ""
|
|
66 |
|
67 |
#: src/Admin/Area.php:208
|
68 |
#: src/Admin/Area.php:209
|
69 |
-
#: src/Admin/Area.php:
|
70 |
#: wp-mail-smtp-0.11.2.php:688
|
71 |
msgid "Settings"
|
72 |
msgstr ""
|
73 |
|
74 |
#: src/Admin/Area.php:216
|
75 |
#: src/Admin/Area.php:217
|
76 |
-
#: src/Admin/Area.php:
|
77 |
-
#: src/Admin/Pages/About.php:
|
78 |
#: src/Admin/Pages/Logs.php:40
|
79 |
#: src/Admin/Pages/LogsTab.php:31
|
80 |
msgid "Email Log"
|
@@ -139,16 +139,20 @@ msgstr ""
|
|
139 |
msgid "Install and Activate"
|
140 |
msgstr ""
|
141 |
|
|
|
|
|
|
|
|
|
142 |
#. translators: %1$s - WP.org link; %2$s - same WP.org link.
|
143 |
-
#: src/Admin/Area.php:
|
144 |
msgid "Please rate <strong>WP Mail SMTP</strong> <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">★★★★★</a> on <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress.org</a> to help us spread the word. Thank you from the WP Mail SMTP team!"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: src/Admin/Area.php:
|
148 |
msgid "WP Mail SMTP Pro related message was successfully dismissed."
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: src/Admin/Area.php:
|
152 |
msgid "Educational notice for this mailer was successfully dismissed."
|
153 |
msgstr ""
|
154 |
|
@@ -158,7 +162,7 @@ msgstr ""
|
|
158 |
|
159 |
#. translators: %s - plugin current license type.
|
160 |
#: src/Admin/Pages/About.php:98
|
161 |
-
#: src/Admin/Pages/About.php:
|
162 |
msgid "%s vs Pro"
|
163 |
msgstr ""
|
164 |
|
@@ -250,76 +254,76 @@ msgstr ""
|
|
250 |
msgid "Could not install the plugin."
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: src/Admin/Pages/About.php:
|
254 |
msgid "Plugin installed & activated."
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: src/Admin/Pages/About.php:
|
258 |
msgid "Plugin installed."
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: src/Admin/Pages/About.php:
|
262 |
msgid "Get the most out of WP Mail SMTP by upgrading to Pro and unlocking all of the powerful features."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: src/Admin/Pages/About.php:
|
266 |
msgid "Feature"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: src/Admin/Pages/About.php:
|
270 |
msgid "Pro"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: src/Admin/Pages/About.php:
|
274 |
msgid "Get WP Mail SMTP Pro Today and Unlock all of these Powerful Features"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: src/Admin/Pages/About.php:
|
278 |
msgid "Bonus: WP Mail SMTP Lite users get <span class=\"price-off\">20% off regular price</span>, automatically applied at checkout."
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: src/Admin/Pages/About.php:
|
282 |
#: src/Admin/Pages/ControlTab.php:27
|
283 |
msgid "Email Controls"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: src/Admin/Pages/About.php:
|
287 |
msgid "Additional Mailers"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: src/Admin/Pages/About.php:
|
291 |
msgid "Customer Support"
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: src/Admin/Pages/About.php:
|
295 |
msgid "Emails are not logged"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: src/Admin/Pages/About.php:
|
299 |
msgid "Complete Email Log management inside WordPress"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: src/Admin/Pages/About.php:
|
303 |
msgid "No controls over whether default WordPress emails are sent"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: src/Admin/Pages/About.php:
|
307 |
msgid "Complete Email Controls management for most default WordPress emails"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: src/Admin/Pages/About.php:
|
311 |
msgid "Only default list of mailers"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: src/Admin/Pages/About.php:
|
315 |
msgid "Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES"
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: src/Admin/Pages/About.php:
|
319 |
msgid "Limited Support"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: src/Admin/Pages/About.php:
|
323 |
msgid "Priority Support"
|
324 |
msgstr ""
|
325 |
|
@@ -1658,6 +1662,6 @@ msgstr ""
|
|
1658 |
msgid "Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. %2$sRead more%3$s for additional information."
|
1659 |
msgstr ""
|
1660 |
|
1661 |
-
#: wp_mail_smtp.php:
|
1662 |
msgid "Please deactivate the free version of the WP Mail SMTP plugin before activating WP Mail SMTP Pro."
|
1663 |
msgstr ""
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: WP Mail SMTP 1.7.1\n"
|
4 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n"
|
5 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
6 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
+
"POT-Creation-Date: 2019-11-11T16:59:39+02:00\n"
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
12 |
"X-Generator: WP-CLI 2.2.0\n"
|
13 |
"X-Domain: wp-mail-smtp\n"
|
66 |
|
67 |
#: src/Admin/Area.php:208
|
68 |
#: src/Admin/Area.php:209
|
69 |
+
#: src/Admin/Area.php:793
|
70 |
#: wp-mail-smtp-0.11.2.php:688
|
71 |
msgid "Settings"
|
72 |
msgstr ""
|
73 |
|
74 |
#: src/Admin/Area.php:216
|
75 |
#: src/Admin/Area.php:217
|
76 |
+
#: src/Admin/Area.php:794
|
77 |
+
#: src/Admin/Pages/About.php:612
|
78 |
#: src/Admin/Pages/Logs.php:40
|
79 |
#: src/Admin/Pages/LogsTab.php:31
|
80 |
msgid "Email Log"
|
139 |
msgid "Install and Activate"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: src/Admin/Area.php:359
|
143 |
+
msgid "Download"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
#. translators: %1$s - WP.org link; %2$s - same WP.org link.
|
147 |
+
#: src/Admin/Area.php:418
|
148 |
msgid "Please rate <strong>WP Mail SMTP</strong> <a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">★★★★★</a> on <a href=\"%2$s\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress.org</a> to help us spread the word. Thank you from the WP Mail SMTP team!"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: src/Admin/Area.php:738
|
152 |
msgid "WP Mail SMTP Pro related message was successfully dismissed."
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: src/Admin/Area.php:757
|
156 |
msgid "Educational notice for this mailer was successfully dismissed."
|
157 |
msgstr ""
|
158 |
|
162 |
|
163 |
#. translators: %s - plugin current license type.
|
164 |
#: src/Admin/Pages/About.php:98
|
165 |
+
#: src/Admin/Pages/About.php:511
|
166 |
msgid "%s vs Pro"
|
167 |
msgstr ""
|
168 |
|
254 |
msgid "Could not install the plugin."
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: src/Admin/Pages/About.php:476
|
258 |
msgid "Plugin installed & activated."
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: src/Admin/Pages/About.php:484
|
262 |
msgid "Plugin installed."
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: src/Admin/Pages/About.php:519
|
266 |
msgid "Get the most out of WP Mail SMTP by upgrading to Pro and unlocking all of the powerful features."
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: src/Admin/Pages/About.php:528
|
270 |
msgid "Feature"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: src/Admin/Pages/About.php:538
|
274 |
msgid "Pro"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: src/Admin/Pages/About.php:579
|
278 |
msgid "Get WP Mail SMTP Pro Today and Unlock all of these Powerful Features"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: src/Admin/Pages/About.php:586
|
282 |
msgid "Bonus: WP Mail SMTP Lite users get <span class=\"price-off\">20% off regular price</span>, automatically applied at checkout."
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: src/Admin/Pages/About.php:613
|
286 |
#: src/Admin/Pages/ControlTab.php:27
|
287 |
msgid "Email Controls"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: src/Admin/Pages/About.php:614
|
291 |
msgid "Additional Mailers"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: src/Admin/Pages/About.php:615
|
295 |
msgid "Customer Support"
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: src/Admin/Pages/About.php:636
|
299 |
msgid "Emails are not logged"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: src/Admin/Pages/About.php:642
|
303 |
msgid "Complete Email Log management inside WordPress"
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: src/Admin/Pages/About.php:650
|
307 |
msgid "No controls over whether default WordPress emails are sent"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: src/Admin/Pages/About.php:656
|
311 |
msgid "Complete Email Controls management for most default WordPress emails"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: src/Admin/Pages/About.php:664
|
315 |
msgid "Only default list of mailers"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: src/Admin/Pages/About.php:670
|
319 |
msgid "Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: src/Admin/Pages/About.php:678
|
323 |
msgid "Limited Support"
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: src/Admin/Pages/About.php:684
|
327 |
msgid "Priority Support"
|
328 |
msgstr ""
|
329 |
|
1662 |
msgid "Your site is running an outdated version of PHP that is no longer supported and may cause issues with %1$s. %2$sRead more%3$s for additional information."
|
1663 |
msgstr ""
|
1664 |
|
1665 |
+
#: wp_mail_smtp.php:130
|
1666 |
msgid "Please deactivate the free version of the WP Mail SMTP plugin before activating WP Mail SMTP Pro."
|
1667 |
msgstr ""
|
assets/libs/jquery-confirm.min.css
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
/*!
|
2 |
-
* jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/)
|
3 |
-
* Author: boniface pereira
|
4 |
-
* Website: www.craftpip.com
|
5 |
-
* Contact: hey@craftpip.com
|
6 |
-
*
|
7 |
-
* Copyright 2013-2019 jquery-confirm
|
8 |
-
* Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE)
|
9 |
*/@-webkit-keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}body[class*=jconfirm-no-scroll-]{overflow:hidden!important}.jconfirm{position:fixed;top:0;left:0;right:0;bottom:0;z-index:99999999;font-family:inherit;overflow:hidden}.jconfirm .jconfirm-bg{position:fixed;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .4s;transition:opacity .4s}.jconfirm .jconfirm-bg.jconfirm-bg-h{opacity:0!important}.jconfirm .jconfirm-scrollpane{-webkit-perspective:500px;perspective:500px;-webkit-perspective-origin:center;perspective-origin:center;display:table;width:100%;height:100%}.jconfirm .jconfirm-row{display:table-row;width:100%}.jconfirm .jconfirm-cell{display:table-cell;vertical-align:middle}.jconfirm .jconfirm-holder{max-height:100%;padding:50px 0}.jconfirm .jconfirm-box-container{-webkit-transition:-webkit-transform;transition:-webkit-transform;transition:transform;transition:transform,-webkit-transform}.jconfirm .jconfirm-box-container.jconfirm-no-transition{-webkit-transition:none!important;transition:none!important}.jconfirm .jconfirm-box{background:white;border-radius:4px;position:relative;outline:0;padding:15px 15px 0;overflow:hidden;margin-left:auto;margin-right:auto}@-webkit-keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@-webkit-keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@-webkit-keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@-webkit-keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@-webkit-keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@-webkit-keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}@keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}.jconfirm .jconfirm-box.jconfirm-type-animated{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.jconfirm .jconfirm-box.jconfirm-type-blue{border-top:solid 7px #3498db;-webkit-animation-name:type-blue;animation-name:type-blue}.jconfirm .jconfirm-box.jconfirm-type-green{border-top:solid 7px #2ecc71;-webkit-animation-name:type-green;animation-name:type-green}.jconfirm .jconfirm-box.jconfirm-type-red{border-top:solid 7px #e74c3c;-webkit-animation-name:type-red;animation-name:type-red}.jconfirm .jconfirm-box.jconfirm-type-orange{border-top:solid 7px #f1c40f;-webkit-animation-name:type-orange;animation-name:type-orange}.jconfirm .jconfirm-box.jconfirm-type-purple{border-top:solid 7px #9b59b6;-webkit-animation-name:type-purple;animation-name:type-purple}.jconfirm .jconfirm-box.jconfirm-type-dark{border-top:solid 7px #34495e;-webkit-animation-name:type-dark;animation-name:type-dark}.jconfirm .jconfirm-box.loading{height:120px}.jconfirm .jconfirm-box.loading:before{content:'';position:absolute;left:0;background:white;right:0;top:0;bottom:0;border-radius:10px;z-index:1}.jconfirm .jconfirm-box.loading:after{opacity:.6;content:'';height:30px;width:30px;border:solid 3px transparent;position:absolute;left:50%;margin-left:-15px;border-radius:50%;-webkit-animation:jconfirm-spin 1s infinite linear;animation:jconfirm-spin 1s infinite linear;border-bottom-color:dodgerblue;top:50%;margin-top:-15px;z-index:2}.jconfirm .jconfirm-box div.jconfirm-closeIcon{height:20px;width:20px;position:absolute;top:10px;right:10px;cursor:pointer;opacity:.6;text-align:center;font-size:27px!important;line-height:14px!important;display:none;z-index:1}.jconfirm .jconfirm-box div.jconfirm-closeIcon:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-closeIcon .fa{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .glyphicon{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .zmdi{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon:hover{opacity:1}.jconfirm .jconfirm-box div.jconfirm-title-c{display:block;font-size:22px;line-height:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-bottom:15px}.jconfirm .jconfirm-box div.jconfirm-title-c.jconfirm-hand{cursor:move}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{font-size:inherit;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i{vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:inherit;font-family:inherit;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-content-pane{margin-bottom:15px;height:auto;-webkit-transition:height .4s ease-in;transition:height .4s ease-in;display:inline-block;width:100%;position:relative;overflow-x:hidden;overflow-y:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane.no-scroll{overflow-y:hidden}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar{width:3px}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-track{background:rgba(0,0,0,0.1)}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-thumb{background:#666;border-radius:3px}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content{overflow:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content img{max-width:100%;height:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content:empty{display:none}.jconfirm .jconfirm-box .jconfirm-buttons{padding-bottom:11px}.jconfirm .jconfirm-box .jconfirm-buttons>button{margin-bottom:4px;margin-left:2px;margin-right:2px}.jconfirm .jconfirm-box .jconfirm-buttons button{display:inline-block;padding:6px 12px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:4px;min-height:1em;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease,-webkit-box-shadow .1s ease;-webkit-tap-highlight-color:transparent;border:0;background-image:none}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue{background-color:#3498db;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue:hover{background-color:#2980b9;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green{background-color:#2ecc71;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green:hover{background-color:#27ae60;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red{background-color:#e74c3c;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red:hover{background-color:#c0392b;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange{background-color:#f1c40f;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange:hover{background-color:#f39c12;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default{background-color:#ecf0f1;color:#000;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default:hover{background-color:#bdc3c7;color:#000}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple{background-color:#9b59b6;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple:hover{background-color:#8e44ad;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark{background-color:#34495e;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark:hover{background-color:#2c3e50;color:#FFF}.jconfirm .jconfirm-box.jconfirm-type-red .jconfirm-title-c .jconfirm-icon-c{color:#e74c3c!important}.jconfirm .jconfirm-box.jconfirm-type-blue .jconfirm-title-c .jconfirm-icon-c{color:#3498db!important}.jconfirm .jconfirm-box.jconfirm-type-green .jconfirm-title-c .jconfirm-icon-c{color:#2ecc71!important}.jconfirm .jconfirm-box.jconfirm-type-purple .jconfirm-title-c .jconfirm-icon-c{color:#9b59b6!important}.jconfirm .jconfirm-box.jconfirm-type-orange .jconfirm-title-c .jconfirm-icon-c{color:#f1c40f!important}.jconfirm .jconfirm-box.jconfirm-type-dark .jconfirm-title-c .jconfirm-icon-c{color:#34495e!important}.jconfirm .jconfirm-clear{clear:both}.jconfirm.jconfirm-rtl{direction:rtl}.jconfirm.jconfirm-rtl div.jconfirm-closeIcon{left:5px;right:auto}.jconfirm.jconfirm-white .jconfirm-bg,.jconfirm.jconfirm-light .jconfirm-bg{background-color:#444;opacity:.2}.jconfirm.jconfirm-white .jconfirm-box,.jconfirm.jconfirm-light .jconfirm-box{-webkit-box-shadow:0 2px 6px rgba(0,0,0,0.2);box-shadow:0 2px 6px rgba(0,0,0,0.2);border-radius:5px}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default{-webkit-box-shadow:none;box-shadow:none;color:#333}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#ddd}.jconfirm.jconfirm-white.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-black .jconfirm-bg,.jconfirm.jconfirm-dark .jconfirm-bg{background-color:darkslategray;opacity:.4}.jconfirm.jconfirm-black .jconfirm-box,.jconfirm.jconfirm-dark .jconfirm-box{-webkit-box-shadow:0 2px 6px rgba(0,0,0,0.2);box-shadow:0 2px 6px rgba(0,0,0,0.2);background:#444;border-radius:5px;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button{border:0;background-image:none;text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none;-webkit-transition:background .1s;transition:background .1s;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default{-webkit-box-shadow:none;box-shadow:none;color:#fff;background:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#666}.jconfirm.jconfirm-black.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-shake{-webkit-animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-glow{-webkit-animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@-webkit-keyframes glow{0%,100%{-webkit-box-shadow:0 0 0 red;box-shadow:0 0 0 red}50%{-webkit-box-shadow:0 0 30px red;box-shadow:0 0 30px red}}@keyframes glow{0%,100%{-webkit-box-shadow:0 0 0 red;box-shadow:0 0 0 red}50%{-webkit-box-shadow:0 0 30px red;box-shadow:0 0 30px red}}.jconfirm{-webkit-perspective:400px;perspective:400px}.jconfirm .jconfirm-box{opacity:1;-webkit-transition-property:all;transition-property:all}.jconfirm .jconfirm-box.jconfirm-animation-top,.jconfirm .jconfirm-box.jconfirm-animation-left,.jconfirm .jconfirm-box.jconfirm-animation-right,.jconfirm .jconfirm-box.jconfirm-animation-bottom,.jconfirm .jconfirm-box.jconfirm-animation-opacity,.jconfirm .jconfirm-box.jconfirm-animation-zoom,.jconfirm .jconfirm-box.jconfirm-animation-scale,.jconfirm .jconfirm-box.jconfirm-animation-none,.jconfirm .jconfirm-box.jconfirm-animation-rotate,.jconfirm .jconfirm-box.jconfirm-animation-rotatex,.jconfirm .jconfirm-box.jconfirm-animation-rotatey,.jconfirm .jconfirm-box.jconfirm-animation-scaley,.jconfirm .jconfirm-box.jconfirm-animation-scalex{opacity:0}.jconfirm .jconfirm-box.jconfirm-animation-rotate{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.jconfirm .jconfirm-box.jconfirm-animation-rotatex{-webkit-transform:rotateX(90deg);transform:rotateX(90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatexr{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatey{-webkit-transform:rotatey(90deg);transform:rotatey(90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotateyr{-webkit-transform:rotatey(-90deg);transform:rotatey(-90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scaley{-webkit-transform:scaley(1.5);transform:scaley(1.5);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scalex{-webkit-transform:scalex(1.5);transform:scalex(1.5);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-top{-webkit-transform:translate(0px,-100px);transform:translate(0px,-100px)}.jconfirm .jconfirm-box.jconfirm-animation-left{-webkit-transform:translate(-100px,0px);transform:translate(-100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-right{-webkit-transform:translate(100px,0px);transform:translate(100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-bottom{-webkit-transform:translate(0px,100px);transform:translate(0px,100px)}.jconfirm .jconfirm-box.jconfirm-animation-zoom{-webkit-transform:scale(1.2);transform:scale(1.2)}.jconfirm .jconfirm-box.jconfirm-animation-scale{-webkit-transform:scale(0.5);transform:scale(0.5)}.jconfirm .jconfirm-box.jconfirm-animation-none{visibility:hidden}.jconfirm.jconfirm-supervan .jconfirm-bg{background-color:rgba(54,70,93,0.95)}.jconfirm.jconfirm-supervan .jconfirm-box{background-color:transparent}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-blue{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-green{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-red{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-orange{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-purple{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-dark{border:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-closeIcon{color:white}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c{text-align:center;color:white;font-size:28px;font-weight:normal}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c>*{padding-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content-pane{margin-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content{text-align:center;color:white}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons button{font-size:16px;border-radius:2px;background:#303f53;text-shadow:none;border:0;color:white;padding:10px;min-width:100px}.jconfirm.jconfirm-supervan.jconfirm-rtl .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-material .jconfirm-bg{background-color:rgba(0,0,0,0.67)}.jconfirm.jconfirm-material .jconfirm-box{background-color:white;-webkit-box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 25px 10px 25px}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons{text-align:right}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-weight:500}.jconfirm.jconfirm-material.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-bootstrap .jconfirm-bg{background-color:rgba(0,0,0,0.21)}.jconfirm.jconfirm-bootstrap .jconfirm-box{background-color:white;-webkit-box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);border:solid 1px rgba(0,0,0,0.4);padding:15px 0 0}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold;padding-left:15px;padding-right:15px}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87);padding:0 15px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons{text-align:right;padding:10px;margin:-5px 0 0;border-top:solid 1px #ddd;overflow:hidden;border-radius:0 0 4px 4px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons button{font-weight:500}.jconfirm.jconfirm-bootstrap.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-modern .jconfirm-bg{background-color:slategray;opacity:.6}.jconfirm.jconfirm-modern .jconfirm-box{background-color:white;-webkit-box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 30px 15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87);top:15px;right:15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:24px;font-weight:bold;text-align:center;margin-bottom:10px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{-webkit-transition:-webkit-transform .5s;transition:-webkit-transform .5s;transition:transform .5s;transition:transform .5s,-webkit-transform .5s;-webkit-transform:scale(0);transform:scale(0);display:block;margin-right:0;margin-left:0;margin-bottom:10px;font-size:69px;color:#aaa}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-content{text-align:center;font-size:15px;color:#777;margin-bottom:25px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button{font-weight:bold;text-transform:uppercase;-webkit-transition:background .1s;transition:background .1s;padding:10px 20px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button+button{margin-left:4px}.jconfirm.jconfirm-modern.jconfirm-open .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{-webkit-transform:scale(1);transform:scale(1)}
|
1 |
+
/*!
|
2 |
+
* jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/)
|
3 |
+
* Author: boniface pereira
|
4 |
+
* Website: www.craftpip.com
|
5 |
+
* Contact: hey@craftpip.com
|
6 |
+
*
|
7 |
+
* Copyright 2013-2019 jquery-confirm
|
8 |
+
* Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE)
|
9 |
*/@-webkit-keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes jconfirm-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}body[class*=jconfirm-no-scroll-]{overflow:hidden!important}.jconfirm{position:fixed;top:0;left:0;right:0;bottom:0;z-index:99999999;font-family:inherit;overflow:hidden}.jconfirm .jconfirm-bg{position:fixed;top:0;left:0;right:0;bottom:0;-webkit-transition:opacity .4s;transition:opacity .4s}.jconfirm .jconfirm-bg.jconfirm-bg-h{opacity:0!important}.jconfirm .jconfirm-scrollpane{-webkit-perspective:500px;perspective:500px;-webkit-perspective-origin:center;perspective-origin:center;display:table;width:100%;height:100%}.jconfirm .jconfirm-row{display:table-row;width:100%}.jconfirm .jconfirm-cell{display:table-cell;vertical-align:middle}.jconfirm .jconfirm-holder{max-height:100%;padding:50px 0}.jconfirm .jconfirm-box-container{-webkit-transition:-webkit-transform;transition:-webkit-transform;transition:transform;transition:transform,-webkit-transform}.jconfirm .jconfirm-box-container.jconfirm-no-transition{-webkit-transition:none!important;transition:none!important}.jconfirm .jconfirm-box{background:white;border-radius:4px;position:relative;outline:0;padding:15px 15px 0;overflow:hidden;margin-left:auto;margin-right:auto}@-webkit-keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@keyframes type-blue{1%,100%{border-color:#3498db}50%{border-color:#5faee3}}@-webkit-keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@keyframes type-green{1%,100%{border-color:#2ecc71}50%{border-color:#54d98c}}@-webkit-keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@keyframes type-red{1%,100%{border-color:#e74c3c}50%{border-color:#ed7669}}@-webkit-keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@keyframes type-orange{1%,100%{border-color:#f1c40f}50%{border-color:#f4d03f}}@-webkit-keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@keyframes type-purple{1%,100%{border-color:#9b59b6}50%{border-color:#b07cc6}}@-webkit-keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}@keyframes type-dark{1%,100%{border-color:#34495e}50%{border-color:#46627f}}.jconfirm .jconfirm-box.jconfirm-type-animated{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.jconfirm .jconfirm-box.jconfirm-type-blue{border-top:solid 7px #3498db;-webkit-animation-name:type-blue;animation-name:type-blue}.jconfirm .jconfirm-box.jconfirm-type-green{border-top:solid 7px #2ecc71;-webkit-animation-name:type-green;animation-name:type-green}.jconfirm .jconfirm-box.jconfirm-type-red{border-top:solid 7px #e74c3c;-webkit-animation-name:type-red;animation-name:type-red}.jconfirm .jconfirm-box.jconfirm-type-orange{border-top:solid 7px #f1c40f;-webkit-animation-name:type-orange;animation-name:type-orange}.jconfirm .jconfirm-box.jconfirm-type-purple{border-top:solid 7px #9b59b6;-webkit-animation-name:type-purple;animation-name:type-purple}.jconfirm .jconfirm-box.jconfirm-type-dark{border-top:solid 7px #34495e;-webkit-animation-name:type-dark;animation-name:type-dark}.jconfirm .jconfirm-box.loading{height:120px}.jconfirm .jconfirm-box.loading:before{content:'';position:absolute;left:0;background:white;right:0;top:0;bottom:0;border-radius:10px;z-index:1}.jconfirm .jconfirm-box.loading:after{opacity:.6;content:'';height:30px;width:30px;border:solid 3px transparent;position:absolute;left:50%;margin-left:-15px;border-radius:50%;-webkit-animation:jconfirm-spin 1s infinite linear;animation:jconfirm-spin 1s infinite linear;border-bottom-color:dodgerblue;top:50%;margin-top:-15px;z-index:2}.jconfirm .jconfirm-box div.jconfirm-closeIcon{height:20px;width:20px;position:absolute;top:10px;right:10px;cursor:pointer;opacity:.6;text-align:center;font-size:27px!important;line-height:14px!important;display:none;z-index:1}.jconfirm .jconfirm-box div.jconfirm-closeIcon:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-closeIcon .fa{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .glyphicon{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon .zmdi{font-size:16px}.jconfirm .jconfirm-box div.jconfirm-closeIcon:hover{opacity:1}.jconfirm .jconfirm-box div.jconfirm-title-c{display:block;font-size:22px;line-height:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;padding-bottom:15px}.jconfirm .jconfirm-box div.jconfirm-title-c.jconfirm-hand{cursor:move}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{font-size:inherit;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c i{vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:inherit;font-family:inherit;display:inline-block;vertical-align:middle}.jconfirm .jconfirm-box div.jconfirm-title-c .jconfirm-title:empty{display:none}.jconfirm .jconfirm-box div.jconfirm-content-pane{margin-bottom:15px;height:auto;-webkit-transition:height .4s ease-in;transition:height .4s ease-in;display:inline-block;width:100%;position:relative;overflow-x:hidden;overflow-y:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane.no-scroll{overflow-y:hidden}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar{width:3px}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-track{background:rgba(0,0,0,0.1)}.jconfirm .jconfirm-box div.jconfirm-content-pane::-webkit-scrollbar-thumb{background:#666;border-radius:3px}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content{overflow:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content img{max-width:100%;height:auto}.jconfirm .jconfirm-box div.jconfirm-content-pane .jconfirm-content:empty{display:none}.jconfirm .jconfirm-box .jconfirm-buttons{padding-bottom:11px}.jconfirm .jconfirm-box .jconfirm-buttons>button{margin-bottom:4px;margin-left:2px;margin-right:2px}.jconfirm .jconfirm-box .jconfirm-buttons button{display:inline-block;padding:6px 12px;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:4px;min-height:1em;-webkit-transition:opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,background .1s ease,-webkit-box-shadow .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease;transition:opacity .1s ease,background-color .1s ease,color .1s ease,box-shadow .1s ease,background .1s ease,-webkit-box-shadow .1s ease;-webkit-tap-highlight-color:transparent;border:0;background-image:none}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue{background-color:#3498db;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-blue:hover{background-color:#2980b9;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green{background-color:#2ecc71;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-green:hover{background-color:#27ae60;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red{background-color:#e74c3c;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-red:hover{background-color:#c0392b;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange{background-color:#f1c40f;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-orange:hover{background-color:#f39c12;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default{background-color:#ecf0f1;color:#000;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-default:hover{background-color:#bdc3c7;color:#000}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple{background-color:#9b59b6;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-purple:hover{background-color:#8e44ad;color:#FFF}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark{background-color:#34495e;color:#FFF;text-shadow:none;-webkit-transition:background .2s;transition:background .2s}.jconfirm .jconfirm-box .jconfirm-buttons button.btn-dark:hover{background-color:#2c3e50;color:#FFF}.jconfirm .jconfirm-box.jconfirm-type-red .jconfirm-title-c .jconfirm-icon-c{color:#e74c3c!important}.jconfirm .jconfirm-box.jconfirm-type-blue .jconfirm-title-c .jconfirm-icon-c{color:#3498db!important}.jconfirm .jconfirm-box.jconfirm-type-green .jconfirm-title-c .jconfirm-icon-c{color:#2ecc71!important}.jconfirm .jconfirm-box.jconfirm-type-purple .jconfirm-title-c .jconfirm-icon-c{color:#9b59b6!important}.jconfirm .jconfirm-box.jconfirm-type-orange .jconfirm-title-c .jconfirm-icon-c{color:#f1c40f!important}.jconfirm .jconfirm-box.jconfirm-type-dark .jconfirm-title-c .jconfirm-icon-c{color:#34495e!important}.jconfirm .jconfirm-clear{clear:both}.jconfirm.jconfirm-rtl{direction:rtl}.jconfirm.jconfirm-rtl div.jconfirm-closeIcon{left:5px;right:auto}.jconfirm.jconfirm-white .jconfirm-bg,.jconfirm.jconfirm-light .jconfirm-bg{background-color:#444;opacity:.2}.jconfirm.jconfirm-white .jconfirm-box,.jconfirm.jconfirm-light .jconfirm-box{-webkit-box-shadow:0 2px 6px rgba(0,0,0,0.2);box-shadow:0 2px 6px rgba(0,0,0,0.2);border-radius:5px}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default{-webkit-box-shadow:none;box-shadow:none;color:#333}.jconfirm.jconfirm-white .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-light .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#ddd}.jconfirm.jconfirm-white.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-light.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-black .jconfirm-bg,.jconfirm.jconfirm-dark .jconfirm-bg{background-color:darkslategray;opacity:.4}.jconfirm.jconfirm-black .jconfirm-box,.jconfirm.jconfirm-dark .jconfirm-box{-webkit-box-shadow:0 2px 6px rgba(0,0,0,0.2);box-shadow:0 2px 6px rgba(0,0,0,0.2);background:#444;border-radius:5px;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons{float:right}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button{border:0;background-image:none;text-transform:uppercase;font-size:14px;font-weight:bold;text-shadow:none;-webkit-transition:background .1s;transition:background .1s;color:white}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default{-webkit-box-shadow:none;box-shadow:none;color:#fff;background:0}.jconfirm.jconfirm-black .jconfirm-box .jconfirm-buttons button.btn-default:hover,.jconfirm.jconfirm-dark .jconfirm-box .jconfirm-buttons button.btn-default:hover{background:#666}.jconfirm.jconfirm-black.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c,.jconfirm.jconfirm-dark.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-shake{-webkit-animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:shake .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.jconfirm .jconfirm-box.hilight.jconfirm-hilight-glow{-webkit-animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;animation:glow .82s cubic-bezier(0.36,0.07,0.19,0.97) both;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}20%,80%{-webkit-transform:translate3d(4px,0,0);transform:translate3d(4px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-8px,0,0);transform:translate3d(-8px,0,0)}40%,60%{-webkit-transform:translate3d(8px,0,0);transform:translate3d(8px,0,0)}}@-webkit-keyframes glow{0%,100%{-webkit-box-shadow:0 0 0 red;box-shadow:0 0 0 red}50%{-webkit-box-shadow:0 0 30px red;box-shadow:0 0 30px red}}@keyframes glow{0%,100%{-webkit-box-shadow:0 0 0 red;box-shadow:0 0 0 red}50%{-webkit-box-shadow:0 0 30px red;box-shadow:0 0 30px red}}.jconfirm{-webkit-perspective:400px;perspective:400px}.jconfirm .jconfirm-box{opacity:1;-webkit-transition-property:all;transition-property:all}.jconfirm .jconfirm-box.jconfirm-animation-top,.jconfirm .jconfirm-box.jconfirm-animation-left,.jconfirm .jconfirm-box.jconfirm-animation-right,.jconfirm .jconfirm-box.jconfirm-animation-bottom,.jconfirm .jconfirm-box.jconfirm-animation-opacity,.jconfirm .jconfirm-box.jconfirm-animation-zoom,.jconfirm .jconfirm-box.jconfirm-animation-scale,.jconfirm .jconfirm-box.jconfirm-animation-none,.jconfirm .jconfirm-box.jconfirm-animation-rotate,.jconfirm .jconfirm-box.jconfirm-animation-rotatex,.jconfirm .jconfirm-box.jconfirm-animation-rotatey,.jconfirm .jconfirm-box.jconfirm-animation-scaley,.jconfirm .jconfirm-box.jconfirm-animation-scalex{opacity:0}.jconfirm .jconfirm-box.jconfirm-animation-rotate{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.jconfirm .jconfirm-box.jconfirm-animation-rotatex{-webkit-transform:rotateX(90deg);transform:rotateX(90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatexr{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotatey{-webkit-transform:rotatey(90deg);transform:rotatey(90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-rotateyr{-webkit-transform:rotatey(-90deg);transform:rotatey(-90deg);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scaley{-webkit-transform:scaley(1.5);transform:scaley(1.5);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-scalex{-webkit-transform:scalex(1.5);transform:scalex(1.5);-webkit-transform-origin:center;transform-origin:center}.jconfirm .jconfirm-box.jconfirm-animation-top{-webkit-transform:translate(0px,-100px);transform:translate(0px,-100px)}.jconfirm .jconfirm-box.jconfirm-animation-left{-webkit-transform:translate(-100px,0px);transform:translate(-100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-right{-webkit-transform:translate(100px,0px);transform:translate(100px,0px)}.jconfirm .jconfirm-box.jconfirm-animation-bottom{-webkit-transform:translate(0px,100px);transform:translate(0px,100px)}.jconfirm .jconfirm-box.jconfirm-animation-zoom{-webkit-transform:scale(1.2);transform:scale(1.2)}.jconfirm .jconfirm-box.jconfirm-animation-scale{-webkit-transform:scale(0.5);transform:scale(0.5)}.jconfirm .jconfirm-box.jconfirm-animation-none{visibility:hidden}.jconfirm.jconfirm-supervan .jconfirm-bg{background-color:rgba(54,70,93,0.95)}.jconfirm.jconfirm-supervan .jconfirm-box{background-color:transparent}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-blue{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-green{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-red{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-orange{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-purple{border:0}.jconfirm.jconfirm-supervan .jconfirm-box.jconfirm-type-dark{border:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-closeIcon{color:white}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c{text-align:center;color:white;font-size:28px;font-weight:normal}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c>*{padding-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content-pane{margin-bottom:25px}.jconfirm.jconfirm-supervan .jconfirm-box div.jconfirm-content{text-align:center;color:white}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-supervan .jconfirm-box .jconfirm-buttons button{font-size:16px;border-radius:2px;background:#303f53;text-shadow:none;border:0;color:white;padding:10px;min-width:100px}.jconfirm.jconfirm-supervan.jconfirm-rtl .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-material .jconfirm-bg{background-color:rgba(0,0,0,0.67)}.jconfirm.jconfirm-material .jconfirm-box{background-color:white;-webkit-box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 25px 10px 25px}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold}.jconfirm.jconfirm-material .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons{text-align:right}.jconfirm.jconfirm-material .jconfirm-box .jconfirm-buttons button{text-transform:uppercase;font-weight:500}.jconfirm.jconfirm-material.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-bootstrap .jconfirm-bg{background-color:rgba(0,0,0,0.21)}.jconfirm.jconfirm-bootstrap .jconfirm-box{background-color:white;-webkit-box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);box-shadow:0 3px 8px 0 rgba(0,0,0,0.2);border:solid 1px rgba(0,0,0,0.4);padding:15px 0 0}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{margin-right:8px;margin-left:0}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87)}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:22px;font-weight:bold;padding-left:15px;padding-right:15px}.jconfirm.jconfirm-bootstrap .jconfirm-box div.jconfirm-content{color:rgba(0,0,0,0.87);padding:0 15px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons{text-align:right;padding:10px;margin:-5px 0 0;border-top:solid 1px #ddd;overflow:hidden;border-radius:0 0 4px 4px}.jconfirm.jconfirm-bootstrap .jconfirm-box .jconfirm-buttons button{font-weight:500}.jconfirm.jconfirm-bootstrap.jconfirm-rtl .jconfirm-title-c .jconfirm-icon-c{margin-left:8px;margin-right:0}.jconfirm.jconfirm-modern .jconfirm-bg{background-color:slategray;opacity:.6}.jconfirm.jconfirm-modern .jconfirm-box{background-color:white;-webkit-box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);box-shadow:0 7px 8px -4px rgba(0,0,0,0.2),0 13px 19px 2px rgba(0,0,0,0.14),0 5px 24px 4px rgba(0,0,0,0.12);padding:30px 30px 15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-closeIcon{color:rgba(0,0,0,0.87);top:15px;right:15px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c{color:rgba(0,0,0,0.87);font-size:24px;font-weight:bold;text-align:center;margin-bottom:10px}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-title-c .jconfirm-icon-c{-webkit-transition:-webkit-transform .5s;transition:-webkit-transform .5s;transition:transform .5s;transition:transform .5s,-webkit-transform .5s;-webkit-transform:scale(0);transform:scale(0);display:block;margin-right:0;margin-left:0;margin-bottom:10px;font-size:69px;color:#aaa}.jconfirm.jconfirm-modern .jconfirm-box div.jconfirm-content{text-align:center;font-size:15px;color:#777;margin-bottom:25px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons{text-align:center}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button{font-weight:bold;text-transform:uppercase;-webkit-transition:background .1s;transition:background .1s;padding:10px 20px}.jconfirm.jconfirm-modern .jconfirm-box .jconfirm-buttons button+button{margin-left:4px}.jconfirm.jconfirm-modern.jconfirm-open .jconfirm-box .jconfirm-title-c .jconfirm-icon-c{-webkit-transform:scale(1);transform:scale(1)}
|
assets/libs/jquery-confirm.min.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
/*!
|
2 |
-
* jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/)
|
3 |
-
* Author: Boniface Pereira
|
4 |
-
* Website: www.craftpip.com
|
5 |
-
* Contact: hey@craftpip.com
|
6 |
-
*
|
7 |
-
* Copyright 2013-2019 jquery-confirm
|
8 |
-
* Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE)
|
9 |
-
*/
|
10 |
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{if(typeof module==="object"&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=="undefined"){jQuery=require("jquery");}else{jQuery=require("jquery")(root);}}factory(jQuery);return jQuery;};}else{factory(jQuery);}}}(function($){var w=window;$.fn.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}$(this).each(function(){var $this=$(this);if($this.attr("jc-attached")){console.warn("jConfirm has already been attached to this element ",$this[0]);return;}$this.on("click",function(e){e.preventDefault();var jcOption=$.extend({},options);if($this.attr("data-title")){jcOption.title=$this.attr("data-title");}if($this.attr("data-content")){jcOption.content=$this.attr("data-content");}if(typeof jcOption.buttons==="undefined"){jcOption.buttons={};}jcOption["$target"]=$this;if($this.attr("href")&&Object.keys(jcOption.buttons).length===0){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];jcOption.buttons=buttons;jcOption.buttons[firstBtn].action=function(){location.href=$this.attr("href");};}jcOption.closeIcon=false;var instance=$.confirm(jcOption);});$this.attr("jc-attached",true);});return $(this);};$.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}var putDefaultButtons=!(options.buttons===false);if(typeof options.buttons!=="object"){options.buttons={};}if(Object.keys(options.buttons).length===0&&putDefaultButtons){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});options.buttons=buttons;}return w.jconfirm(options);};$.alert=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}var putDefaultButtons=!(options.buttons===false);if(typeof options.buttons!=="object"){options.buttons={};}if(Object.keys(options.buttons).length===0&&putDefaultButtons){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];options.buttons[firstBtn]=buttons[firstBtn];}return w.jconfirm(options);};$.dialog=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false,closeIcon:function(){}};}options.buttons={};if(typeof options.closeIcon==="undefined"){options.closeIcon=function(){};}options.confirmKeys=[13];return w.jconfirm(options);};w.jconfirm=function(options){if(typeof options==="undefined"){options={};}var pluginOptions=$.extend(true,{},w.jconfirm.pluginDefaults);if(w.jconfirm.defaults){pluginOptions=$.extend(true,pluginOptions,w.jconfirm.defaults);}pluginOptions=$.extend(true,{},pluginOptions,options);var instance=new w.Jconfirm(pluginOptions);w.jconfirm.instances.push(instance);return instance;};w.Jconfirm=function(options){$.extend(this,options);this._init();};w.Jconfirm.prototype={_init:function(){var that=this;if(!w.jconfirm.instances.length){w.jconfirm.lastFocused=$("body").find(":focus");}this._id=Math.round(Math.random()*99999);this.contentParsed=$(document.createElement("div"));if(!this.lazyOpen){setTimeout(function(){that.open();},0);}},_buildHTML:function(){var that=this;this._parseAnimation(this.animation,"o");this._parseAnimation(this.closeAnimation,"c");this._parseBgDismissAnimation(this.backgroundDismissAnimation);this._parseColumnClass(this.columnClass);this._parseTheme(this.theme);this._parseType(this.type);var template=$(this.template);template.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed);if(this.typeAnimated){template.find(".jconfirm-box").addClass("jconfirm-type-animated");}if(this.useBootstrap){template.find(".jc-bs3-row").addClass(this.bootstrapClasses.row);template.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center");template.find(".jconfirm-box-container").addClass(this.columnClassParsed);if(this.containerFluid){template.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid);}else{template.find(".jc-bs3-container").addClass(this.bootstrapClasses.container);}}else{template.find(".jconfirm-box").css("width",this.boxWidth);}if(this.titleClass){template.find(".jconfirm-title-c").addClass(this.titleClass);}template.addClass(this.themeParsed);var ariaLabel="jconfirm-box"+this._id;template.find(".jconfirm-box").attr("aria-labelledby",ariaLabel).attr("tabindex",-1);template.find(".jconfirm-content").attr("id",ariaLabel);if(this.bgOpacity!==null){template.find(".jconfirm-bg").css("opacity",this.bgOpacity);}if(this.rtl){template.addClass("jconfirm-rtl");}this.$el=template.appendTo(this.container);this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container");this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box");this.$jconfirmBg=this.$el.find(".jconfirm-bg");this.$title=this.$el.find(".jconfirm-title");this.$titleContainer=this.$el.find(".jconfirm-title-c");this.$content=this.$el.find("div.jconfirm-content");this.$contentPane=this.$el.find(".jconfirm-content-pane");this.$icon=this.$el.find(".jconfirm-icon-c");this.$closeIcon=this.$el.find(".jconfirm-closeIcon");this.$holder=this.$el.find(".jconfirm-holder");this.$btnc=this.$el.find(".jconfirm-buttons");this.$scrollPane=this.$el.find(".jconfirm-scrollpane");that.setStartingPoint();this._contentReady=$.Deferred();this._modalReady=$.Deferred();this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom,});this.setTitle();this.setIcon();this._setButtons();this._parseContent();this.initDraggable();if(this.isAjax){this.showLoading(false);}$.when(this._contentReady,this._modalReady).then(function(){if(that.isAjaxLoading){setTimeout(function(){that.isAjaxLoading=false;that.setContent();that.setTitle();that.setIcon();setTimeout(function(){that.hideLoading(false);that._updateContentMaxHeight();},100);if(typeof that.onContentReady==="function"){that.onContentReady();}},50);}else{that._updateContentMaxHeight();that.setTitle();that.setIcon();if(typeof that.onContentReady==="function"){that.onContentReady();}}if(that.autoClose){that._startCountDown();}}).then(function(){that._watchContent();});if(this.animation==="none"){this.animationSpeed=1;this.animationBounce=1;}this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce));this.$contentPane.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1));},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(type){this.typeParsed=this._typePrefix+type;},setType:function(type){var oldClass=this.typeParsed;this._parseType(type);this.$jconfirmBox.removeClass(oldClass).addClass(this.typeParsed);},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(theme){var previous=this.theme;this.theme=theme||this.theme;this._parseTheme(this.theme);if(previous){this.$el.removeClass(previous);}this.$el.addClass(this.themeParsed);this.theme=theme;},_parseTheme:function(theme){var that=this;theme=theme.split(",");$.each(theme,function(k,a){if(a.indexOf(that._themePrefix)===-1){theme[k]=that._themePrefix+$.trim(a);}});this.themeParsed=theme.join(" ").toLowerCase();},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(bgDismissAnimation){var animation=bgDismissAnimation.split(",");var that=this;$.each(animation,function(k,a){if(a.indexOf(that._bgDismissPrefix)===-1){animation[k]=that._bgDismissPrefix+$.trim(a);}});this.backgroundDismissAnimationParsed=animation.join(" ").toLowerCase();},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(animation){this.animation=animation||this.animation;this._parseAnimation(this.animation,"o");},_parseAnimation:function(animation,which){which=which||"o";var animations=animation.split(",");var that=this;$.each(animations,function(k,a){if(a.indexOf(that._animationPrefix)===-1){animations[k]=that._animationPrefix+$.trim(a);}});var a_string=animations.join(" ").toLowerCase();if(which==="o"){this.animationParsed=a_string;}else{this.closeAnimationParsed=a_string;}return a_string;},setCloseAnimation:function(closeAnimation){this.closeAnimation=closeAnimation||this.closeAnimation;this._parseAnimation(this.closeAnimation,"c");},setAnimationSpeed:function(speed){this.animationSpeed=speed||this.animationSpeed;},columnClassParsed:"",setColumnClass:function(colClass){if(!this.useBootstrap){console.warn("cannot set columnClass, useBootstrap is set to false");return;}this.columnClass=colClass||this.columnClass;this._parseColumnClass(this.columnClass);this.$jconfirmBoxContainer.addClass(this.columnClassParsed);},_updateContentMaxHeight:function(){var height=$(window).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":height+"px"});},setBoxWidth:function(width){if(this.useBootstrap){console.warn("cannot set boxWidth, useBootstrap is set to true");return;}this.boxWidth=width;this.$jconfirmBox.css("width",width);},_parseColumnClass:function(colClass){colClass=colClass.toLowerCase();var p;switch(colClass){case"xl":case"xlarge":p="col-md-12";break;case"l":case"large":p="col-md-8 col-md-offset-2";break;case"m":case"medium":p="col-md-6 col-md-offset-3";break;case"s":case"small":p="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":p="col-md-2 col-md-offset-5";break;default:p=colClass;}this.columnClassParsed=p;},initDraggable:function(){var that=this;var $t=this.$titleContainer;this.resetDrag();if(this.draggable){$t.on("mousedown",function(e){$t.addClass("jconfirm-hand");that.mouseX=e.clientX;that.mouseY=e.clientY;that.isDrag=true;});$(window).on("mousemove."+this._id,function(e){if(that.isDrag){that.movingX=e.clientX-that.mouseX+that.initialX;that.movingY=e.clientY-that.mouseY+that.initialY;that.setDrag();}});$(window).on("mouseup."+this._id,function(){$t.removeClass("jconfirm-hand");if(that.isDrag){that.isDrag=false;that.initialX=that.movingX;that.initialY=that.movingY;}});}},resetDrag:function(){this.isDrag=false;this.initialX=0;this.initialY=0;this.movingX=0;this.movingY=0;this.mouseX=0;this.mouseY=0;this.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");},setDrag:function(){if(!this.draggable){return;}this.alignMiddle=false;var boxWidth=this.$jconfirmBox.outerWidth();var boxHeight=this.$jconfirmBox.outerHeight();var windowWidth=$(window).width();var windowHeight=$(window).height();var that=this;var dragUpdate=1;if(that.movingX%dragUpdate===0||that.movingY%dragUpdate===0){if(that.dragWindowBorder){var leftDistance=(windowWidth/2)-boxWidth/2;var topDistance=(windowHeight/2)-boxHeight/2;topDistance-=that.dragWindowGap;leftDistance-=that.dragWindowGap;if(leftDistance+that.movingX<0){that.movingX=-leftDistance;}else{if(leftDistance-that.movingX<0){that.movingX=leftDistance;}}if(topDistance+that.movingY<0){that.movingY=-topDistance;}else{if(topDistance-that.movingY<0){that.movingY=topDistance;}}}that.$jconfirmBoxContainer.css("transform","translate("+that.movingX+"px, "+that.movingY+"px)");}},_scrollTop:function(){if(typeof pageYOffset!=="undefined"){return pageYOffset;}else{var B=document.body;var D=document.documentElement;D=(D.clientHeight)?D:B;return D.scrollTop;}},_watchContent:function(){var that=this;if(this._timer){clearInterval(this._timer);}var prevContentHeight=0;this._timer=setInterval(function(){if(that.smoothContent){var contentHeight=that.$content.outerHeight()||0;if(contentHeight!==prevContentHeight){prevContentHeight=contentHeight;}var wh=$(window).height();var total=that.offsetTop+that.offsetBottom+that.$jconfirmBox.height()-that.$contentPane.height()+that.$content.height();if(total<wh){that.$contentPane.addClass("no-scroll");}else{that.$contentPane.removeClass("no-scroll");}}},this.watchInterval);},_overflowClass:"jconfirm-overflow",_hilightAnimating:false,highlight:function(){this.hiLightModal();},hiLightModal:function(){var that=this;if(this._hilightAnimating){return;}that.$body.addClass("hilight");var duration=parseFloat(that.$body.css("animation-duration"))||2;this._hilightAnimating=true;setTimeout(function(){that._hilightAnimating=false;that.$body.removeClass("hilight");},duration*1000);},_bindEvents:function(){var that=this;this.boxClicked=false;this.$scrollPane.click(function(e){if(!that.boxClicked){var buttonName=false;var shouldClose=false;var str;if(typeof that.backgroundDismiss==="function"){str=that.backgroundDismiss();}else{str=that.backgroundDismiss;}if(typeof str==="string"&&typeof that.buttons[str]!=="undefined"){buttonName=str;shouldClose=false;}else{if(typeof str==="undefined"||!!(str)===true){shouldClose=true;}else{shouldClose=false;}}if(buttonName){var btnResponse=that.buttons[buttonName].action.apply(that);shouldClose=(typeof btnResponse==="undefined")||!!(btnResponse);}if(shouldClose){that.close();}else{that.hiLightModal();}}that.boxClicked=false;});this.$jconfirmBox.click(function(e){that.boxClicked=true;});var isKeyDown=false;$(window).on("jcKeyDown."+that._id,function(e){if(!isKeyDown){isKeyDown=true;}});$(window).on("keyup."+that._id,function(e){if(isKeyDown){that.reactOnKey(e);isKeyDown=false;}});$(window).on("resize."+this._id,function(){that._updateContentMaxHeight();setTimeout(function(){that.resetDrag();},100);});},_cubic_bezier:"0.36, 0.55, 0.19",_getCSS:function(speed,bounce){return{"-webkit-transition-duration":speed/1000+"s","transition-duration":speed/1000+"s","-webkit-transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+bounce+")","transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+bounce+")"};},_setButtons:function(){var that=this;var total_buttons=0;if(typeof this.buttons!=="object"){this.buttons={};}$.each(this.buttons,function(key,button){total_buttons+=1;if(typeof button==="function"){that.buttons[key]=button={action:button};}that.buttons[key].text=button.text||key;that.buttons[key].btnClass=button.btnClass||"btn-default";that.buttons[key].action=button.action||function(){};that.buttons[key].keys=button.keys||[];that.buttons[key].isHidden=button.isHidden||false;that.buttons[key].isDisabled=button.isDisabled||false;$.each(that.buttons[key].keys,function(i,a){that.buttons[key].keys[i]=a.toLowerCase();});var button_element=$('<button type="button" class="btn"></button>').html(that.buttons[key].text).addClass(that.buttons[key].btnClass).prop("disabled",that.buttons[key].isDisabled).css("display",that.buttons[key].isHidden?"none":"").click(function(e){e.preventDefault();var res=that.buttons[key].action.apply(that,[that.buttons[key]]);that.onAction.apply(that,[key,that.buttons[key]]);that._stopCountDown();if(typeof res==="undefined"||res){that.close();}});that.buttons[key].el=button_element;that.buttons[key].setText=function(text){button_element.html(text);};that.buttons[key].addClass=function(className){button_element.addClass(className);};that.buttons[key].removeClass=function(className){button_element.removeClass(className);};that.buttons[key].disable=function(){that.buttons[key].isDisabled=true;button_element.prop("disabled",true);};that.buttons[key].enable=function(){that.buttons[key].isDisabled=false;button_element.prop("disabled",false);};that.buttons[key].show=function(){that.buttons[key].isHidden=false;button_element.css("display","");};that.buttons[key].hide=function(){that.buttons[key].isHidden=true;button_element.css("display","none");};that["$_"+key]=that["$$"+key]=button_element;that.$btnc.append(button_element);});if(total_buttons===0){this.$btnc.hide();}if(this.closeIcon===null&&total_buttons===0){this.closeIcon=true;}if(this.closeIcon){if(this.closeIconClass){var closeHtml='<i class="'+this.closeIconClass+'"></i>';this.$closeIcon.html(closeHtml);}this.$closeIcon.click(function(e){e.preventDefault();var buttonName=false;var shouldClose=false;var str;if(typeof that.closeIcon==="function"){str=that.closeIcon();}else{str=that.closeIcon;}if(typeof str==="string"&&typeof that.buttons[str]!=="undefined"){buttonName=str;shouldClose=false;}else{if(typeof str==="undefined"||!!(str)===true){shouldClose=true;}else{shouldClose=false;}}if(buttonName){var btnResponse=that.buttons[buttonName].action.apply(that);shouldClose=(typeof btnResponse==="undefined")||!!(btnResponse);}if(shouldClose){that.close();}});this.$closeIcon.show();}else{this.$closeIcon.hide();}},setTitle:function(string,force){force=force||false;if(typeof string!=="undefined"){if(typeof string==="string"){this.title=string;}else{if(typeof string==="function"){if(typeof string.promise==="function"){console.error("Promise was returned from title function, this is not supported.");}var response=string();if(typeof response==="string"){this.title=response;}else{this.title=false;}}else{this.title=false;}}}if(this.isAjaxLoading&&!force){return;}this.$title.html(this.title||"");this.updateTitleContainer();},setIcon:function(iconClass,force){force=force||false;if(typeof iconClass!=="undefined"){if(typeof iconClass==="string"){this.icon=iconClass;}else{if(typeof iconClass==="function"){var response=iconClass();if(typeof response==="string"){this.icon=response;}else{this.icon=false;}}else{this.icon=false;}}}if(this.isAjaxLoading&&!force){return;}this.$icon.html(this.icon?'<i class="'+this.icon+'"></i>':"");this.updateTitleContainer();},updateTitleContainer:function(){if(!this.title&&!this.icon){this.$titleContainer.hide();}else{this.$titleContainer.show();}},setContentPrepend:function(content,force){if(!content){return;}this.contentParsed.prepend(content);},setContentAppend:function(content){if(!content){return;}this.contentParsed.append(content);},setContent:function(content,force){force=!!force;var that=this;if(content){this.contentParsed.html("").append(content);}if(this.isAjaxLoading&&!force){return;}this.$content.html("");this.$content.append(this.contentParsed);setTimeout(function(){that.$body.find("input[autofocus]:visible:first").focus();},100);},loadingSpinner:false,showLoading:function(disableButtons){this.loadingSpinner=true;this.$jconfirmBox.addClass("loading");if(disableButtons){this.$btnc.find("button").prop("disabled",true);}},hideLoading:function(enableButtons){this.loadingSpinner=false;this.$jconfirmBox.removeClass("loading");if(enableButtons){this.$btnc.find("button").prop("disabled",false);}},ajaxResponse:false,contentParsed:"",isAjax:false,isAjaxLoading:false,_parseContent:function(){var that=this;var e=" ";if(typeof this.content==="function"){var res=this.content.apply(this);if(typeof res==="string"){this.content=res;}else{if(typeof res==="object"&&typeof res.always==="function"){this.isAjax=true;this.isAjaxLoading=true;res.always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded==="function"){that.contentLoaded(data,status,xhr);}});this.content=e;}else{this.content=e;}}}if(typeof this.content==="string"&&this.content.substr(0,4).toLowerCase()==="url:"){this.isAjax=true;this.isAjaxLoading=true;var u=this.content.substring(4,this.content.length);$.get(u).done(function(html){that.contentParsed.html(html);}).always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded==="function"){that.contentLoaded(data,status,xhr);}});}if(!this.content){this.content=e;}if(!this.isAjax){this.contentParsed.html(this.content);this.setContent();that._contentReady.resolve();}},_stopCountDown:function(){clearInterval(this.autoCloseInterval);if(this.$cd){this.$cd.remove();}},_startCountDown:function(){var that=this;var opt=this.autoClose.split("|");if(opt.length!==2){console.error("Invalid option for autoClose. example 'close|10000'");return false;}var button_key=opt[0];var time=parseInt(opt[1]);if(typeof this.buttons[button_key]==="undefined"){console.error("Invalid button key '"+button_key+"' for autoClose");return false;}var seconds=Math.ceil(time/1000);this.$cd=$('<span class="countdown"> ('+seconds+")</span>").appendTo(this["$_"+button_key]);this.autoCloseInterval=setInterval(function(){that.$cd.html(" ("+(seconds-=1)+") ");if(seconds<=0){that["$$"+button_key].trigger("click");that._stopCountDown();}},1000);},_getKey:function(key){switch(key){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space";}var initial=String.fromCharCode(key);if(/^[A-z0-9]+$/.test(initial)){return initial.toLowerCase();}else{return false;}},reactOnKey:function(e){var that=this;var a=$(".jconfirm");if(a.eq(a.length-1)[0]!==this.$el[0]){return false;}var key=e.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(key)){return false;}var keyChar=this._getKey(key);if(keyChar==="esc"&&this.escapeKey){if(this.escapeKey===true){this.$scrollPane.trigger("click");}else{if(typeof this.escapeKey==="string"||typeof this.escapeKey==="function"){var buttonKey;if(typeof this.escapeKey==="function"){buttonKey=this.escapeKey();}else{buttonKey=this.escapeKey;}if(buttonKey){if(typeof this.buttons[buttonKey]==="undefined"){console.warn("Invalid escapeKey, no buttons found with key "+buttonKey);}else{this["$_"+buttonKey].trigger("click");}}}}}$.each(this.buttons,function(key,button){if(button.keys.indexOf(keyChar)!==-1){that["$_"+key].trigger("click");}});},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables");},_unwatchContent:function(){clearInterval(this._timer);},close:function(onClosePayload){var that=this;if(typeof this.onClose==="function"){this.onClose(onClosePayload);}this._unwatchContent();$(window).unbind("resize."+this._id);$(window).unbind("keyup."+this._id);$(window).unbind("jcKeyDown."+this._id);if(this.draggable){$(window).unbind("mousemove."+this._id);$(window).unbind("mouseup."+this._id);this.$titleContainer.unbind("mousedown");}that.$el.removeClass(that.loadedClass);$("body").removeClass("jconfirm-no-scroll-"+that._id);that.$jconfirmBoxContainer.removeClass("jconfirm-no-transition");setTimeout(function(){that.$body.addClass(that.closeAnimationParsed);that.$jconfirmBg.addClass("jconfirm-bg-h");var closeTimer=(that.closeAnimation==="none")?1:that.animationSpeed;setTimeout(function(){that.$el.remove();var l=w.jconfirm.instances;var i=w.jconfirm.instances.length-1;for(i;i>=0;i--){if(w.jconfirm.instances[i]._id===that._id){w.jconfirm.instances.splice(i,1);}}if(!w.jconfirm.instances.length){if(that.scrollToPreviousElement&&w.jconfirm.lastFocused&&w.jconfirm.lastFocused.length&&$.contains(document,w.jconfirm.lastFocused[0])){var $lf=w.jconfirm.lastFocused;if(that.scrollToPreviousElementAnimate){var st=$(window).scrollTop();var ot=w.jconfirm.lastFocused.offset().top;var wh=$(window).height();if(!(ot>st&&ot<(st+wh))){var scrollTo=(ot-Math.round((wh/3)));$("html, body").animate({scrollTop:scrollTo},that.animationSpeed,"swing",function(){$lf.focus();});}else{$lf.focus();}}else{$lf.focus();}w.jconfirm.lastFocused=false;}}if(typeof that.onDestroy==="function"){that.onDestroy();}},closeTimer*0.4);},50);return true;},open:function(){if(this.isOpen()){return false;}this._buildHTML();this._bindEvents();this._open();return true;},setStartingPoint:function(){var el=false;if(this.animateFromElement!==true&&this.animateFromElement){el=this.animateFromElement;w.jconfirm.lastClicked=false;}else{if(w.jconfirm.lastClicked&&this.animateFromElement===true){el=w.jconfirm.lastClicked;w.jconfirm.lastClicked=false;}else{return false;}}if(!el){return false;}var offset=el.offset();var iTop=el.outerHeight()/2;var iLeft=el.outerWidth()/2;iTop-=this.$jconfirmBox.outerHeight()/2;iLeft-=this.$jconfirmBox.outerWidth()/2;var sourceTop=offset.top+iTop;sourceTop=sourceTop-this._scrollTop();var sourceLeft=offset.left+iLeft;var wh=$(window).height()/2;var ww=$(window).width()/2;var targetH=wh-this.$jconfirmBox.outerHeight()/2;var targetW=ww-this.$jconfirmBox.outerWidth()/2;sourceTop-=targetH;sourceLeft-=targetW;if(Math.abs(sourceTop)>wh||Math.abs(sourceLeft)>ww){return false;}this.$jconfirmBoxContainer.css("transform","translate("+sourceLeft+"px, "+sourceTop+"px)");},_open:function(){var that=this;if(typeof that.onOpenBefore==="function"){that.onOpenBefore();}this.$body.removeClass(this.animationParsed);this.$jconfirmBg.removeClass("jconfirm-bg-h");this.$body.focus();that.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");setTimeout(function(){that.$body.css(that._getCSS(that.animationSpeed,1));that.$body.css({"transition-property":that.$body.css("transition-property")+", margin"});that.$jconfirmBoxContainer.addClass("jconfirm-no-transition");that._modalReady.resolve();if(typeof that.onOpen==="function"){that.onOpen();}that.$el.addClass(that.loadedClass);},this.animationSpeed);},loadedClass:"jconfirm-open",isClosed:function(){return !this.$el||this.$el.parent().length===0;},isOpen:function(){return !this.isClosed();},toggle:function(){if(!this.isOpen()){this.open();}else{this.close();}}};w.jconfirm.instances=[];w.jconfirm.lastFocused=false;w.jconfirm.pluginDefaults={template:'<div class="jconfirm"><div class="jconfirm-bg jconfirm-bg-h"></div><div class="jconfirm-scrollpane"><div class="jconfirm-row"><div class="jconfirm-cell"><div class="jconfirm-holder"><div class="jc-bs3-container"><div class="jc-bs3-row"><div class="jconfirm-box-container jconfirm-animated"><div class="jconfirm-box" role="dialog" aria-labelledby="labelled" tabindex="-1"><div class="jconfirm-closeIcon">×</div><div class="jconfirm-title-c"><span class="jconfirm-icon-c"></span><span class="jconfirm-title"></span></div><div class="jconfirm-content-pane"><div class="jconfirm-content"></div></div><div class="jconfirm-buttons"></div><div class="jconfirm-clear"></div></div></div></div></div></div></div></div></div></div>',title:"Hello",titleClass:"",type:"default",typeAnimated:true,draggable:true,dragWindowGap:15,dragWindowBorder:true,animateFromElement:true,alignMiddle:true,smoothContent:true,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:false,bgOpacity:null,theme:"light",animation:"scale",closeAnimation:"scale",animationSpeed:400,animationBounce:1,escapeKey:true,rtl:false,container:"body",containerFluid:false,backgroundDismiss:false,backgroundDismissAnimation:"shake",autoClose:false,closeIcon:null,closeIconClass:false,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:true,scrollToPreviousElementAnimate:true,useBootstrap:true,offsetTop:40,offsetBottom:40,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}};var keyDown=false;$(window).on("keydown",function(e){if(!keyDown){var $target=$(e.target);var pass=false;if($target.closest(".jconfirm-box").length){pass=true;}if(pass){$(window).trigger("jcKeyDown");}keyDown=true;}});$(window).on("keyup",function(){keyDown=false;});w.jconfirm.lastClicked=false;$(document).on("mousedown","button, a, [jc-source]",function(){w.jconfirm.lastClicked=$(this);});}));
|
1 |
+
/*!
|
2 |
+
* jquery-confirm v3.3.4 (http://craftpip.github.io/jquery-confirm/)
|
3 |
+
* Author: Boniface Pereira
|
4 |
+
* Website: www.craftpip.com
|
5 |
+
* Contact: hey@craftpip.com
|
6 |
+
*
|
7 |
+
* Copyright 2013-2019 jquery-confirm
|
8 |
+
* Licensed under MIT (https://github.com/craftpip/jquery-confirm/blob/master/LICENSE)
|
9 |
+
*/
|
10 |
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{if(typeof module==="object"&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=="undefined"){jQuery=require("jquery");}else{jQuery=require("jquery")(root);}}factory(jQuery);return jQuery;};}else{factory(jQuery);}}}(function($){var w=window;$.fn.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}$(this).each(function(){var $this=$(this);if($this.attr("jc-attached")){console.warn("jConfirm has already been attached to this element ",$this[0]);return;}$this.on("click",function(e){e.preventDefault();var jcOption=$.extend({},options);if($this.attr("data-title")){jcOption.title=$this.attr("data-title");}if($this.attr("data-content")){jcOption.content=$this.attr("data-content");}if(typeof jcOption.buttons==="undefined"){jcOption.buttons={};}jcOption["$target"]=$this;if($this.attr("href")&&Object.keys(jcOption.buttons).length===0){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];jcOption.buttons=buttons;jcOption.buttons[firstBtn].action=function(){location.href=$this.attr("href");};}jcOption.closeIcon=false;var instance=$.confirm(jcOption);});$this.attr("jc-attached",true);});return $(this);};$.confirm=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}var putDefaultButtons=!(options.buttons===false);if(typeof options.buttons!=="object"){options.buttons={};}if(Object.keys(options.buttons).length===0&&putDefaultButtons){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});options.buttons=buttons;}return w.jconfirm(options);};$.alert=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false};}var putDefaultButtons=!(options.buttons===false);if(typeof options.buttons!=="object"){options.buttons={};}if(Object.keys(options.buttons).length===0&&putDefaultButtons){var buttons=$.extend(true,{},w.jconfirm.pluginDefaults.defaultButtons,(w.jconfirm.defaults||{}).defaultButtons||{});var firstBtn=Object.keys(buttons)[0];options.buttons[firstBtn]=buttons[firstBtn];}return w.jconfirm(options);};$.dialog=function(options,option2){if(typeof options==="undefined"){options={};}if(typeof options==="string"){options={content:options,title:(option2)?option2:false,closeIcon:function(){}};}options.buttons={};if(typeof options.closeIcon==="undefined"){options.closeIcon=function(){};}options.confirmKeys=[13];return w.jconfirm(options);};w.jconfirm=function(options){if(typeof options==="undefined"){options={};}var pluginOptions=$.extend(true,{},w.jconfirm.pluginDefaults);if(w.jconfirm.defaults){pluginOptions=$.extend(true,pluginOptions,w.jconfirm.defaults);}pluginOptions=$.extend(true,{},pluginOptions,options);var instance=new w.Jconfirm(pluginOptions);w.jconfirm.instances.push(instance);return instance;};w.Jconfirm=function(options){$.extend(this,options);this._init();};w.Jconfirm.prototype={_init:function(){var that=this;if(!w.jconfirm.instances.length){w.jconfirm.lastFocused=$("body").find(":focus");}this._id=Math.round(Math.random()*99999);this.contentParsed=$(document.createElement("div"));if(!this.lazyOpen){setTimeout(function(){that.open();},0);}},_buildHTML:function(){var that=this;this._parseAnimation(this.animation,"o");this._parseAnimation(this.closeAnimation,"c");this._parseBgDismissAnimation(this.backgroundDismissAnimation);this._parseColumnClass(this.columnClass);this._parseTheme(this.theme);this._parseType(this.type);var template=$(this.template);template.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed);if(this.typeAnimated){template.find(".jconfirm-box").addClass("jconfirm-type-animated");}if(this.useBootstrap){template.find(".jc-bs3-row").addClass(this.bootstrapClasses.row);template.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center");template.find(".jconfirm-box-container").addClass(this.columnClassParsed);if(this.containerFluid){template.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid);}else{template.find(".jc-bs3-container").addClass(this.bootstrapClasses.container);}}else{template.find(".jconfirm-box").css("width",this.boxWidth);}if(this.titleClass){template.find(".jconfirm-title-c").addClass(this.titleClass);}template.addClass(this.themeParsed);var ariaLabel="jconfirm-box"+this._id;template.find(".jconfirm-box").attr("aria-labelledby",ariaLabel).attr("tabindex",-1);template.find(".jconfirm-content").attr("id",ariaLabel);if(this.bgOpacity!==null){template.find(".jconfirm-bg").css("opacity",this.bgOpacity);}if(this.rtl){template.addClass("jconfirm-rtl");}this.$el=template.appendTo(this.container);this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container");this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box");this.$jconfirmBg=this.$el.find(".jconfirm-bg");this.$title=this.$el.find(".jconfirm-title");this.$titleContainer=this.$el.find(".jconfirm-title-c");this.$content=this.$el.find("div.jconfirm-content");this.$contentPane=this.$el.find(".jconfirm-content-pane");this.$icon=this.$el.find(".jconfirm-icon-c");this.$closeIcon=this.$el.find(".jconfirm-closeIcon");this.$holder=this.$el.find(".jconfirm-holder");this.$btnc=this.$el.find(".jconfirm-buttons");this.$scrollPane=this.$el.find(".jconfirm-scrollpane");that.setStartingPoint();this._contentReady=$.Deferred();this._modalReady=$.Deferred();this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom,});this.setTitle();this.setIcon();this._setButtons();this._parseContent();this.initDraggable();if(this.isAjax){this.showLoading(false);}$.when(this._contentReady,this._modalReady).then(function(){if(that.isAjaxLoading){setTimeout(function(){that.isAjaxLoading=false;that.setContent();that.setTitle();that.setIcon();setTimeout(function(){that.hideLoading(false);that._updateContentMaxHeight();},100);if(typeof that.onContentReady==="function"){that.onContentReady();}},50);}else{that._updateContentMaxHeight();that.setTitle();that.setIcon();if(typeof that.onContentReady==="function"){that.onContentReady();}}if(that.autoClose){that._startCountDown();}}).then(function(){that._watchContent();});if(this.animation==="none"){this.animationSpeed=1;this.animationBounce=1;}this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce));this.$contentPane.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1));this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1));},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(type){this.typeParsed=this._typePrefix+type;},setType:function(type){var oldClass=this.typeParsed;this._parseType(type);this.$jconfirmBox.removeClass(oldClass).addClass(this.typeParsed);},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(theme){var previous=this.theme;this.theme=theme||this.theme;this._parseTheme(this.theme);if(previous){this.$el.removeClass(previous);}this.$el.addClass(this.themeParsed);this.theme=theme;},_parseTheme:function(theme){var that=this;theme=theme.split(",");$.each(theme,function(k,a){if(a.indexOf(that._themePrefix)===-1){theme[k]=that._themePrefix+$.trim(a);}});this.themeParsed=theme.join(" ").toLowerCase();},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(bgDismissAnimation){var animation=bgDismissAnimation.split(",");var that=this;$.each(animation,function(k,a){if(a.indexOf(that._bgDismissPrefix)===-1){animation[k]=that._bgDismissPrefix+$.trim(a);}});this.backgroundDismissAnimationParsed=animation.join(" ").toLowerCase();},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(animation){this.animation=animation||this.animation;this._parseAnimation(this.animation,"o");},_parseAnimation:function(animation,which){which=which||"o";var animations=animation.split(",");var that=this;$.each(animations,function(k,a){if(a.indexOf(that._animationPrefix)===-1){animations[k]=that._animationPrefix+$.trim(a);}});var a_string=animations.join(" ").toLowerCase();if(which==="o"){this.animationParsed=a_string;}else{this.closeAnimationParsed=a_string;}return a_string;},setCloseAnimation:function(closeAnimation){this.closeAnimation=closeAnimation||this.closeAnimation;this._parseAnimation(this.closeAnimation,"c");},setAnimationSpeed:function(speed){this.animationSpeed=speed||this.animationSpeed;},columnClassParsed:"",setColumnClass:function(colClass){if(!this.useBootstrap){console.warn("cannot set columnClass, useBootstrap is set to false");return;}this.columnClass=colClass||this.columnClass;this._parseColumnClass(this.columnClass);this.$jconfirmBoxContainer.addClass(this.columnClassParsed);},_updateContentMaxHeight:function(){var height=$(window).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":height+"px"});},setBoxWidth:function(width){if(this.useBootstrap){console.warn("cannot set boxWidth, useBootstrap is set to true");return;}this.boxWidth=width;this.$jconfirmBox.css("width",width);},_parseColumnClass:function(colClass){colClass=colClass.toLowerCase();var p;switch(colClass){case"xl":case"xlarge":p="col-md-12";break;case"l":case"large":p="col-md-8 col-md-offset-2";break;case"m":case"medium":p="col-md-6 col-md-offset-3";break;case"s":case"small":p="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":p="col-md-2 col-md-offset-5";break;default:p=colClass;}this.columnClassParsed=p;},initDraggable:function(){var that=this;var $t=this.$titleContainer;this.resetDrag();if(this.draggable){$t.on("mousedown",function(e){$t.addClass("jconfirm-hand");that.mouseX=e.clientX;that.mouseY=e.clientY;that.isDrag=true;});$(window).on("mousemove."+this._id,function(e){if(that.isDrag){that.movingX=e.clientX-that.mouseX+that.initialX;that.movingY=e.clientY-that.mouseY+that.initialY;that.setDrag();}});$(window).on("mouseup."+this._id,function(){$t.removeClass("jconfirm-hand");if(that.isDrag){that.isDrag=false;that.initialX=that.movingX;that.initialY=that.movingY;}});}},resetDrag:function(){this.isDrag=false;this.initialX=0;this.initialY=0;this.movingX=0;this.movingY=0;this.mouseX=0;this.mouseY=0;this.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");},setDrag:function(){if(!this.draggable){return;}this.alignMiddle=false;var boxWidth=this.$jconfirmBox.outerWidth();var boxHeight=this.$jconfirmBox.outerHeight();var windowWidth=$(window).width();var windowHeight=$(window).height();var that=this;var dragUpdate=1;if(that.movingX%dragUpdate===0||that.movingY%dragUpdate===0){if(that.dragWindowBorder){var leftDistance=(windowWidth/2)-boxWidth/2;var topDistance=(windowHeight/2)-boxHeight/2;topDistance-=that.dragWindowGap;leftDistance-=that.dragWindowGap;if(leftDistance+that.movingX<0){that.movingX=-leftDistance;}else{if(leftDistance-that.movingX<0){that.movingX=leftDistance;}}if(topDistance+that.movingY<0){that.movingY=-topDistance;}else{if(topDistance-that.movingY<0){that.movingY=topDistance;}}}that.$jconfirmBoxContainer.css("transform","translate("+that.movingX+"px, "+that.movingY+"px)");}},_scrollTop:function(){if(typeof pageYOffset!=="undefined"){return pageYOffset;}else{var B=document.body;var D=document.documentElement;D=(D.clientHeight)?D:B;return D.scrollTop;}},_watchContent:function(){var that=this;if(this._timer){clearInterval(this._timer);}var prevContentHeight=0;this._timer=setInterval(function(){if(that.smoothContent){var contentHeight=that.$content.outerHeight()||0;if(contentHeight!==prevContentHeight){prevContentHeight=contentHeight;}var wh=$(window).height();var total=that.offsetTop+that.offsetBottom+that.$jconfirmBox.height()-that.$contentPane.height()+that.$content.height();if(total<wh){that.$contentPane.addClass("no-scroll");}else{that.$contentPane.removeClass("no-scroll");}}},this.watchInterval);},_overflowClass:"jconfirm-overflow",_hilightAnimating:false,highlight:function(){this.hiLightModal();},hiLightModal:function(){var that=this;if(this._hilightAnimating){return;}that.$body.addClass("hilight");var duration=parseFloat(that.$body.css("animation-duration"))||2;this._hilightAnimating=true;setTimeout(function(){that._hilightAnimating=false;that.$body.removeClass("hilight");},duration*1000);},_bindEvents:function(){var that=this;this.boxClicked=false;this.$scrollPane.click(function(e){if(!that.boxClicked){var buttonName=false;var shouldClose=false;var str;if(typeof that.backgroundDismiss==="function"){str=that.backgroundDismiss();}else{str=that.backgroundDismiss;}if(typeof str==="string"&&typeof that.buttons[str]!=="undefined"){buttonName=str;shouldClose=false;}else{if(typeof str==="undefined"||!!(str)===true){shouldClose=true;}else{shouldClose=false;}}if(buttonName){var btnResponse=that.buttons[buttonName].action.apply(that);shouldClose=(typeof btnResponse==="undefined")||!!(btnResponse);}if(shouldClose){that.close();}else{that.hiLightModal();}}that.boxClicked=false;});this.$jconfirmBox.click(function(e){that.boxClicked=true;});var isKeyDown=false;$(window).on("jcKeyDown."+that._id,function(e){if(!isKeyDown){isKeyDown=true;}});$(window).on("keyup."+that._id,function(e){if(isKeyDown){that.reactOnKey(e);isKeyDown=false;}});$(window).on("resize."+this._id,function(){that._updateContentMaxHeight();setTimeout(function(){that.resetDrag();},100);});},_cubic_bezier:"0.36, 0.55, 0.19",_getCSS:function(speed,bounce){return{"-webkit-transition-duration":speed/1000+"s","transition-duration":speed/1000+"s","-webkit-transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+bounce+")","transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+bounce+")"};},_setButtons:function(){var that=this;var total_buttons=0;if(typeof this.buttons!=="object"){this.buttons={};}$.each(this.buttons,function(key,button){total_buttons+=1;if(typeof button==="function"){that.buttons[key]=button={action:button};}that.buttons[key].text=button.text||key;that.buttons[key].btnClass=button.btnClass||"btn-default";that.buttons[key].action=button.action||function(){};that.buttons[key].keys=button.keys||[];that.buttons[key].isHidden=button.isHidden||false;that.buttons[key].isDisabled=button.isDisabled||false;$.each(that.buttons[key].keys,function(i,a){that.buttons[key].keys[i]=a.toLowerCase();});var button_element=$('<button type="button" class="btn"></button>').html(that.buttons[key].text).addClass(that.buttons[key].btnClass).prop("disabled",that.buttons[key].isDisabled).css("display",that.buttons[key].isHidden?"none":"").click(function(e){e.preventDefault();var res=that.buttons[key].action.apply(that,[that.buttons[key]]);that.onAction.apply(that,[key,that.buttons[key]]);that._stopCountDown();if(typeof res==="undefined"||res){that.close();}});that.buttons[key].el=button_element;that.buttons[key].setText=function(text){button_element.html(text);};that.buttons[key].addClass=function(className){button_element.addClass(className);};that.buttons[key].removeClass=function(className){button_element.removeClass(className);};that.buttons[key].disable=function(){that.buttons[key].isDisabled=true;button_element.prop("disabled",true);};that.buttons[key].enable=function(){that.buttons[key].isDisabled=false;button_element.prop("disabled",false);};that.buttons[key].show=function(){that.buttons[key].isHidden=false;button_element.css("display","");};that.buttons[key].hide=function(){that.buttons[key].isHidden=true;button_element.css("display","none");};that["$_"+key]=that["$$"+key]=button_element;that.$btnc.append(button_element);});if(total_buttons===0){this.$btnc.hide();}if(this.closeIcon===null&&total_buttons===0){this.closeIcon=true;}if(this.closeIcon){if(this.closeIconClass){var closeHtml='<i class="'+this.closeIconClass+'"></i>';this.$closeIcon.html(closeHtml);}this.$closeIcon.click(function(e){e.preventDefault();var buttonName=false;var shouldClose=false;var str;if(typeof that.closeIcon==="function"){str=that.closeIcon();}else{str=that.closeIcon;}if(typeof str==="string"&&typeof that.buttons[str]!=="undefined"){buttonName=str;shouldClose=false;}else{if(typeof str==="undefined"||!!(str)===true){shouldClose=true;}else{shouldClose=false;}}if(buttonName){var btnResponse=that.buttons[buttonName].action.apply(that);shouldClose=(typeof btnResponse==="undefined")||!!(btnResponse);}if(shouldClose){that.close();}});this.$closeIcon.show();}else{this.$closeIcon.hide();}},setTitle:function(string,force){force=force||false;if(typeof string!=="undefined"){if(typeof string==="string"){this.title=string;}else{if(typeof string==="function"){if(typeof string.promise==="function"){console.error("Promise was returned from title function, this is not supported.");}var response=string();if(typeof response==="string"){this.title=response;}else{this.title=false;}}else{this.title=false;}}}if(this.isAjaxLoading&&!force){return;}this.$title.html(this.title||"");this.updateTitleContainer();},setIcon:function(iconClass,force){force=force||false;if(typeof iconClass!=="undefined"){if(typeof iconClass==="string"){this.icon=iconClass;}else{if(typeof iconClass==="function"){var response=iconClass();if(typeof response==="string"){this.icon=response;}else{this.icon=false;}}else{this.icon=false;}}}if(this.isAjaxLoading&&!force){return;}this.$icon.html(this.icon?'<i class="'+this.icon+'"></i>':"");this.updateTitleContainer();},updateTitleContainer:function(){if(!this.title&&!this.icon){this.$titleContainer.hide();}else{this.$titleContainer.show();}},setContentPrepend:function(content,force){if(!content){return;}this.contentParsed.prepend(content);},setContentAppend:function(content){if(!content){return;}this.contentParsed.append(content);},setContent:function(content,force){force=!!force;var that=this;if(content){this.contentParsed.html("").append(content);}if(this.isAjaxLoading&&!force){return;}this.$content.html("");this.$content.append(this.contentParsed);setTimeout(function(){that.$body.find("input[autofocus]:visible:first").focus();},100);},loadingSpinner:false,showLoading:function(disableButtons){this.loadingSpinner=true;this.$jconfirmBox.addClass("loading");if(disableButtons){this.$btnc.find("button").prop("disabled",true);}},hideLoading:function(enableButtons){this.loadingSpinner=false;this.$jconfirmBox.removeClass("loading");if(enableButtons){this.$btnc.find("button").prop("disabled",false);}},ajaxResponse:false,contentParsed:"",isAjax:false,isAjaxLoading:false,_parseContent:function(){var that=this;var e=" ";if(typeof this.content==="function"){var res=this.content.apply(this);if(typeof res==="string"){this.content=res;}else{if(typeof res==="object"&&typeof res.always==="function"){this.isAjax=true;this.isAjaxLoading=true;res.always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded==="function"){that.contentLoaded(data,status,xhr);}});this.content=e;}else{this.content=e;}}}if(typeof this.content==="string"&&this.content.substr(0,4).toLowerCase()==="url:"){this.isAjax=true;this.isAjaxLoading=true;var u=this.content.substring(4,this.content.length);$.get(u).done(function(html){that.contentParsed.html(html);}).always(function(data,status,xhr){that.ajaxResponse={data:data,status:status,xhr:xhr};that._contentReady.resolve(data,status,xhr);if(typeof that.contentLoaded==="function"){that.contentLoaded(data,status,xhr);}});}if(!this.content){this.content=e;}if(!this.isAjax){this.contentParsed.html(this.content);this.setContent();that._contentReady.resolve();}},_stopCountDown:function(){clearInterval(this.autoCloseInterval);if(this.$cd){this.$cd.remove();}},_startCountDown:function(){var that=this;var opt=this.autoClose.split("|");if(opt.length!==2){console.error("Invalid option for autoClose. example 'close|10000'");return false;}var button_key=opt[0];var time=parseInt(opt[1]);if(typeof this.buttons[button_key]==="undefined"){console.error("Invalid button key '"+button_key+"' for autoClose");return false;}var seconds=Math.ceil(time/1000);this.$cd=$('<span class="countdown"> ('+seconds+")</span>").appendTo(this["$_"+button_key]);this.autoCloseInterval=setInterval(function(){that.$cd.html(" ("+(seconds-=1)+") ");if(seconds<=0){that["$$"+button_key].trigger("click");that._stopCountDown();}},1000);},_getKey:function(key){switch(key){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space";}var initial=String.fromCharCode(key);if(/^[A-z0-9]+$/.test(initial)){return initial.toLowerCase();}else{return false;}},reactOnKey:function(e){var that=this;var a=$(".jconfirm");if(a.eq(a.length-1)[0]!==this.$el[0]){return false;}var key=e.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(key)){return false;}var keyChar=this._getKey(key);if(keyChar==="esc"&&this.escapeKey){if(this.escapeKey===true){this.$scrollPane.trigger("click");}else{if(typeof this.escapeKey==="string"||typeof this.escapeKey==="function"){var buttonKey;if(typeof this.escapeKey==="function"){buttonKey=this.escapeKey();}else{buttonKey=this.escapeKey;}if(buttonKey){if(typeof this.buttons[buttonKey]==="undefined"){console.warn("Invalid escapeKey, no buttons found with key "+buttonKey);}else{this["$_"+buttonKey].trigger("click");}}}}}$.each(this.buttons,function(key,button){if(button.keys.indexOf(keyChar)!==-1){that["$_"+key].trigger("click");}});},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables");},_unwatchContent:function(){clearInterval(this._timer);},close:function(onClosePayload){var that=this;if(typeof this.onClose==="function"){this.onClose(onClosePayload);}this._unwatchContent();$(window).unbind("resize."+this._id);$(window).unbind("keyup."+this._id);$(window).unbind("jcKeyDown."+this._id);if(this.draggable){$(window).unbind("mousemove."+this._id);$(window).unbind("mouseup."+this._id);this.$titleContainer.unbind("mousedown");}that.$el.removeClass(that.loadedClass);$("body").removeClass("jconfirm-no-scroll-"+that._id);that.$jconfirmBoxContainer.removeClass("jconfirm-no-transition");setTimeout(function(){that.$body.addClass(that.closeAnimationParsed);that.$jconfirmBg.addClass("jconfirm-bg-h");var closeTimer=(that.closeAnimation==="none")?1:that.animationSpeed;setTimeout(function(){that.$el.remove();var l=w.jconfirm.instances;var i=w.jconfirm.instances.length-1;for(i;i>=0;i--){if(w.jconfirm.instances[i]._id===that._id){w.jconfirm.instances.splice(i,1);}}if(!w.jconfirm.instances.length){if(that.scrollToPreviousElement&&w.jconfirm.lastFocused&&w.jconfirm.lastFocused.length&&$.contains(document,w.jconfirm.lastFocused[0])){var $lf=w.jconfirm.lastFocused;if(that.scrollToPreviousElementAnimate){var st=$(window).scrollTop();var ot=w.jconfirm.lastFocused.offset().top;var wh=$(window).height();if(!(ot>st&&ot<(st+wh))){var scrollTo=(ot-Math.round((wh/3)));$("html, body").animate({scrollTop:scrollTo},that.animationSpeed,"swing",function(){$lf.focus();});}else{$lf.focus();}}else{$lf.focus();}w.jconfirm.lastFocused=false;}}if(typeof that.onDestroy==="function"){that.onDestroy();}},closeTimer*0.4);},50);return true;},open:function(){if(this.isOpen()){return false;}this._buildHTML();this._bindEvents();this._open();return true;},setStartingPoint:function(){var el=false;if(this.animateFromElement!==true&&this.animateFromElement){el=this.animateFromElement;w.jconfirm.lastClicked=false;}else{if(w.jconfirm.lastClicked&&this.animateFromElement===true){el=w.jconfirm.lastClicked;w.jconfirm.lastClicked=false;}else{return false;}}if(!el){return false;}var offset=el.offset();var iTop=el.outerHeight()/2;var iLeft=el.outerWidth()/2;iTop-=this.$jconfirmBox.outerHeight()/2;iLeft-=this.$jconfirmBox.outerWidth()/2;var sourceTop=offset.top+iTop;sourceTop=sourceTop-this._scrollTop();var sourceLeft=offset.left+iLeft;var wh=$(window).height()/2;var ww=$(window).width()/2;var targetH=wh-this.$jconfirmBox.outerHeight()/2;var targetW=ww-this.$jconfirmBox.outerWidth()/2;sourceTop-=targetH;sourceLeft-=targetW;if(Math.abs(sourceTop)>wh||Math.abs(sourceLeft)>ww){return false;}this.$jconfirmBoxContainer.css("transform","translate("+sourceLeft+"px, "+sourceTop+"px)");},_open:function(){var that=this;if(typeof that.onOpenBefore==="function"){that.onOpenBefore();}this.$body.removeClass(this.animationParsed);this.$jconfirmBg.removeClass("jconfirm-bg-h");this.$body.focus();that.$jconfirmBoxContainer.css("transform","translate("+0+"px, "+0+"px)");setTimeout(function(){that.$body.css(that._getCSS(that.animationSpeed,1));that.$body.css({"transition-property":that.$body.css("transition-property")+", margin"});that.$jconfirmBoxContainer.addClass("jconfirm-no-transition");that._modalReady.resolve();if(typeof that.onOpen==="function"){that.onOpen();}that.$el.addClass(that.loadedClass);},this.animationSpeed);},loadedClass:"jconfirm-open",isClosed:function(){return !this.$el||this.$el.parent().length===0;},isOpen:function(){return !this.isClosed();},toggle:function(){if(!this.isOpen()){this.open();}else{this.close();}}};w.jconfirm.instances=[];w.jconfirm.lastFocused=false;w.jconfirm.pluginDefaults={template:'<div class="jconfirm"><div class="jconfirm-bg jconfirm-bg-h"></div><div class="jconfirm-scrollpane"><div class="jconfirm-row"><div class="jconfirm-cell"><div class="jconfirm-holder"><div class="jc-bs3-container"><div class="jc-bs3-row"><div class="jconfirm-box-container jconfirm-animated"><div class="jconfirm-box" role="dialog" aria-labelledby="labelled" tabindex="-1"><div class="jconfirm-closeIcon">×</div><div class="jconfirm-title-c"><span class="jconfirm-icon-c"></span><span class="jconfirm-title"></span></div><div class="jconfirm-content-pane"><div class="jconfirm-content"></div></div><div class="jconfirm-buttons"></div><div class="jconfirm-clear"></div></div></div></div></div></div></div></div></div></div>',title:"Hello",titleClass:"",type:"default",typeAnimated:true,draggable:true,dragWindowGap:15,dragWindowBorder:true,animateFromElement:true,alignMiddle:true,smoothContent:true,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:false,bgOpacity:null,theme:"light",animation:"scale",closeAnimation:"scale",animationSpeed:400,animationBounce:1,escapeKey:true,rtl:false,container:"body",containerFluid:false,backgroundDismiss:false,backgroundDismissAnimation:"shake",autoClose:false,closeIcon:null,closeIconClass:false,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:true,scrollToPreviousElementAnimate:true,useBootstrap:true,offsetTop:40,offsetBottom:40,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}};var keyDown=false;$(window).on("keydown",function(e){if(!keyDown){var $target=$(e.target);var pass=false;if($target.closest(".jconfirm-box").length){pass=true;}if(pass){$(window).trigger("jcKeyDown");}keyDown=true;}});$(window).on("keyup",function(){keyDown=false;});w.jconfirm.lastClicked=false;$(document).on("mousedown","button, a, [jc-source]",function(){w.jconfirm.lastClicked=$(this);});}));
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: wpforms, jaredatch, smub, slaFFik
|
3 |
Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, wp smtp
|
4 |
Requires at least: 4.9
|
5 |
-
Tested up to: 5.
|
6 |
-
Stable tag: 1.7.
|
7 |
Requires PHP: 5.3
|
8 |
|
9 |
The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites.
|
@@ -208,6 +208,10 @@ By all means please contact us to discuss features or options you'd like to see
|
|
208 |
|
209 |
== Changelog ==
|
210 |
|
|
|
|
|
|
|
|
|
211 |
= 1.7.0 - 2019-10-24 =
|
212 |
* Added: Add a new constant `WPMS_DO_NOT_SEND` to block email sending.
|
213 |
* Fixed: Default email (wordpress@example.com) rewriting in CLI mode.
|
2 |
Contributors: wpforms, jaredatch, smub, slaFFik
|
3 |
Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, wp smtp
|
4 |
Requires at least: 4.9
|
5 |
+
Tested up to: 5.3
|
6 |
+
Stable tag: 1.7.1
|
7 |
Requires PHP: 5.3
|
8 |
|
9 |
The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites.
|
208 |
|
209 |
== Changelog ==
|
210 |
|
211 |
+
= 1.7.1 - 2019-11-11 =
|
212 |
+
* Fixed: Compatibility with WordPress 5.3.
|
213 |
+
* Fixed: `Processor::get_default_email()` always returns empty value when server incorrectly configured.
|
214 |
+
|
215 |
= 1.7.0 - 2019-10-24 =
|
216 |
* Added: Add a new constant `WPMS_DO_NOT_SEND` to block email sending.
|
217 |
* Fixed: Default email (wordpress@example.com) rewriting in CLI mode.
|
src/Admin/Area.php
CHANGED
@@ -356,6 +356,7 @@ class Area {
|
|
356 |
'plugin_install_error' => \esc_html__( 'Could not install a plugin. Please download from WordPress.org and install manually.', 'wp-mail-smtp' ),
|
357 |
'plugin_install_activate_btn' => \esc_html__( 'Install and Activate', 'wp-mail-smtp' ),
|
358 |
'plugin_activate_btn' => \esc_html__( 'Activate', 'wp-mail-smtp' ),
|
|
|
359 |
);
|
360 |
|
361 |
\wp_localize_script(
|
356 |
'plugin_install_error' => \esc_html__( 'Could not install a plugin. Please download from WordPress.org and install manually.', 'wp-mail-smtp' ),
|
357 |
'plugin_install_activate_btn' => \esc_html__( 'Install and Activate', 'wp-mail-smtp' ),
|
358 |
'plugin_activate_btn' => \esc_html__( 'Activate', 'wp-mail-smtp' ),
|
359 |
+
'plugin_download_btn' => \esc_html__( 'Download', 'wp-mail-smtp' ),
|
360 |
);
|
361 |
|
362 |
\wp_localize_script(
|
src/Admin/Pages/About.php
CHANGED
@@ -5,7 +5,7 @@ namespace WPMailSMTP\Admin\Pages;
|
|
5 |
use WPMailSMTP\Admin\Area;
|
6 |
use WPMailSMTP\Admin\PageAbstract;
|
7 |
use WPMailSMTP\Admin\PluginsInstallSkin;
|
8 |
-
use WPMailSMTP\
|
9 |
|
10 |
/**
|
11 |
* Class About to display a page with About Us and Versus content.
|
@@ -447,14 +447,11 @@ class About extends PageAbstract {
|
|
447 |
\wp_send_json_error( $error );
|
448 |
}
|
449 |
|
450 |
-
// We do not need any extra credentials if we have gotten this far, so let's install the plugin.
|
451 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
452 |
-
|
453 |
// Do not allow WordPress to search/download translations, as this will break JS output.
|
454 |
\remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
|
455 |
|
456 |
// Create the plugin upgrader with our custom skin.
|
457 |
-
$installer = new
|
458 |
|
459 |
// Error check.
|
460 |
if ( ! \method_exists( $installer, 'install' ) || empty( $_POST['plugin'] ) ) {
|
5 |
use WPMailSMTP\Admin\Area;
|
6 |
use WPMailSMTP\Admin\PageAbstract;
|
7 |
use WPMailSMTP\Admin\PluginsInstallSkin;
|
8 |
+
use WPMailSMTP\Admin\PluginsInstallUpgrader;
|
9 |
|
10 |
/**
|
11 |
* Class About to display a page with About Us and Versus content.
|
447 |
\wp_send_json_error( $error );
|
448 |
}
|
449 |
|
|
|
|
|
|
|
450 |
// Do not allow WordPress to search/download translations, as this will break JS output.
|
451 |
\remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
|
452 |
|
453 |
// Create the plugin upgrader with our custom skin.
|
454 |
+
$installer = new PluginsInstallUpgrader( new PluginsInstallSkin() );
|
455 |
|
456 |
// Error check.
|
457 |
if ( ! \method_exists( $installer, 'install' ) || empty( $_POST['plugin'] ) ) {
|
src/Admin/PluginsInstallSkin.php
CHANGED
@@ -1,27 +1,15 @@
|
|
1 |
<?php
|
|
|
2 |
namespace WPMailSMTP\Admin;
|
3 |
|
4 |
/**
|
5 |
* WordPress class extended for on-the-fly plugin installations.
|
6 |
*
|
7 |
* @since 1.5.0
|
|
|
8 |
*/
|
9 |
class PluginsInstallSkin extends \WP_Upgrader_Skin {
|
10 |
|
11 |
-
/**
|
12 |
-
* Set the upgrader object and store it as a property in the parent class.
|
13 |
-
*
|
14 |
-
* @since 1.5.0
|
15 |
-
*
|
16 |
-
* @param object $upgrader The upgrader object (passed by reference).
|
17 |
-
*/
|
18 |
-
public function set_upgrader( &$upgrader ) {
|
19 |
-
|
20 |
-
if ( is_object( $upgrader ) ) {
|
21 |
-
$this->upgrader =& $upgrader;
|
22 |
-
}
|
23 |
-
}
|
24 |
-
|
25 |
/**
|
26 |
* Empty out the header of its HTML content and only check to see if it has
|
27 |
* been performed or not.
|
@@ -54,17 +42,6 @@ class PluginsInstallSkin extends \WP_Upgrader_Skin {
|
|
54 |
}
|
55 |
}
|
56 |
|
57 |
-
/**
|
58 |
-
* Empty out the feedback method to prevent outputting HTML strings as the install
|
59 |
-
* is progressing.
|
60 |
-
*
|
61 |
-
* @since 1.5.0
|
62 |
-
*
|
63 |
-
* @param string $string The feedback string.
|
64 |
-
*/
|
65 |
-
public function feedback( $string ) {
|
66 |
-
}
|
67 |
-
|
68 |
/**
|
69 |
* Empty out JavaScript output that calls function to decrement the update counts.
|
70 |
*
|
1 |
<?php
|
2 |
+
|
3 |
namespace WPMailSMTP\Admin;
|
4 |
|
5 |
/**
|
6 |
* WordPress class extended for on-the-fly plugin installations.
|
7 |
*
|
8 |
* @since 1.5.0
|
9 |
+
* @since 1.7.1 Removed feedback() method override to be compatible with PHP5.3+ and WP5.3.
|
10 |
*/
|
11 |
class PluginsInstallSkin extends \WP_Upgrader_Skin {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Empty out the header of its HTML content and only check to see if it has
|
15 |
* been performed or not.
|
42 |
}
|
43 |
}
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
/**
|
46 |
* Empty out JavaScript output that calls function to decrement the update counts.
|
47 |
*
|
src/Admin/PluginsInstallUpgrader.php
ADDED
@@ -0,0 +1,576 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPMailSMTP\Admin;
|
4 |
+
|
5 |
+
use WP_Error;
|
6 |
+
use WP_Upgrader;
|
7 |
+
use WP_Filesystem_Base;
|
8 |
+
|
9 |
+
/** \WP_Upgrader class */
|
10 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
11 |
+
|
12 |
+
/** \Plugin_Upgrader class */
|
13 |
+
require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* In WP 5.3 a PHP 5.6 splat operator (...$args) was added to \WP_Upgrader_Skin::feedback().
|
17 |
+
* We need to remove all calls to *Skin::feedback() method, as we can't override it in own Skin
|
18 |
+
* without breaking support for PHP 5.3-5.5.
|
19 |
+
*
|
20 |
+
* @internal Please do not use this class outside of core WPForms development. May be removed at any time.
|
21 |
+
*
|
22 |
+
* @since 1.7.1
|
23 |
+
*/
|
24 |
+
class PluginsInstallUpgrader extends \Plugin_Upgrader {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Run an upgrade/installation.
|
28 |
+
*
|
29 |
+
* Attempts to download the package (if it is not a local file), unpack it, and
|
30 |
+
* install it in the destination folder.
|
31 |
+
*
|
32 |
+
* @since 2.8.0
|
33 |
+
*
|
34 |
+
* @param array $options {
|
35 |
+
* Array or string of arguments for upgrading/installing a package.
|
36 |
+
*
|
37 |
+
* @type string $package The full path or URI of the package to install.
|
38 |
+
* Default empty.
|
39 |
+
* @type string $destination The full path to the destination folder.
|
40 |
+
* Default empty.
|
41 |
+
* @type bool $clear_destination Whether to delete any files already in the
|
42 |
+
* destination folder. Default false.
|
43 |
+
* @type bool $clear_working Whether to delete the files form the working
|
44 |
+
* directory after copying to the destination.
|
45 |
+
* Default false.
|
46 |
+
* @type bool $abort_if_destination_exists Whether to abort the installation if the destination
|
47 |
+
* folder already exists. When true, `$clear_destination`
|
48 |
+
* should be false. Default true.
|
49 |
+
* @type bool $is_multi Whether this run is one of multiple upgrade/installation
|
50 |
+
* actions being performed in bulk. When true, the skin
|
51 |
+
* WP_Upgrader::header() and WP_Upgrader::footer()
|
52 |
+
* aren't called. Default false.
|
53 |
+
* @type array $hook_extra Extra arguments to pass to the filter hooks called by
|
54 |
+
* WP_Upgrader::run().
|
55 |
+
* }
|
56 |
+
* @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,
|
57 |
+
* or false if unable to connect to the filesystem.
|
58 |
+
*/
|
59 |
+
public function run( $options ) {
|
60 |
+
|
61 |
+
$defaults = array(
|
62 |
+
'package' => '', // Please always pass this.
|
63 |
+
'destination' => '', // And this
|
64 |
+
'clear_destination' => false,
|
65 |
+
'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
|
66 |
+
'clear_working' => true,
|
67 |
+
'is_multi' => false,
|
68 |
+
'hook_extra' => array(), // Pass any extra $hook_extra args here, this will be passed to any hooked filters.
|
69 |
+
);
|
70 |
+
|
71 |
+
$options = wp_parse_args( $options, $defaults );
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Filters the package options before running an update.
|
75 |
+
*
|
76 |
+
* See also {@see 'upgrader_process_complete'}.
|
77 |
+
*
|
78 |
+
* @since 4.3.0
|
79 |
+
*
|
80 |
+
* @param array $options {
|
81 |
+
* Options used by the upgrader.
|
82 |
+
*
|
83 |
+
* @type string $package Package for update.
|
84 |
+
* @type string $destination Update location.
|
85 |
+
* @type bool $clear_destination Clear the destination resource.
|
86 |
+
* @type bool $clear_working Clear the working resource.
|
87 |
+
* @type bool $abort_if_destination_exists Abort if the Destination directory exists.
|
88 |
+
* @type bool $is_multi Whether the upgrader is running multiple times.
|
89 |
+
* @type array $hook_extra {
|
90 |
+
* Extra hook arguments.
|
91 |
+
*
|
92 |
+
* @type string $action Type of action. Default 'update'.
|
93 |
+
* @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'.
|
94 |
+
* @type bool $bulk Whether the update process is a bulk update. Default true.
|
95 |
+
* @type string $plugin Path to the plugin file relative to the plugins directory.
|
96 |
+
* @type string $theme The stylesheet or template name of the theme.
|
97 |
+
* @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
|
98 |
+
* or 'core'.
|
99 |
+
* @type object $language_update The language pack update offer.
|
100 |
+
* }
|
101 |
+
* }
|
102 |
+
*/
|
103 |
+
$options = apply_filters( 'upgrader_package_options', $options );
|
104 |
+
|
105 |
+
if ( ! $options['is_multi'] ) { // call $this->header separately if running multiple times
|
106 |
+
$this->skin->header();
|
107 |
+
}
|
108 |
+
|
109 |
+
// Connect to the Filesystem first.
|
110 |
+
$res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
|
111 |
+
// Mainly for non-connected filesystem.
|
112 |
+
if ( ! $res ) {
|
113 |
+
if ( ! $options['is_multi'] ) {
|
114 |
+
$this->skin->footer();
|
115 |
+
}
|
116 |
+
return false;
|
117 |
+
}
|
118 |
+
|
119 |
+
$this->skin->before();
|
120 |
+
|
121 |
+
if ( is_wp_error( $res ) ) {
|
122 |
+
$this->skin->error( $res );
|
123 |
+
$this->skin->after();
|
124 |
+
if ( ! $options['is_multi'] ) {
|
125 |
+
$this->skin->footer();
|
126 |
+
}
|
127 |
+
return $res;
|
128 |
+
}
|
129 |
+
|
130 |
+
/*
|
131 |
+
* Download the package (Note, This just returns the filename
|
132 |
+
* of the file if the package is a local file)
|
133 |
+
*/
|
134 |
+
$download = $this->download_package( $options['package'], true );
|
135 |
+
|
136 |
+
// Allow for signature soft-fail.
|
137 |
+
// WARNING: This may be removed in the future.
|
138 |
+
if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
|
139 |
+
|
140 |
+
// Don't output the 'no signature could be found' failure message for now.
|
141 |
+
if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) {
|
142 |
+
// Outout the failure error as a normal feedback, and not as an error:
|
143 |
+
//$this->skin->feedback( $download->get_error_message() );
|
144 |
+
|
145 |
+
// Report this failure back to WordPress.org for debugging purposes.
|
146 |
+
wp_version_check(
|
147 |
+
array(
|
148 |
+
'signature_failure_code' => $download->get_error_code(),
|
149 |
+
'signature_failure_data' => $download->get_error_data(),
|
150 |
+
)
|
151 |
+
);
|
152 |
+
}
|
153 |
+
|
154 |
+
// Pretend this error didn't happen.
|
155 |
+
$download = $download->get_error_data( 'softfail-filename' );
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( is_wp_error( $download ) ) {
|
159 |
+
$this->skin->error( $download );
|
160 |
+
$this->skin->after();
|
161 |
+
if ( ! $options['is_multi'] ) {
|
162 |
+
$this->skin->footer();
|
163 |
+
}
|
164 |
+
return $download;
|
165 |
+
}
|
166 |
+
|
167 |
+
$delete_package = ( $download != $options['package'] ); // Do not delete a "local" file
|
168 |
+
|
169 |
+
// Unzips the file into a temporary directory.
|
170 |
+
$working_dir = $this->unpack_package( $download, $delete_package );
|
171 |
+
if ( is_wp_error( $working_dir ) ) {
|
172 |
+
$this->skin->error( $working_dir );
|
173 |
+
$this->skin->after();
|
174 |
+
if ( ! $options['is_multi'] ) {
|
175 |
+
$this->skin->footer();
|
176 |
+
}
|
177 |
+
return $working_dir;
|
178 |
+
}
|
179 |
+
|
180 |
+
// With the given options, this installs it to the destination directory.
|
181 |
+
$result = $this->install_package(
|
182 |
+
array(
|
183 |
+
'source' => $working_dir,
|
184 |
+
'destination' => $options['destination'],
|
185 |
+
'clear_destination' => $options['clear_destination'],
|
186 |
+
'abort_if_destination_exists' => $options['abort_if_destination_exists'],
|
187 |
+
'clear_working' => $options['clear_working'],
|
188 |
+
'hook_extra' => $options['hook_extra'],
|
189 |
+
)
|
190 |
+
);
|
191 |
+
|
192 |
+
$this->skin->set_result( $result );
|
193 |
+
if ( is_wp_error( $result ) ) {
|
194 |
+
$this->skin->error( $result );
|
195 |
+
//$this->skin->feedback( 'process_failed' );
|
196 |
+
} else {
|
197 |
+
// Installation succeeded.
|
198 |
+
//$this->skin->feedback( 'process_success' );
|
199 |
+
}
|
200 |
+
|
201 |
+
$this->skin->after();
|
202 |
+
|
203 |
+
if ( ! $options['is_multi'] ) {
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Fires when the upgrader process is complete.
|
207 |
+
*
|
208 |
+
* See also {@see 'upgrader_package_options'}.
|
209 |
+
*
|
210 |
+
* @since 3.6.0
|
211 |
+
* @since 3.7.0 Added to WP_Upgrader::run().
|
212 |
+
* @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`.
|
213 |
+
*
|
214 |
+
* @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a
|
215 |
+
* Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
|
216 |
+
* @param array $hook_extra {
|
217 |
+
* Array of bulk item update data.
|
218 |
+
*
|
219 |
+
* @type string $action Type of action. Default 'update'.
|
220 |
+
* @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'.
|
221 |
+
* @type bool $bulk Whether the update process is a bulk update. Default true.
|
222 |
+
* @type array $plugins Array of the basename paths of the plugins' main files.
|
223 |
+
* @type array $themes The theme slugs.
|
224 |
+
* @type array $translations {
|
225 |
+
* Array of translations update data.
|
226 |
+
*
|
227 |
+
* @type string $language The locale the translation is for.
|
228 |
+
* @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'.
|
229 |
+
* @type string $slug Text domain the translation is for. The slug of a theme/plugin or
|
230 |
+
* 'default' for core translations.
|
231 |
+
* @type string $version The version of a theme, plugin, or core.
|
232 |
+
* }
|
233 |
+
* }
|
234 |
+
*/
|
235 |
+
do_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
|
236 |
+
|
237 |
+
$this->skin->footer();
|
238 |
+
}
|
239 |
+
|
240 |
+
return $result;
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Toggle maintenance mode for the site.
|
245 |
+
*
|
246 |
+
* Creates/deletes the maintenance file to enable/disable maintenance mode.
|
247 |
+
*
|
248 |
+
* @since 2.8.0
|
249 |
+
*
|
250 |
+
* @global WP_Filesystem_Base $wp_filesystem Subclass
|
251 |
+
*
|
252 |
+
* @param bool $enable True to enable maintenance mode, false to disable.
|
253 |
+
*/
|
254 |
+
public function maintenance_mode( $enable = false ) {
|
255 |
+
global $wp_filesystem;
|
256 |
+
$file = $wp_filesystem->abspath() . '.maintenance';
|
257 |
+
if ( $enable ) {
|
258 |
+
//$this->skin->feedback( 'maintenance_start' );
|
259 |
+
// Create maintenance file to signal that we are upgrading
|
260 |
+
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
|
261 |
+
$wp_filesystem->delete( $file );
|
262 |
+
$wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
|
263 |
+
} elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
|
264 |
+
//$this->skin->feedback( 'maintenance_end' );
|
265 |
+
$wp_filesystem->delete( $file );
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Download a package.
|
271 |
+
*
|
272 |
+
* @since 2.8.0
|
273 |
+
*
|
274 |
+
* @param string $package The URI of the package. If this is the full path to an
|
275 |
+
* existing local file, it will be returned untouched.
|
276 |
+
* @param bool $check_signatures Whether to validate file signatures. Default false.
|
277 |
+
* @return string|WP_Error The full path to the downloaded package file, or a WP_Error object.
|
278 |
+
*/
|
279 |
+
public function download_package( $package, $check_signatures = false ) {
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Filters whether to return the package.
|
283 |
+
*
|
284 |
+
* @since 3.7.0
|
285 |
+
*
|
286 |
+
* @param bool $reply Whether to bail without returning the package.
|
287 |
+
* Default false.
|
288 |
+
* @param string $package The package file name.
|
289 |
+
* @param WP_Upgrader $this The WP_Upgrader instance.
|
290 |
+
*/
|
291 |
+
$reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
|
292 |
+
if ( false !== $reply ) {
|
293 |
+
return $reply;
|
294 |
+
}
|
295 |
+
|
296 |
+
if ( ! preg_match( '!^(http|https|ftp)://!i', $package ) && file_exists( $package ) ) { //Local file or remote?
|
297 |
+
return $package; //must be a local file..
|
298 |
+
}
|
299 |
+
|
300 |
+
if ( empty( $package ) ) {
|
301 |
+
return new WP_Error( 'no_package', $this->strings['no_package'] );
|
302 |
+
}
|
303 |
+
|
304 |
+
//$this->skin->feedback( 'downloading_package', $package );
|
305 |
+
|
306 |
+
$download_file = download_url( $package, 300, $check_signatures );
|
307 |
+
|
308 |
+
if ( is_wp_error( $download_file ) && ! $download_file->get_error_data( 'softfail-filename' ) ) {
|
309 |
+
return new WP_Error( 'download_failed', $this->strings['download_failed'], $download_file->get_error_message() );
|
310 |
+
}
|
311 |
+
|
312 |
+
return $download_file;
|
313 |
+
}
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Unpack a compressed package file.
|
317 |
+
*
|
318 |
+
* @since 2.8.0
|
319 |
+
*
|
320 |
+
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
321 |
+
*
|
322 |
+
* @param string $package Full path to the package file.
|
323 |
+
* @param bool $delete_package Optional. Whether to delete the package file after attempting
|
324 |
+
* to unpack it. Default true.
|
325 |
+
* @return string|WP_Error The path to the unpacked contents, or a WP_Error on failure.
|
326 |
+
*/
|
327 |
+
public function unpack_package( $package, $delete_package = true ) {
|
328 |
+
global $wp_filesystem;
|
329 |
+
|
330 |
+
//$this->skin->feedback( 'unpack_package' );
|
331 |
+
|
332 |
+
$upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
|
333 |
+
|
334 |
+
//Clean up contents of upgrade directory beforehand.
|
335 |
+
$upgrade_files = $wp_filesystem->dirlist( $upgrade_folder );
|
336 |
+
if ( ! empty( $upgrade_files ) ) {
|
337 |
+
foreach ( $upgrade_files as $file ) {
|
338 |
+
$wp_filesystem->delete( $upgrade_folder . $file['name'], true );
|
339 |
+
}
|
340 |
+
}
|
341 |
+
|
342 |
+
// We need a working directory - Strip off any .tmp or .zip suffixes
|
343 |
+
$working_dir = $upgrade_folder . basename( basename( $package, '.tmp' ), '.zip' );
|
344 |
+
|
345 |
+
// Clean up working directory
|
346 |
+
if ( $wp_filesystem->is_dir( $working_dir ) ) {
|
347 |
+
$wp_filesystem->delete( $working_dir, true );
|
348 |
+
}
|
349 |
+
|
350 |
+
// Unzip package to working directory
|
351 |
+
$result = unzip_file( $package, $working_dir );
|
352 |
+
|
353 |
+
// Once extracted, delete the package if required.
|
354 |
+
if ( $delete_package ) {
|
355 |
+
unlink( $package );
|
356 |
+
}
|
357 |
+
|
358 |
+
if ( is_wp_error( $result ) ) {
|
359 |
+
$wp_filesystem->delete( $working_dir, true );
|
360 |
+
if ( 'incompatible_archive' == $result->get_error_code() ) {
|
361 |
+
return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );
|
362 |
+
}
|
363 |
+
return $result;
|
364 |
+
}
|
365 |
+
|
366 |
+
return $working_dir;
|
367 |
+
}
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Install a package.
|
371 |
+
*
|
372 |
+
* Copies the contents of a package form a source directory, and installs them in
|
373 |
+
* a destination directory. Optionally removes the source. It can also optionally
|
374 |
+
* clear out the destination folder if it already exists.
|
375 |
+
*
|
376 |
+
* @since 2.8.0
|
377 |
+
*
|
378 |
+
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
379 |
+
* @global array $wp_theme_directories
|
380 |
+
*
|
381 |
+
* @param array|string $args {
|
382 |
+
* Optional. Array or string of arguments for installing a package. Default empty array.
|
383 |
+
*
|
384 |
+
* @type string $source Required path to the package source. Default empty.
|
385 |
+
* @type string $destination Required path to a folder to install the package in.
|
386 |
+
* Default empty.
|
387 |
+
* @type bool $clear_destination Whether to delete any files already in the destination
|
388 |
+
* folder. Default false.
|
389 |
+
* @type bool $clear_working Whether to delete the files form the working directory
|
390 |
+
* after copying to the destination. Default false.
|
391 |
+
* @type bool $abort_if_destination_exists Whether to abort the installation if
|
392 |
+
* the destination folder already exists. Default true.
|
393 |
+
* @type array $hook_extra Extra arguments to pass to the filter hooks called by
|
394 |
+
* WP_Upgrader::install_package(). Default empty array.
|
395 |
+
* }
|
396 |
+
*
|
397 |
+
* @return array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.
|
398 |
+
*/
|
399 |
+
public function install_package( $args = array() ) {
|
400 |
+
global $wp_filesystem, $wp_theme_directories;
|
401 |
+
|
402 |
+
$defaults = array(
|
403 |
+
'source' => '', // Please always pass this
|
404 |
+
'destination' => '', // and this
|
405 |
+
'clear_destination' => false,
|
406 |
+
'clear_working' => false,
|
407 |
+
'abort_if_destination_exists' => true,
|
408 |
+
'hook_extra' => array(),
|
409 |
+
);
|
410 |
+
|
411 |
+
$args = wp_parse_args( $args, $defaults );
|
412 |
+
|
413 |
+
// These were previously extract()'d.
|
414 |
+
$source = $args['source'];
|
415 |
+
$destination = $args['destination'];
|
416 |
+
$clear_destination = $args['clear_destination'];
|
417 |
+
|
418 |
+
set_time_limit( 300 );
|
419 |
+
|
420 |
+
if ( empty( $source ) || empty( $destination ) ) {
|
421 |
+
return new WP_Error( 'bad_request', $this->strings['bad_request'] );
|
422 |
+
}
|
423 |
+
//$this->skin->feedback( 'installing_package' );
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Filters the install response before the installation has started.
|
427 |
+
*
|
428 |
+
* Returning a truthy value, or one that could be evaluated as a WP_Error
|
429 |
+
* will effectively short-circuit the installation, returning that value
|
430 |
+
* instead.
|
431 |
+
*
|
432 |
+
* @since 2.8.0
|
433 |
+
*
|
434 |
+
* @param bool|WP_Error $response Response.
|
435 |
+
* @param array $hook_extra Extra arguments passed to hooked filters.
|
436 |
+
*/
|
437 |
+
$res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] );
|
438 |
+
|
439 |
+
if ( is_wp_error( $res ) ) {
|
440 |
+
return $res;
|
441 |
+
}
|
442 |
+
|
443 |
+
//Retain the Original source and destinations
|
444 |
+
$remote_source = $args['source'];
|
445 |
+
$local_destination = $destination;
|
446 |
+
|
447 |
+
$source_files = array_keys( $wp_filesystem->dirlist( $remote_source ) );
|
448 |
+
$remote_destination = $wp_filesystem->find_folder( $local_destination );
|
449 |
+
|
450 |
+
//Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
|
451 |
+
if ( 1 == count( $source_files ) && $wp_filesystem->is_dir( trailingslashit( $args['source'] ) . $source_files[0] . '/' ) ) { //Only one folder? Then we want its contents.
|
452 |
+
$source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
|
453 |
+
} elseif ( count( $source_files ) == 0 ) {
|
454 |
+
return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
|
455 |
+
} else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
|
456 |
+
$source = trailingslashit( $args['source'] );
|
457 |
+
}
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Filters the source file location for the upgrade package.
|
461 |
+
*
|
462 |
+
* @since 2.8.0
|
463 |
+
* @since 4.4.0 The $hook_extra parameter became available.
|
464 |
+
*
|
465 |
+
* @param string $source File source location.
|
466 |
+
* @param string $remote_source Remote file source location.
|
467 |
+
* @param WP_Upgrader $this WP_Upgrader instance.
|
468 |
+
* @param array $hook_extra Extra arguments passed to hooked filters.
|
469 |
+
*/
|
470 |
+
$source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this, $args['hook_extra'] );
|
471 |
+
|
472 |
+
if ( is_wp_error( $source ) ) {
|
473 |
+
return $source;
|
474 |
+
}
|
475 |
+
|
476 |
+
// Has the source location changed? If so, we need a new source_files list.
|
477 |
+
if ( $source !== $remote_source ) {
|
478 |
+
$source_files = array_keys( $wp_filesystem->dirlist( $source ) );
|
479 |
+
}
|
480 |
+
|
481 |
+
/*
|
482 |
+
* Protection against deleting files in any important base directories.
|
483 |
+
* Theme_Upgrader & Plugin_Upgrader also trigger this, as they pass the
|
484 |
+
* destination directory (WP_PLUGIN_DIR / wp-content/themes) intending
|
485 |
+
* to copy the directory into the directory, whilst they pass the source
|
486 |
+
* as the actual files to copy.
|
487 |
+
*/
|
488 |
+
$protected_directories = array( ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes' );
|
489 |
+
|
490 |
+
if ( is_array( $wp_theme_directories ) ) {
|
491 |
+
$protected_directories = array_merge( $protected_directories, $wp_theme_directories );
|
492 |
+
}
|
493 |
+
|
494 |
+
if ( in_array( $destination, $protected_directories ) ) {
|
495 |
+
$remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
|
496 |
+
$destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
|
497 |
+
}
|
498 |
+
|
499 |
+
if ( $clear_destination ) {
|
500 |
+
// We're going to clear the destination if there's something there.
|
501 |
+
//$this->skin->feedback( 'remove_old' );
|
502 |
+
|
503 |
+
$removed = $this->clear_destination( $remote_destination );
|
504 |
+
|
505 |
+
/**
|
506 |
+
* Filters whether the upgrader cleared the destination.
|
507 |
+
*
|
508 |
+
* @since 2.8.0
|
509 |
+
*
|
510 |
+
* @param mixed $removed Whether the destination was cleared. true on success, WP_Error on failure
|
511 |
+
* @param string $local_destination The local package destination.
|
512 |
+
* @param string $remote_destination The remote package destination.
|
513 |
+
* @param array $hook_extra Extra arguments passed to hooked filters.
|
514 |
+
*/
|
515 |
+
$removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
|
516 |
+
|
517 |
+
if ( is_wp_error( $removed ) ) {
|
518 |
+
return $removed;
|
519 |
+
}
|
520 |
+
} elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {
|
521 |
+
//If we're not clearing the destination folder and something exists there already, Bail.
|
522 |
+
//But first check to see if there are actually any files in the folder.
|
523 |
+
$_files = $wp_filesystem->dirlist( $remote_destination );
|
524 |
+
if ( ! empty( $_files ) ) {
|
525 |
+
$wp_filesystem->delete( $remote_source, true ); //Clear out the source files.
|
526 |
+
return new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination );
|
527 |
+
}
|
528 |
+
}
|
529 |
+
|
530 |
+
//Create destination if needed
|
531 |
+
if ( ! $wp_filesystem->exists( $remote_destination ) ) {
|
532 |
+
if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
|
533 |
+
return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
|
534 |
+
}
|
535 |
+
}
|
536 |
+
// Copy new version of item into place.
|
537 |
+
$result = copy_dir( $source, $remote_destination );
|
538 |
+
if ( is_wp_error( $result ) ) {
|
539 |
+
if ( $args['clear_working'] ) {
|
540 |
+
$wp_filesystem->delete( $remote_source, true );
|
541 |
+
}
|
542 |
+
return $result;
|
543 |
+
}
|
544 |
+
|
545 |
+
//Clear the Working folder?
|
546 |
+
if ( $args['clear_working'] ) {
|
547 |
+
$wp_filesystem->delete( $remote_source, true );
|
548 |
+
}
|
549 |
+
|
550 |
+
$destination_name = basename( str_replace( $local_destination, '', $destination ) );
|
551 |
+
if ( '.' == $destination_name ) {
|
552 |
+
$destination_name = '';
|
553 |
+
}
|
554 |
+
|
555 |
+
$this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );
|
556 |
+
|
557 |
+
/**
|
558 |
+
* Filters the installation response after the installation has finished.
|
559 |
+
*
|
560 |
+
* @since 2.8.0
|
561 |
+
*
|
562 |
+
* @param bool $response Installation response.
|
563 |
+
* @param array $hook_extra Extra arguments passed to hooked filters.
|
564 |
+
* @param array $result Installation result data.
|
565 |
+
*/
|
566 |
+
$res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );
|
567 |
+
|
568 |
+
if ( is_wp_error( $res ) ) {
|
569 |
+
$this->result = $res;
|
570 |
+
return $res;
|
571 |
+
}
|
572 |
+
|
573 |
+
//Bombard the calling function will all the info which we've just used.
|
574 |
+
return $this->result;
|
575 |
+
}
|
576 |
+
}
|
src/Processor.php
CHANGED
@@ -152,12 +152,12 @@ class Processor {
|
|
152 |
public function filter_mail_from_email( $wp_email ) {
|
153 |
|
154 |
$options = new Options();
|
155 |
-
$
|
156 |
$from_email = $options->get( 'mail', 'from_email' );
|
157 |
$def_email = $this->get_default_email();
|
158 |
|
159 |
// Return FROM EMAIL if forced in settings.
|
160 |
-
if ( $
|
161 |
return $from_email;
|
162 |
}
|
163 |
|
@@ -166,11 +166,7 @@ class Processor {
|
|
166 |
return $wp_email;
|
167 |
}
|
168 |
|
169 |
-
|
170 |
-
$wp_email = $from_email;
|
171 |
-
}
|
172 |
-
|
173 |
-
return $wp_email;
|
174 |
}
|
175 |
|
176 |
/**
|
@@ -210,7 +206,7 @@ class Processor {
|
|
210 |
|
211 |
$server_name = Geo::get_site_domain();
|
212 |
|
213 |
-
if ( empty( $
|
214 |
return '';
|
215 |
}
|
216 |
|
152 |
public function filter_mail_from_email( $wp_email ) {
|
153 |
|
154 |
$options = new Options();
|
155 |
+
$forced = $options->get( 'mail', 'from_email_force' );
|
156 |
$from_email = $options->get( 'mail', 'from_email' );
|
157 |
$def_email = $this->get_default_email();
|
158 |
|
159 |
// Return FROM EMAIL if forced in settings.
|
160 |
+
if ( $forced & ! empty( $from_email ) ) {
|
161 |
return $from_email;
|
162 |
}
|
163 |
|
166 |
return $wp_email;
|
167 |
}
|
168 |
|
169 |
+
return ! empty( $from_email ) ? $from_email : $wp_email;
|
|
|
|
|
|
|
|
|
170 |
}
|
171 |
|
172 |
/**
|
206 |
|
207 |
$server_name = Geo::get_site_domain();
|
208 |
|
209 |
+
if ( empty( $server_name ) ) {
|
210 |
return '';
|
211 |
}
|
212 |
|
vendor/google/auth/src/Cache/Item.php
CHANGED
@@ -35,7 +35,7 @@ final class Item implements CacheItemInterface
|
|
35 |
private $value;
|
36 |
|
37 |
/**
|
38 |
-
* @var \DateTime
|
39 |
*/
|
40 |
private $expiration;
|
41 |
|
@@ -81,7 +81,7 @@ final class Item implements CacheItemInterface
|
|
81 |
return true;
|
82 |
}
|
83 |
|
84 |
-
return
|
85 |
}
|
86 |
|
87 |
/**
|
@@ -126,9 +126,9 @@ final class Item implements CacheItemInterface
|
|
126 |
public function expiresAfter($time)
|
127 |
{
|
128 |
if (is_int($time)) {
|
129 |
-
$this->expiration = new \
|
130 |
} elseif ($time instanceof \DateInterval) {
|
131 |
-
$this->expiration = (
|
132 |
} elseif ($time === null) {
|
133 |
$this->expiration = $time;
|
134 |
} else {
|
@@ -182,4 +182,9 @@ final class Item implements CacheItemInterface
|
|
182 |
|
183 |
return false;
|
184 |
}
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
35 |
private $value;
|
36 |
|
37 |
/**
|
38 |
+
* @var \DateTime|null
|
39 |
*/
|
40 |
private $expiration;
|
41 |
|
81 |
return true;
|
82 |
}
|
83 |
|
84 |
+
return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp();
|
85 |
}
|
86 |
|
87 |
/**
|
126 |
public function expiresAfter($time)
|
127 |
{
|
128 |
if (is_int($time)) {
|
129 |
+
$this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S"));
|
130 |
} elseif ($time instanceof \DateInterval) {
|
131 |
+
$this->expiration = $this->currentTime()->add($time);
|
132 |
} elseif ($time === null) {
|
133 |
$this->expiration = $time;
|
134 |
} else {
|
182 |
|
183 |
return false;
|
184 |
}
|
185 |
+
|
186 |
+
protected function currentTime()
|
187 |
+
{
|
188 |
+
return new \DateTime('now', new \DateTimeZone('UTC'));
|
189 |
+
}
|
190 |
}
|
vendor/psr/log/Psr/Log/LoggerInterface.php
CHANGED
@@ -118,6 +118,8 @@ interface LoggerInterface
|
|
118 |
* @param array $context
|
119 |
*
|
120 |
* @return void
|
|
|
|
|
121 |
*/
|
122 |
public function log($level, $message, array $context = array());
|
123 |
}
|
118 |
* @param array $context
|
119 |
*
|
120 |
* @return void
|
121 |
+
*
|
122 |
+
* @throws \Psr\Log\InvalidArgumentException
|
123 |
*/
|
124 |
public function log($level, $message, array $context = array());
|
125 |
}
|
vendor/psr/log/Psr/Log/LoggerTrait.php
CHANGED
@@ -135,6 +135,8 @@ trait LoggerTrait
|
|
135 |
* @param array $context
|
136 |
*
|
137 |
* @return void
|
|
|
|
|
138 |
*/
|
139 |
abstract public function log($level, $message, array $context = array());
|
140 |
}
|
135 |
* @param array $context
|
136 |
*
|
137 |
* @return void
|
138 |
+
*
|
139 |
+
* @throws \Psr\Log\InvalidArgumentException
|
140 |
*/
|
141 |
abstract public function log($level, $message, array $context = array());
|
142 |
}
|
vendor/psr/log/Psr/Log/NullLogger.php
CHANGED
@@ -20,6 +20,8 @@ class NullLogger extends AbstractLogger
|
|
20 |
* @param array $context
|
21 |
*
|
22 |
* @return void
|
|
|
|
|
23 |
*/
|
24 |
public function log($level, $message, array $context = array())
|
25 |
{
|
20 |
* @param array $context
|
21 |
*
|
22 |
* @return void
|
23 |
+
*
|
24 |
+
* @throws \Psr\Log\InvalidArgumentException
|
25 |
*/
|
26 |
public function log($level, $message, array $context = array())
|
27 |
{
|
wp_mail_smtp.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: WP Mail SMTP
|
4 |
-
* Version: 1.7.
|
5 |
* Plugin URI: https://wpmailsmtp.com/
|
6 |
* Description: Reconfigures the <code>wp_mail()</code> function to use Gmail/Mailgun/SendGrid/SMTP instead of the default <code>mail()</code> and creates an options page to manage the settings.
|
7 |
* Author: WPForms
|
@@ -32,6 +32,8 @@
|
|
32 |
/*
|
33 |
define( 'WPMS_ON', true ); // True turns on the whole constants support and usage, false turns it off.
|
34 |
|
|
|
|
|
35 |
define( 'WPMS_MAIL_FROM', 'mail@example.com' );
|
36 |
define( 'WPMS_MAIL_FROM_FORCE', true ); // True turns it on, false turns it off.
|
37 |
define( 'WPMS_MAIL_FROM_NAME', 'From Name' );
|
@@ -140,7 +142,7 @@ if ( ! function_exists( 'wp_mail_smtp_check_pro_loading_allowed' ) ) {
|
|
140 |
}
|
141 |
|
142 |
if ( ! defined( 'WPMS_PLUGIN_VER' ) ) {
|
143 |
-
define( 'WPMS_PLUGIN_VER', '1.7.
|
144 |
}
|
145 |
if ( ! defined( 'WPMS_PHP_VER' ) ) {
|
146 |
define( 'WPMS_PHP_VER', '5.3.6' );
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: WP Mail SMTP
|
4 |
+
* Version: 1.7.1
|
5 |
* Plugin URI: https://wpmailsmtp.com/
|
6 |
* Description: Reconfigures the <code>wp_mail()</code> function to use Gmail/Mailgun/SendGrid/SMTP instead of the default <code>mail()</code> and creates an options page to manage the settings.
|
7 |
* Author: WPForms
|
32 |
/*
|
33 |
define( 'WPMS_ON', true ); // True turns on the whole constants support and usage, false turns it off.
|
34 |
|
35 |
+
define( 'WPMS_DO_NOT_SEND', true ); // Or false, in that case constant is ignored.
|
36 |
+
|
37 |
define( 'WPMS_MAIL_FROM', 'mail@example.com' );
|
38 |
define( 'WPMS_MAIL_FROM_FORCE', true ); // True turns it on, false turns it off.
|
39 |
define( 'WPMS_MAIL_FROM_NAME', 'From Name' );
|
142 |
}
|
143 |
|
144 |
if ( ! defined( 'WPMS_PLUGIN_VER' ) ) {
|
145 |
+
define( 'WPMS_PLUGIN_VER', '1.7.1' );
|
146 |
}
|
147 |
if ( ! defined( 'WPMS_PHP_VER' ) ) {
|
148 |
define( 'WPMS_PHP_VER', '5.3.6' );
|