Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,178 @@
|
||||
/* globals wp_mail_smtp_connect */
|
||||
|
||||
/**
|
||||
* Connect functionality - Upgrade plugin from Lite to Pro version.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var WPMailSMTPConnect = window.WPMailSMTPConnect || ( function( document, window, $ ) {
|
||||
|
||||
/**
|
||||
* Elements reference.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var el = {
|
||||
$connectBtn: $( '#wp-mail-smtp-setting-upgrade-license-button' ),
|
||||
$connectKey: $( '#wp-mail-smtp-setting-upgrade-license-key' )
|
||||
};
|
||||
|
||||
/**
|
||||
* Public functions and properties.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var app = {
|
||||
|
||||
/**
|
||||
* Start the engine.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
init: function() {
|
||||
|
||||
$( app.ready );
|
||||
},
|
||||
|
||||
/**
|
||||
* Document ready.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
ready: function() {
|
||||
|
||||
app.events();
|
||||
},
|
||||
|
||||
/**
|
||||
* Register JS events.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
events: function() {
|
||||
|
||||
app.connectBtnClick();
|
||||
},
|
||||
|
||||
/**
|
||||
* Register connect button event.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
connectBtnClick: function() {
|
||||
|
||||
el.$connectBtn.on( 'click', function() {
|
||||
app.gotoUpgradeUrl();
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the alert arguments in case of Pro already installed.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param {object} res Ajax query result object.
|
||||
*
|
||||
* @returns {object} Alert arguments.
|
||||
*/
|
||||
proAlreadyInstalled: function( res ) {
|
||||
|
||||
return {
|
||||
title: wp_mail_smtp_connect.text.almost_done,
|
||||
content: res.data.message,
|
||||
icon: '"></i><img src="' + wp_mail_smtp_connect.plugin_url + '/assets/images/font-awesome/check-circle-solid-green.svg" style="width: 40px; height: 40px;"><i class="',
|
||||
type: 'green',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp_connect.text.plugin_activate_btn,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ],
|
||||
action: function() {
|
||||
window.location.reload();
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Go to upgrade url.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
gotoUpgradeUrl: function() {
|
||||
|
||||
var data = {
|
||||
action: 'wp_mail_smtp_connect_url',
|
||||
key: el.$connectKey.val(),
|
||||
nonce: wp_mail_smtp_connect.nonce,
|
||||
};
|
||||
|
||||
$.post( wp_mail_smtp_connect.ajax_url, data )
|
||||
.done( function( res ) {
|
||||
if ( res.success ) {
|
||||
if ( res.data.reload ) {
|
||||
$.alert( app.proAlreadyInstalled( res ) );
|
||||
return;
|
||||
}
|
||||
window.location.href = res.data.url;
|
||||
return;
|
||||
}
|
||||
$.alert( {
|
||||
title: wp_mail_smtp_connect.text.oops,
|
||||
content: res.data.message,
|
||||
icon: '"></i><img src="' + wp_mail_smtp_connect.plugin_url + '/assets/images/font-awesome/exclamation-circle-solid-orange.svg" style="width: 40px; height: 40px;"><i class="',
|
||||
type: 'orange',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp_connect.text.ok,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ],
|
||||
},
|
||||
},
|
||||
} );
|
||||
} )
|
||||
.fail( function( xhr ) {
|
||||
app.failAlert( xhr );
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Alert in case of server error.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param {object} xhr XHR object.
|
||||
*/
|
||||
failAlert: function( xhr ) {
|
||||
|
||||
$.alert( {
|
||||
title: wp_mail_smtp_connect.text.oops,
|
||||
content: wp_mail_smtp_connect.text.server_error + '<br>' + xhr.status + ' ' + xhr.statusText + ' ' + xhr.responseText,
|
||||
icon: '"></i><img src="' + wp_mail_smtp_connect.plugin_url + '/assets/images/font-awesome/exclamation-circle-regular-red.svg" style="width: 40px; height: 40px;"><i class="',
|
||||
type: 'red',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp_connect.text.ok,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ],
|
||||
},
|
||||
},
|
||||
} );
|
||||
},
|
||||
};
|
||||
|
||||
// Provide access to public functions/properties.
|
||||
return app;
|
||||
|
||||
}( document, window, jQuery ) );
|
||||
|
||||
// Initialize.
|
||||
WPMailSMTPConnect.init();
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var WPMailSMTPConnect=window.WPMailSMTPConnect||function(n,e){var c={$connectBtn:e("#wp-mail-smtp-setting-upgrade-license-button"),$connectKey:e("#wp-mail-smtp-setting-upgrade-license-key")},o={init:function(){e(o.ready)},ready:function(){o.events()},events:function(){o.connectBtnClick()},connectBtnClick:function(){c.$connectBtn.on("click",function(){o.gotoUpgradeUrl()})},proAlreadyInstalled:function(t){return{title:wp_mail_smtp_connect.text.almost_done,content:t.data.message,icon:'"></i><img src="'+wp_mail_smtp_connect.plugin_url+'/assets/images/font-awesome/check-circle-solid-green.svg" style="width: 40px; height: 40px;"><i class="',type:"green",buttons:{confirm:{text:wp_mail_smtp_connect.text.plugin_activate_btn,btnClass:"btn-confirm",keys:["enter"],action:function(){n.location.reload()}}}}},gotoUpgradeUrl:function(){var t={action:"wp_mail_smtp_connect_url",key:c.$connectKey.val(),nonce:wp_mail_smtp_connect.nonce};e.post(wp_mail_smtp_connect.ajax_url,t).done(function(t){return t.success?t.data.reload?void e.alert(o.proAlreadyInstalled(t)):void(n.location.href=t.data.url):void e.alert({title:wp_mail_smtp_connect.text.oops,content:t.data.message,icon:'"></i><img src="'+wp_mail_smtp_connect.plugin_url+'/assets/images/font-awesome/exclamation-circle-solid-orange.svg" style="width: 40px; height: 40px;"><i class="',type:"orange",buttons:{confirm:{text:wp_mail_smtp_connect.text.ok,btnClass:"btn-confirm",keys:["enter"]}}})}).fail(function(t){o.failAlert(t)})},failAlert:function(t){e.alert({title:wp_mail_smtp_connect.text.oops,content:wp_mail_smtp_connect.text.server_error+"<br>"+t.status+" "+t.statusText+" "+t.responseText,icon:'"></i><img src="'+wp_mail_smtp_connect.plugin_url+'/assets/images/font-awesome/exclamation-circle-regular-red.svg" style="width: 40px; height: 40px;"><i class="',type:"red",buttons:{confirm:{text:wp_mail_smtp_connect.text.ok,btnClass:"btn-confirm",keys:["enter"]}}})}};return o}((document,window),jQuery);WPMailSMTPConnect.init();
|
||||
@@ -0,0 +1,190 @@
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
/* global wp_mail_smtp_about */
|
||||
'use strict';
|
||||
|
||||
var WPMailSMTP = window.WPMailSMTP || {};
|
||||
WPMailSMTP.Admin = WPMailSMTP.Admin || {};
|
||||
|
||||
/**
|
||||
* WP Mail SMTP Admin area About module.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
WPMailSMTP.Admin.About = WPMailSMTP.Admin.About || ( function( document, window, $ ) {
|
||||
|
||||
/**
|
||||
* Public functions and properties.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var app = {
|
||||
|
||||
/**
|
||||
* Start the engine. DOM is not ready yet, use only to init something.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
init: function() {
|
||||
|
||||
// Do that when DOM is ready.
|
||||
$( app.ready );
|
||||
},
|
||||
|
||||
/**
|
||||
* DOM is fully loaded.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
ready: function() {
|
||||
|
||||
app.pageHolder = $( '.wp-mail-smtp-page-about' );
|
||||
|
||||
app.bindActions();
|
||||
|
||||
$( '.wp-mail-smtp-page' ).trigger( 'WPMailSMTP.Admin.About.ready' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Process all generic actions/events, mostly custom that were fired by our API.
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
bindActions: function() {
|
||||
|
||||
/*
|
||||
* Make plugins description the same height.
|
||||
*/
|
||||
jQuery( '.wp-mail-smtp-admin-about-plugins .plugin-item .details' ).matchHeight();
|
||||
|
||||
/*
|
||||
* Install/Active the plugins.
|
||||
*/
|
||||
$( document ).on( 'click', '.wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
var $btn = $( this );
|
||||
|
||||
if ( $btn.hasClass( 'disabled' ) || $btn.hasClass( 'loading' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var $plugin = $btn.closest( '.plugin-item' ),
|
||||
plugin = $btn.attr( 'data-plugin' ),
|
||||
task,
|
||||
cssClass,
|
||||
statusText,
|
||||
buttonText,
|
||||
successText;
|
||||
|
||||
$btn.addClass( 'loading disabled' );
|
||||
$btn.text( wp_mail_smtp_about.plugin_processing );
|
||||
|
||||
if ( $btn.hasClass( 'status-inactive' ) ) {
|
||||
|
||||
// Activate.
|
||||
task = 'about_plugin_activate';
|
||||
cssClass = 'status-active button button-secondary disabled';
|
||||
statusText = wp_mail_smtp_about.plugin_active;
|
||||
buttonText = wp_mail_smtp_about.plugin_activated;
|
||||
|
||||
} else if ( $btn.hasClass( 'status-download' ) ) {
|
||||
|
||||
// Install & Activate.
|
||||
task = 'about_plugin_install';
|
||||
cssClass = 'status-active button disabled';
|
||||
statusText = wp_mail_smtp_about.plugin_active;
|
||||
buttonText = wp_mail_smtp_about.plugin_activated;
|
||||
|
||||
} else if ( $btn.hasClass( 'status-open' ) ) {
|
||||
|
||||
// Open site in new window.
|
||||
window.open( $btn.attr( 'href' ), '_blank' ).focus();
|
||||
$btn.removeClass( 'loading disabled' );
|
||||
$btn.text( wp_mail_smtp_about.plugin_visit );
|
||||
|
||||
return;
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
// Setup ajax POST data.
|
||||
var data = {
|
||||
action: 'wp_mail_smtp_ajax',
|
||||
task: task,
|
||||
nonce : wp_mail_smtp_about.nonce,
|
||||
plugin: plugin
|
||||
};
|
||||
|
||||
$.post( wp_mail_smtp_about.ajax_url, data, function( res ) {
|
||||
var isInstallSuccessful;
|
||||
|
||||
if ( res.success ) {
|
||||
isInstallSuccessful = true;
|
||||
if ( 'about_plugin_install' === task ) {
|
||||
$btn.attr( 'data-plugin', res.data.basename );
|
||||
successText = res.data.msg;
|
||||
if ( ! res.data.is_activated ) {
|
||||
cssClass = 'button';
|
||||
statusText = wp_mail_smtp_about.plugin_inactive;
|
||||
buttonText = wp_mail_smtp_about.plugin_activate;
|
||||
}
|
||||
} else {
|
||||
successText = res.data;
|
||||
}
|
||||
$plugin.find( '.actions' ).append( '<div class="msg success">' + successText + '</div>' );
|
||||
$plugin.find( 'span.status-label' )
|
||||
.removeClass( 'status-active status-inactive status-download' )
|
||||
.addClass( cssClass )
|
||||
.removeClass( 'button button-primary button-secondary disabled' )
|
||||
.text( statusText );
|
||||
$btn
|
||||
.removeClass( 'status-active status-inactive status-download' )
|
||||
.removeClass( 'button button-primary button-secondary disabled' )
|
||||
.addClass( cssClass ).html( buttonText );
|
||||
} else {
|
||||
isInstallSuccessful = false;
|
||||
|
||||
if (
|
||||
res.hasOwnProperty( 'data' ) &&
|
||||
res.data.hasOwnProperty( 0 ) &&
|
||||
res.data[ 0 ].hasOwnProperty( 'code' ) &&
|
||||
res.data[ 0 ].code === 'download_failed'
|
||||
) {
|
||||
|
||||
// Specific server-returned error.
|
||||
$plugin.find( '.actions' ).append( '<div class="msg error">' + wp_mail_smtp_about.plugin_install_error + '</div>' );
|
||||
} else {
|
||||
|
||||
// Generic error.
|
||||
$plugin.find( '.actions' ).append( '<div class="msg error">' + res.data + '</div>' );
|
||||
}
|
||||
|
||||
$btn.html( wp_mail_smtp_about.plugin_download_btn );
|
||||
}
|
||||
|
||||
if ( ! isInstallSuccessful ) {
|
||||
$btn.removeClass( 'disabled' );
|
||||
}
|
||||
$btn.removeClass( 'loading' );
|
||||
|
||||
// Automatically clear plugin messages after 3 seconds.
|
||||
setTimeout( function() {
|
||||
$( '.plugin-item .msg' ).remove();
|
||||
}, 3000 );
|
||||
|
||||
} ).fail( function( xhr ) {
|
||||
console.log( xhr.responseText );
|
||||
} );
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
// Provide access to public functions/properties.
|
||||
return app;
|
||||
}( document, window, jQuery ) );
|
||||
|
||||
// Initialize.
|
||||
WPMailSMTP.Admin.About.init();
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.About=WPMailSMTP.Admin.About||function(a,t,u){var i={init:function(){u(i.ready)},ready:function(){i.pageHolder=u(".wp-mail-smtp-page-about"),i.bindActions(),u(".wp-mail-smtp-page").trigger("WPMailSMTP.Admin.About.ready")},bindActions:function(){jQuery(".wp-mail-smtp-admin-about-plugins .plugin-item .details").matchHeight(),u(a).on("click",".wp-mail-smtp-admin-about-plugins .plugin-item .action-button .button",function(a){a.preventDefault();var i=u(this);if(i.hasClass("disabled")||i.hasClass("loading"))return!1;var s,n,l,e,o,d=i.closest(".plugin-item"),a=i.attr("data-plugin");if(i.addClass("loading disabled"),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,e=wp_mail_smtp_about.plugin_activated;else{if(!i.hasClass("status-download"))return i.hasClass("status-open")?(t.open(i.attr("href"),"_blank").focus(),i.removeClass("loading disabled"),void i.text(wp_mail_smtp_about.plugin_visit)):void 0;s="about_plugin_install",n="status-active button disabled",l=wp_mail_smtp_about.plugin_active,e=wp_mail_smtp_about.plugin_activated}a={action:"wp_mail_smtp_ajax",task:s,nonce:wp_mail_smtp_about.nonce,plugin:a};u.post(wp_mail_smtp_about.ajax_url,a,function(a){var t;a.success?(t=!0,"about_plugin_install"===s?(i.attr("data-plugin",a.data.basename),o=a.data.msg,a.data.is_activated||(n="button",l=wp_mail_smtp_about.plugin_inactive,e=wp_mail_smtp_about.plugin_activate)):o=a.data,d.find(".actions").append('<div class="msg success">'+o+"</div>"),d.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(e)):(t=!1,a.hasOwnProperty("data")&&a.data.hasOwnProperty(0)&&a.data[0].hasOwnProperty("code")&&"download_failed"===a.data[0].code?d.find(".actions").append('<div class="msg error">'+wp_mail_smtp_about.plugin_install_error+"</div>"):d.find(".actions").append('<div class="msg error">'+a.data+"</div>"),i.html(wp_mail_smtp_about.plugin_download_btn)),t||i.removeClass("disabled"),i.removeClass("loading"),setTimeout(function(){u(".plugin-item .msg").remove()},3e3)}).fail(function(a){console.log(a.responseText)})})}};return i}(document,window,jQuery),WPMailSMTP.Admin.About.init();
|
||||
@@ -0,0 +1,517 @@
|
||||
/* globals wp_mail_smtp, jconfirm, ajaxurl */
|
||||
'use strict';
|
||||
|
||||
var WPMailSMTP = window.WPMailSMTP || {};
|
||||
WPMailSMTP.Admin = WPMailSMTP.Admin || {};
|
||||
|
||||
/**
|
||||
* WP Mail SMTP Admin area module.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
WPMailSMTP.Admin.Settings = WPMailSMTP.Admin.Settings || ( function( document, window, $ ) {
|
||||
|
||||
/**
|
||||
* Public functions and properties.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var app = {
|
||||
|
||||
/**
|
||||
* State attribute showing if one of the plugin settings
|
||||
* changed and was not yet saved.
|
||||
*
|
||||
* @since 1.9.0
|
||||
*
|
||||
* @type {boolean}
|
||||
*/
|
||||
pluginSettingsChanged: false,
|
||||
|
||||
/**
|
||||
* Start the engine. DOM is not ready yet, use only to init something.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
init: function() {
|
||||
|
||||
// Do that when DOM is ready.
|
||||
$( app.ready );
|
||||
},
|
||||
|
||||
/**
|
||||
* DOM is fully loaded.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
ready: function() {
|
||||
|
||||
app.pageHolder = $( '.wp-mail-smtp-tab-settings' );
|
||||
|
||||
app.settingsForm = $( '.wp-mail-smtp-connection-settings-form' );
|
||||
|
||||
// If there are screen options we have to move them.
|
||||
$( '#screen-meta-links, #screen-meta' ).prependTo( '#wp-mail-smtp-header-temp' ).show();
|
||||
|
||||
app.bindActions();
|
||||
|
||||
app.setJQueryConfirmDefaults();
|
||||
|
||||
// Flyout Menu.
|
||||
app.initFlyoutMenu();
|
||||
},
|
||||
|
||||
/**
|
||||
* Process all generic actions/events, mostly custom that were fired by our API.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
bindActions: function() {
|
||||
|
||||
// Mailer selection.
|
||||
$( '.wp-mail-smtp-mailer-image', app.settingsForm ).on( 'click', function() {
|
||||
$( this ).parents( '.wp-mail-smtp-mailer' ).find( 'input' ).trigger( 'click' );
|
||||
} );
|
||||
|
||||
$( '.wp-mail-smtp-mailer input', app.settingsForm ).on( 'click', function() {
|
||||
var $input = $( this );
|
||||
|
||||
if ( $input.prop( 'disabled' ) ) {
|
||||
|
||||
// Educational Popup.
|
||||
if ( $input.hasClass( 'educate' ) ) {
|
||||
app.education.upgradeMailer( $input );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deselect the current mailer.
|
||||
$( '.wp-mail-smtp-mailer', app.settingsForm ).removeClass( 'active' );
|
||||
|
||||
// Select the correct one.
|
||||
$( this ).parents( '.wp-mail-smtp-mailer' ).addClass( 'active' );
|
||||
|
||||
// Hide all mailers options and display for a currently clicked one.
|
||||
$( '.wp-mail-smtp-mailer-option', app.settingsForm ).addClass( 'hidden' ).removeClass( 'active' );
|
||||
$( '.wp-mail-smtp-mailer-option-' + $( this ).val(), app.settingsForm ).addClass( 'active' ).removeClass( 'hidden' );
|
||||
} );
|
||||
|
||||
app.mailers.smtp.bindActions();
|
||||
|
||||
// Dismiss Pro banner at the bottom of the page.
|
||||
$( '#wp-mail-smtp-pro-banner-dismiss', app.pageHolder ).on( 'click', function() {
|
||||
$.ajax( {
|
||||
url: ajaxurl,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: {
|
||||
action: 'wp_mail_smtp_ajax',
|
||||
task: 'pro_banner_dismiss',
|
||||
nonce: wp_mail_smtp.nonce
|
||||
}
|
||||
} )
|
||||
.always( function() {
|
||||
$( '#wp-mail-smtp-pro-banner', app.pageHolder ).fadeOut( 'fast' );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Dissmis educational notices for certain mailers.
|
||||
$( '.js-wp-mail-smtp-mailer-notice-dismiss', app.settingsForm ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
var $btn = $( this ),
|
||||
$notice = $btn.parents( '.inline-notice' );
|
||||
|
||||
if ( $btn.hasClass( 'disabled' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax( {
|
||||
url: ajaxurl,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: {
|
||||
action: 'wp_mail_smtp_ajax',
|
||||
nonce: wp_mail_smtp.nonce,
|
||||
task: 'notice_dismiss',
|
||||
notice: $notice.data( 'notice' ),
|
||||
mailer: $notice.data( 'mailer' )
|
||||
},
|
||||
beforeSend: function() {
|
||||
$btn.addClass( 'disabled' );
|
||||
}
|
||||
} )
|
||||
.always( function() {
|
||||
$notice.fadeOut( 'fast', function() {
|
||||
$btn.removeClass( 'disabled' );
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Show/hide debug output.
|
||||
$( '#wp-mail-smtp-debug .error-log-toggle' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
$( '#wp-mail-smtp-debug .error-log' ).slideToggle();
|
||||
} );
|
||||
|
||||
// Copy debug output to clipboard.
|
||||
$( '#wp-mail-smtp-debug .error-log-copy' ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
var $self = $( this );
|
||||
|
||||
// Get error log.
|
||||
var $content = $( '#wp-mail-smtp-debug .error-log' );
|
||||
|
||||
// Copy to clipboard.
|
||||
if ( ! $content.is( ':visible' ) ) {
|
||||
$content.addClass( 'error-log-selection' );
|
||||
}
|
||||
var range = document.createRange();
|
||||
range.selectNode( $content[0] );
|
||||
window.getSelection().removeAllRanges();
|
||||
window.getSelection().addRange( range );
|
||||
document.execCommand( 'Copy' );
|
||||
window.getSelection().removeAllRanges();
|
||||
$content.removeClass( 'error-log-selection' );
|
||||
|
||||
$self.addClass( 'error-log-copy-copied' );
|
||||
|
||||
setTimeout(
|
||||
function() {
|
||||
$self.removeClass( 'error-log-copy-copied' );
|
||||
},
|
||||
1500
|
||||
);
|
||||
} );
|
||||
|
||||
// Remove mailer connection.
|
||||
$( '.js-wp-mail-smtp-provider-remove', app.settingsForm ).on( 'click', function() {
|
||||
return confirm( wp_mail_smtp.text_provider_remove );
|
||||
} );
|
||||
|
||||
// Copy input text to clipboard.
|
||||
$( '.wp-mail-smtp-setting-copy', app.settingsForm ).on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
var target = $( '#' + $( this ).data( 'source_id' ) ).get( 0 );
|
||||
|
||||
target.select();
|
||||
document.execCommand( 'Copy' );
|
||||
|
||||
var $buttonIcon = $( this ).find( '.dashicons' );
|
||||
|
||||
$buttonIcon
|
||||
.removeClass( 'dashicons-admin-page' )
|
||||
.addClass( 'wp-mail-smtp-dashicons-yes-alt-green wp-mail-smtp-success wp-mail-smtp-animate' );
|
||||
|
||||
setTimeout(
|
||||
function() {
|
||||
$buttonIcon
|
||||
.removeClass( 'wp-mail-smtp-dashicons-yes-alt-green wp-mail-smtp-success wp-mail-smtp-animate' )
|
||||
.addClass( 'dashicons-admin-page' );
|
||||
},
|
||||
1000
|
||||
);
|
||||
} );
|
||||
|
||||
// Notice bar: click on the dissmiss button.
|
||||
$( '#wp-mail-smtp-notice-bar' ).on( 'click', '.dismiss', function() {
|
||||
var $notice = $( this ).closest( '#wp-mail-smtp-notice-bar' );
|
||||
|
||||
$notice.addClass( 'out' );
|
||||
setTimeout(
|
||||
function() {
|
||||
$notice.remove();
|
||||
},
|
||||
300
|
||||
);
|
||||
|
||||
$.post(
|
||||
ajaxurl,
|
||||
{
|
||||
action: 'wp_mail_smtp_notice_bar_dismiss',
|
||||
nonce: wp_mail_smtp.nonce,
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
app.triggerExitNotice();
|
||||
app.beforeSaveChecks();
|
||||
|
||||
// Register change event to show/hide plugin supported settings for currently selected mailer.
|
||||
$( '.js-wp-mail-smtp-setting-mailer-radio-input', app.settingsForm ).on( 'change', this.processMailerSettingsOnChange );
|
||||
|
||||
// Disable multiple click on the Email Test tab submit button and display a loader icon.
|
||||
$( '.wp-mail-smtp-tab-tools-test #email-test-form' ).on( 'submit', function() {
|
||||
var $button = $( this ).find( '.wp-mail-smtp-btn' );
|
||||
|
||||
$button.attr( 'disabled', true );
|
||||
$button.find( 'span' ).hide();
|
||||
$button.find( '.wp-mail-smtp-loading' ).show();
|
||||
} );
|
||||
},
|
||||
|
||||
education: {
|
||||
upgradeMailer: function( $input ) {
|
||||
|
||||
var mailerName = $input.data( 'title' ).trim();
|
||||
|
||||
$.alert( {
|
||||
backgroundDismiss: true,
|
||||
escapeKey: true,
|
||||
animationBounce: 1,
|
||||
type: 'blue',
|
||||
closeIcon: true,
|
||||
title: wp_mail_smtp.education.upgrade_title.replace( /%name%/g, mailerName ),
|
||||
icon: '"></i>' + wp_mail_smtp.education.upgrade_icon_lock + '<i class="',
|
||||
content: wp_mail_smtp.education.upgrade_content.replace( /%name%/g, mailerName ),
|
||||
boxWidth: '550px',
|
||||
onOpenBefore: function() {
|
||||
this.$btnc.after( '<div class="discount-note">' + wp_mail_smtp.education.upgrade_bonus + wp_mail_smtp.education.upgrade_doc + '</div>' );
|
||||
this.$body.addClass( 'wp-mail-smtp-upgrade-mailer-education-modal' );
|
||||
},
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp.education.upgrade_button,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ],
|
||||
action: function() {
|
||||
var appendChar = /(\?)/.test( wp_mail_smtp.education.upgrade_url ) ? '&' : '?',
|
||||
upgradeURL = wp_mail_smtp.education.upgrade_url + appendChar + 'utm_content=' + encodeURIComponent( $input.val() );
|
||||
|
||||
window.open( upgradeURL, '_blank' );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Individual mailers specific js code.
|
||||
*
|
||||
* @since 1.6.0
|
||||
*/
|
||||
mailers: {
|
||||
smtp: {
|
||||
bindActions: function() {
|
||||
|
||||
// Hide SMTP-specific user/pass when Auth disabled.
|
||||
$( '#wp-mail-smtp-setting-smtp-auth' ).on( 'change', function() {
|
||||
$( '#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass' ).toggleClass( 'inactive' );
|
||||
} );
|
||||
|
||||
// Port default values based on encryption type.
|
||||
$( '#wp-mail-smtp-setting-row-smtp-encryption input' ).on( 'change', function() {
|
||||
|
||||
var $input = $( this ),
|
||||
$smtpPort = $( '#wp-mail-smtp-setting-smtp-port', app.settingsForm );
|
||||
|
||||
if ( 'tls' === $input.val() ) {
|
||||
$smtpPort.val( '587' );
|
||||
$( '#wp-mail-smtp-setting-row-smtp-autotls' ).addClass( 'inactive' );
|
||||
} else if ( 'ssl' === $input.val() ) {
|
||||
$smtpPort.val( '465' );
|
||||
$( '#wp-mail-smtp-setting-row-smtp-autotls' ).removeClass( 'inactive' );
|
||||
} else {
|
||||
$smtpPort.val( '25' );
|
||||
$( '#wp-mail-smtp-setting-row-smtp-autotls' ).removeClass( 'inactive' );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Exit notice JS code when plugin settings are not saved.
|
||||
*
|
||||
* @since 1.9.0
|
||||
*/
|
||||
triggerExitNotice: function() {
|
||||
|
||||
var $settingPages = $( '.wp-mail-smtp-page-general' );
|
||||
|
||||
// Display an exit notice, if settings are not saved.
|
||||
$( window ).on( 'beforeunload', function() {
|
||||
if ( app.pluginSettingsChanged ) {
|
||||
return wp_mail_smtp.text_settings_not_saved;
|
||||
}
|
||||
} );
|
||||
|
||||
// Set settings changed attribute, if any input was changed.
|
||||
$( ':input:not( #wp-mail-smtp-setting-license-key, .wp-mail-smtp-not-form-input )', $settingPages ).on( 'change', function() {
|
||||
app.pluginSettingsChanged = true;
|
||||
} );
|
||||
|
||||
// Clear the settings changed attribute, if the settings are about to be saved.
|
||||
$( 'form', $settingPages ).on( 'submit', function() {
|
||||
app.pluginSettingsChanged = false;
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Perform any checks before the settings are saved.
|
||||
*
|
||||
* Checks:
|
||||
* - warn users if they try to save the settings with the default (PHP) mailer selected.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
beforeSaveChecks: function() {
|
||||
|
||||
app.settingsForm.on( 'submit', function() {
|
||||
if ( $( '.wp-mail-smtp-mailer input:checked', app.settingsForm ).val() === 'mail' ) {
|
||||
var $thisForm = $( this );
|
||||
|
||||
$.alert( {
|
||||
backgroundDismiss: false,
|
||||
escapeKey: false,
|
||||
animationBounce: 1,
|
||||
type: 'orange',
|
||||
icon: '"></i><img src="' + wp_mail_smtp.plugin_url + '/assets/images/font-awesome/exclamation-circle-solid-orange.svg" style="width: 40px; height: 40px;" alt="' + wp_mail_smtp.default_mailer_notice.icon_alt + '"><i class="',
|
||||
title: wp_mail_smtp.default_mailer_notice.title,
|
||||
content: wp_mail_smtp.default_mailer_notice.content,
|
||||
boxWidth: '550px',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp.default_mailer_notice.save_button,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ],
|
||||
action: function() {
|
||||
$thisForm.off( 'submit' ).trigger( 'submit' );
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: wp_mail_smtp.default_mailer_notice.cancel_button,
|
||||
btnClass: 'btn-cancel',
|
||||
},
|
||||
}
|
||||
} );
|
||||
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* On change callback for showing/hiding plugin supported settings for currently selected mailer.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
processMailerSettingsOnChange: function() {
|
||||
|
||||
var mailerSupportedSettings = wp_mail_smtp.all_mailers_supports[ $( this ).val() ];
|
||||
|
||||
for ( var setting in mailerSupportedSettings ) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if ( mailerSupportedSettings.hasOwnProperty( setting ) ) {
|
||||
$( '.js-wp-mail-smtp-setting-' + setting, app.settingsForm ).toggle( mailerSupportedSettings[ setting ] );
|
||||
}
|
||||
}
|
||||
|
||||
// Special case: "from email" (group settings).
|
||||
var $mainSettingInGroup = $( '.js-wp-mail-smtp-setting-from_email' );
|
||||
|
||||
$mainSettingInGroup.closest( '.wp-mail-smtp-setting-row' ).toggle(
|
||||
mailerSupportedSettings['from_email'] || mailerSupportedSettings['from_email_force']
|
||||
);
|
||||
$mainSettingInGroup.siblings( '.wp-mail-smtp-setting-mid-row-sep' ).toggle(
|
||||
mailerSupportedSettings['from_email'] && mailerSupportedSettings['from_email_force']
|
||||
);
|
||||
|
||||
// Special case: "from name" (group settings).
|
||||
$mainSettingInGroup = $( '.js-wp-mail-smtp-setting-from_name' );
|
||||
|
||||
$mainSettingInGroup.closest( '.wp-mail-smtp-setting-row' ).toggle(
|
||||
mailerSupportedSettings['from_name'] || mailerSupportedSettings['from_name_force']
|
||||
);
|
||||
$mainSettingInGroup.siblings( '.wp-mail-smtp-setting-mid-row-sep' ).toggle(
|
||||
mailerSupportedSettings['from_name'] && mailerSupportedSettings['from_name_force']
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set jQuery-Confirm default options.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
setJQueryConfirmDefaults: function() {
|
||||
|
||||
jconfirm.defaults = {
|
||||
typeAnimated: false,
|
||||
draggable: false,
|
||||
animateFromElement: false,
|
||||
theme: 'modern',
|
||||
boxWidth: '400px',
|
||||
useBootstrap: false
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Flyout Menu (quick links).
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
initFlyoutMenu: function() {
|
||||
|
||||
// Flyout Menu Elements.
|
||||
var $flyoutMenu = $( '#wp-mail-smtp-flyout' );
|
||||
|
||||
if ( $flyoutMenu.length === 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $head = $flyoutMenu.find( '.wp-mail-smtp-flyout-head' );
|
||||
|
||||
// Click on the menu head icon.
|
||||
$head.on( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
$flyoutMenu.toggleClass( 'opened' );
|
||||
} );
|
||||
|
||||
// Page elements and other values.
|
||||
var $wpfooter = $( '#wpfooter' );
|
||||
|
||||
if ( $wpfooter.length === 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $overlap = $(
|
||||
'.wp-mail-smtp-page-logs-archive, ' +
|
||||
'.wp-mail-smtp-tab-tools-action-scheduler, ' +
|
||||
'.wp-mail-smtp-page-reports, ' +
|
||||
'.wp-mail-smtp-tab-tools-debug-events, ' +
|
||||
'.wp-mail-smtp-tab-connections'
|
||||
);
|
||||
|
||||
// Hide menu if scrolled down to the bottom of the page or overlap some critical controls.
|
||||
$( window ).on( 'resize scroll', _.debounce( function() {
|
||||
|
||||
var wpfooterTop = $wpfooter.offset().top,
|
||||
wpfooterBottom = wpfooterTop + $wpfooter.height(),
|
||||
overlapBottom = $overlap.length > 0 ? $overlap.offset().top + $overlap.height() + 85 : 0,
|
||||
viewTop = $( window ).scrollTop(),
|
||||
viewBottom = viewTop + $( window ).height();
|
||||
|
||||
if ( wpfooterBottom <= viewBottom && wpfooterTop >= viewTop && overlapBottom > viewBottom ) {
|
||||
$flyoutMenu.addClass( 'out' );
|
||||
} else {
|
||||
$flyoutMenu.removeClass( 'out' );
|
||||
}
|
||||
}, 50 ) );
|
||||
|
||||
$( window ).trigger( 'scroll' );
|
||||
}
|
||||
};
|
||||
|
||||
// Provide access to public functions/properties.
|
||||
return app;
|
||||
}( document, window, jQuery ) );
|
||||
|
||||
// Initialize.
|
||||
WPMailSMTP.Admin.Settings.init();
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var WPMailSMTP=window.WPMailSMTP||{};WPMailSMTP.Admin=WPMailSMTP.Admin||{},WPMailSMTP.Admin.Settings=WPMailSMTP.Admin.Settings||function(s,l,p){var a={pluginSettingsChanged:!1,init:function(){p(a.ready)},ready:function(){a.pageHolder=p(".wp-mail-smtp-tab-settings"),a.settingsForm=p(".wp-mail-smtp-connection-settings-form"),p("#screen-meta-links, #screen-meta").prependTo("#wp-mail-smtp-header-temp").show(),a.bindActions(),a.setJQueryConfirmDefaults(),a.initFlyoutMenu()},bindActions:function(){p(".wp-mail-smtp-mailer-image",a.settingsForm).on("click",function(){p(this).parents(".wp-mail-smtp-mailer").find("input").trigger("click")}),p(".wp-mail-smtp-mailer input",a.settingsForm).on("click",function(){var t=p(this);if(t.prop("disabled"))return t.hasClass("educate")&&a.education.upgradeMailer(t),!1;p(".wp-mail-smtp-mailer",a.settingsForm).removeClass("active"),p(this).parents(".wp-mail-smtp-mailer").addClass("active"),p(".wp-mail-smtp-mailer-option",a.settingsForm).addClass("hidden").removeClass("active"),p(".wp-mail-smtp-mailer-option-"+p(this).val(),a.settingsForm).addClass("active").removeClass("hidden")}),a.mailers.smtp.bindActions(),p("#wp-mail-smtp-pro-banner-dismiss",a.pageHolder).on("click",function(){p.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",task:"pro_banner_dismiss",nonce:wp_mail_smtp.nonce}}).always(function(){p("#wp-mail-smtp-pro-banner",a.pageHolder).fadeOut("fast")})}),p(".js-wp-mail-smtp-mailer-notice-dismiss",a.settingsForm).on("click",function(t){t.preventDefault();var e=p(this),i=e.parents(".inline-notice");if(e.hasClass("disabled"))return!1;p.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"wp_mail_smtp_ajax",nonce:wp_mail_smtp.nonce,task:"notice_dismiss",notice:i.data("notice"),mailer:i.data("mailer")},beforeSend:function(){e.addClass("disabled")}}).always(function(){i.fadeOut("fast",function(){e.removeClass("disabled")})})}),p("#wp-mail-smtp-debug .error-log-toggle").on("click",function(t){t.preventDefault(),p("#wp-mail-smtp-debug .error-log").slideToggle()}),p("#wp-mail-smtp-debug .error-log-copy").on("click",function(t){t.preventDefault();var e=p(this),i=p("#wp-mail-smtp-debug .error-log");i.is(":visible")||i.addClass("error-log-selection");t=s.createRange();t.selectNode(i[0]),l.getSelection().removeAllRanges(),l.getSelection().addRange(t),s.execCommand("Copy"),l.getSelection().removeAllRanges(),i.removeClass("error-log-selection"),e.addClass("error-log-copy-copied"),setTimeout(function(){e.removeClass("error-log-copy-copied")},1500)}),p(".js-wp-mail-smtp-provider-remove",a.settingsForm).on("click",function(){return confirm(wp_mail_smtp.text_provider_remove)}),p(".wp-mail-smtp-setting-copy",a.settingsForm).on("click",function(t){t.preventDefault(),p("#"+p(this).data("source_id")).get(0).select(),s.execCommand("Copy");var e=p(this).find(".dashicons");e.removeClass("dashicons-admin-page").addClass("wp-mail-smtp-dashicons-yes-alt-green wp-mail-smtp-success wp-mail-smtp-animate"),setTimeout(function(){e.removeClass("wp-mail-smtp-dashicons-yes-alt-green wp-mail-smtp-success wp-mail-smtp-animate").addClass("dashicons-admin-page")},1e3)}),p("#wp-mail-smtp-notice-bar").on("click",".dismiss",function(){var t=p(this).closest("#wp-mail-smtp-notice-bar");t.addClass("out"),setTimeout(function(){t.remove()},300),p.post(ajaxurl,{action:"wp_mail_smtp_notice_bar_dismiss",nonce:wp_mail_smtp.nonce})}),a.triggerExitNotice(),a.beforeSaveChecks(),p(".js-wp-mail-smtp-setting-mailer-radio-input",a.settingsForm).on("change",this.processMailerSettingsOnChange),p(".wp-mail-smtp-tab-tools-test #email-test-form").on("submit",function(){var t=p(this).find(".wp-mail-smtp-btn");t.attr("disabled",!0),t.find("span").hide(),t.find(".wp-mail-smtp-loading").show()})},education:{upgradeMailer:function(e){var t=e.data("title").trim();p.alert({backgroundDismiss:!0,escapeKey:!0,animationBounce:1,type:"blue",closeIcon:!0,title:wp_mail_smtp.education.upgrade_title.replace(/%name%/g,t),icon:'"></i>'+wp_mail_smtp.education.upgrade_icon_lock+'<i class="',content:wp_mail_smtp.education.upgrade_content.replace(/%name%/g,t),boxWidth:"550px",onOpenBefore:function(){this.$btnc.after('<div class="discount-note">'+wp_mail_smtp.education.upgrade_bonus+wp_mail_smtp.education.upgrade_doc+"</div>"),this.$body.addClass("wp-mail-smtp-upgrade-mailer-education-modal")},buttons:{confirm:{text:wp_mail_smtp.education.upgrade_button,btnClass:"btn-confirm",keys:["enter"],action:function(){var t=/(\?)/.test(wp_mail_smtp.education.upgrade_url)?"&":"?",t=wp_mail_smtp.education.upgrade_url+t+"utm_content="+encodeURIComponent(e.val());l.open(t,"_blank")}}}})}},mailers:{smtp:{bindActions:function(){p("#wp-mail-smtp-setting-smtp-auth").on("change",function(){p("#wp-mail-smtp-setting-row-smtp-user, #wp-mail-smtp-setting-row-smtp-pass").toggleClass("inactive")}),p("#wp-mail-smtp-setting-row-smtp-encryption input").on("change",function(){var t=p(this),e=p("#wp-mail-smtp-setting-smtp-port",a.settingsFLine truncated
|
||||
@@ -0,0 +1,302 @@
|
||||
/* global wp_mail_smtp_dashboard_widget, ajaxurl, moment, WPMailSMTPChart */
|
||||
/**
|
||||
* WP Mail SMTP Dashboard Widget function.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var WPMailSMTPDashboardWidget = window.WPMailSMTPDashboardWidget || ( function( document, window, $ ) {
|
||||
|
||||
/**
|
||||
* Elements reference.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var el = {
|
||||
$canvas : $( '#wp-mail-smtp-dash-widget-chart' ),
|
||||
$settingsBtn : $( '#wp-mail-smtp-dash-widget-settings-button' ),
|
||||
$dismissBtn : $( '.wp-mail-smtp-dash-widget-dismiss-chart-upgrade' ),
|
||||
$summaryReportEmailBlock : $( '.wp-mail-smtp-dash-widget-summary-report-email-block' ),
|
||||
$summaryReportEmailDismissBtn : $( '.wp-mail-smtp-dash-widget-summary-report-email-dismiss' ),
|
||||
$summaryReportEmailEnableInput : $( '#wp-mail-smtp-dash-widget-summary-report-email-enable' ),
|
||||
};
|
||||
|
||||
/**
|
||||
* Chart.js functions and properties.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var chart = {
|
||||
|
||||
/**
|
||||
* Chart.js instance.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
instance: null,
|
||||
|
||||
/**
|
||||
* Chart.js settings.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
settings: {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [
|
||||
{
|
||||
label: '',
|
||||
data: [],
|
||||
backgroundColor: 'rgba(34, 113, 177, 0.15)',
|
||||
borderColor: 'rgba(34, 113, 177, 1)',
|
||||
borderWidth: 2,
|
||||
pointRadius: 4,
|
||||
pointBorderWidth: 1,
|
||||
pointBackgroundColor: 'rgba(255, 255, 255, 1)',
|
||||
}
|
||||
],
|
||||
},
|
||||
options: {
|
||||
maintainAspectRatio: false,
|
||||
scales: {
|
||||
xAxes: [ {
|
||||
type: 'time',
|
||||
time: {
|
||||
unit: 'day',
|
||||
tooltipFormat: 'MMM D',
|
||||
},
|
||||
distribution: 'series',
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
source: 'labels',
|
||||
padding: 10,
|
||||
minRotation: 25,
|
||||
maxRotation: 25,
|
||||
callback: function( value, index, values ) {
|
||||
|
||||
// Distribute the ticks equally starting from a right side of xAxis.
|
||||
var gap = Math.floor( values.length / 7 );
|
||||
|
||||
if ( gap < 1 ) {
|
||||
return value;
|
||||
}
|
||||
if ( ( values.length - index - 1 ) % gap === 0 ) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
},
|
||||
} ],
|
||||
yAxes: [ {
|
||||
ticks: {
|
||||
beginAtZero: true,
|
||||
maxTicksLimit: 6,
|
||||
padding: 20,
|
||||
callback: function( value ) {
|
||||
|
||||
// Make sure the tick value has no decimals.
|
||||
if ( Math.floor( value ) === value ) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
},
|
||||
} ],
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0,
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
duration: 0,
|
||||
},
|
||||
hover: {
|
||||
animationDuration: 0,
|
||||
},
|
||||
legend: {
|
||||
display: false,
|
||||
},
|
||||
tooltips: {
|
||||
displayColors: false,
|
||||
},
|
||||
responsiveAnimationDuration: 0,
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Init Chart.js.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
init: function() {
|
||||
|
||||
var ctx;
|
||||
|
||||
if ( ! el.$canvas.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
ctx = el.$canvas[ 0 ].getContext( '2d' );
|
||||
|
||||
chart.instance = new WPMailSMTPChart( ctx, chart.settings );
|
||||
|
||||
chart.updateWithDummyData();
|
||||
|
||||
chart.instance.update();
|
||||
},
|
||||
|
||||
/**
|
||||
* Update Chart.js settings with dummy data.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
updateWithDummyData: function() {
|
||||
|
||||
var end = moment().startOf( 'day' ),
|
||||
days = 7,
|
||||
data = [ 55, 45, 34, 45, 32, 55, 65 ],
|
||||
date,
|
||||
i;
|
||||
|
||||
for ( i = 1; i <= days; i++ ) {
|
||||
|
||||
date = end.clone().subtract( i, 'days' );
|
||||
|
||||
chart.settings.data.labels.push( date );
|
||||
chart.settings.data.datasets[ 0 ].data.push( {
|
||||
t: date,
|
||||
y: data[ i - 1 ],
|
||||
} );
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Public functions and properties.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var app = {
|
||||
|
||||
/**
|
||||
* Publicly accessible Chart.js functions and properties.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
chart: chart,
|
||||
|
||||
/**
|
||||
* Start the engine.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
init: function() {
|
||||
$( app.ready );
|
||||
},
|
||||
|
||||
/**
|
||||
* Document ready.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
ready: function() {
|
||||
|
||||
el.$settingsBtn.on( 'click', function() {
|
||||
$( this ).siblings( '.wp-mail-smtp-dash-widget-settings-menu' ).toggle();
|
||||
} );
|
||||
|
||||
el.$dismissBtn.on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
app.saveWidgetMeta( 'hide_graph', 1 );
|
||||
$( this ).closest( '.wp-mail-smtp-dash-widget-chart-block-container' ).remove();
|
||||
$( '#wp-mail-smtp-dash-widget-upgrade-footer' ).show();
|
||||
} );
|
||||
|
||||
// Hide summary report email block on dismiss icon click.
|
||||
el.$summaryReportEmailDismissBtn.on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
app.saveWidgetMeta( 'hide_summary_report_email_block', 1 );
|
||||
el.$summaryReportEmailBlock.slideUp();
|
||||
} );
|
||||
|
||||
// Enable summary report email on checkbox enable.
|
||||
el.$summaryReportEmailEnableInput.on( 'change', function( event ) {
|
||||
event.preventDefault();
|
||||
|
||||
var $self = $( this ),
|
||||
$loader = $self.next( 'i' );
|
||||
|
||||
$self.hide();
|
||||
$loader.show();
|
||||
|
||||
var data = {
|
||||
_wpnonce: wp_mail_smtp_dashboard_widget.nonce,
|
||||
action : 'wp_mail_smtp_' + wp_mail_smtp_dashboard_widget.slug + '_enable_summary_report_email'
|
||||
};
|
||||
|
||||
$.post( ajaxurl, data )
|
||||
.done( function() {
|
||||
el.$summaryReportEmailBlock.find( '.wp-mail-smtp-dash-widget-summary-report-email-block-setting' )
|
||||
.addClass( 'hidden' );
|
||||
el.$summaryReportEmailBlock.find( '.wp-mail-smtp-dash-widget-summary-report-email-block-applied' )
|
||||
.removeClass( 'hidden' );
|
||||
} )
|
||||
.fail( function() {
|
||||
$self.show();
|
||||
$loader.hide();
|
||||
} );
|
||||
} );
|
||||
|
||||
chart.init();
|
||||
app.removeOverlay( el.$canvas );
|
||||
},
|
||||
|
||||
/**
|
||||
* Save dashboard widget meta in backend.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param {string} meta Meta name to save.
|
||||
* @param {number} value Value to save.
|
||||
*/
|
||||
saveWidgetMeta: function( meta, value ) {
|
||||
|
||||
var data = {
|
||||
_wpnonce: wp_mail_smtp_dashboard_widget.nonce,
|
||||
action : 'wp_mail_smtp_' + wp_mail_smtp_dashboard_widget.slug + '_save_widget_meta',
|
||||
meta : meta,
|
||||
value : value,
|
||||
};
|
||||
|
||||
$.post( ajaxurl, data );
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove an overlay from a widget block containing $el.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param {object} $el jQuery element inside a widget block.
|
||||
*/
|
||||
removeOverlay: function( $el ) {
|
||||
$el.siblings( '.wp-mail-smtp-dash-widget-overlay' ).remove();
|
||||
},
|
||||
};
|
||||
|
||||
// Provide access to public functions/properties.
|
||||
return app;
|
||||
|
||||
}( document, window, jQuery ) );
|
||||
|
||||
// Initialize.
|
||||
WPMailSMTPDashboardWidget.init();
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var WPMailSMTPDashboardWidget=window.WPMailSMTPDashboardWidget||function(e){var s={$canvas:e("#wp-mail-smtp-dash-widget-chart"),$settingsBtn:e("#wp-mail-smtp-dash-widget-settings-button"),$dismissBtn:e(".wp-mail-smtp-dash-widget-dismiss-chart-upgrade"),$summaryReportEmailBlock:e(".wp-mail-smtp-dash-widget-summary-report-email-block"),$summaryReportEmailDismissBtn:e(".wp-mail-smtp-dash-widget-summary-report-email-dismiss"),$summaryReportEmailEnableInput:e("#wp-mail-smtp-dash-widget-summary-report-email-enable")},n={instance:null,settings:{type:"line",data:{labels:[],datasets:[{label:"",data:[],backgroundColor:"rgba(34, 113, 177, 0.15)",borderColor:"rgba(34, 113, 177, 1)",borderWidth:2,pointRadius:4,pointBorderWidth:1,pointBackgroundColor:"rgba(255, 255, 255, 1)"}]},options:{maintainAspectRatio:!1,scales:{xAxes:[{type:"time",time:{unit:"day",tooltipFormat:"MMM D"},distribution:"series",ticks:{beginAtZero:!0,source:"labels",padding:10,minRotation:25,maxRotation:25,callback:function(t,a,i){var e=Math.floor(i.length/7);return e<1||(i.length-a-1)%e==0?t:void 0}}}],yAxes:[{ticks:{beginAtZero:!0,maxTicksLimit:6,padding:20,callback:function(t){if(Math.floor(t)===t)return t}}}]},elements:{line:{tension:0}},animation:{duration:0},hover:{animationDuration:0},legend:{display:!1},tooltips:{displayColors:!1},responsiveAnimationDuration:0}},init:function(){var t;s.$canvas.length&&(t=s.$canvas[0].getContext("2d"),n.instance=new WPMailSMTPChart(t,n.settings),n.updateWithDummyData(),n.instance.update())},updateWithDummyData:function(){for(var t,a=moment().startOf("day"),i=[55,45,34,45,32,55,65],e=1;e<=7;e++)t=a.clone().subtract(e,"days"),n.settings.data.labels.push(t),n.settings.data.datasets[0].data.push({t:t,y:i[e-1]})}},a={chart:n,init:function(){e(a.ready)},ready:function(){s.$settingsBtn.on("click",function(){e(this).siblings(".wp-mail-smtp-dash-widget-settings-menu").toggle()}),s.$dismissBtn.on("click",function(t){t.preventDefault(),a.saveWidgetMeta("hide_graph",1),e(this).closest(".wp-mail-smtp-dash-widget-chart-block-container").remove(),e("#wp-mail-smtp-dash-widget-upgrade-footer").show()}),s.$summaryReportEmailDismissBtn.on("click",function(t){t.preventDefault(),a.saveWidgetMeta("hide_summary_report_email_block",1),s.$summaryReportEmailBlock.slideUp()}),s.$summaryReportEmailEnableInput.on("change",function(t){t.preventDefault();var a=e(this),i=a.next("i");a.hide(),i.show();t={_wpnonce:wp_mail_smtp_dashboard_widget.nonce,action:"wp_mail_smtp_"+wp_mail_smtp_dashboard_widget.slug+"_enable_summary_report_email"};e.post(ajaxurl,t).done(function(){s.$summaryReportEmailBlock.find(".wp-mail-smtp-dash-widget-summary-report-email-block-setting").addClass("hidden"),s.$summaryReportEmailBlock.find(".wp-mail-smtp-dash-widget-summary-report-email-block-applied").removeClass("hidden")}).fail(function(){a.show(),i.hide()})}),n.init(),a.removeOverlay(s.$canvas)},saveWidgetMeta:function(t,a){a={_wpnonce:wp_mail_smtp_dashboard_widget.nonce,action:"wp_mail_smtp_"+wp_mail_smtp_dashboard_widget.slug+"_save_widget_meta",meta:t,value:a};e.post(ajaxurl,a)},removeOverlay:function(t){t.siblings(".wp-mail-smtp-dash-widget-overlay").remove()}};return a}((document,window,jQuery));WPMailSMTPDashboardWidget.init();
|
||||
@@ -0,0 +1,185 @@
|
||||
/* global wp_mail_smtp, ajaxurl */
|
||||
|
||||
/**
|
||||
* WP Mail SMTP Admin Notifications.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var WPMailSMTPAdminNotifications = window.WPMailSMTPAdminNotifications || ( function( document, window, $ ) {
|
||||
|
||||
/**
|
||||
* Elements holder.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var el = {
|
||||
$notifications: $( '#wp-mail-smtp-notifications' ),
|
||||
$nextButton: $( '#wp-mail-smtp-notifications .navigation .next' ),
|
||||
$prevButton: $( '#wp-mail-smtp-notifications .navigation .prev' ),
|
||||
$adminBarCounter: $( '#wp-admin-bar-wp-mail-smtp-menu .wp-mail-smtp-admin-bar-menu-notification-counter' ),
|
||||
};
|
||||
|
||||
/**
|
||||
* Public functions and properties.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var app = {
|
||||
|
||||
/**
|
||||
* Start the engine.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
init: function() {
|
||||
|
||||
$( app.ready );
|
||||
},
|
||||
|
||||
/**
|
||||
* Document ready.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
ready: function() {
|
||||
|
||||
app.updateNavigation();
|
||||
app.events();
|
||||
},
|
||||
|
||||
/**
|
||||
* Register JS events.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
events: function() {
|
||||
|
||||
el.$notifications
|
||||
.on( 'click', '.dismiss', app.dismiss )
|
||||
.on( 'click', '.next', app.navNext )
|
||||
.on( 'click', '.prev', app.navPrev );
|
||||
},
|
||||
|
||||
/**
|
||||
* Click on the Dismiss notification button.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param {object} event Event object.
|
||||
*/
|
||||
dismiss: function( event ) {
|
||||
|
||||
if ( el.$currentMessage.length === 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AJAX call - update option.
|
||||
var data = {
|
||||
action: 'wp_mail_smtp_notification_dismiss',
|
||||
nonce: wp_mail_smtp.nonce,
|
||||
id: el.$currentMessage.data( 'message-id' ),
|
||||
};
|
||||
|
||||
$.post( ajaxurl, data, function( response ) {
|
||||
if ( ! response.success ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update counter.
|
||||
var count = parseInt( el.$adminBarCounter.text(), 10 );
|
||||
if ( count > 1 ) {
|
||||
--count;
|
||||
el.$adminBarCounter.html( '<span>' + count + '</span>' );
|
||||
} else {
|
||||
el.$adminBarCounter.remove();
|
||||
}
|
||||
|
||||
// Remove notification.
|
||||
var $nextMessage = el.$nextMessage.length < 1 ? el.$prevMessage : el.$nextMessage;
|
||||
|
||||
if ( $nextMessage.length === 0 ) {
|
||||
el.$notifications.remove();
|
||||
} else {
|
||||
el.$currentMessage.remove();
|
||||
$nextMessage.addClass( 'current' );
|
||||
app.updateNavigation();
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Click on the Next notification button.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param {object} event Event object.
|
||||
*/
|
||||
navNext: function( event ) {
|
||||
|
||||
if ( el.$nextButton.hasClass( 'disabled' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
el.$currentMessage.removeClass( 'current' );
|
||||
el.$nextMessage.addClass( 'current' );
|
||||
|
||||
app.updateNavigation();
|
||||
},
|
||||
|
||||
/**
|
||||
* Click on the Previous notification button.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param {object} event Event object.
|
||||
*/
|
||||
navPrev: function( event ) {
|
||||
|
||||
if ( el.$prevButton.hasClass( 'disabled' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
el.$currentMessage.removeClass( 'current' );
|
||||
el.$prevMessage.addClass( 'current' );
|
||||
|
||||
app.updateNavigation();
|
||||
},
|
||||
|
||||
/**
|
||||
* Update navigation buttons.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
updateNavigation: function() {
|
||||
|
||||
el.$currentMessage = el.$notifications.find( '.wp-mail-smtp-notifications-message.current' );
|
||||
el.$nextMessage = el.$currentMessage.next( '.wp-mail-smtp-notifications-message' );
|
||||
el.$prevMessage = el.$currentMessage.prev( '.wp-mail-smtp-notifications-message' );
|
||||
|
||||
if ( el.$nextMessage.length === 0 ) {
|
||||
el.$nextButton.addClass( 'disabled' );
|
||||
} else {
|
||||
el.$nextButton.removeClass( 'disabled' );
|
||||
}
|
||||
|
||||
if ( el.$prevMessage.length === 0 ) {
|
||||
el.$prevButton.addClass( 'disabled' );
|
||||
} else {
|
||||
el.$prevButton.removeClass( 'disabled' );
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return app;
|
||||
|
||||
}( document, window, jQuery ) );
|
||||
|
||||
// Initialize.
|
||||
WPMailSMTPAdminNotifications.init();
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var WPMailSMTPAdminNotifications=window.WPMailSMTPAdminNotifications||function(t){var a={$notifications:t("#wp-mail-smtp-notifications"),$nextButton:t("#wp-mail-smtp-notifications .navigation .next"),$prevButton:t("#wp-mail-smtp-notifications .navigation .prev"),$adminBarCounter:t("#wp-admin-bar-wp-mail-smtp-menu .wp-mail-smtp-admin-bar-menu-notification-counter")},i={init:function(){t(i.ready)},ready:function(){i.updateNavigation(),i.events()},events:function(){a.$notifications.on("click",".dismiss",i.dismiss).on("click",".next",i.navNext).on("click",".prev",i.navPrev)},dismiss:function(e){var n;0!==a.$currentMessage.length&&(n={action:"wp_mail_smtp_notification_dismiss",nonce:wp_mail_smtp.nonce,id:a.$currentMessage.data("message-id")},t.post(ajaxurl,n,function(e){e.success&&(1<(e=parseInt(a.$adminBarCounter.text(),10))?a.$adminBarCounter.html("<span>"+--e+"</span>"):a.$adminBarCounter.remove(),0===(e=a.$nextMessage.length<1?a.$prevMessage:a.$nextMessage).length?a.$notifications.remove():(a.$currentMessage.remove(),e.addClass("current"),i.updateNavigation()))}))},navNext:function(e){a.$nextButton.hasClass("disabled")||(a.$currentMessage.removeClass("current"),a.$nextMessage.addClass("current"),i.updateNavigation())},navPrev:function(e){a.$prevButton.hasClass("disabled")||(a.$currentMessage.removeClass("current"),a.$prevMessage.addClass("current"),i.updateNavigation())},updateNavigation:function(){a.$currentMessage=a.$notifications.find(".wp-mail-smtp-notifications-message.current"),a.$nextMessage=a.$currentMessage.next(".wp-mail-smtp-notifications-message"),a.$prevMessage=a.$currentMessage.prev(".wp-mail-smtp-notifications-message"),0===a.$nextMessage.length?a.$nextButton.addClass("disabled"):a.$nextButton.removeClass("disabled"),0===a.$prevMessage.length?a.$prevButton.addClass("disabled"):a.$prevButton.removeClass("disabled")}};return i}((document,window,jQuery));WPMailSMTPAdminNotifications.init();
|
||||
@@ -0,0 +1,355 @@
|
||||
/* global wp_mail_smtp_tools_debug_events, ajaxurl, flatpickr */
|
||||
/**
|
||||
* WPMailSMTP Debug Events functionality.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var WPMailSmtpDebugEvents = window.WPMailSmtpDebugEvents || ( function( document, window, $ ) {
|
||||
|
||||
/**
|
||||
* Elements.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var el = {
|
||||
$debugEventsPage: $( '.wp-mail-smtp-tab-tools-debug-events' ),
|
||||
$dateFlatpickr: $( '.wp-mail-smtp-filter-date-selector' ),
|
||||
};
|
||||
|
||||
/**
|
||||
* Public functions and properties.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {object}
|
||||
*/
|
||||
var app = {
|
||||
|
||||
/**
|
||||
* Start the engine.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
init: function() {
|
||||
|
||||
$( app.ready );
|
||||
},
|
||||
|
||||
/**
|
||||
* Document ready.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
ready: function() {
|
||||
|
||||
app.initDateRange();
|
||||
app.events();
|
||||
|
||||
// Open debug event popup from the query string.
|
||||
var searchParams = new URLSearchParams( location.search );
|
||||
|
||||
if ( searchParams.has( 'debug_event_id' ) ) {
|
||||
app.openDebugEventPopup( searchParams.get( 'debug_event_id' ) );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Register JS events.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
events: function() {
|
||||
|
||||
el.$debugEventsPage.on( 'click', '#wp-mail-smtp-reset-filter .reset', app.resetFilter );
|
||||
el.$debugEventsPage.on( 'click', '#wp-mail-smtp-delete-all-debug-events-button', app.deleteAllDebugEvents );
|
||||
el.$debugEventsPage.on( 'click', '.js-wp-mail-smtp-debug-event-preview', app.eventClicked );
|
||||
},
|
||||
|
||||
/**
|
||||
* Init Flatpickr at Date Range field.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
initDateRange: function() {
|
||||
|
||||
var langCode = wp_mail_smtp_tools_debug_events.lang_code,
|
||||
flatpickrLocale = {
|
||||
rangeSeparator: ' - ',
|
||||
};
|
||||
|
||||
if (
|
||||
flatpickr !== 'undefined' &&
|
||||
Object.prototype.hasOwnProperty.call( flatpickr, 'l10ns' ) &&
|
||||
Object.prototype.hasOwnProperty.call( flatpickr.l10ns, langCode )
|
||||
) {
|
||||
flatpickrLocale = flatpickr.l10ns[ langCode ];
|
||||
flatpickrLocale.rangeSeparator = ' - ';
|
||||
}
|
||||
|
||||
el.$dateFlatpickr.flatpickr( {
|
||||
altInput : true,
|
||||
altFormat : 'M j, Y',
|
||||
dateFormat: 'Y-m-d',
|
||||
locale : flatpickrLocale,
|
||||
mode : 'range'
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset filter handler.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
resetFilter: function() {
|
||||
|
||||
var $form = $( this ).parents( 'form' );
|
||||
|
||||
$form.find( $( this ).data( 'scope' ) ).find( 'input,select' ).each( function() {
|
||||
|
||||
var $this = $( this );
|
||||
if ( app.isIgnoredForResetInput( $this ) ) {
|
||||
return;
|
||||
}
|
||||
app.resetInput( $this );
|
||||
} );
|
||||
|
||||
// Submit the form.
|
||||
$form.submit();
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset input.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} $input Input element.
|
||||
*/
|
||||
resetInput: function( $input ) {
|
||||
|
||||
switch ( $input.prop( 'tagName' ).toLowerCase() ) {
|
||||
case 'input':
|
||||
$input.val( '' );
|
||||
break;
|
||||
case 'select':
|
||||
$input.val( $input.find( 'option' ).first().val() );
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Input is ignored for reset.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} $input Input element.
|
||||
*
|
||||
* @returns {boolean} Is ignored.
|
||||
*/
|
||||
isIgnoredForResetInput: function( $input ) {
|
||||
|
||||
return [ 'submit', 'hidden' ].indexOf( ( $input.attr( 'type' ) || '' ).toLowerCase() ) !== -1 &&
|
||||
! $input.hasClass( 'flatpickr-input' );
|
||||
},
|
||||
|
||||
/**
|
||||
* Process the click on the delete all debug events button.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} event jQuery event.
|
||||
*/
|
||||
deleteAllDebugEvents: function( event ) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var $btn = $( event.target );
|
||||
|
||||
$.confirm( {
|
||||
backgroundDismiss: false,
|
||||
escapeKey: true,
|
||||
animationBounce: 1,
|
||||
closeIcon: true,
|
||||
type: 'orange',
|
||||
icon: app.getModalIcon( 'exclamation-circle-solid-orange' ),
|
||||
title: wp_mail_smtp_tools_debug_events.texts.notice_title,
|
||||
content: wp_mail_smtp_tools_debug_events.texts.delete_all_notice,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp_tools_debug_events.texts.yes,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ],
|
||||
action: function() {
|
||||
app.executeAllDebugEventsDeletion( $btn );
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: wp_mail_smtp_tools_debug_events.texts.cancel,
|
||||
btnClass: 'btn-cancel',
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Process the click on the event item.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} event jQuery event.
|
||||
*/
|
||||
eventClicked: function( event ) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
app.openDebugEventPopup( $( this ).data( 'event-id' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Open debug event popup.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param {int} eventId Debug event ID.
|
||||
*/
|
||||
openDebugEventPopup: function( eventId ) {
|
||||
|
||||
var data = {
|
||||
action: 'wp_mail_smtp_debug_event_preview',
|
||||
id: eventId,
|
||||
nonce: $( '#wp-mail-smtp-debug-events-nonce', el.$debugEventsPage ).val()
|
||||
};
|
||||
|
||||
var popup = $.alert( {
|
||||
backgroundDismiss: true,
|
||||
escapeKey: true,
|
||||
animationBounce: 1,
|
||||
type: 'blue',
|
||||
icon: app.getModalIcon( 'info-circle-blue' ),
|
||||
title: false,
|
||||
content: wp_mail_smtp_tools_debug_events.loader,
|
||||
boxWidth: '550px',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp_tools_debug_events.texts.close,
|
||||
btnClass: 'btn-confirm',
|
||||
keys: [ 'enter' ]
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
$.post( ajaxurl, data, function( response ) {
|
||||
if ( response.success ) {
|
||||
popup.setTitle( response.data.title );
|
||||
popup.setContent( response.data.content );
|
||||
} else {
|
||||
popup.setContent( response.data );
|
||||
}
|
||||
} ).fail( function() {
|
||||
popup.setContent( wp_mail_smtp_tools_debug_events.texts.error_occurred );
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* AJAX call for deleting all debug events.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} $btn jQuery object of the clicked button.
|
||||
*/
|
||||
executeAllDebugEventsDeletion: function( $btn ) {
|
||||
|
||||
$btn.prop( 'disabled', true );
|
||||
|
||||
var data = {
|
||||
action: 'wp_mail_smtp_delete_all_debug_events',
|
||||
nonce: $( '#wp-mail-smtp-debug-events-nonce', el.$debugEventsPage ).val()
|
||||
};
|
||||
|
||||
$.post( ajaxurl, data, function( response ) {
|
||||
var message = response.data,
|
||||
icon,
|
||||
type,
|
||||
callback;
|
||||
|
||||
if ( response.success ) {
|
||||
icon = 'check-circle-solid-green';
|
||||
type = 'green';
|
||||
callback = function() {
|
||||
location.reload();
|
||||
return false;
|
||||
};
|
||||
} else {
|
||||
icon = 'exclamation-circle-regular-red';
|
||||
type = 'red';
|
||||
}
|
||||
|
||||
app.displayModal( message, icon, type, callback );
|
||||
$btn.prop( 'disabled', false );
|
||||
} ).fail( function() {
|
||||
app.displayModal( wp_mail_smtp_tools_debug_events.texts.error_occurred, 'exclamation-circle-regular-red', 'red' );
|
||||
$btn.prop( 'disabled', false );
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Display the modal with provided text and icon.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} message The message to be displayed in the modal.
|
||||
* @param {string} icon The icon name from /assets/images/font-awesome/ to be used in modal.
|
||||
* @param {string} type The type of the message (red, green, orange, blue, purple, dark).
|
||||
* @param {Function} actionCallback The action callback function.
|
||||
*/
|
||||
displayModal: function( message, icon, type, actionCallback ) {
|
||||
|
||||
type = type || 'default';
|
||||
actionCallback = actionCallback || function() {};
|
||||
|
||||
$.alert( {
|
||||
backgroundDismiss: true,
|
||||
escapeKey: true,
|
||||
animationBounce: 1,
|
||||
type: type,
|
||||
closeIcon: true,
|
||||
title: false,
|
||||
icon: icon ? app.getModalIcon( icon ) : '',
|
||||
content: message,
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: wp_mail_smtp_tools_debug_events.texts.ok,
|
||||
btnClass: 'wp-mail-smtp-btn wp-mail-smtp-btn-md',
|
||||
keys: [ 'enter' ],
|
||||
action: actionCallback
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns prepared modal icon.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} icon The icon name from /assets/images/font-awesome/ to be used in modal.
|
||||
*
|
||||
* @returns {string} Modal icon HTML.
|
||||
*/
|
||||
getModalIcon: function( icon ) {
|
||||
|
||||
return '"></i><img src="' + wp_mail_smtp_tools_debug_events.plugin_url + '/assets/images/font-awesome/' + icon + '.svg" style="width: 40px; height: 40px;" alt=""><i class="';
|
||||
},
|
||||
};
|
||||
|
||||
// Provide access to public functions/properties.
|
||||
return app;
|
||||
|
||||
}( document, window, jQuery ) );
|
||||
|
||||
// Initialize.
|
||||
WPMailSmtpDebugEvents.init();
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";var WPMailSmtpDebugEvents=window.WPMailSmtpDebugEvents||function(s){var n={$debugEventsPage:s(".wp-mail-smtp-tab-tools-debug-events"),$dateFlatpickr:s(".wp-mail-smtp-filter-date-selector")},i={init:function(){s(i.ready)},ready:function(){i.initDateRange(),i.events();var e=new URLSearchParams(location.search);e.has("debug_event_id")&&i.openDebugEventPopup(e.get("debug_event_id"))},events:function(){n.$debugEventsPage.on("click","#wp-mail-smtp-reset-filter .reset",i.resetFilter),n.$debugEventsPage.on("click","#wp-mail-smtp-delete-all-debug-events-button",i.deleteAllDebugEvents),n.$debugEventsPage.on("click",".js-wp-mail-smtp-debug-event-preview",i.eventClicked)},initDateRange:function(){var e=wp_mail_smtp_tools_debug_events.lang_code,t={rangeSeparator:" - "};"undefined"!==flatpickr&&Object.prototype.hasOwnProperty.call(flatpickr,"l10ns")&&Object.prototype.hasOwnProperty.call(flatpickr.l10ns,e)&&((t=flatpickr.l10ns[e]).rangeSeparator=" - "),n.$dateFlatpickr.flatpickr({altInput:!0,altFormat:"M j, Y",dateFormat:"Y-m-d",locale:t,mode:"range"})},resetFilter:function(){var e=s(this).parents("form");e.find(s(this).data("scope")).find("input,select").each(function(){var e=s(this);i.isIgnoredForResetInput(e)||i.resetInput(e)}),e.submit()},resetInput:function(e){switch(e.prop("tagName").toLowerCase()){case"input":e.val("");break;case"select":e.val(e.find("option").first().val())}},isIgnoredForResetInput:function(e){return-1!==["submit","hidden"].indexOf((e.attr("type")||"").toLowerCase())&&!e.hasClass("flatpickr-input")},deleteAllDebugEvents:function(e){e.preventDefault();var t=s(e.target);s.confirm({backgroundDismiss:!1,escapeKey:!0,animationBounce:1,closeIcon:!0,type:"orange",icon:i.getModalIcon("exclamation-circle-solid-orange"),title:wp_mail_smtp_tools_debug_events.texts.notice_title,content:wp_mail_smtp_tools_debug_events.texts.delete_all_notice,buttons:{confirm:{text:wp_mail_smtp_tools_debug_events.texts.yes,btnClass:"btn-confirm",keys:["enter"],action:function(){i.executeAllDebugEventsDeletion(t)}},cancel:{text:wp_mail_smtp_tools_debug_events.texts.cancel,btnClass:"btn-cancel"}}})},eventClicked:function(e){e.preventDefault(),i.openDebugEventPopup(s(this).data("event-id"))},openDebugEventPopup:function(e){var e={action:"wp_mail_smtp_debug_event_preview",id:e,nonce:s("#wp-mail-smtp-debug-events-nonce",n.$debugEventsPage).val()},t=s.alert({backgroundDismiss:!0,escapeKey:!0,animationBounce:1,type:"blue",icon:i.getModalIcon("info-circle-blue"),title:!1,content:wp_mail_smtp_tools_debug_events.loader,boxWidth:"550px",buttons:{confirm:{text:wp_mail_smtp_tools_debug_events.texts.close,btnClass:"btn-confirm",keys:["enter"]}}});s.post(ajaxurl,e,function(e){e.success?(t.setTitle(e.data.title),t.setContent(e.data.content)):t.setContent(e.data)}).fail(function(){t.setContent(wp_mail_smtp_tools_debug_events.texts.error_occurred)})},executeAllDebugEventsDeletion:function(o){o.prop("disabled",!0);var e={action:"wp_mail_smtp_delete_all_debug_events",nonce:s("#wp-mail-smtp-debug-events-nonce",n.$debugEventsPage).val()};s.post(ajaxurl,e,function(e){var t,n,a,s=e.data;e.success?(t="check-circle-solid-green",n="green",a=function(){return location.reload(),!1}):(t="exclamation-circle-regular-red",n="red"),i.displayModal(s,t,n,a),o.prop("disabled",!1)}).fail(function(){i.displayModal(wp_mail_smtp_tools_debug_events.texts.error_occurred,"exclamation-circle-regular-red","red"),o.prop("disabled",!1)})},displayModal:function(e,t,n,a){a=a||function(){},s.alert({backgroundDismiss:!0,escapeKey:!0,animationBounce:1,type:n=n||"default",closeIcon:!0,title:!1,icon:t?i.getModalIcon(t):"",content:e,buttons:{confirm:{text:wp_mail_smtp_tools_debug_events.texts.ok,btnClass:"wp-mail-smtp-btn wp-mail-smtp-btn-md",keys:["enter"],action:a}}})},getModalIcon:function(e){return'"></i><img src="'+wp_mail_smtp_tools_debug_events.plugin_url+"/assets/images/font-awesome/"+e+'.svg" style="width: 40px; height: 40px;" alt=""><i class="'}};return i}((document,window,jQuery));WPMailSmtpDebugEvents.init();
|
||||
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* Chart.js v2.9.4
|
||||
* https://www.chartjs.org
|
||||
* (c) 2020 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*
|
||||
* NOTE: This file was modified. Chart object was renamed to WPMailSMTPChart, to prevent JS library conflicts with other plugins.
|
||||
* "Chart" was replaced with "WPMailSMTPChart" 3 times in this file.
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],(function(t){return e(function(){try{return t("moment")}catch(t){}}())})):(t=t||self).WPMailSMTPChart=e(t.moment)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,aLine truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
/* flatpickr v4.6.9,, @license MIT */
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=t()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function t(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var a=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a}var n=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],a={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},i={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},o=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},r=function(e){return!0===e?1:0};function l(e,t){var n;return function(){var a=this;clearTimeout(n),n=setTimeout((function(){return e.apply(a,arguments)}),t)}}var c=function(e){return e instanceof Array?e:[e]};function d(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function s(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function u(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function f(e,t){return t(e)?e:e.parentNode?f(e.parentNode,t):void 0}function m(e,t){var n=s("div","numInputWrapper"),a=s("input","numInput "+e),i=s("span","arrowUp"),o=s("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var p=function(){},h=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},v={D:p,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*r(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var a=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:functionLine truncated
|
||||
@@ -0,0 +1,388 @@
|
||||
/**
|
||||
* jquery-match-height 0.7.2 by @liabru
|
||||
* http://brm.io/jquery-match-height/
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
;(function(factory) { // eslint-disable-line no-extra-semi
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module !== 'undefined' && module.exports) {
|
||||
// CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Global
|
||||
factory(jQuery);
|
||||
}
|
||||
})(function($) {
|
||||
/*
|
||||
* internal
|
||||
*/
|
||||
|
||||
var _previousResizeWidth = -1,
|
||||
_updateTimeout = -1;
|
||||
|
||||
/*
|
||||
* _parse
|
||||
* value parse utility function
|
||||
*/
|
||||
|
||||
var _parse = function(value) {
|
||||
// parse value and convert NaN to 0
|
||||
return parseFloat(value) || 0;
|
||||
};
|
||||
|
||||
/*
|
||||
* _rows
|
||||
* utility function returns array of jQuery selections representing each row
|
||||
* (as displayed after float wrapping applied by browser)
|
||||
*/
|
||||
|
||||
var _rows = function(elements) {
|
||||
var tolerance = 1,
|
||||
$elements = $(elements),
|
||||
lastTop = null,
|
||||
rows = [];
|
||||
|
||||
// group elements by their top position
|
||||
$elements.each(function(){
|
||||
var $that = $(this),
|
||||
top = $that.offset().top - _parse($that.css('margin-top')),
|
||||
lastRow = rows.length > 0 ? rows[rows.length - 1] : null;
|
||||
|
||||
if (lastRow === null) {
|
||||
// first item on the row, so just push it
|
||||
rows.push($that);
|
||||
} else {
|
||||
// if the row top is the same, add to the row group
|
||||
if (Math.floor(Math.abs(lastTop - top)) <= tolerance) {
|
||||
rows[rows.length - 1] = lastRow.add($that);
|
||||
} else {
|
||||
// otherwise start a new row group
|
||||
rows.push($that);
|
||||
}
|
||||
}
|
||||
|
||||
// keep track of the last row top
|
||||
lastTop = top;
|
||||
});
|
||||
|
||||
return rows;
|
||||
};
|
||||
|
||||
/*
|
||||
* _parseOptions
|
||||
* handle plugin options
|
||||
*/
|
||||
|
||||
var _parseOptions = function(options) {
|
||||
var opts = {
|
||||
byRow: true,
|
||||
property: 'height',
|
||||
target: null,
|
||||
remove: false
|
||||
};
|
||||
|
||||
if (typeof options === 'object') {
|
||||
return $.extend(opts, options);
|
||||
}
|
||||
|
||||
if (typeof options === 'boolean') {
|
||||
opts.byRow = options;
|
||||
} else if (options === 'remove') {
|
||||
opts.remove = true;
|
||||
}
|
||||
|
||||
return opts;
|
||||
};
|
||||
|
||||
/*
|
||||
* matchHeight
|
||||
* plugin definition
|
||||
*/
|
||||
|
||||
var matchHeight = $.fn.matchHeight = function(options) {
|
||||
var opts = _parseOptions(options);
|
||||
|
||||
// handle remove
|
||||
if (opts.remove) {
|
||||
var that = this;
|
||||
|
||||
// remove fixed height from all selected elements
|
||||
this.css(opts.property, '');
|
||||
|
||||
// remove selected elements from all groups
|
||||
$.each(matchHeight._groups, function(key, group) {
|
||||
group.elements = group.elements.not(that);
|
||||
});
|
||||
|
||||
// TODO: cleanup empty groups
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
if (this.length <= 1 && !opts.target) {
|
||||
return this;
|
||||
}
|
||||
|
||||
// keep track of this group so we can re-apply later on load and resize events
|
||||
matchHeight._groups.push({
|
||||
elements: this,
|
||||
options: opts
|
||||
});
|
||||
|
||||
// match each element's height to the tallest element in the selection
|
||||
matchHeight._apply(this, opts);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/*
|
||||
* plugin global options
|
||||
*/
|
||||
|
||||
matchHeight.version = '0.7.2';
|
||||
matchHeight._groups = [];
|
||||
matchHeight._throttle = 80;
|
||||
matchHeight._maintainScroll = false;
|
||||
matchHeight._beforeUpdate = null;
|
||||
matchHeight._afterUpdate = null;
|
||||
matchHeight._rows = _rows;
|
||||
matchHeight._parse = _parse;
|
||||
matchHeight._parseOptions = _parseOptions;
|
||||
|
||||
/*
|
||||
* matchHeight._apply
|
||||
* apply matchHeight to given elements
|
||||
*/
|
||||
|
||||
matchHeight._apply = function(elements, options) {
|
||||
var opts = _parseOptions(options),
|
||||
$elements = $(elements),
|
||||
rows = [$elements];
|
||||
|
||||
// take note of scroll position
|
||||
var scrollTop = $(window).scrollTop(),
|
||||
htmlHeight = $('html').outerHeight(true);
|
||||
|
||||
// get hidden parents
|
||||
var $hiddenParents = $elements.parents().filter(':hidden');
|
||||
|
||||
// cache the original inline style
|
||||
$hiddenParents.each(function() {
|
||||
var $that = $(this);
|
||||
$that.data('style-cache', $that.attr('style'));
|
||||
});
|
||||
|
||||
// temporarily must force hidden parents visible
|
||||
$hiddenParents.css('display', 'block');
|
||||
|
||||
// get rows if using byRow, otherwise assume one row
|
||||
if (opts.byRow && !opts.target) {
|
||||
|
||||
// must first force an arbitrary equal height so floating elements break evenly
|
||||
$elements.each(function() {
|
||||
var $that = $(this),
|
||||
display = $that.css('display');
|
||||
|
||||
// temporarily force a usable display value
|
||||
if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
|
||||
display = 'block';
|
||||
}
|
||||
|
||||
// cache the original inline style
|
||||
$that.data('style-cache', $that.attr('style'));
|
||||
|
||||
$that.css({
|
||||
'display': display,
|
||||
'padding-top': '0',
|
||||
'padding-bottom': '0',
|
||||
'margin-top': '0',
|
||||
'margin-bottom': '0',
|
||||
'border-top-width': '0',
|
||||
'border-bottom-width': '0',
|
||||
'height': '100px',
|
||||
'overflow': 'hidden'
|
||||
});
|
||||
});
|
||||
|
||||
// get the array of rows (based on element top position)
|
||||
rows = _rows($elements);
|
||||
|
||||
// revert original inline styles
|
||||
$elements.each(function() {
|
||||
var $that = $(this);
|
||||
$that.attr('style', $that.data('style-cache') || '');
|
||||
});
|
||||
}
|
||||
|
||||
$.each(rows, function(key, row) {
|
||||
var $row = $(row),
|
||||
targetHeight = 0;
|
||||
|
||||
if (!opts.target) {
|
||||
// skip apply to rows with only one item
|
||||
if (opts.byRow && $row.length <= 1) {
|
||||
$row.css(opts.property, '');
|
||||
return;
|
||||
}
|
||||
|
||||
// iterate the row and find the max height
|
||||
$row.each(function(){
|
||||
var $that = $(this),
|
||||
style = $that.attr('style'),
|
||||
display = $that.css('display');
|
||||
|
||||
// temporarily force a usable display value
|
||||
if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') {
|
||||
display = 'block';
|
||||
}
|
||||
|
||||
// ensure we get the correct actual height (and not a previously set height value)
|
||||
var css = { 'display': display };
|
||||
css[opts.property] = '';
|
||||
$that.css(css);
|
||||
|
||||
// find the max height (including padding, but not margin)
|
||||
if ($that.outerHeight(false) > targetHeight) {
|
||||
targetHeight = $that.outerHeight(false);
|
||||
}
|
||||
|
||||
// revert styles
|
||||
if (style) {
|
||||
$that.attr('style', style);
|
||||
} else {
|
||||
$that.css('display', '');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if target set, use the height of the target element
|
||||
targetHeight = opts.target.outerHeight(false);
|
||||
}
|
||||
|
||||
// iterate the row and apply the height to all elements
|
||||
$row.each(function(){
|
||||
var $that = $(this),
|
||||
verticalPadding = 0;
|
||||
|
||||
// don't apply to a target
|
||||
if (opts.target && $that.is(opts.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// handle padding and border correctly (required when not using border-box)
|
||||
if ($that.css('box-sizing') !== 'border-box') {
|
||||
verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width'));
|
||||
verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom'));
|
||||
}
|
||||
|
||||
// set the height (accounting for padding and border)
|
||||
$that.css(opts.property, (targetHeight - verticalPadding) + 'px');
|
||||
});
|
||||
});
|
||||
|
||||
// revert hidden parents
|
||||
$hiddenParents.each(function() {
|
||||
var $that = $(this);
|
||||
$that.attr('style', $that.data('style-cache') || null);
|
||||
});
|
||||
|
||||
// restore scroll position if enabled
|
||||
if (matchHeight._maintainScroll) {
|
||||
$(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true));
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/*
|
||||
* matchHeight._applyDataApi
|
||||
* applies matchHeight to all elements with a data-match-height attribute
|
||||
*/
|
||||
|
||||
matchHeight._applyDataApi = function() {
|
||||
var groups = {};
|
||||
|
||||
// generate groups by their groupId set by elements using data-match-height
|
||||
$('[data-match-height], [data-mh]').each(function() {
|
||||
var $this = $(this),
|
||||
groupId = $this.attr('data-mh') || $this.attr('data-match-height');
|
||||
|
||||
if (groupId in groups) {
|
||||
groups[groupId] = groups[groupId].add($this);
|
||||
} else {
|
||||
groups[groupId] = $this;
|
||||
}
|
||||
});
|
||||
|
||||
// apply matchHeight to each group
|
||||
$.each(groups, function() {
|
||||
this.matchHeight(true);
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* matchHeight._update
|
||||
* updates matchHeight on all current groups with their correct options
|
||||
*/
|
||||
|
||||
var _update = function(event) {
|
||||
if (matchHeight._beforeUpdate) {
|
||||
matchHeight._beforeUpdate(event, matchHeight._groups);
|
||||
}
|
||||
|
||||
$.each(matchHeight._groups, function() {
|
||||
matchHeight._apply(this.elements, this.options);
|
||||
});
|
||||
|
||||
if (matchHeight._afterUpdate) {
|
||||
matchHeight._afterUpdate(event, matchHeight._groups);
|
||||
}
|
||||
};
|
||||
|
||||
matchHeight._update = function(throttle, event) {
|
||||
// prevent update if fired from a resize event
|
||||
// where the viewport width hasn't actually changed
|
||||
// fixes an event looping bug in IE8
|
||||
if (event && event.type === 'resize') {
|
||||
var windowWidth = $(window).width();
|
||||
if (windowWidth === _previousResizeWidth) {
|
||||
return;
|
||||
}
|
||||
_previousResizeWidth = windowWidth;
|
||||
}
|
||||
|
||||
// throttle updates
|
||||
if (!throttle) {
|
||||
_update(event);
|
||||
} else if (_updateTimeout === -1) {
|
||||
_updateTimeout = setTimeout(function() {
|
||||
_update(event);
|
||||
_updateTimeout = -1;
|
||||
}, matchHeight._throttle);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* bind events
|
||||
*/
|
||||
|
||||
// apply on DOM ready event
|
||||
$(matchHeight._applyDataApi);
|
||||
|
||||
// use on or bind where supported
|
||||
var on = $.fn.on ? 'on' : 'bind';
|
||||
|
||||
// update heights on load and resize events
|
||||
$(window)[on]('load', function(event) {
|
||||
matchHeight._update(false, event);
|
||||
});
|
||||
|
||||
// throttled update heights on resize events
|
||||
$(window)[on]('resize orientationchange', function(event) {
|
||||
matchHeight._update(true, event);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){function c(t){return parseFloat(t)||0}function h(t){var e=l(t),n=null,a=[];return e.each(function(){var t=l(this),e=t.offset().top-c(t.css("margin-top")),o=0<a.length?a[a.length-1]:null;null!==o&&Math.floor(Math.abs(n-e))<=1?a[a.length-1]=o.add(t):a.push(t),n=e}),a}function p(t){var e={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof t?l.extend(e,t):("boolean"==typeof t?e.byRow=t:"remove"===t&&(e.remove=!0),e)}var n=-1,a=-1,d=l.fn.matchHeight=function(t){var e=p(t);if(e.remove){var o=this;return this.css(e.property,""),l.each(d._groups,function(t,e){e.elements=e.elements.not(o)}),this}return this.length<=1&&!e.target||(d._groups.push({elements:this,options:e}),d._apply(this,e)),this};d.version="0.7.2",d._groups=[],d._throttle=80,d._maintainScroll=!1,d._beforeUpdate=null,d._afterUpdate=null,d._rows=h,d._parse=c,d._parseOptions=p,d._apply=function(t,e){var i=p(e),o=l(t),n=[o],a=l(window).scrollTop(),r=l("html").outerHeight(!0),s=o.parents().filter(":hidden");return s.each(function(){var t=l(this);t.data("style-cache",t.attr("style"))}),s.css("display","block"),i.byRow&&!i.target&&(o.each(function(){var t=l(this),e=t.css("display");"inline-block"!==e&&"flex"!==e&&"inline-flex"!==e&&(e="block"),t.data("style-cache",t.attr("style")),t.css({display:e,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),n=h(o),o.each(function(){var t=l(this);t.attr("style",t.data("style-cache")||"")})),l.each(n,function(t,e){var o=l(e),a=0;if(i.target)a=i.target.outerHeight(!1);else{if(i.byRow&&o.length<=1)return void o.css(i.property,"");o.each(function(){var t=l(this),e=t.attr("style"),o=t.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block");var n={display:o};n[i.property]="",t.css(n),t.outerHeight(!1)>a&&(a=t.outerHeight(!1)),e?t.attr("style",e):t.css("display","")})}o.each(function(){var t=l(this),e=0;i.target&&t.is(i.target)||("border-box"!==t.css("box-sizing")&&(e+=c(t.css("border-top-width"))+c(t.css("border-bottom-width")),e+=c(t.css("padding-top"))+c(t.css("padding-bottom"))),t.css(i.property,a-e+"px"))})}),s.each(function(){var t=l(this);t.attr("style",t.data("style-cache")||null)}),d._maintainScroll&&l(window).scrollTop(a/r*l("html").outerHeight(!0)),this},d._applyDataApi=function(){var o={};l("[data-match-height], [data-mh]").each(function(){var t=l(this),e=t.attr("data-mh")||t.attr("data-match-height");o[e]=e in o?o[e].add(t):t}),l.each(o,function(){this.matchHeight(!0)})};function i(t){d._beforeUpdate&&d._beforeUpdate(t,d._groups),l.each(d._groups,function(){d._apply(this.elements,this.options)}),d._afterUpdate&&d._afterUpdate(t,d._groups)}d._update=function(t,e){if(e&&"resize"===e.type){var o=l(window).width();if(o===n)return;n=o}t?-1===a&&(a=setTimeout(function(){i(e),a=-1},d._throttle)):i(e)},l(d._applyDataApi);var t=l.fn.on?"on":"bind";l(window)[t]("load",function(t){d._update(!1,t)}),l(window)[t]("resize orientationchange",function(t){d._update(!0,t)})});
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function f(){return H.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function o(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Pt(e,t,n,s,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){if(null==e._isValid){var t=m(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function I(e){var t=l(NaN);return null!=e?E(m(t),e):m(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=f.momentProperties=[],z=!1;function $(e,t){var n,s,i,r=Z.length;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=m(t)),o(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)o(i=t[s=Z[n]])||(e[s]=i);return e}function q(e){$(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,f.updateOffset(this),z=!1)}function h(e){return e instanceof q||null!=e&&null!=e._isAMomentObject}function B(e){!1===f.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=f.deprecationHandler&&f.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=f.deprecationHandler&&f.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function d(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=d(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndLine truncated
|
||||
Reference in new issue
Block a user