/** * @package theme_enlightlite * @copyright 2015 onwards LMSACE Dev Team (http://www.lmsace.com) * @authors LMSACE Dev Team * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $(function(){var img=$("nav#header").find('.avatar').find('img[src$="/u/f2"]');var src=img.attr('src');img.attr('src',src+"_white");msg=$("header#header").find('#nav-message-popover-container .nav-link').find("img[src$='t/message']");msgsrc=msg.attr('src');msg.attr('src',msgsrc+"_white");note=$("header#header").find('#nav-notification-popover-container .nav-link').find("img[src$='i/notifications']");notesrc=note.attr('src');note.attr('src',notesrc+"_white");par=$('#page');par.find('h2').each(function(){cont=$(this).html();con=cont.split(' ')}) if($("#header .navbar-nav button").attr('aria-expanded')==="true"){$("#header .navbar-nav").find('button').addClass('is-active')} $("#header .navbar-nav button").click(function(){$this=$(this);setTimeout(function(){if($this.attr('aria-expanded')==="true"){$("#header .navbar-nav").find('button').addClass('is-active')}else{$("#header .navbar-nav").find('button').removeClass('is-active')}},200)});$("#mycourses").parent('div#frontpage-course-list').addClass("frontpage-mycourse-list");$("#site-news-forum").append("
");$val=$("#id_s_theme_enlightlite_popularCourse_type").val();if($val==1){$("#admin-popularCourse_id").find('input[type=text]').attr('disabled','disabled')} $("#id_s_theme_enlightlite_popularCourse_type").on('change',function(){$this=$(this);val=$this.val();if(val=='1'){$("#admin-popularCourse_id").find('input[type=text]').attr('disabled','disabled')}else{$("#admin-popularCourse_id").find('input[type=text]').removeAttr('disabled')}});var toggelSection=['#theme_enlightlite_general','#theme_enlightlite_slideshow','#theme_enlightlite_marketingspot','#theme_enlightlite_footer'];$.each(toggelSection,function(key,value){h3=$(value).find('h3.main');block=value.split("_")[2];h3.each(function(key){$this=$(this);var childid=block+"_toggle_"+key;hidden="true";var toggleChild='
';$(this).nextUntil('h3.main').wrapAll(toggleChild);var toggleHead='
';$this.wrap(toggleHead);iconclass=(hidden=="false")?'fa-minus-square':'fa-plus-square';var toggleIcon='
';$this.append(toggleIcon)})}) $(".enlightlite-toggle-head").click(function(){$this=$(this);parentid=$this.parent('fieldset').parent('div.tab-pane').attr('id');if(parentid.length!=""){parent=$("#"+parentid)}else{parent=$(".tab-pane.active[aria-expanded=true]")} headid=$this.attr('id');childid="child_"+headid;child=$("#"+childid);var dataHidden=$("#"+childid).attr('data-hidden');if(dataHidden=="false"){child.slideUp('slow');child.attr('data-hidden','true')}else{child.slideDown('slow');child.attr('data-hidden','false')} parent.find('.child-toggle').not(child).slideUp('slow').attr('data-hidden','true');toggleicon2(parentid)}) function toggleicon2(parentid){if(parentid.length!=""){parent=$("#"+parentid)}else{parent=$(".tab-pane.active[aria-expanded=true]")} parent.find('.enlightlite-toggle-head').each(function(){$this=$(this);childid=$(this).attr('id');dataHidden=parent.find('#child_'+childid).attr('data-hidden');if(dataHidden=="false"){$this.find('h3 .toggle-icon i').addClass('fa-minus-square').removeClass('fa-plus-square')}else{$this.find('h3 .toggle-icon i').addClass('fa-plus-square').removeClass('fa-minus-square')}})} $(".child-toggle[data-hidden=true]").hide();if($('body').hasClass('dir-rtl')){var w=$(".header-main #sgkk").width();var win=$(window).width();if(win>=980){var ul_w=$(".header-main #site-user-menu ul").width();var le=(w-ul_w);$('#cr_menu').css({"width":w+'px',"right":'-'+le+'px'})} $(window).resize(function(){var w=$(".header-main #sgkk").width();var win=$(window).width();if(win>=980){var ul_w=$(".header-main #site-user-menu ul").width();var le=(w-ul_w);$('#cr_menu').css({"width":w+'px',"right":'-'+le+'px'})}})}else{var w=$(".header-main #sgkk").width();var win=$(window).width();if(win>=980){var ul_w=$(".header-main #site-user-menu ul").width();var le=(w-ul_w);$('#cr_menu').css({"width":w+'px',"left":'-'+le+'px'})} $(window).resize(function(){var w=$(".header-main #sgkk").width();var win=$(window).width();if(win>=980){var ul_w=$(".header-main #site-user-menu ul").width();var le=(w-ul_w);$('#cr_menu').css({"width":w+'px',"left":'-'+le+'px'})}})} $("#cr_link").mouseenter(function(){$("#cr_link").addClass("active");$('#cr_menu').show()});$("#cr_link").mouseleave(function(){$("#cr_link").removeClass("active");$('#cr_menu').hide()})})