-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
142 lines (135 loc) · 4.25 KB
/
Copy pathscript.js
File metadata and controls
142 lines (135 loc) · 4.25 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
var lineWrap = function(lineString, lineLength) {
var marker = 0;
var spaceMarker = 0;
var oldMarker = 0;
var lines = [];
var lineIndex=0;
while(marker < lineString.length){
var spaceChange = false;
var endLine = false;
spaceMarker=0;
for(i = 0; i < lineLength; i++){
if(lineString[marker + i]=== " "){
spaceMarker = marker + i;
}
if(marker+i === lineString.length-1){
endLine=true;
spaceMarker = marker+i;
i = lineLength;
}
}
if(endLine === true){
spaceMarker=lineString.length;
lines[lineIndex] = lineString.substring(marker);
}
else{
lines[lineIndex] = lineString.substring(marker, spaceMarker);
}
lineIndex++;
oldMarker = marker;
marker = spaceMarker + 1;
}
return lines;
};
window.onload = function() {
var lineLength = 18;
$("#accordion").accordion({header: '.accordionHead'}, { icons: { header: "ui-icon-plus", headerSelected: "ui-icon-minus" } });
$(".accordionHead").each(function(counter){
var headerHeight= $(this).children("h3").css("height");
headerHeight= parseInt(headerHeight);
var arrowTop= headerHeight/2 -4;
$(this).css("height", headerHeight + 14);
$(this).children(".expandArrow").css("top", arrowTop);
});
$("#accordion").children("div").each(function(counter){
var expanded = $(this).children(".subContent").attr("aria-expanded");
$(this).children("p").append(counter);
if(expanded==="true"){
$(this).find(".expandArrow").text("v");
}
else{
$(this).find(".expandArrow").text(">");
}
});
/*
$(".accordionHead, .accordionHead h3, .expandArrow, .accordionHolder").mouseenter(function(){
$(this).css("cursor", "hand");
});
$(".accordionHead, .accordionHead h3, .expandArrow, .accordionHolder").mouseleave(function(){
$(this).css("cursor", "hand");
});
*/
$(".accordionHead").click(function(){
$("#accordion").children("div").each(function(counter){
var expanded = $(this).children(".subContent").attr("aria-expanded");
$(this).children("p").append(counter);
if(expanded==="true"){
$(this).find(".expandArrow").text("v");
}
else{
$(this).find(".expandArrow").text(">");
}
});
});
$("#menu").children(".menuItem").mouseenter(function(){
$(this).children(".menuBG").css("background-color", "white");
$(this).children("span").css("color", "black");
$(this).css("cursor", "hand");
});
$("#menu").children(".menuItem").mouseleave(function(){
$(this).children(".menuBG").css("background-color", "#000100");
$(this).children("span").css("color", "white");
$(this).css("cursor", "hand");
});
$("#find, #findExtension").mouseenter(function(){
$("#findExtension").show();
});
$("#find, #findExtension").mouseleave(function(){
$("#findExtension").hide();
});
$("#findExtension").children(".menuItem").mouseenter(function(){
$(this).children(".menuBG").css("background-color", "white");
$(this).children("span").css("color", "black");
$(this).css("cursor", "hand");
});
$("#findExtension").children(".menuItem").mouseleave(function(){
$(this).children(".menuBG").css("background-color", "#001133");
$(this).children("span").css("color", "#BBBBBB");
$(this).css("cursor", "hand");
});
/* LINEWRAP ON THE NAVIGATION MENU */
$(".menuItem").each(function(counter){
var sample = $(this).children("span").html();
if(sample.length > lineLength){
var newLines = [];
newLines = lineWrap(sample, lineLength);
$(this).children("span").html(newLines[0]);
var blockHeight = 15;
var increment = blockHeight;
for(i=1; i<newLines.length; i++){
$(this).children("span").append("<br>" + newLines[i]);
blockHeight += increment;
$(this).children(".menuBG").css("height", blockHeight + "px");
}
}
});
/* Experiment end. */
/* $(".menuItem").each(function(i){
$(this).append("Hi!");
var fullLine = $(this).html();
if(fullLine.length > lineLength){
newLines = lineWrap(fullLine, lineLength);
$(this).html(newLines[0]);
for(i=1; i < newLines.length; i++){
$(this).append("<br>" + newLines[i]);
}
}
});
*/
$(".accordionHead").mouseenter(function(){
$(this).css({cursor: "pointer"});
});
$(".accordionHead").mouseleave(function(){
$(this).css("cursor", "default");
});
}