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
26 if (window.opera) {
\r
27 document.addEventListener("load",initSearch,false) }
\r
28 else if (window.addEventListener) {
\r
29 window.addEventListener("load",initSearch,false) }
\r
30 else if (window.attachEvent) {
\r
31 window.attachEvent("onload", initSearch); }
\r
33 function initSearch() {
\r
34 // basic object detection
\r
35 if(!document.getElementById || !document.getElementsByTagName) { return; }
\r
37 // check if QuickSearch table AND search area is present
\r
38 if (!document.getElementById('qstable')||!document.getElementById('qs')) { return; }
\r
40 // give id of the table that has QuickSearch
\r
41 // is global variable on purpose
\r
42 searchTable = document.getElementById('qstable');
\r
46 document.getElementById('qs').style.display = 'block';
\r
47 document.getElementById('qsfield').onkeyup = testEvent;
\r
50 function quickSearch(tInput){
\r
51 searchText = new RegExp(tInput.value,"i");
\r
52 var inRows = searchTable.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
\r
54 // find/set number of searchable columns
\r
55 // by default script searches all columns
\r
56 var cols = searchTable.getElementsByTagName('thead')[0].getElementsByTagName('th').length;
\r
57 // to set a fixed number of columns, uncomment next line
\r
58 // var cols = 4 // search the left 'cols' columns
\r
60 // count number of hits
\r
63 // start looping through all rows
\r
64 for (var i = 0; cRow = inRows[i]; i++){
\r
65 inCells = cRow.getElementsByTagName('td');
\r
66 var gevonden = false;
\r
68 for (var j=0; j<cols; j++) { // only first 'cols' columns
\r
70 var t = cCell.innerText?cCell.innerText:getTextContent(cCell);
\r
71 if ((tInput.value.length == 0) || (t.search(searchText) != -1)){ gevonden=true; }
\r
74 gevonden == true?cRow.className = 'entry show':cRow.className = 'entry noshow';
\r
75 gevonden == true?hits++:hits=hits;
\r
78 // update statistics
\r
82 function setStatistics (hits) {
\r
83 var allRows = searchTable.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
\r
85 for (var i=0; i<allRows.length;i++) {
\r
86 if (allRows[i].className.indexOf('entry') != -1) {
\r
91 if(hits < 0) { hits=entries; }
\r
93 var stats = document.getElementById('stat');
\r
94 if(stats) { stats.firstChild.data = hits + '/' + entries}
\r
97 function getTextContent(node) {
\r
98 // Function written by Arve Bersvendsen
\r
99 // http://www.virtuelvis.com
\r
101 if (node.nodeType == 3) {
\r
102 return node.nodeValue;
\r
104 if (node.nodeType == 1) { // element node
\r
106 for (var chld = node.firstChild;chld;chld=chld.nextSibling) {
\r
107 text.push(getTextContent(chld));
\r
109 return text.join("");
\r
110 } return ""; // some other node, won't contain text nodes.
\r
113 function testEvent(e){
\r
114 if (!e) var e = window.event;
\r
118 function clearQS() {
\r
119 qsfield = document.getElementById('qsfield');
\r
120 qsfield.value = '';
\r
121 quickSearch(qsfield);
\r
125 qsfield = document.getElementById('qsfield');
\r
126 quickSearch(qsfield);
\r
130 <style type="text/css">
\r
131 body { background-color: white; font-family: "Trebuchet MS", Arial, sans-serif; font-size: 12px; line-height: 1.2; padding: 1em; }
\r
133 #qs { width: auto; border-style: solid; border-color: gray; border-width: 1px 1px 0px 1px; padding: 0.5em 0.5em; display:none; }
\r
134 #qs form { padding: 0px; margin: 0px; }
\r
135 #qs form p { padding: 0px; margin: 0px; }
\r
137 table { border: 1px gray solid; width: 100%; empty-cells: show; }
\r
138 th, td { border: 1px gray solid; padding: 0.5em; vertical-align: top; }
\r
139 td { text-align: left; vertical-align: top; }
\r
140 th { background-color: #EFEFEF; }
\r
142 td a, td a:hover { color: navy; font-weight: bold; }
\r
144 tr.noshow { display: none;}
\r
149 <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
150 <table id="qstable" border="1">
\r
151 <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