File Editor
Directories:
.. (Back)
dev
libs
Files:
sinatra-admin.min.js
Create New File
Create
Edit File: sinatra-admin.min.js
!function($){"use strict";var SinatraAdmin={init:function(){$(document).ready(SinatraAdmin.ready),$(window).on("load",SinatraAdmin.load),SinatraAdmin.bindUIActions(),$(document).trigger("sinatraReady")},ready:function(){},load:function(){window.dispatchEvent(new Event("resize"))},resize:function(){},bindUIActions:function(){var $this,$wrap=$("#wpwrap");$("body");$wrap.on("click",".plugins .si-btn:not(.active)",(function(e){e.preventDefault(),$wrap.find(".plugins .si-btn.in-progress").length||($this=$(this),SinatraAdmin.pluginAction($this))})),$(document).on("wp-plugin-install-success",SinatraAdmin.pluginInstallSuccess),$(document).on("wp-plugin-install-error",SinatraAdmin.pluginInstallError)},pluginAction:function($button){if($button.addClass("in-progress").attr("disabled","disabled").html(sinatra_strings.texts[$button.data("action")+"-inprogress"]),"install"===$button.data("action"))wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(event),$(document).on("credential-modal-cancel",(function(){$button.removeAttr("disabled").removeClass("in-progress").html(sinatra_strings.texts.install),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")}))),wp.updates.installPlugin({slug:$button.data("plugin")});else{var data={_ajax_nonce:sinatra_strings.wpnonce,plugin:$button.data("plugin"),action:"sinatra-plugin-"+$button.data("action")};$.post(sinatra_strings.ajaxurl,data,(function(response){response.success?$button.data("redirect")?window.location.href=$button.data("redirect"):location.reload():$(".plugins .si-btn.in-progress").removeAttr("disabled").removeClass("in-progress primary").addClass("secondary").html(sinatra_strings.texts.retry)}))}},pluginInstallSuccess:function(event,response){event.preventDefault();var activatedSlug,$init=jQuery(event.target).data("init");activatedSlug=void 0===$init?response.slug:$init;var $button=$('.plugins a[data-plugin="'+activatedSlug+'"]');$button.data("action","activate"),SinatraAdmin.pluginAction($button)},pluginInstallError:function(event,response){event.preventDefault();var activatedSlug,$init=jQuery(event.target).data("init");activatedSlug=void 0===$init?response.slug:$init,$('.plugins a[data-plugin="'+activatedSlug+'"]').attr("disabled","disabled").removeClass("in-progress primary").addClass("secondary").html(wp.updates.l10n.installFailedShort)}};SinatraAdmin.init(),window.sinatraadmin=SinatraAdmin}(jQuery);
Save Changes
Rename File
Rename