"use strict";if(typeof jQuery==="undefined"){throw new Error("Alert requires jQuery")}$(function(){function t(){function t(){var t='<div id="global-alert" class="modal">'+'<div class="modal-dialog modal-sm" >'+'<div class="modal-content">'+'<div class="modal-header" style="background-color: #428bca;color:white">'+'<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>'+'<h5 class="modal-title" style="color:white"><i class="fa fa-exclamation-circle"></i>告警</h5>'+"</div>"+'<div class="modal-body small">'+'<p style = "font-size: 15px;margin: 5px 0;"></p>'+"</div>"+'<div class="modal-footer" >'+'<button type="button" class="btn btn-primary btn-ok" aria-hidden="true" data-dismiss="modal">确定</button>'+'<button id="btn-cancel" class="btn btn-default btn-cancel">取消</button>'+"</div>"+"</div>"+"</div>"+"</div>";$("body").append(t);$("#global-alert").css("z-index",10001)}function l(){$(window).resize(a);$("#global-alert button").click(e)}function e(){$("#global-alert").hide();$("#whole-page").hide()}function o(){var t='<div id="whole-page"></div>';$("body").append(t);var l={width:"100%",height:"100%","background-color":"black",position:"absolute",top:"0px",left:"0px",display:"none","z-index":3e3,opacity:.5};$(t).css(l)}function a(){var t=document.documentElement.clientHeight;var l=document.documentElement.clientWidth;var e=$("#global-alert .modal-body").outerHeight(true);if(e>300)$("#global-alert .modal-body").height(300);var o=$("#global-alert .modal-content").outerHeight(true);$("#global-alert .modal-content").css("top",(t-o)/2)}function n(t,l,o,n,i,d){$("#global-alert button").unbind();$("#global-alert button").click(e);if(l!==undefined&&typeof l==="function"){$("#global-alert .btn-ok").one("click",l)}if(n!==undefined&&typeof n==="function"){$("#global-alert .btn-cancel").one("click",n)}$("#global-alert p").text(t);if(i!=undefined){$("#global-alert .modal-title").text(i)}else $("#global-alert .modal-title").text("告警");if(o)$("#btn-cancel").show();else $("#btn-cancel").hide();$("#global-alert").show();$("#whole-page").show();a()}function i(t,l,e){n(t,l,true,e)}function d(){t();a();l();if($("#whole-page").length==0){o()}}d();window.alert=n}t()});