modified file bootstrap-buttons.css

This commit is contained in:
2023-12-08 23:23:36 +00:00
committed by Gitium
parent 33d18af972
commit 3f4d8b933f
2304 changed files with 24432 additions and 417943 deletions

View File

@ -60,16 +60,21 @@ var W3tc_Lightbox = {
} else if (this.options.url) {
this.load(this.options.url, this.options.callback);
if (typeof ga != 'undefined') {
if (window.w3tc_ga) {
var w3tc_action = this.options.url.match(/w3tc_action=([^&]+)/);
if (window.w3tc_ga) {
if (w3tc_action && w3tc_action[1])
w3tc_ga('send', 'pageview', 'overlays/' + w3tc_action[1]);
else {
var w3tc_action = this.options.url.match(/&(w3tc_[^&]+)&/);
if (w3tc_action && w3tc_action[1])
w3tc_ga('send', 'pageview', 'overlays/' + w3tc_action[1]);
}
if (! w3tc_action || ! w3tc_action[1]) {
w3tc_action = this.options.url.match(/&(w3tc_[^&]+)&/);
}
if (w3tc_action && w3tc_action[1]) {
w3tc_ga(
'event',
'pageview',
{
eventLabel: 'overlays/' + w3tc_action[1]
}
);
}
}
}
@ -385,9 +390,7 @@ function w3tc_lightbox_self_test(nonce) {
function w3tc_lightbox_upgrade(nonce, data_src, renew_key) {
var client_id = '';
if (window.w3tc_ga) {
w3tc_ga(function(tracker) {
client_id = tracker.get('clientId');
});
client_id = w3tc_ga_cid;
}
W3tc_Lightbox.open({
@ -412,9 +415,11 @@ function w3tc_lightbox_upgrade(nonce, data_src, renew_key) {
jQuery('#w3tc-purchase-link', lightbox.container).on( 'click', function() {
lightbox.close();
jQuery([document.documentElement, document.body]).animate({
scrollTop: jQuery("#licensing").offset().top
}, 2000);
if ( jQuery('#licensing').length ) {
jQuery([document.documentElement, document.body]).animate({
scrollTop: jQuery('#licensing').offset().top
}, 2000);
}
});
// Allow for customizations of the "upgrade" overlay specifically.
@ -444,7 +449,7 @@ function w3tc_lightbox_buy_plugin(nonce, data_src, renew_key, client_id) {
var data = event.data.split(' ');
if (data[0] === 'license') {
// legacy purchase
w3tc_lightbox_save_licence_key(function() {
w3tc_lightbox_save_license_key(function() {
lightbox.close();
});
} else if (data[0] === 'v2_license') {
@ -457,7 +462,7 @@ function w3tc_lightbox_buy_plugin(nonce, data_src, renew_key, client_id) {
window.location = window.location + '&refresh';
}
w3tc_lightbox_save_licence_key(data[1], nonce, function() {
w3tc_lightbox_save_license_key(data[1], nonce, function() {
jQuery('#buy_frame').attr('src', data[3]);
});
}
@ -476,12 +481,12 @@ function w3tc_lightbox_buy_plugin(nonce, data_src, renew_key, client_id) {
});
}
function w3tc_lightbox_save_licence_key(license_key, nonce, callback) {
function w3tc_lightbox_save_license_key(license_key, nonce, callback) {
jQuery('#plugin_license_key').val(license_key);
var params = {
w3tc_default_save_licence_key: 1,
w3tc_default_save_license_key: 1,
license_key: license_key,
_wpnonce: nonce
_wpnonce: ('array' === jQuery.type(nonce)) ? nonce[0] : nonce
};
jQuery.post('admin.php?page=w3tc_dashboard', params, function(data) {

View File

@ -17,8 +17,14 @@ jQuery(function() {
// GA.
if ( w3tc_enable_ga ) {
w3tc_ga( 'create', W3TC_SetupGuide.ga_profile, 'auto' );
w3tc_ga( 'send', 'event', 'button', 'w3tc_setup_guide', 'w3tc-wizard-step-welcome' );
w3tc_ga(
'event',
'button',
{
eventCategory: 'w3tc_setup_guide',
eventLabel: 'w3tc-wizard-step-welcome'
}
);
}
// Handle the terms of service notice.
@ -54,28 +60,36 @@ jQuery(function() {
if ( 'accept' === choice ) {
W3TC_SetupGuide.tos_choice = choice;
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://api.w3-edge.com/v1/analytics','w3tc_ga');
var gaScript = document.createElement( 'script' );
gaScript.type = 'text/javascript';
gaScript.setAttribute( 'async', 'true' );
gaScript.setAttribute( 'src', 'https://www.googletagmanager.com/gtag/js?id=' + W3TC_SetupGuide.ga_profile );
document.documentElement.firstChild.appendChild( gaScript );
window.dataLayer = window.dataLayer || [];
const w3tc_ga = function() { dataLayer.push( arguments ); }
if (window.w3tc_ga) {
w3tc_ga( 'create', W3TC_SetupGuide.ga_profile, 'auto' );
w3tc_ga( 'set', {
'dimension1': 'w3-total-cache',
'dimension2': W3TC_SetupGuide.w3tc_version,
'dimension3': W3TC_SetupGuide.wp_version,
'dimension4': W3TC_SetupGuide.php_version,
'dimension5': W3TC_SetupGuide.server_software,
'dimension6': W3TC_SetupGuide.db_version,
'dimension7': W3TC_SetupGuide.home_url_host,
'dimension9': W3TC_SetupGuide.install_version,
'dimension10': W3TC_SetupGuide.w3tc_edition,
'dimension11': W3TC_SetupGuide.list_widgets,
'page': W3TC_SetupGuide.page
});
w3tc_enable_ga = true;
w3tc_ga( 'send', 'pageview' );
w3tc_ga( 'js', new Date() );
w3tc_ga( 'config', W3TC_SetupGuide.ga_profile, {
'user_properties': {
'plugin': 'w3-total-cache',
'w3tc_version': W3TC_SetupGuide.w3tc_version,
'wp_version': W3TC_SetupGuide.wp_version,
'php_version': W3TC_SetupGuide.php_version,
'server_software': W3TC_SetupGuide.server_software,
'wpdb_version': W3TC_SetupGuide.db_version,
'home_url': W3TC_SetupGuide.home_url_host,
'w3tc_install_version': W3TC_SetupGuide.install_version,
'w3tc_edition': W3TC_SetupGuide.w3tc_edition,
'w3tc_widgets': W3TC_SetupGuide.list_widgets,
'page': W3TC_SetupGuide.page
}
});
}
}
});
@ -110,6 +124,9 @@ function w3tc_wizard_actions( $slide ) {
browsercacheSettings = {
enabled: null
},
imageserviceSettings = {
enabled: null
},
lazyloadSettings = {
enabled: null
},
@ -320,6 +337,52 @@ function w3tc_wizard_actions( $slide ) {
});
}
/**
* Configure Image Service.
*
* @since 2.3.4
*
* @param int enable Enable browser cache.
* @return jqXHR
*/
function configImageservice( enable ) {
configSuccess = null;
return jQuery.ajax({
method: 'POST',
url: ajaxurl,
data: {
_wpnonce: nonce,
action: 'w3tc_config_imageservice',
enable: enable
}
})
.done(function( response ) {
configSuccess = response.data.success;
});
}
/**
* Get Image Service settings.
*
* @since 2.3.4
*
* @return jqXHR
*/
function getImageserviceSettings() {
return jQuery.ajax({
method: 'POST',
url: ajaxurl,
data: {
_wpnonce: nonce,
action: 'w3tc_get_imageservice_settings'
}
})
.done(function( response ) {
imageserviceSettings = response.data;
});
}
/**
* Configure Lazy Load.
*
@ -400,7 +463,14 @@ function w3tc_wizard_actions( $slide ) {
// GA.
if ( w3tc_enable_ga ) {
w3tc_ga( 'send', 'event', 'button', 'w3tc_setup_guide', slideId );
w3tc_ga(
'event',
'button',
{
eventCategory: 'w3tc_setup_guide',
eventLabel: slideId
}
);
}
switch ( slideId ) {
@ -833,7 +903,7 @@ function w3tc_wizard_actions( $slide ) {
$container.find( '#w3tc-options-menu li' ).removeClass( 'is-active' );
$container.find( '#w3tc-wizard-step-objectcache' ).addClass( 'is-active' );
if ( ! $container.find( '#test-results' ).data( 'oc-none' ) ) {
if ( ! $container.find( '#test-results' ).data( 'oc-none' ) && ! W3TC_SetupGuide.objcache_disabled ) {
$nextButton.prop( 'disabled', 'disabled' );
}
@ -1181,7 +1251,7 @@ function w3tc_wizard_actions( $slide ) {
break;
case 'w3tc-wizard-slide-ll1':
case 'w3tc-wizard-slide-io1':
// Save the browser cache setting from the previous slide.
var browsercacheEnabled = $container.find( 'input:checked[name="browsercache_enable"]' ).val();
@ -1198,6 +1268,38 @@ function w3tc_wizard_actions( $slide ) {
jQuery( '#w3tc-wizard-step-browsercache' ).append( '<span class="dashicons dashicons-yes"></span>' );
}
// Present the Image Service slide.
$container.find( '#w3tc-options-menu li' ).removeClass( 'is-active' );
$container.find( '#w3tc-wizard-step-imageservice' ).addClass( 'is-active' );
$dashboardButton.closest( 'span' ).hide();
$nextButton.closest( 'span' ).show();
$nextButton.prop( 'disabled', 'disabled' );
// Update the Image Service enable chackbox from saved config.
getImageserviceSettings()
.then( function() {
$container.find( 'input#imageservice-enable' ).prop( 'checked', imageserviceSettings.enabled );
$nextButton.prop( 'disabled', false );
}, configFailed );
break;
case 'w3tc-wizard-slide-ll1':
// Save the image service setting from the previous slide.
var imageserviceEnabled = $container.find( 'input:checked#imageservice-enable' ).val();
configImageservice( ( '1' === imageserviceEnabled ? 1 : 0 ) )
.fail( function() {
$slide.append(
'<div class="notice notice-error"><p><strong>' +
W3TC_SetupGuide.config_error_msg +
'</strong></p></div>'
);
});
if ( ! jQuery( '#w3tc-wizard-step-imageservice .dashicons-yes' ).length ) {
jQuery( '#w3tc-wizard-step-imageservice' ).append( '<span class="dashicons dashicons-yes"></span>' );
}
// Present the Lazy Load slide.
$container.find( '#w3tc-options-menu li' ).removeClass( 'is-active' );
$container.find( '#w3tc-wizard-step-lazyload' ).addClass( 'is-active' );
@ -1228,9 +1330,10 @@ function w3tc_wizard_actions( $slide ) {
objcacheEngineLabel = $container.find( 'input:checked[name="objcache_engine"]' )
.closest('td').next('td').text(),
browsercacheEnabled = $container.find( 'input:checked[name="browsercache_enable"]' ).val(),
imageserviceEnabled = $container.find( 'input#imageservice-enable' ).val(),
lazyloadEnabled = $container.find( 'input:checked#lazyload-enable' ).val();
// Save the lazyload setting from the previous slide.
// Save the lazy load setting from the previous slide.
configLazyload( ( '1' === lazyloadEnabled ? 1 : 0 ) )
.fail( function() {
$slide.append(
@ -1268,8 +1371,12 @@ function w3tc_wizard_actions( $slide ) {
browsercacheEnabled ? W3TC_SetupGuide.enabled : W3TC_SetupGuide.none
);
$container.find( '#w3tc-imageservice-setting' ).html(
imageserviceEnabled ? W3TC_SetupGuide.enabled : W3TC_SetupGuide.notEnabled
);
$container.find( '#w3tc-lazyload-setting' ).html(
lazyloadEnabled ? W3TC_SetupGuide.enabled : W3TC_SetupGuide.none
lazyloadEnabled ? W3TC_SetupGuide.enabled : W3TC_SetupGuide.notEnabled
);
if ( ! jQuery( '#test-results' ).data( 'completed' ) ) {

View File

@ -13,13 +13,14 @@
$nextButton = $container.find( '#w3tc-wizard-next '),
$previousButton = $container.find( '#w3tc-wizard-previous ');
jQuery( '.button-buy-plugin' ).parent().remove();
$skipLink.on( 'click', skipFunction );
$skipButton.on( 'click', skipFunction );
jQuery( window ).on( 'beforeunload', function() {
return W3TC_Wizard.beforeunloadText;
var $previousSlide = $container.find( '.w3tc-wizard-slides:visible' ).prev( '.w3tc-wizard-slides' );
if ( $previousSlide.length ) {
return W3TC_Wizard.beforeunloadText;
}
});
// Listen for clicks to go to the W3TC Dashboard.
@ -51,7 +52,14 @@
// GA.
if ( window.w3tc_ga ) {
w3tc_ga( 'send', 'event', 'button', page, 'skip' );
w3tc_ga(
'event',
'button',
{
eventCategory: page,
eventLabel: 'skip'
}
);
}
jQuery.ajax({