# HG changeset patch # User Thierry Florac # Date 1539791733 -7200 # Node ID 4ee52103327cd64ffc04e2d880a88791f83b7b1a # Parent bcd694fda81daba231096fdea995aa7978130fae Use local storage to store minified state diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-callbacks.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/myams-callbacks.min.js Wed Oct 17 17:55:33 2018 +0200 @@ -0,0 +1,1 @@ +!function(a,e){var t=e.MyAMS,s=t;t.callbacks={init:function(e){a("[data-ams-callback]",e).each(function(){var e=this,t=a(e).data();try{var n=JSON.parse(t.amsCallback);Array.isArray(n)||(n=[n])}catch(a){n=t.amsCallback.split(/\s+/)}for(var l=0;l  '+n.i18n.DELETE_WARNING,status:"info",buttons:n.i18n.BTN_OK_CANCEL},function(a){if(a===n.i18n.BTN_OK){var s=t.parents("tr").first(),i=s.parents("table").first(),r=s.data("ams-location")||i.data("ams-location")||"";r&&(r+="/");var f=s.data("ams-delete-target")||i.data("ams-delete-target")||"delete-element.json",c=s.data("ams-element-name");e.ajax.post(r+f,{object_name:c},function(a,t){"success"===a.status?(i.hasClass("datatable")?i.dataTable().fnDeleteRow(s[0]):s.remove(),a.handle_json&&e.ajax.handleJSON(a)):e.ajax.handleJSON(a)})}})}},switchElementVisibility:function(){return function(){var t=a(this),e=t.parents("td").first(),s=t.parents("tr").first(),i=s.parents("table");a("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),n.ajax.post(i.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||i.data("ams-attribute-switcher")),{object_name:s.data("ams-element-name")},function(e,n){e.visible?a("i",t).attr("class","fa fa-fw fa-eye"):a("i",t).attr("class","fa fa-fw fa-eye-slash text-danger")})}},switchElementAttribute:function(){return function(){var t=a(this),e=t.parents("td").first(),s=e.data("ams-switcher-attribute-name"),i=t.parents("tr").first(),r=i.parents("table");a("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),n.ajax.post(r.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||r.data("ams-attribute-switcher")),{object_name:i.data("ams-element-name")},function(e,n){e[s]||e.on?a("i",t).attr("class",r.data("ams-"+s+"-icon-on")||"fa fa-fw fa-check-square-o"):a("i",t).attr("class",r.data("ams-"+s+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75")})}}}}(jQuery,this); diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-events.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/myams-events.min.js Wed Oct 17 17:55:33 2018 +0200 @@ -0,0 +1,1 @@ +!function(n,a){var t=a.MyAMS,e=t;t.events={init:function(a){n("[data-ams-events-handlers]",a).each(function(){var a=n(this),t=a.data("ams-events-handlers");if(t)for(var i in t)t.hasOwnProperty(i)&&a.on(i,e.getFunctionByName(t[i]))})}}}(jQuery,this); diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-init.js --- a/src/pyams_skin/resources/js/myams-init.js Wed Oct 17 14:38:55 2018 +0200 +++ b/src/pyams_skin/resources/js/myams-init.js Wed Oct 17 17:55:33 2018 +0200 @@ -50,6 +50,12 @@ $(document).ajaxStop(ams.ajax.stop); $(document).ajaxError(ams.error.ajax); + // Check for minified state in local storage + var state = globals.localStorage && globals.localStorage.getItem('window-state'); + if (state) { + body.addClass(state); + } + // Check mobile/desktop if (!ams.isMobile) { ams.root.addClass('desktop-detected'); @@ -175,7 +181,14 @@ // Left navigation collapser $('.minifyme').click(function(e) { - $('BODY').toggleClass("minified"); + body.toggleClass("minified"); + if (globals.localStorage) { + if (body.hasClass('minified')) { + globals.localStorage.setItem('window-state', 'minified'); + } else { + globals.localStorage.setItem('window-state', ''); + } + } $(this).effect("highlight", {}, 500); e.preventDefault(); }); diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-init.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/myams-init.min.js Wed Oct 17 17:55:33 2018 +0200 @@ -0,0 +1,1 @@ +!function(t,e){var a=e.MyAMS,o=a;a.initPage=function(){var n=t("body");o.root=n,o.leftPanel=t("#left-panel"),o.shortcuts=t("#shortcuts"),o.plugins.initData(n);var i=t.ajaxSettings.xhr;t.ajaxSetup({beforeSend:function(t,a){if(o.safeMethods.indexOf(a.type)<0&&void 0!==e.Cookies){var n=Cookies.get(o.csrfCookieName);n&&t.setRequestHeader(o.csrfHeaderName,n)}},progress:o.ajax.progress,progressUpload:o.ajax.progress,xhr:function(){var t=i();if(t&&"function"==typeof t.addEventListener){var e=this;e&&e.progress&&t.addEventListener("progress",function(t){e.progress(t)},!1)}return t}}),t(document).ajaxStart(o.ajax.start),t(document).ajaxStop(o.ajax.stop),t(document).ajaxError(o.error.ajax);var s=e.localStorage&&e.localStorage.getItem("window-state");s&&n.addClass(s),o.isMobile?(o.root.addClass("mobile-detected"),o.device="mobile",o.enableFastclick&&o.ajax.check(t.fn.noClickDelay,o.baseURL+"/ext/jquery-smartclick"+o.devext+".js",function(){t("NAV UL A").noClickDelay(),t("A","#hide-menu").noClickDelay()})):(o.root.addClass("desktop-detected"),o.device="desktop"),t("#hide-menu").find(">:first-child >A").click(function(t){n.toggleClass("hidden-menu"),t.preventDefault()}),t("#show-shortcuts").click(function(t){o.shortcuts.is(":visible")?o.skin._hideShortcutButtons():o.skin._showShortcutButtons(),t.preventDefault()}),o.shortcuts.click(function(t){o.skin._hideShortcutButtons()}),t(document).mouseup(function(t){o.shortcuts.is(t.target)||0!==o.shortcuts.has(t.target).length||o.skin._hideShortcutButtons()}),t("#search-mobile").click(function(){o.root.addClass("search-mobile")}),t("#cancel-search-js").click(function(){o.root.removeClass("search-mobile")}),t(".activity-button","#user-activity").click(function(e){var a=t("#user-activity"),o=t(".ajax-dropdown",a);o.is(":visible")?(o.fadeOut(150),a.removeClass("active")):(o.css("left",-o.innerWidth()+a.innerWidth()).fadeIn(150),a.addClass("active")),e.preventDefault()}),o.skin.checkNotification(),t(document).mouseup(function(e){var a=t(".ajax-dropdown");a.is(e.target)||0!==a.has(e.target).length||a.fadeOut(150).prev().removeClass("active")}),t('input[name="activity"]').change(function(e){var a=t(this).data("ams-url");if(a){e.preventDefault(),e.stopPropagation();var n=o.getFunctionByName(a);if("function"==typeof n&&(a=n.call(this)),"function"==typeof a)a.call(this);else{var i=t(".ajax-notifications");o.skin.loadURL(a,i)}}}),t("a","#user-menu LI.logout").click(function(e){e.preventDefault(),e.stopPropagation(),o.loginURL=t(this).attr("href"),o.skin.bigBox({title:" "+o.i18n.LOGOUT+" "+t("#show-shortcut").text()+" ?",content:o.i18n.LOGOUT_COMMENT,buttons:o.i18n.BTN_YES_NO},function(t){t===o.i18n.BTN_YES&&(o.root.addClass("animated fadeOutUp"),setTimeout(o.skin.logout,1e3))})});var r=t("nav");t("UL",r).myams_menu({accordion:!1!==r.data("ams-menu-accordion"),speed:o.menuSpeed}),t(".minifyme").click(function(a){n.toggleClass("minified"),e.localStorage&&(n.hasClass("minified")?e.localStorage.setItem("window-state","minified"):e.localStorage.setItem("window-state","")),t(this).effect("highlight",{},500),a.preventDefault()}),t("#refresh").click(function(t){o.skin.bigBox({title:" "+o.i18n.CLEAR_STORAGE_TITLE,content:o.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+o.i18n.BTN_CANCEL+"]["+o.i18n.BTN_OK+"]"},function(t){t===o.i18n.BTN_OK&&localStorage&&(localStorage.clear(),location.reload())}),t.preventDefault()}),n.on("click",function(e){var a=t(this);a.is(e.target)||0!==a.has(e.target).length||0!==t(".popover").has(e.target).length||a.popover("hide")}),o.ajax.check(t.resize,o.baseURL+"ext/jquery-resize"+o.devext+".js",function(){t("#main").resize(function(){o.skin._setPageHeight(),o.skin._checkMobileWidth()}),r.resize(function(){o.skin._setPageHeight()})}),o.ajaxNav&&(t(document).on("click",'a[href="#"]',function(t){t.preventDefault()}),t(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(e){var a=t(e.currentTarget),n=a.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var i=a.attr("href")||a.data("ams-url");if(i&&!i.startsWith("javascript")&&!a.attr("target")&&!0!==a.data("ams-context-menu")){e.preventDefault(),e.stopPropagation();var s,r,c;i.indexOf("?")>=0?(s=i.split("?"),r=s[0],c=s[1].unserialize()):(r=i,c=void 0);var l=o.getFunctionByName(r);"function"==typeof l&&(i=l.call(a,c)),"function"==typeof i?i.call(a,c):(i=i.replace(/\%23/,"#"),e.ctrlKey?window.open(i):(r=a.data("ams-target"))?o.form.confirmChangedForm(r,function(){o.skin.loadURL(i,r,a.data("ams-link-options"),a.data("ams-link-callback"))}):o.form.confirmChangedForm(function(){i.startsWith("#")?i!==location.hash&&(o.root.hasClass("mobile-view-activated")?(o.root.removeClass("hidden-menu"),window.setTimeout(function(){window.location.hash=i},50)):window.location.hash=i):window.location=i}))}}}),t(document).on("click",'a[target="_blank"]',function(e){e.preventDefault();var a=t(e.currentTarget);window.open(a.attr("href")),o.stats.logEvent(a.data("ams-stats-category")||"Navigation",a.data("ams-stats-action")||"External",a.data("ams-stats-label")||a.attr("href"))}),t(document).on("click",'a[target="_top"]',function(e){e.preventDefault(),o.form.confirmChangedForm(function(){window.location=t(e.currentTarget).attr("href")})}),t(window).on("hashchange",o.skin.checkURL)),t(document).off("click.modal").on("click",'[data-toggle="modal"]',function(e){var a=t(this),n=a.data("ams-disabled-handlers");!0!==n&&"click"!==n&&"all"!==n&&!0!==a.data("ams-context-menu")&&(!0===a.data("ams-stop-propagation")&&e.stopPropagation(),e.preventDefault(),o.dialog.open(a),a.parents("#shortcut").exists()&&setTimeout(o.skin._hideShortcutButtons,300))}),t(document).on("click",'button[type="submit"], button.submit',function(){var e=t(this);t(e.get(0).form).data("ams-submit-button",e)}),t(document).on("click",'input[type="checkbox"][readonly]',function(){return!1}),t(document).on("click","[data-ams-click-handler]",function(e){var a=t(this),n=a.data("ams-disabled-handlers");if(!0!==n&&"click"!==n&&"all"!==n){var i=a.data();if(i.amsClickHandler){!0!==i.amsStopPropagation&&!0!==i.amsClickStopPropagation||e.stopPropagation(),!0!==i.amsClickKeepDefault&&e.preventDefault();for(var s=i.amsClickHandler.split(/\s+/),r=0;rs&&t(window).height()-n'),o.skin.loadURL(n.amsUrl,a.attr("href"),{afterLoadCallback:function(){n.amsTabLoadOnce&&a.data("ams-tab-loaded",!0),t("i",a).remove()},afterErrorCallback:function(){t("i",a).remove()}})}}),t(document).on("hide.bs.modal",function(e){var a=t(e.target);o.form.confirmChangedForm(a,function(){return a.data("modal").isShown=!0,!0},function(){return e.preventDefault(),!1})}),t(document).on("myams.refresh",function(t,e){a.executeFunctionByName(e.handler||a.skin.refreshContent,t.target,e)}),o.initContent(document),o.ajaxNav&&r.exists()&&o.skin.checkURL(),o.form.setFocus(document),t(window).on("beforeunload",o.form.checkBeforeUnload)},a.initContent=function(e){t(".tipsy").remove(),t("[rel=tooltip]",e).tooltip(),t("[rel=popover]",e).popover(),t("[rel=popover-hover]",e).popover({trigger:"hover"}),o.plugins.init(e),o.callbacks.init(e),o.events.init(e),o.form.init(e),"desktop"===o.device?o.skin._initDesktopWidgets(e):o.skin._initMobileWidgets(e),o.skin._setPageHeight()},a.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_CHARACTER_COPY_OK:"Character copied to clipboard",CLIPBOARD_TEXT_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"},a.plugins.i18n={widgets:{},validate:{},datatables:{},fancybox:{ERROR:"Can't load requested content.",RETRY:"Please check URL or try again later.",CLOSE:"Close",NEXT:"Next",PREVIOUS:"Previous"},dndupload:{FILES_SELECTED:"{count} files selected",CHOOSE_FILE:"Select file(s)",ADD_INFO:"to add them to current folder,",DRAG_FILE:"or drag and drop them here!",UPLOAD:"Upload",UPLOADING:"Uploading…",DONE:"Done!",UPLOAD_MORE:"Upload more?",ERROR:"Error!",TRY_AGAIN:"Try again?"}},t(document).ready(function(){var e=(t=jQuery.noConflict())("HTML");e.removeClass("no-js").addClass("js");var o=e.attr("lang")||e.attr("xml:lang");o&&!o.startsWith("en")?(a.lang=o,a.getScript(a.baseURL+"i18n/myams_"+o.substr(0,2)+a.devext+".js",function(){a.initPage()})):a.initPage()})}(jQuery,this); diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-skin.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/myams-skin.min.js Wed Oct 17 17:55:33 2018 +0200 @@ -0,0 +1,1 @@ +!function(e,a){var t=a.MyAMS,i=t;t.skin={_setPageHeight:function(){var a=e("#main").height(),t=(i.leftPanel.height(),e(window).height()-i.navbarHeight);a>t?i.root.css("min-height",a+i.navbarHeight):i.root.css("min-height",t),i.leftPanel.css("min-height",t),i.leftPanel.css("max-height",t)},_checkMobileWidth:function(){e(window).width()<979?i.root.addClass("mobile-view-activated"):i.root.hasClass("mobile-view-activated")&&i.root.removeClass("mobile-view-activated")},_showShortcutButtons:function(){i.shortcuts.animate({height:"show"},200,"easeOutCirc"),i.root.addClass("shortcut-on")},_hideShortcutButtons:function(){i.shortcuts.animate({height:"hide"},300,"easeOutCirc"),i.root.removeClass("shortcut-on")},checkNotification:function(){var a=e(".badge","#user-activity >span");parseInt(a.text())>0?a.removeClass("hidden").addClass("bg-color-red bounceIn animated"):a.addClass("hidden").removeClass("bg-color-red bounceIn animated")},refreshNotificationsPanel:function(a){var t=e(this);t.addClass("disabled"),e("i",t).addClass("fa-spin"),e('input[name="activity"]:checked',"#user-activity").change(),e("i",t).removeClass("fa-spin"),t.removeClass("disabled")},refreshContent:function(a){var i=e('[id="'+a.object_id+'"]');return i.replaceWith(e(a.content)),i=e('[id="'+a.object_id+'"]'),t.initContent(i),i},refreshImage:function(a){e('img[src^="'+a.src+'"]').attr("src",a.target)},refreshWidget:function(a){var i=e('[id="'+a.parent_id+'"]'),n=e('[name="'+a.widget_name+'"]',i);n.exists()||(n=e('[name="'+a.widget_name+':list"]',i));var s=n.parents(".input").last();return s.html(a.content),t.initContent(s),s},refreshTable:function(a){var i=e('[id="'+a.object_id+'"]').parents(".ams-widget:first");return i.replaceWith(e(a.table)),i=e('[id="'+a.object_id+'"]').parents(".ams-widget:first"),t.initContent(i),i},refreshSwitchedTable:function(e){var a=i.skin.refreshTable(e).siblings("legend");a.parents("fieldset:first").hasClass("switched")&&a.click()},refreshRow:function(a){var i=e('tr[id="'+a.object_id+'"]'),n=i.parents("table").first(),s=e(a.row);return i.replaceWith(s),t.initContent(s),n.hasClass("table-dnd")&&(s.addClass("no-drag-handle"),n.tableDnDUpdate()),s},refreshRowCell:function(a){var i=e('tr[id="'+a.object_id+'"]'),n=i.parents("table").first(),s=e("tr",e("thead",n)),o=e('th[data-ams-column-name="'+a.col_name+'"]',s),r=e("th",s).index(o);if(r>-1){var l=e(e("td",i).get(r));l.html(a.cell),t.initContent(l)}},switchCellContent:function(a){var i=e(this),n=e("i.switch",i),s=i.parents("td"),o=e(i.data("ams-switch-target")||".inner-table-form",s),r=i.parents("tr");if(n.hasClass("fa-plus-square-o")){var l=r.parents("table");o.html('

