# HG changeset patch # User luginbue # Date 1077876764 -3600 # Node ID c50e0e77d697fa8562369b349bab6075ed96fcb8 # Parent e2da788376136ef2f826507b0b24dce9f0220c64 restart xul version control - first delete everything diff -r e2da78837613 -r c50e0e77d697 xul/annota/annota.js --- a/xul/annota/annota.js Fri Feb 27 11:06:54 2004 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,319 +0,0 @@ -include ('chrome://jslib/content/io/dir.js'); -include ('chrome://jslib/content/io/file.js'); -include ('chrome://jslib/content/io/rdfBase.js'); -include ('chrome://jslib/content/io/rdfResource.js'); -include ('chrome://jslib/content/io/rdfContainer.js'); -include ('chrome://jslib/content/io/rdf.js'); -include ('chrome://jslib/content/io/rdfFile.js'); -include('chrome://jslib/content/io/fileUtils.js'); - -var slash='/'; -if (navigator.platform=="Win32"){ - slash='\\'; -} - -var directory=slash; -var digilib_path=slash; - -getProfile(); - -function makePathCompatible(path){ - if (navigator.platform=="Win32"){ - // slash durch backslash ersetzten - path=path.replace(/\//g,"\\"); - // nur 2 backslashs am anfang - path=path.replace(/^\\{3}/,"\\\\"); - // vor Laufwerkbuchstaben kein Backslash - if (path.indexOf(":")>0){ - path=path.replace(/^\\/g,""); - } - // nur ein Slash gibt Absturz - path=path.replace(/^\\$/,"c:\\"); - //alert(path); - } - return path; -} - -function file_open(){ - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a Directory", nsIFilePicker.modeGetFolder); - - // set default direcotry - var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - directory=makePathCompatible(directory); - aLocalFile.initWithPath(directory); - fp.displayDirectory=aLocalFile; - - var res=fp.show(); - if (res==nsIFilePicker.returnOK){ - directory=fp.fileURL.path; - directory=makePathCompatible(directory); - setTreeDirectory(); - } -} - -function setTreeDirectory(){ - var t=document.getElementById("file_tree"); - t.setAttribute("ref","file://"+directory); -} - -function refreshTree(){ - var t=document.getElementById("file_tree"); - t.builder.rebuild(); -} - -function file_save(){ - - // get Digilib-Parameter form Browser - // alert(window.content.location.href); - - var documentpath=''; - try{ - documentpath=window.content.getParameter('fn'); - }catch (e){ - documentpath=''; - } - if (documentpath != ''){ - var docPath='urn:echo:'+documentpath; - - var rdfString='' + - '' + - ' ' + - ' ' + - ' ' + - ' '+ - ''; - - var ds=new RDFDataSource(); - ds.parseFromString(rdfString,"http://echo.unibe.ch/digilib/rdf/digilib.rdf"); - var node=ds.getNode(docPath); - var arrayParams=window.content.listParameters(); - for (i=0; i< arrayParams.length; i++){ - var value=window.content.getParameter(arrayParams[i]); - //alert(arrayParams[i]+":"+value); - node.addTarget("http://echo.unibe.ch/digilib/rdf#"+arrayParams[i],value); - } - node.addTarget("http://echo.unibe.ch/digilib/rdf#lv","1"); - //alert(ds.serializeToString()); - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a File", nsIFilePicker.modeSave); - - // set default direcotry - var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); - directory=makePathCompatible(directory); - aLocalFile.initWithPath(directory); - fp.displayDirectory=aLocalFile; - - fp.appendFilter("Annotations","*.rdf; *.RDF"); - var res=fp.show(); - if (res==nsIFilePicker.returnOK){ - var thefile=fp.file; - // --- do something with the file here --- - //alert(fp.file); - //alert(fp.fileURL.path); - - var strFilePath=fp.file.path; - strFilePath=strFilePath.toLowerCase(); - if (strFilePath.indexOf('.rdf')<0){ - strFilePath=fp.fileURL.path+".rdf"; - }else{ - strFilePath=fp.fileURL.path; - } - strFilePath=makePathCompatible(strFilePath); - var f=new File(strFilePath); - //var boolFileExists=f.exists(); - //alert(boolFileExists); - f.create(); - f.open('w'); - f.write(ds.serializeToString()); - f.close(); - refreshTree(); - } - }else{ - alert("Error: no alcatraz component. can't create an annotation."); - } -} - -function file_local(){ - // noch nicht programmiert -} - -function file_annotaDB(){ - alert("At the moment it is not possible to use the annota DB! This feature is not yet programmed."); - var menu_item=document.getElementById('local'); - menu_item.setAttribute('checked','true'); -} - -function tree_click(){ - var t=document.getElementById("file_tree"); //tree element - var l=t.view.getItemAtIndex(t.currentIndex); //aus baum treeitem herausholen mit dem selected index (currentIndex) - //l.firstChild ist treeitem - var d=l.firstChild.firstChild; //treecell - var firstLabel=d.getAttribute("label"); - var cols=document.getElementById("cols"); - var col=cols.childNodes; - var nodes=l.firstChild.childNodes; - var rdf_file=""; - for (var i=0;i - - - - - - - - diff -r e2da78837613 -r c50e0e77d697 xul/install_sidebar.jsp --- a/xul/install_sidebar.jsp Fri Feb 27 11:06:54 2004 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -<%@page contentType="text/html" import="java.util.*"%> -<% - String serverName = request.getServerName(); - int serverPort = request.getServerPort(); - String serverPATH = request.getRequestURI(); - int lastSlash = serverPATH.lastIndexOf("/"); - serverPATH=serverPATH.substring(0, lastSlash); -%> - - -Alcatraz-XUL-Sidebars - - - - - - - - -
- -

