This repository was archived by the owner on Jul 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.js
129 lines (124 loc) · 4.07 KB
/
main.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
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
function content(num) {
return document.getElementById('project'+num).innerHTML;
}
function shrink(num) {
document.getElementById('project'+num).innerHTML = '';
document.getElementById('link'+num).href = 'javascript:expand('+num+')';
}
function expand(num) {
document.getElementById('project'+num).innerHTML = projects[num];
document.getElementById('link'+num).href = 'javascript:shrink('+num+')';
}
function expandAll(num) {
for (i=1; i<(num+1); i++) {
expand(i);
}
}
function shrinkAll(num) {
for (i=1; i<(num+1); i++) {
shrink(i);
}
}
function news_content(num) {
return document.getElementById('story'+num).innerHTML;
}
function news_shrink(num) {
document.getElementById('story'+num).innerHTML = '';
document.getElementById('headline'+num).href = 'javascript:news_expand('+num+')';
}
function news_expand(num) {
document.getElementById('story'+num).innerHTML = stories[num];
document.getElementById('headline'+num).href = 'javascript:news_shrink('+num+')';
}
function news_expandAll(num) {
for (i=1; i<(num+1); i++) {
news_expand(i);
}
}
function news_shrinkAll(num) {
for (i=1; i<(num+1); i++) {
news_shrink(i);
}
}
projects = new Array();
function init(num) {
for (i=1; i<(num+1); i++) {
projects[i] = content(i);
shrink(i);
}
}
stories = new Array();
function news_init(num) {
for (i=1; i<(num+1); i++) {
stories[i] = news_content(i);
news_shrink(i);
}
}
function nowt() {
}
function picCreate() {
output = '';
for (i=start; i<(start+width); i++) {
if (i >= 0 && i < pics.length) {
output += "<a href=\"javascript: nowt()\" onclick=\"javascript: picPop('"+pic_titles[i]+"', '"+pics[i]+"', event)\">";
output += "<img style=\"\" src=\""+imgServ+"thumb/"+pics[i]+"\" alt=\"Pic\" />";
output += "</a>";
}
}
return output;
}
function picPop(title, url, e) {
// var posx = 0;
// var posy = 0;
// if (!e) var e = window.event;
// if (e.pageX || e.pageY) {
// posx = e.pageX;
// posy = e.pageY;
// }
// else if (e.clientX || e.clientY) {
// posx = e.clientX + document.body.scrollLeft
// + document.documentElement.scrollLeft;
// posy = e.clientY + document.body.scrollTop
// + document.documentElement.scrollTop;
// }
document.getElementById('pic_pop').style.left = document.body.scrollLeft + document.documentElement.scrollLeft+'px';
document.getElementById('pic_pop').style.top = document.body.scrollTop + document.documentElement.scrollTop+'px';
winW = 10000; winH = 10000;
if (window.innerHeight || window.innerWidth) {
winH = window.innerHeight;
winW = window.innerWidth;
}
else {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
document.getElementById('pic_pop').style.maxHeight = winH+'px';
document.getElementById('pic_pop').style.maxWidth = winW+'px';
document.getElementById('pic_pic').innerHTML =
'<a href="javascript: nowt()" onclick="javascript:picClose()">'+
'<img alt="Picture" src="'+imgServ+'img/'+url+'" /></a>';
document.getElementById('pic_title').innerHTML = title;
document.getElementById('pic_pop').style.visibility = 'visible';
}
window.onscroll = function() {
document.getElementById('pic_pop').style.left = document.body.scrollLeft + document.documentElement.scrollLeft+'px';
document.getElementById('pic_pop').style.top = document.body.scrollTop + document.documentElement.scrollTop+'px';
}
function picClose() {
document.getElementById('pic_pop').style.visibility = 'hidden';
document.getElementById('pic_pic').innerHTML = '';
}
function picLeft() {
if (start > 0) {
start -= width;
document.getElementById('pic_container').innerHTML = picCreate();
}
}
function picRight() {
if ((start+width) < pics.length) {
start += width;
document.getElementById('pic_container').innerHTML = picCreate();
}
}
function doSomething(e) {
}