'),t.ajax.post(l.data("ams-location")+"/"+i.data("ams-switch-handler"),{object_name:r.data("ams-element-name")},function(e){o.html(e),e&&(t.initContent(o),n.removeClass("fa-plus-square-o").addClass("fa-minus-square-o"))})}else t.skin.cleanContainer(o),o.empty(),n.removeClass("fa-minus-square-o").addClass("fa-plus-square-o")},_initDesktopWidgets:function(t){if(i.enableWidgets){var n=e(".ams-widget",t);n.length>0&&i.ajax.check(e.fn.MyAMSWidget,i.baseURL+"myams-widgets"+i.devext+".js",function(){n.each(function(){var a=e(this),t=a.data(),n=e.extend({},{deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"},t.amsWidgetOptions);n=i.executeFunctionByName(t.amsWidgetInitcallback,a,n)||n,a.MyAMSWidget(n)}),a.MyAMSWidget.initWidgetsGrid(e(".ams-widget-grid",t))})}},_initMobileWidgets:function(e){i.enableMobile&&i.enableWidgets&&i.skin._initDesktopWidgets(e)},alert:function(a,t,n,s,o,r){"error"===t&&(t="danger"),e(".alert-"+t,a).not(".persistent").remove();var l='

'+n+"

"+(o?"

