芝麻web文件管理V1.00
' );
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: '"> 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();