diff -r 372f2766ea20 -r bf1778c34b9a wp/wp-content/plugins/option-tree/assets/js/ot-admin.js --- a/wp/wp-content/plugins/option-tree/assets/js/ot-admin.js Mon Oct 14 18:30:03 2019 +0200 +++ b/wp/wp-content/plugins/option-tree/assets/js/ot-admin.js Mon Oct 14 18:35:50 2019 +0200 @@ -1,6 +1,6 @@ /** * Option Tree UI - * + * * Dependencies: jQuery, jQuery UI, ColorPicker * * @author Derek Herman (derek@valendesigns.com) @@ -318,8 +318,8 @@ while( match = regex.exec( condition ) ) { conditions.push({ - 'check': match[1], - 'rule': match[2], + 'check': match[1], + 'rule': match[2], 'value': match[3] || '' }); } @@ -361,7 +361,7 @@ break; case 'contains': result = ( v1.indexOf(v2) !== -1 ? true : false ); - break; + break; case 'is': result = ( v1 == v2 ); break; @@ -383,7 +383,7 @@ passed = ( passed && result ); break; } - + }); if ( passed ) { @@ -391,7 +391,7 @@ } else { $(this).animate({opacity: 'hide' , height: 'hide'}, 200); } - + delete passed; }); @@ -618,8 +618,9 @@ dataType: 'json', data: { action: 'ot_google_font', - family: input.val(), - field_id: input.attr('id') + family: input.val(), + field_id: input.attr( 'id' ), + nonce: option_tree.nonce } }).done(function(response) { if ( response.hasOwnProperty('variants') ) { @@ -728,7 +729,7 @@ editor.setTheme("ace/theme/chrome"); editor.getSession().setMode("ace/mode/css"); editor.setShowPrintMargin( false ); - + editor.getSession().setValue(this_textarea.val()); editor.getSession().on('change', function(){ this_textarea.val(editor.getSession().getValue()); @@ -818,8 +819,9 @@ url: ajaxurl, dataType: 'html', data: { - action: 'gallery_update' - , ids: ids + action: 'gallery_update', + ids: ids, + nonce: option_tree.nonce }, success: function(res) { parent.children('.ot-gallery-list').html(res); @@ -860,50 +862,50 @@ if ( _.isUndefined( shortcode.get('ids') ) && ! input.hasClass('ot-gallery-shortcode') && ids ) shortcode.set( 'ids', ids ) - + if ( _.isUndefined( shortcode.get('ids') ) ) shortcode.set( 'ids', '0' ) - + attachments = wp.media.gallery.attachments( shortcode ) selection = new wp.media.model.Selection( attachments.models, { props: attachments.props.toJSON() , multiple: true }) - + selection.gallery = attachments.gallery - + // Fetch the query's attachments, and then break ties from the query to allow for sorting. selection.more().done( function () { selection.props.set({ query: false }) selection.unmirror() selection.props.unset('orderby') }) - + return selection - + } - + , open: function (elm) { - + ot_gallery.frame(elm).open() - + } - + , remove: function (elm) { - + if ( confirm( option_tree.confirm ) ) { - + $(elm).parents('.format-setting-inner').children('.ot-gallery-value').attr('value', ''); $(elm).parents('.format-setting-inner').children('.ot-gallery-list').remove(); $(elm).next('.ot-gallery-edit').text( option_tree.create ); $(elm).remove(); OT_UI.parse_condition(); - + } } - + } // Gallery delete @@ -911,13 +913,13 @@ e.preventDefault() ot_gallery.remove($(this)) }) - + // Gallery edit $(document).on('click.ot_gallery.data-api', '.ot-gallery-edit', function (e) { e.preventDefault() ot_gallery.open($(this)) }) - + }(window.jQuery); /*! @@ -925,43 +927,43 @@ */ !function ($) { - $(document).on('ready', function () { - + $( document ).ready( function() { + // Loop over the metaboxes $('.ot-metabox-wrapper').each( function() { - + // Only if there is a tab option if ( $(this).find('.type-tab').length ) { - + // Add .ot-metabox-panels $(this).find('.type-tab').parents('.ot-metabox-wrapper').wrapInner('
') - + // Wrapp with .ot-metabox-tabs & add .ot-metabox-nav before .ot-metabox-panels $(this).find('.ot-metabox-panels').wrap('').before(' ') - + // Loop over settings and build the tabs nav $(this).find('.format-settings').each( function() { - + if ( $(this).find('.type-tab').length > 0 ) { var title = $(this).find('.type-tab').prev().find('label').text() , id = $(this).attr('id') - - // Add a class, hide & append nav item + + // Add a class, hide & append nav item $(this).addClass('is-panel').hide() $(this).parents('.ot-metabox-panels').prev('.ot-metabox-nav').append('