"+o+"

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

    '+i.i18n.ERROR+s+"

    "+e.responseText),n&&n.afterErrorCallback&&i.executeFunctionByName(n.afterErrorCallback,this)},async:void 0===n.async||n.async},r=e.extend({},o,n);e.ajax(r)},setLanguage:function(e,a){var t=a.lang;switch(a.handler_type||"json"){case"json":var n=a.method||"setUserLanguage";i.jsonrpc.post(n,{lang:t},function(){window.location.reload(!0)});break;case"ajax":var s=a.href||"setUserLanguage";i.ajax.post(s,{lang:t},function(){window.location.reload(!0)})}},logout:function(){window.location=i.loginURL}}}(jQuery,this); diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-stats.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/myams-stats.min.js Wed Oct 17 17:55:33 2018 +0200 @@ -0,0 +1,1 @@ +!function(a,t){var o=t.MyAMS;o.stats={logPageview:function(a){if(void 0!==t._gaq){var o=t.window.location;t._gaq.push(["_trackPageview",a||o.pathname+o.hash])}},logEvent:function(a,o,e){void 0!==t._gaq&&("object"==typeof a&&(o=a.action,e=a.label,a=a.category),t._gaq.push(["_trackEvent",a,o,e]))}}}(jQuery,this); diff -r bcd694fda81d -r 4ee52103327c src/pyams_skin/resources/js/myams-tree.min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/resources/js/myams-tree.min.js Wed Oct 17 17:55:33 2018 +0200 @@ -0,0 +1,1 @@ +!function(a,e){var t=e.MyAMS,s=t;t.tree={switchTableNode:function(){function e(t){a('tr[data-ams-tree-node-parent-id="'+t+'"]').each(function(){var t=a(this);e(t.data("ams-tree-node-id")),t.remove()})}var r=a(this),n=a("i.switch",r),d=r.parents("tr").first(),o=d.parents("table").first();if(n.hasClass("fa-minus-square-o"))e(d.data("ams-tree-node-id")),n.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");else{var i=d.data("ams-location")||o.data("ams-location")||"",l=d.data("ams-tree-nodes-target")||o.data("ams-tree-nodes-target")||"get-tree-nodes.json",f=d.data("ams-element-name");n.removeClass("fa-plus-square-o").addClass("fa-cog fa-spin"),t.ajax.post(i+"/"+f+"/"+l,{can_sort:!a("td.sorter",d).is(":empty")},function(e,t){if(e.length>0){for(var r=d,i=0;i0},void 0===e.scrollbarWidth&&(e.scrollbarWidth=function(){var a=e('
    ').appendTo("body"),t=a.children(),n=t.innerWidth()-t.height(99).innerWidth();return a.remove(),n}),e.fn.extend({exists:function(){return e(this).length>0},objectOrParentWithClass:function(e){return this.hasClass(e)?this:this.parents("."+e)},listattr:function(a){var t=[];return this.each(function(){t.push(e(this).attr(a))}),t},style:function(e,a,t){if(void 0!==this.get(0)){var n=this.get(0).style;return void 0!==e?void 0!==a?(t=void 0!==t?t:"",n.setProperty(e,a,t),this):n.getPropertyValue(e):n}},removeClassPrefix:function(a){return this.each(function(t,n){var s=n.className.split(" ").map(function(e){return e.startsWith(a)?"":e});n.className=e.trim(s.join(" "))}),this}}),void 0===a.MyAMS&&(a.MyAMS={devmode:!0,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:!0,safeMethods:["GET","HEAD","OPTIONS","TRACE"],csrfCookieName:"csrf_token",csrfHeaderName:"X-CSRF-Token",enableWidgets:!0,enableMobile:!1,enableFastclick:!1,warnOnFormChange:!1,ismobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())});var n=a.MyAMS,s=n;n.baseURL=function(){var a=e('script[src*="/myams.js"], script[src*="/myams.min.js"]').attr("src");return s.devmode=a.indexOf(".min.js")<0,s.devext=s.devmode?"":".min",a.substring(0,a.lastIndexOf("/")+1)}(),n.log=function(){t&&t.debug&&t.debug(this,arguments)},n.getQueryVar=function(e,a){if(e.indexOf("?")<0)return!1;e.endsWith("&")||(e+="&");var t=new RegExp(".*?[&\\?]"+a+"=(.*?)&.*"),n=e.replace(t,"$1");return n!==e&&n},n.rgb2hex=function(a){return"#"+e.map(a.match(/\b(\d+)\b/g),function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},n.generateId=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()},n.generateUUID=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===a?t:3&t|8).toString(16)})},n.getObject=function(e,a){if(e){if("string"!=typeof e)return e;var t=e.split(".");a=void 0===a||null===a?window:a;for(var n=0;n").attr("data-ams-id",t).text('@import "'+s.getSource(a)+'";'),n)var c=setInterval(function(){try{o[0].sheet.cssRules;n.call(window,!0,i),clearInterval(c)}catch(e){}},10);o.appendTo(r)}else n&&n.call(window,!1,i)}}(jQuery,this),jQuery.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");for(var a="",t=0;t127&&n<2048?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128))}return a},decode:function(e){for(var a="",t=0,n=0,s=0,i=0;t191&&n<224?(s=e.charCodeAt(t+1),a+=String.fromCharCode((31&n)<<6|63&s),t+=2):(s=e.charCodeAt(t+1),i=e.charCodeAt(t+2),a+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&i),t+=3);return a}},function(e,a){var t=a.MyAMS;e.fn.extend({contextMenu:function(a){function n(t,n,s){var i=e(window)[n](),r=e(a.menuSelector)[n](),o=t;return t+r>i&&r',openedSign:''},a),n=e(this);n.find("LI").each(function(){var a=e(this);if(a.find("UL").size()>0){a.find("A:first").append(""+t.closedSign+"");var n=a.find("A:first");"#"===n.attr("href")&&n.click(function(){return!1})}}),n.find("LI.active").each(function(){var a=e(this).parents("UL"),n=a.parent("LI");a.slideDown(t.speed),n.find("b:first").html(t.openedSign),n.addClass("open")}),n.find("LI A").on("click",function(){var a=e(this);if(!a.hasClass("active")){var s=a.attr("href").replace(/^#/,""),i=a.parent().find("UL");if(t.accordion){var r=a.parent().parents("UL"),o=n.find("UL:visible");o.each(function(a){var n=!0;if(r.each(function(e){if(r[e]===o[a])return n=!1,!1}),n&&i!==o[a]){var c=e(o[a]);!s&&c.hasClass("active")||c.slideUp(t.speed,function(){e(this).parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}var c=a.parent().find("UL:first");s||!c.is(":visible")||c.hasClass("active")?c.slideDown(t.speed,function(){a.parent("LI").addClass("open").find("B:first").delay(t.speed).html(t.openedSign)}):c.slideUp(t.speed,function(){a.parent("LI").removeClass("open").find("B:first").delay(t.speed).html(t.closedSign)})}})}})}(jQuery,this),function(e,a){var t=a.MyAMS;t.event={stop:function(e){e||(e=window.event),e&&"string"!=typeof e&&(e.stopPropagation?(e.stopPropagation(),e.preventDefault()):(e.cancelBubble=!0,e.returnValue=!1))}}}(jQuery,this),function(e,a){var t=a.MyAMS,n=t;t.browser={getInternetExplorerVersion:function(){var e=-1;if("Microsoft Internet Explorer"===navigator.appName){var a=navigator.userAgent;null!==new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))}return e},checkVersion:function(){var e="You're not using Windows Internet Explorer.",t=this.getInternetExplorerVersion();t>-1&&(e=t>=8?"You're using a recent copy of Windows Internet Explorer.":"You should upgrade your copy of Windows Internet Explorer."),a.alert&&a.alert(e)},isIE8orlower:function(){var e="0",a=this.getInternetExplorerVersion();return a>-1&&(e=a>=9?0:1),e},copyToClipboard:function(s){function i(s){var i=!1;if(window.clipboardData&&window.clipboardData.setData)i=clipboardData.setData("Text",s);else if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var r=e("