1 line
60 KiB
JavaScript
1 line
60 KiB
JavaScript
|
|
"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function jsPanelError(e){this.name="jsPanelError",this.message=e||"",this.stack=(new Error).stack}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.append=e.append||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){var n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}}),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t=(this.document||this.ownerDocument).querySelectorAll(e),n=void 0,o=this;do{for(n=t.length;--n>=0&&t.item(n)!==o;);}while(n<0&&(o=o.parentElement));return o}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var n=0;n<this.length;n++)e.call(t,this[n],n,this)}),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(void 0!==o&&null!==o){o=Object(o);for(var a=Object.keys(Object(o)),i=0,r=a.length;i<r;i++){var s=a[i],l=Object.getOwnPropertyDescriptor(o,s);void 0!==l&&l.enumerable&&(t[s]=o[s])}}}return t}}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return t<this.length?t|=0:t=this.length,this.substr(t-e.length,e.length)===e}),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(t||0,e.length)===e}),jsPanelError.prototype=Object.create(Error.prototype),jsPanelError.prototype.constructor=jsPanelError;var jsPanel={version:"4.0.0-beta.1.18",date:"2017-12-28 13:01",idCounter:0,ziBase:100,themes:["default","primary","info","success","warning","danger"],mdbthemes:["secondary","elegant","stylish","unique","special"],autopositionSpacing:4,isIE:navigator.appVersion.match(/Trident/),defaults:{boxShadow:3,container:document.body,contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},headerTitle:"jsPanel",headerControls:"all",iconfont:"jsglyph",maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:"center",resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:40,minHeight:40},theme:"default"},defaultSnapConfig:{sensitivity:70,trigger:"panel"},ajaxAlwaysCallbacks:[],extensions:{},ajax:function ajax(obj){var conf=obj.options.contentAjax,configDefaults={method:"GET",async:!0,user:"",pwd:"",done:function(){obj.content.innerHTML=this.responseText},autoresize:!0,autoreposition:!0},config=void 0;if("string"==typeof conf)config=Object.assign({},configDefaults,{url:encodeURI(conf),evalscripttags:!0});else{if("object"!==(void 0===conf?"undefined":_typeof(conf))||!conf.url)return console.info("XMLHttpRequest seems to miss the request url!"),obj;config=Object.assign({},configDefaults,conf),config.url=encodeURI(conf.url),!1===config.async&&(config.timeout=0,config.withCredentials&&(config.withCredentials=void 0),config.responseType&&(config.responseType=void 0))}var xhr=new XMLHttpRequest;return xhr.onreadystatechange=function(){if(4===xhr.readyState){if(200===xhr.status){if(config.done.call(xhr,obj),config.evalscripttags){var scripttags=xhr.responseText.match(/<script\b[^>]*>([\s\S]*?)<\/script>/gi);scripttags&&scripttags.forEach(function(tag){var js=tag.replace(/
|