-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
364 lines (318 loc) · 11.6 KB
/
Copy pathscript.js
File metadata and controls
364 lines (318 loc) · 11.6 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
// Code generated by Dreamweaver for image rollover in index.html
function MM_preloadImages() { //v3.0
MM_HideLayers();
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
var time;
function MM_HideLayers() {
time=setTimeout("MM_ShowLayers('Personal','','hide','Research','','hide','MapList','','hide','Links','','hide','key','','hide')",50);
//time=setTimeout("MM_ShowLayers('MapList','','hide')",2000);
}
function MM_TimeOut() {
clearTimeout(time);
}
function MM_ShowLayers() {
var i,v,obj,args=MM_ShowLayers.arguments;
clearTimeout(time);
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
{
v=args[i+2];
if (obj.style)
{
obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v;
}
obj.visibility=v;
}
}
// End of code generated by Dreamweaver
//////////////////////////////////////////////////
// Onload function
window.onload = function(){
MM_preloadImages('figures/test.gif');
if (window.location.pathname=="/Calendar.html"){//to change to /Webpage/Calendar.html when on computer
CFP();
}
if (window.location.pathname=="/Publications.html"){//to change to /Webpage/Publications.html when on computer
Pub(1);
//document.getElementById("button").active = true;
//.className
}
}
// Ajax code to retrieve data //
///////////////////////////////
var count_pub;
function Pub(search,keyword){
// search = 0 if by year, 1 if by domain, 2 search
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var past = 1000;
count_pub = 0;
var myObj = JSON.parse(this.responseText);
if (keyword=="Custom"){
keyword[0] = document.getElementById("key-search").value;
}
// The book part
var text = "";
var pub = myObj.book;
if (pub.length==0){
text += "<p><strong>There is no publications corresponding to your search!</strong></p>";
}
else{
text += Create_html(pub,text,past,search,0,keyword);
text = text.slice(0,text.length-13)+".</span></li>";
document.getElementById("book").innerHTML = text+"</ul></td></tr>";
//alert(text+"</ul></td></tr>");
}
// The journal part
var text = "";
var pub = myObj.journal;
if (pub.length==0){
text += "<p><strong>There is no publications corresponding to your search!</strong></p>";
}
else{
text += Create_html(pub,text,past,search,1,keyword);
text = text.slice(0,text.length-13)+".</span></li>";
document.getElementById("journal").innerHTML = text+"</ul></td></tr>";
}
// The conference part
var text = "";
var pub = myObj.conference;
if (pub.length==0){
text += "<p><strong>There is no publications corresponding to your search!</strong></p>";
}
else{
text += Create_html(pub,text,past,search,2,keyword);
text = text.slice(0,text.length-13)+".</span></li>";
document.getElementById("conf").innerHTML = text+"</ul></td></tr>";
}
}
};
xmlhttp.open("GET", "pub.json", true);
xmlhttp.send();
if (search == 1){
document.getElementById("btn-search").setAttribute('class', 'btn');
document.getElementById("btn-year").disabled = false;
//document.getElementById("btn-search").disabled = false;
document.getElementById("btn-dom").disabled = true;
}
else if (search == 0){
document.getElementById("btn-search").setAttribute('class', 'btn');
document.getElementById("btn-dom").disabled = false;
//document.getElementById("btn-search").disabled = false;
document.getElementById("btn-year").disabled = true;
}
else{
document.getElementById("btn-search").setAttribute('class', 'btn-active');
document.getElementById("btn-dom").disabled = false;
document.getElementById("btn-year").disabled = false;
//MM_ShowLayers('key','','show');
//document.getElementById("test").style.visibility = "visible";
}
}
function Create_html(pub1,text,past,search,type,keyword1){
// type = 0 for book, 1 for journal, 2 for conf
switch (type) {
case 0:
var ul_x = "<ul style='color:#006600;list-style-type:square;'>";
break;
case 1:
var ul_x = "<ul style='color:#ed1261;list-style-type:square;'>";
break;
case 2:
var ul_x = "<ul style='list-style-type:square;'>";
}
var date = new Date();
if (search == 1){
var pub = pub1.slice(0);
pub.sort(function(a,b) {
var x = a.key.toLowerCase();
var y = b.key.toLowerCase();
return x < y ? -1 : x > y ? 1 : 0;
});
var d = "";
var test = false;
for (var i=0; i<pub.length;i++){
var year = pub[i].year;
if (year>=date.getFullYear()-past){//test if the pub in the range of years selected
if (pub[i].key!=d){
if (test)
text += "</ul></td></tr>";
text += "<tr><td class='Title'>"+pub[i].key+"</td></tr>";
d = pub[i].key;
text += "<tr><td>"+ul_x;
test = true;
}
text += "<li><span style='color:#000000'>"+pub[i].authors+
""<strong>"+pub[i].title+
"</strong>" "+pub[i].other+", "+pub[i].year;
if (pub[i].web)
text += ' [<a href="'+pub[i].web+'" target=_self>pdf</a>]';
if (pub[i].DOI)
text += ' [<a href="'+pub[i].DOI+'" target=_self>doi</a>]';
text +=",</span></li>";
}
else
break;
}
document.getElementById("list").innerHTML = "";
}
if (search == 0){
var pub = pub1.slice(0);
pub.sort(function(a,b) {
return b.year - a.year;
});
var d = date.getFullYear()+1;
var test = false;
for (var i=0; i<pub.length;i++){
var year = pub[i].year;
if (year>=date.getFullYear()-past){//test if the pub in the range of years selected
if (year<d){
if (test)
text += "</ul></td></tr>";
text += "<tr><td class='Title'>"+year+"</td></tr>";
d = year;
text += "<tr><td>"+ul_x;
test = true;
}
text += "<li><span style='color:#000000'>"+pub[i].authors+
""<strong>"+pub[i].title+
"</strong>" "+pub[i].other+", "+pub[i].year;
if (pub[i].web)
text += ' [<a href="'+pub[i].web+'" target=_self>pdf</a>]';
if (pub[i].DOI)
text += ' [<a href="'+pub[i].DOI+'" target=_self>doi</a>]';
text +=",</span></li>";
}
else
break;
}
document.getElementById("list").innerHTML = "";
}
if (search == 2){
var pub = pub1.slice(0);
pub.sort(function(a,b) {
return b.year - a.year;
});
var test = true;
//text+="<p>"+keyword1.length+"</p>";
for (var i=0; i<pub.length;i++){
/*var found = x.find(function(element) {
return element == keyword;
});*/
var year = pub[i].year;
for (var j=0;j<keyword1.length;j++){
keyword = keyword1[j].toLowerCase();
//text+="<p>"+keyword+"</p>"+"<p>"+pub[i].other+"</p>";
if ( (pub[i].keyword.toLowerCase().search(keyword)>=0 || pub[i].other.toLowerCase().search(keyword)>=0 || pub[i].title.toLowerCase().search(keyword)>=0 || pub[i].authors.toLowerCase().search(keyword)>=0)){//test if the pub has the keyword
if (test)
text += "<tr><td>"+ul_x;
text += "<li><span style='color:#000000'>"+pub[i].authors+
""<strong>"+pub[i].title+
"</strong>" "+pub[i].other+", "+pub[i].year;
if (pub[i].web)
text += ' [<a href="'+pub[i].web+'" target=_self>pdf</a>]';
if (pub[i].DOI)
text += ' [<a href="'+pub[i].DOI+'" target=_self>doi</a>]';
text +=",</span></li>";
test = false;
count_pub++;
break;
}
}
/*keyword = keyword.toLowerCase();
if (year>=date.getFullYear()-past && (pub[i].keyword.toLowerCase().search(keyword)>=0 || pub[i].other.toLowerCase().search(keyword)>=0 || pub[i].key.toLowerCase().search(keyword)>=0 || pub[i].title.toLowerCase().search(keyword)>=0 || pub[i].authors.toLowerCase().search(keyword)>=0)){//test if the pub has the keyword
text += "<tr><td>"+ul_x;
text += "<li><span style='color:#000000'>"+pub[i].authors+
"""+pub[i].title+
"" "+pub[i].other+", "+pub[i].year;
if (pub[i].web)
text += ' [<a href="'+pub[i].web+'" target=_self>pdf</a>]';
text +=",</span></li>";
test = false;
}*/
}
if (test)
text += "<tr><td><ul style='list-style-type:none;'><li><span> Sorry. There is no papers in relation with keyword ""+keyword1.join()+"".</span></li>" ;
document.getElementById("list").innerHTML = "In this page you can find "+count_pub+" paper(s) that correspond to keyword \""+keyword+"\"";
}
return text;
}
function CFP(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = JSON.parse(this.responseText);
var today = new Date();
// The conference part
var text = "";
if (myObj.conf.length==0){
text += "<p><strong>There is no available conference deadlines</strong></p>";
}
else{
for (var i=0; i<myObj.conf.length;i++){
var date = new Date(myObj.conf[i].Deadline);
if (today<=date){
text += "<li><span style='color:#000000'>"+myObj.conf[i].name+
"</span><br><span style='color:#000000'><strong>Deadline: "+myObj.conf[i].Deadline+
"</strong></span><br><span style='color:#000000'>Website: <a href='"+myObj.conf[i].Website+"' target='_blank'>CFP</a></span></li>";
}
}
}
document.getElementById("conf").innerHTML = text;
//alert(text);
// The journal part
var text = "";
if (myObj.jour.length==0){
text += "<p><strong>There is no available special issue deadlines</strong></p>";
}
else{
for (var i=0; i<myObj.jour.length;i++){
var date = new Date(myObj.jour[i].Deadline);
if (today<=date){
text += "<li><span style='color:#000000'>"+myObj.jour[i].name+
"</span><br><span style='color:#000000'><strong>Deadline: "+myObj.jour[i].Deadline+
"</strong></span><br><span style='color:#000000'>Website: <a href='"+myObj.jour[i].Website+"' target='_blank'>CFP</a></span></li>";
}
}
}
//alert(text);
document.getElementById("journal").innerHTML = text;
}
};
xmlhttp.open("GET", "cfp.json", true);
xmlhttp.send();
}
// Google Analytics
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-380149-1', 'auto');
ga('send', 'pageview');
//End Google Analytics