-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharts_aus_journey.js
105 lines (75 loc) · 2.66 KB
/
arts_aus_journey.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
checkJQuery();
function checkJQuery(){if (typeof(jQuery)==='undefined'){setTimeout(checkJQuery,100);}else{startJS();}}
var timeout=null;
function startJS(){
$(document).ready(function() {
$(".arts-dropdown").on("click",function(){$(this).find(".arts-dropdown-content").stop(true).slideToggle();});
$(".arts-banner-btn").on("click",function(){$(this).parent().next().stop(true).slideToggle();$(this).find("i").toggle();});
changeLinks();
checkEndOfLesson();
$('.icc-acc-toggle').click(function(e){
e.preventDefault();
var $this = $(this);
if ($this.hasClass('icc-accordion-show')) {
$this.removeClass('icc-accordion-show');
}else{
$this.toggleClass('icc-accordion-show');
}
if ($this.next().hasClass('icc-accordion-show')) {
$this.next().removeClass('icc-accordion-show');
$this.next().slideUp(350);
}else{
$this.parent().parent().find('div .inner').removeClass('icc-accordion-show');
$this.parent().parent().find('div .inner').slideUp(350);
$this.next().toggleClass('icc-accordion-show');
$this.next().slideToggle(350);
}
});
$('a[data-toggle="tab"]').on('shown.bs.tab',function(e){
//e.target // newly activated tab
//e.relatedTarget // previous active tab
try{
//console.log(e.target);
//console.log(e.relatedTarget);
var prevId="#"+$(e.relatedTarget).attr('id')+"-content";
var prevFrm=$(prevId).find("iframe");
var prevSrc=$(prevFrm).attr("src");
$(prevFrm).attr("src",prevSrc);
}catch(ex){
console.log(ex);
}
});
/* CQ Scores */
$(".CQ_scores_btn").on("click",function(){
var clsArr=this.className.split(' ');
$(".CQ_scores_fb").hide();
var clsNum=clsArr.length;
var clsName=clsArr[clsNum-1];
$("#"+clsName).fadeIn();
});
});
}
function changeLinks(){
var sec=getParameterByName("section");
var id=getParameterByName("id");
var alist=$(".arts-nav a[href]");
var menunum=$(".arts-nav").attr("data-menu-num");
var url=window.location.href.split('?')[0];
//if(sec==null&&menunum==undefined){location.href=url+"?id="+id+"§ion=1";}
if(menunum==undefined){
$(".arts-nav a[href]").each(function(i){if(sec==(i+1))$(this).addClass("arts-nav-active");});
}else{
$(".arts-nav a[href]").eq(menunum-1).addClass("arts-nav-active");
}
}
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function checkEndOfLesson(){
console.log("checkEndOfLesson");
if($("h3").text().indexOf("end of lesson")>0){
console.log("checkEndOfLesson h3 "+$("h3").text().indexOf("end of lesson"));
showEndOfLesson();
}
}