PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / js / blockUI.js

blockUI.js in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.7.0, at js/blockUI.js

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var wp_optimize = window.wp_optimize || {};
2
3 /**
4 * Blocks UI
5 *
6 * @param {string} message Information to show in blockUI
7 * @param {Object} options Display options
8 * @param {integer} timeout (optional)
9 * @param {boolean} is_popup_blocking_screen (optional) when is true then it is impossible to close the popup by clicking outside
10 */
11 wp_optimize.block_ui = function (message, options, timeout, is_popup_blocking_screen) {
12
13 var font_size = 'medium';
14 if (typeof message === 'string') {
15 if (message.length < 30) {
16 font_size = 'large';
17 } else if (message.length > 100) {
18 font_size = 'small';
19 }
20 }
21
22 var $ = jQuery,
23 logo_src = (typeof wpoptimize !== 'undefined' && wpoptimize.logo_src) || (typeof wposmush !== 'undefined' && wposmush.logo_src),
24 params = {
25 css: {
26 width: '300px',
27 border: 'none',
28 'border-radius': '10px',
29 left: 'calc(50% - 150px)',
30 padding: '20px'
31 },
32 message: '<div class="wp_optimize_blink_animation"><img src="'+logo_src+'" height="80" width="80"><div class="wp_optimize_blink_animation-message_text--'+font_size+'">'+message+'</div></div>'
33 };
34
35 options = options || {};
36
37 if (timeout) {
38 setTimeout(jQuery.unblockUI, timeout);
39 } else if (!is_popup_blocking_screen) {
40 options.onOverlayClick = jQuery.unblockUI;
41 }
42
43 params = $.extend(params, options);
44
45 $.blockUI(params);
46 }
47