# HG changeset patch # User Thierry Florac # Date 1401831955 -7200 # Node ID 2c6d47b76a7b93633df3f52abcfadbe1840dc7e2 # Parent 173b951c6aefe3c8f0f179274bade6672fe7ea86 Updated javascript API diff -r 173b951c6aef -r 2c6d47b76a7b src/ztfy/myams/resources/js/i18n/myams_fr.js --- a/src/ztfy/myams/resources/js/i18n/myams_fr.js Tue Jun 03 23:40:12 2014 +0200 +++ b/src/ztfy/myams/resources/js/i18n/myams_fr.js Tue Jun 03 23:45:55 2014 +0200 @@ -52,7 +52,9 @@ BTN_CANCEL: "Annuler", BTN_YES: "Oui", BTN_NO: "Non", + BTN_OK_CANCEL: "[OK][Annuler]", + FORM_CHANGED_WARNING: "Certaines modifications n'ont pas été enregistrées.\nCes modifications seront perdues si vous quittez cette page.", NO_UPDATE: "Aucune modification effectuée.", DATA_UPDATED: "Données enregistrées.", diff -r 173b951c6aef -r 2c6d47b76a7b src/ztfy/myams/resources/js/i18n/myams_fr.min.js --- a/src/ztfy/myams/resources/js/i18n/myams_fr.min.js Tue Jun 03 23:40:12 2014 +0200 +++ b/src/ztfy/myams/resources/js/i18n/myams_fr.min.js Tue Jun 03 23:45:55 2014 +0200 @@ -1,1 +1,1 @@ -(function(b){if(b.datepicker){var a={closeText:"Fermer",prevText:"Précédent",nextText:"Suivant",currentText:"Aujourd'hui",monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],weekHeader:"Sem.",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};b.datepicker.setDefaults(a)}b.extend(MyAMS.i18n,{INFO:"Information",WARNING:"!! ATTENTION !!",ERROR:"ERREUR : ",WAIT:"Veuillez patienter...",FORM_SUBMITTED:"Vous avez déjà soumis ce formulaire !",ERROR_OCCURED:"Une erreur s'est produite !",ERRORS_OCCURED:"Des erreurs se sont produites !",NO_SERVER_RESPONSE:"Pas de réponse du serveur !",BAD_LOGIN_TITLE:"Paramètres de connexion incorrects !",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirmation",CONFIRM_REMOVE:"La suppression de cet élément ne peut pas être annulée. Confirmez-vous ?",CLEAR_STORAGE_TITLE:"Effacer le stockage local ?",CLEAR_STORAGE_CONTENT:"Le stockage local permet de mémoriser au sein de votre navigateur le paramétrage des composants sur l'ensemble de ce site.
Êtes-vous sûr(e) de vouloir effacer ces paramètres pour l'ensemble de l'application ?",BTN_OK:"OK",BTN_CANCEL:"Annuler",BTN_YES:"Oui",BTN_NO:"Non",NO_UPDATE:"Aucune modification effectuée.",DATA_UPDATED:"Données enregistrées.",HOME:"Accueil",LOGOUT:"Déconnexion",LOGOUT_COMMENT:"Vous pouvez renforcer votre sécurité en fermant la fenêtre de ce navigateur une fois la déconnexion effectuée...",SELECT2_PLURAL:"s",SELECT2_NOMATCHES:"Pas de correspondance",SELECT2_SEARCHING:"Recherche...",SELECT2_LOADMORE:"Chargement en cours...",SELECT2_INPUT_TOOSHORT:"Veuillez saisir au moins {0} caractère{1}",SELECT2_INPUT_TOOLONG:"Veuillez supprimer {0} caractère{1}",SELECT2_SELECTION_TOOBIG:"Vous ne pouvez sélectionner que {0} élément{1}",SELECT2_FREETAG_PREFIX:"Texte libre : ",DT_COLUMNS:"Colonnes"});MyAMS.plugins.i18n={widgets:{SETTINGS_KEY_LABEL:"Réinitialiser les paramètres de ce composant ?",POSITION_KEY_LABEL:"Réinitialiser la position de ce composant ?",TIMESTAMP_FORMAT:"Dernière mise à jour: %d%/%m%/%y% %h%:%i%:%s",ERROR_LABEL:"Une erreur s'est produite : ",UPDATED_LABEL:"Dernière mise à jour : ",REFRESH_LABEL:"Rafraîchir",EDIT_BTN:"Modifier le titre",DELETE_BTN:"Supprimer",DELETE_LABEL:"Supprimer le composant : ",DELETE_MSG:"ATTENTION : cette action ne peut pas être annulée !",FULLSCREEN_BTN:"Plein écran",COLLAPSE_BTN:"Replier",REFRESH_BTN:"Recharger le contenu",LOADING_MSG:"Chargement..."},validate:{required:"Ce champ est obligatoire.",remote:"Veuillez corriger ce champ.",email:"Veuillez saisir une adresse mail valide.",url:"Veuillez saisir une URL valide.",date:"Veuillez saisir une date valide.",dateISO:"Veuillez saisir une date valide (format ISO).",number:"Veuillez saisir un nombre.",digits:"Veuillez ne saisir que des chiffres.",creditcard:"Veuillez saisir un numéro de carte valide.",equalTo:"Veuillez saisir la même valeur.",maxlength:"Ce champ est limité à {0} caractères.",minlength:"Ce champ doit faire au moins {0} caractères.",rangelength:"Ce champ doit comporter entre {0} et {1} caractères.",range:"Veuillez saisir une valeur entre {0} et {1}.",max:"Veuillez saisir une valeur inférieure ou égale à {0}.",min:"Veuillez saisir une valeur supérieure ou égale à {0}."},datatables:{sProcessing:"Traitement en cours...",sSearch:"Filtrer...",sLengthMenu:"Afficher _MENU_ éléments par page",sInfo:"Affichage des éléments _START_ à _END_ sur _TOTAL_",sInfoEmpty:"Aucun élément à afficher",sInfoFiltered:"(sur un total de _MAX_)",sInfoPostFix:"",sLoadingRecords:"Chargement en cours...",sZeroRecords:"Aucun élément à afficher",sEmptyTable:"Aucune donnée disponible dans le tableau",oPaginate:{sFirst:"Premier",sPrevious:"Précédent",sNext:"Suivant",sLast:"Dernier"},sColumns:"Colonnes",oAria:{sSortAscending:": activer pour trier la colonne par ordre croissant",sSortDescending:": activer pour trier la colonne par ordre décroissant"}}}})(jQuery); \ No newline at end of file +(function(b){if(b.datepicker){var a={closeText:"Fermer",prevText:"Précédent",nextText:"Suivant",currentText:"Aujourd'hui",monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],weekHeader:"Sem.",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};b.datepicker.setDefaults(a)}b.extend(MyAMS.i18n,{INFO:"Information",WARNING:"!! ATTENTION !!",ERROR:"ERREUR : ",WAIT:"Veuillez patienter...",FORM_SUBMITTED:"Vous avez déjà soumis ce formulaire !",ERROR_OCCURED:"Une erreur s'est produite !",ERRORS_OCCURED:"Des erreurs se sont produites !",NO_SERVER_RESPONSE:"Pas de réponse du serveur !",BAD_LOGIN_TITLE:"Paramètres de connexion incorrects !",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirmation",CONFIRM_REMOVE:"La suppression de cet élément ne peut pas être annulée. Confirmez-vous ?",CLEAR_STORAGE_TITLE:"Effacer le stockage local ?",CLEAR_STORAGE_CONTENT:"Le stockage local permet de mémoriser au sein de votre navigateur le paramétrage des composants sur l'ensemble de ce site.
Êtes-vous sûr(e) de vouloir effacer ces paramètres pour l'ensemble de l'application ?",BTN_OK:"OK",BTN_CANCEL:"Annuler",BTN_YES:"Oui",BTN_NO:"Non",BTN_OK_CANCEL:"[OK][Annuler]",FORM_CHANGED_WARNING:"Certaines modifications n'ont pas été enregistrées.\nCes modifications seront perdues si vous quittez cette page.",NO_UPDATE:"Aucune modification effectuée.",DATA_UPDATED:"Données enregistrées.",HOME:"Accueil",LOGOUT:"Déconnexion",LOGOUT_COMMENT:"Vous pouvez renforcer votre sécurité en fermant la fenêtre de ce navigateur une fois la déconnexion effectuée...",SELECT2_PLURAL:"s",SELECT2_NOMATCHES:"Pas de correspondance",SELECT2_SEARCHING:"Recherche...",SELECT2_LOADMORE:"Chargement en cours...",SELECT2_INPUT_TOOSHORT:"Veuillez saisir au moins {0} caractère{1}",SELECT2_INPUT_TOOLONG:"Veuillez supprimer {0} caractère{1}",SELECT2_SELECTION_TOOBIG:"Vous ne pouvez sélectionner que {0} élément{1}",SELECT2_FREETAG_PREFIX:"Texte libre : ",DT_COLUMNS:"Colonnes"});MyAMS.plugins.i18n={widgets:{SETTINGS_KEY_LABEL:"Réinitialiser les paramètres de ce composant ?",POSITION_KEY_LABEL:"Réinitialiser la position de ce composant ?",TIMESTAMP_FORMAT:"Dernière mise à jour: %d%/%m%/%y% %h%:%i%:%s",ERROR_LABEL:"Une erreur s'est produite : ",UPDATED_LABEL:"Dernière mise à jour : ",REFRESH_LABEL:"Rafraîchir",EDIT_BTN:"Modifier le titre",DELETE_BTN:"Supprimer",DELETE_LABEL:"Supprimer le composant : ",DELETE_MSG:"ATTENTION : cette action ne peut pas être annulée !",FULLSCREEN_BTN:"Plein écran",COLLAPSE_BTN:"Replier",REFRESH_BTN:"Recharger le contenu",LOADING_MSG:"Chargement..."},validate:{required:"Ce champ est obligatoire.",remote:"Veuillez corriger ce champ.",email:"Veuillez saisir une adresse mail valide.",url:"Veuillez saisir une URL valide.",date:"Veuillez saisir une date valide.",dateISO:"Veuillez saisir une date valide (format ISO).",number:"Veuillez saisir un nombre.",digits:"Veuillez ne saisir que des chiffres.",creditcard:"Veuillez saisir un numéro de carte valide.",equalTo:"Veuillez saisir la même valeur.",maxlength:"Ce champ est limité à {0} caractères.",minlength:"Ce champ doit faire au moins {0} caractères.",rangelength:"Ce champ doit comporter entre {0} et {1} caractères.",range:"Veuillez saisir une valeur entre {0} et {1}.",max:"Veuillez saisir une valeur inférieure ou égale à {0}.",min:"Veuillez saisir une valeur supérieure ou égale à {0}."},datatables:{sProcessing:"Traitement en cours...",sSearch:"Filtrer...",sLengthMenu:"Afficher _MENU_ éléments par page",sInfo:"Affichage des éléments _START_ à _END_ sur _TOTAL_",sInfoEmpty:"Aucun élément à afficher",sInfoFiltered:"(sur un total de _MAX_)",sInfoPostFix:"",sLoadingRecords:"Chargement en cours...",sZeroRecords:"Aucun élément à afficher",sEmptyTable:"Aucune donnée disponible dans le tableau",oPaginate:{sFirst:"Premier",sPrevious:"Précédent",sNext:"Suivant",sLast:"Dernier"},sColumns:"Colonnes",oAria:{sSortAscending:": activer pour trier la colonne par ordre croissant",sSortDescending:": activer pour trier la colonne par ordre décroissant"}}}})(jQuery); \ No newline at end of file diff -r 173b951c6aef -r 2c6d47b76a7b src/ztfy/myams/resources/js/myams.js --- a/src/ztfy/myams/resources/js/myams.js Tue Jun 03 23:40:12 2014 +0200 +++ b/src/ztfy/myams/resources/js/myams.js Tue Jun 03 23:45:55 2014 +0200 @@ -2,7 +2,7 @@ * MyAMS * « My Application Management Skin » * - * $Tag$ + * $Tag: 0.1.2 $ * A bootstrap based application/administration skin * * Custom administration and application skin tools @@ -102,6 +102,9 @@ */ $.fn.extend({ + /* + * Check if current object is empty or not + */ exists: function() { return $(this).length > 0; }, @@ -136,6 +139,9 @@ } }, + /* + * Remove CSS classes starting with a given prefix + */ removeClassPrefix: function (prefix) { this.each(function (i, it) { var classes = it.className.split(" ").map(function(item) { @@ -146,6 +152,9 @@ return this; }, + /* + * Main menus manager + */ myams_menu: function(options) { // Extend our default options with those provided var defaults = { @@ -321,6 +330,7 @@ enable_widgets: true, enable_mobile: false, enable_fastclick: false, + warn_on_form_change: false, ismobile: (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())) }; } @@ -613,6 +623,21 @@ }, /** + * Handle AJAX upload and download progress + * + * @param event: the source event + * @param request: the request + * @param options: AJAX options + */ + progress: function(event) { + if (!event.lengthComputable) + return; + if (event.loaded >= event.total) + return; + console.log(parseInt((event.loaded / event.total * 100), 10) + "%"); + }, + + /** * Post data to given URL */ post: function(url, data, options, callback) { @@ -764,7 +789,7 @@ } if (result.content) { var content = result.content; - var container = $(content.target || form || '#content'); + var container = $(content.target || target || form || '#content'); container.html(content.html); ams.initContent(container); } @@ -774,7 +799,7 @@ ams.skin.alert($(form || '#content'), status, '', message); else - ams.skin.alert($(message.target || form || '#content'), + ams.skin.alert($(message.target || target || form || '#content'), message.status || 'success', message.header, message.body, @@ -886,7 +911,7 @@ * - @options: additional JSON-RPC procedure parameters * - @callback: name of a callback which will be called on server response */ - post: function(method, options, callback) { + post: function(method, data, options, callback) { ams.ajax.check($.jsonRpc, ams.baseURL + 'ext/jquery-jsonrpc' + (ams.devmode ? '.js' : '.min.js'), function() { @@ -903,18 +928,19 @@ callback = ams.getFunctionByName(callback); delete options.callback; - var settings = { + var defaults = { url: ams.jsonrpc.getAddr(options.url), type: 'post', cache: false, method: method, - params: options, + params: data, async: typeof(callback) == 'function', - success: callback || function(data, status) { + success: callback || function(data /*, status*/) { result = data.result; }, error: ams.error.show }; + var settings = $.extend({}, defaults, options); $.jsonRpc(settings); return result; }); @@ -928,6 +954,72 @@ MyAMS.form = { /** + * Init forms to activate form change listeners + * + * @param element: the parent element + */ + init: function(element) { + // Activate form changes if required + if (ams.warn_on_form_change) + var forms = $('FORM[data-ams-warn-on-change!="false"]', element); + else + forms = $('FORM[data-ams-warn-on-change="true"]', element); + forms.each(function() { + var form = $(this); + $('INPUT[type="text"], ' + + 'INPUT[type="checkbox"], ' + + 'INPUT[type="radio"], ' + + 'SELECT, ' + + 'TEXTAREA, ' + + '[data-ams-changed-event]', form).each(function() { + var source = $(this); + if (source.data('ams-ignore-change') !== true) { + var event = source.data('ams-changed-event') || 'change'; + source.on(event, function () { + $(this).parents('FORM').attr('data-ams-form-changed', true); + }); + } + }); + form.on('reset', function() { + $(this).removeAttr('data-ams-form-changed'); + }); + }); + }, + + /** + * Check for modified forms before exiting + */ + checkBeforeUnload: function() { + var forms = $('FORM[data-ams-form-changed="true"]'); + if (forms.exists()) { + return ams.i18n.FORM_CHANGED_WARNING; + } + }, + + /** + * Check for modified forms before loading new inner content + */ + confirmChangedForm: function(element, callback) { + if (typeof(element) == 'function') { + callback = element; + element = undefined; + } + var forms = $('FORM[data-ams-form-changed="true"]', element); + if (forms.exists()) { + ams.skin.bigBox({ + title: ams.i18n.WARNING, + content: '  ' + ams.i18n.FORM_CHANGED_WARNING, + buttons: ams.i18n.BTN_OK_CANCEL + }, function(button) { + if (button == ams.i18n.BTN_OK) + callback.call(element); + }); + } else { + callback.call(element); + } + }, + + /** * Submit given form */ submit: function(form, handler, submit_options) { @@ -1049,6 +1141,7 @@ button.button('reset'); form.data('submitted', false); form.removeData('ams-submit-button'); + form.removeAttr('data-ams-form-changed'); }, iframe: hasUpload } @@ -1329,8 +1422,13 @@ } if (typeof(source) == 'string') var url = source; - else + else { url = source.attr('href') || source.data('ams-url'); + var url_getter = ams.getFunctionByName(url); + if (typeof(url_getter) == 'function') { + url = url_getter.call(source); + } + } if (!url) return; $('body').modalmanager('loading'); @@ -1734,38 +1832,47 @@ var input = $('').attr('name', fieldname) .attr('id', fieldname.replace(/\./, '_')) .data('ams-checker-init', true) - .val(data.amsCheckerState == 'on') - .on('change', function(e) { - e.preventDefault(); - var veto = {}; - legend.trigger('ams.checker.before-switch', [legend, veto]); - if (veto.veto) - return; - if ($(this).is(':checked')) { - if (data.amsCheckerMode == 'disable') - fieldset.removeAttr('disabled') - else - fieldset.removeClass('switched'); - legend.trigger('ams.checker.opened', [legend]); - } else { - if (data.amsCheckerMode == 'disable') - fieldset.attr('disabled', 'disabled'); - else - fieldset.addClass('switched'); - legend.trigger('ams.checker.closed', [legend]); - } - }) - .appendTo(checker); + .val(data.amsCheckerState == 'on'); + if (data.amsCheckerReadonly) { + input.attr('disabled', 'disabled'); + } else { + input.on('change', function(e) { + e.preventDefault(); + var veto = {}; + legend.trigger('ams.checker.before-switch', [legend, veto]); + if (veto.veto) + return; + if ($(this).is(':checked')) { + if (data.amsCheckerMode == 'disable') + fieldset.removeAttr('disabled') + else + fieldset.removeClass('switched'); + $('[data-required]', fieldset).attr('required', 'required'); + legend.trigger('ams.checker.opened', [legend]); + } else { + if (data.amsCheckerMode == 'disable') + fieldset.attr('disabled', 'disabled'); + else + fieldset.addClass('switched'); + $('[data-required]', fieldset).removeAttr('required'); + legend.trigger('ams.checker.closed', [legend]); + } + }); + } + input.appendTo(checker); $('.legend', legend).attr('for', input.attr('id')); checker.append('') .prependTo(legend); - if (data.amsCheckerState == 'on') + var required = $('[required]', fieldset); + required.attr('data-required', true); + if (data.amsCheckerState == 'on') { input.attr('checked', true); - else { + } else { if (data.amsCheckerMode == 'disable') fieldset.attr('disabled', 'disabled'); else fieldset.addClass('switched'); + required.removeAttr('required'); } legend.data('ams-checker', 'on'); } @@ -2737,7 +2844,7 @@ updateActiveMenus(menu); ams.skin.loadURL(url, container); document.title = $('[data-ams-page-title]:first', container).data('ams-page-title') || - $('nav A[href="' + hash + '"]').attr('title') || + menu.attr('title') || document.title; } else { var active_url = $('[data-ams-active-menu]').data('ams-active-menu'); @@ -2822,6 +2929,31 @@ $.ajax(settings); }, + /** + * Change user language + */ + setLanguage: function(options) { + var lang = options.lang; + var handler_type = options.handler_type || 'json'; + switch (handler_type) { + case 'json': + var method = options.method || 'setUserLanguage'; + ams.jsonrpc.post(method, {lang: lang}, function() { + window.location.reload(true); + }); + break; + case 'ajax': + var href = options.href || 'setUserLanguage'; + ams.ajax.post(href, {lang: lang}, function() { + window.location.reload(true); + }); + break; + } + }, + + /** + * Go to logout page + */ logout: function() { window.location = ams.loginURL; } @@ -2840,6 +2972,21 @@ ams.shortcuts = $('#shortcut'); // Init main AJAX events + var jquery_xhr = $.ajaxSettings.xhr; + $.ajaxSetup({ + progress: ams.ajax.progress, + progressUpload: ams.ajax.progress, + xhr: function() { + var request = jquery_xhr(); + if (request && (typeof(request.addEventListener) == "function")) { + var that = this; + request.addEventListener("progress", function(evt) { + that.progress(evt); + }, false); + } + return request; + } + }); $(document).ajaxError(ams.error.ajax); // Check mobile/desktop @@ -3004,22 +3151,30 @@ if (!href || href.startsWith('javascript:') || link.attr('target')) return; e.preventDefault(); + var href_getter = ams.getFunctionByName(href); + if (typeof(href_getter) == 'function') { + href = href_getter.call(link); + } var target = link.data('ams-target'); if (target) { - ams.skin.loadURL(href, target, link.data('ams-link-options'), link.data('ams-link-callback')); + ams.form.confirmChangedForm(target, function() { + ams.skin.loadURL(href, target, link.data('ams-link-options'), link.data('ams-link-callback')); + }); } else { - if (href.startsWith('#')) { - if (href != location.hash) { - if (ams.root.hasClass('mobile-view-activated')) { - ams.root.removeClass('hidden-menu'); - window.setTimeout(function() { + ams.form.confirmChangedForm(function() { + if (href.startsWith('#')) { + if (href != location.hash) { + if (ams.root.hasClass('mobile-view-activated')) { + ams.root.removeClass('hidden-menu'); + window.setTimeout(function () { + window.location.hash = href; + }, 150); + } else window.location.hash = href; - }, 150); - } else - window.location.hash = href; - } - } else - window.location = href; + } + } else + window.location = href; + }); } }); $(document).on('click', 'a[target="_blank"]', function(e) { @@ -3028,7 +3183,9 @@ }); $(document).on('click', 'a[target="_top"]', function(e) { e.preventDefault(); - window.location = $(e.currentTarget).attr('href'); + ams.form.confirmChangedForm(function() { + window.location = $(e.currentTarget).attr('href'); + }); }); // Check URL when hash changed @@ -3057,6 +3214,8 @@ var source = $(this); var data = source.data(); if (data.amsClickHandler) { + if (data.amsClickStopPropagation === true) + e.stopPropagation(); if (data.amsClickKeepDefault !== true) e.preventDefault(); var callback = ams.getFunctionByName(data.amsClickHandler); @@ -3078,6 +3237,19 @@ } }); + // Initialize custom reset handlers + $(document).on('reset', '[data-ams-reset-handler]', function(e) { + var form = $(this); + var data = form.data(); + if (data.amsResetHandler) { + if (data.amsResetKeepDefault !== true) + e.preventDefault(); + var callback = ams.getFunctionByName(data.amsResetHandler); + if (callback !== undefined) + callback.call(form, data.amsResetHandlerOptions); + } + }); + // Handle update on file upload placeholder $(document).on('change', 'input[type="file"]', function(e) { e.preventDefault(); @@ -3117,6 +3289,9 @@ if ((window.location.hash == '') || (ams.getQueryVar(window.location.href, 'came_from') != false)) ams.initContent(document); + // Add unload event listener to check for modified forms + $(window).on('beforeunload', ams.form.checkBeforeUnload); + }; @@ -3143,6 +3318,7 @@ ams.plugins.init(element); ams.callbacks.init(element); ams.events.init(element); + ams.form.init(element); // Initialize widgets if (ams.device === 'desktop') @@ -3183,12 +3359,14 @@ BTN_CANCEL: "Cancel", BTN_YES: "Yes", BTN_NO: "No", + BTN_OK_CANCEL: "[OK][Cancel]", + FORM_CHANGED_WARNING: "Some changes were not saved. These updates will be lost if you leave this page.", NO_UPDATE: "No changes were applied.", DATA_UPDATED: "Data successfully updated.", HOME: "Home", - LOGOUT: "Logout ?", + LOGOUT: "Logout?", LOGOUT_COMMENT: "You can improve your security further after logging out by closing this opened browser", SELECT2_PLURAL: 's', diff -r 173b951c6aef -r 2c6d47b76a7b src/ztfy/myams/resources/js/myams.min.js --- a/src/ztfy/myams/resources/js/myams.min.js Tue Jun 03 23:40:12 2014 +0200 +++ b/src/ztfy/myams/resources/js/myams.min.js Tue Jun 03 23:45:55 2014 +0200 @@ -1,1 +1,1 @@ -(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d=b('
').appendTo("body");var e=d.children();var c=e.innerWidth()-e.height(99).innerWidth();d.remove();return c}}b.fn.extend({exists:function(){return b(this).length>0},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},myams_menu:function(c){var e={accordion:"true",speed:200,closedSign:'',openedSign:''};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append(""+d.closedSign+"");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(g.size()!=0){if(d.accordion){if(!g.is(":visible")){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b("script:last");var d=c.attr("src");return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c").attr({rel:"stylesheet",type:"text/css",href:a.getSource(c),"data-ams-id":f}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(f,e){if(e.statusText=="OK"){return}var c=a.ajax.getResponse(e);if(c.content_type=="json"){a.ajax.handleJSON(c.data)}else{var g=f.statusText||f.type;var d=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

