annotate xul/content/annota.js @ 252:59250ea2ad55

servlet version 1.19b5 - filename and dpi in request - filename and dpi in dlInfo-*
author robcast
date Wed, 25 Aug 2004 01:06:30 +0200
parents 0e841edf6c39
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
1 include ('chrome://jslib/content/io/dir.js');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
2 include ('chrome://jslib/content/io/file.js');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
3 /*include ('chrome://jslib/content/io/rdfBase.js');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
4 include ('chrome://jslib/content/io/rdfResource.js');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
5 include ('chrome://jslib/content/io/rdfContainer.js');*/
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
6 include ('chrome://jslib/content/io/rdf.js');/*
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
7 include ('chrome://jslib/content/io/rdfFile.js');*/
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
8 include ('chrome://jslib/content/io/fileUtils.js');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
9
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
10 /* Konstanten */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
11 var BEGIN_OF_URI = 'urn:echo';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
12 var TREE_ID = 'annotation_tree';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
13 var ECHO = 'http://echo.unibe.ch/digilib/rdf#';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
14 var HEADER_URI = 'urn:header:';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
15
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
16 var slash='/';
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
17 if (navigator.platform=="Win32"){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
18 slash='\\';
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
19 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
20
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
21 var directory=slash;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
22 var digilib_path=slash;
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
23 var creator = 'unknown';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
24 var rdfTree;
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
25
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
26 getProfile();
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
27 getAnnotations();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
28
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
29
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
30 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
31 * Opens a Dialog to make a text annotation.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
32 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
33 function dialog_annotate() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
34 if(this.getAttributeOfSelectedNode('url') != '') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
35 window.openDialog("chrome://alcatraz/content/dialog_annotate.xul", "dialog_annotate", "chrome,dialog,resizable=no", "");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
36 } else {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
37 alert('No Annotation is selected!');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
38 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
39 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
40
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
41
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
42 function makePathCompatible(path){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
43 if (navigator.platform=="Win32"){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
44 // slash durch backslash ersetzten
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
45 path=path.replace(/\//g,"\\");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
46 // nur 2 backslashs am anfang
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
47 path=path.replace(/^\\{3}/,"\\\\");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
48 // vor Laufwerkbuchstaben kein Backslash
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
49 if (path.indexOf(":")>0){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
50 path=path.replace(/^\\/g,"");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
51 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
52 // nur ein Slash gibt Absturz
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
53 path=path.replace(/^\\$/,"c:\\");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
54 //alert(path);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
55 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
56 return path;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
57 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
58
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
59 function file_open(){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
60 var nsIFilePicker = Components.interfaces.nsIFilePicker;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
61 var fp = Components.classes["@mozilla.org/filepicker;1"]
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
62 .createInstance(nsIFilePicker);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
63 fp.init(window, "Select a Directory", nsIFilePicker.modeGetFolder);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
64
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
65 // set default directory
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
66 var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
67 directory=makePathCompatible(directory);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
68 aLocalFile.initWithPath(directory);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
69 fp.displayDirectory=aLocalFile;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
70
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
71 var res=fp.show();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
72 if (res==nsIFilePicker.returnOK){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
73 directory=fp.fileURL.path;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
74 directory=makePathCompatible(directory);
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
75 this.setTreeDirectory();
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
76 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
77 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
78
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
79 function setTreeDirectory(){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
80 this.rdfTree = new RDFTree(this.TREE_ID);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
81 this.rdfTree.addDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
82 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
83
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
84 function setCreatorName() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
85
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
86 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
87
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
88 function refreshTree(){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
89 this.rdfTree = new RDFTree(this.TREE_ID);
214
0e841edf6c39 The tree is sortable now.
slarti
parents: 213
diff changeset
90 this.rdfTree.doSort('name');
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
91 this.rdfTree.rebuild();
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
92 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
93
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
94 function getAttributeOfSelectedNode(attribute) {
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
95 this.rdfTree = new RDFTree(this.TREE_ID);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
96 var tree = this.rdfTree.tree;
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
97 try {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
98 return tree.view.getCellText(tree.currentIndex,attribute);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
99 } catch(e) {
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
100 return '';
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
101 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
102 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
103
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
104 function getURIOfSelectedNode() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
105 var url = this.getAttributeOfSelectedNode('url');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
106 if(url != '') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
107 return id = this.BEGIN_OF_URI + ':' + url
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
108 + '|' + this.getAttributeOfSelectedNode('pagenumber')
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
109 + '|' + this.getAttributeOfSelectedNode('name');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
110 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
111 return '';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
112 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
113
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
114 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
115 * Deletes the selected Annotation
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
116 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
117 function deleteAnnotation() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
118 var name = this.getAttributeOfSelectedNode('name');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
119 if(name != '') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
120 var isSure = window.confirm('Do you really want to delete the Annotations "'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
121 + name + '?');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
122 if(isSure) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
123 var dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
124 containerNode = dataSource.getNode(this.BEGIN_OF_URI);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
125 var uri = this.getURIOfSelectedNode();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
126 containerNode.removeChild(dataSource.getNode(uri));
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
127 // alert(this.HEADER_URI+this.getURIOfSelectedNode());
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
128 //alert(uri);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
129 dataSource.deleteRecursive(this.HEADER_URI+uri); // Delete the Header
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
130 dataSource.deleteRecursive(uri);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
131 this.refreshTree();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
132 dataSource.save();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
133 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
134 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
135
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
136 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
137
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
138 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
139 * Adds a Textannotation to an existing annotation.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
140 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
141 function addTextAnnotation(text) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
142 var id = this.getURIOfSelectedNode();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
143 dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
144 var node = dataSource.getNode(id);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
145 if(node.propertyExists('http://purl.org/dc/elements/1.0/title')) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
146 /** Do something */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
147 } else { // Should never be reached
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
148 alert('AddTextAnnotation: No Annotation is selected!');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
149 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
150 //alert(text);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
151 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
152
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
153 function getCurrentDate() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
154 var now = new Date();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
155 return date = ((now.getYear() < 999) ? (now.getYear()+1900) : now.getYear()) + '-'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
156 +now.getDate() + '-' + now.getDay() + ', '
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
157 +now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' '
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
158 +(now.getTimezoneOffset()/60) + ':00 GMT';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
159 }
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
160
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
161 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
162 * Creates A Complex RDF entry and adds it to the base Container.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
163 * @params String The urn of the new node without(!) title (so far).
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
164 * @todo isn't complex yet...
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
165 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
166 function createComplexRDFEntry(inCompleteURN) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
167 var title = window.prompt("Please enter a title for this Annotation"
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
168 ,this.getAttributeOfSelectedNode('name'));
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
169 if(title != null) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
170 var completeURN = inCompleteURN+title;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
171 var echoContainer = dataSource.getNode(BEGIN_OF_URI);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
172 echoContainer.makeSeq();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
173
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
174 echoContainer.addChild(completeURN);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
175 /* var node = dataSource.getNode(completeURN);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
176 node.addTarget(ECHO + 'template','text_digilib');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
177 node.addTarget(ECHO + 'echo','basic');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
178 node.addTarget(ECHO + 'lv","1");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
179 node.addTarget("http://purl.org/dc/elements/1.0/title",title);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
180 node.addTarget("http://purl.org/dc/elements/1.0/creator","");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
181 node.addTarget("http://purl.org/dc/elements/1.0/date","");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
182 node.addTarget("http://www.w3.org/2000/10/annotation-ns#created","");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
183 node.addTarget("http://www.w3.org/1999/02/22-rdf-syntax-ns#type",'Annotation');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
184
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
185 var arrayParams=window.content.listParameters();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
186
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
187 var s = '';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
188 for (i=0; i< arrayParams.length; i++){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
189 s += arrayParams[i] + ' ' + window.content.getParameter(arrayParams[i]) + '\n';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
190 //var value=window.content.getParameter(arrayParams[i]);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
191 //alert(arrayParams[i]+":"+value);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
192 //node.addTarget(ECHO + '+arrayParams[i],value);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
193 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
194 alert(s);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
195
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
196 node.addTarget(ECHO + 'lv',"1");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
197 node.addTarget("http://purl.org/dc/elements/1.0/title",title);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
198 node.addTarget("http://purl.org/dc/elements/1.0/creator","");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
199 node.addTarget("http://purl.org/dc/elements/1.0/date","");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
200 node.addTarget("http://www.w3.org/2000/10/annotation-ns#created","");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
201 //node.addTarget("http://www.w3.org/2000/10/annotation-ns#Annotation","targetof");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
202 //var node2 = dataSource.getNode("targetof");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
203 //node2.addTarget(ECHO + 'lv',"1");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
204 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
205 var date = this.getCurrentDate();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
206 var node = dataSource.getNode(this.HEADER_URI + completeURN);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
207 var created = '';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
208 /** @Todo Doesn't work correctly, if the selected one isn't the overwritten one! */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
209 if(!node.propertyExists('http://purl.org/dc/elements/1.0/title')) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
210 created = date;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
211 } else {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
212 created = this.getAttributeOfSelectedNode('created');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
213 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
214 var fn = window.content.getParameter('fn');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
215 var pn = window.content.getParameter('pn');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
216 var ws = window.content.getParameter('ws');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
217 var mk = window.content.getParameter('mk');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
218 var wx = window.content.getParameter('wx');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
219 var wy = window.content.getParameter('wy');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
220 var ww = window.content.getParameter('ww');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
221 var wh = window.content.getParameter('wh');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
222 var pt = window.content.getParameter('pt');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
223
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
224 var brgt = window.content.getParameter('brgt');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
225 var cont = window.content.getParameter('cont');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
226 var rot = window.content.getParameter('rot');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
227 var rgba = window.content.getParameter('rgba');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
228 var rgbm = window.content.getParameter('rgbm');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
229 var ddpix = window.content.getParameter('ddpix');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
230 var ddpiy = window.content.getParameter('ddpiy');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
231
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
232 var lv = 1; /** @todo get the parameter right */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
233
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
234
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
235 var rdfHeader = '<?xml version="1.0" ?>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
236 +'<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
237 +' xmlns:echo="' + ECHO + '"\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
238 +' xmlns:a="http://www.w3.org/2000/10/annotation-ns#"\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
239 +' xmlns:d="http://purl.org/dc/elements/1.0/">\n\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
240 var rdfFooter = '</RDF:RDF>\n';
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
241
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
242 var rdf = rdfHeader;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
243 if(true) { // annotation is basic
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
244 rdf += ' <RDF:Description RDF:about="' + completeURN + '">\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
245 + ' <!-- Annotations Type -->\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
246 + ' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
247 + ' <echo:type rdf:resource="' + ECHO + 'Digilib"/>\n' //echo -> RDF
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
248 + ' <!-- Echo Digilib Parameters -->\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
249 + ' <echo:fn>' + fn + '</echo:fn>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
250 + ' <echo:pn>' + pn + '</echo:pn>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
251 + ' <echo:ws>' + ws + '</echo:ws>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
252 + ' <echo:mk>' + mk + '</echo:mk>\n' // As there isn't a textmark yet, I only set mk
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
253 + ' <echo:wx>' + wx + '</echo:wx>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
254 + ' <echo:wy>' + wy + '</echo:wy>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
255 + ' <echo:ww>' + ww + '</echo:ww>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
256 + ' <echo:wh>' + wh + '</echo:wh>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
257 + ' <echo:pt>' + pt + '</echo:pt>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
258 + ' <echo:brgt>' + brgt + '</echo:brgt>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
259 + ' <echo:cont>' + cont + '</echo:cont>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
260 + ' <echo:rot>' + rot + '</echo:rot>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
261 + ' <echo:rgba>' + rgba + '</echo:rgba>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
262 + ' <echo:rgbm>' + rgbm + '</echo:rgbm>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
263 + ' <echo:ddpix>' + ddpix + '</echo:ddpix>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
264 + ' <echo:ddpiy>' + ddpiy + '</echo:ddpiy>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
265 + ' <echo:lv>' + lv + '</echo:lv>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
266 + ' <!-- Dublin Core -->\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
267 + ' <d:title>' + title + '</d:title>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
268 + ' <d:creator>' + creator + '</d:creator>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
269 + ' <d:date>' + date + '</d:date>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
270 + ' <!-- WWW.W3.org Annotations -->\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
271 + ' <a:created>' + created + '</a:created>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
272 + ' </RDF:Description>\n';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
273 } else { // annotation is complex /** @Todo The other components aren't correct yet*/
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
274
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
275 rdf +=' <RDF:Description RDF:about="' + this.HEADER_URI + completeURN + '">\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
276 + ' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
277 + ' <echo:template>text_digilib</echo:template>\n' // are there other templates?
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
278 + ' <!-- Dublin Core -->\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
279 + ' <d:title>' + title + '</d:title>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
280 + ' <d:creator>' + creator + '</d:creator>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
281 + ' <d:date>' + date + '</d:date>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
282 + ' <!-- WWW.W3.org Annotations -->\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
283 + ' <a:created>' + created + '</a:created>\n';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
284
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
285 rdf +=' <echo:type rdf:resource="' + ECHO + 'complex"/>\n'; //echo -> RDF
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
286 + ' <echo:annotation RDF:resource="' + completeURN +'"/>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
287 + ' </RDF:Description>\n\n';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
288 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
289
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
290 rdf += rdfFooter;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
291 //alert(rdf);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
292 var ds = new RDFDataSource();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
293
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
294 //Remove the original to add the new one
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
295 dataSource.deleteRecursive(this.HEADER_URI+completeURN);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
296 ds.parseFromString(rdf,'file://'+this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
297 ds.copyAllToDataSource(dataSource);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
298
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
299 /*******************************************************
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
300
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
301 var rdf ='<?xml version="1.0" ?>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
302 +'<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
303 +' xmlns:echo="' + ECHO + '"'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
304 +' xmlns:a="http://www.w3.org/2000/10/annotation-ns#"'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
305 +' xmlns:d="http://purl.org/dc/elements/1.0/">'
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
306
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
307 +' <RDF:Description rdf:about="'+completeURN+'">'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
308 +' <echo:template>text_digilib</echo:template>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
309 +' <echo:type rdf:resource="' + ECHO + 'complex"/>' //echo -> RDF
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
310 +' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
311 +' <echo:annotation>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
312 +' <RDF:Description>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
313 +' <!-- Annotations Type -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
314 +' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation"/>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
315 +' <echo:type rdf:resource="' + ECHO + 'Digilib"/>' //echo -> RDF
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
316 +' <!-- Echo Digilib Parameters -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
317 +' <echo:fn>histbot/botany</echo:fn>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
318 +' <echo:pn>1</echo:pn>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
319 +' <echo:ws>1.0</echo:ws>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
320 +' <echo:text_mark echo:mk="0.6021/0.8411">'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
321 +' <RDF:Description>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
322 +' <!-- Annotations Type -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
323 +' <RDF:type rdf:resource="http://www.w3.org/2000/10/annotation-ns#Annotation" />'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
324 +' <echo:type rdf:resource="' + ECHO + 'Text" />'//echo -> RDF
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
325 +' <!-- Alcatraz Text -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
326 +' <echo:txt>Mark 1 shows the root of the Anthoxanthum odoratum &lt;br /&gt; there is a lot of textand textt and text and text and text</echo:txt>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
327 +' <!-- Dublin Core -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
328 +' <d:title>Text Annotation of Mark1</d:title>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
329 +' <d:creator>erwin.mueller@philo.unibe.ch</d:creator>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
330 +' <d:date>2003-07-11T19:13:52+01:00</d:date>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
331 +' <!-- WWW.W3.org Annotations -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
332 +' <a:created>2003-07-11T19:13:16+01:00</a:created>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
333 +' </RDF:Description>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
334 +' </echo:text_mark>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
335 +' <echo:wx>0.2626</echo:wx>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
336 +' <echo:wy>0.8123</echo:wy>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
337 +' <echo:ww>0.4747</echo:ww>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
338 +' <echo:wh>0.1484</echo:wh>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
339 +' <echo:pt>249</echo:pt>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
340 +' <echo:lv>1</echo:lv>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
341 +' <!-- Dublin Core -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
342 +' <d:title>Ruchgras</d:title>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
343 +' <d:creator>daniel.engler@philo.unibe.ch</d:creator>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
344 +' <d:date>2003-05-11T16:42:52+01:00</d:date>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
345 +' <!-- WWW.W3.org Annotations -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
346 +' <a:created>2003-05-11T16:34:16+01:00</a:created>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
347 +' </RDF:Description>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
348 +' </echo:annotation>' // rdf:resource="echo00765"/>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
349 +' <d:title>Complex Annotation Digilib and Text</d:title>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
350 +' <d:creator>karl.gerber@germ.unibe.ch</d:creator>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
351 +' <d:date>2003-01-13T19:13:52+01:00</d:date>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
352 +' <!-- WWW.W3.org Annotations -->'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
353 +' <a:created>2003-01-13T19:13:16+01:00</a:created>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
354 +' </RDF:Description>'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
355 +'</RDF:RDF>';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
356 ds = new RDFDataSource();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
357 ds.parseFromString(rdf,"http://echo.unibe.ch/digilib/rdf/digilib.rdf");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
358 //alert('Beispiel einer komplexen Annotation:\n\n'+ds.serializeToString());
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
359 ***************************************************************/
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
360 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
361 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
362
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
363 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
364 * Saves the open echo-site in the annotation.rdf-file without asking.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
365 * @todo The <code>about</code> has to be modified if the URN's are changing!
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
366 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
367 function quickSave() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
368 var about='';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
369 try {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
370 var identify;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
371 try {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
372 identify = (typeof(window.content.identify()) != 'undefined')
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
373 ? window.content.identify() : false;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
374 } catch(e) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
375 identify = false;
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
376 }
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
377 about = window.content.getParameter('fn');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
378 about += '|' + window.content.getParameter('pn') + '|';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
379 } catch (e){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
380 about = '';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
381 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
382 if (about != ''){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
383 //alert('Creator: '+this.creator);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
384 while(this.creator == 'unknown' || this.creator == '') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
385 this.creator = window.prompt("Please enter a username:",this.creator);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
386 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
387 this.setProfile();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
388
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
389 //URN isn't complete yet!
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
390 var urn = BEGIN_OF_URI + ':' + about;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
391 //alert('Documentpath: '+documentpath);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
392
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
393 dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
394
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
395 this.createComplexRDFEntry(urn);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
396 dataSource.save();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
397 refreshTree();
214
0e841edf6c39 The tree is sortable now.
slarti
parents: 213
diff changeset
398
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
399 } else{
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
400 alert("Error: no alcatraz component. can't create an annotation.");
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
401 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
402 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
403
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
404 /** @todo Allow the users to save their RDF-Files anywhere.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
405 function saveAs(){
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
406
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
407 // get Digilib-Parameter form Browser
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
408 //alert(window.content.location.href);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
409
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
410 var documentpath='';
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
411 try{
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
412 documentpath=window.content.getParameter('fn');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
413 documentpath=documentpath.replace(':',';');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
414 }catch (e){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
415 documentpath='';
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
416 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
417 if (documentpath != ''){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
418 //documentpath=documentpath.replace(slash,':');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
419 //alert(documentpath);
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
420 var docPath = BEGIN_OF_URI + ':' + documentpath;
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
421
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
422 var t=document.getElementById("file_tree");
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
423 dataSource = new RDFDataSource();
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
424 this.createComplexRDFEntry(docPath);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
425
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
426 //dataSource.save();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
427 //refreshTree();
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
428 var nsIFilePicker = Components.interfaces.nsIFilePicker;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
429 var fp = Components.classes["@mozilla.org/filepicker;1"]
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
430 .createInstance(nsIFilePicker);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
431 fp.init(window, "Select a File", nsIFilePicker.modeSave);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
432
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
433 // set default direcotry
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
434 var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
435 directory=makePathCompatible(directory);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
436 aLocalFile.initWithPath(directory);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
437 fp.displayDirectory=aLocalFile;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
438
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
439 fp.appendFilter("Annotations","*.rdf; *.RDF");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
440 var res=fp.show();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
441 if (res==nsIFilePicker.returnOK){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
442 var thefile=fp.file;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
443 // --- do something with the file here ---
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
444 //alert(fp.file);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
445 //alert(fp.fileURL.path);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
446
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
447 var strFilePath=fp.file.path;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
448 strFilePath=strFilePath.toLowerCase();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
449 if (strFilePath.indexOf('.rdf')<0){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
450 strFilePath=fp.fileURL.path+".rdf";
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
451 }else{
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
452 strFilePath=fp.fileURL.path;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
453 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
454 strFilePath=makePathCompatible(strFilePath);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
455 var f=new File(strFilePath);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
456 //var boolFileExists=f.exists();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
457 //alert(boolFileExists);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
458 f.create();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
459 f.open('w');
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
460 f.write(dataSource.serializeToString());
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
461 f.close();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
462 refreshTree();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
463 }
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
464
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
465 } else{
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
466 alert("Error: no alcatraz component. can't create an annotation.");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
467 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
468 }
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
469 //*/
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
470
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
471 function file_local(){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
472 // noch nicht programmiert
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
473 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
474
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
475 function file_annotaDB(){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
476 alert("At the moment it is not possible to use the annota DB! This feature is not yet programmed.");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
477 var menu_item=document.getElementById('local');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
478 menu_item.setAttribute('checked','true');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
479 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
480
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
481 function tree_click(){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
482 var rdfFile = this.getURIOfSelectedNode();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
483 if (rdfFile!=''){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
484 //alert('New identifier: '+ rdfFile);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
485 this.send_annotation(rdfFile);
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
486 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
487 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
488
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
489
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
490 /***
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
491 * Diese Funktion wird gebraucht um im Dialog den Pfad zu digilib zu setzen
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
492 *
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
493 ***/
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
494 function setDigilibPath(digilibPathValue){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
495 digilib_path=digilibPathValue;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
496 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
497
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
498 /***
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
499 * Dialog tools momentan kann man nur den Pfad zu digilib setzen
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
500 *
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
501 ***/
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
502 function show_dialog(dialog){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
503 if (dialog=="tool path"){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
504 window.openDialog("tools_dialog.xul","funny dialog",
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
505 "chrome",digilib_path,setDigilibPath);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
506 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
507 if (dialog == 'creator') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
508 var creatorName = window.prompt('Enter the name of the creator of the annotations:'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
509 ,this.creator);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
510 if(creatorName != '') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
511 this.creator = creatorName;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
512 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
513 }
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
514 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
515
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
516
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
517 /***
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
518 * Gibt den Inhalt eines Files als String zurueck
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
519 *
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
520 ***/
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
521 function readFile(fileName){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
522 var file = new File(fileName);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
523 var string = '';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
524 if (file.isFile()){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
525 file.open();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
526 string=file.read();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
527 file.close();
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
528 }
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
529 return string;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
530 }
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
531
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
532 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
533 * @todo digilib.jsp sollte hier nicht auf die urn schauen, sondern auf den fn parameter!
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
534 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
535 function getContentOfRdfDescription(id) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
536 dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
537 var inMemoryDataSource = new RDFDataSource();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
538 var node = dataSource.getNode(id);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
539 var properties = node.getProperties();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
540 var urn = this.getAttributeOfSelectedNode('url');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
541 urn = urn.replace(/^file:\/\//,"");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
542 urn = this.makePathCompatible(urn);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
543 var inMemoryNode = inMemoryDataSource.getNode(this.BEGIN_OF_URI+':'+urn);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
544 while(properties.hasMoreElements()) {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
545 var property = properties.getNext();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
546 var target = node.getTarget(property);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
547 inMemoryNode.addTarget(property,target);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
548 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
549 return inMemoryDataSource.serializeToString();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
550 }
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
551
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
552 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
553 * @todo check if it is platform independant
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
554 */
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
555 function send_annotation(rdfFilePath){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
556 //digilib_path = 'http://pythia2.unibe.ch:8080/docuserver/digitallibrary';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
557 strRdfFile = this.getContentOfRdfDescription(rdfFilePath);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
558 //alert(strRdfFile);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
559 if (strRdfFile!=''){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
560 var formid = 'mainform';
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
561 var form = this.createForm(formid, digilib_path+"/digilib.jsp", "post", "_content");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
562 this.setFormData(form, formid, strRdfFile);
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
563 form.submit();
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
564 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
565 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
566
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
567 function createForm(formid, action, method, target) {
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
568 var form = document.getElementById(formid);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
569 if(form != null)
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
570 document.documentElement.removeChild(form);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
571
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
572 var form = document.createElementNS("http://www.w3.org/1999/xhtml", "form");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
573 form.setAttribute("id", formid);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
574 form.setAttribute("action", action);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
575 form.setAttribute("method", method);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
576 form.setAttribute("target", target);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
577 document.documentElement.appendChild(form);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
578 return form;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
579 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
580
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
581 function setFormData(form, formid, rdf) {
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
582 var val1 = document.createElementNS("http://www.w3.org/1999/xhtml", "input");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
583 val1.setAttribute('type', 'hidden');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
584 val1.setAttribute('name', 'rdf');
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
585 val1.setAttribute('value', rdf);
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
586 form.appendChild(val1);
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
587 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
588
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
589
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
590 function getProfileDirectory(){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
591 // First get the directory service and query interface it to
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
592 // nsIProperties
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
593 var dirService = Components.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
594 classes['@mozilla.org/file/directory_service;1'].
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
595 getService(Components.interfaces.nsIProperties);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
596
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
597 // Next get the "ProfD" property of type nsIFile from the directory
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
598 // service, FYI this constant is defined in
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
599 // mozilla/xpcom/io/nsAppDirectoryServiceDefs.h
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
600
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
601 const NS_APP_USER_PROFILE_50_DIR = "ProfD";
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
602 profileDir = dirService.get(NS_APP_USER_PROFILE_50_DIR,
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
603 Components.interfaces.nsIFile);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
604
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
605 // Now that we have it we can show it's path. See nsIFile for the
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
606 // other things you that can be done with profileDir
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
607 //alert(profileDir.path);
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
608 return profileDir.path;
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
609 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
610
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
611 function getProfile(){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
612 var strProfile=readFile(getProfileDirectory()+slash+"annota.dat");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
613 if (strProfile==""){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
614 directory=slash;
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
615 digilib_path="http://hera.unibe.ch:8080/alcatraz";
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
616 creator = 'unknown'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
617 setProfile();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
618 } else {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
619 var params=strProfile.split("\n");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
620 for (var i=0;i<params.length;i++){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
621 var key_value=params[i].split("|");
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
622 if (key_value[0]=='directory'){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
623 directory=key_value[1];
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
624 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
625 if (key_value[0]=='tool path'){
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
626 digilib_path=key_value[1];
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
627 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
628 if(key_value[0] == 'creator') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
629 creator = key_value[1];
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
630 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
631 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
632 }
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
633 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
634
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
635 /**
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
636 * @todo Menuentry where the user can set the creator name.
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
637 */
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
638 function setProfile(){
213
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
639 var file = new File(getProfileDirectory()+slash+'annota.dat');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
640 file.create();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
641 file.open('w');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
642 file.write('directory|'+directory+'\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
643 +'tool path|'+digilib_path+'\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
644 +'creator|'+this.creator+'\n');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
645 file.close();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
646 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
647
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
648 function getAnnotations() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
649 var annotations = this.readFile(this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
650 if(annotations=='') {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
651 this.setAnnotations();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
652 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
653 }
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
654
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
655 function setAnnotations() {
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
656 var file = new File(this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
657 //alert(this.getProfileDirectory()+slash+'annotations.rdf');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
658 file.create();
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
659 file.open('w');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
660 file.write('<?xml version="1.0"?>\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
661 +'<RDF:RDF xmlns:ECHO="' + ECHO + '"\n'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
662 +' xmlns:ANNOTATION=\"http://www.w3.org/2000/10/annotation-ns#"'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
663 +' xmlns:DC=\"http://purl.org/dc/elements/1.0/"'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
664 +' xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#">'
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
665 +'</RDF:RDF>\n');
8e4724b71b67 Enhanced the robustness of the annotation tab.
slarti
parents: 203
diff changeset
666 file.close();
203
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
667 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
668
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
669 function traverse(node){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
670 if (node.hasChildNodes){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
671 var arr_nodes=node.childNodes;
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
672 for (var i=0;i<arr_nodes.length;i++){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
673 if (arr_nodes[i].getAttribute("open")){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
674 //alert(arr_nodes[i].getAttribute("open"));
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
675 if (arr_nodes[i].hasChildNodes && arr_nodes[i].firstChild.hasChildNodes){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
676 alert(arr_nodes[i].firstChild.firstChild.getAttribute("label"));
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
677 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
678 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
679 traverse(arr_nodes[i]);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
680 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
681 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
682 }
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
683
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
684 function traverseTree(){
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
685 var t=document.getElementById("file_tree");
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
686 traverse(t);
bf945fcf9105 restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff changeset
687 }