# HG changeset patch # User Thierry Florac # Date 1551446743 -3600 # Node ID c08b8f12dab52a38385f74b1d94ce1760287d46d # Parent 8b49d8f78ac2744a99ee71837d1a33589664537e Use timeout instead of interval in action progress callback diff -r 8b49d8f78ac2 -r c08b8f12dab5 src/pyams_skin/resources/js/myams-form.js --- a/src/pyams_skin/resources/js/myams-form.js Thu Feb 14 17:38:29 2019 +0100 +++ b/src/pyams_skin/resources/js/myams-form.js Fri Mar 01 14:25:43 2019 +0100 @@ -195,10 +195,10 @@ // Inner progress status handler function _getProgress(handler, progress_id) { - var interval; + var timeout; function _clearProgressStatus() { - clearInterval(interval); + clearTimeout(timeout); ams.form.resetAfterSubmit(form, button); button.html(button.data('ams-progress-content')); ams.executeFunctionByName(progressEndCallback, form, button); @@ -223,6 +223,7 @@ } button.text(text); } + timeout = setTimeout(_getProgressStatus, progressInterval); } else if (result.status === 'finished') { _clearProgressStatus(); } @@ -233,7 +234,7 @@ } button.button('loading'); - interval = setInterval(_getProgressStatus, progressInterval); + timeout = setTimeout(_getProgressStatus, progressInterval); } // Initialize form data diff -r 8b49d8f78ac2 -r c08b8f12dab5 src/pyams_skin/resources/js/myams-form.min.js --- a/src/pyams_skin/resources/js/myams-form.min.js Thu Feb 14 17:38:29 2019 +0100 +++ b/src/pyams_skin/resources/js/myams-form.min.js Fri Mar 01 14:25:43 2019 +0100 @@ -1,1 +1,1 @@ -!function(O,E){var A=E.MyAMS;A.form={init:function(a){O("FORM",a).each(function(){var a=O(this);O('INPUT.select2[type="hidden"]',a).each(function(){var a=O(this);a.data("ams-select2-input-value",a.val())})}),(A.warnOnFormChange?O('FORM[data-ams-warn-on-change!="false"]',a):O('FORM[data-ams-warn-on-change="true"]',a)).each(function(){var a=O(this);O('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',a).each(function(){var a=O(this);if(!0!==a.data("ams-ignore-change")){var e=a.data("ams-changed-event")||"change";a.on(e,function(){A.form.setChanged(O(this).parents("FORM"))})}}),a.on("reset",function(){A.form.resetChanged(O(this))})})},setFocus:function(a){var e=O("[data-ams-focus-target]",a).first();e.exists()||(e=O("input, select",a).first()),e.exists()&&(e.hasClass("select2-input")&&(e=e.parents(".select2")),e.hasClass("select2")?setTimeout(function(){e.select2("focus"),!0===e.data("ams-focus-open")&&e.select2("open")},100):e.focus())},checkBeforeUnload:function(){if(O('FORM[data-ams-form-changed="true"]').exists())return A.i18n.FORM_CHANGED_WARNING},confirmChangedForm:function(e,t,a){"function"==typeof e&&(t=e,e=void 0),O('FORM[data-ams-form-changed="true"]',e).exists()?a?E.confirm(A.i18n.FORM_CHANGED_WARNING,A.i18n.WARNING)?t.call(e):a.call(e):A.skin&&A.skin.bigBox({title:A.i18n.WARNING,content:'  '+A.i18n.FORM_CHANGED_WARNING,buttons:A.i18n.BTN_OK_CANCEL},function(a){a===A.i18n.BTN_OK&&t.call(e)}):t.call(e)},setChanged:function(a){a.attr("data-ams-form-changed",!0)},resetChanged:function(a){void 0!==a&&O(a).removeAttr("data-ams-form-changed")},submit:function(t,k,N){if(!(t=O(t)).exists())return!1;if("object"==typeof k&&(N=k,k=void 0),t.data("submitted"))return t.data("ams-form-hide-submitted")||A.skin&&A.skin.messageBox("warning",{title:A.i18n.WAIT,content:A.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:t.data("ams-form-alert-timeout")||5e3}),!1;if(A.form&&!A.form._checkSubmitValidators(t))return!1;O(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),O(".state-error",t).removeClassPrefix("state-");var a=O(t.data("ams-submit-button"));return a&&!a.data("ams-form-hide-loading")&&(a.data("ams-progress-content",a.html()),a.button("loading")),A.ajax&&A.ajax.check(O.fn.ajaxSubmit,A.baseURL+"ext/jquery-form-3.49"+A.devext+".js",function(){function a(s,a){var i,e,t,r,n,o,m,l,u,c,f=s.data(),d=f.amsFormOptions;if(N&&(n=N.formDataInitCallback),n?delete N.formDataInitCallback:n=f.amsFormDataInitCallback,n){var g={};if(r=A.executeFunctionByName(n,s,g),g.veto)return(i=s.data("ams-submit-button"))&&i.button("reset"),A.form.finalizeSubmitFooter.call(s),!1}else r=f.amsFormData||{};(i=O(s.data("ams-submit-button")))&&i.exists()?t=(e=i.data()).amsFormSubmitTarget:e={};var b=k||e.amsFormHandler||f.amsFormHandler||"";if(b.startsWith(window.location.protocol))c=b;else{var h=e.amsFormAction||s.attr("action").replace(/#/,"");c=h.startsWith(window.location.protocol)?h:A.ajax&&A.ajax.getAddr()+h,c+=b}o=e.amsProgressHandler||f.amsProgressHandler||"",m=e.amsProgressInterval||f.amsProgressInterval||1e3,l=e.amsProgressCallback||f.amsProgressCallback,u=e.amsProgressEndCallback||f.amsProgressEndCallback;var v,p=null;N&&N.initSubmitTarget?A.executeFunctionByName(N.initSubmitTarget,s):f.amsFormInitSubmitTarget?(p=O(t||f.amsFormSubmitTarget||"#content"),A.executeFunctionByName(f.amsFormInitSubmit||"MyAMS.form.initSubmit",s,p)):f.amsFormHideSubmitFooter||A.executeFunctionByName(f.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",s),N&&(r=O.extend({},r,N.form_data)),o?r.progress_id=A.generateUUID():(v=void 0!==a.uuid)&&(c.indexOf("X-Progress-ID")<0&&(c+="?X-Progress-ID="+a.uuid),delete a.uuid);var x={url:c,type:"post",cache:!1,data:r,dataType:f.amsFormDatatype,beforeSerialize:function(){void 0!==E.tinyMCE&&E.tinyMCE.triggerSave()},beforeSubmit:function(a,e){e.data("submitted",!0)},error:function(a,e,t,r){p&&A.executeFunctionByName(f.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",r,p),A.form.resetAfterSubmit(r)},iframe:v},C=N&&N.downloadTarget||f.amsFormDownloadTarget;if(C){var S=O('iframe[name="'+C+'"]');S.exists()||(S=O("").hide().attr("name",C).appendTo(O("body"))),x=O.extend({},x,{iframe:!0,iframeTarget:S,success:function(a,e,t,r){if(O(r).parents(".modal-dialog").exists())A.dialog&&A.dialog.close(r);else{var s,i=r.data("ams-submit-button");i&&(s=i.data("ams-form-submit-callback")),s||(s=A.getFunctionByName(f.amsFormSubmitCallback)||A.form._submitCallback);try{s.call(r,a,e,t,r)}finally{A.form.resetAfterSubmit(r),A.form.resetChanged(r)}}}})}else x=O.extend({},x,{error:function(a,e,t,r){p&&A.executeFunctionByName(f.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",r,p),A.form.resetAfterSubmit(r)},success:function(a,e,t,r){var s,i=r.data("ams-submit-button");i&&(s=i.data("ams-form-submit-callback")),s||(s=A.getFunctionByName(f.amsFormSubmitCallback)||A.form._submitCallback);try{s.call(r,a,e,t,r)}finally{A.form.resetAfterSubmit(r),A.form.resetChanged(r)}},iframe:v});var F=O.extend({},x,a,d,N);if(o&&function(a,e){var t;function r(){clearInterval(t),A.form.resetAfterSubmit(s,i),i.html(i.data("ams-progress-content")),A.executeFunctionByName(u,s,i),A.form.resetChanged(s)}i.button("loading"),t=setInterval(function(){A.ajax&&A.ajax.post(a,{progress_id:e},{error:r},A.getFunctionByName(l)||function(a,e){if("success"===e)if("running"===a.status)if(a.message)i.text(a.message);else{var t=i.data("ams-progress-text")||A.i18n.PROGRESS;a.current?t+=": "+a.current+"/ "+(a.length||100):t+="...",i.text(t)}else"finished"===a.status&&r();else r()})},m)}(o,r.progress_id),O(s).ajaxSubmit(F),C){var R=O(s).parents(".modal-dialog"),y=R.exists()&&i.exists()&&i.data("ams-keep-modal");R.exists()&&!0!==y?A.dialog&&A.dialog.close(s):o||setTimeout(function(){A.form.resetAfterSubmit(s,i),A.form.resetChanged(s)},i.data("ams-form-reset-timeout")||2e3)}}if(!0!==t.data("ams-form-ignore-uploads")&&0';e||(e=t.data("ams-form-submit-message")),e&&(r+=""+e+""),O(a).html('
'+r+"
"),O(a).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(a){if(a.is(":visible")){var e=a.data("ams-submit-button");e&&e.button("reset"),A.form.finalizeSubmitFooter.call(a)}a.data("submitted",!1),a.removeData("ams-submit-button")},finalizeSubmitOnError:function(a){O("i",a).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(a){var e=O(this),t='';a||(a=O(this).data("ams-form-submit-message")),a&&(t+=''+a+"");var r=O("footer",e);O("button",r).hide(),r.append('
'+t+"
")},finalizeSubmitFooter:function(){var a=O(this),e=O("footer",a);e&&(O(".row",e).remove(),O("button",e).show())},_submitCallback:function(a,e,t,r){var s;r.is(":visible")&&(A.form.finalizeSubmitFooter.call(r),(s=r.data("ams-submit-button"))&&s.button("reset"));var i,n,o=r.data();if(o.amsFormDatatype)i=o.amsFormDatatype;else{var m=A.ajax&&A.ajax.getResponse(t);m&&(i=m.contentType,a=m.data)}switch(n=O(s?s.data("ams-form-submit-target")||o.amsFormSubmitTarget||"#content":o.amsFormSubmitTarget||"#content"),i){case"json":A.ajax&&A.ajax.handleJSON(a,r,n);break;case"script":case"xml":break;case"html":case"text":default:A.form.resetChanged(r),s&&!0!==s.data("ams-keep-modal")&&A.dialog&&A.dialog.close(r),n.exists()||(n=O("body")),n.parents(".hidden").removeClass("hidden"),O(".alert",n.parents(".alerts-container")).remove(),n.css({opacity:"0.0"}).html(a).delay(50).animate({opacity:"1.0"},300),A.initContent&&A.initContent(n),A.form.setFocus(n)}var l=t.getResponseHeader("X-AMS-Callback");if(l){var u=t.getResponseHeader("X-AMS-Callback-Options");A.executeFunctionByName(l,r,void 0===u?{}:JSON.parse(u),t)}},_getSubmitValidators:function(a){var e=[],t=a.data("ams-form-validator");return t&&e.push([a,t]),O("[data-ams-form-validator]",a).each(function(){var a=O(this);e.push([a,a.data("ams-form-validator")])}),e},_checkSubmitValidators:function(a){var e=A.form._getSubmitValidators(a);if(!e.length)return!0;for(var t=[],r=!0,s=0;s"+i.header+"
"+i.message):s.push(i.message||i)}if(e.widgets)for(r=0;r'+n.message+""):n.label&&s.push(n.label+" : "+n.message);var m=o.parents(".tab-pane").index()+1;if(0  '+t.i18n.FORM_CHANGED_WARNING,buttons:t.i18n.BTN_OK_CANCEL},function(e){e===t.i18n.BTN_OK&&s.call(r)}):s.call(r)},setChanged:function(e){e.attr("data-ams-form-changed",!0)},resetChanged:function(a){void 0!==a&&e(a).removeAttr("data-ams-form-changed")},submit:function(r,s,i){if(!(r=e(r)).exists())return!1;if("object"==typeof s&&(i=s,s=void 0),r.data("submitted"))return r.data("ams-form-hide-submitted")||t.skin&&t.skin.messageBox("warning",{title:t.i18n.WAIT,content:t.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:r.data("ams-form-alert-timeout")||5e3}),!1;if(t.form&&!t.form._checkSubmitValidators(r))return!1;e(".alert-danger, SPAN.state-error",r).not(".persistent").remove(),e(".state-error",r).removeClassPrefix("state-");var n=e(r.data("ams-submit-button"));return n&&!n.data("ams-form-hide-loading")&&(n.data("ams-progress-content",n.html()),n.button("loading")),t.ajax&&t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js",function(){function n(r,n){var o,m,l,u,c,f,d,g,b,h=r.data(),v=h.amsFormOptions;if(i&&(c=i.formDataInitCallback),c?delete i.formDataInitCallback:c=h.amsFormDataInitCallback,c){var p={};if(u=t.executeFunctionByName(c,r,p),p.veto)return(o=r.data("ams-submit-button"))&&o.button("reset"),t.form.finalizeSubmitFooter.call(r),!1}else u=h.amsFormData||{};(o=e(r.data("ams-submit-button")))&&o.exists()?l=(m=o.data()).amsFormSubmitTarget:m={};var x,C=s||m.amsFormHandler||h.amsFormHandler||"";if(C.startsWith(window.location.protocol))x=C;else{var S=m.amsFormAction||r.attr("action").replace(/#/,"");x=S.startsWith(window.location.protocol)?S:t.ajax&&t.ajax.getAddr()+S,x+=C}f=m.amsProgressHandler||h.amsProgressHandler||"",d=m.amsProgressInterval||h.amsProgressInterval||1e3,g=m.amsProgressCallback||h.amsProgressCallback,b=m.amsProgressEndCallback||h.amsProgressEndCallback;var F=null;i&&i.initSubmitTarget?t.executeFunctionByName(i.initSubmitTarget,r):h.amsFormInitSubmitTarget?(F=e(l||h.amsFormSubmitTarget||"#content"),t.executeFunctionByName(h.amsFormInitSubmit||"MyAMS.form.initSubmit",r,F)):h.amsFormHideSubmitFooter||t.executeFunctionByName(h.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",r),i&&(u=e.extend({},u,i.form_data));var R;f?u.progress_id=t.generateUUID():(R=void 0!==n.uuid)&&(x.indexOf("X-Progress-ID")<0&&(x+="?X-Progress-ID="+n.uuid),delete n.uuid);var y={url:x,type:"post",cache:!1,data:u,dataType:h.amsFormDatatype,beforeSerialize:function(){void 0!==a.tinyMCE&&a.tinyMCE.triggerSave()},beforeSubmit:function(e,a){a.data("submitted",!0)},error:function(e,a,r,s){F&&t.executeFunctionByName(h.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,F),t.form.resetAfterSubmit(s)},iframe:R},k=i&&i.downloadTarget||h.amsFormDownloadTarget;if(k){var N=e('iframe[name="'+k+'"]');N.exists()||(N=e("").hide().attr("name",k).appendTo(e("body"))),y=e.extend({},y,{iframe:!0,iframeTarget:N,success:function(a,r,s,i){if(e(i).parents(".modal-dialog").exists())t.dialog&&t.dialog.close(i);else{var n,o=i.data("ams-submit-button");o&&(n=o.data("ams-form-submit-callback")),n||(n=t.getFunctionByName(h.amsFormSubmitCallback)||t.form._submitCallback);try{n.call(i,a,r,s,i)}finally{t.form.resetAfterSubmit(i),t.form.resetChanged(i)}}}})}else y=e.extend({},y,{error:function(e,a,r,s){F&&t.executeFunctionByName(h.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",s,F),t.form.resetAfterSubmit(s)},success:function(e,a,r,s){var i,n=s.data("ams-submit-button");n&&(i=n.data("ams-form-submit-callback")),i||(i=t.getFunctionByName(h.amsFormSubmitCallback)||t.form._submitCallback);try{i.call(s,e,a,r,s)}finally{t.form.resetAfterSubmit(s),t.form.resetChanged(s)}},iframe:R});var O=e.extend({},y,n,v,i);if(f&&function(e,a){function s(){clearTimeout(n),t.form.resetAfterSubmit(r,o),o.html(o.data("ams-progress-content")),t.executeFunctionByName(b,r,o),t.form.resetChanged(r)}function i(){t.ajax&&t.ajax.post(e,{progress_id:a},{error:s},t.getFunctionByName(g)||function(e,a){if("success"===a)if("running"===e.status){if(e.message)o.text(e.message);else{var r=o.data("ams-progress-text")||t.i18n.PROGRESS;e.current?r+=": "+e.current+"/ "+(e.length||100):r+="...",o.text(r)}n=setTimeout(i,d)}else"finished"===e.status&&s();else s()})}var n;o.button("loading"),n=setTimeout(i,d)}(f,u.progress_id),e(r).ajaxSubmit(O),k){var E=e(r).parents(".modal-dialog"),A=E.exists()&&o.exists()&&o.data("ams-keep-modal");E.exists()&&!0!==A?t.dialog&&t.dialog.close(r):f||setTimeout(function(){t.form.resetAfterSubmit(r,o),t.form.resetChanged(r)},o.data("ams-form-reset-timeout")||2e3)}}if(!0!==r.data("ams-form-ignore-uploads")&&e('INPUT[type="file"]',r).length>0){t.ajax&&t.ajax.check(e.progressBar,t.baseURL+"ext/jquery-progressbar"+t.devext+".js");var o=e.extend({},{uuid:e.progressBar.submit(r)});n(r,o)}else n(r,{})}),!1},initSubmit:function(a,t){var r=e(this),s='';t||(t=r.data("ams-form-submit-message")),t&&(s+=""+t+""),e(a).html('
'+s+"
"),e(a).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(e){if(e.is(":visible")){var a=e.data("ams-submit-button");a&&a.button("reset"),t.form.finalizeSubmitFooter.call(e)}e.data("submitted",!1),e.removeData("ams-submit-button")},finalizeSubmitOnError:function(a){e("i",a).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(a){var t=e(this),r='';a||(a=e(this).data("ams-form-submit-message")),a&&(r+=''+a+"");var s=e("footer",t);e("button",s).hide(),s.append('
'+r+"
")},finalizeSubmitFooter:function(){var a=e(this),t=e("footer",a);t&&(e(".row",t).remove(),e("button",t).show())},_submitCallback:function(a,r,s,i){var n;i.is(":visible")&&(t.form.finalizeSubmitFooter.call(i),(n=i.data("ams-submit-button"))&&n.button("reset"));var o,m=i.data();if(m.amsFormDatatype)o=m.amsFormDatatype;else{var l=t.ajax&&t.ajax.getResponse(s);l&&(o=l.contentType,a=l.data)}var u;switch(u=e(n?n.data("ams-form-submit-target")||m.amsFormSubmitTarget||"#content":m.amsFormSubmitTarget||"#content"),o){case"json":t.ajax&&t.ajax.handleJSON(a,i,u);break;case"script":case"xml":break;case"html":case"text":default:t.form.resetChanged(i),n&&!0!==n.data("ams-keep-modal")&&t.dialog&&t.dialog.close(i),u.exists()||(u=e("body")),u.parents(".hidden").removeClass("hidden"),e(".alert",u.parents(".alerts-container")).remove(),u.css({opacity:"0.0"}).html(a).delay(50).animate({opacity:"1.0"},300),t.initContent&&t.initContent(u),t.form.setFocus(u)}var c=s.getResponseHeader("X-AMS-Callback");if(c){var f=s.getResponseHeader("X-AMS-Callback-Options");t.executeFunctionByName(c,i,void 0===f?{}:JSON.parse(f),s)}},_getSubmitValidators:function(a){var t=[],r=a.data("ams-form-validator");return r&&t.push([a,r]),e("[data-ams-form-validator]",a).each(function(){var a=e(this);t.push([a,a.data("ams-form-validator")])}),t},_checkSubmitValidators:function(e){var a=t.form._getSubmitValidators(e);if(!a.length)return!0;for(var r=[],s=!0,i=0;i0&&(r=r.concat(s))}if(r.length>0){var u=1===r.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED;return t.skin&&t.skin.alert(e,"danger",u,r),!1}return s},showErrors:function(a,r){var s;if("string"==typeof r)t.skin&&t.skin.alert(a,"error",t.i18n.ERROR_OCCURED,r);else if(r instanceof Array)s=1===r.length?t.i18n.ERROR_OCCURED:t.i18n.ERRORS_OCCURED,t.skin&&t.skin.alert(a,"error",s,r);else{e(".state-error",a).removeClass("state-error"),s=r.error_header||(r.widgets&&r.widgets.length>1?t.i18n.ERRORS_OCCURED:t.i18n.ERROR_OCCURED);var i,n=[];if(r.messages)for(i=0;i"+o.header+"
"+o.message):n.push(o.message||o)}if(r.widgets)for(i=0;i'+m.message+""):m.label&&n.push(m.label+" : "+m.message);var u=l.parents(".tab-pane").index()+1;if(u>0){var c=e(".nav-tabs",e(l).parents(".tabforms"));e("li:nth-child("+u+")",c).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",a).click()}}t.skin&&t.skin.alert(e(".form-group:first",a),r.error_level||"error",s,n,r.error_message)}}}}(jQuery,this); diff -r 8b49d8f78ac2 -r c08b8f12dab5 src/pyams_skin/resources/js/myams.js --- a/src/pyams_skin/resources/js/myams.js Thu Feb 14 17:38:29 2019 +0100 +++ b/src/pyams_skin/resources/js/myams.js Fri Mar 01 14:25:43 2019 +0100 @@ -1846,10 +1846,10 @@ // Inner progress status handler function _getProgress(handler, progress_id) { - var interval; + var timeout; function _clearProgressStatus() { - clearInterval(interval); + clearTimeout(timeout); ams.form.resetAfterSubmit(form, button); button.html(button.data('ams-progress-content')); ams.executeFunctionByName(progressEndCallback, form, button); @@ -1874,6 +1874,7 @@ } button.text(text); } + timeout = setTimeout(_getProgressStatus, progressInterval); } else if (result.status === 'finished') { _clearProgressStatus(); } @@ -1884,7 +1885,7 @@ } button.button('loading'); - interval = setInterval(_getProgressStatus, progressInterval); + timeout = setTimeout(_getProgressStatus, progressInterval); } // Initialize form data diff -r 8b49d8f78ac2 -r c08b8f12dab5 src/pyams_skin/resources/js/myams.min.js --- a/src/pyams_skin/resources/js/myams.min.js Thu Feb 14 17:38:29 2019 +0100 +++ b/src/pyams_skin/resources/js/myams.min.js Fri Mar 01 14:25:43 2019 +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,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"], script[src*="/myams-core.js"], script[src*="/myams-core.min.js"], script[src*="/myams-require.js"], script[src*="/myams-require.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 c=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)}}(jQuery,this),function(e,a){a.MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"}}(jQuery,this),jQuery.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}},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("