var App=function(){var isRTL=false;var isIE8=false;var isIE9=false;var isIE10=false;var resizeHandlers=[];var assetsPath="../assets/";var globalImgPath="global/img/";var globalPluginsPath="global/plugins/";var globalCssPath="global/css/";var brandColors={"blue":"#89C4F4","red":"#F3565D","green":"#1bbc9b","purple":"#9b59b6","grey":"#95a5a6","yellow":"#F8CB00"};var handleInit=function(){if($("body").css("direction")==="rtl"){isRTL=true}isIE8=!!navigator.userAgent.match(/MSIE 8.0/);isIE9=!!navigator.userAgent.match(/MSIE 9.0/);isIE10=!!navigator.userAgent.match(/MSIE 10.0/);if(isIE10){$("html").addClass("ie10")}if(isIE10||isIE9||isIE8){$("html").addClass("ie")}};var _runResizeHandlers=function(){for(var i=0;i .portlet-title .fullscreen",function(e){e.preventDefault();var portlet=$(this).closest(".portlet");if(portlet.hasClass("portlet-fullscreen")){$(this).removeClass("on");portlet.removeClass("portlet-fullscreen");$("body").removeClass("page-portlet-fullscreen");portlet.children(".portlet-body").css("height","auto")}else{var height=App.getViewPort().height-portlet.children(".portlet-title").outerHeight()-parseInt(portlet.children(".portlet-body").css("padding-top"))-parseInt(portlet.children(".portlet-body").css("padding-bottom"));$(this).addClass("on");portlet.addClass("portlet-fullscreen");$("body").addClass("page-portlet-fullscreen");portlet.children(".portlet-body").css("height",height)}})};var handleMaterialDesign=function(){$("body").on("click",".md-checkbox > label, .md-radio > label",function(){var the=$(this);var el=$(this).children("span:first-child");el.addClass("inc");var newone=el.clone(true);el.before(newone);$("."+el.attr("class")+":last",the).remove()});if($("body").hasClass("page-md")){var element,circle,d,x,y;$("body").on("click","a.btn, button.btn, input.btn, label.btn",function(e){element=$(this);if(element.find(".md-click-circle").length==0){element.prepend("")}circle=element.find(".md-click-circle");circle.removeClass("md-click-animate");if(!circle.height()&&!circle.width()){d=Math.max(element.outerWidth(),element.outerHeight());circle.css({height:d,width:d})}x=e.pageX-element.offset().left-circle.width()/2;y=e.pageY-element.offset().top-circle.height()/2;circle.css({top:y+"px",left:x+"px"}).addClass("md-click-animate");setTimeout(function(){circle.remove()},1000)})}var handleInput=function(el){if(el.val()!=""){el.addClass("edited")}else{el.removeClass("edited")}};$("body").on("keydown",".form-md-floating-label .form-control",function(e){handleInput($(this))});$("body").on("blur",".form-md-floating-label .form-control",function(e){handleInput($(this))});$(".form-md-floating-label .form-control").each(function(){if($(this).val().length>0){$(this).addClass("edited")}})};var handleiCheck=function(){};var handleBootstrapSwitch=function(){if(!$().bootstrapSwitch){return}$(".make-switch").bootstrapSwitch()};var handleBootstrapConfirmation=function(){};var handleAccordions=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(e){App.scrollTo($(e.target))})};var handleTabs=function(){if(encodeURI(location.hash)){var tabid=encodeURI(location.hash.substr(1));$('a[href="#'+tabid+'"]').parents(".tab-pane:hidden").each(function(){var tabid=$(this).attr("id");$('a[href="#'+tabid+'"]').click()});$('a[href="#'+tabid+'"]').click()}if($().tabdrop){$(".tabbable-tabdrop .nav-pills, .tabbable-tabdrop .nav-tabs").tabdrop({text:' '})}};var handleModals=function(){};var handleTooltips=function(){$(".tooltips").tooltip();$(".portlet > .portlet-title .fullscreen").tooltip({trigger:"hover",container:"body",title:"Fullscreen"});$(".portlet > .portlet-title > .tools > .reload").tooltip({trigger:"hover",container:"body",title:"Reload"});$(".portlet > .portlet-title > .tools > .remove").tooltip({trigger:"hover",container:"body",title:"Remove"});$(".portlet > .portlet-title > .tools > .config").tooltip({trigger:"hover",container:"body",title:"Settings"});$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({trigger:"hover",container:"body",title:"Collapse/Expand"})};var handleDropdowns=function(){$("body").on("click",".dropdown-menu.hold-on-click",function(e){e.stopPropagation()})};var handleAlerts=function(){};var handleDropdownHover=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover(); $(this).addClass("hover-initialized")})};var handleTextareaAutosize=function(){if(typeof(autosize)=="function"){autosize(document.querySelector("textarea.autosizeme"))}};var lastPopedPopover;var handlePopovers=function(){$(".popovers").popover();$(document).on("click.bs.popover.data-api",function(e){if(lastPopedPopover){lastPopedPopover.popover("hide")}})};var handleScrollers=function(){App.initSlimScroll(".scroller")};var handleFancybox=function(){};var handleCounterup=function(){if(!$().counterUp){return}$("[data-counter='counterup']").counterUp({delay:10,time:1000})};var handleFixInputPlaceholderForIE=function(){if(isIE8||isIE9){$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var input=$(this);if(input.val()===""&&input.attr("placeholder")!==""){input.addClass("placeholder").val(input.attr("placeholder"))}input.focus(function(){if(input.val()==input.attr("placeholder")){input.val("")}});input.blur(function(){if(input.val()===""||input.val()==input.attr("placeholder")){input.val(input.attr("placeholder"))}})})}};var handleSelect2=function(){if($().select2){$.fn.select2.defaults.set("theme","bootstrap");$(".select2me").select2({placeholder:"Select",width:"auto",allowClear:true})}};var handleHeight=function(){$("[data-auto-height]").each(function(){var parent=$(this);var items=$("[data-height]",parent);var height=0;var mode=parent.attr("data-mode");var offset=parseInt(parent.attr("data-offset")?parent.attr("data-offset"):0);items.each(function(){if($(this).attr("data-height")=="height"){$(this).css("height","")}else{$(this).css("min-height","")}var height_=(mode=="base-height"?$(this).outerHeight():$(this).outerHeight(true));if(height_>height){height=height_}});height=height+offset;items.each(function(){if($(this).attr("data-height")=="height"){$(this).css("height",height)}else{$(this).css("min-height",height)}});if(parent.attr("data-related")){$(parent.attr("data-related")).css("height",parent.height())}})};return{init:function(){handleInit();handleOnResize();handleMaterialDesign();handleiCheck();handleBootstrapSwitch();handleScrollers();handleFancybox();handleSelect2();handlePortletTools();handleAlerts();handleDropdowns();handleTabs();handleTooltips();handlePopovers();handleAccordions();handleModals();handleBootstrapConfirmation();handleTextareaAutosize();handleCounterup();this.addResizeHandler(handleHeight);handleFixInputPlaceholderForIE()},initAjax:function(){handleiCheck();handleBootstrapSwitch();handleDropdownHover();handleScrollers();handleSelect2();handleFancybox();handleDropdowns();handleTooltips();handlePopovers();handleAccordions();handleBootstrapConfirmation()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(el){lastPopedPopover=el},addResizeHandler:function(func){resizeHandlers.push(func)},runResizeHandlers:function(){_runResizeHandlers()},scrollTo:function(el,offeset){var pos=(el&&el.length>0)?el.offset().top:0;if(el){if($("body").hasClass("page-header-fixed")){pos=pos-$(".page-header").height()}else{if($("body").hasClass("page-header-top-fixed")){pos=pos-$(".page-header-top").height()}else{if($("body").hasClass("page-header-menu-fixed")){pos=pos-$(".page-header-menu").height()}}}pos=pos+(offeset?offeset:-1*el.height())}$("html,body").animate({scrollTop:pos},"slow")},initSlimScroll:function(el){if(!$().slimScroll){return}$(el).each(function(){if($(this).attr("data-initialized")){return}var height;if($(this).attr("data-height")){height=$(this).attr("data-height")}else{height=$(this).css("height")}$(this).slimScroll({allowPageScroll:true,size:"7px",color:($(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb"),wrapperClass:($(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv"),railColor:($(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea"),position:isRTL?"left":"right",height:height,alwaysVisible:($(this).attr("data-always-visible")=="1"?true:false),railVisible:($(this).attr("data-rail-visible")=="1"?true:false),disableFadeOut:true});$(this).attr("data-initialized","1")})},destroySlimScroll:function(el){if(!$().slimScroll){return}$(el).each(function(){if($(this).attr("data-initialized")==="1"){$(this).removeAttr("data-initialized");$(this).removeAttr("style");var attrList={};if($(this).attr("data-handle-color")){attrList["data-handle-color"]=$(this).attr("data-handle-color")}if($(this).attr("data-wrapper-class")){attrList["data-wrapper-class"]=$(this).attr("data-wrapper-class")}if($(this).attr("data-rail-color")){attrList["data-rail-color"]=$(this).attr("data-rail-color")}if($(this).attr("data-always-visible")){attrList["data-always-visible"]=$(this).attr("data-always-visible")}if($(this).attr("data-rail-visible")){attrList["data-rail-visible"]=$(this).attr("data-rail-visible")}$(this).slimScroll({wrapperClass:($(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv"),destroy:true});var the=$(this);$.each(attrList,function(key,value){the.attr(key,value) })}})},scrollTop:function(){App.scrollTo()},blockUI:function(options){},unblockUI:function(target){},startPageLoading:function(options){},stopPageLoading:function(){},alert:function(options){},initFancybox:function(){handleFancybox()},getActualVal:function(el){el=$(el);if(el.val()===el.attr("placeholder")){return""}return el.val()},getURLParameter:function(paramName){var searchString=window.location.search.substring(1),i,val,params=searchString.split("&");for(i=0;i a, .hor-menu .dropdown-submenu > a").on("click",function(e){if(App.getViewPort().width a").on("click",function(e){if(App.getViewPort().widthoffset){$(".page-header-menu").addClass("fixed")}else{$(".page-header-menu").removeClass("fixed")}}if($("body").hasClass("page-header-top-fixed")){if($(window).scrollTop()>offset){$(".page-header-top").addClass("fixed")}else{$(".page-header-top").removeClass("fixed")}}})};var handleMainMenuActiveLink=function(mode,el){var url=location.hash.toLowerCase();var menu=$(".hor-menu");if(mode==="click"||mode==="set"){el=$(el)}else{if(mode==="match"){menu.find("li > a").each(function(){var path=$(this).attr("href").toLowerCase();if(path.length>1&&url.substr(1,path.length-1)==path.substr(1)){el=$(this);return}})}}if(!el||el.length==0){return}if(el.attr("href").toLowerCase()==="javascript:;"||el.attr("href").toLowerCase()==="#"){return}menu.find("li.active").removeClass("active");menu.find("li > a > .selected").remove();menu.find("li.open").removeClass("open");el.parents("li").each(function(){$(this).addClass("active");if($(this).parent("ul.navbar-nav").length===1){$(this).find("> a").append('')}})};var handleMainMenuOnResize=function(){var width=App.getViewPort().width;var menu=$(".page-header-menu");if(width>=resBreakpointMd){$(".page-header-menu").css("display","block")}else{if(widthoffset){$(".scroll-to-top").fadeIn(duration)}else{$(".scroll-to-top").fadeOut(duration)}})}else{$(window).scroll(function(){if($(this).scrollTop()>offset){$(".scroll-to-top").fadeIn(duration)}else{$(".scroll-to-top").fadeOut(duration)}})}$(".scroll-to-top").click(function(e){e.preventDefault();$("html, body").animate({scrollTop:0},duration);return false})};return{initHeader:function(){handleHeader();handleMainMenu();App.addResizeHandler(handleMainMenuOnResize);if(App.isAngularJsApp()){handleMainMenuActiveLink("match")}},initContent:function(){handleContentHeight()},initFooter:function(){handleGoTop()},init:function(){this.initHeader();this.initContent();this.initFooter()},setMainMenuActiveLink:function(mode,el){handleMainMenuActiveLink(mode,el)},closeMainMenu:function(){$(".hor-menu").find("li.open").removeClass("open");if(App.getViewPort().width .container-fluid").length===1){$(".theme-setting-layout",panel).val("fluid")}else{$(".theme-setting-layout",panel).val("boxed")}if($(".top-menu li.dropdown.dropdown-dark").length>0){$(".theme-setting-top-menu-style",panel).val("dark")}else{$(".theme-setting-top-menu-style",panel).val("light")}if($("body").hasClass("page-header-top-fixed")){$(".theme-setting-top-menu-mode",panel).val("fixed")}else{$(".theme-setting-top-menu-mode",panel).val("not-fixed")}if($(".hor-menu.hor-menu-light").length>0){$(".theme-setting-mega-menu-style",panel).val("light")}else{$(".theme-setting-mega-menu-style",panel).val("dark")}if($("body").hasClass("page-header-menu-fixed")){$(".theme-setting-mega-menu-mode",panel).val("fixed")}else{$(".theme-setting-mega-menu-mode",panel).val("not-fixed")}var resetLayout=function(){$("body").removeClass("page-header-top-fixed").removeClass("page-header-menu-fixed");$(".page-header-top > .container-fluid").removeClass("container-fluid").addClass("container");$(".page-header-menu > .container-fluid").removeClass("container-fluid").addClass("container");$(".page-head > .container-fluid").removeClass("container-fluid").addClass("container");$(".page-content > .container-fluid").removeClass("container-fluid").addClass("container");$(".page-prefooter > .container-fluid").removeClass("container-fluid").addClass("container");$(".page-footer > .container-fluid").removeClass("container-fluid").addClass("container")};var setLayout=function(){var layoutMode=$(".theme-setting-layout",panel).val();var headerTopMenuStyle=$(".theme-setting-top-menu-style",panel).val();var headerTopMenuMode=$(".theme-setting-top-menu-mode",panel).val();var headerMegaMenuStyle=$(".theme-setting-mega-menu-style",panel).val();var headerMegaMenuMode=$(".theme-setting-mega-menu-mode",panel).val();resetLayout();if(layoutMode==="fluid"){$(".page-header-top > .container").removeClass("container").addClass("container-fluid");$(".page-header-menu > .container").removeClass("container").addClass("container-fluid");$(".page-head > .container").removeClass("container").addClass("container-fluid");$(".page-content > .container").removeClass("container").addClass("container-fluid");$(".page-prefooter > .container").removeClass("container").addClass("container-fluid");$(".page-footer > .container").removeClass("container").addClass("container-fluid")}if(headerTopMenuStyle==="dark"){$(".top-menu > .navbar-nav > li.dropdown").addClass("dropdown-dark")}else{$(".top-menu > .navbar-nav > li.dropdown").removeClass("dropdown-dark")}if(headerTopMenuMode==="fixed"){$("body").addClass("page-header-top-fixed")}else{$("body").removeClass("page-header-top-fixed")}if(headerMegaMenuStyle==="light"){$(".hor-menu").addClass("hor-menu-light")}else{$(".hor-menu").removeClass("hor-menu-light")}if(headerMegaMenuMode==="fixed"){$("body").addClass("page-header-menu-fixed")}else{$("body").removeClass("page-header-menu-fixed")}};var setColor=function(color){var color_=(App.isRTL()?color+"-rtl":color);$("#style_color").attr("href",Layout.getLayoutCssPath()+"themes/"+color_+".min.css");$(".page-logo img").attr("src",Layout.getLayoutImgPath()+"logo-"+color+".png")};$(".theme-colors > li",panel).click(function(){var color=$(this).attr("data-theme");setColor(color);$(".theme-colors > li",panel).removeClass("active");$(this).addClass("active") });$(".theme-setting-top-menu-mode",panel).change(function(){var headerTopMenuMode=$(".theme-setting-top-menu-mode",panel).val();var headerMegaMenuMode=$(".theme-setting-mega-menu-mode",panel).val();if(headerMegaMenuMode==="fixed"){alert("The top menu and mega menu can not be fixed at the same time.");$(".theme-setting-mega-menu-mode",panel).val("not-fixed");headerTopMenuMode="not-fixed"}});$(".theme-setting-mega-menu-mode",panel).change(function(){var headerTopMenuMode=$(".theme-setting-top-menu-mode",panel).val();var headerMegaMenuMode=$(".theme-setting-mega-menu-mode",panel).val();if(headerTopMenuMode==="fixed"){alert("The top menu and mega menu can not be fixed at the same time.");$(".theme-setting-top-menu-mode",panel).val("not-fixed");headerTopMenuMode="not-fixed"}});$(".theme-setting",panel).change(setLayout)};var setThemeStyle=function(style){var file=(style==="rounded"?"components-rounded":"components");file=(App.isRTL()?file+"-rtl":file);$("#style_components").attr("href",App.getGlobalCssPath()+file+".min.css");if(typeof Cookies!=="undefined"){Cookies.set("layout-style-option",style)}};return{init:function(){handleTheme();$(".theme-panel .theme-setting-style").change(function(){setThemeStyle($(this).val())});if(typeof Cookies!=="undefined"&&Cookies.get("layout-style-option")==="rounded"){setThemeStyle(Cookies.get("layout-style-option"));$(".theme-panel .layout-style-option").val(Cookies.get("layout-style-option"))}}}}();if(App.isAngularJsApp()===false){jQuery(document).ready(function(){Demo.init()})};