assets/themes/j1/core/js/template.js in j1-template-2020.0.17 vs assets/themes/j1/core/js/template.js in j1-template-2020.0.18
- old
+ new
@@ -17,10 +17,10 @@
e.exports=function(e){var o,n,t=j1.getCookieNames(),a=(t.cookie_consent,t.user_session,{});$.extend({foo:"bar",bar:"foo"},e);return{init:function(e,t){return o=log4javascript.getLogger("j1.core.navigator"),n="core is being initialized",o.info(n),this.manageDropdownMenu(e,t),this.navbarSticky(),this.navbarScrollspy(),a.type="command",a.action="module_initialized",a.text="navigator core initialized successfully",j1.sendMessage("j1.core.navigator","j1.adapter.navigator",a),!0},eventHandler:function(){var e=log4javascript.getLogger("j1.core.navigator.eventHandler"),o=$("nav.navbar.navigator");if(o.hasClass("navbar-sticky")&&o.wrap("<div class='wrap-sticky'></div>"),o.hasClass("brand-center")){var n=new Array,t=$("nav.brand-center"),a=t.find("ul.navbar-nav");t.find("ul.navbar-nav > li").each((function(){n.push($(this).html())}));var s=n.splice(0,Math.round(n.length/2)),i=n,r="",l=function(e){r="";for(var o=0;o<e.length;o++)r+="<li>"+e[o]+"</li>"};l(s),a.html(r),t.find("ul.nav").first().addClass("navbar-left"),l(i),a.after('<ul class="nav navbar-nav"></ul>').next().html(r),t.find("ul.nav").last().addClass("navbar-right"),t.find("ul.nav.navbar-left").wrap("<div class='col_half left'></div>"),t.find("ul.nav.navbar-right").wrap("<div class='col_half right'></div>"),t.find("ul.navbar-nav > li").each((function(){var e=$("ul.dropdown-menu",this),o=$("ul.megamenu-content",this);e.closest("li").addClass("dropdown"),o.closest("li").addClass("megamenu-fw")}))}o.find("ul.nav").hasClass("navbar-center")&&o.addClass("menu-center"),o.hasClass("navbar-full")?($("nav.navbar.navigator").find("ul.nav").wrap("<div class='wrap-full-menu'></div>"),$(".wrap-full-menu").wrap("<div class='nav-full'></div>"),$("ul.nav.navbar-nav").prepend("<li class='close-full-menu'><a href='#'><i class='mdi mdi-close'></i></a></li>")):o.hasClass("navbar-mobile")?o.removeClass("no-full"):o.addClass("no-full"),o.hasClass("no-background")&&$(window).on("scroll",(function(){var e=$("nav.navbar").outerHeight();$(window).scrollTop()>e?$(".navbar-fixed").removeClass("no-background"):$(".navbar-fixed").addClass("no-background")})),o.hasClass("navbar-transparent")&&$(window).on("scroll",(function(){var e=$("nav.navbar").outerHeight();$(window).scrollTop()>e?($(".navbar-fixed").removeClass("navbar-transparent"),$(".navbar-fixed").addClass("navbar-scrolled")):($(".navbar-fixed").removeClass("navbar-scrolled"),$(".navbar-fixed").addClass("navbar-transparent"))})),$("nav.navbar.navigator .attr-nav").each((function(){e.debug("register OPEN event|s for QuickSearch"),$("li.search > a",this).on("click",(function(o){e.debug("manage search action OPEN"),$("html,body").animate({scrollTop:0},0),$(".top-search").slideToggle("slow","swing",(function(){$(".top-search").is(":visible")?($("body").addClass("stop-scrolling"),$("body").bind("touchmove",(function(e){e.preventDefault()}))):($("body").removeClass("stop-scrolling"),$("body").unbind("touchmove"))}))}))})),e.debug("register CLOSE event|s for QuickSearch"),$(".input-group-addon.close-search").on("click",(function(o){o.preventDefault(),e.debug("manage search action CLOSE"),$(".top-search").slideUp("slow","swing"),$("html,body").animate({scrollTop:0},0),$("body").removeClass("stop-scrolling"),$("body").unbind("touchmove"),o.stopPropagation()})),$("nav.navbar.navigator .attr-nav").each((function(){e.debug("register SHOW|HIDE event|s for J1 Translator"),$("li.translator > a",this).on("click",(function(o){e.debug("toggle translator icon SHOW|HIDE"),$("#google_translate_element").toggle(),"none"!==$("#google_translate_element").css("display")&&$("html,body").animate({scrollTop:0},"slow")}))})),$("body").wrapInner("<div class='wrapper'></div>")},manageDropdownMenu:function(e,o){var n,t,a,s,i=e,r=o,l=$("nav.navbar.navigator"),d=$(window).width(),c=($("nav").width(),l.find("ul.nav").data("in")),u=l.find("ul.nav").data("out"),p="#"+r.xhr_container_id+".collapse",m=r.delay_menu_open;if(d<(t="lg"===i.nav_bar.media_breakpoint?992:"md"===i.nav_bar.media_breakpoint?768:"sm"===i.nav_bar.media_breakpoint?576:992)?($(p).addClass("navbar-collapse"),$(p).removeClass("show"),$("#navigator_nav_quicklinks").addClass("show"),$("nav.navbar.navigator .attr-nav").each((function(){$(".dropdown-menu",this).removeClass("animated"),$("li.dropdown",this).off("mouseenter"),$("li.dropdown",this).off("mouseleave"),$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){$(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle(),$(".navbar-toggle").each((function(){$(".mdi",this).removeClass("mdi-close"),$(".mdi",this).addClass("mdi-menu"),$(".navbar-collapse").removeClass("in"),$(".navbar-collapse").removeClass("open")}))})),$(this).on("mouseleave",(function(){$(".dropdown-menu",this).stop().fadeOut(),$("li.dropdown",this).removeClass("open")}))})),$("#desktop_menu").hide()):d>=t&&($("#navigator_nav_quicklinks").removeClass("show"),$("#desktop_menu").show(),$(".dropdown-menu > li").hover((function(){var e,o=$(this).find("ul");1==o.length&&(1.1*o.height()/(e=null!=o.css("max-height")?o.css("max-height").match(/\d+/)[0]:200)>1&&o.css({height:e,"overflow-y":"auto"}))})),$(p).removeClass("navbar-collapse"),$(p).addClass("show"),l.hasClass("navbar-sidebar")&&$("nav.navbar.navigator ul.nav").each((function(){$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){})),$(".dropdown-menu",this).addClass("animated"),$("li.dropdown",this).on("mouseenter",(function(){$(".dropdown-menu",this).eq(0).removeClass(u),$(".dropdown-menu",this).eq(0).stop().fadeIn().addClass(c),$(this).addClass("open")})),$(".col_menu").each((function(){$(".content",this).addClass("animated"),$(".title",this).on("mouseenter",(function(){$(this).closest(".col_menu").find(".content").stop().fadeIn().addClass(c),$(this).closest(".col_menu").addClass("open")}))})),$(this).on("mouseleave",(function(){$(".dropdown-menu",this).stop().removeClass(c),$(".dropdown-menu",this).stop().addClass(u).fadeOut(),$(".col_menu",this).find(".content").stop().fadeOut().removeClass(c),$(".col_menu",this).removeClass("open"),$("li.dropdown",this).removeClass("open")}))})),$("nav.navbar.navigator ul.nav").each((function(){$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){})),$(".megamenu-fw",this).each((function(){$(".title",this).off("click"),$("a.dropdown-toggle",this).off("click"),$(".content").removeClass("animated")})),$(".dropdown-menu",this).addClass("animated"),$("li.dropdown",this).on("mouseenter",(function(){if(n=$(".dropdown-menu",this).eq(0),a=$(this),$("body").hasClass("stop-scrolling")||$("body").hasClass("mm-ocd-opened"))return!1;n.removeClass(u),n.removeClass("open"),a.addClass("open"),s=window.setTimeout((function(){a.hasClass("open")&&(n.stop().fadeIn().addClass(c),n.addClass("open"),a.addClass("open"))}),m)})),$("li.dropdown",this).on("mouseleave",(function(){window.clearTimeout(s),$(this).removeClass("open").removeClass("open"),$(".dropdown-menu",this).removeClass("open"),$(".dropdown-menu",this).eq(0).removeClass(c),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(u)})),$(this).on("mouseleave",(function(){window.clearTimeout(s),$("li.dropdown",this).removeClass("open"),$(".dropdown-menu",this).removeClass("open"),$(".dropdown-menu",this).removeClass(c),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(u)}))}))),$("nav.navbar.navigator .attr-nav").each((function(){$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){})),$(".dropdown-menu",this).addClass("animated"),$("li.dropdown",this).on("mouseenter",(function(){$(".dropdown-menu",this).eq(0).removeClass(u),$(".dropdown-menu",this).eq(0).stop().fadeIn().addClass(c),$(this).addClass("open")})),$("li.dropdown",this).on("mouseleave",(function(){$(".dropdown-menu",this).eq(0).removeClass(c),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(u),$(this).removeClass("open")})),$(this).on("mouseleave",(function(){$(".dropdown-menu",this).removeClass(c),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(u),$("li.dropdown",this).removeClass("open")}))})),l.hasClass("navbar-full")){var f=$(window).height(),v=$(window).width();$(".nav-full").css("height",f+"px"),$(".wrap-full-menu").css("height",f+"px"),$(".wrap-full-menu").css("width",v+"px"),$(".navbar-collapse").addClass("animated"),$(".navbar-toggle").each((function(){var e=$(this).data("target");$(this).off("click"),$(this).on("click",(function(o){o.preventDefault(),$(e).removeClass(u),$(e).addClass("in"),$(e).addClass(c)})),$("li.close-full-menu").on("click",(function(o){o.preventDefault(),$(e).addClass(u),setTimeout((function(){$(e).removeClass("in"),$(e).removeClass(c)}),500)}))}))}},navbarSticky:function(){var e=$("nav.navbar.navigator");if(e.hasClass("navbar-sticky")){var o=e.height();$(".wrap-sticky").height(o);var n=$(".wrap-sticky").offset().top;$(window).on("scroll",(function(){$(window).scrollTop()>n?e.addClass("sticked"):e.removeClass("sticked")}))}},navbarScrollspy:function(){var e=$(".navbar-scrollspy"),o=$("body"),n=$("nav.navbar.navigator"),t=n.outerHeight();if(e.length){o.scrollspy({target:".navbar",offset:t}),$(".scroll").on("click",(function(e){e.preventDefault(),$(".scroll").removeClass("active"),$(this).addClass("active"),$(".navbar-collapse").removeClass("in"),$(".navbar-toggle").each((function(){$(".mdi",this).removeClass("mdi-close"),$(".mdi",this).addClass("mdi-menu")}));$(window).scrollTop();var o,t=$(this).find("a"),a=$(t.attr("href")).offset().top,s=$(window).width(),i=n.data("minus-value-desktop"),r=n.data("minus-value-mobile"),l=n.data("speed");o=s>992?a-i:a-r,$("html, body").stop().animate({scrollTop:o},l)}));var a=function(){var e=o.data("bs.scrollspy");e&&(t=n.outerHeight(),e.options.offset=t,o.data("bs.scrollspy",e),o.scrollspy("refresh"))};$(window).on("resize",(function(){clearTimeout(e);var e=setTimeout(a,200)}))}},updateSidebar:function(e){var o,t=log4javascript.getLogger("j1.core.navigator.updateSidebar");return o=JSON.stringify(e),n="user state data: "+o,t.debug(n),j1.resolveMacros(e),j1.updateMacros(e),!0}}}(jQuery)},function(e,o,n){"use strict";
/*!
* J1 SSM
* Copyright (C) 2020 Juergen Adams
* Licensed under MIT License.
- */e.exports=function(e){$.extend({foo:"bar",bar:"foo"},e);return{init:function(e){var o,n,t="true"===e.toc;n="initialize ssm core",(o=log4javascript.getLogger("j1.core.ssc")).info(n),e.z_level&&a.css("z-index",e.z-level);var a=$("#ssm-container"),s=t?e.margin:e.margin+35;a.css("right","".concat(s)),a.hasClass("ssm-btns-left")&&(a.hasClass("ssm-anim-slide")||a.hasClass("ssm-anim-icons"))?a.css("left","-"+(0-s)+"px"):a.hasClass("ssm-btns-right")&&(a.hasClass("ssm-anim-slide")||a.hasClass("ssm-anim-icons"))&&a.css("right","-"+(0-s)+"px"),"menu"==e.mode&&a.hover((function(){$("body").addClass("stop-scrolling"),$("body").bind("touchmove",(function(e){e.preventDefault()})),window.setTimeout((function(){a.hasClass("ssm-btns-left")&&a.hasClass("ssm-anim-slide")?a.stop().animate({left:0},300):a.hasClass("ssm-btns-right")&&a.hasClass("ssm-anim-slide")&&a.stop().animate({right:0},300)}),250)}),(function(){window.setTimeout((function(){$("body").removeClass("stop-scrolling"),$("body").unbind("touchmove"),a.hasClass("ssm-btns-left")&&a.hasClass("ssm-anim-slide")?a.animate({left:"-"+(0-s)+"px"},300):a.hasClass("ssm-btns-right")&&a.hasClass("ssm-anim-slide")&&a.animate({right:"-"+(0-s)+"px"},300)}),100)})),n="ssm core successfully initialized",o.info(n)}}}(jQuery)},function(e,o){
+ */e.exports=function(e){$.extend({foo:"bar",bar:"foo"},e);return{init:function(e){var o,n,t="true"===e.toc;n="initialize ssm core",(o=log4javascript.getLogger("j1.core.ssc")).info(n);var a=$("#content"),s=$("#ssm-container"),i=t?e.margin:e.margin+35;e.z_level&&ssb_panel.css("z-index",e.z-level),a.css("padding-right","50px"),s.css("right","".concat(i)),s.hasClass("ssm-btns-left")&&(s.hasClass("ssm-anim-slide")||s.hasClass("ssm-anim-icons"))?s.css("left","-"+(0-i)+"px"):s.hasClass("ssm-btns-right")&&(s.hasClass("ssm-anim-slide")||s.hasClass("ssm-anim-icons"))&&s.css("right","-"+(0-i)+"px"),"menu"==e.mode&&s.hover((function(){$("body").addClass("stop-scrolling"),$("body").bind("touchmove",(function(e){e.preventDefault()})),window.setTimeout((function(){s.hasClass("ssm-btns-left")&&s.hasClass("ssm-anim-slide")?s.stop().animate({left:0},300):s.hasClass("ssm-btns-right")&&s.hasClass("ssm-anim-slide")&&s.stop().animate({right:0},300)}),250)}),(function(){window.setTimeout((function(){$("body").removeClass("stop-scrolling"),$("body").unbind("touchmove"),s.hasClass("ssm-btns-left")&&s.hasClass("ssm-anim-slide")?s.animate({left:"-"+(0-i)+"px"},300):s.hasClass("ssm-btns-right")&&s.hasClass("ssm-anim-slide")&&s.animate({right:"-"+(0-i)+"px"},300)}),100)})),n="ssm core successfully initialized",o.info(n)}}}(jQuery)},function(e,o){
/*!
* J1 Cookiebar
* Copyright (C) 2020 Juergen Adams
* Licensed under MIT License.
*/
\ No newline at end of file