- -

Alcatraz-XUL-Sidebars

- - - Digilib-Buttons im Sidebar -
- -

- -
- - - diff -r e2da78837613 -r c50e0e77d697 xul/menu.js --- a/xul/menu.js Fri Feb 27 11:06:54 2004 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -/* -Copyright (C) 2003 WTWG, Uni Bern - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3 -*/ -function rotate() { - value = prompt("Enter absolute rotation angle in degrees (clockwise orientation) :"); - - if (value) { - window.content.rotation(value); - } -} - -function color_add() { - - value = prompt("Enter the values you like to add to the red, green and blue color channel.\n\nFormat is R/G/B, where R,G,B are floating numbers between -255 and +255."); - - if (value) { - - values = value.split("/"); - - if (values.length != 3) alert("Illegal format"); - else if ((values[0] < -255) || (values[0] > 255)) alert("Illegal value for red"); - else if ((values[1] < -255) || (values[1] > 255)) alert("Illegal value for green"); - else if ((values[2] < -255) || (values[2] > 255)) alert("Illegal value for blue"); - - else window.content.rgba(value); - - } -} - -function color_multiply() { - - value = prompt("Enter the values you like to multiply with the different color channels.\n\nFormat is R/G/B, where R,G,B are floating numbers bigger than 0."); - - if (value) { - - values = value.split("/"); - - if (values.length != 3) alert("Illegal format"); - else if (values[0] < 0) alert("Illegal value for red"); - else if (values[1] < 0) alert("Illegal value for green"); - else if (values[2] < 0) alert("Illegal value for blue"); - - else window.content.rgbm(value); - - } -} - -function showMetadata(myurl){ - var arrUrl=myurl.split("?"); - var strDigilib=arrUrl[0]; - var strParams=arrUrl[1]; - var strArguments=strParams.split("&"); - var strDocDir=""; - for (i=0;i=0){ - strDocDir=strArg.substr(intPos+3); - } - } - if (strDocDir == ""){ - alert("no metadata available"); - }else{ - window.open("showMetadata.jsp?docdir="+strDocDir,"Metadata "+strDocDir,"menubar=no scrollbars=yes height=400 width=600"); - } -} - - -function checkBrowser() { - - this.ua = navigator.userAgent; - this.ver = navigator.appVersion; - this.dom = ( document.getElementById ); - this.opera = ( this.dom ) && ( this.ua.toLowerCase().indexOf("opera") > -1 ); - this.ie4 = ( document.all ) && ( !this.dom ); - this.ie5 = ( this.ver.indexOf("MSIE 5") > -1 ) && ( this.dom ); - this.ie6 = ( this.ver.indexOf("MSIE 6") > -1 ) && ( this.dom ); - this.ns4 = ( document.layers ) && ( !this.dom ); - this.ns6 = ( this.dom ) && ( parseInt(this.ver) >= 5 ) && ( !this.opera ); - this.ns = this.ns4 || this.ns6; - this.ie = this.ie4 || this.ie5 || this.ie6; - - return this; -} - -browser = new checkBrowser(); - -function overButton(n) { - if (showHelp) contextHelp(n); -} - - -// just to be sure, that no buffer overflow can arrive -var semaphor = true; - -function contextHelp(n) { - - if (helpWindow.closed) { - changeHelp(); - return; - } - - if ((navigator.appVersion.indexOf("Macintosh") < 0) && semaphor) { - semaphor = false; - - var tmpHelp = helpText[n]; - tmpHelp = tmpHelp.replace(/\(br\)/,"
"); - var help = tmpHelp.split("|"); - - helpWindow.focus(); - helpWindow.document.open(); - helpWindow.document.write('Context Help'); - helpWindow.document.write(''); - helpWindow.document.write('
'); - helpWindow.document.write(help[0] + '
'); - helpWindow.document.write(help[1] + '
'); - helpWindow.document.close(); - - - // stupid workaround because of netscape 6, that doesen't know the opener property - // this workaround is still ok because netscape 6 has eventbuffer checks so no overflow - if (browser.ns6) { - semaphor = true; - } - - // next stupid workaround because of opera 6, that somehow don't start the 'onLoad'- - // attribute in the body tag (the helpwindow does not finish loading) - if (browser.opera) { - setTimeout("semaphor = true;", 50); - } - - } - -} - -function openContextHelp() { - if (navigator.appVersion.indexOf("Macintosh") > -1) { - openContextHelpMac(); - return; - } - - semaphor = false; - - var winWidth = 270; - var winHeight = 130; - - var xScreen = 0.9*(screen.width-winWidth); - var yScreen = 0.8*(screen.height-winHeight); - - helpWindow = window.open("", "ContextHelp", "width=" + winWidth + ",height=" + winHeight + ",screenX=" + xScreen + ",screenY=" + yScreen + ",left=" + xScreen + ",top=" + yScreen); - - helpWindow.focus(); - helpWindow.document.open(); - helpWindow.document.write('Context Help'); - helpWindow.document.write(''); - helpWindow.document.write('
'); - helpWindow.document.write('Context Help
'); - helpWindow.document.write('Move over any button to get some more information about its function
'); - helpWindow.document.close(); - - // for some safety reason help-requests have to be blocked while opening the window - setTimeout("semaphor = true;", 200); -} - -// because macs have a strange window focus behaviour we have to go a special - -// way for them - just opening a window that contains all button-descriptions - -function openContextHelpMac() { - - var winWidth = 270; - var winHeight = 600; - - var xScreen = 0.9*(screen.width-winWidth); - var yScreen = 0.8*(screen.height-winHeight); - - helpWindow = window.open("", "ContextHelp", "width=" + winWidth + ",height=" + winHeight + ",screenX=" + xScreen + ",screenY=" + yScreen + ",left=" + xScreen + ",top=" + yScreen + ",scrollbars"); - - helpWindow.focus(); - helpWindow.document.open(); - helpWindow.document.write('Context Help Macintosh'); - helpWindow.document.write(''); - helpWindow.document.write(''); - - for (n = 0; n < helpText.length; n++) { - - help = helpText[n].split("|"); - helpWindow.document.write(''); - } - - helpWindow.document.write('
'); - helpWindow.document.write(help[0] + '
'); - helpWindow.document.write('

' + help[1] + '
 

'); - helpWindow.document.close(); -} - -function closeContextHelp() { - if (helpWindow != '' && !helpWindow.closed) { - helpWindow.close(); - } - - helpWindow = ''; - -} - -function changeHelp() { - showHelp = !showHelp; - showHelp ? openContextHelp() : closeContextHelp(); -} - - -// variable containing the contextwindow - -var helpWindow = ''; \ No newline at end of file