%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/jugement/wp-content/plugins/jetpack/_inc/build/
Upload File :
Create Path :
Current File : /home/emergentqj/jugement/wp-content/plugins/jetpack/_inc/build/connect-button.min.js

/* Do not modify this file directly. It is compiled from other files. */
/* global jpConnect */
jQuery(document).ready(function(n){var e=n(".jp-connect-button"),t=n(".jp-connect-full__tos-blurb");e.click(function(e){e.preventDefault(),n("#jetpack-connection-cards").fadeOut(600),o.isRegistering||("original"===jpConnect.forceVariation?o.handleOriginalFlow():"in_place"===jpConnect.forceVariation?o.handleConnectInPlaceFlow():o.startConnectionFlow())});var a=n('<iframe class="jp-jetpack-connect__iframe" />'),o={isRegistering:!1,isPaidPlan:!1,startConnectionFlow:function(){n.ajax({url:"https://public-api.wordpress.com/wpcom/v2/abtest/jetpack_connect_in_place_v2",type:"GET",error:o.handleConnectionError,xhrFields:{withCredentials:!0},crossDomain:!0,success:function(n){n&&"in_place"===n.variation?o.handleConnectInPlaceFlow():o.handleOriginalFlow()}})},handleOriginalFlow:function(){window.location=e.attr("href")},handleConnectInPlaceFlow:function(){o.isRegistering=!0,t.hide(),e.hide(),o.triggerLoadingState();var a=jpConnect.apiBaseUrl+"/connection/register";window.Initial_State&&window.Initial_State.calypsoEnv&&(a=a+"?"+n.param({calypso_env:window.Initial_State.calypsoEnv})),n.ajax({url:a,type:"POST",data:{registration_nonce:jpConnect.registrationNonce,_wpnonce:jpConnect.apiNonce},error:o.handleConnectionError,success:o.handleConnectionSuccess})},triggerLoadingState:function(){var e=n("<span>").addClass("jp-connect-full__button-container-loading").text(jpConnect.buttonTextRegistering).appendTo(".jp-connect-full__button-container"),t=n("<div>").addClass("jp-spinner"),a=n("<div>").addClass("jp-spinner__outer").appendTo(t);n("<div>").addClass("jp-spinner__inner").appendTo(a),e.after(t)},handleConnectionSuccess:function(e){o.fetchPlanType(),window.addEventListener("message",o.receiveData),a.attr("src",e.authorizeUrl),a.on("load",function(){a.show(),n(".jp-connect-full__button-container").hide()}),a.hide(),n(".jp-connect-full__button-container").after(a)},fetchPlanType:function(){n.ajax({url:jpConnect.apiBaseUrl+"/site",type:"GET",data:{_wpnonce:jpConnect.apiSiteDataNonce},success:function(n){var e=JSON.parse(n.data);o.isPaidPlan=!e.plan.is_free}})},receiveData:function(n){n.origin===jpConnect.jetpackApiDomain&&n.source===a.get(0).contentWindow&&"close"===n.data&&(window.removeEventListener("message",this.receiveData),o.handleAuthorizationComplete())},handleAuthorizationComplete:function(){o.isRegistering=!1,o.isPaidPlan?window.location.assign(jpConnect.dashboardUrl):window.location.assign(jpConnect.plansPromptUrl),window.location.reload(!0)},handleConnectionError:function(n){o.isRegistering=!1,o.handleOriginalFlow()}}});

Zerion Mini Shell 1.0