admin.js
110 lines
| 1 | ( function ( $ ) { |
| 2 | |
| 3 | $( document ).ready( function () { |
| 4 | |
| 5 | $( '.wplikebtns' ).buttonset(); |
| 6 | $( '#rl_fb_overlay_color_input' ).wpColorPicker(); |
| 7 | |
| 8 | $( document ).on( 'click', '#rl-fb-modal-yes', function ( event ) { |
| 9 | $( '#rl-fb-show-overlay-yes' ).trigger( 'click' ); |
| 10 | $( '#rl-fb-show-overlay-no' ).button( 'disable' ); |
| 11 | $( '#rl-fb-show-overlay-yes' ).button( 'disable' ); |
| 12 | $( '#rl-fb-show-close-button-no' ).trigger( 'click' ); |
| 13 | $( '#rl-fb-show-close-button-no' ).button( 'disable' ); |
| 14 | $( '#rl-fb-show-close-button-yes' ).button( 'disable' ); |
| 15 | $( '#rl-fb-enable-escape-button-no' ).trigger( 'click' ); |
| 16 | $( '#rl-fb-enable-escape-button-no' ).button( 'disable' ); |
| 17 | $( '#rl-fb-enable-escape-button-yes' ).button( 'disable' ); |
| 18 | $( '#rl-fb-hide-on-overlay-click-no' ).trigger( 'click' ); |
| 19 | $( '#rl-fb-hide-on-overlay-click-no' ).button( 'disable' ); |
| 20 | $( '#rl-fb-hide-on-overlay-click-yes' ).button( 'disable' ); |
| 21 | $( '#rl-fb-hide-on-content-click-no' ).trigger( 'click' ); |
| 22 | $( '#rl-fb-hide-on-content-click-no' ).button( 'disable' ); |
| 23 | $( '#rl-fb-hide-on-content-click-yes' ).button( 'disable' ); |
| 24 | } ); |
| 25 | |
| 26 | $( document ).on( 'click', '#rl-fb-modal-no', function ( event ) { |
| 27 | $( '#rl-fb-show-overlay-no' ).button( 'enable' ); |
| 28 | $( '#rl-fb-show-overlay-yes' ).button( 'enable' ); |
| 29 | $( '#rl-fb-show-overlay-yes' ).trigger( 'click' ); |
| 30 | $( '#rl-fb-show-close-button-no' ).button( 'enable' ); |
| 31 | $( '#rl-fb-show-close-button-yes' ).button( 'enable' ); |
| 32 | $( '#rl-fb-show-close-button-no' ).trigger( 'click' ); |
| 33 | $( '#rl-fb-enable-escape-button-no' ).button( 'enable' ); |
| 34 | $( '#rl-fb-enable-escape-button-yes' ).button( 'enable' ); |
| 35 | $( '#rl-fb-enable-escape-button-no' ).trigger( 'click' ); |
| 36 | $( '#rl-fb-hide-on-overlay-click-no' ).button( 'enable' ); |
| 37 | $( '#rl-fb-hide-on-overlay-click-yes' ).button( 'enable' ); |
| 38 | $( '#rl-fb-hide-on-overlay-click-no' ).trigger( 'click' ); |
| 39 | $( '#rl-fb-hide-on-content-click-no' ).button( 'enable' ); |
| 40 | $( '#rl-fb-hide-on-content-click-yes' ).button( 'enable' ); |
| 41 | $( '#rl-fb-hide-on-content-click-no' ).trigger( 'click' ); |
| 42 | } ); |
| 43 | |
| 44 | $( '#rl_pp_opacity_span' ).slider( { |
| 45 | value: rlArgs.opacity_pp, |
| 46 | min: 0, |
| 47 | max: 100, |
| 48 | step: 1, |
| 49 | orientation: 'horizontal', |
| 50 | slide: function ( e, ui ) { |
| 51 | $( '#rl_pp_opacity_input' ).attr( 'value', ui.value ); |
| 52 | $( '#rl_pp_opacity_span' ).attr( 'title', ui.value ); |
| 53 | } |
| 54 | } ); |
| 55 | |
| 56 | $( '#rl_fb_overlay_opacity_span' ).slider( { |
| 57 | value: rlArgs.opacity_fb, |
| 58 | min: 0, |
| 59 | max: 100, |
| 60 | step: 1, |
| 61 | orientation: 'horizontal', |
| 62 | slide: function ( e, ui ) { |
| 63 | $( '#rl_fb_overlay_opacity_input' ).attr( 'value', ui.value ); |
| 64 | $( '#rl_fb_overlay_opacity_span' ).attr( 'title', ui.value ); |
| 65 | } |
| 66 | } ); |
| 67 | |
| 68 | $( document ).on( 'change', '#rl-pp-slideshow-yes, #rl-pp-slideshow-no', function ( event ) { |
| 69 | if ( $( this ).val() === 'yes' ) { |
| 70 | $( '#rl_pp_slideshow_delay' ).fadeIn( 300 ); |
| 71 | } else { |
| 72 | $( '#rl_pp_slideshow_delay' ).fadeOut( 300 ); |
| 73 | } |
| 74 | } ); |
| 75 | |
| 76 | $( document ).on( 'change', '#rl-sb-hide-bars-yes, #rl-sb-hide-bars-no', function ( event ) { |
| 77 | if ( $( this ).val() === 'yes' ) { |
| 78 | $( '#rl_sb_hide_bars_delay' ).fadeIn( 300 ); |
| 79 | } else { |
| 80 | $( '#rl_sb_hide_bars_delay' ).fadeOut( 300 ); |
| 81 | } |
| 82 | } ); |
| 83 | |
| 84 | $( document ).on( 'change', '#rl-enable-custom-events-yes, #rl-enable-custom-events-no', function ( event ) { |
| 85 | if ( $( this ).val() === 'yes' ) { |
| 86 | $( '#rl_custom_events' ).fadeIn( 300 ); |
| 87 | } else { |
| 88 | $( '#rl_custom_events' ).fadeOut( 300 ); |
| 89 | } |
| 90 | } ); |
| 91 | |
| 92 | $( document ).on( 'change', '#rl-enable-gallery-image-size-yes, #rl-enable-gallery-image-size-no', function ( event ) { |
| 93 | if ( $( this ).val() === 'yes' ) { |
| 94 | $( '#rl_gallery_image_size' ).fadeIn( 300 ); |
| 95 | } else { |
| 96 | $( '#rl_gallery_image_size' ).fadeOut( 300 ); |
| 97 | } |
| 98 | } ); |
| 99 | |
| 100 | $( document ).on( 'click', 'input#reset_rl_configuration', function ( event ) { |
| 101 | return confirm( rlArgs.resetScriptToDefaults ); |
| 102 | } ); |
| 103 | |
| 104 | $( document ).on( 'click', 'input#reset_rl_settings', function ( event ) { |
| 105 | return confirm( rlArgs.resetSettingsToDefaults ); |
| 106 | } ); |
| 107 | |
| 108 | } ); |
| 109 | |
| 110 | } )( jQuery ); |