%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /backups/router/usr/local/opnsense/www/js/
Upload File :
Create Path :
Current File : //backups/router/usr/local/opnsense/www/js/bootstrap-dialog.min.js

(function(e,t){"use strict";if(typeof module!="undefined"&&module.exports){var n=typeof process!="undefined",s=n&&"electron"in process.versions;s?e.BootstrapDialog=t(e.jQuery):module.exports=t(require("jquery"),require("bootstrap"))}else typeof define=="function"&&define.amd?define("bootstrap-dialog",["jquery","bootstrap"],function(e){return t(e)}):e.BootstrapDialog=t(e.jQuery)})(this,function(e){"use strict";var t,s=e.fn.modal.Constructor,n=function(e,t){s.call(this,e,t)};return n.getModalVersion=function(){var t=null;return typeof e.fn.modal.Constructor.VERSION=="undefined"?t="v3.1":/3\.2\.\d+/.test(e.fn.modal.Constructor.VERSION)?t="v3.2":/3\.3\.[1,2]/.test(e.fn.modal.Constructor.VERSION)?t="v3.3":t="v3.3.4",t},n.ORIGINAL_BODY_PADDING=parseInt(e("body").css("padding-right")||0,10),n.METHODS_TO_OVERRIDE={},n.METHODS_TO_OVERRIDE["v3.1"]={},n.METHODS_TO_OVERRIDE["v3.2"]={hide:function(t){if(t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),!this.isShown||t.isDefaultPrevented())return;this.isShown=!1;var n=this.getGlobalOpenedDialogs();n.length===0&&this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}},n.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var e=n.ORIGINAL_BODY_PADDING;this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},resetScrollbar:function(){var e=this.getGlobalOpenedDialogs();e.length===0&&this.$body.css("padding-right",n.ORIGINAL_BODY_PADDING)},hideModal:function(){this.$element.hide(),this.backdrop(e.proxy(function(){var e=this.getGlobalOpenedDialogs();e.length===0&&this.$body.removeClass("modal-open"),this.resetAdjustments(),this.resetScrollbar(),this.$element.trigger("hidden.bs.modal")},this))}},n.METHODS_TO_OVERRIDE["v3.3.4"]=e.extend({},n.METHODS_TO_OVERRIDE["v3.3"]),n.prototype={constructor:n,getGlobalOpenedDialogs:function(){var n=[];return e.each(t.dialogs,function(e,t){t.isRealized()&&t.isOpened()&&n.push(t)}),n}},n.prototype=e.extend(n.prototype,s.prototype,n.METHODS_TO_OVERRIDE[n.getModalVersion()]),t=function(n){this.defaultOptions=e.extend(!0,{id:t.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},t.defaultOptions),this.indexedButtons={},this.registeredButtonHotkeys={},this.draggableData={isMouseDown:!1,mouseOffset:{}},this.realized=!1,this.opened=!1,this.initOptions(n),this.holdThisInstance()},t.BootstrapDialogModal=n,t.NAMESPACE="bootstrap-dialog",t.TYPE_DEFAULT="type-default",t.TYPE_INFO="type-info",t.TYPE_PRIMARY="type-primary",t.TYPE_SUCCESS="type-success",t.TYPE_WARNING="type-warning",t.TYPE_DANGER="type-danger",t.DEFAULT_TEXTS={},t.DEFAULT_TEXTS[t.TYPE_DEFAULT]="Information",t.DEFAULT_TEXTS[t.TYPE_INFO]="Information",t.DEFAULT_TEXTS[t.TYPE_PRIMARY]="Information",t.DEFAULT_TEXTS[t.TYPE_SUCCESS]="Success",t.DEFAULT_TEXTS[t.TYPE_WARNING]="Warning",t.DEFAULT_TEXTS[t.TYPE_DANGER]="Danger",t.DEFAULT_TEXTS.OK="OK",t.DEFAULT_TEXTS.CANCEL="Cancel",t.DEFAULT_TEXTS.CONFIRM="Confirmation",t.SIZE_NORMAL="size-normal",t.SIZE_SMALL="size-small",t.SIZE_WIDE="size-wide",t.SIZE_LARGE="size-large",t.BUTTON_SIZES={},t.BUTTON_SIZES[t.SIZE_NORMAL]="",t.BUTTON_SIZES[t.SIZE_SMALL]="",t.BUTTON_SIZES[t.SIZE_WIDE]="",t.BUTTON_SIZES[t.SIZE_LARGE]="btn-lg",t.ICON_SPINNER="glyphicon glyphicon-asterisk",t.defaultOptions={type:t.TYPE_PRIMARY,size:t.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:!0,closable:!0,closeByBackdrop:!0,closeByKeyboard:!0,spinicon:t.ICON_SPINNER,autodestroy:!0,draggable:!1,animate:!0,description:"",tabindex:-1},t.configDefaultOptions=function(n){t.defaultOptions=e.extend(!0,t.defaultOptions,n)},t.dialogs={},t.openAll=function(){e.each(t.dialogs,function(e,t){t.open()})},t.closeAll=function(){e.each(t.dialogs,function(e,t){t.close()})},t.getDialog=function(e){var n=null;return typeof t.dialogs[e]!="undefined"&&(n=t.dialogs[e]),n},t.setDialog=function(e){return t.dialogs[e.getId()]=e,e},t.addDialog=function(e){return t.setDialog(e)},t.moveFocus=function(){var n=null;e.each(t.dialogs,function(e,t){n=t}),n!==null&&n.isRealized()&&n.getModal().focus()},t.METHODS_TO_OVERRIDE={},t.METHODS_TO_OVERRIDE["v3.1"]={handleModalBackdropEvent:function(){return this.getModal().on("click",{dialog:this},function(e){e.target===this&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByBackdrop()&&e.data.dialog.close()}),this},updateZIndex:function(){var s,o,i=1040,a=1050,n=0;return e.each(t.dialogs,function(){n++}),s=this.getModal(),o=s.data("bs.modal").$backdrop,s.css("z-index",a+(n-1)*20),o.css("z-index",i+(n-1)*20),this},open:function(){return!this.isRealized()&&this.realize(),this.getModal().modal("show"),this.updateZIndex(),this}},t.METHODS_TO_OVERRIDE["v3.2"]={handleModalBackdropEvent:t.METHODS_TO_OVERRIDE["v3.1"].handleModalBackdropEvent,updateZIndex:t.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:t.METHODS_TO_OVERRIDE["v3.1"].open},t.METHODS_TO_OVERRIDE["v3.3"]={},t.METHODS_TO_OVERRIDE["v3.3.4"]=e.extend({},t.METHODS_TO_OVERRIDE["v3.1"]),t.prototype={constructor:t,initOptions:function(t){return this.options=e.extend(!0,this.defaultOptions,t),this},holdThisInstance:function(){return t.addDialog(this),this},initModalStuff:function(){return this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter()),this.getModal().append(this.getModalDialog()),this.getModalDialog().append(this.getModalContent()),this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter()),this},createModal:function(){var t=e('<div class="modal" role="dialog"></div>');return t.prop("id",this.getId()),t.attr("aria-labelledby",this.getId()+"_title"),t},getModal:function(){return this.$modal},setModal:function(e){return this.$modal=e,this},createModalDialog:function(){return e('<div class="modal-dialog"></div>')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(e){return this.$modalDialog=e,this},createModalContent:function(){return e('<div class="modal-content"></div>')},getModalContent:function(){return this.$modalContent},setModalContent:function(e){return this.$modalContent=e,this},createModalHeader:function(){return e('<div class="modal-header"></div>')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(e){return this.$modalHeader=e,this},createModalBody:function(){return e('<div class="modal-body"></div>')},getModalBody:function(){return this.$modalBody},setModalBody:function(e){return this.$modalBody=e,this},createModalFooter:function(){return e('<div class="modal-footer"></div>')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(e){return this.$modalFooter=e,this},createDynamicContent:function(e){var t=null;return typeof e=="function"?t=e.call(e,this):t=e,typeof t=="string"&&(t=this.formatStringContent(t)),t},formatStringContent:function(e){return this.options.nl2br?e.replace(/\r\n/g,"<br />").replace(/[\r\n]/g,"<br />"):e},setData:function(e,t){return this.options.data[e]=t,this},getData:function(e){return this.options.data[e]},setId:function(e){return this.options.id=e,this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(e){return this.options.type=e,this.updateType(),this},updateType:function(){if(this.isRealized()){var e=[t.TYPE_DEFAULT,t.TYPE_INFO,t.TYPE_PRIMARY,t.TYPE_SUCCESS,t.TYPE_WARNING,t.TYPE_DANGER];this.getModal().removeClass(e.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(e){return this.options.size=e,this.updateSize(),this},updateSize:function(){if(this.isRealized()){var n=this;this.getModal().removeClass(t.SIZE_NORMAL).removeClass(t.SIZE_SMALL).removeClass(t.SIZE_WIDE).removeClass(t.SIZE_LARGE),this.getModal().addClass(this.getSize()),this.getModalDialog().removeClass("modal-sm"),this.getSize()===t.SIZE_SMALL&&this.getModalDialog().addClass("modal-sm"),this.getModalDialog().removeClass("modal-lg"),this.getSize()===t.SIZE_WIDE&&this.getModalDialog().addClass("modal-lg"),e.each(this.options.buttons,function(t,s){var r,o=n.getButton(s.id),i=["btn-lg","btn-sm","btn-xs"],a=!1;typeof s.cssClass=="string"&&(r=s.cssClass.split(" "),e.each(r,function(t,n){e.inArray(n,i)!==-1&&(a=!0)})),a||(o.removeClass(i.join(" ")),o.addClass(n.getButtonSize()))})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(e){return this.options.cssClass=e,this},getTitle:function(){return this.options.title},setTitle:function(e){return this.options.title=e,this.updateTitle(),this},updateTitle:function(){if(this.isRealized()){var e=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(e).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(e){return this.options.message=e,this.updateMessage(),this},updateMessage:function(){if(this.isRealized()){var e=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(e)}return this},isClosable:function(){return this.options.closable},setClosable:function(e){return this.options.closable=e,this.updateClosable(),this},setCloseByBackdrop:function(e){return this.options.closeByBackdrop=e,this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(e){return this.options.closeByKeyboard=e,this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(e){return this.options.animate=e,this},updateAnimate:function(){return this.isRealized()&&this.getModal().toggleClass("fade",this.isAnimate()),this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(e){return this.options.spinicon=e,this},addButton:function(e){return this.options.buttons.push(e),this},addButtons:function(t){var n=this;return e.each(t,function(e,t){n.addButton(t)}),this},getButtons:function(){return this.options.buttons},setButtons:function(e){return this.options.buttons=e,this.updateButtons(),this},getButton:function(e){return typeof this.indexedButtons[e]!="undefined"?this.indexedButtons[e]:null},getButtonSize:function(){return typeof t.BUTTON_SIZES[this.getSize()]!="undefined"?t.BUTTON_SIZES[this.getSize()]:""},updateButtons:function(){return this.isRealized()&&(this.getButtons().length===0?this.getModalFooter().hide():this.getModalFooter().show().find("."+this.getNamespace("footer")).html("").append(this.createFooterButtons())),this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(e){this.options.autodestroy=e},getDescription:function(){return this.options.description},setDescription:function(e){return this.options.description=e,this},setTabindex:function(e){return this.options.tabindex=e,this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){return this.isRealized()&&this.getModal().attr("tabindex",this.getTabindex()),this},getDefaultText:function(){return t.DEFAULT_TEXTS[this.getType()]},getNamespace:function(e){return t.NAMESPACE+"-"+e},createHeaderContent:function(){var t=e("<div></div>");return t.addClass(this.getNamespace("header")),t.append(this.createTitleContent()),t.prepend(this.createCloseButton()),t},createTitleContent:function(){var t=e("<div></div>");return t.addClass(this.getNamespace("title")),t},createCloseButton:function(){var n,t=e("<div></div>");return t.addClass(this.getNamespace("close-button")),n=e('<button class="close">&times;</button>'),t.append(n),t.on("click",{dialog:this},function(e){e.data.dialog.close()}),t},createBodyContent:function(){var t=e("<div></div>");return t.addClass(this.getNamespace("body")),t.append(this.createMessageContent()),t},createMessageContent:function(){var t=e("<div></div>");return t.addClass(this.getNamespace("message")),t},createFooterContent:function(){var t=e("<div></div>");return t.addClass(this.getNamespace("footer")),t},createFooterButtons:function(){var s=this,n=e("<div></div>");return n.addClass(this.getNamespace("footer-buttons")),this.indexedButtons={},e.each(this.options.buttons,function(e,o){o.id||(o.id=t.newGuid());var i=s.createButton(o);s.indexedButtons[o.id]=i,n.append(i)}),n},createButton:function(t){var n=e('<button class="btn"></button>');return n.prop("id",t.id),n.data("button",t),typeof t.icon!="undefined"&&e.trim(t.icon)!==""&&n.append(this.createButtonIcon(t.icon)),typeof t.label!="undefined"&&n.append(t.label),typeof t.cssClass!="undefined"&&e.trim(t.cssClass)!==""?n.addClass(t.cssClass):n.addClass("btn-default"),typeof t.hotkey!="undefined"&&(this.registeredButtonHotkeys[t.hotkey]=n),n.on("click",{dialog:this,$button:n,button:t},function(e){var s=e.data.dialog,t=e.data.$button,n=t.data("button");typeof n.action=="function"&&n.action.call(t,s,e),n.autospin&&t.toggleSpin(!0)}),this.enhanceButton(n),typeof t.enabled!="undefined"&&n.toggleEnable(t.enabled),n},enhanceButton:function(e){return e.dialog=this,e.toggleEnable=function(e){var t=this;return typeof e!="undefined"?t.prop("disabled",!e).toggleClass("disabled",!e):t.prop("disabled",!t.prop("disabled")),t},e.enable=function(){var e=this;return e.toggleEnable(!0),e},e.disable=function(){var e=this;return e.toggleEnable(!1),e},e.toggleSpin=function(t){var n=this,s=n.dialog,o=n.find("."+s.getNamespace("button-icon"));return typeof t=="undefined"&&(t=!(e.find(".icon-spin").length>0)),t?(o.hide(),e.prepend(s.createButtonIcon(s.getSpinicon()).addClass("icon-spin"))):(o.show(),e.find(".icon-spin").remove()),n},e.spin=function(){var e=this;return e.toggleSpin(!0),e},e.stopSpin=function(){var e=this;return e.toggleSpin(!1),e},this},createButtonIcon:function(t){var n=e("<span></span>");return n.addClass(this.getNamespace("button-icon")).addClass(t),n},enableButtons:function(t){return e.each(this.indexedButtons,function(e,n){n.toggleEnable(t)}),this},updateClosable:function(){return this.isRealized()&&this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable()),this},onShow:function(e){return this.options.onshow=e,this},onShown:function(e){return this.options.onshown=e,this},onHide:function(e){return this.options.onhide=e,this},onHidden:function(e){return this.options.onhidden=e,this},isRealized:function(){return this.realized},setRealized:function(e){return this.realized=e,this},isOpened:function(){return this.opened},setOpened:function(e){return this.opened=e,this},handleModalEvents:function(){return this.getModal().on("show.bs.modal",{dialog:this},function(e){var n,t=e.data.dialog;if(t.setOpened(!0),t.isModalEvent(e)&&typeof t.options.onshow=="function")return n=t.options.onshow(t),n===!1&&t.setOpened(!1),n}),this.getModal().on("shown.bs.modal",{dialog:this},function(e){var t=e.data.dialog;t.isModalEvent(e)&&typeof t.options.onshown=="function"&&t.options.onshown(t)}),this.getModal().on("hide.bs.modal",{dialog:this},function(e){var n,t=e.data.dialog;if(t.setOpened(!1),t.isModalEvent(e)&&typeof t.options.onhide=="function")return n=t.options.onhide(t),n===!1&&t.setOpened(!0),n}),this.getModal().on("hidden.bs.modal",{dialog:this},function(n){var s=n.data.dialog;s.isModalEvent(n)&&typeof s.options.onhidden=="function"&&s.options.onhidden(s),s.isAutodestroy()&&(s.setRealized(!1),delete t.dialogs[s.getId()],e(this).remove()),t.moveFocus()}),this.handleModalBackdropEvent(),this.getModal().on("keyup",{dialog:this},function(e){e.which===27&&e.data.dialog.isClosable()&&e.data.dialog.canCloseByKeyboard()&&e.data.dialog.close()}),this.getModal().on("keyup",{dialog:this},function(t){var n,s=t.data.dialog;typeof s.registeredButtonHotkeys[t.which]!="undefined"&&(n=e(s.registeredButtonHotkeys[t.which]),!n.prop("disabled")&&n.focus().trigger("click"))}),this},handleModalBackdropEvent:function(){return this.getModal().on("click",{dialog:this},function(t){e(t.target).hasClass("modal-backdrop")&&t.data.dialog.isClosable()&&t.data.dialog.canCloseByBackdrop()&&t.data.dialog.close()}),this},isModalEvent:function(e){return typeof e.namespace!="undefined"&&e.namespace==="bs.modal"},makeModalDraggable:function(){return this.options.draggable&&(this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(e){var n,t=e.data.dialog;t.draggableData.isMouseDown=!0,n=t.getModalDialog().offset(),t.draggableData.mouseOffset={top:e.clientY-n.top,left:e.clientX-n.left}}),this.getModal().on("mouseup mouseleave",{dialog:this},function(e){e.data.dialog.draggableData.isMouseDown=!1}),e("body").on("mousemove",{dialog:this},function(e){var t=e.data.dialog;if(!t.draggableData.isMouseDown)return;t.getModalDialog().offset({top:e.clientY-t.draggableData.mouseOffset.top,left:e.clientX-t.draggableData.mouseOffset.left})})),this},realize:function(){return this.initModalStuff(),this.getModal().addClass(t.NAMESPACE).addClass(this.getCssClass()),this.updateSize(),this.getDescription()&&this.getModal().attr("aria-describedby",this.getDescription()),this.getModalFooter().append(this.createFooterContent()),this.getModalHeader().append(this.createHeaderContent()),this.getModalBody().append(this.createBodyContent()),this.getModal().data("bs.modal",new n(this.getModal(),{backdrop:"static",keyboard:!1,show:!1})),this.makeModalDraggable(),this.handleModalEvents(),this.setRealized(!0),this.updateButtons(),this.updateType(),this.updateTitle(),this.updateMessage(),this.updateClosable(),this.updateAnimate(),this.updateSize(),this.updateTabindex(),this},open:function(){return!this.isRealized()&&this.realize(),this.getModal().modal("show"),this},close:function(){return!this.isRealized()&&this.realize(),this.getModal().modal("hide"),this}},t.prototype=e.extend(t.prototype,t.METHODS_TO_OVERRIDE[n.getModalVersion()]),t.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e==="x"?t:t&3|8;return n.toString(16)})},t.show=function(e){return new t(e).open()},t.alert=function(){var n={},s={type:t.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,buttonLabel:t.DEFAULT_TEXTS.OK,callback:null};return typeof arguments[0]=="object"&&arguments[0].constructor==={}.constructor?n=e.extend(!0,s,arguments[0]):n=e.extend(!0,s,{message:arguments[0],callback:typeof arguments[1]!="undefined"?arguments[1]:null}),new t({type:n.type,title:n.title,message:n.message,closable:n.closable,draggable:n.draggable,data:{callback:n.callback},onhide:function(e){!e.getData("btnClicked")&&e.isClosable()&&typeof e.getData("callback")=="function"&&e.getData("callback")(!1)},buttons:[{label:n.buttonLabel,action:function(e){e.setData("btnClicked",!0),typeof e.getData("callback")=="function"&&e.getData("callback")(!0),e.close()}}]}).open()},t.confirm=function(){var n={},s={type:t.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,btnCancelLabel:t.DEFAULT_TEXTS.CANCEL,btnOKLabel:t.DEFAULT_TEXTS.OK,btnOKClass:null,callback:null};return typeof arguments[0]=="object"&&arguments[0].constructor==={}.constructor?n=e.extend(!0,s,arguments[0]):n=e.extend(!0,s,{message:arguments[0],closable:!1,buttonLabel:t.DEFAULT_TEXTS.OK,callback:typeof arguments[1]!="undefined"?arguments[1]:null}),n.btnOKClass===null&&(n.btnOKClass=["btn",n.type.split("-")[1]].join("-")),new t({type:n.type,title:n.title,message:n.message,closable:n.closable,draggable:n.draggable,data:{callback:n.callback},buttons:[{label:n.btnCancelLabel,action:function(e){typeof e.getData("callback")=="function"&&e.getData("callback")(!1),e.close()}},{label:n.btnOKLabel,cssClass:n.btnOKClass,action:function(e){typeof e.getData("callback")=="function"&&e.getData("callback")(!0),e.close()}}]}).open()},t.warning=function(e){return new t({type:t.TYPE_WARNING,message:e}).open()},t.danger=function(e){return new t({type:t.TYPE_DANGER,message:e}).open()},t.success=function(e){return new t({type:t.TYPE_SUCCESS,message:e}).open()},t})

Zerion Mini Shell 1.0