# HG changeset patch # User luginbue # Date 1089332154 -7200 # Node ID 7349d58cd391e75ef24415b35daa9947fd59448f # Parent b51840f2ff7530a644f6251822bbb3c55f53946c new digicat version with only one js file diff -r b51840f2ff75 -r 7349d58cd391 client/digitallibrary/navcat_ie.js --- a/client/digitallibrary/navcat_ie.js Fri Jul 09 02:15:54 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -// these two global variables have to be initialised before the frist use of the functions below -// to fill in the attributes you can use the function initPicture provided below -// - array with all attributes -var att = new Array(); - -// - variable to store the path to the frame, in which the pictures should be created -var whichFrame = parent.mainFrame; - -// give a name to the window containing digicat - this way one can test if there is already a -// digicat-window open and replace the contents of it (ex. digilib) -window.name = "digicat"; - -function loadThumbTable() { - tableWidth = whichFrame.document.body.offsetWidth-30; - tableHeight = whichFrame.document.body.offsetHeight-30; - - cellWidth = Math.floor(tableWidth/att[3])-9; - cellHeight = Math.floor(tableHeight/att[2])-6; - -// alert(tableWidth + " " + tableHeight + "\n" + cellWidth + " " +cellHeight); - - whichFrame.document.open(); - whichFrame.document.write(''); - whichFrame.document.write(''); - whichFrame.document.write(''); - - - whichFrame.document.write(''); - whichFrame.document.write(''); - for (i = 0; i < att[2]; i++) { - whichFrame.document.write(''); - for (j = 0; j < att[3]; j++) { - indexNr = parseInt(att[1])+i*parseInt(att[3])+j; - thumb = parent.baseUrl + "/servlet/Scaler/"; - thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=" + att[4] + "&dw=" + cellWidth + "&dh=" + (cellHeight-25); - whichFrame.document.write(''); - } - whichFrame.document.write(''); - } - whichFrame.document.write('
'); - whichFrame.document.write(''); - whichFrame.document.write(''); - whichFrame.document.write('
'); - whichFrame.document.write(indexNr + '
'); - whichFrame.document.close(); - - initScripts(); -} - - -function Backpage() { - - if (att[1] <= 1) { - att[1] = 1; - alert("You are already on the first page!"); - } - - att[1] = parseInt(att[1])-parseInt(att[2]*att[3]); - - if (att[1] < 1) { - att[1] = 1; - } - loadThumbTable(); -} - - - -function Nextpage() { - - att[1] = parseInt(att[1])+parseInt(att[2]*att[3]); - loadThumbTable(); -} - - -// capturing keypresses for next and previous page -function parseKeypress() { - e = whichFrame.event; - - if (e.keyCode == 110) { - Nextpage(); - } - if (e.keyCode == 98) { - Backpage(); - } - whichFrame.document.cancleBubble = true; -} - - - -// initialize browser specific things (keypress caputring) -function initScripts() { - whichFrame.document.onkeypress = parseKeypress; - whichFrame.focus(); -} - - -// fill in the values of the "att"-array -function initPicture(picURL) { - att = picURL.split("+"); - - if (att[0].lastIndexOf("/") == att[0].length-1) { - att[0] = att[0].substring(0, att[0].length-1); - } - - if (att.length < 2 || att[1] == "") { - att[1] = 1; - } - - if (att.length < 3 || att[2] == "") { - att[2] = 3; - } - - if (att.length < 4) { - att[3] = 4; - } -} diff -r b51840f2ff75 -r 7349d58cd391 client/digitallibrary/navcat_n4.js --- a/client/digitallibrary/navcat_n4.js Fri Jul 09 02:15:54 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -// these two global variables have to be initialised before the frist use of the functions below -// to fill in the attributes you can use the function initPicture provided below -// - array with all attributes -var att = new Array(); - -// - variable to store the path to the frame, in which the pictures should be created -var whichFrame = parent.mainFrame; - -// give a name to the window containing digicat - this way one can test if there is already a -// digicat-window open and replace the contents of it (ex. digilib) -window.name = "digicat"; - -function loadThumbTable() { - tableWidth = whichFrame.innerWidth-30; - tableHeight = whichFrame.innerHeight-30; - - cellWidth = Math.floor(tableWidth/att[3])-6; - cellHeight = Math.floor(tableHeight/att[2])-4; - -// alert(tableWidth + " " + tableHeight + "\n" + cellWidth + " " +cellHeight); - - whichFrame.document.open(); - whichFrame.document.write(''); - whichFrame.document.write(''); - whichFrame.document.write(''); - - - whichFrame.document.write(''); - whichFrame.document.write(''); - for (i = 0; i < att[2]; i++) { - whichFrame.document.write(''); - for (j = 0; j < att[3]; j++) { - indexNr = parseInt(att[1])+i*parseInt(att[3])+j; - thumb = parent.baseUrl + "/servlet/Scaler/"; - thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=" + att[4] + "&dw=" + cellWidth + "&dh=" + (cellHeight-25); - whichFrame.document.write(''); - } - whichFrame.document.write(''); - } - whichFrame.document.write('
'); - whichFrame.document.write(''); - whichFrame.document.write(''); - whichFrame.document.write('
'); - whichFrame.document.write(indexNr + '
'); - whichFrame.document.close(); -} - - -function Backpage() { - - if (att[1] <= 1) { - att[1] = 1; - alert("You are already on the first page!"); - } - - att[1] = parseInt(att[1])-parseInt(att[2]*att[3]); - - if (att[1] < 1) { - att[1] = 1; - } - loadThumbTable(); -} - - -function Nextpage() { - - att[1] = parseInt(att[1])+parseInt(att[2]*att[3]); - loadThumbTable(); -} - - -// capturing keypresses for next and previous page -function parseKeypress(event) { - var whichCode = (window.Event) ? event.which : event.keyCode; - if (String.fromCharCode(whichCode) == "n") { - Nextpage(); - } - if (String.fromCharCode(whichCode) == "b") { - Backpage(); - } -} - - -// initialize browser specific things (keypress caputring) -function initScripts() { - window.captureEvents(Event.KEYDOWN); - window.onkeydown = parseKeypress; -} - - -// fill in the values of the "att"-array -function initPicture(picURL) { - att = picURL.split("+"); - - if (att[0].lastIndexOf("/") == att[0].length-1) { - att[0] = att[0].substring(0, att[0].length-1); - } - - if (att.length < 2 || att[1] == "") { - att[1] = 1; - } - if (att.length < 3 || att[2] == "") { - att[2] = 3; - } - - if (att.length < 4) { - att[3] = 4; - } -} diff -r b51840f2ff75 -r 7349d58cd391 client/digitallibrary/navcat_n6.js --- a/client/digitallibrary/navcat_n6.js Fri Jul 09 02:15:54 2004 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -// these two global variables have to be initialised before the frist use of the functions below -// to fill in the attributes you can use the function initPicture provided below -// - array with all attributes -var att = new Array(); - -// - variable to store the path to the frame, in which the pictures should be created -var whichFrame = parent.mainFrame; - -// give a name to the window containing digicat - this way one can test if there is already a -// digicat-window open and replace the contents of it (ex. digilib) -window.name = "digicat"; - -function loadThumbTable() { - tableWidth = whichFrame.innerWidth-30; - tableHeight = whichFrame.innerHeight-30; - - cellWidth = Math.floor(tableWidth/att[3])-6; - cellHeight = Math.floor(tableHeight/att[2])-4; - -// alert(tableWidth + " " + tableHeight + "\n" + cellWidth + " " +cellHeight); - - whichFrame.document.open(); - whichFrame.document.write(''); - whichFrame.document.write(''); - whichFrame.document.write(''); - - - whichFrame.document.write(''); - whichFrame.document.write(''); - for (i = 0; i < att[2]; i++) { - whichFrame.document.write(''); - for (j = 0; j < att[3]; j++) { - indexNr = parseInt(att[1])+i*parseInt(att[3])+j; - thumb = parent.baseUrl + "/servlet/Scaler/"; - thumb += att[0] + "?" + "pn=" + indexNr + "&ws=1.0&mo=" + att[4] + "&dw=" + cellWidth + "&dh=" + (cellHeight-25); - whichFrame.document.write(''); - } - whichFrame.document.write(''); - } - whichFrame.document.write('
'); - whichFrame.document.write(''); - whichFrame.document.write(''); - whichFrame.document.write('
'); - whichFrame.document.write(indexNr + '
'); - whichFrame.document.close(); - - initScripts(); -} - - -function Backpage() { - - if (att[1] <= 1) { - att[1] = 1; - alert("You are already on the first page!"); - } - - att[1] = parseInt(att[1])-parseInt(att[2]*att[3]); - - if (att[1] < 1) { - att[1] = 1; - } - loadThumbTable(); -} - - - -function Nextpage() { - - att[1] = parseInt(att[1])+parseInt(att[2]*att[3]); - loadThumbTable(); -} - - -// capturing keypresses for next and previous page -// ascii-values of n = 110, b = 98 -function parseKeypress (event) { - if (event.charCode == 110) { - Nextpage(); - } - if (event.charCode == 98) { - Backpage(); - } -} - - -// initialize browser specific things (keypress caputring) -function initScripts() { - for (var f = 0; f < frames.length; f++) { - frames[f].document.addEventListener('keypress', parseKeypress, true); - } - whichFrame.focus(); -} - - -// fill in the values of the "att"-array -function initPicture(picURL) { - att = picURL.split("+"); - - if (att[0].lastIndexOf("/") == att[0].length-1) { - att[0] = att[0].substring(0, att[0].length-1); - } - - if (att.length < 2 || att[1] == "") { - att[1] = 1; - } - - if (att.length < 3 || att[2] == "") { - att[2] = 3; - } - - if (att.length < 4) { - att[3] = 4; - } - -} diff -r b51840f2ff75 -r 7349d58cd391 client/digitallibrary/navigation.js --- a/client/digitallibrary/navigation.js Fri Jul 09 02:15:54 2004 +0200 +++ b/client/digitallibrary/navigation.js Fri Jul 09 02:15:54 2004 +0200 @@ -20,6 +20,11 @@ */ +function identify() { + return 'Digilib v0.6'; +} + + var ZOOMFACTOR = Math.sqrt(2); dlParams = new Object(); @@ -119,24 +124,26 @@ } // window size + var wwidth, wheight; + if (self.innerHeight) // all except Explorer { - wwidth = self.innerWidth; - wheight = self.innerHeight; + wwidth = self.innerWidth; + wheight = self.innerWeight; } else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode { - wwidth = document.documentElement.clientWidth; - wheight = document.documentElement.clientHeight; + wwidth = document.documentElement.clientWidth; + wheight = document.doumentElement.clientHeight; } else if (document.body) // other Explorers { - wwidth = document.body.clientWidth; - wheight = document.body.clientHeight; + wwidth = document.body.clientWidth; + wheight = doument.body.clientHeight; } - queryString += "&dw=" + (wwidth-30) + "&dh=" + (wheight-30); + queryString += "&dw=" + (wwidth-30) + "&dh=" + (whewight-30); queryString += "&lv=1"; @@ -227,7 +234,7 @@ } -function ref(select) { +function ref() { var hyperlinkRef = baseUrl + "/digilib.jsp?"; hyperlinkRef += dlParams.fn.value + "+" + dlParams.pn.value + "+" + dlParams.ws.value + "+"; @@ -238,10 +245,17 @@ hyperlinkRef += "+" + dlParams.wh.value; } + return hyperlinkRef; + +} + + +function ref(select) { + if ( select == 0 ) { - prompt("Link for LaTeX-documents", "\\href{" + hyperlinkRef + "}{TEXT}"); + prompt("Link for LaTeX-documents", "\\href{" + ref() + "}{TEXT}"); } else if ( select == 1 ) { - prompt("Link for HTML-documents", hyperlinkRef); + prompt("Link for HTML-documents", ref()); } }