PluginProbe ʕ •ᴥ•ʔ
Slider Ultimate / 2.0.8
Slider Ultimate v2.0.8
trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9
ultimate-slider / lib / simple-admin-pages / js / admin-settings.js
ultimate-slider / lib / simple-admin-pages / js Last commit date
address.js 4 years ago admin-settings.js 4 years ago count.js 4 years ago file_upload.js 4 years ago image.js 4 years ago infinite_table.js 4 years ago opening-hours.js 4 years ago ordering.js 4 years ago scheduler.js 4 years ago spectrum.js 4 years ago
admin-settings.js
104 lines
1 jQuery(document).ready(function() {
2
3 if ( ! jQuery.isFunction( jQuery.fn.spectrum ) ) { return; }
4
5 jQuery('.sap-spectrum').spectrum({
6 showInput: true,
7 showInitial: true,
8 preferredFormat: "hex",
9 allowEmpty: true
10 });
11
12 jQuery('.sap-spectrum').css('display', 'inline');
13
14 jQuery('.sap-spectrum').on('change', function() {
15 if (jQuery(this).val() != "") {
16 jQuery(this).css('background', jQuery(this).val());
17 var rgb = EWD_SAP_hexToRgb(jQuery(this).val());
18 var Brightness = (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
19 if (Brightness < 100) {jQuery(this).css('color', '#ffffff');}
20 else {jQuery(this).css('color', '#000000');}
21 }
22 else {
23 jQuery(this).css('background', 'none');
24 }
25 });
26
27 jQuery('.sap-spectrum').each(function() {
28 if (jQuery(this).val() != "") {
29 jQuery(this).css('background', jQuery(this).val());
30 var rgb = EWD_SAP_hexToRgb(jQuery(this).val());
31 var Brightness = (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
32 if (Brightness < 100) {jQuery(this).css('color', '#ffffff');}
33 else {jQuery(this).css('color', '#000000');}
34 }
35 });
36
37 jQuery( 'fieldset[data-conditional_on]' ).each( function() {
38
39 var option = jQuery( this );
40 var option_name = jQuery( 'input[name="option_page"]' ).val() + '[' + option.data( 'conditional_on' ) + ']';
41 console.log( option_name );
42 jQuery( '[name="' + option_name + '"], [name="' + option_name + '[]"]' ).on( 'change', function() {
43
44 var option_value = jQuery( this ).attr( 'type' ) != 'checkbox' ? jQuery( this ).val() :
45 ( ( option.data( 'conditional_on_value' ) == 1 || option.data( 'conditional_on_value' ) == '' ) ? jQuery( this ).is( ':checked' ) :
46 ( jQuery( this ).is( ':checked' ) ? option.data( 'conditional_on_value' ) : false ) );
47 console.log( option_name ); console.log( option_value ); console.log( option.data( 'conditional_on_value' ) );
48 if ( option_value == option.data( 'conditional_on_value' ) ) {
49
50 option.parent().parent().removeClass( 'sap-hidden' );
51 }
52 else {
53
54 option.parent().parent().addClass( 'sap-hidden' );
55 }
56 });
57 });
58 });
59
60 function EWD_SAP_hexToRgb(hex) {
61 var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
62 return result ? {
63 r: parseInt(result[1], 16),
64 g: parseInt(result[2], 16),
65 b: parseInt(result[3], 16)
66 } : null;
67 }
68
69 //OPTIONS PAGE YES/NO TOGGLE SWITCHES
70 jQuery(document).ready(function($){
71 $('.sap-admin-option-toggle').on('change', function() {
72 var Input_Name = $(this).data('inputname');
73 if ($(this).is(':checked')) {
74 $('input[name="' + Input_Name + '"][value="1"]').prop('checked', true).trigger('change');
75 $('input[name="' + Input_Name + '"][value=""]').prop('checked', false);
76 }
77 else {
78 $('input[name="' + Input_Name + '"][value="1"]').prop('checked', false).trigger('change');
79 $('input[name="' + Input_Name + '"][value=""]').prop('checked', true);
80 }
81 });
82 });
83
84 /*LOCK BOXES*/
85 jQuery( document ).ready( function() {
86
87 function resizeLockdownBoxes() {
88 jQuery('.sap-premium-options-table-overlay').each(function(){
89
90 var eachProTableOverlay = jQuery( this );
91 var associatedTable = eachProTableOverlay.next();
92 associatedTable.css('min-height', '260px');
93 var tablePosition = associatedTable.position();
94
95 eachProTableOverlay.css( 'width', associatedTable.outerWidth(true) + 'px' );
96 eachProTableOverlay.css( 'height', associatedTable.outerHeight() + 'px' );
97 eachProTableOverlay.css( 'left', tablePosition.left + 'px' );
98 eachProTableOverlay.css( 'top', tablePosition.top + 'px' );
99 });
100 }
101
102 setTimeout( resizeLockdownBoxes, 750 );
103 jQuery( window ).on( 'resize', resizeLockdownBoxes );
104 });