/
listrefs.begin.layout
373 lines (309 loc) · 11.6 KB
/
listrefs.begin.layout
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
365
366
367
368
369
370
371
372
373
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Lei Li's publications</title>
<meta http-equiv="Content-Type" content="text/html; charset=\encoding">
<script type="text/javascript">
<!--
// QuickSearch script for JabRef HTML export
// Version: 2.0
//
// Copyright (c) 2006-2008, Mark Schenk
//
// This software is distributed under a Creative Commons Attribution 3.0 License
// http://creativecommons.org/licenses/by/3.0/
// Some features:
// + optionally searches Abstracts and Reviews
// + allows RegExp searches
// e.g. to search for entries between 1980 and 1989, type: 198[0-9]
// e.g. for any entry ending with 'symmetry', type: symmetry$
// e.g. for all reftypes that are books: ^book$, or ^article$
// e.g. for entries by either John or Doe, type john|doe
// + easy toggling of Abstract/Review/BibTeX
// Search settings
var searchAbstract = true;
var searchReview = true;
// Speed optimisation introduced some esoteric problems with certain RegExp searches
// e.g. if the previous search is 200[-7] and the next search is 200[4-7] then the search doesn't work properly until the next 'keyup'
// hence the searchOpt can be turned off for RegExp adepts
var searchOpt = true;
if (window.addEventListener) {
window.addEventListener("load",initSearch,false); }
else if (window.attachEvent) {
window.attachEvent("onload", initSearch); }
function initSearch() {
// basic object detection
if(!document.getElementById || !document.getElementsByTagName) { return; }
if (!document.getElementById('qstable')||!document.getElementById('qs')) { return; }
// find QS table and appropriate rows
searchTable = document.getElementById('qstable');
var allRows = searchTable.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
// split all rows into entryRows and infoRows (e.g. abstract, review, bibtex)
entryRows = new Array();
infoRows = new Array(); absRows = new Array(); revRows = new Array();
for (var i=0, k=0, j=0; i<allRows.length;i++) {
if (allRows[i].className.match(/entry/)) {
entryRows[j++] = allRows[i];
} else {
infoRows[k++] = allRows[i];
// check for abstract/review
if (allRows[i].className.match(/abstract/)) {
absRows.push(allRows[i]);
} else if (allRows[i].className.match(/review/)) {
revRows.push(allRows[i]);
}
}
}
//number of entries and rows
numRows = allRows.length;
numEntries = entryRows.length;
numInfo = infoRows.length;
numAbs = absRows.length;
numRev = revRows.length;
//find the query field
qsfield = document.getElementById('qsfield');
// previous search term; used for speed optimisation
prevSearch = '';
//find statistics location
stats = document.getElementById('stat');
setStatistics(-1);
// creates the appropriate search settings
createQSettingsDialog();
// shows the searchfield
document.getElementById('qs').style.display = 'block';
document.getElementById('qsfield').onkeyup = testEvent;
}
function quickSearch(tInput){
if (tInput.value.length == 0) {
showAll();
setStatistics(-1);
qsfield.className = '';
return;
} else {
// only search for valid RegExp
try {
var searchText = new RegExp(tInput.value,"i")
closeAllInfo();
qsfield.className = '';
}
catch(err) {
prevSearch = tInput.value;
qsfield.className = 'invalidsearch';
return;
}
}
// count number of hits
var hits = 0;
// start looping through all entry rows
for (var i = 0; cRow = entryRows[i]; i++){
// only show search the cells if it isn't already hidden OR if the search term is getting shorter, then search all
// some further optimisation is possible: if the search string is getting shorter, and the row is already visible, skip it. Then be careful with hits!
if(!searchOpt || cRow.className.indexOf('noshow')==-1 || tInput.value.length <= prevSearch.length){
var found = false;
var inCells = cRow.getElementsByTagName('td');
var numCols = inCells.length;
for (var j=0; j<numCols; j++) {
cCell = inCells[j];
var t = cCell.innerText?cCell.innerText:getTextContent(cCell);
if (t.search(searchText) != -1){
found=true;
break;
}
}
// look for further hits in Abstract and Review
if(!found) {
var articleid = cRow.id;
if(searchAbstract && (abs = document.getElementById('abs_'+articleid))) {
if (getTextContent(abs).search(searchText) != -1){ found=true; }
}
if(searchReview && (rev = document.getElementById('rev_'+articleid))) {
if (getTextContent(rev).search(searchText) != -1){ found=true; }
}
}
if(found) {
cRow.className = 'entry show';
hits++;
} else {
cRow.className = 'entry noshow';
}
}
}
// update statistics
setStatistics(hits)
// set previous search value
prevSearch = tInput.value;
}
function toggleInfo(articleid,info) {
var entry = document.getElementById(articleid);
var abs = document.getElementById('abs_'+articleid);
var rev = document.getElementById('rev_'+articleid);
var bib = document.getElementById('bib_'+articleid);
if (abs && info == 'abstract') {
if(abs.className.indexOf('abstract') != -1) {
abs.className.indexOf('noshow') == -1?abs.className = 'abstract noshow':abs.className = 'abstract';
}
} else if (rev && info == 'review') {
if(rev.className.indexOf('review') != -1) {
rev.className.indexOf('noshow') == -1?rev.className = 'review noshow':rev.className = 'review';
}
} else if (bib && info == 'bibtex') {
if(bib.className.indexOf('bibtex') != -1) {
bib.className.indexOf('noshow') == -1?bib.className = 'bibtex noshow':bib.className = 'bibtex';
}
} else {
return;
}
// check if one or the other is available
var revshow = false;
var absshow = false;
var bibshow = false;
(abs && abs.className.indexOf('noshow') == -1)? absshow = true: absshow = false;
(rev && rev.className.indexOf('noshow') == -1)? revshow = true: revshow = false;
(bib && bib.className == 'bibtex')? bibshow = true: bibshow = false;
// highlight original entry
if(entry) {
if (revshow || absshow || bibshow) {
entry.className = 'entry highlight show';
} else {
entry.className = 'entry show';
}
}
// When there's a combination of abstract/review/bibtex showing, need to add class for correct styling
if(absshow) {
(revshow||bibshow)?abs.className = 'abstract nextshow':abs.className = 'abstract';
}
if (revshow) {
bibshow?rev.className = 'review nextshow': rev.className = 'review';
}
}
function setStatistics (hits) {
if(hits < 0) { hits=numEntries; }
if(stats) { stats.firstChild.data = hits + '/' + numEntries}
}
function getTextContent(node) {
// Function written by Arve Bersvendsen
// http://www.virtuelvis.com
if (node.nodeType == 3) {
return node.nodeValue;
} // text node
if (node.nodeType == 1) { // element node
var text = [];
for (var chld = node.firstChild;chld;chld=chld.nextSibling) {
text.push(getTextContent(chld));
}
return text.join("");
} return ""; // some other node, won't contain text nodes.
}
function showAll(){
// first close all abstracts, reviews, etc.
closeAllInfo();
for (var i = 0; i < numEntries; i++){
entryRows[i].className = 'entry show';
}
}
function closeAllInfo(){
for (var i=0; i < numInfo; i++){
if (infoRows[i].className.indexOf('noshow') ==-1) {
infoRows[i].className = infoRows[i].className + ' noshow';
}
}
}
function testEvent(e){
if (!e) var e = window.event;
quickSearch(this);
}
function clearQS() {
qsfield.value = '';
quickSearch(qsfield);
}
function redoQS(){
showAll();
quickSearch(qsfield);
}
// Create Search Settings
function toggleQSettingsDialog() {
var qssettings = document.getElementById('qssettings');
if(qssettings.className.indexOf('active')==-1) {
qssettings.className = 'active';
if(absCheckBox && searchAbstract == true) { absCheckBox.checked = 'checked'; }
if(revCheckBox && searchReview == true) { revCheckBox.checked = 'checked'; }
} else {
qssettings.className= '';
}
}
function createQSettingsDialog(){
var qssettingslist = document.getElementById('qssettings').getElementsByTagName('ul')[0];
if(numAbs!=0) {
var x = document.createElement('input');
x.id = "searchAbs";
x.type = "checkbox";
x.onclick = toggleQSetting;
var y = qssettingslist.appendChild(document.createElement('li')).appendChild(document.createElement('label'));
y.appendChild(x);
y.appendChild(document.createTextNode('search abstracts'));
}
if(numRev!=0) {
var x = document.createElement('input');
x.id = "searchRev";
x.type = "checkbox";
x.onclick = toggleQSetting;
var y = qssettingslist.appendChild(document.createElement('li')).appendChild(document.createElement('label'));
y.appendChild(x);
y.appendChild(document.createTextNode('search reviews'));
}
// global variables
absCheckBox = document.getElementById('searchAbs');
revCheckBox = document.getElementById('searchRev');
// show search settings
if(absCheckBox||revCheckBox) {
document.getElementById('qssettings').style.display = 'block';
}
}
function toggleQSetting() {
if(this.id=='searchAbs') { searchAbstract = !searchAbstract; }
if(this.id=='searchRev') { searchReview = !searchReview; }
redoQS()
}
-->
</script>
<style type="text/css">
body { background-color: white; font-family: "Trebuchet MS", Arial, sans-serif; font-size: 14px; line-height: 1.2; padding: 1em; color: #2E2E2E; width: 50em; margin: auto auto; }
#qs { width: auto; border-style: solid; border-color: gray; border-width: 1px 1px 1px 1px; padding: 0.5em 0.5em; display:none; position:relative; }
#qs form { padding: 0px; margin: 0px; }
#qs form p { padding: 0px; margin: 0px; }
.invalidsearch { background-color: red; }
table { border: 1px gray none; width: 100%; empty-cells: show; border-spacing: 0em 0.3em; margin-top: 1em; }
th, td { border-width: 0px 0px; border-color: gray; border-style: solid; padding: 0.5em; vertical-align: top; }
td { text-align: justify; vertical-align: top; }
td a { color: navy; text-decoration: none; }
td a:hover { text-decoration: underline; }
tr.noshow { display: none;}
tr.highlight td { background-color: #F1F1F1; border-top: 2px black solid; font-weight: bold; }
tr.abstract td, tr.review td, tr.bibtex td { background-color: #F1F1F1; border-bottom: 2px black solid; text-align: justify; }
tr.nextshow td { border-bottom: none; }
tr.bibtex pre { width: 100%; overflow: auto;}
p.infolinks { margin: 0.5em 0em 0em 0em; padding: 0px; }
#qssettings { padding: 0.5em; position: absolute; top: 0.2em; right: 0.2em; border: 1px gray solid; background-color: white; display: none; }
#qssettings p { font-weight: bold; cursor: pointer; }
#qssettings ul { display: none; list-style-type: none; padding-left: 0; margin: 0; }
#qssettings.active ul { display: block; }
@media print {
p.infolinks, #qssettings, #qs { display: none !important; }
tr { page-break-inside: avoid; }
}
.note {color: green; font-size: 67%; text-indent:2em; margin-top:1px; margin-bottom:-3px;}
</style>
</head>
<body>
<div id="qs">
<form action="">
<p>QuickSearch: <input type="text" name="qsfield" id="qsfield" autocomplete="off" title="Allows plain text as well as RegExp searches" /><input type="button" onclick="clearQS()" value="clear" /> Number of matching entries: <span id="stat">0</span>.</p>
<div id="qssettings">
<p onclick="toggleQSettingsDialog()">Search Settings</p>
<ul>
</ul>
</div>
</form>
</div>
<table id="qstable" border="1">
<tbody>