6 |
|
|
7 |
var g_isTouch = false; |
var g_isTouch = false; |
8 |
|
|
9 |
|
function crdWindowWidth() { |
10 |
|
return window.innerWidth || |
11 |
|
document.documentElement.clientWidth || |
12 |
|
document.getElementsByTagName('body')[0].clientWidth; |
13 |
|
} |
14 |
|
|
15 |
function crdWindowHeight() { |
function crdWindowHeight() { |
16 |
return window.innerHeight || |
return window.innerHeight || |
17 |
document.documentElement.clientHeight || |
document.documentElement.clientHeight || |
61 |
} |
} |
62 |
} |
} |
63 |
|
|
64 |
|
function crdUpdateTOCStatus() { |
65 |
|
var noTOC = $("html").hasClass("no-toc"); |
66 |
|
$("nav > .foldbtn a").html( |
67 |
|
noTOC ? ">>>" : "<<<" |
68 |
|
); |
69 |
|
$("nav > .foldbtn a").attr("title", |
70 |
|
noTOC ? "Show content menu." : "Hide content menu." |
71 |
|
) |
72 |
|
} |
73 |
|
|
74 |
|
function crdToggleTOC() { |
75 |
|
$("html").toggleClass("no-toc"); |
76 |
|
crdUpdateTOCStatus(); |
77 |
|
} |
78 |
|
|
79 |
function crdOnWindowResize() { |
function crdOnWindowResize() { |
80 |
var wh = crdWindowHeight(); |
var wh = crdWindowHeight(); |
81 |
$("nav > ul > li ul").css("max-height", wh - 70); |
$("nav > ul > li ul").css("max-height", wh - 70); |
105 |
$("header a[title]" ).tooltip({ |
$("header a[title]" ).tooltip({ |
106 |
disabled: true |
disabled: true |
107 |
}); |
}); |
108 |
|
$("nav a[title]" ).tooltip({ |
109 |
|
disabled: true |
110 |
|
}); |
111 |
} |
} |
112 |
$("article img[caption]").each(function() { |
$("article img[caption]").each(function() { |
113 |
$(this).after( |
$(this).after( |
138 |
}); |
}); |
139 |
} |
} |
140 |
}); |
}); |
141 |
|
var w = crdWindowWidth(); |
142 |
|
if (w < 1200) { |
143 |
|
$("html").addClass("no-toc"); |
144 |
|
} |
145 |
|
crdUpdateTOCStatus(); |
146 |
}); |
}); |
147 |
|
|
148 |
$(document).ready(function() { |
$(document).ready(function() { |