"+g+"

"+d+"

",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(f);console.debug(e)}},show:function(f,c,e){if(!e){return}var d=a.ajax.getResponse(f);if(d.content_type=="json"){a.ajax.handleJSON(d.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"

"+c+"

"+e+"

",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(e);console.debug(f)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g,true),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d){if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}}else{h="json";c={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{content_type:h,data:c}},handleJSON:function(m,e,i){var g=m.status;var c;switch(g){case"alert":alert(m.alert.title+"\n\n"+m.alert.content);break;case"error":a.form.showErrors(e,m);break;case"success":if(m.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"callback":case"callbacks":if(m.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(m.location);break;case"reload":if(m.close_form!=false){a.dialog.close(e)}c=m.location;if(c.startsWith("#")){c=c.substr(1)}a.skin.loadURL(c,m.target||i||"#content");break;case"redirect":c=m.location;if(m.window){window.open(c,m.window,m.options)}else{window.location.href=c}break;default:console.log("Unhandled status: "+g);break}if(m.content){var j=m.content;var d=b(j.target||e||"#content");d.html(j.html);a.initContent(d)}if(m.message){var l=m.message;if(typeof(l)=="string"){a.skin.alert(b(e||"#content"),g,"",l)}else{a.skin.alert(b(l.target||e||"#content"),l.status||"success",l.header,l.body,l.subtitle)}}if(m.messagebox){l=m.messagebox;if(typeof(l)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:l,timeout:10000})}else{var f=l.status||"info";if(f=="error"&&e&&i){a.executeFunctionByName(e.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",e,i)}a.skin.messageBox(f,{title:l.title||a.i18n.ERROR_OCCURED,content:l.content,icon:l.icon,number:l.number,timeout:l.timeout||10000})}}if(m.callback){a.executeFunctionByName(m.callback,e,m.options)}if(m.callbacks){for(var h in m.callbacks){if(!b.isNumeric(h)){continue}var k=m.callbacks[h];a.executeFunctionByName(k,e,k.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(e,c,d){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var f;if(typeof(c)=="function"){d=c;c={}}else{if(!c){c={}}}if(typeof(d)=="undefined"){d=c.callback}if(typeof(d)=="string"){d=a.getFunctionByName(d)}delete c.callback;var g={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:e,params:c,async:typeof(d)=="function",success:d||function(i,h){f=i.result},error:a.error.show};b.jsonRpc(g);return f})}};MyAMS.form={submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:5000});return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"),function(){function i(l,x){var q=l.data();var m=q.amsFormOptions;if(f){var v=f.formDataInitCallback}if(v){delete f.formDataInitCallback}else{v=q.amsFormDataInitCallback}if(v){if(typeof(v)=="function"){var t=v.call(l)}else{t=a.executeFunctionByName(v,l)}}else{t=q.amsFormData||{}}var r=b(l.data("ams-submit-button"));var w,s;if(r){w=r.data("ams-form-handler");s=r.data("ams-form-submit-target")}var p=l.attr("action").replace(/#/,"");if(p.startsWith(window.location.protocol)){var k=p}else{k=a.ajax.getAddr()+p}k+=d||w||q.amsFormHandler||"";var u=null;if(q.amsFormInitSubmitTarget){u=b(s||q.amsFormSubmitTarget||"#content");a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmit",l,u)}else{if(!q.amsFormHideSubmitFooter){a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",l)}}var j=typeof(x.uuid)!="undefined";if(j){if(k.indexOf("X-Progress-ID")<0){k+="?X-Progress-ID="+x.uuid}delete x.uuid}var o={url:k,type:"post",cache:false,data:t,dataType:q.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(z,y){y.data("submitted",true)},error:function(C,y,z,B){if(u){a.executeFunctionByName(q.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",B,u)}if(B.is(":visible")){var A=B.data("ams-submit-button");if(A){A.button("reset")}a.form.finalizeSubmitFooter.call(B)}B.data("submitted",false);B.removeData("ams-submit-button")},success:function(y,z,C,B){var D;var A=B.data("ams-submit-button");if(A){D=A.data("ams-form-submit-callback")}if(!D){D=a.getFunctionByName(q.amsFormSubmitCallback)||a.form._submitCallback}D.call(B,y,z,C,B);if(B.is(":visible")&&A){A.button("reset")}B.data("submitted",false);B.removeData("ams-submit-button")},iframe:j};var n=b.extend({},o,x,m,f);b(l).ajaxSubmit(n)}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+(a.devmode?".js":".min.js"));var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='';if(!d){d=c.data("ams-form-submit-message")}if(d){f+=""+d+""}b(e).html('
'+f+"
");b(e).parents(".hidden").removeClass("hidden")},finalizeSubmitOnError:function(c){b("i",c).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(d){var c=b(this);var f='';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+=''+d+""}var e=b("footer",c);b("button",e).hide();e.append('
'+f+"
")},finalizeSubmitFooter:function(){var c=b(this);var d=b("footer",c);if(d){b(".row",d).remove();b("button",d).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}switch(j){case"json":a.ajax.handleJSON(m,c,i);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l))}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(e,h){if(typeof(h)=="string"){a.skin.alert(e,"error",a.i18n.ERROR_OCCURED,h)}else{if(h instanceof Array){var g=h.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"error",g,h)}else{g=h.widgets&&(h.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED;var d=new Array();var c;for(c in h.messages){if(!b.isNumeric(c)){continue}d.push(h.messages[c].message||h.messages[c])}for(c in h.widgets){if(!b.isNumeric(c)){continue}var f=h.widgets[c];b('[name="'+f.name+'"]',e).parent("label").removeClassPrefix("state-").addClass("state-error").after(''+f.message+"");if(f.label){d.push(f.label+" : "+f.message)}}a.skin.alert(e,"error",g,d,h.error_message)}}}};MyAMS.dialog={open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+(a.devmode?".js":".min.js"),function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+(a.devmode?".js":".min.js"),function(f){if(f){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.fn.modalmanager.defaults.spinner='
'}if(typeof(d)=="string"){var e=d}else{e=d.attr("href")||d.data("ams-url")}if(!e){return}b("body").modalmanager("loading");if(e.indexOf("#")==0){b(e).modal("show")}else{b.get(e,c,function(j,i,h){b("body").modalmanager("removeLoading");var k=a.ajax.getResponse(h);var p=k.content_type;var q=k.data;switch(p){case"json":a.ajax.handleJSON(q,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var l=b(q);var n=b(".modal-dialog",l.wrap("
").parent());var m=n.data();var o={overflow:m.amsModalOverflow||".modal-viewport",maxHeight:m.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",l).outerHeight(true)-b("footer",l).outerHeight(true)-85}:a.getFunctionByName(m.amsModalMaxHeight)};var g=b.extend({},o,m.amsModalOptions);g=a.executeFunctionByName(m.amsModalInitCallback,n,g)||g;b("
").addClass("modal fade").append(l).modal(g);a.initContent(l)}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("
").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("
").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}}};MyAMS.helpers={select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

"+e.error_message+"

",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(result.location);break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(g,d,f){var c=g.result;if(typeof(c)=="string"){try{c=JSON.parse(c)}catch(h){}}switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

"+c.error_message+"

",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(c.location);break;default:f.callback({results:c.results||c,more:c.has_more||false,context:c.context})}}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});for(var d in a.plugins.enabled){if(f.indexOf(d)>=0){continue}var g=a.plugins.enabled[d];if(typeof(g)=="function"){g(e)}}var c;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){c=m[j];var i={src:l.data("ams-plugin-"+c+"-src"),css:l.data("ams-plugin-"+c+"-css"),callback:l.data("ams-plugin-"+c+"-callback"),register:l.data("ams-plugin-"+c+"-register"),async:l.data("ams-plugin-"+c+"-async")};h[c]=i}}else{h=l.data("ams-plugins")}for(c in h){if(a.plugins.enabled[c]===undefined){var k=h[c];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(typeof(o)=="function"){o(e)}if(k.register!==false){a.plugins.enabled[c]=o}}else{if(k.register!==false){a.plugins.enabled[c]=null}}var n=k.css;if(n){a.getCSS(n,c+"_css")}},{async:k.async===undefined?true:k.async})}}})},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+(a.devmode?".js":".min.js"),function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+(a.devmode?".css":".min.css"),"jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e])}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var h=b(this);var d=h.parent("fieldset");var j=h.data();if(!j.amsChecker){var g=b('');var f=j.amsCheckerFieldname||("checker_"+a.generateId());var i=j.amsCheckerHiddenPrefix;if(i){b('').attr("name",i+f).val(true).appendTo(g)}var e=b('').attr("name",f).attr("id",f.replace(/\./,"_")).data("ams-checker-init",true).val(j.amsCheckerState=="on").on("change",function(l){l.preventDefault();var k={};h.trigger("ams.checker.before-switch",[h,k]);if(k.veto){return}if(b(this).is(":checked")){if(j.amsCheckerMode=="disable"){d.removeAttr("disabled")}else{d.removeClass("switched")}h.trigger("ams.checker.opened",[h])}else{if(j.amsCheckerMode=="disable"){d.attr("disabled","disabled")}else{d.addClass("switched")}h.trigger("ams.checker.closed",[h])}}).appendTo(g);b(".legend",h).attr("for",e.attr("id"));g.append("").prependTo(h);if(j.amsCheckerState=="on"){e.attr("checked",true)}else{if(j.amsCheckerMode=="disable"){d.attr("disabled","disabled")}else{d.addClass("switched")}}h.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.4.5"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={url:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),type:j.amsSelect2MethodType||"POST",cache:false,method:j.amsSelect2QueryMethod,params:j.amsSelect2QueryParams||{},success:function(n,m){return a.helpers.select2QueryMethodSuccessCallback.call(e,n,m,k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){b.jsonRpc(l)})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:(j.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){d.each(function(){var e=b(this);var i=e.data();var g={dateFormat:i.amsDatepickerFormat||"dd/mm/yy",prevText:'',nextText:'',changeMonth:i.amsDatepickerChangeMonth,changeYear:i.amsDatepickerChangeYear,showButtonPanel:!i.amsDatepickerHidePanel};var f=b.extend({},g,i.amsDatepickerOptions);f=a.executeFunctionByName(i.amsDatepickerInitCallback,e,f)||f;var h=e.datepicker(f);a.executeFunctionByName(i.amsDatepickerAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+(a.devmode?".js":".min.js"),function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(h,i){if(i.parent("label").length){h.insertAfter(i.parent())}else{h.insertAfter(i)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"));return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+(a.devmode?".js":".min.js"),function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+(a.devmode?".js":".min.js"));var s=b(this);var v=s.data();var u=(v.amsDatatableExtensions||"").split(/\s+/);var h=v.amsDatatableSdom||"W"+((u.indexOf("colreorder")>=0||u.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(u.indexOf("colvis")>=0?"C":"")+((v.amsDatatablePagination===false||v.amsDatatablePaginationSize===false)?"":"L")+(v.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(u.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>";var q={bJQueryUI:false,bFilter:v.amsDatatableGlobalFilter!==false,bPaginate:v.amsDatatablePagination!==false,bInfo:v.amsDatatableInfo!==false,bSort:v.amsDatatableSort!==false,bDeferRender:true,bAutoWidth:false,iDisplayLength:v.amsDatatableDisplayLength||25,sPaginationType:v.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(y,x){b(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' ')}};var t=b.extend({},q,v.amsDatatableOptions);var j;if(u.length>0){for(j in u){switch(u[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+(a.devmode?".js":".min.js"));break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+(a.devmode?".js":".min.js"));break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+(a.devmode?".js":".min.js"));break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+(a.devmode?".js":".min.js"));break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+(a.devmode?".js":".min.js"));var m={activate:"click",sAlign:"right"};t.oColVis=b.extend({},m,v.amsDatatableColvisOptions);break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+(a.devmode?".js":".min.js"));break;case"fixedheader":a.ajax.check(b.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+(a.devmode?".js":".min.js"));break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+(a.devmode?".js":".min.js"));break;case"rowgrouping":a.ajax.check(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+(a.devmode?".js":".min.js"));break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+(a.devmode?".js":".min.js"));break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+(a.devmode?".js":".min.js"));break;default:break}}}t=a.executeFunctionByName(v.amsDatatableInitCallback,s,t)||t;var g=s.dataTable(t);a.executeFunctionByName(v.amsDatatableAfterInitCallback,s,g,t);if(u.length>0){for(j in u){switch(u[j]){case"autofill":var w=b.extend({},v.amsDatatableAutofillOptions,t.autofill);w=a.executeFunctionByName(v.amsDatatableAutofillInitCallback,s,w)||w;s.data("ams-autofill",v.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(s,w):a.executeFunctionByName(v.amsDatatableAutofillConstructor,s,g,w));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,v.amsDatatableColumnfilterOptions,t.columnfilter);l=a.executeFunctionByName(v.amsDatatableColumnfilterInitCallback,s,l)||l;s.data("ams-columnfilter",v.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(v.amsDatatableColumnfilterConstructor,s,g,l));break;case"fixedcolumns":var f=b.extend({},v.amsDatatableFixedcolumnsOptions,t.fixedcolumns);f=a.executeFunctionByName(v.amsDatatableFixedcolumnsInitCallback,s,f)||f;s.data("ams-fixedcolumns",v.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(s,f):a.executeFunctionByName(v.amsDatatableFixedcolumnsConstructor,s,g,f));break;case"fixedheader":var r=b.extend({},v.amsDatatableFixedheaderOptions,t.fixedheader);r=a.executeFunctionByName(v.amsDatatableFixedheadeInitCallback,s,r)||r;s.data("ams-fixedheader",v.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(s,r):a.executeFunctionByName(v.amsDatatableFixedheaderConstructor,s,g,r));break;case"keytable":var i={table:s.get(0),datatable:g};var p=b.extend({},i,v.amsDatatableKeytableOptions,t.keytable);p=a.executeFunctionByName(v.amsDatatableKeytableInitCallback,s,p)||p;s.data("ams-keytable",v.amsDatatableKeytableConstructor===undefined?new KeyTable(p):a.executeFunctionByName(v.amsDatatableKeytableConstructor,s,g,p));break;case"rowgrouping":var o=b.extend({},v.amsDatatableRowgroupingOptions,t.rowgrouping);o=a.executeFunctionByName(v.amsDatatableRowgroupingInitCallback,s,o)||o;s.data("ams-rowgrouping",v.amsDatatableRowgroupingConstructor===undefined?s.rowGrouping(o):a.executeFunctionByName(v.amsDatatableRowgroupingConstructor,s,g,o));break;case"rowreordering":var n=b.extend({},v.amsDatatableRowreorderingOptions,t.rowreordering);n=a.executeFunctionByName(v.amsDatatableRowreorderingInitCallback,s,n)||n;s.data("ams-rowreordering",v.amsDatatableRowreorderingConstructor===undefined?s.rowReordering(n):a.executeFunctionByName(v.amsDatatableRowreorderingConstructor,s,g,n));break;default:break}}}})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+(a.devmode?".js":".min.js"),function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.icon});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.icon});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+(a.devmode?".js":".min.js"),function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='

'+e+"

"+(i?("

"+i+"

"):"")+"
    ";if(typeof(k)=="string"){g+="
  • "+k+"
  • "}else{for(var f in k){if(!b.isNumeric(f)){continue}g+="
  • "+k[f]+"
  • "}}g+="
";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("
  • ").append(b("").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("
  • ").append(f.attr("href").replace(/^#/,"")?b("").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||b('nav A[href="'+f+'"]').attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){c.html('

    Loading...

    ');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(c)}}},error:function(k,j,i){c.html('

    '+a.i18n.ERROR+i+"

    "+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){a.root=b("BODY");a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");b(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+(a.devmode?".js":".min.js"),function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(c){b("BODY").toggleClass("hidden-menu");c.preventDefault()});b("#show-shortcut").click(function(c){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}c.preventDefault()});b(document).mouseup(function(c){if(!a.shortcuts.is(c.target)&&a.shortcuts.has(c.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(d){var c=b(this);var f=c.next(".ajax-dropdown");if(!f.is(":visible")){f.css("left",c.position().left-f.innerWidth()/2+c.innerWidth()/2).fadeIn(150);c.addClass("active")}else{f.fadeOut(150);c.removeClass("active")}d.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(c){var d=b(".ajax-dropdown");if(!d.is(c.target)&&d.has(c.target).length===0){d.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var c=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(c,container)});b("#logout a").click(function(c){c.preventDefault();a.loginURL=b(this).attr("href");a.skin.bigBox({title:" "+a.i18n.LOGOUT+" "+b("#show-shortcut").text()+" ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(d){if(d==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(c){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);c.preventDefault()});b("#refresh").click(function(c){a.skin.bigBox({title:" "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(d){if(d==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});c.preventDefault()});b("BODY").on("click",function(d){var c=b(this);if(!c.is(d.target)&&c.has(d.target).length===0&&b(".popover").has(d.target).length===0){c.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+(a.devmode?".js":".min.js"),function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){if(b("nav").length>0){a.skin.checkURL()}b(document).on("click",'a[href="#"]',function(c){c.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(g){var d=b(g.currentTarget);var c=d.attr("href")||d.data("ams-url");if(!c||c.startsWith("javascript:")||d.attr("target")){return}g.preventDefault();var f=d.data("ams-target");if(f){a.skin.loadURL(c,f,d.data("ams-link-options"),d.data("ams-link-callback"))}else{if(c.startsWith("#")){if(c!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=c},150)}else{window.location.hash=c}}}else{window.location=c}}});b(document).on("click",'a[target="_blank"]',function(c){c.preventDefault();window.open(b(c.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(c){c.preventDefault();window.location=b(c.currentTarget).attr("href")});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(d){d.preventDefault();var c=b(this);a.dialog.open(c);if(c.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("shown.bs.modal",a.dialog.shown);b(document).on("click",'button[type="submit"], button.submit',function(){var c=b(this);b(c.get(0).form).data("ams-submit-button",c)});b(document).on("click","[data-ams-click-handler]",function(f){var d=b(this);var c=d.data();if(c.amsClickHandler){if(c.amsClickKeepDefault!==true){f.preventDefault()}var g=a.getFunctionByName(c.amsClickHandler);if(g!==undefined){g.call(d,c.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(f){var d=b(this);var c=d.data();if(c.amsChangeHandler){if(c.amsChangeKeepDefault!==true){f.preventDefault()}var g=a.getFunctionByName(c.amsChangeHandler);if(g!==undefined){g.call(d,c.amsChangeHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(f){f.preventDefault();var c=b(this);var d=c.parent(".button");if(d.exists()&&d.parent().hasClass("input-file")){d.next('input[type="text"]').val(c.val())}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(c){if(b(this).parent("li").hasClass("disabled")){c.preventDefault();return false}});b(document).on("show.bs.tab",function(f){var c=b(f.target);var d=c.data();if(d.amsUrl){if(d.amsTabLoaded){return}a.skin.loadURL(d.amsUrl,c.attr("href"));if(d.amsTabLoadOnce){c.data("ams-tab-loaded",true)}}});a.plugins.enabled.hint(document);if((window.location.hash=="")||(a.getQueryVar(window.location.href,"came_from")!=false)){a.initContent(document)}};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",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_YES:"Yes",BTN_NO:"No",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_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"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML").attr("lang")||b("HTML").attr("xml:lang");if(c&&!c.startsWith("en")){MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+c.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery); \ No newline at end of file +(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d=b('
    ').appendTo("body");var e=d.children();var c=e.innerWidth()-e.height(99).innerWidth();d.remove();return c}}b.fn.extend({exists:function(){return b(this).length>0},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},myams_menu:function(c){var e={accordion:"true",speed:200,closedSign:'',openedSign:''};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append(""+d.closedSign+"");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(g.size()!=0){if(d.accordion){if(!g.is(":visible")){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,warn_on_form_change:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b("script:last");var d=c.attr("src");return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c").attr({rel:"stylesheet",type:"text/css",href:a.getSource(c),"data-ams-id":f}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(f,e){if(e.statusText=="OK"){return}var c=a.ajax.getResponse(e);if(c.content_type=="json"){a.ajax.handleJSON(c.data)}else{var g=f.statusText||f.type;var d=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

    "+g+"

    "+d+"

    ",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(f);console.debug(e)}},show:function(f,c,e){if(!e){return}var d=a.ajax.getResponse(f);if(d.content_type=="json"){a.ajax.handleJSON(d.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"

    "+c+"

    "+e+"

    ",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(e);console.debug(f)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},progress:function(c){if(!c.lengthComputable){return}if(c.loaded>=c.total){return}console.log(parseInt((c.loaded/c.total*100),10)+"%")},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g,true),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d){if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}}else{h="json";c={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{content_type:h,data:c}},handleJSON:function(m,e,i){var g=m.status;var c;switch(g){case"alert":alert(m.alert.title+"\n\n"+m.alert.content);break;case"error":a.form.showErrors(e,m);break;case"success":if(m.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"callback":case"callbacks":if(m.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(m.location);break;case"reload":if(m.close_form!=false){a.dialog.close(e)}c=m.location;if(c.startsWith("#")){c=c.substr(1)}a.skin.loadURL(c,m.target||i||"#content");break;case"redirect":c=m.location;if(m.window){window.open(c,m.window,m.options)}else{window.location.href=c}break;default:console.log("Unhandled status: "+g);break}if(m.content){var j=m.content;var d=b(j.target||i||e||"#content");d.html(j.html);a.initContent(d)}if(m.message){var l=m.message;if(typeof(l)=="string"){a.skin.alert(b(e||"#content"),g,"",l)}else{a.skin.alert(b(l.target||i||e||"#content"),l.status||"success",l.header,l.body,l.subtitle)}}if(m.messagebox){l=m.messagebox;if(typeof(l)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:l,timeout:10000})}else{var f=l.status||"info";if(f=="error"&&e&&i){a.executeFunctionByName(e.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",e,i)}a.skin.messageBox(f,{title:l.title||a.i18n.ERROR_OCCURED,content:l.content,icon:l.icon,number:l.number,timeout:l.timeout||10000})}}if(m.callback){a.executeFunctionByName(m.callback,e,m.options)}if(m.callbacks){for(var h in m.callbacks){if(!b.isNumeric(h)){continue}var k=m.callbacks[h];a.executeFunctionByName(k,e,k.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(f,d,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:d,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};var h=b.extend({},i,c);b.jsonRpc(h);return g})}};MyAMS.form={init:function(d){if(a.warn_on_form_change){var c=b('FORM[data-ams-warn-on-change!="false"]',d)}else{c=b('FORM[data-ams-warn-on-change="true"]',d)}c.each(function(){var e=b(this);b('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',e).each(function(){var g=b(this);if(g.data("ams-ignore-change")!==true){var f=g.data("ams-changed-event")||"change";g.on(f,function(){b(this).parents("FORM").attr("data-ams-form-changed",true)})}});e.on("reset",function(){b(this).removeAttr("data-ams-form-changed")})})},checkBeforeUnload:function(){var c=b('FORM[data-ams-form-changed="true"]');if(c.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(d,e){if(typeof(d)=="function"){e=d;d=undefined}var c=b('FORM[data-ams-form-changed="true"]',d);if(c.exists()){a.skin.bigBox({title:a.i18n.WARNING,content:'  '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(f){if(f==a.i18n.BTN_OK){e.call(d)}})}else{e.call(d)}},submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:5000});return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"),function(){function i(l,x){var q=l.data();var m=q.amsFormOptions;if(f){var v=f.formDataInitCallback}if(v){delete f.formDataInitCallback}else{v=q.amsFormDataInitCallback}if(v){if(typeof(v)=="function"){var t=v.call(l)}else{t=a.executeFunctionByName(v,l)}}else{t=q.amsFormData||{}}var r=b(l.data("ams-submit-button"));var w,s;if(r){w=r.data("ams-form-handler");s=r.data("ams-form-submit-target")}var p=l.attr("action").replace(/#/,"");if(p.startsWith(window.location.protocol)){var k=p}else{k=a.ajax.getAddr()+p}k+=d||w||q.amsFormHandler||"";var u=null;if(q.amsFormInitSubmitTarget){u=b(s||q.amsFormSubmitTarget||"#content");a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmit",l,u)}else{if(!q.amsFormHideSubmitFooter){a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",l)}}var j=typeof(x.uuid)!="undefined";if(j){if(k.indexOf("X-Progress-ID")<0){k+="?X-Progress-ID="+x.uuid}delete x.uuid}var o={url:k,type:"post",cache:false,data:t,dataType:q.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(z,y){y.data("submitted",true)},error:function(C,y,z,B){if(u){a.executeFunctionByName(q.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",B,u)}if(B.is(":visible")){var A=B.data("ams-submit-button");if(A){A.button("reset")}a.form.finalizeSubmitFooter.call(B)}B.data("submitted",false);B.removeData("ams-submit-button")},success:function(y,z,C,B){var D;var A=B.data("ams-submit-button");if(A){D=A.data("ams-form-submit-callback")}if(!D){D=a.getFunctionByName(q.amsFormSubmitCallback)||a.form._submitCallback}D.call(B,y,z,C,B);if(B.is(":visible")&&A){A.button("reset")}B.data("submitted",false);B.removeData("ams-submit-button");B.removeAttr("data-ams-form-changed")},iframe:j};var n=b.extend({},o,x,m,f);b(l).ajaxSubmit(n)}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+(a.devmode?".js":".min.js"));var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='';if(!d){d=c.data("ams-form-submit-message")}if(d){f+=""+d+""}b(e).html('
    '+f+"
    ");b(e).parents(".hidden").removeClass("hidden")},finalizeSubmitOnError:function(c){b("i",c).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(d){var c=b(this);var f='';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+=''+d+""}var e=b("footer",c);b("button",e).hide();e.append('
    '+f+"
    ")},finalizeSubmitFooter:function(){var c=b(this);var d=b("footer",c);if(d){b(".row",d).remove();b("button",d).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}switch(j){case"json":a.ajax.handleJSON(m,c,i);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l))}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(e,h){if(typeof(h)=="string"){a.skin.alert(e,"error",a.i18n.ERROR_OCCURED,h)}else{if(h instanceof Array){var g=h.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"error",g,h)}else{g=h.widgets&&(h.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED;var d=new Array();var c;for(c in h.messages){if(!b.isNumeric(c)){continue}d.push(h.messages[c].message||h.messages[c])}for(c in h.widgets){if(!b.isNumeric(c)){continue}var f=h.widgets[c];b('[name="'+f.name+'"]',e).parent("label").removeClassPrefix("state-").addClass("state-error").after(''+f.message+"");if(f.label){d.push(f.label+" : "+f.message)}}a.skin.alert(e,"error",g,d,h.error_message)}}}};MyAMS.dialog={open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+(a.devmode?".js":".min.js"),function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+(a.devmode?".js":".min.js"),function(g){if(g){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.fn.modalmanager.defaults.spinner='
    '}if(typeof(d)=="string"){var f=d}else{f=d.attr("href")||d.data("ams-url");var e=a.getFunctionByName(f);if(typeof(e)=="function"){f=e.call(d)}}if(!f){return}b("body").modalmanager("loading");if(f.indexOf("#")==0){b(f).modal("show")}else{b.get(f,c,function(k,j,i){b("body").modalmanager("removeLoading");var l=a.ajax.getResponse(i);var q=l.content_type;var r=l.data;switch(q){case"json":a.ajax.handleJSON(r,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var m=b(r);var o=b(".modal-dialog",m.wrap("
    ").parent());var n=o.data();var p={overflow:n.amsModalOverflow||".modal-viewport",maxHeight:n.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",m).outerHeight(true)-b("footer",m).outerHeight(true)-85}:a.getFunctionByName(n.amsModalMaxHeight)};var h=b.extend({},p,n.amsModalOptions);h=a.executeFunctionByName(n.amsModalInitCallback,o,h)||h;b("
    ").addClass("modal fade").append(m).modal(h);a.initContent(m)}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("
    ").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("
    ").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}}};MyAMS.helpers={select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

    "+e.error_message+"

    ",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(result.location);break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(g,d,f){var c=g.result;if(typeof(c)=="string"){try{c=JSON.parse(c)}catch(h){}}switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

    "+c.error_message+"

    ",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(c.location);break;default:f.callback({results:c.results||c,more:c.has_more||false,context:c.context})}}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});for(var d in a.plugins.enabled){if(f.indexOf(d)>=0){continue}var g=a.plugins.enabled[d];if(typeof(g)=="function"){g(e)}}var c;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){c=m[j];var i={src:l.data("ams-plugin-"+c+"-src"),css:l.data("ams-plugin-"+c+"-css"),callback:l.data("ams-plugin-"+c+"-callback"),register:l.data("ams-plugin-"+c+"-register"),async:l.data("ams-plugin-"+c+"-async")};h[c]=i}}else{h=l.data("ams-plugins")}for(c in h){if(a.plugins.enabled[c]===undefined){var k=h[c];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(typeof(o)=="function"){o(e)}if(k.register!==false){a.plugins.enabled[c]=o}}else{if(k.register!==false){a.plugins.enabled[c]=null}}var n=k.css;if(n){a.getCSS(n,c+"_css")}},{async:k.async===undefined?true:k.async})}}})},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+(a.devmode?".js":".min.js"),function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+(a.devmode?".css":".min.css"),"jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e])}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var h=b(this);var d=h.parent("fieldset");var j=h.data();if(!j.amsChecker){var g=b('');var f=j.amsCheckerFieldname||("checker_"+a.generateId());var i=j.amsCheckerHiddenPrefix;if(i){b('').attr("name",i+f).val(true).appendTo(g)}var e=b('').attr("name",f).attr("id",f.replace(/\./,"_")).data("ams-checker-init",true).val(j.amsCheckerState=="on");if(j.amsCheckerReadonly){e.attr("disabled","disabled")}else{e.on("change",function(m){m.preventDefault();var l={};h.trigger("ams.checker.before-switch",[h,l]);if(l.veto){return}if(b(this).is(":checked")){if(j.amsCheckerMode=="disable"){d.removeAttr("disabled")}else{d.removeClass("switched")}b("[data-required]",d).attr("required","required");h.trigger("ams.checker.opened",[h])}else{if(j.amsCheckerMode=="disable"){d.attr("disabled","disabled")}else{d.addClass("switched")}b("[data-required]",d).removeAttr("required");h.trigger("ams.checker.closed",[h])}})}e.appendTo(g);b(".legend",h).attr("for",e.attr("id"));g.append("").prependTo(h);var k=b("[required]",d);k.attr("data-required",true);if(j.amsCheckerState=="on"){e.attr("checked",true)}else{if(j.amsCheckerMode=="disable"){d.attr("disabled","disabled")}else{d.addClass("switched")}k.removeAttr("required")}h.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.4.5"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={url:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),type:j.amsSelect2MethodType||"POST",cache:false,method:j.amsSelect2QueryMethod,params:j.amsSelect2QueryParams||{},success:function(n,m){return a.helpers.select2QueryMethodSuccessCallback.call(e,n,m,k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){b.jsonRpc(l)})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:(j.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){d.each(function(){var e=b(this);var i=e.data();var g={dateFormat:i.amsDatepickerFormat||"dd/mm/yy",prevText:'',nextText:'',changeMonth:i.amsDatepickerChangeMonth,changeYear:i.amsDatepickerChangeYear,showButtonPanel:!i.amsDatepickerHidePanel};var f=b.extend({},g,i.amsDatepickerOptions);f=a.executeFunctionByName(i.amsDatepickerInitCallback,e,f)||f;var h=e.datepicker(f);a.executeFunctionByName(i.amsDatepickerAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+(a.devmode?".js":".min.js"),function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(h,i){if(i.parent("label").length){h.insertAfter(i.parent())}else{h.insertAfter(i)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"));return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+(a.devmode?".js":".min.js"),function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+(a.devmode?".js":".min.js"));var s=b(this);var v=s.data();var u=(v.amsDatatableExtensions||"").split(/\s+/);var h=v.amsDatatableSdom||"W"+((u.indexOf("colreorder")>=0||u.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(u.indexOf("colvis")>=0?"C":"")+((v.amsDatatablePagination===false||v.amsDatatablePaginationSize===false)?"":"L")+(v.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(u.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>";var q={bJQueryUI:false,bFilter:v.amsDatatableGlobalFilter!==false,bPaginate:v.amsDatatablePagination!==false,bInfo:v.amsDatatableInfo!==false,bSort:v.amsDatatableSort!==false,bDeferRender:true,bAutoWidth:false,iDisplayLength:v.amsDatatableDisplayLength||25,sPaginationType:v.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(y,x){b(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' ')}};var t=b.extend({},q,v.amsDatatableOptions);var j;if(u.length>0){for(j in u){switch(u[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+(a.devmode?".js":".min.js"));break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+(a.devmode?".js":".min.js"));break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+(a.devmode?".js":".min.js"));break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+(a.devmode?".js":".min.js"));break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+(a.devmode?".js":".min.js"));var m={activate:"click",sAlign:"right"};t.oColVis=b.extend({},m,v.amsDatatableColvisOptions);break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+(a.devmode?".js":".min.js"));break;case"fixedheader":a.ajax.check(b.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+(a.devmode?".js":".min.js"));break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+(a.devmode?".js":".min.js"));break;case"rowgrouping":a.ajax.check(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+(a.devmode?".js":".min.js"));break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+(a.devmode?".js":".min.js"));break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+(a.devmode?".js":".min.js"));break;default:break}}}t=a.executeFunctionByName(v.amsDatatableInitCallback,s,t)||t;var g=s.dataTable(t);a.executeFunctionByName(v.amsDatatableAfterInitCallback,s,g,t);if(u.length>0){for(j in u){switch(u[j]){case"autofill":var w=b.extend({},v.amsDatatableAutofillOptions,t.autofill);w=a.executeFunctionByName(v.amsDatatableAutofillInitCallback,s,w)||w;s.data("ams-autofill",v.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(s,w):a.executeFunctionByName(v.amsDatatableAutofillConstructor,s,g,w));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,v.amsDatatableColumnfilterOptions,t.columnfilter);l=a.executeFunctionByName(v.amsDatatableColumnfilterInitCallback,s,l)||l;s.data("ams-columnfilter",v.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(v.amsDatatableColumnfilterConstructor,s,g,l));break;case"fixedcolumns":var f=b.extend({},v.amsDatatableFixedcolumnsOptions,t.fixedcolumns);f=a.executeFunctionByName(v.amsDatatableFixedcolumnsInitCallback,s,f)||f;s.data("ams-fixedcolumns",v.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(s,f):a.executeFunctionByName(v.amsDatatableFixedcolumnsConstructor,s,g,f));break;case"fixedheader":var r=b.extend({},v.amsDatatableFixedheaderOptions,t.fixedheader);r=a.executeFunctionByName(v.amsDatatableFixedheadeInitCallback,s,r)||r;s.data("ams-fixedheader",v.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(s,r):a.executeFunctionByName(v.amsDatatableFixedheaderConstructor,s,g,r));break;case"keytable":var i={table:s.get(0),datatable:g};var p=b.extend({},i,v.amsDatatableKeytableOptions,t.keytable);p=a.executeFunctionByName(v.amsDatatableKeytableInitCallback,s,p)||p;s.data("ams-keytable",v.amsDatatableKeytableConstructor===undefined?new KeyTable(p):a.executeFunctionByName(v.amsDatatableKeytableConstructor,s,g,p));break;case"rowgrouping":var o=b.extend({},v.amsDatatableRowgroupingOptions,t.rowgrouping);o=a.executeFunctionByName(v.amsDatatableRowgroupingInitCallback,s,o)||o;s.data("ams-rowgrouping",v.amsDatatableRowgroupingConstructor===undefined?s.rowGrouping(o):a.executeFunctionByName(v.amsDatatableRowgroupingConstructor,s,g,o));break;case"rowreordering":var n=b.extend({},v.amsDatatableRowreorderingOptions,t.rowreordering);n=a.executeFunctionByName(v.amsDatatableRowreorderingInitCallback,s,n)||n;s.data("ams-rowreordering",v.amsDatatableRowreorderingConstructor===undefined?s.rowReordering(n):a.executeFunctionByName(v.amsDatatableRowreorderingConstructor,s,g,n));break;default:break}}}})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+(a.devmode?".js":".min.js"),function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.icon});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.icon});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+(a.devmode?".js":".min.js"),function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='

    '+e+"

    "+(i?("

    "+i+"

    "):"")+"
      ";if(typeof(k)=="string"){g+="
    • "+k+"
    • "}else{for(var f in k){if(!b.isNumeric(f)){continue}g+="
    • "+k[f]+"
    • "}}g+="
    ";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("
  • ").append(b("").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("
  • ").append(f.attr("href").replace(/^#/,"")?b("").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||g.attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){c.html('

    Loading...

    ');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(c)}}},error:function(k,j,i){c.html('

    '+a.i18n.ERROR+i+"

    "+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},setLanguage:function(d){var f=d.lang;var e=d.handler_type||"json";switch(e){case"json":var g=d.method||"setUserLanguage";a.jsonrpc.post(g,{lang:f},function(){window.location.reload(true)});break;case"ajax":var c=d.href||"setUserLanguage";a.ajax.post(c,{lang:f},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){a.root=b("BODY");a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");var c=b.ajaxSettings.xhr;b.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var e=c();if(e&&(typeof(e.addEventListener)=="function")){var d=this;e.addEventListener("progress",function(f){d.progress(f)},false)}return e}});b(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+(a.devmode?".js":".min.js"),function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(d){b("BODY").toggleClass("hidden-menu");d.preventDefault()});b("#show-shortcut").click(function(d){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}d.preventDefault()});b(document).mouseup(function(d){if(!a.shortcuts.is(d.target)&&a.shortcuts.has(d.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(f){var d=b(this);var g=d.next(".ajax-dropdown");if(!g.is(":visible")){g.css("left",d.position().left-g.innerWidth()/2+d.innerWidth()/2).fadeIn(150);d.addClass("active")}else{g.fadeOut(150);d.removeClass("active")}f.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(d){var f=b(".ajax-dropdown");if(!f.is(d.target)&&f.has(d.target).length===0){f.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var d=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(d,container)});b("#logout a").click(function(d){d.preventDefault();a.loginURL=b(this).attr("href");a.skin.bigBox({title:" "+a.i18n.LOGOUT+" "+b("#show-shortcut").text()+" ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(e){if(e==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(d){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);d.preventDefault()});b("#refresh").click(function(d){a.skin.bigBox({title:" "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(e){if(e==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});d.preventDefault()});b("BODY").on("click",function(f){var d=b(this);if(!d.is(f.target)&&d.has(f.target).length===0&&b(".popover").has(f.target).length===0){d.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+(a.devmode?".js":".min.js"),function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){if(b("nav").length>0){a.skin.checkURL()}b(document).on("click",'a[href="#"]',function(d){d.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(i){var g=b(i.currentTarget);var d=g.attr("href")||g.data("ams-url");if(!d||d.startsWith("javascript:")||g.attr("target")){return}i.preventDefault();var f=a.getFunctionByName(d);if(typeof(f)=="function"){d=f.call(g)}var h=g.data("ams-target");if(h){a.form.confirmChangedForm(h,function(){a.skin.loadURL(d,h,g.data("ams-link-options"),g.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(d.startsWith("#")){if(d!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=d},150)}else{window.location.hash=d}}}else{window.location=d}})}});b(document).on("click",'a[target="_blank"]',function(d){d.preventDefault();window.open(b(d.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(d){d.preventDefault();a.form.confirmChangedForm(function(){window.location=b(d.currentTarget).attr("href")})});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(f){f.preventDefault();var d=b(this);a.dialog.open(d);if(d.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("shown.bs.modal",a.dialog.shown);b(document).on("click",'button[type="submit"], button.submit',function(){var d=b(this);b(d.get(0).form).data("ams-submit-button",d)});b(document).on("click","[data-ams-click-handler]",function(g){var f=b(this);var d=f.data();if(d.amsClickHandler){if(d.amsClickStopPropagation===true){g.stopPropagation()}if(d.amsClickKeepDefault!==true){g.preventDefault()}var h=a.getFunctionByName(d.amsClickHandler);if(h!==undefined){h.call(f,d.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(g){var f=b(this);var d=f.data();if(d.amsChangeHandler){if(d.amsChangeKeepDefault!==true){g.preventDefault()}var h=a.getFunctionByName(d.amsChangeHandler);if(h!==undefined){h.call(f,d.amsChangeHandlerOptions)}}});b(document).on("reset","[data-ams-reset-handler]",function(g){var d=b(this);var f=d.data();if(f.amsResetHandler){if(f.amsResetKeepDefault!==true){g.preventDefault()}var h=a.getFunctionByName(f.amsResetHandler);if(h!==undefined){h.call(d,f.amsResetHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(g){g.preventDefault();var d=b(this);var f=d.parent(".button");if(f.exists()&&f.parent().hasClass("input-file")){f.next('input[type="text"]').val(d.val())}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(d){if(b(this).parent("li").hasClass("disabled")){d.preventDefault();return false}});b(document).on("show.bs.tab",function(g){var d=b(g.target);var f=d.data();if(f.amsUrl){if(f.amsTabLoaded){return}a.skin.loadURL(f.amsUrl,d.attr("href"));if(f.amsTabLoadOnce){d.data("ams-tab-loaded",true)}}});a.plugins.enabled.hint(document);if((window.location.hash=="")||(a.getQueryVar(window.location.href,"came_from")!=false)){a.initContent(document)}b(window).on("beforeunload",a.form.checkBeforeUnload)};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);a.form.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",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_YES:"Yes",BTN_NO:"No",BTN_OK_CANCEL:"[OK][Cancel]",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",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_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"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML").attr("lang")||b("HTML").attr("xml:lang");if(c&&!c.startsWith("en")){MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+c.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery); \ No newline at end of file