-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathmaster.js
100 lines (94 loc) · 3.15 KB
/
master.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
window.init = window.init || {};
init = {
console: function() {
var method;
var noop = function noop() {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
if (!console[method]) {
console[method] = noop;
}
}
},
basic: function() {
jQuery('html').removeClass('no-js');
},
showHide: function() {
jQuery('.home .news-posts .post:first .read-more').addClass('hidden');
jQuery('.home .news-posts .body').not('.body:first').addClass('hidden');
jQuery('.read-more a').on('click', function(event) {
event.preventDefault();
var anchor = jQuery(this),
body = anchor.closest('.post').find('.body').not(':animated'),
txt = anchor.hasClass('point-down') ? 'Close' : 'Read More';
anchor.toggleClass('point-down point-up').text(txt);
body.slideToggle('fast', 'linear');
});
},
documentationSelect: function() {
jQuery('#latest-documentation').on('change', function() {
var url = jQuery(this).val();
if (url) {
window.location = url;
}
return false;
});
},
asflinksSelect: function() {
jQuery('#latest-asflinks').on('change', function() {
var url = jQuery(this).val();
if (url) {
window.location = url;
}
return false;
});
}
};
/* jQuery functions to run after page is loaded */
jQuery(document).ready(function() {
jQuery.each(init,
function(i, item) {
item();
}
);
if (window.location.href.indexOf('product') > -1 || window.location.href.indexOf('product.html') > -1) {
jQuery('.menu-item-28').addClass('current-menu-item');
jQuery('.section-head').first().hide();
}
else if (window.location.href.indexOf('documentation') > -1 || window.location.href.indexOf('documentation.html') > -1) {
jQuery('.menu-item-25').addClass('current-menu-item');
}
else if (window.location.href.indexOf('community') > -1 || window.location.href.indexOf('community.html') > -1) {
jQuery('.menu-item-24').addClass('current-menu-item');
}
else if (window.location.href.indexOf('download') > -1 || window.location.href.indexOf('thank') > -1 || window.location.href.indexOf('download.html') > -1 || window.location.href.indexOf('thank.html') > -1 ) {
}
else {
jQuery('.menu-item-27').addClass('current-menu-item');
}
});
//Product page
jQuery(document).ready(function () {
jQuery('#features-link').click(function () {
jQuery('.features-posts').show();
jQuery('.overview-tab').hide();
jQuery('.resources').hide();
jQuery('#menu-item-69').removeClass('current-menu-item');
jQuery('#menu-item-68').addClass('current-menu-item');
});
jQuery('#overview-link').click(function () {
jQuery('.features-posts').hide();
jQuery('.overview-tab').show();
jQuery('.resources').show();
jQuery('#menu-item-69').addClass('current-menu-item');
jQuery('#menu-item-68').removeClass('current-menu-item');
});
});