# HG changeset patch # User Thierry Florac # Date 1579003899 -3600 # Node ID c390a4b8ca80e518540e09970a08c7eca5a3d7e6 # Parent 848894fde5fca237c348a381eba4a6d8b1400738 Updated AJAX error message handling diff -r 848894fde5fc -r c390a4b8ca80 src/ztfy/myams/resources/js/myams.js --- a/src/ztfy/myams/resources/js/myams.js Fri Jun 29 15:12:51 2018 +0200 +++ b/src/ztfy/myams/resources/js/myams.js Tue Jan 14 13:11:39 2020 +0100 @@ -833,7 +833,7 @@ ams.ajax.handleJSON(response.data); } else { var title = error || event.statusText || event.type; - var message = response.responseText; + var message = response.responseText || response.data; ams.skin.messageBox('error', { title: ams.i18n.ERROR_OCCURED, content: '

' + title + '

' + (message || '') + '

', diff -r 848894fde5fc -r c390a4b8ca80 src/ztfy/myams/resources/js/myams.min.js --- a/src/ztfy/myams/resources/js/myams.min.js Fri Jun 29 15:12:51 2018 +0200 +++ b/src/ztfy/myams/resources/js/myams.min.js Tue Jan 14 13:11:39 2020 +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},contextMenu:function(a){function t(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 l=e(o[a]);!s&&l.hasClass("active")||l.slideUp(t.speed,function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}var l=a.parent().find("UL:first");s||!l.is(":visible")||l.hasClass("active")?l.slideDown(t.speed,function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)}):l.slideUp(t.speed,function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}}),e.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t127&&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}},void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,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=a.MyAMS,s=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"]').attr("src");return s.devmode=a.indexOf(".min.js")<0,s.devext=s.devmode?"":".min",a.substring(0,a.lastIndexOf("/")+1)}(),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.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},n.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.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)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=void 0===a||null===a?window:a;for(var n=0;n").attr("data-ams-id",t).text('@import "'+s.getSource(a)+'";'),n)var l=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(l)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)},n.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}},n.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(i){function r(i){var r=!1;if(window.clipboardData&&window.clipboardData.setData)r=clipboardData.setData("Text",i);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var o=e("