# HG changeset patch # User Thierry Florac # Date 1543226503 -3600 # Node ID 46e128be7e1c198e7a72b8165d5b02dc53c516a5 # Parent 8c6bd0ac6424d7222909a5008df1443f4eaed1e1 Updated resources diff -r 8c6bd0ac6424 -r 46e128be7e1c src/pyams_skin/__init__.py --- a/src/pyams_skin/__init__.py Mon Nov 26 11:00:18 2018 +0100 +++ b/src/pyams_skin/__init__.py Mon Nov 26 11:01:43 2018 +0100 @@ -78,19 +78,24 @@ minified='js/ext/js-cookie.min.js', bottom=True) -myams_core = Resource(library, 'js/myams-core.js', - minified='js/myams-core.min.js', - depends=(jquery,), - bottom=True) + +# +# MyAMS custom resources +# myams_js = Resource(library, 'js/myams.js', minified='js/myams.min.js', depends=(bootstrap, js_cookie), bottom=True) +myams_js_core = Resource(library, 'js/myams-core.js', + minified='js/myams-core.min.js', + depends=(jquery,), + bottom=True) + myams_plugins_loader = Resource(library, 'js/myams-plugins-loader.js', minified='js/myams-plugins-loader.min.js', - depends=(myams_js,), + depends=(myams_js_core,), bottom=True) diff -r 8c6bd0ac6424 -r 46e128be7e1c src/pyams_skin/resources/js/myams-ajax.min.js --- a/src/pyams_skin/resources/js/myams-ajax.min.js Mon Nov 26 11:00:18 2018 +0100 +++ b/src/pyams_skin/resources/js/myams-ajax.min.js Mon Nov 26 11:01:43 2018 +0100 @@ -1,1 +1,1 @@ -!function(p,g){var e=g.MyAMS,h=e;e.ajax={check:function(e,t,a,o){function n(e,t){if(void 0!==a){a instanceof Array||(a=[a]);for(var o=0;o=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var t=e.url;delete e.url,h.ajax.post(t,e,function(e,t,o){h.ajax.handleJSON(e)})}},post:function(e,t,o,n){var a,s;a=e.startsWith(window.location.protocol)?e:this.getAddr()+e,"function"==typeof o?(n=o,o={}):o||(o={}),void 0===n&&(n=o.callback),"string"==typeof n&&(n=h.getFunctionByName(n)),delete o.callback;var i={url:a,type:"post",cache:!1,async:"function"==typeof n,data:p.param(t),dataType:"json",beforeSend:function(e,t){if(void 0!==g.Cookies){var o=Cookies.get(h.csrfCookieName);o&&e.setRequestHeader(h.csrfHeaderName,o)}},success:n||function(e){s=e.result}},r=p.extend({},i,o);return p.ajax(r),s},getResponse:function(t){var o,n,e=t.getResponseHeader("content-type");if(e)if(e.startsWith("application/javascript"))o="script",n=t.responseText;else if(e.startsWith("text/html"))o="html",n=t.responseText;else if(e.startsWith("text/xml"))o="xml",n=t.responseText;else if(n=t.responseJSON)o="json";else try{n=JSON.parse(t.responseText),o="json"}catch(e){n=t.responseText,o="text"}else o="json",n={status:"alert",alert:{title:h.i18n.ERROR_OCCURED,content:h.i18n.NO_SERVER_RESPONSE}};return{contentType:o,data:n}},handleJSON:function(e,t,o){var n,a,s,i,r,c,l,f=e.status;switch(f){case"alert":g.alert&&g.alert(e.alert.title+"\n\n"+e.alert.content);break;case"error":h.form.showErrors(t,e);break;case"info":case"success":void 0!==t&&(h.form.resetChanged(t),!1!==e.close_form&&h.dialog.close(t));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==t&&(h.form.resetChanged(t),!1!==e.close_form&&h.dialog.close(t));break;case"modal":h.dialog.open(e.location);break;case"reload":void 0!==t&&(h.form.resetChanged(t),!1!==e.close_form&&h.dialog.close(t)),(n=e.location||window.location.hash).startsWith("#")&&(n=n.substr(1));var d=p(e.target||o||"#content");h.skin.loadURL(n,d,{preLoadCallback:h.getFunctionByName(e.pre_reload)||function(){p("[data-ams-pre-reload]",d).each(function(){h.executeFunctionByName(p(this).data("ams-pre-reload"))})},preLoadCallbackOptions:e.pre_reload_options,afterLoadCallback:h.getFunctionByName(e.post_reload)||function(){p("[data-ams-post-reload]",d).each(function(){h.executeFunctionByName(p(this).data("ams-post-reload"))})},afterLoadCallbackOptions:e.post_reload_options});break;case"redirect":void 0!==t&&(h.form.resetChanged(t),!0===e.close_form&&h.dialog.close(t)),(n=e.location||window.location.href).endsWith("##")&&(n=n.replace(/##/,window.location.hash)),e.window?window.open(n,e.window,e.options):window.location.href===n?window.location.reload(!0):window.location.href=n;break;default:console&&console.log&&console.log("Unhandled status: "+f)}if(e.content&&(s=e.content,i=p(s.target||o||t||"#content"),!0===s.raw?i.text(s.text):(i.html(s.html),h.initContent(i)),s.keep_hidden||i.removeClass("hidden")),e.contents){var u=e.contents;for(a=0;a0?e.when.apply(e,l).then(function(){i(!0,s)}):i(!1,s)}else void 0===t?"string"==typeof o&&n.getScript(o,function(){i(!0,s)},c):i(!1,s)},getAddr:function(t){var o=t||e("HTML HEAD BASE").attr("href")||window.location.href;return o.substr(0,o.lastIndexOf("/")+1)},start:function(){e("#ajax-gear").show()},stop:function(){e("#ajax-gear").hide()},progress:function(e){e.lengthComputable&&(e.loaded>=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var t=e.url;delete e.url,n.ajax.post(t,e,function(e,t,o){n.ajax.handleJSON(e)})}},post:function(o,a,s,i){var r;r=o.startsWith(window.location.protocol)?o:this.getAddr()+o,"function"==typeof s?(i=s,s={}):s||(s={}),void 0===i&&(i=s.callback),"string"==typeof i&&(i=n.getFunctionByName(i)),delete s.callback;var c,l={url:r,type:"post",cache:!1,async:"function"==typeof i,data:e.param(a),dataType:"json",beforeSend:function(e,o){if(void 0!==t.Cookies){var a=Cookies.get(n.csrfCookieName);a&&e.setRequestHeader(n.csrfHeaderName,a)}},success:i||function(e){c=e.result}},f=e.extend({},l,s);return e.ajax(f),c},getResponse:function(e){var t,o,a=e.getResponseHeader("content-type");if(a)if(a.startsWith("application/javascript"))t="script",o=e.responseText;else if(a.startsWith("text/html"))t="html",o=e.responseText;else if(a.startsWith("text/xml"))t="xml",o=e.responseText;else if(o=e.responseJSON)t="json";else try{o=JSON.parse(e.responseText),t="json"}catch(n){o=e.responseText,t="text"}else t="json",o={status:"alert",alert:{title:n.i18n.ERROR_OCCURED,content:n.i18n.NO_SERVER_RESPONSE}};return{contentType:t,data:o}},handleJSON:function(o,a,s){var i,r=o.status;switch(r){case"alert":t.alert&&t.alert(o.alert.title+"\n\n"+o.alert.content);break;case"error":n.form.showErrors(a,o);break;case"info":case"success":void 0!==a&&(n.form.resetChanged(a),!1!==o.close_form&&n.dialog.close(a));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==a&&(n.form.resetChanged(a),!1!==o.close_form&&n.dialog.close(a));break;case"modal":n.dialog.open(o.location);break;case"reload":void 0!==a&&(n.form.resetChanged(a),!1!==o.close_form&&n.dialog.close(a)),(i=o.location||window.location.hash).startsWith("#")&&(i=i.substr(1));var c=e(o.target||s||"#content");n.skin.loadURL(i,c,{preLoadCallback:n.getFunctionByName(o.pre_reload)||function(){e("[data-ams-pre-reload]",c).each(function(){n.executeFunctionByName(e(this).data("ams-pre-reload"))})},preLoadCallbackOptions:o.pre_reload_options,afterLoadCallback:n.getFunctionByName(o.post_reload)||function(){e("[data-ams-post-reload]",c).each(function(){n.executeFunctionByName(e(this).data("ams-post-reload"))})},afterLoadCallbackOptions:o.post_reload_options});break;case"redirect":void 0!==a&&(n.form.resetChanged(a),!0===o.close_form&&n.dialog.close(a)),(i=o.location||window.location.href).endsWith("##")&&(i=i.replace(/##/,window.location.hash)),o.window?window.open(i,o.window,o.options):window.location.href===i?window.location.reload(!0):window.location.href=i;break;default:console&&console.log&&console.log("Unhandled status: "+r)}var l,f,d;if(o.content&&(f=o.content,d=e(f.target||s||a||"#content"),!0===f.raw?d.text(f.text):(d.html(f.html),n.initContent(d)),f.keep_hidden||d.removeClass("hidden")),o.contents){var u=o.contents;for(l=0;l=0)){var u=s.plugins.enabled[o];if(u)switch(typeof u){case"function":u(n);break;default:for(var g=0;g=0)console&&console.warn&&console.warn("Plugin "+n+" is already registered!");else if("object"==typeof a){var t=a.src;t?s.ajax.check(a.callback,t,function(t){t&&(s.plugins.enabled[n]=s.getFunctionByName(a.callback),a.css&&s.getCSS(a.css,n+"_css"),e&&s.executeFunctionByName(e))}):(s.plugins.enabled[n]=s.getFunctionByName(a.callback),a.css&&s.getCSS(a.css,n+"_css"),e&&s.executeFunctionByName(e))}else"function"==typeof a&&(s.plugins.enabled[n]=a,e&&s.executeFunctionByName(e))}}}(jQuery,this); diff -r 8c6bd0ac6424 -r 46e128be7e1c src/pyams_skin/resources/js/myams-plugins.min.js --- a/src/pyams_skin/resources/js/myams-plugins.min.js Mon Nov 26 11:00:18 2018 +0100 +++ b/src/pyams_skin/resources/js/myams-plugins.min.js Mon Nov 26 11:01:43 2018 +0100 @@ -1,1 +1,1 @@ -!function(y,e){var x=e.MyAMS;y.extend(x.plugins.enabled,{svg:function(e){var a=y(".svg-container",e);0').prependTo(y(this)).addClass("open"===s.amsSwitcherState?s.amsSwitcherMinusClass||"fa-minus":s.amsSwitcherPlusClass||"fa-plus"),n.on("click",function(e){e.preventDefault();var a={};if(n.trigger("ams.switcher.before-switch",[n,a]),!a.veto)if(i.hasClass("switched")){i.removeClass("switched"),y(".fa",n).removeClass(s.amsSwitcherPlusClass||"fa-plus").addClass(s.amsSwitcherMinusClass||"fa-minus"),n.trigger("ams.switcher.opened",[n]);var t=n.attr("id");t&&y('legend.switcher[data-ams-switcher-sync="'+t+'"]',i).each(function(){var e=y(this);e.parents("fieldset").hasClass("switched")&&e.click()})}else i.addClass("switched"),y(".fa",n).removeClass(s.amsSwitcherMinusClass||"fa-minus").addClass(s.amsSwitcherPlusClass||"fa-plus"),n.trigger("ams.switcher.closed",[n])}),"open"!==s.amsSwitcherState&&i.addClass("switched"),n.data("ams-switcher","on"))})},checker:function(e){y("LEGEND.checker",e).each(function(){var i=y(this),s=i.parent("fieldset"),r=i.data();if(!r.amsChecker){var e=y(''),a=r.amsCheckerFieldname||"checker_"+x.generateId(),t=a.replace(/\./,"_"),n=r.amsCheckerHiddenPrefix,o=null,c=r.amsCheckerHiddenValueOn||"true",l=r.amsCheckerHiddenValueOff||"false",m=r.amsCheckerMarker||!1;n?o=y('').attr("name",n+a).val("on"===r.amsCheckerState?c:l).prependTo(i):m&&y('').attr("name",m).attr("value",1).prependTo(i);var d=y('').attr("name",a).attr("id",t).data("ams-checker-hidden-input",o).data("ams-checker-init",!0).val(r.amsCheckerValue||!0).attr("checked","on"===r.amsCheckerState?"checked":null);r.amsCheckerReadonly?d.attr("disabled","disabled"):d.on("change",function(e){e.preventDefault();var a={},t=y(this).is(":checked");if(i.trigger("ams.checker.before-switch",[i,a]),a.veto)y(this).prop("checked",!t);else if(x.executeFunctionByName(r.amsCheckerChangeHandler,i,t),!r.amsCheckerCancelDefault){var n=d.data("ams-checker-hidden-input");t?("disable"===r.amsCheckerMode?(s.removeAttr("disabled"),y(".select2",s).removeAttr("disabled")):s.removeClass("switched"),n&&n.val(c),y("[data-required]",s).attr("required","required"),i.trigger("ams.checker.opened",[i])):("disable"===r.amsCheckerMode?(s.prop("disabled","disabled"),y(".select2",s).attr("disabled","disabled")):s.addClass("switched"),n&&n.val(l),y("[data-required]",s).removeAttr("required"),i.trigger("ams.checker.closed",[i]))}}),d.appendTo(e),y(">label",i).attr("for",d.attr("id")),e.append("").prependTo(i);var u=y("[required]",s);u.attr("data-required",!0),"on"===r.amsCheckerState?d.attr("checked",!0):("disable"===r.amsCheckerMode?(s.attr("disabled","disabled"),y(".select2",s).attr("disabled","disabled")):s.addClass("switched"),u.removeAttr("required")),i.data("ams-checker","on")}})},slider:function(e){var a=y(".slider",e);0r<'dt-wrapper't"+(0<=h.indexOf("scroller")?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===b.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",a=b.amsDatatableSorting;if("string"==typeof a){var t=a.split(";");for(a=[],d=0;d')}},p=y.extend({},m,b.amsDatatableOptions),f=[],g=[],v=[];if(00&&t.each(function(){var a=e(this),t=e("svg",a),n=t.attr("width"),i=t.attr("height");n&&i&&t.get(0).setAttribute("viewBox","0 0 "+Math.round(parseFloat(n))+" "+Math.round(parseFloat(i))),t.attr("width","100%").attr("height","auto")})},hint:function(a){var n=e(".hint:not(:parents(.nohints))",a);n.length>0&&t.ajax.check(e.fn.tipsy,t.baseURL+"ext/jquery-tipsy"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-tipsy"+t.devext+".css","jquery-tipsy",function(){n.each(function(){var a=e(this),n=a.data(),i={html:void 0===n.amsHintHtml?(a.attr("title")||"").startsWith("<"):n.amsHintHtml,title:t.getFunctionByName(n.amsHintTitleGetter)||function(){var a=e(this),t=a.attr("original-title")||a.attr(n.amsHintTitleAttr||"title")||(n.amsHintHtml?a.html():a.text());return t=t.replace(/\?_="/,"?_="+(new Date).getTime()+'"')},opacity:n.amsHintOpacity||.95,gravity:n.amsHintGravity||"sw",offset:n.amsHintOffset||0},s=e.extend({},i,n.amsHintOptions);s=t.executeFunctionByName(n.amsHintInitCallback,a,s)||s;var r=a.tipsy(s);t.executeFunctionByName(n.amsHintAfterInitCallback,a,r,s)})})})},contextMenu:function(a){var n=e(".context-menu",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={menuSelector:n.amsContextmenuSelector,menuSelected:t.helpers.contextMenuHandler},s=e.extend({},i,n.amsContextmenuOptions);s=t.executeFunctionByName(n.amsContextmenuInitCallback,a,s)||s;var r=a.contextMenu(s);t.executeFunctionByName(n.amsContextmenuAfterInitCallback,a,r,s)})},switcher:function(a){e("LEGEND.switcher",a).each(function(){var a=e(this),t=a.parent("fieldset"),n=a.data();n.amsSwitcher||(e('').prependTo(e(this)).addClass("open"===n.amsSwitcherState?n.amsSwitcherMinusClass||"fa-minus":n.amsSwitcherPlusClass||"fa-plus"),a.on("click",function(i){i.preventDefault();var s={};if(a.trigger("ams.switcher.before-switch",[a,s]),!s.veto)if(t.hasClass("switched")){t.removeClass("switched"),e(".fa",a).removeClass(n.amsSwitcherPlusClass||"fa-plus").addClass(n.amsSwitcherMinusClass||"fa-minus"),a.trigger("ams.switcher.opened",[a]);var r=a.attr("id");r&&e('legend.switcher[data-ams-switcher-sync="'+r+'"]',t).each(function(){var a=e(this);a.parents("fieldset").hasClass("switched")&&a.click()})}else t.addClass("switched"),e(".fa",a).removeClass(n.amsSwitcherMinusClass||"fa-minus").addClass(n.amsSwitcherPlusClass||"fa-plus"),a.trigger("ams.switcher.closed",[a])}),"open"!==n.amsSwitcherState&&t.addClass("switched"),a.data("ams-switcher","on"))})},checker:function(a){e("LEGEND.checker",a).each(function(){var a=e(this),n=a.parent("fieldset"),i=a.data();if(!i.amsChecker){var s=e(''),r=i.amsCheckerFieldname||"checker_"+t.generateId(),o=r.replace(/\./,"_"),c=i.amsCheckerHiddenPrefix,l=null,m=i.amsCheckerHiddenValueOn||"true",d=i.amsCheckerHiddenValueOff||"false",u=i.amsCheckerMarker||!1;c?l=e('').attr("name",c+r).val("on"===i.amsCheckerState?m:d).prependTo(a):u&&e('').attr("name",u).attr("value",1).prependTo(a);var b=e('').attr("name",r).attr("id",o).data("ams-checker-hidden-input",l).data("ams-checker-init",!0).val(i.amsCheckerValue||!0).attr("checked","on"===i.amsCheckerState?"checked":null);i.amsCheckerReadonly?b.attr("disabled","disabled"):b.on("change",function(s){s.preventDefault();var r={},o=e(this).is(":checked");if(a.trigger("ams.checker.before-switch",[a,r]),r.veto)e(this).prop("checked",!o);else if(t.executeFunctionByName(i.amsCheckerChangeHandler,a,o),!i.amsCheckerCancelDefault){var c=b.data("ams-checker-hidden-input");o?("disable"===i.amsCheckerMode?(n.removeAttr("disabled"),e(".select2",n).removeAttr("disabled")):n.removeClass("switched"),c&&c.val(m),e("[data-required]",n).attr("required","required"),a.trigger("ams.checker.opened",[a])):("disable"===i.amsCheckerMode?(n.prop("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),c&&c.val(d),e("[data-required]",n).removeAttr("required"),a.trigger("ams.checker.closed",[a]))}}),b.appendTo(s),e(">label",a).attr("for",b.attr("id")),s.append("").prependTo(a);var h=e("[required]",n);h.attr("data-required",!0),"on"===i.amsCheckerState?b.attr("checked",!0):("disable"===i.amsCheckerMode?(n.attr("disabled","disabled"),e(".select2",n).attr("disabled","disabled")):n.addClass("switched"),h.removeAttr("required")),a.data("ams-checker","on")}})},slider:function(a){var n=e(".slider",a);n.length>0&&t.ajax.check(e.fn.slider,t.baseURL+"ext/bootstrap-slider-2.0.0"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),i=e.extend({},{},a.data.amsSliderOptions);i=t.executeFunctionByName(n.amsSliderInitCallback,a,i)||i;var s=a.slider(i);t.executeFunctionByName(n.amsSliderAfterInitCallback,a,s,i)})})},draggable:function(a){var n=e(".draggable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={cursor:n.amsDraggableCursor||"move",containment:n.amsDraggableContainment,handle:n.amsDraggableHandle,connectToSortable:n.amsDraggableConnectSortable,helper:t.getFunctionByName(n.amsDraggableHelper)||n.amsDraggableHelper,start:t.getFunctionByName(n.amsDraggableStart),stop:t.getFunctionByName(n.amsDraggableStop)},s=e.extend({},i,n.amsDraggableOptions);s=t.executeFunctionByName(n.amsDraggableInitCallback,a,s)||s;var r=a.draggable(s);a.disableSelection(),t.executeFunctionByName(n.amsDraggableAfterInitCallback,a,r,s)})},droppable:function(a){var n=e(".droppable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={accept:n.amsdroppableAccept,drop:t.getFunctionByName(n.amsDroppableDrop)},s=e.extend({},i,n.amsDroppableOptions);s=t.executeFunctionByName(n.amsDroppableInitCallback,a,s)||s;var r=a.droppable(s);t.executeFunctionByName(n.amsDroppableAfterInitCallback,a,r,s)})},sortable:function(a){var n=e(".sortable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={items:n.amsSortableItems,handle:n.amsSortableHandle,helper:n.amsSortableHelper,connectWith:n.amsSortableConnectwith,start:t.getFunctionByName(n.amsSortableStart),over:t.getFunctionByName(n.amsSortableOver),containment:n.amsSortableContainment,placeholder:n.amsSortablePlaceholder,stop:t.getFunctionByName(n.amsSortableStop)},s=e.extend({},i,n.amsSortableOptions);s=t.executeFunctionByName(n.amsSortableInitCallback,a,s)||s;var r=a.sortable(s);a.disableSelection(),t.executeFunctionByName(n.amsSortableAfterInitCallback,a,r,s)})},resizable:function(a){var n=e(".resizable",a);n.length>0&&n.each(function(){var a=e(this),n=a.data(),i={autoHide:!1===n.amsResizableAutohide||n.amsResizableAutohide,containment:n.amsResizableContainment,grid:n.amsResizableGrid,handles:n.amsResizableHandles,start:t.getFunctionByName(n.amsResizableStart),stop:t.getFunctionByName(n.amsResizableStop)},s=e.extend({},i,n.amsResizableOptions);s=t.executeFunctionByName(n.amsResizableInitCallback,a,s)||s;var r=a.resizable(s);a.disableSelection(),t.executeFunctionByName(n.amsResizableAfterInitCallback,a,r,s)})},typeahead:function(a){var n=e(".typeahead",a);n.length>0&&t.ajax.check(e.fn.typeahead,t.baseURL+"ext/jquery-typeahead"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),i=e.extend({},{},n.amsTypeaheadOptions);i=t.executeFunctionByName(n.amsTypeaheadInitCallback,a,i)||i;var s=a.typeahead(i);t.executeFunctionByName(n.amsTypeaheadAfterInitCallback,a,s,i)})})},treeview:function(a){var n=e(".treeview",a);n.length>0&&t.ajax.check(e.fn.treview,t.baseURL+"ext/bootstrap-treeview"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/bootstrap-treeview"+t.devext+".css","bootstrap-treeview",function(){n.each(function(){var a=e(this),n=a.data(),i={data:n.amsTreeviewData,levels:n.amsTreeviewLevels,injectStyle:n.amsTreeviewInjectStyle,expandIcon:n.amsTreeviewExpandIcon||"fa fa-fw fa-plus-square-o",collapseIcon:n.amsTreeviewCollaspeIcon||"fa fa-fw fa-minus-square-o",emptyIcon:n.amsTreeviewEmptyIcon||"fa fa-fw",nodeIcon:n.amsTreeviewNodeIcon,selectedIcon:n.amsTreeviewSelectedIcon,checkedIcon:n.amsTreeviewCheckedIcon||"fa fa-fw fa-check-square-o",uncheckedIcon:n.amsTreeviewUncheckedIcon||"fa fa-fw fa-square-o",color:n.amsTreeviewColor,backColor:n.amsTreeviewBackColor,borderColor:n.amsTreeviewBorderColor,onHoverColor:n.amsTreeviewHoverColor,selectedColor:n.amsTreeviewSelectedColor,selectedBackColor:n.amsTreeviewSelectedBackColor,unselectableColor:n.amsTreeviewUnselectableColor||"rgba(1,1,1,0.25)",unselectableBackColor:n.amsTreeviewUnselectableBackColor||"rgba(1,1,1,0.25)",enableLinks:n.amsTreeviewEnableLinks,highlightSelected:n.amsTreeviewHighlightSelected,highlightSearchResults:n.amsTreeviewhighlightSearchResults,showBorder:n.amsTreeviewShowBorder,showIcon:n.amsTreeviewShowIcon,showCheckbox:n.amsTreeviewShowCheckbox,showTags:n.amsTreeviewShowTags,toggleUnselectable:n.amsTreeviewToggleUnselectable,multiSelect:n.amsTreeviewMultiSelect,onNodeChecked:t.getFunctionByName(n.amsTreeviewNodeChecked),onNodeCollapsed:t.getFunctionByName(n.amsTreeviewNodeCollapsed),onNodeDisabled:t.getFunctionByName(n.amsTreeviewNodeDisabled),onNodeEnabled:t.getFunctionByName(n.amsTreeviewNodeEnabled),onNodeExpanded:t.getFunctionByName(n.amsTreeviewNodeExpanded),onNodeSelected:t.getFunctionByName(n.amsTreeviewNodeSelected),onNodeUnchecked:t.getFunctionByName(n.amsTreeviewNodeUnchecked),onNodeUnselected:t.getFunctionByName(n.amsTreeviewNodeUnselected),onSearchComplete:t.getFunctionByName(n.amsTreeviewSearchComplete),onSearchCleared:t.getFunctionByName(n.amsTreeviewSearchCleared)},s=e.extend({},i,n.amsTreeviewOptions);s=t.executeFunctionByName(n.amsTreeviewInitcallback,a,s)||s;var r=a.treeview(s);t.executeFunctionByName(n.amsTreeviewAfterInitCallback,a,r,s)})})})},select2:function(a){var n=e(".select2",a);n.length>0&&t.ajax.check(e.fn.select2,t.baseURL+"ext/jquery-select2-3.5.4"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();if(!n.select2){var i={placeholder:n.amsSelect2Placeholder,multiple:n.amsSelect2Multiple,minimumInputLength:n.amsSelect2MinimumInputLength||0,maximumSelectionSize:n.amsSelect2MaximumSelectionSize,openOnEnter:void 0===n.amsSelect2EnterOpen||n.amsSelect2EnterOpen,allowClear:void 0===n.amsSelect2AllowClear||n.amsSelect2AllowClear,width:n.amsSelect2Width||"100%",initSelection:t.getFunctionByName(n.amsSelect2InitSelection),formatSelection:void 0===n.amsSelect2FormatSelection?t.helpers.select2FormatSelection:t.getFunctionByName(n.amsSelect2FormatSelection),formatResult:t.getFunctionByName(n.amsSelect2FormatResult),formatMatches:void 0===n.amsSelect2FormatMatches?function(e){return 1===e?t.i18n.SELECT2_MATCH:e+t.i18n.SELECT2_MATCHES}:t.getFunctionByName(n.amsSelect2FormatMatches),formatNoMatches:void 0===n.amsSelect2FormatResult?function(e){return t.i18n.SELECT2_NOMATCHES}:t.getFunctionByName(n.amsSelect2FormatResult),formatInputTooShort:void 0===n.amsSelect2FormatInputTooShort?function(e,a){var n=a-e.length;return t.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooShort),formatInputTooLong:void 0===n.amsSelect2FormatInputTooLong?function(e,a){var n=e.length-a;return t.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,n).replace(/\{1\}/,1===n?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatInputTooLong),formatSelectionTooBig:void 0===n.amsSelect2FormatSelectionTooBig?function(e){return t.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,e).replace(/\{1\}/,1===e?"":t.i18n.SELECT2_PLURAL)}:t.getFunctionByName(n.amsSelect2FormatSelectionTooBig),formatLoadMore:void 0===n.amsSelect2FormatLoadMore?function(e){return t.i18n.SELECT2_LOADMORE}:t.getFunctionByName(n.amsSelect2FormatLoadMore),formatSearching:void 0===n.amsSelect2FormatSearching?function(){return t.i18n.SELECT2_SEARCHING}:t.getFunctionByName(n.amsSelect2FormatSearching),separator:n.amsSelect2Separator||",",tokenSeparators:n.amsSelect2TokensSeparators||[","],tokenizer:t.getFunctionByName(n.amsSelect2Tokenizer)};switch(a.context.type){case"text":case"hidden":if(!i.initSelection){var s=a.data("ams-select2-values");s&&(i.initSelection=function(a,t){var n=[];e(a.val().split(i.separator)).each(function(){n.push({id:this,text:s[this]||this})}),t(n)})}}a.attr("readonly")?"hidden"===a.attr("type")&&(i.query=function(){return[]}):n.amsSelect2Query?(i.query=t.getFunctionByName(n.amsSelect2Query),i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryUrl?(i.ajax={url:n.amsSelect2QueryUrl,quietMillis:n.amsSelect2QuietMillis||200,type:n.amsSelect2QueryType||"POST",dataType:n.amsSelect2QueryDatatype||"json",data:function(a,t,i){var s={};return s[n.amsSelect2QueryParamName||"query"]=a,s[n.amsSelect2PageParamName||"page"]=t,s[n.amsSelect2ContextParamName||"context"]=i,e.extend({},s,n.amsSelect2QueryOptions)},results:t.helpers.select2QueryUrlResultsCallback},i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2QueryMethod?(i.query=function(i){var s={id:(new Date).getTime(),params:n.amsSelect2QueryParams||{},success:function(e){return t.helpers.select2QueryMethodSuccessCallback.call(a,e,"success",i)},error:t.error.show};s.params[n.amsSelect2QueryParamName||"query"]=i.term,s.params[n.amsSelect2PageParamName||"page"]=i.page,s.params[n.amsSelect2ContextParamName||"context"]=i.context,s=e.extend({},s,n.amsSelect2QueryOptions),s=t.executeFunctionByName(n.amsSelect2QueryInitCallback,a,s)||s,t.ajax.check(e.jsonRPC,t.baseURL+"ext/jquery-jsonrpc"+t.devext+".js",function(){e.jsonRPC.withOptions({endPoint:n.amsSelect2MethodTarget||t.jsonrpc.getAddr(),namespace:n.amsSelect2MethodNamespace,cache:!1},function(){e.jsonRPC.request(n.amsSelect2QueryMethod,s)})})},i.minimumInputLength=n.amsSelect2MinimumInputLength||1):n.amsSelect2Tags?i.tags=n.amsSelect2Tags:n.amsSelect2Data&&(i.data=n.amsSelect2Data),n.amsSelect2EnableFreeTags&&(i.createSearchChoice=function(e){return{id:e,text:(n.amsSelect2FreeTagsPrefix||t.i18n.SELECT2_FREETAG_PREFIX)+e}});var r=e.extend({},i,n.amsSelect2Options);r=t.executeFunctionByName(n.amsSelect2InitCallback,a,r)||r;var o=a.select2(r);t.executeFunctionByName(n.amsSelect2AfterInitCallback,a,o,r),a.hasClass("ordered")&&t.ajax.check(e.fn.select2Sortable,t.baseURL+"ext/jquery-select2-sortable"+t.devext+".js",function(){a.select2Sortable({bindOrder:"sortableStop"})}),a.on("change",function(){void 0!==e(a.get(0).form).data("validator")&&e(a).valid()})}})})},maskedit:function(a){var n=e("[data-mask]",a);n.length>0&&t.ajax.check(e.fn.mask,t.baseURL+"ext/jquery-maskedinput-1.4.1"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),i={placeholder:void 0===n.amsMaskeditPlaceholder?"X":n.amsMaskeditPlaceholder,complete:t.getFunctionByName(n.amsMaskeditComplete)},s=e.extend({},i,n.amsMaskeditOptions);s=t.executeFunctionByName(n.amsMaskeditInitCallback,a,s)||s;var r=a.mask(a.attr("data-mask"),s);t.executeFunctionByName(n.amsMaskeditAfterInitCallback,a,r,s)})})},inputmask:function(a){var n=e("input[data-input-mask]",a);n.length>0&&t.ajax.check(e.fn.inputmask,t.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+t.devext+".js",function(){n.each(function(){var a,n=e(this),i=n.data();a="object"==typeof i.inputMask?i.inputMask:{mask:i.inputMask.toString()};var s=e.extend({},a,i.amsInputmaskOptions);s=t.executeFunctionByName(i.amsInputmaskInitCallback,n,s)||s;var r=n.inputmask(s);t.executeFunctionByName(i.amsInputmaskAfterInitCallback,n,r,s)})})},datepicker:function(a){var n=e(".datepicker",a);n.length>0&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog.registerHideCallback(t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),i={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y",datepicker:!0,dayOfWeekStart:1,timepicker:!1,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},datetimepicker:function(a){var n=e(".datetimepicker",a);n.length>0&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog.registerHideCallback(t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),i={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"d/m/y H:i",datepicker:!0,dayOfWeekStart:1,timepicker:!0,closeOnDateSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect,weeks:n.amsDatetimepickerWeeks},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},timepicker:function(a){var n=e(".timepicker",a);n.length>0&&t.ajax.check(e.fn.datetimepicker,t.baseURL+"ext/jquery-datetimepicker"+t.devext+".js",function(a){a&&t.dialog.registerHideCallback(t.helpers.datetimepickerDialogHiddenCallback),t.getCSS(t.baseURL+"../css/ext/jquery-datetimepicker"+t.devext+".css","jquery-datetimepicker",function(){n.each(function(){var a=e(this),n=a.data(),i={lang:n.amsDatetimepickerLang||t.lang,format:n.amsDatetimepickerFormat||"H:i",datepicker:!1,timepicker:!0,closeOnTimeSelect:void 0===n.amsDatetimepickerCloseOnSelect||n.amsDatetimepickerCloseOnSelect},s=e.extend({},i,n.amsDatetimepickerOptions);s=t.executeFunctionByName(n.amsDatetimepickerInitCallback,a,s)||s;var r=a.datetimepicker(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},colorpicker:function(a){var n=e(".colorpicker",a);n.length>0&&t.ajax.check(e.fn.minicolors,t.baseURL+"ext/jquery-minicolors"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-minicolors"+t.devext+".css","jquery-minicolors",function(){n.each(function(){var a=e(this),n=a.data(),i={position:n.amsColorpickerPosition||a.closest(".input").data("ams-colorpicker-position")||"bottom left"},s=e.extend({},i,n.amsColorpickerOptions);s=t.executeFunctionByName(n.amsColorpickerInitCallback,a,s)||s;var r=a.minicolors(s);t.executeFunctionByName(n.amsDatetimepickerAfterInitCallback,a,r,s)})})})},dndupload:function(a){var n=e(".dndupload",a);n.length>0&&t.ajax.check(e.fn.dndupload,t.baseURL+"ext/jquery-dndupload"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-dndupload"+t.devext+".css","jquery-dndupload",function(){n.each(function(){var a=e(this),n=a.data(),i={action:n.amsDnduploadAction||a.attr("action")||"upload-files",fieldname:n.amsDnduploadFieldname||"files",autosubmit:n.amsDnduploadAutosubmit},s=e.extend({},i,n.amsDnduploadOptions);s=t.executeFunctionByName(n.amsDnduploadInitCallback,a,s)||s;var r=a.dndupload(s);t.executeFunctionByName(n.amsDnduploadAfterInitcallback,a,r,s)})})})},validate:function(a){var n=e("FORM:not([novalidate])",a);n.length>0&&t.ajax.check(e.fn.validate,t.baseURL+"ext/jquery-validate-1.17.0"+t.devext+".js",function(a){if(a&&(e.validator.setDefaults({highlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(a){e(a).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(e,a){var t=a.parents("label:first");t.length?e.insertAfter(t):e.insertAfter(a)}}),t.plugins.i18n)){for(var i in t.plugins.i18n.validate)if(t.plugins.i18n.validate.hasOwnProperty(i)){var s=t.plugins.i18n.validate[i];"string"==typeof s&&s.indexOf("{0}")>-1&&(t.plugins.i18n.validate[i]=e.validator.format(s))}e.extend(e.validator.messages,t.plugins.i18n.validate)}n.each(function(){var a=e(this),n=a.data(),i={ignore:null,submitHandler:void 0!==a.attr("data-async")?void 0===n.amsFormSubmitHandler?function(){return e(".state-error",a).removeClass("state-error"),t.ajax.check(e.fn.ajaxSubmit,t.baseURL+"ext/jquery-form-3.49"+t.devext+".js"),t.form.submit(a)}:t.getFunctionByName(n.amsFormSubmitHandler):void 0,invalidHandler:void 0!==a.attr("data-async")?void 0===n.amsFormInvalidHandler?function(t,n){e(".state-error",a).removeClass("state-error");for(var i=0;i0){var o=e(".nav-tabs",e(s.element).parents(".tabforms"));e("li:nth-child("+r+")",o).removeClassPrefix("state-").addClass("state-error"),e("li.state-error:first a",o).click()}}}:t.getFunctionByName(n.amsFormInvalidHandler):void 0};e("[data-ams-validate-rules]",a).each(function(a){0===a&&(i.rules={}),i.rules[e(this).attr("name")]=e(this).data("ams-validate-rules")});var s=e.extend({},i,n.amsValidateOptions);s=t.executeFunctionByName(n.amsValidateInitCallback,a,s)||s;var r=a.validate(s);t.executeFunctionByName(n.amsValidateAfterInitCallback,a,r,s)})})},datatable:function(a){var n=e(".datatable",a);n.length>0&&t.ajax.check(e.fn.dataTable,t.baseURL+"ext/jquery-dataTables-1.9.4"+t.devext+".js",function(){t.ajax.check(e.fn.dataTableExt.oPagination.bootstrap_full,t.baseURL+"myams-dataTables"+t.devext+".js",function(){e(n).each(function(){var a,n=e(this),i=n.data(),s=(i.amsDatatableExtensions||"").split(/\s+/),r=i.amsDatatableSdom||"W"+(s.indexOf("colreorder")>=0||s.indexOf("colreorderwithresize")>=0?"R":"")+"<'dt-top-row'"+(s.indexOf("colvis")>=0?"C":"")+(!1===i.amsDatatablePagination||!1===i.amsDatatablePaginationSize?"":"L")+(!1===i.amsDatatableGlobalFilter?"":"F")+">r<'dt-wrapper't"+(s.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===i.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",o=i.amsDatatableSorting;if("string"==typeof o){var c=o.split(";");for(o=[],a=0;a=0,bPaginate:!1!==i.amsDatatablePagination,bInfo:!1!==i.amsDatatableInfo,bSort:!1!==i.amsDatatableSort,aaSorting:o,aoColumns:d.length>0?d:void 0,bDeferRender:!0,bAutoWidth:!1,iDisplayLength:i.amsDatatableDisplayLength||25,sPaginationType:i.amsDatatablePaginationType||"bootstrap_full",sDom:r,oLanguage:t.plugins.i18n.datatables,fnInitComplete:function(a,n){e(".ColVis_Button").addClass("btn btn-default btn-sm").html((t.plugins.i18n.datatables.sColumns||"Columns")+' ')}},g=e.extend({},f,i.amsDatatableOptions),v=[],y=[],x=[];if(s.length>0)for(a=0;a0)for(a=0;a0)for(a=0;a0&&t.ajax.check(e.fn.tableDnD,t.baseURL+"ext/jquery-tablednd"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data();n.amsTabledndDragHandle?e("tr",a).addClass("no-drag-handle"):e(a).on("mouseover","tr",function(){e(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){e(this.cells[0]).removeClass("drag-handle")});var i={onDragClass:n.amsTabledndDragClass||"dragging-row",onDragStart:t.getFunctionByName(n.amsTabledndDragStart),dragHandle:n.amsTabledndDragHandle,scrollAmount:n.amsTabledndScrollAmount,onAllowDrop:n.amsTabledndAllowDrop,onDrop:t.getFunctionByName(n.amsTabledndDrop)||function(i,s){var r=n.amsTabledndDropTarget;if(r){e(s).data("ams-disabled-handlers","click");try{var o=[];e(i.rows).each(function(){var a=e(this).data("ams-element-name");a&&o.push(a)});var c=t.getFunctionByName(r);if("function"==typeof c)c.call(a,i,o);else{if(!r.startsWith(window.location.protocol)){var l=n.amsLocation;l&&(r=l+"/"+r)}t.ajax.post(r,{names:JSON.stringify(o)})}}finally{setTimeout(function(){e(s).removeData("ams-disabled-handlers")},50)}}return!1}},s=e.extend({},i,n.amsTabledndOptions);s=t.executeFunctionByName(n.amsTabledndInitCallback,a,s)||s;var r=a.tableDnD(s);t.executeFunctionByName(n.amsTabledndAfterInitCallback,a,r,s)})})},wizard:function(a){var n=e(".wizard",a);n.length>0&&t.ajax.check(e.fn.bootstrapWizard,t.baseURL+"ext/bootstrap-wizard-1.4.2"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),i={withVisible:void 0===n.amsWizardWithVisible||n.amsWizardWithVisible,tabClass:n.amsWizardTabClass,firstSelector:n.amsWizardFirstSelector,previousSelector:n.amsWizardPreviousSelector,nextSelector:n.amsWizardNextSelector,lastSelector:n.amsWizardLastSelector,finishSelector:n.amsWizardFinishSelector,backSelector:n.amsWizardBackSelector,onInit:t.getFunctionByName(n.amsWizardInit),onShow:t.getFunctionByName(n.amsWizardShow),onNext:t.getFunctionByName(n.amsWizardNext),onPrevious:t.getFunctionByName(n.amsWizardPrevious),onFirst:t.getFunctionByName(n.amsWizardFirst),onLast:t.getFunctionByName(n.amsWizardLast),onBack:t.getFunctionByName(n.amsWizardBack),onFinish:t.getFunctionByName(n.amsWizardFinish),onTabChange:t.getFunctionByName(n.amsWizardTabChange),onTabClick:t.getFunctionByName(n.amsWizardTabClick),onTabShow:t.getFunctionByName(n.amsWizardTabShow)},s=e.extend({},i,n.amsWizardOptions);s=t.executeFunctionByName(n.amsWizardInitCallback,a,s)||s;var r=a.bootstrapWizard(s);t.executeFunctionByName(n.amsWizardAfterInitCallback,a,r,s)})})},tinymce:function(a){function n(){e(".tinymce",e(this)).each(function(){var a=tinymce.get(e(this).attr("id"));a&&a.remove()})}var i=e(".tinymce",a);if(i.length>0){var s=t.baseURL+"ext/tinymce"+(t.devmode?"/dev":"");t.ajax.check(window.tinymce,s+"/tinymce"+t.devext+".js",function(a){function r(){i.each(function(){var a=e(this),n=a.data(),i={theme:n.amsTinymceTheme||"modern",language:t.lang,menubar:!1!==n.amsTinymceMenubar,statusbar:!1!==n.amsTinymceStatusbar,plugins:n.amsTinymcePlugins||["advlist autosave autolink lists link charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern autoresize"],toolbar:n.amsTinymceToolbar,toolbar1:!1!==n.amsTinymceToolbar1&&(n.amsTinymceToolbar1||"undo redo | pastetext | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent"),toolbar2:!1!==n.amsTinymceToolbar2&&(n.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code"),content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:!0,image_list:t.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:t.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,paste_as_text:void 0===n.amsTinymcePasteAsText||n.amsTinymcePasteAsText,paste_auto_cleanup_on_paste:void 0===n.amsTinymcePasteAutoCleanup||n.amsTinymcePasteAutoCleanup,paste_strip_class_attributes:n.amsTinymcePasteStripClassAttributes||"all",paste_remove_spans:void 0===n.amsTinymcePaseRemoveSpans||n.amsTinymcePasteRemoveSpans,paste_remove_styles:void 0===n.amsTinymcePasteRemoveStyles||n.amsTinymcePasteRemoveStyles,height:n.amsTinymceHeight||50,min_height:50,resize:!0,autoresize_min_height:50,autoresize_max_height:500};if(n.amsTinymceExternalPlugins){var s=n.amsTinymceExternalPlugins.split(/\s+/);for(var r in s)if(s.hasOwnProperty(r)){var o=a.data("ams-tinymce-plugin-"+s[r]);tinymce.PluginManager.load(s[r],t.getSource(o))}}var c=e.extend({},i,n.amsTinymceOptions);c=t.executeFunctionByName(n.amsTinymceInitCallback,a,c)||c;var l=a.tinymce(c);t.executeFunctionByName(n.amsTinymceAfterInitCallback,a,l,c)})}a?t.getScript(s+"/jquery.tinymce"+t.devext+".js",function(){tinymce.baseURL=s,tinymce.suffix=t.devext,t.skin.registerCleanCallback(n),r()}):r()})}},imgareaselect:function(a){var n=e(".imgareaselect",a);n.length>0&&t.ajax.check(e.fn.imgAreaSelect,t.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-imgareaselect"+t.devext+".css","jquery-imgareaselect",function(){n.each(function(){var a=e(this),n=a.data(),i=n.amsImgareaselectParent?a.parents(n.amsImgareaselectParent):"body",s={instance:!0,handles:!0,parent:i,x1:n.amsImgareaselectX1||0,y1:n.amsImgareaselectY1||0,x2:n.amsImgareaselectX2||n.amsImgareaselectImageWidth,y2:n.amsImgareaselectY2||n.amsImgareaselectImageHeight,imageWidth:n.amsImgareaselectImageWidth,imageHeight:n.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:n.amsImgareaselectRatio,onSelectEnd:t.getFunctionByName(n.amsImgareaselectSelectEnd)||function(a,t){var s=n.amsImgareaselectTargetField||"image_";e('input[name="'+s+'x1"]',i).val(t.x1),e('input[name="'+s+'y1"]',i).val(t.y1),e('input[name="'+s+'x2"]',i).val(t.x2),e('input[name="'+s+'y2"]',i).val(t.y2)}},r=e.extend({},s,n.amsImgareaselectOptions);r=t.executeFunctionByName(n.amsImgareaselectInitCallback,a,r)||r;var o=a.imgAreaSelect(r);t.executeFunctionByName(n.amsImgareaselectAfterInitCallback,a,o,r),setTimeout(function(){o.update()},250)})})})},fancybox:function(a){var n=e(".fancybox",a);n.length>0&&t.ajax.check(e.fn.fancybox,t.baseURL+"ext/jquery-fancybox-2.1.5"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-fancybox-2.1.5"+t.devext+".css","jquery-fancybox",function(){n.each(function(){var a,n=e(this),i=n.data(),s=n;i.amsFancyboxElements&&(s=e(i.amsFancyboxElements,n));var r=(i.amsFancyboxHelpers||"").split(/\s+/);if(r.length>0)for(a=0;a0)for(a=0;a0&&t.ajax.check(e.fn.plot,t.baseURL+"flot/jquery.flot"+t.devext+".js",function(){n.each(function(){var a=e(this),n=a.data(),i=(n.amsChartPlugins||"").split(/\s+/);if(i.length>0)for(var s in i)if(i.hasOwnProperty(s)){var r=i[s];(function(a){for(var t in e.plot.plugins)if(e.plot.plugins.hasOwnProperty(t)){var n=e.plot.plugins[t];if(n.name===a)return n}return null})(r)||t.getScript(t.baseURL+"flot/jquery.flot."+r+t.devext+".js")}var o=e.extend({},{},n.amsChartOptions);o=t.executeFunctionByName(n.amsChartInitCallback,a,o)||o;var c=n.amsChartData;c=t.executeFunctionByName(n.amsChartInitData,a,c)||c;var l=a.plot(c,o);t.executeFunctionByName(n.amsChartAfterInitCallback,a,l,o)})})},graphs:function(a){var n=e(".sparkline",a);n.length>0&&t.ajax.check(t.graphs,t.baseURL+"myams-graphs"+t.devext+".js",function(){t.graphs.init(n)})},scrollbars:function(a){var n=e(".scrollbar",a);n.length>0&&t.ajax.check(e.event.special.mousewheel,t.baseURL+"ext/jquery-mousewheel.min.js",function(){t.ajax.check(e.fn.mCustomScrollbar,t.baseURL+"ext/jquery-mCustomScrollbar"+t.devext+".js",function(){t.getCSS(t.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar",function(){n.each(function(){var a=e(this),n=a.data(),i={theme:n.amsScrollbarTheme||"light"},s=e.extend({},i,n.amsScrollbarOptions);s=t.executeFunctionByName(n.amsScrollbarInitCallback,a,s)||s;var r=a.mCustomScrollbar(s);t.executeFunctionByName(n.amsScrollbarAfterInitCallback,a,r,s)})})})})}})}(jQuery,this); diff -r 8c6bd0ac6424 -r 46e128be7e1c src/pyams_skin/resources/js/myams.min.js --- a/src/pyams_skin/resources/js/myams.min.js Mon Nov 26 11:00:18 2018 +0100 +++ b/src/pyams_skin/resources/js/myams.min.js Mon Nov 26 11:01:43 2018 +0100 @@ -1,1 +1,1 @@ -"use strict";!function(o,a){var e=a.console;String.prototype.startsWith=function(e){var a=this.length,t=e.length;return!(a
').appendTo("body"),a=e.children(),t=a.innerWidth()-a.height(99).innerWidth();return e.remove(),t}),o.fn.extend({exists:function(){return 0").attr("data-ams-id",a).text('@import "'+c.getSource(e)+'";'),t)var r=setInterval(function(){try{i[0].sheet.cssRules;t.call(window,!0,n),clearInterval(r)}catch(e){}},10);i.appendTo(s)}else t&&t.call(window,!1,n)}}(jQuery,this),jQuery.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t>6|192):(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;t',openedSign:''},e),t=c(this);t.find("LI").each(function(){var e=c(this);if(0"+o.closedSign+"");var a=e.find("A:first");"#"===a.attr("href")&&a.click(function(){return!1})}}),t.find("LI.active").each(function(){var e=c(this).parents("UL"),a=e.parent("LI");e.slideDown(o.speed),a.find("b:first").html(o.openedSign),a.addClass("open")}),t.find("LI A").on("click",function(){var e=c(this);if(!e.hasClass("active")){var n=e.attr("href").replace(/^#/,""),s=e.parent().find("UL");if(o.accordion){var i=e.parent().parents("UL"),r=t.find("UL:visible");r.each(function(a){var t=!0;if(i.each(function(e){if(i[e]===r[a])return t=!1}),t&&s!==r[a]){var e=c(r[a]);!n&&e.hasClass("active")||e.slideUp(o.speed,function(){c(this).parent("LI").removeClass("open").find("B:first").delay(o.speed).html(o.closedSign)})}})}var a=e.parent().find("UL:first");n||!a.is(":visible")||a.hasClass("active")?a.slideDown(o.speed,function(){e.parent("LI").addClass("open").find("B:first").delay(o.speed).html(o.openedSign)}):a.slideUp(o.speed,function(){e.parent("LI").removeClass("open").find("B:first").delay(o.speed).html(o.closedSign)})}})}})}(jQuery,this),function(e,a){var t=a.MyAMS;t.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(n,s){var i=s.MyAMS,r=i;i.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.",a=this.getInternetExplorerVersion();-1");t.val(e),t.css("position","fixed"),t.appendTo(n("body")),t.get(0).select();try{document.execCommand("copy"),a=!0}catch(e){console&&console.warn&&console.warn("Copy to clipboard failed.",e)}finally{t.remove()}}a?r.skin.smallBox("success",{title:1"+s+"

"+(i||"")+"

",icon:"fa fa-warning animated shake",timeout:1e4})}console&&(console.error&&console.error(e),console.debug&&console.debug(a))}},show:function(e,a,t){if(t){var n=r.ajax.getResponse(e);"json"===n.contentType?r.ajax.handleJSON(n.data):r.skin.messageBox("error",{title:r.i18n.ERRORS_OCCURED,content:"

"+a+"

"+t+"

",icon:"fa fa-warning animated shake",timeout:1e4}),console&&(console.error&&console.error(t),console.debug&&console.debug(e))}}}}(jQuery,this),function(h,p){var e=p.MyAMS,g=e;e.ajax={check:function(e,a,s,t){function n(e,a){if(void 0!==s){s instanceof Array||(s=[s]);for(var t=0;t=e.total||console&&console.log&&console.log(parseInt(e.loaded/e.total*100,10)+"%"))},getJSON:function(){return function(e){var a=e.url;delete e.url,g.ajax.post(a,e,function(e,a,t){g.ajax.handleJSON(e)})}},post:function(e,a,t,n){var s,i;s=e.startsWith(window.location.protocol)?e:this.getAddr()+e,"function"==typeof t?(n=t,t={}):t||(t={}),void 0===n&&(n=t.callback),"string"==typeof n&&(n=g.getFunctionByName(n)),delete t.callback;var r={url:s,type:"post",cache:!1,async:"function"==typeof n,data:h.param(a),dataType:"json",beforeSend:function(e,a){if(void 0!==p.Cookies){var t=Cookies.get(g.csrfCookieName);t&&e.setRequestHeader(g.csrfHeaderName,t)}},success:n||function(e){i=e.result}},o=h.extend({},r,t);return h.ajax(o),i},getResponse:function(a){var t,n,e=a.getResponseHeader("content-type");if(e)if(e.startsWith("application/javascript"))t="script",n=a.responseText;else if(e.startsWith("text/html"))t="html",n=a.responseText;else if(e.startsWith("text/xml"))t="xml",n=a.responseText;else if(n=a.responseJSON)t="json";else try{n=JSON.parse(a.responseText),t="json"}catch(e){n=a.responseText,t="text"}else t="json",n={status:"alert",alert:{title:g.i18n.ERROR_OCCURED,content:g.i18n.NO_SERVER_RESPONSE}};return{contentType:t,data:n}},handleJSON:function(e,a,t){var n,s,i,r,o,c,l,d=e.status;switch(d){case"alert":p.alert&&p.alert(e.alert.title+"\n\n"+e.alert.content);break;case"error":g.form.showErrors(a,e);break;case"info":case"success":void 0!==a&&(g.form.resetChanged(a),!1!==e.close_form&&g.dialog.close(a));break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":void 0!==a&&(g.form.resetChanged(a),!1!==e.close_form&&g.dialog.close(a));break;case"modal":g.dialog.open(e.location);break;case"reload":void 0!==a&&(g.form.resetChanged(a),!1!==e.close_form&&g.dialog.close(a)),(n=e.location||window.location.hash).startsWith("#")&&(n=n.substr(1));var m=h(e.target||t||"#content");g.skin.loadURL(n,m,{preLoadCallback:g.getFunctionByName(e.pre_reload)||function(){h("[data-ams-pre-reload]",m).each(function(){g.executeFunctionByName(h(this).data("ams-pre-reload"))})},preLoadCallbackOptions:e.pre_reload_options,afterLoadCallback:g.getFunctionByName(e.post_reload)||function(){h("[data-ams-post-reload]",m).each(function(){g.executeFunctionByName(h(this).data("ams-post-reload"))})},afterLoadCallbackOptions:e.post_reload_options});break;case"redirect":void 0!==a&&(g.form.resetChanged(a),!0===e.close_form&&g.dialog.close(a)),(n=e.location||window.location.href).endsWith("##")&&(n=n.replace(/##/,window.location.hash)),e.window?window.open(n,e.window,e.options):window.location.href===n?window.location.reload(!0):window.location.href=n;break;default:console&&console.log&&console.log("Unhandled status: "+d)}if(e.content&&(i=e.content,r=h(i.target||t||a||"#content"),!0===i.raw?r.text(i.text):(r.html(i.html),g.initContent(r)),i.keep_hidden||r.removeClass("hidden")),e.contents){var u=e.contents;for(s=0;s  '+R.i18n.FORM_CHANGED_WARNING,buttons:R.i18n.BTN_OK_CANCEL},function(e){e===R.i18n.BTN_OK&&t.call(a)}):t.call(a)},setChanged:function(e){e.attr("data-ams-form-changed",!0)},resetChanged:function(e){void 0!==e&&F(e).removeAttr("data-ams-form-changed")},submit:function(t,T,N){if(!(t=F(t)).exists())return!1;if("object"==typeof T&&(N=T,T=void 0),t.data("submitted"))return t.data("ams-form-hide-submitted")||R.skin.messageBox("warning",{title:R.i18n.WAIT,content:R.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:t.data("ams-form-alert-timeout")||5e3}),!1;if(!R.form._checkSubmitValidators(t))return!1;F(".alert-danger, SPAN.state-error",t).not(".persistent").remove(),F(".state-error",t).removeClassPrefix("state-");var e=F(t.data("ams-submit-button"));return e&&!e.data("ams-form-hide-loading")&&(e.data("ams-progress-content",e.html()),e.button("loading")),R.ajax.check(F.fn.ajaxSubmit,R.baseURL+"ext/jquery-form-3.49"+R.devext+".js",function(){function e(s,e){var i,a,t,n,r,o,c,l,d,m,u=s.data(),f=u.amsFormOptions;if(N&&(r=N.formDataInitCallback),r?delete N.formDataInitCallback:r=u.amsFormDataInitCallback,r){var h={};if(n=R.executeFunctionByName(r,s,h),h.veto)return(i=s.data("ams-submit-button"))&&i.button("reset"),R.form.finalizeSubmitFooter.call(s),!1}else n=u.amsFormData||{};(i=F(s.data("ams-submit-button")))&&i.exists()?t=(a=i.data()).amsFormSubmitTarget:a={};var p=T||a.amsFormHandler||u.amsFormHandler||"";if(p.startsWith(window.location.protocol))m=p;else{var g=a.amsFormAction||s.attr("action").replace(/#/,"");m=g.startsWith(window.location.protocol)?g:R.ajax.getAddr()+g,m+=p}o=a.amsProgressHandler||u.amsProgressHandler||"",c=a.amsProgressInterval||u.amsProgressInterval||1e3,l=a.amsProgressCallback||u.amsProgressCallback,d=a.amsProgressEndCallback||u.amsProgressEndCallback;var b,v=null;N&&N.initSubmitTarget?R.executeFunctionByName(N.initSubmitTarget,s):u.amsFormInitSubmitTarget?(v=F(t||u.amsFormSubmitTarget||"#content"),R.executeFunctionByName(u.amsFormInitSubmit||"MyAMS.form.initSubmit",s,v)):u.amsFormHideSubmitFooter||R.executeFunctionByName(u.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",s),N&&(n=F.extend({},n,N.form_data)),o?n.progress_id=R.generateUUID():(b=void 0!==e.uuid)&&(m.indexOf("X-Progress-ID")<0&&(m+="?X-Progress-ID="+e.uuid),delete e.uuid);var y={url:m,type:"post",cache:!1,data:n,dataType:u.amsFormDatatype,beforeSerialize:function(){void 0!==j.tinyMCE&&j.tinyMCE.triggerSave()},beforeSubmit:function(e,a){a.data("submitted",!0)},error:function(e,a,t,n){v&&R.executeFunctionByName(u.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,v),R.form.resetAfterSubmit(n)},iframe:b},x=N&&N.downloadTarget||u.amsFormDownloadTarget;if(x){var C=F('iframe[name="'+x+'"]');C.exists()||(C=F("").hide().attr("name",x).appendTo(F("body"))),y=F.extend({},y,{iframe:!0,iframeTarget:C,success:function(e,a,t,n){if(F(n).parents(".modal-dialog").exists())R.dialog.close(n);else{var s,i=n.data("ams-submit-button");i&&(s=i.data("ams-form-submit-callback")),s||(s=R.getFunctionByName(u.amsFormSubmitCallback)||R.form._submitCallback);try{s.call(n,e,a,t,n)}finally{R.form.resetAfterSubmit(n),R.form.resetChanged(n)}}}})}else y=F.extend({},y,{error:function(e,a,t,n){v&&R.executeFunctionByName(u.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",n,v),R.form.resetAfterSubmit(n)},success:function(e,a,t,n){var s,i=n.data("ams-submit-button");i&&(s=i.data("ams-form-submit-callback")),s||(s=R.getFunctionByName(u.amsFormSubmitCallback)||R.form._submitCallback);try{s.call(n,e,a,t,n)}finally{R.form.resetAfterSubmit(n),R.form.resetChanged(n)}},iframe:b});var k=F.extend({},y,e,f,N);if(o&&function(e,a){var t;function n(){clearInterval(t),R.form.resetAfterSubmit(s,i),i.html(i.data("ams-progress-content")),R.executeFunctionByName(d,s,i),R.form.resetChanged(s)}i.button("loading"),t=setInterval(function(){R.ajax.post(e,{progress_id:a},{error:n},R.getFunctionByName(l)||function(e,a){if("success"===a)if("running"===e.status)if(e.message)i.text(e.message);else{var t=i.data("ams-progress-text")||R.i18n.PROGRESS;e.current?t+=": "+e.current+"/ "+(e.length||100):t+="...",i.text(t)}else"finished"===e.status&&n();else n()})},c)}(o,n.progress_id),F(s).ajaxSubmit(k),x){var S=F(s).parents(".modal-dialog"),w=S.exists()&&i.exists()&&i.data("ams-keep-modal");S.exists()&&!0!==w?R.dialog.close(s):o||setTimeout(function(){R.form.resetAfterSubmit(s,i),R.form.resetChanged(s)},i.data("ams-form-reset-timeout")||2e3)}}if(!0!==t.data("ams-form-ignore-uploads")&&0';a||(a=t.data("ams-form-submit-message")),a&&(n+=""+a+""),F(e).html('
'+n+"
"),F(e).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(e){if(e.is(":visible")){var a=e.data("ams-submit-button");a&&a.button("reset"),R.form.finalizeSubmitFooter.call(e)}e.data("submitted",!1),e.removeData("ams-submit-button")},finalizeSubmitOnError:function(e){F("i",e).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(e){var a=F(this),t='';e||(e=F(this).data("ams-form-submit-message")),e&&(t+=''+e+"");var n=F("footer",a);F("button",n).hide(),n.append('
'+t+"
")},finalizeSubmitFooter:function(){var e=F(this),a=F("footer",e);a&&(F(".row",a).remove(),F("button",a).show())},_submitCallback:function(e,a,t,n){var s;n.is(":visible")&&(R.form.finalizeSubmitFooter.call(n),(s=n.data("ams-submit-button"))&&s.button("reset"));var i,r,o=n.data();if(o.amsFormDatatype)i=o.amsFormDatatype;else{var c=R.ajax.getResponse(t);i=c.contentType,e=c.data}switch(r=F(s?s.data("ams-form-submit-target")||o.amsFormSubmitTarget||"#content":o.amsFormSubmitTarget||"#content"),i){case"json":R.ajax.handleJSON(e,n,r);break;case"script":case"xml":break;case"html":case"text":default:R.form.resetChanged(n),s&&!0!==s.data("ams-keep-modal")&&R.dialog.close(n),r.exists()||(r=F("body")),r.parents(".hidden").removeClass("hidden"),F(".alert",r.parents(".alerts-container")).remove(),r.css({opacity:"0.0"}).html(e).delay(50).animate({opacity:"1.0"},300),R.initContent(r),R.form.setFocus(r)}var l=t.getResponseHeader("X-AMS-Callback");if(l){var d=t.getResponseHeader("X-AMS-Callback-Options");R.executeFunctionByName(l,n,void 0===d?{}:JSON.parse(d),t)}},_getSubmitValidators:function(e){var a=[],t=e.data("ams-form-validator");return t&&a.push([e,t]),F("[data-ams-form-validator]",e).each(function(){var e=F(this);a.push([e,e.data("ams-form-validator")])}),a},_checkSubmitValidators:function(e){var a=R.form._getSubmitValidators(e);if(!a.length)return!0;for(var t=[],n=!0,s=0;s"+i.header+"
"+i.message):s.push(i.message||i)}if(a.widgets)for(n=0;n'+r.message+""):r.label&&s.push(r.label+" : "+r.message);var c=o.parents(".tab-pane").index()+1;if(0
'),"string"==typeof f)m={},u=f;else{m=f.data(),u=f.attr("href")||m.amsUrl;var a=g.getFunctionByName(u);"function"==typeof a&&(u=a.call(f))}u&&(p("body").modalmanager("loading"),0===u.indexOf("#")?p(u).modal("show"):p.ajax({url:u,type:"get",cache:void 0!==m.amsAllowCache&&m.amsAllowCache,data:t,success:function(e,a,t){p("body").modalmanager("removeLoading");var n=g.ajax.getResponse(t),s=n.contentType,i=n.data;switch(s){case"json":g.ajax.handleJSON(i,p(p(f).data("ams-json-target")||"#content"));break;case"script":case"xml":break;case"html":case"text":default:var r=p(i),o=p(".modal-dialog",r.wrap("
").parent()),c=o.data()||{},l={backdrop:"static",overflow:c.amsModalOverflow||".modal-viewport",maxHeight:void 0===c.amsModalMaxHeight?function(){return p(window).height()-p(".modal-header",r).outerHeight(!0)-p("footer",r).outerHeight(!0)-85}:g.getFunctionByName(c.amsModalMaxHeight)},d=p.extend({},l,c.amsModalOptions);d=g.executeFunctionByName(c.amsModalInitCallback,o,d)||d,h&&(h.shown&&g.dialog.registerShownCallback(h.shown,r),h.hide&&g.dialog.registerHideCallback(h.hide,r)),p("
").addClass("modal fade").append(r).modal(d).on("shown",g.dialog.shown).on("hidden",g.dialog.hidden),g.initContent(r),!1!==m.amsLogEvent&&g.stats.logPageview(u)}}}))})})},shown:function(e){function a(e){var a=p(".scrollmarker.top",s),t=s.scrollTop();0=s.get(0).scrollHeight?n.hide():n.show()}var t,n=e.target,s=p(".modal-viewport",n);if(s.exists()){var i=parseInt(s.css("max-height")),r=p.scrollbarWidth();"hidden"!==s.css("overflow")&&s.height()===i?(p("
").addClass("scrollmarker").addClass("top").css("top",0).css("width",s.width()-r).hide().appendTo(s),p("
").addClass("scrollmarker").addClass("bottom").css("top",i-20).css("width",s.width()-r).appendTo(s),s.scroll(a),s.off("resize").on("resize",a)):p(".scrollmarker",s).remove()}p("[data-ams-shown-callback]",n).each(function(){var e=g.getFunctionByName(p(this).data("ams-shown-callback"));e&&e.call(n,this)});var o=p(".modal-dialog",n).data("shown-callbacks");if(o)for(t=0;t"+e.error_message+"",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":i(this).data("select2").dropdown.hide(),r.dialog.open(e.location);break;default:return{results:e.results||e,more:e.has_more||!1,context:e.context}}},select2QueryMethodSuccessCallback:function(e,a,t){var n=e.result;if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}switch(n.status){case"error":r.skin.messageBox("error",{title:r.i18n.ERROR_OCCURED,content:"

"+n.error_message+"

",icon:"fa fa-warning animated shake",timeout:1e4});break;case"modal":i(this).data("select2").dropdown.hide(),r.dialog.open(n.location);break;default:t.callback({results:n.results||n,more:n.has_more||!1,context:n.context})}},select2ChangeHelper:function(){var e=i(this),a=e.data(),t=i(a.amsSelect2HelperTarget);switch(a.amsSelect2HelperType){case"html":t.html('
');var n={};n[a.amsSelect2HelperArgument||"value"]=e.val(),i.get(a.amsSelect2HelperUrl,n,r.getFunctionByName(a.amsSelect2HelperCallback)||function(e){e?(t.html(e),r.initContent(t)):t.empty()}).fail(function(){t.empty()});break;case"json-rpc":t.html('
'),r.jsonrpc.post(a.amsSelect2HelperMethod,{value:e.val()},{url:a.amsSelect2HelperUrl},r.getFunctionByName(a.amsSelect2HelperCallback)||function(e){e.result?(t.html(e.result),r.initContent(t)):t.empty()});break;default:var s=a.amsSelect2HelperCallback;s&&r.executeFunctionByName(s,e,a)}},contextMenuHandler:function(e,a){"A"!==a.get(0).tagName&&(a=a.parents("a").first());var t=a.data();if("modal"===t.toggle)r.dialog.open(a);else{var n=a.attr("href")||t.amsUrl;if(!n||n.startsWith("javascript")||a.attr("target"))return;r.event.stop();var s=r.getFunctionByName(n);"function"==typeof s&&(n=s.call(a,e)),"function"==typeof n?n.call(a,e):(n=n.replace(/\%23/,"#"),(e=a.data("ams-target"))?r.form.confirmChangedForm(e,function(){r.skin.loadURL(n,e,a.data("ams-link-options"),a.data("ams-link-callback"))}):r.form.confirmChangedForm(function(){n.startsWith("#")?n!==location.hash&&(r.root.hasClass("mobile-view-activated")?(r.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=n},150)):window.location.hash=n):window.location=n}))}},datetimepickerDialogHiddenCallback:function(){i(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")},clearSearchTarget:function(){var e=i(this);if(!e.val()){var a=i(e).parents("form").first();i(a.data("ams-form-submit-target")).empty()}},setSEOStatus:function(){var e=i(this),a=e.siblings(".progress").children(".progress-bar"),t=Math.min(e.val().length,100),n="success";t<20||80').prependTo(y(this)).addClass("open"===i.amsSwitcherState?i.amsSwitcherMinusClass||"fa-minus":i.amsSwitcherPlusClass||"fa-plus"),n.on("click",function(e){e.preventDefault();var a={};if(n.trigger("ams.switcher.before-switch",[n,a]),!a.veto)if(s.hasClass("switched")){s.removeClass("switched"),y(".fa",n).removeClass(i.amsSwitcherPlusClass||"fa-plus").addClass(i.amsSwitcherMinusClass||"fa-minus"),n.trigger("ams.switcher.opened",[n]);var t=n.attr("id");t&&y('legend.switcher[data-ams-switcher-sync="'+t+'"]',s).each(function(){var e=y(this);e.parents("fieldset").hasClass("switched")&&e.click()})}else s.addClass("switched"),y(".fa",n).removeClass(i.amsSwitcherMinusClass||"fa-minus").addClass(i.amsSwitcherPlusClass||"fa-plus"),n.trigger("ams.switcher.closed",[n])}),"open"!==i.amsSwitcherState&&s.addClass("switched"),n.data("ams-switcher","on"))})},checker:function(e){y("LEGEND.checker",e).each(function(){var s=y(this),i=s.parent("fieldset"),r=s.data();if(!r.amsChecker){var e=y(''),a=r.amsCheckerFieldname||"checker_"+x.generateId(),t=a.replace(/\./,"_"),n=r.amsCheckerHiddenPrefix,o=null,c=r.amsCheckerHiddenValueOn||"true",l=r.amsCheckerHiddenValueOff||"false",d=r.amsCheckerMarker||!1;n?o=y('').attr("name",n+a).val("on"===r.amsCheckerState?c:l).prependTo(s):d&&y('').attr("name",d).attr("value",1).prependTo(s);var m=y('').attr("name",a).attr("id",t).data("ams-checker-hidden-input",o).data("ams-checker-init",!0).val(r.amsCheckerValue||!0).attr("checked","on"===r.amsCheckerState?"checked":null);r.amsCheckerReadonly?m.attr("disabled","disabled"):m.on("change",function(e){e.preventDefault();var a={},t=y(this).is(":checked");if(s.trigger("ams.checker.before-switch",[s,a]),a.veto)y(this).prop("checked",!t);else if(x.executeFunctionByName(r.amsCheckerChangeHandler,s,t),!r.amsCheckerCancelDefault){var n=m.data("ams-checker-hidden-input");t?("disable"===r.amsCheckerMode?(i.removeAttr("disabled"),y(".select2",i).removeAttr("disabled")):i.removeClass("switched"),n&&n.val(c),y("[data-required]",i).attr("required","required"),s.trigger("ams.checker.opened",[s])):("disable"===r.amsCheckerMode?(i.prop("disabled","disabled"),y(".select2",i).attr("disabled","disabled")):i.addClass("switched"),n&&n.val(l),y("[data-required]",i).removeAttr("required"),s.trigger("ams.checker.closed",[s]))}}),m.appendTo(e),y(">label",s).attr("for",m.attr("id")),e.append("").prependTo(s);var u=y("[required]",i);u.attr("data-required",!0),"on"===r.amsCheckerState?m.attr("checked",!0):("disable"===r.amsCheckerMode?(i.attr("disabled","disabled"),y(".select2",i).attr("disabled","disabled")):i.addClass("switched"),u.removeAttr("required")),s.data("ams-checker","on")}})},slider:function(e){var a=y(".slider",e);0r<'dt-wrapper't"+(0<=h.indexOf("scroller")?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(!1===f.amsDatatableInformation?"":"i")+"><'col-sm-6 text-right'p>>",a=f.amsDatatableSorting;if("string"==typeof a){var t=a.split(";");for(a=[],m=0;m')}},p=y.extend({},d,f.amsDatatableOptions),g=[],b=[],v=[];if(0  '+c.i18n.DELETE_WARNING,status:"info",buttons:c.i18n.BTN_OK_CANCEL},function(e){if(e===c.i18n.BTN_OK){var t=r.parents("tr").first(),n=t.parents("table").first(),a=t.data("ams-location")||n.data("ams-location")||"";a&&(a+="/");var s=t.data("ams-delete-target")||n.data("ams-delete-target")||"delete-element.json",i=t.data("ams-element-name");o.ajax.post(a+s,{object_name:i},function(e,a){"success"===e.status?(n.hasClass("datatable")?n.dataTable().fnDeleteRow(t[0]):t.remove(),e.handle_json&&o.ajax.handleJSON(e)):o.ajax.handleJSON(e)})}})}},switchElementVisibility:function(){return function(){var t=i(this),e=t.parents("td").first(),a=t.parents("tr").first(),n=a.parents("table");i("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),c.ajax.post(n.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||n.data("ams-attribute-switcher")),{object_name:a.data("ams-element-name")},function(e,a){e.visible?i("i",t).attr("class","fa fa-fw fa-eye"):i("i",t).attr("class","fa fa-fw fa-eye-slash text-danger")})}},switchElementAttribute:function(){return function(){var t=i(this),e=t.parents("td").first(),n=e.data("ams-switcher-attribute-name"),a=t.parents("tr").first(),s=a.parents("table");i("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),c.ajax.post(s.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||s.data("ams-attribute-switcher")),{object_name:a.data("ams-element-name")},function(e,a){e[n]||e.on?i("i",t).attr("class",s.data("ams-"+n+"-icon-on")||"fa fa-fw fa-check-square-o"):i("i",t).attr("class",s.data("ams-"+n+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75")})}}}}(jQuery,this),function(h,e){var c=e.MyAMS,p=c;c.tree={switchTableNode:function(){var e=h(this),i=h("i.switch",e),r=e.parents("tr").first(),o=r.parents("table").first();if(i.hasClass("fa-minus-square-o"))!function a(e){h('tr[data-ams-tree-node-parent-id="'+e+'"]').each(function(){var e=h(this);a(e.data("ams-tree-node-id")),e.remove()})}(r.data("ams-tree-node-id")),i.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var a=r.data("ams-location")||o.data("ams-location")||"",t=r.data("ams-tree-nodes-target")||o.data("ams-tree-nodes-target")||"get-tree-nodes.json",n=r.data("ams-element-name");i.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),c.ajax.post(a+"/"+n+"/"+t,{can_sort:!h("td.sorter",r).is(":empty")},function(e,a){if(0span");0'),o.ajax.post(r.data("ams-location")+"/"+a.data("ams-switch-handler"),{object_name:i.data("ams-element-name")},function(e){s.html(e),e&&(o.initContent(s),t.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"))})}else o.skin.cleanContainer(s),s.empty(),t.removeClass("fa-minus-square-o").addClass("fa-plus-square-o")},_initDesktopWidgets:function(e){if(d.enableWidgets){var a=l(".ams-widget",e);0

'+t+"

"+(s?"

"+s+"

":"");if("string"==typeof n)r+="
  • "+n+"
";else if(n){for(var o in r+="
    ",n)l.isNumeric(o)&&(r+="
  • "+n[o]+"
  • ");r+="
"}l(r+="
").insertBefore(e),e.exists&&d.skin.scrollTo(e,{offset:{top:-50}})},bigBox:function(e,a){d.ajax.check(d.notify,d.baseURL+"myams-notify"+d.devext+".js",function(){d.notify.messageBox(e,a)})},messageBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),d.ajax.check(d.notify,d.baseURL+"myams-notify"+d.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,d.notify.bigBox(a,t)})},smallBox:function(e,a,t){"object"==typeof e&&(t=a,a=e||{},e="info"),d.ajax.check(d.notify,d.baseURL+"myams-notify"+d.devext+".js",function(){switch(e){case"error":case"danger":a.color="#C46A69";break;case"warning":a.color="#C79121";break;case"success":a.color="#739E73";break;default:a.color=a.color||"#3276B1"}a.sound=!1,d.notify.smallBox(a,t)})},scrollTo:function(t,n){d.ajax.check(l.scrollTo,d.baseURL+"ext/jquery-scrollto-2.1.2"+d.devext+".js",function(){var e=l("body"),a=n.offset||0;e.hasClass("fixed-header")&&(a-=l("#header").height()),e.hasClass("fixed-ribbon")&&(a-=l("#ribbon").height()),n=l.extend({},n,{offset:a}),l.scrollTo(t,n)})},_drawBreadCrumb:function(){var n=l("OL.breadcrumb","#ribbon");l("li",n).not(".parent").remove(),l("li",n).exists()||n.append(l("
  • ").append(l("").text(d.i18n.HOME).addClass("padding-right-5").attr("href",l('nav a[href!="#"]:first').attr("href")))),l("LI.active >A","nav").each(function(){var e=l(this),a=l.trim(e.clone().children(".badge").remove().end().text()),t=l("
  • ").append(e.attr("href").replace(/^#/,"")?l("").html(a).attr("href",e.attr("href")):a);n.append(t)})},checkURL:function(){function e(e){l(".active",t).removeClass("active"),e.addClass("open").addClass("active"),e.parents("li").addClass("open active").children("ul").addClass("active").show(),e.parents("li:first").removeClass("open"),e.parents("ul").addClass(e.attr("href").replace(/^#/,"")?"active":"").show()}var a,t=l("nav"),n=location.hash,s=n.replace(/^#/,"");if(s){var i=l("#content");i.exists()||(i=l("body")),(a=l('A[href="'+n+'"]',t)).exists()&&e(a),d.skin.loadURL(s,i,{afterLoadCallback:function(){var e=l("html head title").data("ams-title-prefix");document.title=(e?e+" > ":"")+(l("[data-ams-page-title]:first",i).data("ams-page-title")||a.attr("title")||document.title)}})}else{var r=l("[data-ams-active-menu]").data("ams-active-menu");(a=r?l('A[href="'+r+'"]',t):l('>UL >LI >A[href!="#"]',t).first()).exists()&&(e(a),r?d.skin._drawBreadCrumb():window.location.hash=a.attr("href"))}},_clean_callbacks:[],registerCleanCallback:function(e){var a=d.skin._clean_callbacks;a.indexOf(e)<0&&a.push(e)},unregisterCleanCallback:function(e){var a=d.skin._clean_callbacks,t=a.indexOf(e);0<=t&&a.splice(t,1)},cleanContainer:function(e){for(var a=d.skin._clean_callbacks,t=0;t '+d.i18n.LOADING+" "),r[0]===l("#content")[0]){d.skin._drawBreadCrumb();var e=l("html head title").data("ams-title-prefix");document.title=(e?e+" > ":"")+l(".breadcrumb LI:last-child").text(),l("html, body").animate({scrollTop:0},"fast")}else r.animate({scrollTop:0},"fast")},success:function(e,a,t){if(c)d.executeFunctionByName(c,this,e,a,t,o);else{var n=d.ajax.getResponse(t),s=n.contentType,i=n.data;switch(l(".loading",r).remove(),s){case"json":d.ajax.handleJSON(i,r);break;case"script":case"xml":break;case"html":case"text":default:r.parents(".hidden").removeClass("hidden"),l(".alert",r.parents(".alerts-container")).remove(),r.css({opacity:"0.0"}).html(e).removeClass("hidden").delay(50).animate({opacity:"1.0"},300),d.initContent(r),d.form.setFocus(r)}o&&o.afterLoadCallback&&d.executeFunctionByName(o.afterLoadCallback,this,o.afterLoadCallbackOptions),d.stats.logPageview()}},error:function(e,a,t){r.html('

    '+d.i18n.ERROR+t+"

    "+e.responseText),o&&o.afterErrorCallback&&d.executeFunctionByName(o.afterErrorCallback,this)},async:void 0===o.async||o.async},t=l.extend({},a,o);l.ajax(t)},setLanguage:function(e,a){var t=a.lang;switch(a.handler_type||"json"){case"json":var n=a.method||"setUserLanguage";d.jsonrpc.post(n,{lang:t},function(){window.location.reload(!0)});break;case"ajax":var s=a.href||"setUserLanguage";d.ajax.post(s,{lang:t},function(){window.location.reload(!0)})}},logout:function(){window.location=d.loginURL}}}(jQuery,this),function(e,n){var a=n.MyAMS;a.stats={logPageview:function(e){if(void 0!==n._gaq){var a=n.window.location;n._gaq.push(["_trackPageview",e||a.pathname+a.hash])}},logEvent:function(e,a,t){void 0!==n._gaq&&("object"==typeof e&&(a=e.action,t=e.label,e=e.category),n._gaq.push(["_trackEvent",e,a,t]))}}}(jQuery,this),function(c,s){var i=s.MyAMS,l=i;i.initPage=function(){var a=c("body");l.root=a,l.leftPanel=c("#left-panel"),l.shortcuts=c("#shortcuts"),l.plugins.initData(a);var t=c.ajaxSettings.xhr;c.ajaxSetup({beforeSend:function(e,a){if(l.safeMethods.indexOf(a.type)<0&&void 0!==s.Cookies){var t=Cookies.get(l.csrfCookieName);t&&e.setRequestHeader(l.csrfHeaderName,t)}},progress:l.ajax.progress,progressUpload:l.ajax.progress,xhr:function(){var e=t();if(e&&"function"==typeof e.addEventListener){var a=this;a&&a.progress&&e.addEventListener("progress",function(e){a.progress(e)},!1)}return e}}),c(document).ajaxStart(l.ajax.start),c(document).ajaxStop(l.ajax.stop),c(document).ajaxError(l.error.ajax);var e=s.localStorage&&s.localStorage.getItem("window-state");e&&a.addClass(e),l.isMobile?(l.root.addClass("mobile-detected"),l.device="mobile",l.enableFastclick&&l.ajax.check(c.fn.noClickDelay,l.baseURL+"/ext/jquery-smartclick"+l.devext+".js",function(){c("NAV UL A").noClickDelay(),c("A","#hide-menu").noClickDelay()})):(l.root.addClass("desktop-detected"),l.device="desktop"),c("#show-shortcuts").click(function(e){l.shortcuts.is(":visible")?l.skin._hideShortcutButtons():l.skin._showShortcutButtons(),e.preventDefault()}),l.shortcuts.click(function(e){l.skin._hideShortcutButtons()}),c(document).mouseup(function(e){l.shortcuts.is(e.target)||0!==l.shortcuts.has(e.target).length||l.skin._hideShortcutButtons()}),c("#search-mobile").click(function(){l.root.addClass("search-mobile")}),c("#cancel-search-js").click(function(){l.root.removeClass("search-mobile")}),c(".activity-button","#user-activity").click(function(e){var a=c("#user-activity"),t=c(".ajax-dropdown",a);t.is(":visible")?(t.fadeOut(150),a.removeClass("active")):(t.css("left",-t.innerWidth()+a.innerWidth()).fadeIn(150),a.addClass("active")),e.preventDefault()}),l.skin.checkNotification(),c(document).mouseup(function(e){var a=c(".ajax-dropdown");a.is(e.target)||0!==a.has(e.target).length||a.fadeOut(150).prev().removeClass("active")}),c('input[name="activity"]').change(function(e){var a=c(this).data("ams-url");if(a){e.preventDefault(),e.stopPropagation();var t=l.getFunctionByName(a);if("function"==typeof t&&(a=t.call(this)),"function"==typeof a)a.call(this);else{var n=c(".ajax-notifications");l.skin.loadURL(a,n)}}}),c("a","#user-menu LI.logout").click(function(e){e.preventDefault(),e.stopPropagation(),l.loginURL=c(this).attr("href"),l.skin.bigBox({title:" "+l.i18n.LOGOUT+" "+c("#show-shortcut").text()+" ?",content:l.i18n.LOGOUT_COMMENT,buttons:l.i18n.BTN_YES_NO},function(e){e===l.i18n.BTN_YES&&(l.root.addClass("animated fadeOutUp"),setTimeout(l.skin.logout,1e3))})});var n=c("nav");c("UL",n).myams_menu({accordion:!1!==n.data("ams-menu-accordion"),speed:l.menuSpeed}),c("#hide-menu").find(">:first-child >A").click(function(e){a.toggleClass("hidden-menu"),s.localStorage&&(a.hasClass("hidden-menu")?s.localStorage.setItem("window-state","hidden-menu"):s.localStorage.setItem("window-state","")),e.preventDefault()}),c(".minifyme").click(function(e){a.toggleClass("minified"),s.localStorage&&(a.hasClass("minified")?s.localStorage.setItem("window-state","minified"):s.localStorage.setItem("window-state","")),c(this).effect("highlight",{},500),e.preventDefault()}),c("#refresh").click(function(e){l.skin.bigBox({title:" "+l.i18n.CLEAR_STORAGE_TITLE,content:l.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+l.i18n.BTN_CANCEL+"]["+l.i18n.BTN_OK+"]"},function(e){e===l.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),e.preventDefault()}),a.on("click",function(e){var a=c(this);a.is(e.target)||0!==a.has(e.target).length||0!==c(".popover").has(e.target).length||a.popover("hide")}),l.ajax.check(c.resize,l.baseURL+"ext/jquery-resize"+l.devext+".js",function(){c("#main").resize(function(){l.skin._setPageHeight(),l.skin._checkMobileWidth()}),n.resize(function(){l.skin._setPageHeight()})}),l.ajaxNav&&(c(document).on("click",'a[href="#"]',function(e){e.preventDefault()}),c(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(e){var a=c(e.currentTarget),t=a.data("ams-disabled-handlers");if(!0!==t&&"click"!==t&&"all"!==t){var n=a.attr("href")||a.data("ams-url");if(n&&!n.startsWith("javascript")&&!a.attr("target")&&!0!==a.data("ams-context-menu")){var s,i;e.preventDefault(),e.stopPropagation(),0<=n.indexOf("?")?(s=n.split("?"),r=s[0],i=s[1].unserialize()):(r=n,i=void 0);var r,o=l.getFunctionByName(r);if("function"==typeof o&&(n=o.call(a,i)),"function"==typeof n)n.call(a,i);else if(n=n.replace(/\%23/,"#"),e.ctrlKey)window.open(n);else(r=a.data("ams-target"))?l.form.confirmChangedForm(r,function(){l.skin.loadURL(n,r,a.data("ams-link-options"),a.data("ams-link-callback"))}):l.form.confirmChangedForm(function(){n.startsWith("#")?n!==location.hash&&(l.root.hasClass("mobile-view-activated")?(l.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=n},50)):window.location.hash=n):window.location=n})}}}),c(document).on("click",'a[target="_blank"]',function(e){e.preventDefault();var a=c(e.currentTarget);window.open(a.attr("href")),l.stats.logEvent(a.data("ams-stats-category")||"Navigation",a.data("ams-stats-action")||"External",a.data("ams-stats-label")||a.attr("href"))}),c(document).on("click",'a[target="_top"]',function(e){e.preventDefault(),l.form.confirmChangedForm(function(){window.location=c(e.currentTarget).attr("href")})}),c(window).on("hashchange",l.skin.checkURL)),c(document).off("click.modal").on("click",'[data-toggle="modal"]',function(e){var a=c(this),t=a.data("ams-disabled-handlers");!0!==t&&"click"!==t&&"all"!==t&&!0!==a.data("ams-context-menu")&&(!0===a.data("ams-stop-propagation")&&e.stopPropagation(),e.preventDefault(),l.dialog.open(a),a.parents("#shortcut").exists()&&setTimeout(l.skin._hideShortcutButtons,300))}),c(document).on("click",'button[type="submit"], button.submit',function(){var e=c(this);c(e.get(0).form).data("ams-submit-button",e)}),c(document).on("click",'input[type="checkbox"][readonly]',function(){return!1}),c(document).on("click","[data-ams-click-handler]",function(e){var a=c(this),t=a.data("ams-disabled-handlers");if(!0!==t&&"click"!==t&&"all"!==t){var n=a.data();if(n.amsClickHandler){!0!==n.amsStopPropagation&&!0!==n.amsClickStopPropagation||e.stopPropagation(),!0!==n.amsClickKeepDefault&&e.preventDefault();for(var s=n.amsClickHandler.split(/\s+/),i=0;i'),l.skin.loadURL(t.amsUrl,a.attr("href"),{afterLoadCallback:function(){t.amsTabLoadOnce&&a.data("ams-tab-loaded",!0),c("i",a).remove()},afterErrorCallback:function(){c("i",a).remove()}})}}),c(document).on("hide.bs.modal",function(e){var a=c(e.target);l.form.confirmChangedForm(a,function(){var e=a.data("modal")||a.data("bs.modal");return e&&(e.isShown=!0),!0},function(){return e.preventDefault(),!1})}),c(document).on("myams.refresh",function(e,a){i.executeFunctionByName(a.handler||i.skin.refreshContent,e.target,a)}),l.initContent(document),l.ajaxNav&&n.exists()&&l.skin.checkURL(),l.form.setFocus(document),c(window).on("beforeunload",l.form.checkBeforeUnload)},i.initContent=function(e){c(".tipsy").remove(),c("[rel=tooltip]",e).tooltip(),c("[rel=popover]",e).popover(),c("[rel=popover-hover]",e).popover({trigger:"hover"}),l.plugins.init(e),l.callbacks.init(e),l.events.init(e),l.form.init(e),"desktop"===l.device?l.skin._initDesktopWidgets(e):l.skin._initMobileWidgets(e),l.skin._setPageHeight()},i.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"},i.plugins.i18n={widgets:{},validate:{},datatables:{},fancybox:{ERROR:"Can't load requested content.",RETRY:"Please check URL or try again later.",CLOSE:"Close",NEXT:"Next",PREVIOUS:"Previous"},dndupload:{FILES_SELECTED:"{count} files selected",CHOOSE_FILE:"Select file(s)",ADD_INFO:"to add them to current folder,",DRAG_FILE:"or drag and drop them here!",UPLOAD:"Upload",UPLOADING:"Uploading…",DONE:"Done!",UPLOAD_MORE:"Upload more?",ERROR:"Error!",TRY_AGAIN:"Try again?"}},c(document).ready(function(){var e=(c=jQuery.noConflict())("HTML");e.removeClass("no-js").addClass("js");var a=e.attr("lang")||e.attr("xml:lang");a&&!a.startsWith("en")?(i.lang=a,i.getScript(i.baseURL+"i18n/myams_"+a.substr(0,2)+i.devext+".js",function(){i.initPage()})):i.initPage()})}(jQuery,this); +"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"]').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),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){var t=a.MyAMS;t.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,n=t;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(s){function i(s){var i=!1;if(window.clipboardData&&window.clipboardData.setData)i=clipboardData.setData("Text",s);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var r=e("