admin-folders.js
6 years ago
admin-galleries.js
6 years ago
admin-gallery.js
6 years ago
admin-media.js
6 years ago
admin-widgets.js
6 years ago
admin.js
6 years ago
front-basicmasonry.js
8 years ago
front-basicslider.js
8 years ago
front.js
6 years ago
gutenberg.min.js
6 years ago
admin.js
77 lines
| 1 | ( function ( $ ) { |
| 2 | |
| 3 | $( document ).ready( function () { |
| 4 | $( '.responsive-lightbox-settings .color-picker' ).wpColorPicker(); |
| 5 | $( '.responsive-lightbox-settings' ).checkBo(); |
| 6 | |
| 7 | $( '.responsive-lightbox-settings input.reset-configuration' ).on( 'click', function() { |
| 8 | return confirm( rlArgsAdmin.resetScriptToDefaults ); |
| 9 | } ); |
| 10 | |
| 11 | $( '.responsive-lightbox-settings input.reset-settings' ).on( 'click', function() { |
| 12 | return confirm( rlArgsAdmin.resetSettingsToDefaults ); |
| 13 | } ); |
| 14 | |
| 15 | $( '.responsive-lightbox-settings input.reset-gallery' ).on( 'click', function() { |
| 16 | return confirm( rlArgsAdmin.resetGalleryToDefaults ); |
| 17 | } ); |
| 18 | |
| 19 | // slide toggle media provider options |
| 20 | $( '.rl-media-provider-expandable' ).on( 'change', function () { |
| 21 | var active = $( this ), |
| 22 | options = active.closest( 'td' ).find( '.rl-media-provider-options' ); |
| 23 | |
| 24 | if ( active.is( ':checked' ) ) |
| 25 | options.slideDown( 'fast' ); |
| 26 | else |
| 27 | options.slideUp( 'fast' ); |
| 28 | } ); |
| 29 | |
| 30 | // load all previously used taxonomies |
| 31 | $( document ).on( 'click', '#rl_folders_load_old_taxonomies', function () { |
| 32 | var select = $( '#rl_media_taxonomy' ), |
| 33 | spinner = select.parent().find( '.spinner' ), |
| 34 | taxonomies = []; |
| 35 | |
| 36 | select.find( 'option' ).each( function ( i, item ) { |
| 37 | taxonomies.push( $( item ).val() ); |
| 38 | } ); |
| 39 | |
| 40 | // show spinner |
| 41 | spinner.toggleClass( 'is-active', true ); |
| 42 | |
| 43 | $.post( ajaxurl, { |
| 44 | action: 'rl-folders-load-old-taxonomies', |
| 45 | taxonomies: taxonomies, |
| 46 | nonce: rlArgsAdmin.tax_nonce |
| 47 | } ).done( function ( response ) { |
| 48 | try { |
| 49 | if ( response.success && response.data.taxonomies.length > 0 ) { |
| 50 | $.each( response.data.taxonomies, function ( i, item ) { |
| 51 | select.append( $( '<option></option>' ).attr( 'value', item ).text( item ) ); |
| 52 | } ); |
| 53 | } else { |
| 54 | //@TODO |
| 55 | } |
| 56 | } catch ( e ) { |
| 57 | //@TODO |
| 58 | } |
| 59 | } ).always( function () { |
| 60 | // hide spinner |
| 61 | spinner.toggleClass( 'is-active', false ); |
| 62 | } ); |
| 63 | |
| 64 | return false; |
| 65 | } ); |
| 66 | } ); |
| 67 | |
| 68 | } )( jQuery ); |
| 69 | |
| 70 | /* |
| 71 | * checkBo lightweight jQuery plugin v0.1.4 by @ElmahdiMahmoud |
| 72 | * Licensed under the MIT license - https://github.com/elmahdim/checkbo/blob/master/LICENSE |
| 73 | * |
| 74 | * Custom checkbox and radio |
| 75 | * Author URL: elmahdim.com |
| 76 | */ |
| 77 | !function(e){e.fn.checkBo=function(c){return c=e.extend({},{checkAllButton:null,checkAllTarget:null,checkAllTextDefault:null,checkAllTextToggle:null},c),this.each(function(){function t(e){this.input=e}function n(){var c=e(this).is(":checked");e(this).closest("label").toggleClass("checked",c)}function i(e,c,t){e.text(e.parent(a).hasClass("checked")?t:c)}function h(c){var t=c.attr("data-show");c=c.attr("data-hide"),e(t).removeClass("is-hidden"),e(c).addClass("is-hidden")}var l=e(this),a=l.find(".cb-checkbox"),d=l.find(".cb-radio"),o=l.find(".cb-switcher"),s=a.find("input:checkbox"),f=d.find("input:radio");s.wrap('<span class="cb-inner"><i></i></span>'),f.wrap('<span class="cb-inner"><i></i></span>');var k=new t("input:checkbox"),r=new t("input:radio");if(t.prototype.checkbox=function(e){var c=e.find(this.input).is(":checked");e.find(this.input).prop("checked",!c).trigger("change")},t.prototype.radiobtn=function(c,t){var n=e('input:radio[name="'+t+'"]');n.prop("checked",!1),n.closest(n.closest(d)).removeClass("checked"),c.addClass("checked"),c.find(this.input).get(0).checked=c.hasClass("checked"),c.find(this.input).change()},s.on("change",n),f.on("change",n),a.find("a").on("click",function(e){e.stopPropagation()}),a.on("click",function(c){c.preventDefault(),k.checkbox(e(this)),c=e(this).attr("data-toggle"),e(c).toggleClass("is-hidden"),h(e(this))}),d.on("click",function(c){c.preventDefault(),r.radiobtn(e(this),e(this).find("input:radio").attr("name")),h(e(this))}),e.fn.toggleCheckbox=function(){this.prop("checked",!this.is(":checked"))},e.fn.switcherChecker=function(){var c=e(this),t=c.find("input"),n=c.find(".cb-state");t.is(":checked")?(c.addClass("checked"),n.html(t.attr("data-state-on"))):(c.removeClass("checked"),n.html(t.attr("data-state-off")))},o.on("click",function(c){c.preventDefault(),c=e(this),c.find("input").toggleCheckbox(),c.switcherChecker(),e(c.attr("data-toggle")).toggleClass("is-hidden")}),o.each(function(){e(this).switcherChecker()}),c.checkAllButton&&c.checkAllTarget){var u=e(this);u.find(e(c.checkAllButton)).on("click",function(){u.find(c.checkAllTarget).find("input:checkbox").each(function(){u.find(e(c.checkAllButton)).hasClass("checked")?u.find(c.checkAllTarget).find("input:checkbox").prop("checked",!0).change():u.find(c.checkAllTarget).find("input:checkbox").prop("checked",!1).change()}),i(u.find(e(c.checkAllButton)).find(".toggle-text"),c.checkAllTextDefault,c.checkAllTextToggle)}),u.find(c.checkAllTarget).find(a).on("click",function(){u.find(c.checkAllButton).find("input:checkbox").prop("checked",!1).change().removeClass("checked"),i(u.find(e(c.checkAllButton)).find(".toggle-text"),c.checkAllTextDefault,c.checkAllTextToggle)})}l.find('[checked="checked"]').closest("label").addClass("checked"),l.find("input").is("input:disabled")&&l.find("input:disabled").closest("label").off().addClass("disabled")})}}(jQuery,window,document); |