src/pyams_skin/resources/js/myams-require.min.js
changeset 488 efdf19b8f453
child 489 63ea9a94bd47
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/myams-require.min.js	Wed Dec 12 21:16:29 2018 +0100
@@ -0,0 +1,1 @@
+"use strict";!function(s,e){var t=e.console;String.prototype.startsWith=function(t){var e=this.length,n=t.length;return!(e<n)&&this.substr(0,n)===t},String.prototype.endsWith=function(t){var e=this.length,n=t.length;return!(e<n)&&this.substr(e-n)===t},String.prototype.unserialize=function(t){for(var e=decodeURIComponent(this).split("&"),n={},r=0;r<e.length;r++){var i=e[r].split("=",2);n[i[0]]=i[1]}return n},Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var n=this.length;for((e=(e=Number(e)||0)<0?Math.ceil(e):Math.floor(e))<0&&(e+=n);e<n;e++)if(e in this&&this[e]===t)return e;return-1}),s.expr[":"].hasvalue=function(t,e,n){return""!==s(t).val()},s.expr[":"].econtains=function(t,e,n){return(t.textContent||t.innerText||s(t).text()||"").toLowerCase()===n[3].toLowerCase()},s.expr[":"].withtext=function(t,e,n){return(t.textContent||t.innerText||s(t).text()||"")===n[3]},s.expr[":"].parents=function(t,e,n){return 0<s(t).parents(n[3]).length},void 0===s.scrollbarWidth&&(s.scrollbarWidth=function(){var t=s('<div style="width: 50px; height: 50px; overflow: auto"><div/></div>').appendTo("body"),e=t.children(),n=e.innerWidth()-e.height(99).innerWidth();return t.remove(),n}),s.fn.extend({exists:function(){return 0<s(this).length},objectOrParentWithClass:function(t){return this.hasClass(t)?this:this.parents("."+t)},listattr:function(t){var e=[];return this.each(function(){e.push(s(this).attr(t))}),e},style:function(t,e,n){if(void 0!==this.get(0)){var r=this.get(0).style;return void 0!==t?void 0!==e?(n=void 0!==n?n:"",r.setProperty(t,e,n),this):r.getPropertyValue(t):r}},removeClassPrefix:function(r){return this.each(function(t,e){var n=e.className.split(" ").map(function(t){return t.startsWith(r)?"":t});e.className=s.trim(n.join(" "))}),this}}),void 0===e.MyAMS&&(e.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n,r=e.MyAMS,c=r;r.baseURL=(n=s('script[src*="/myams.js"], script[src*="/myams.min.js"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.min.js"]').attr("src"),c.devmode=n.indexOf(".min.js")<0,c.devext=c.devmode?"":".min",n.substring(0,n.lastIndexOf("/")+1)),r.log=function(){t&&t.debug&&t.debug(this,arguments)},r.getQueryVar=function(t,e){if(t.indexOf("?")<0)return!1;t.endsWith("&")||(t+="&");var n=new RegExp(".*?[&\\?]"+e+"=(.*?)&.*"),r=t.replace(n,"$1");return r!==t&&r},r.rgb2hex=function(t){return"#"+s.map(t.match(/\b(\d+)\b/g),function(t){return("0"+parseInt(t).toString(16)).slice(-2)}).join("")},r.generateId=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+t()+t()},r.generateUUID=function(){var n=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"===t?e:3&e|8).toString(16)})},r.getObject=function(t,e){if(t){if("string"!=typeof t)return t;var n=t.split(".");e=null==e?window:e;for(var r=0;r<n.length;r++)try{e=e[n[r]]}catch(t){return}return e}},r.getFunctionByName=function(t,e){if(void 0!==t){if("function"==typeof t)return t;var n=t.split("."),r=n.pop();e=null==e?window:e;for(var i=0;i<n.length;i++)try{e=e[n[i]]}catch(t){return}try{return e[r]}catch(t){return}}},r.executeFunctionByName=function(t,e){var n=c.getFunctionByName(t,window);if("function"==typeof n){var r=Array.prototype.slice.call(arguments,2);return n.apply(e,r)}},r.isInDOM=function(t){return!!(t=s(t)).exists()&&e.document.body.contains(t[0])},r.getSource=function(t){return t.replace(/{[^{}]*}/g,function(t){return c.getFunctionByName(t.substr(1,t.length-2))})},r.getScript=function(t,e,n,r){"object"==typeof e&&(r=n,n=e,e=null),void 0===n&&(n={});var i={dataType:"script",url:c.getSource(t),success:e,error:r||c.error.show,cache:!c.devmode,async:void 0===n.async?"function"==typeof e:n.async},o=s.extend({},i,n);return s.ajax(o)},r.getCSS=function(t,e,n,r){n&&(n=c.getFunctionByName(n));var i=s("HEAD"),o=s('style[data-ams-id="'+e+'"]',i);if(0===o.length){if(o=s("<style>").attr("data-ams-id",e).text('@import "'+c.getSource(t)+'";'),n)var a=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,r),clearInterval(a)}catch(t){}},10);o.appendTo(i)}else n&&n.call(window,!1,r)}}(jQuery,this),function(a,t){var s=t.MyAMS,c=[];s.require=function(t,e){for(var n=[],r=0;r<t.length;r++){var i=t[r];if(c.indexOf(i)<0){var o=s.baseURL+"myams-"+i+s.devext+".js";n.push(s.getScript(o,{async:!0},console.error)),c.push(i)}}0<n.length?a.when.apply(a,n).then(function(){e()}):e()}}(jQuery,this);