# HG changeset patch # User Thierry Florac # Date 1611923213 -3600 # Node ID 84a34175f37cb446d6b7117db67681c02724d23b # Parent 97e0aed858835ed4e3992f6da477edd72de38cf3 Rebuild! diff -r 97e0aed85883 -r 84a34175f37c src/myams/resources/js/myams-require.js --- a/src/myams/resources/js/myams-require.js Fri Jan 29 13:26:38 2021 +0100 +++ b/src/myams/resources/js/myams-require.js Fri Jan 29 13:26:53 2021 +0100 @@ -319,12 +319,12 @@ * Get an object given by name */ MyAMS.getObject = function (objectName, context) { + if (typeof(objectName) !== 'string') { + return objectName; + } if (!objectName) { return undefined; } - if (typeof(objectName) !== 'string') { - return objectName; - } var namespaces = objectName.split("."); context = (context === undefined || context === null) ? window : context; for (var i = 0; i < namespaces.length; i++) { @@ -342,10 +342,11 @@ * Small piece of code by Jason Bunting */ MyAMS.getFunctionByName = function (functionName, context) { - if (functionName === undefined) { + if (typeof(functionName) === 'function') { + return functionName; + } + if (!functionName) { return undefined; - } else if (typeof(functionName) === 'function') { - return functionName; } var namespaces = functionName.split("."); var func = namespaces.pop(); diff -r 97e0aed85883 -r 84a34175f37c src/myams/resources/js/myams-require.min.js --- a/src/myams/resources/js/myams-require.min.js Fri Jan 29 13:26:38 2021 +0100 +++ b/src/myams/resources/js/myams-require.min.js Fri Jan 29 13:26:53 2021 +0100 @@ -1,1 +1,1 @@ -"use strict";!function(e,t){var n=t.console;String.prototype.startsWith=function(e){var t=this.length,n=e.length;return!(t0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var t=e('
').appendTo("body"),n=t.children(),r=n.innerWidth()-n.height(99).innerWidth();return t.remove(),r}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(t){var n=[];return this.each((function(){n.push(e(this).attr(t))})),n},style:function(e,t,n){if(void 0!==this.get(0)){var r=this.get(0).style;return void 0!==e?void 0!==t?(n=void 0!==n?n:"",r.setProperty(e,t,n),this):r.getPropertyValue(e):r}},removeClassPrefix:function(t){return this.each((function(n,r){var a=r.className.split(" ").map((function(e){return e.startsWith(t)?"":e}));r.className=e.trim(a.join(" "))})),this}}),void 0===t.MyAMS&&(t.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,formChangedCallback:null,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var r,a=t.MyAMS,o=a;a.baseURL=(r=e('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"),o.devmode=r.indexOf(".min.js")<0,o.devext=o.devmode?"":".min",r.substring(0,r.lastIndexOf("/")+1)),a.log=function(){n&&n.debug&&n.debug(this,arguments)},a.getQueryVar=function(e,t){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var n=new RegExp(".*?[&\\?]"+t+"=(.*?)&.*"),r=e.replace(n,"$1");return r!==e&&r},a.rgb2hex=function(t){return"#"+e.map(t.match(/\b(\d+)\b/g),(function(e){return("0"+parseInt(e).toString(16)).slice(-2)})).join("")},a.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},a.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))},a.getObject=function(e,t){if(e){if("string"!=typeof e)return e;var n=e.split(".");t=null==t?window:t;for(var r=0;r").attr("data-ams-id",n).text('@import "'+o.getSource(t)+'";'),r)var c=setInterval((function(){try{s[0].sheet.cssRules;clearInterval(c),r.call(window,!0,a)}catch(e){}}),10);s.appendTo(i)}else r&&r.call(window,!1,a)},a.initHandlers=function(t){e(t).on("click","[data-ams-click-handler]",(function(t){var n=e(this),r=n.data("ams-disabled-handlers");if(!0!==r&&"click"!==r&&"all"!==r){var a=n.data();if(a.amsClickHandler){!0!==a.amsStopPropagation&&!0!==a.amsClickStopPropagation||t.stopPropagation(),!0!==a.amsClickKeepDefault&&t.preventDefault();for(var i=a.amsClickHandler.split(/\s+/),s=0;s0?e.when.apply(e,o).then((function(){a()})):a()}}(jQuery,this); +"use strict";!function(e,t){var n=t.console;String.prototype.startsWith=function(e){var t=this.length,n=e.length;return!(t0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var t=e('
').appendTo("body"),n=t.children(),r=n.innerWidth()-n.height(99).innerWidth();return t.remove(),r}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(t){var n=[];return this.each((function(){n.push(e(this).attr(t))})),n},style:function(e,t,n){if(void 0!==this.get(0)){var r=this.get(0).style;return void 0!==e?void 0!==t?(n=void 0!==n?n:"",r.setProperty(e,t,n),this):r.getPropertyValue(e):r}},removeClassPrefix:function(t){return this.each((function(n,r){var a=r.className.split(" ").map((function(e){return e.startsWith(t)?"":e}));r.className=e.trim(a.join(" "))})),this}}),void 0===t.MyAMS&&(t.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,formChangedCallback:null,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var r,a=t.MyAMS,o=a;a.baseURL=(r=e('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"),o.devmode=r.indexOf(".min.js")<0,o.devext=o.devmode?"":".min",r.substring(0,r.lastIndexOf("/")+1)),a.log=function(){n&&n.debug&&n.debug(this,arguments)},a.getQueryVar=function(e,t){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var n=new RegExp(".*?[&\\?]"+t+"=(.*?)&.*"),r=e.replace(n,"$1");return r!==e&&r},a.rgb2hex=function(t){return"#"+e.map(t.match(/\b(\d+)\b/g),(function(e){return("0"+parseInt(e).toString(16)).slice(-2)})).join("")},a.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},a.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))},a.getObject=function(e,t){if("string"!=typeof e)return e;if(e){var n=e.split(".");t=null==t?window:t;for(var r=0;r").attr("data-ams-id",n).text('@import "'+o.getSource(t)+'";'),r)var c=setInterval((function(){try{s[0].sheet.cssRules;clearInterval(c),r.call(window,!0,a)}catch(e){}}),10);s.appendTo(i)}else r&&r.call(window,!1,a)},a.initHandlers=function(t){e(t).on("click","[data-ams-click-handler]",(function(t){var n=e(this),r=n.data("ams-disabled-handlers");if(!0!==r&&"click"!==r&&"all"!==r){var a=n.data();if(a.amsClickHandler){!0!==a.amsStopPropagation&&!0!==a.amsClickStopPropagation||t.stopPropagation(),!0!==a.amsClickKeepDefault&&t.preventDefault();for(var i=a.amsClickHandler.split(/\s+/),s=0;s0?e.when.apply(e,o).then((function(){a()})):a()}}(jQuery,this); diff -r 97e0aed85883 -r 84a34175f37c src/myams/resources/js/myams.js --- a/src/myams/resources/js/myams.js Fri Jan 29 13:26:38 2021 +0100 +++ b/src/myams/resources/js/myams.js Fri Jan 29 13:26:53 2021 +0100 @@ -319,12 +319,12 @@ * Get an object given by name */ MyAMS.getObject = function (objectName, context) { + if (typeof(objectName) !== 'string') { + return objectName; + } if (!objectName) { return undefined; } - if (typeof(objectName) !== 'string') { - return objectName; - } var namespaces = objectName.split("."); context = (context === undefined || context === null) ? window : context; for (var i = 0; i < namespaces.length; i++) { @@ -342,10 +342,11 @@ * Small piece of code by Jason Bunting */ MyAMS.getFunctionByName = function (functionName, context) { - if (functionName === undefined) { + if (typeof(functionName) === 'function') { + return functionName; + } + if (!functionName) { return undefined; - } else if (typeof(functionName) === 'function') { - return functionName; } var namespaces = functionName.split("."); var func = namespaces.pop(); diff -r 97e0aed85883 -r 84a34175f37c src/myams/resources/js/myams.min.js --- a/src/myams/resources/js/myams.min.js Fri Jan 29 13:26:38 2021 +0100 +++ b/src/myams/resources/js/myams.min.js Fri Jan 29 13:26:53 2021 +0100 @@ -1,1 +1,1 @@ -"use strict";!function(e,a){var t=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var a=e('
').appendTo("body"),t=a.children(),n=t.innerWidth()-t.height(99).innerWidth();return a.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(a){var t=[];return this.each((function(){t.push(e(this).attr(a))})),t},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(a){return this.each((function(t,n){var s=n.className.split(" ").map((function(e){return e.startsWith(a)?"":e}));n.className=e.trim(s.join(" "))})),this}}),void 0===a.MyAMS&&(a.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,formChangedCallback:null,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n,s=a.MyAMS,i=s;s.baseURL=(n=e('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"),i.devmode=n.indexOf(".min.js")<0,i.devext=i.devmode?"":".min",n.substring(0,n.lastIndexOf("/")+1)),s.log=function(){t&&t.debug&&t.debug(this,arguments)},s.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},s.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),(function(e){return("0"+parseInt(e).toString(16)).slice(-2)})).join("")},s.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},s.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(a){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)}))},s.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=null==a?window:a;for(var n=0;n").attr("data-ams-id",t).text('@import "'+i.getSource(a)+'";'),n)var c=setInterval((function(){try{o[0].sheet.cssRules;clearInterval(c),n.call(window,!0,s)}catch(e){}}),10);o.appendTo(r)}else n&&n.call(window,!1,s)},s.initHandlers=function(a){e(a).on("click","[data-ams-click-handler]",(function(a){var t=e(this),n=t.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var s=t.data();if(s.amsClickHandler){!0!==s.amsStopPropagation&&!0!==s.amsClickStopPropagation||a.stopPropagation(),!0!==s.amsClickKeepDefault&&a.preventDefault();for(var r=s.amsClickHandler.split(/\s+/),o=0;o127&&n<2048?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t191&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},function(e,a){var t=a.MyAMS;e.fn.extend({contextMenu:function(a){function n(t,n,s){var i=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>i&&r',openedSign:''},a),n=e(this);n.find("LI").each((function(){var a=e(this);if(a.find("UL").size()>0){a.find("A:first").append(""+t.closedSign+"");var n=a.find("A:first");"#"===n.attr("href")&&n.click((function(){return!1}))}})),n.find("LI.active").each((function(){var a=e(this).parents("UL"),n=a.parent("LI");a.slideDown(t.speed),n.find("b:first").html(t.openedSign),n.addClass("open")})),n.find("LI A").on("click",(function(){var a=e(this);if(!a.hasClass("active")){var s=a.attr("href").replace(/^#/,""),i=a.parent().find("UL");if(t.accordion){var r=a.parent().parents("UL"),o=n.find("UL:visible");o.each((function(a){var n=!0;if(r.each((function(e){if(r[e]===o[a])return n=!1,!1})),n&&i!==o[a]){var c=e(o[a]);!s&&c.hasClass("active")||c.slideUp(t.speed,(function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)}))}}))}var c=a.parent().find("UL:first");s||!c.is(":visible")||c.hasClass("active")?c.slideDown(t.speed,(function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)})):c.slideUp(t.speed,(function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)}))}}))}})}(jQuery,this),function(e,a){a.MyAMS.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}}}(jQuery,this),function(e,a){var t=a.MyAMS;t.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",t=this.getInternetExplorerVersion();t>-1&&(e=t>=8?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),a.alert&&a.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return a>-1&&(e=a>=9?0:1),e},copyToClipboard:function(n){function s(n){var s=!1;if(window.clipboardData&&window.clipboardData.setData)s=clipboardData.setData("Text",n);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var i=e("