1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
\r
4 <title>JabRef References output</title>
\r
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
\r
7 <script type="text/javascript">
\r
9 // QuickSearch script for tables
\r
11 // Copyright (c) 2006, Mark Schenk
\r
13 // Permission to use, copy, modify, and distribute this software for any
\r
14 // purpose with or without fee is hereby granted, provided that the above
\r
15 // copyright notice and this permission notice appear in all copies.
\r
19 // + combination of CSS/JavaScript degrades nicely
\r
20 // + easy to set number of columns to search
\r
21 // + allows RegExp searches
\r
22 // e.g. to search for entries between 1980 and 1989, type: 198[0-9]
\r
23 // e.g. for any entry ending with 'symmetry', type: symmetry$
\r
24 // e.g. for all reftypes that are books: ^book$, or ^article$
\r
25 // + easy toggling of Abstract/Review/BibTeX
\r
27 if (window.opera) {
\r
28 document.addEventListener("load",initSearch,false) }
\r
29 else if (window.addEventListener) {
\r
30 window.addEventListener("load",initSearch,false) }
\r
31 else if (window.attachEvent) {
\r
32 window.attachEvent("onload", initSearch); }
\r
34 function initSearch() {
\r
35 // basic object detection
\r
36 if(!document.getElementById || !document.getElementsByTagName) { return; }
\r
38 // check if QuickSearch table AND search area is present
\r
39 if (!document.getElementById('qstable')||!document.getElementById('qs')) { return; }
\r
41 // give id of the table that has QuickSearch
\r
42 // is global variable on purpose
\r
43 searchTable = document.getElementById('qstable');
\r
47 document.getElementById('qs').style.display = 'block';
\r
48 document.getElementById('qsfield').onkeyup = testEvent;
\r
51 function quickSearch(tInput){
\r
52 searchText = new RegExp(tInput.value,"i");
\r
53 var allRows = searchTable.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
\r
54 var inRows = new Array();
\r
56 for (var i=0, k=0; i<allRows.length;i++) {
\r
57 if (allRows[i].className.indexOf('entry') != -1) {
\r
58 inRows[k++] = allRows[i];
\r
59 } else if (allRows[i].className.indexOf('noshow') == -1) {
\r
60 allRows[i].className = allRows[i].className + ' noshow';
\r
64 // find/set number of searchable columns
\r
65 // by default script searches all columns
\r
66 var cols = searchTable.getElementsByTagName('thead')[0].getElementsByTagName('th').length;
\r
67 // to set a fixed number of columns, uncomment next line
\r
68 // var cols = 4 // search the left 'cols' columns
\r
70 // count number of hits
\r
73 // start looping through all rows
\r
74 for (var i = 0; cRow = inRows[i]; i++){
\r
76 inCells = cRow.getElementsByTagName('td');
\r
77 var gevonden = false;
\r
79 for (var j=0; j<cols; j++) { // only first 'cols' columns
\r
81 var t = cCell.innerText?cCell.innerText:getTextContent(cCell);
\r
82 if ((tInput.value.length == 0) || (t.search(searchText) != -1)){ gevonden=true; }
\r
85 gevonden == true?cRow.className = 'entry show':cRow.className = 'entry noshow';
\r
86 gevonden == true?hits++:hits=hits;
\r
89 // update statistics
\r
93 function toggleInfo(articleid,info) {
\r
95 var entry = document.getElementById(articleid);
\r
96 var abs = document.getElementById('abs_'+articleid);
\r
97 var rev = document.getElementById('rev_'+articleid);
\r
98 var bib = document.getElementById('bib_'+articleid);
\r
100 if (abs && info == 'abstract') {
\r
101 if(abs.className.indexOf('abstract') != -1) {
\r
102 abs.className.indexOf('noshow') == -1?abs.className = 'abstract noshow':abs.className = 'abstract';
\r
104 } else if (rev && info == 'review') {
\r
105 if(rev.className.indexOf('review') != -1) {
\r
106 rev.className.indexOf('noshow') == -1?rev.className = 'review noshow':rev.className = 'review';
\r
108 } else if (bib && info == 'bibtex') {
\r
109 if(bib.className.indexOf('bibtex') != -1) {
\r
110 bib.className.indexOf('noshow') == -1?bib.className = 'bibtex noshow':bib.className = 'bibtex';
\r
116 // check if one or the other is available
\r
117 var revshow = false;
\r
118 var absshow = false;
\r
119 var bibshow = false;
\r
120 (abs && abs.className.indexOf('noshow') == -1)? absshow = true: absshow = false;
\r
121 (rev && rev.className.indexOf('noshow') == -1)? revshow = true: revshow = false;
\r
122 (bib && bib.className == 'bibtex')? bibshow = true: bibshow = false;
\r
124 // highlight original entry
\r
126 if (revshow || absshow || bibshow) {
\r
127 entry.className = 'entry highlight show';
\r
129 entry.className = 'entry show';
\r
133 // When there's a combination of abstract/review/bibtex showing, need to add class for correct styling
\r
135 (revshow||bibshow)?abs.className = 'abstract nextshow':abs.className = 'abstract';
\r
138 bibshow?rev.className = 'review nextshow': rev.className = 'review';
\r
143 function setStatistics (hits) {
\r
144 var allRows = searchTable.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
\r
146 for (var i=0; i<allRows.length;i++) {
\r
147 if (allRows[i].className.indexOf('entry') != -1) {
\r
152 if(hits < 0) { hits=entries; }
\r
154 var stats = document.getElementById('stat');
\r
155 if(stats) { stats.firstChild.data = hits + '/' + entries}
\r
158 function getTextContent(node) {
\r
159 // Function written by Arve Bersvendsen
\r
160 // http://www.virtuelvis.com
\r
162 if (node.nodeType == 3) {
\r
163 return node.nodeValue;
\r
165 if (node.nodeType == 1) { // element node
\r
167 for (var chld = node.firstChild;chld;chld=chld.nextSibling) {
\r
168 text.push(getTextContent(chld));
\r
170 return text.join("");
\r
171 } return ""; // some other node, won't contain text nodes.
\r
174 function testEvent(e){
\r
175 if (!e) var e = window.event;
\r
179 function clearQS() {
\r
180 qsfield = document.getElementById('qsfield');
\r
181 qsfield.value = '';
\r
182 quickSearch(qsfield);
\r
186 qsfield = document.getElementById('qsfield');
\r
187 quickSearch(qsfield);
\r
191 <style type="text/css">
\r
192 body { background-color: white; font-family: "Trebuchet MS", Arial, sans-serif; font-size: 12px; line-height: 1.2; padding: 1em; }
\r
194 #qs { width: auto; border-style: solid; border-color: gray; border-width: 1px 1px 0px 1px; padding: 0.5em 0.5em; display:none; }
\r
195 #qs form { padding: 0px; margin: 0px; }
\r
196 #qs form p { padding: 0px; margin: 0px; }
\r
198 table { border: 1px gray solid; width: 100%; empty-cells: show; }
\r
199 th, td { border: 1px gray solid; padding: 0.5em; vertical-align: top; }
\r
200 td { text-align: left; vertical-align: top; }
\r
201 th { background-color: #EFEFEF; }
\r
203 td a, td a:hover { color: navy; font-weight: bold; }
\r
205 tr.noshow { display: none;}
\r
207 tr.highlight td { background-color: #F1F1F1; border-top: 2px black solid; font-weight: bold; }
\r
208 tr.abstract td, tr.review td, tr.bibtex td { background-color: #F1F1F1; border-bottom: 2px black solid; }
\r
209 tr.nextshow td { border-bottom: 1px gray solid; }
\r
211 tr.bibtex pre { width: 100%; overflow: auto;}
\r
213 p.infolinks { margin: 0.5em 0em 0em 0em; padding: 0px; }
\r
218 <div id="qs"><form action=""><p>QuickSearch: <input type="text" name="qsfield" id="qsfield" autocomplete="off" title="Allows plain text as wel as RegExp searches" /><input type="button" onclick="clearQS()" value="clear" /> Number of matching entries: <span id="stat">0</span>.</p></form></div>
\r
219 <table id="qstable" border="1">
\r
220 <thead><tr><th width="20%">Author</th><th width="30%">Title</th><th width="5%">Year</th><th width="30%">Journal/Proceedings</th><th width="10%">Reftype</th><th width="5%">DOI/URL</th></tr></thead>
\r