# HG changeset patch
# User slarti
# Date 1080233131 -3600
# Node ID 8e4724b71b6724f56b818ef5ba4ad7d5da6b4def
# Parent f1631db2ff3d2d85fe9695bc3e10c60e952b9138
Enhanced the robustness of the annotation tab.
diff -r f1631db2ff3d -r 8e4724b71b67 xul/alcatraz.jar
Binary file xul/alcatraz.jar has changed
diff -r f1631db2ff3d -r 8e4724b71b67 xul/alcatraz.xpi
Binary file xul/alcatraz.xpi has changed
diff -r f1631db2ff3d -r 8e4724b71b67 xul/content/annota.js
--- a/xul/content/annota.js Thu Mar 25 11:56:08 2004 +0100
+++ b/xul/content/annota.js Thu Mar 25 17:45:31 2004 +0100
@@ -7,6 +7,12 @@
include ('chrome://jslib/content/io/rdfFile.js');*/
include ('chrome://jslib/content/io/fileUtils.js');
+/* Konstanten */
+var BEGIN_OF_URI = 'urn:echo';
+var TREE_ID = 'annotation_tree';
+var ECHO = 'http://echo.unibe.ch/digilib/rdf#';
+var HEADER_URI = 'urn:header:';
+
var slash='/';
if (navigator.platform=="Win32"){
slash='\\';
@@ -14,8 +20,24 @@
var directory=slash;
var digilib_path=slash;
+var creator = 'unknown';
+var rdfTree;
getProfile();
+getAnnotations();
+
+
+/**
+ * Opens a Dialog to make a text annotation.
+ */
+function dialog_annotate() {
+ if(this.getAttributeOfSelectedNode('url') != '') {
+ window.openDialog("chrome://alcatraz/content/dialog_annotate.xul", "dialog_annotate", "chrome,dialog,resizable=no", "");
+ } else {
+ alert('No Annotation is selected!');
+ }
+}
+
function makePathCompatible(path){
if (navigator.platform=="Win32"){
@@ -40,7 +62,7 @@
.createInstance(nsIFilePicker);
fp.init(window, "Select a Directory", nsIFilePicker.modeGetFolder);
- // set default direcotry
+ // set default directory
var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
directory=makePathCompatible(directory);
aLocalFile.initWithPath(directory);
@@ -50,24 +72,27 @@
if (res==nsIFilePicker.returnOK){
directory=fp.fileURL.path;
directory=makePathCompatible(directory);
- setTreeDirectory();
+ this.setTreeDirectory();
}
}
function setTreeDirectory(){
- var t=document.getElementById("file_tree");
- t.setAttribute("datasources","file://"+directory+'test.rdf');
- //alert('datasource: '+ t.getAttribute("datasources"));
- //alert('Directory: file://'+directory+'/test.rdf');
+ this.rdfTree = new RDFTree(this.TREE_ID);
+ this.rdfTree.addDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
+}
+
+function setCreatorName() {
+
}
function refreshTree(){
- var t=document.getElementById("file_tree");
- t.builder.rebuild();
+ this.rdfTree = new RDFTree(this.TREE_ID);
+ this.rdfTree.rebuild();
}
function getAttributeOfSelectedNode(attribute) {
- var tree=document.getElementById("file_tree");
+ this.rdfTree = new RDFTree(this.TREE_ID);
+ var tree = this.rdfTree.tree;
try {
return tree.view.getCellText(tree.currentIndex,attribute);
} catch(e) {
@@ -75,79 +100,307 @@
}
}
-/*
-function createSequence(completeURN) {
- if(completeURN.indexOf(slash) != -1) {
- alert('Recursion: '+completeURN);
- //lowest sequence
- var seqNodeContainer = dataSource.getNode(completeURN.substring(0,completeURN.lastIndexOf(":")));
- seqNodeContainer.makeSeq();
- //lowest description
- var rootNodeContainer = dataSource.getNode(completeURN.substring(0,completeURN.lastIndexOf(":")));
- var fnTemp = completeURN.substring(0,completeURN.lastIndexOf(":"));
- rootNodeContainer.addTarget("http://echo.unibe.ch/digilib/rdf#fn",completeURN.substring(
- fnTemp.lastIndexOf(":")+1,completeURN.lastIndexOf(":")));
+function getURIOfSelectedNode() {
+ var url = this.getAttributeOfSelectedNode('url');
+ if(url != '') {
+ return id = this.BEGIN_OF_URI + ':' + url
+ + '|' + this.getAttributeOfSelectedNode('pagenumber')
+ + '|' + this.getAttributeOfSelectedNode('name');
+ }
+ return '';
+}
+
+/**
+ * Deletes the selected Annotation
+ */
+function deleteAnnotation() {
+ var name = this.getAttributeOfSelectedNode('name');
+ if(name != '') {
+ var isSure = window.confirm('Do you really want to delete the Annotations "'
+ + name + '?');
+ if(isSure) {
+ var dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
+ containerNode = dataSource.getNode(this.BEGIN_OF_URI);
+ var uri = this.getURIOfSelectedNode();
+ containerNode.removeChild(dataSource.getNode(uri));
+// alert(this.HEADER_URI+this.getURIOfSelectedNode());
+ //alert(uri);
+ dataSource.deleteRecursive(this.HEADER_URI+uri); // Delete the Header
+ dataSource.deleteRecursive(uri);
+ this.refreshTree();
+ dataSource.save();
+ }
+ }
+
+}
+
+/**
+ * Adds a Textannotation to an existing annotation.
+ */
+function addTextAnnotation(text) {
+ var id = this.getURIOfSelectedNode();
+ dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
+ var node = dataSource.getNode(id);
+ if(node.propertyExists('http://purl.org/dc/elements/1.0/title')) {
+ /** Do something */
+ } else { // Should never be reached
+ alert('AddTextAnnotation: No Annotation is selected!');
+ }
+ //alert(text);
+}
+
+function getCurrentDate() {
+ var now = new Date();
+ return date = ((now.getYear() < 999) ? (now.getYear()+1900) : now.getYear()) + '-'
+ +now.getDate() + '-' + now.getDay() + ', '
+ +now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + ' '
+ +(now.getTimezoneOffset()/60) + ':00 GMT';
+}
- completeURN = completeURN.replace(slash,':');
+/**
+ * Creates A Complex RDF entry and adds it to the base Container.
+ * @params String The urn of the new node without(!) title (so far).
+ * @todo isn't complex yet...
+ */
+function createComplexRDFEntry(inCompleteURN) {
+ var title = window.prompt("Please enter a title for this Annotation"
+ ,this.getAttributeOfSelectedNode('name'));
+ if(title != null) {
+ var completeURN = inCompleteURN+title;
+ var echoContainer = dataSource.getNode(BEGIN_OF_URI);
+ echoContainer.makeSeq();
+
+ echoContainer.addChild(completeURN);
+/* var node = dataSource.getNode(completeURN);
+ node.addTarget(ECHO + 'template','text_digilib');
+ node.addTarget(ECHO + 'echo','basic');
+ node.addTarget(ECHO + 'lv","1");
+ node.addTarget("http://purl.org/dc/elements/1.0/title",title);
+ node.addTarget("http://purl.org/dc/elements/1.0/creator","");
+ node.addTarget("http://purl.org/dc/elements/1.0/date","");
+ node.addTarget("http://www.w3.org/2000/10/annotation-ns#created","");
+ node.addTarget("http://www.w3.org/1999/02/22-rdf-syntax-ns#type",'Annotation');
+
+ var arrayParams=window.content.listParameters();
+
+ var s = '';
+ for (i=0; i< arrayParams.length; i++){
+ s += arrayParams[i] + ' ' + window.content.getParameter(arrayParams[i]) + '\n';
+ //var value=window.content.getParameter(arrayParams[i]);
+ //alert(arrayParams[i]+":"+value);
+ //node.addTarget(ECHO + '+arrayParams[i],value);
+ }
+ alert(s);
+
+ node.addTarget(ECHO + 'lv',"1");
+ node.addTarget("http://purl.org/dc/elements/1.0/title",title);
+ node.addTarget("http://purl.org/dc/elements/1.0/creator","");
+ node.addTarget("http://purl.org/dc/elements/1.0/date","");
+ node.addTarget("http://www.w3.org/2000/10/annotation-ns#created","");
+ //node.addTarget("http://www.w3.org/2000/10/annotation-ns#Annotation","targetof");
+ //var node2 = dataSource.getNode("targetof");
+ //node2.addTarget(ECHO + 'lv',"1");
+*/
+ var date = this.getCurrentDate();
+ var node = dataSource.getNode(this.HEADER_URI + completeURN);
+ var created = '';
+ /** @Todo Doesn't work correctly, if the selected one isn't the overwritten one! */
+ if(!node.propertyExists('http://purl.org/dc/elements/1.0/title')) {
+ created = date;
+ } else {
+ created = this.getAttributeOfSelectedNode('created');
+ }
+ var fn = window.content.getParameter('fn');
+ var pn = window.content.getParameter('pn');
+ var ws = window.content.getParameter('ws');
+ var mk = window.content.getParameter('mk');
+ var wx = window.content.getParameter('wx');
+ var wy = window.content.getParameter('wy');
+ var ww = window.content.getParameter('ww');
+ var wh = window.content.getParameter('wh');
+ var pt = window.content.getParameter('pt');
+
+ var brgt = window.content.getParameter('brgt');
+ var cont = window.content.getParameter('cont');
+ var rot = window.content.getParameter('rot');
+ var rgba = window.content.getParameter('rgba');
+ var rgbm = window.content.getParameter('rgbm');
+ var ddpix = window.content.getParameter('ddpix');
+ var ddpiy = window.content.getParameter('ddpiy');
+
+ var lv = 1; /** @todo get the parameter right */
+
+
+ var rdfHeader = '\n'
+ +'\n\n'
+ var rdfFooter = '\n';
- //next higher sequence
- var seqNode = dataSource.getNode(completeURN.substring(0,completeURN.lastIndexOf(":")));
- seqNode.makeSeq();
- //next higher description
- var rootNode = dataSource.getNode(completeURN.substring(0,completeURN.lastIndexOf(":")));
- fnTemp = completeURN.substring(0,completeURN.lastIndexOf(":"));
- rootNode.addTarget("http://echo.unibe.ch/digilib/rdf#fn",completeURN.substring(
- fnTemp.lastIndexOf(":")+1,completeURN.lastIndexOf(":")));
- seqNodeContainer.addChild(rootNode);
- alert('Recursion end: '+completeURN);
+ var rdf = rdfHeader;
+ if(true) { // annotation is basic
+ rdf += ' \n'
+ + ' \n'
+ + ' \n'
+ + ' \n' //echo -> RDF
+ + ' \n'
+ + ' ' + fn + '\n'
+ + ' ' + pn + '\n'
+ + ' ' + ws + '\n'
+ + ' ' + mk + '\n' // As there isn't a textmark yet, I only set mk
+ + ' ' + wx + '\n'
+ + ' ' + wy + '\n'
+ + ' ' + ww + '\n'
+ + ' ' + wh + '\n'
+ + ' ' + pt + '\n'
+ + ' ' + brgt + '\n'
+ + ' ' + cont + '\n'
+ + ' ' + rot + '\n'
+ + ' ' + rgba + '\n'
+ + ' ' + rgbm + '\n'
+ + ' ' + ddpix + '\n'
+ + ' ' + ddpiy + '\n'
+ + ' ' + lv + '\n'
+ + ' \n'
+ + ' ' + title + '\n'
+ + ' ' + creator + '\n'
+ + ' ' + date + '\n'
+ + ' \n'
+ + ' ' + created + '\n'
+ + ' \n';
+ } else { // annotation is complex /** @Todo The other components aren't correct yet*/
+
+ rdf +=' \n'
+ + ' \n'
+ + ' text_digilib\n' // are there other templates?
+ + ' \n'
+ + ' ' + title + '\n'
+ + ' ' + creator + '\n'
+ + ' ' + date + '\n'
+ + ' \n'
+ + ' ' + created + '\n';
+
+ rdf +=' \n'; //echo -> RDF
+ + ' \n'
+ + ' \n\n';
+ }
+
+ rdf += rdfFooter;
+ //alert(rdf);
+ var ds = new RDFDataSource();
+
+ //Remove the original to add the new one
+ dataSource.deleteRecursive(this.HEADER_URI+completeURN);
+ ds.parseFromString(rdf,'file://'+this.getProfileDirectory()+slash+'annotations.rdf');
+ ds.copyAllToDataSource(dataSource);
+
+/*******************************************************
+
+ var rdf =''
+ +''
- if(completeURN.lastIndexOf(slash) == -1) {
- alert('Recursion finished : '+completeURN);
- var node = dataSource.getNode(completeURN);
- 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");
- seqNode.addChild(node);
+ +' '
+ +' text_digilib'
+ +' ' //echo -> RDF
+ +' '
+ +' '
+ +' '
+ +' '
+ +' '
+ +' ' //echo -> RDF
+ +' '
+ +' histbot/botany'
+ +' 1'
+ +' 1.0'
+ +' '
+ +' '
+ +' '
+ +' '
+ +' '//echo -> RDF
+ +' '
+ +' Mark 1 shows the root of the Anthoxanthum odoratum <br /> there is a lot of textand textt and text and text and text'
+ +' '
+ +' Text Annotation of Mark1'
+ +' erwin.mueller@philo.unibe.ch'
+ +' 2003-07-11T19:13:52+01:00'
+ +' '
+ +' 2003-07-11T19:13:16+01:00'
+ +' '
+ +' '
+ +' 0.2626'
+ +' 0.8123'
+ +' 0.4747'
+ +' 0.1484'
+ +' 249'
+ +' 1'
+ +' '
+ +' Ruchgras'
+ +' daniel.engler@philo.unibe.ch'
+ +' 2003-05-11T16:42:52+01:00'
+ +' '
+ +' 2003-05-11T16:34:16+01:00'
+ +' '
+ +' ' // rdf:resource="echo00765"/>'
+ +' Complex Annotation Digilib and Text'
+ +' karl.gerber@germ.unibe.ch'
+ +' 2003-01-13T19:13:52+01:00'
+ +' '
+ +' 2003-01-13T19:13:16+01:00'
+ +' '
+ +'';
+ ds = new RDFDataSource();
+ ds.parseFromString(rdf,"http://echo.unibe.ch/digilib/rdf/digilib.rdf");
+ //alert('Beispiel einer komplexen Annotation:\n\n'+ds.serializeToString());
+***************************************************************/
+ }
+}
+
+/**
+ * Saves the open echo-site in the annotation.rdf-file without asking.
+ * @todo The about
has to be modified if the URN's are changing!
+ */
+function quickSave() {
+ var about='';
+ try {
+ var identify;
+ try {
+ identify = (typeof(window.content.identify()) != 'undefined')
+ ? window.content.identify() : false;
+ } catch(e) {
+ identify = false;
}
- this.createSequence(completeURN);
+ about = window.content.getParameter('fn');
+ about += '|' + window.content.getParameter('pn') + '|';
+ } catch (e){
+ about = '';
+ }
+ if (about != ''){
+ //alert('Creator: '+this.creator);
+ while(this.creator == 'unknown' || this.creator == '') {
+ this.creator = window.prompt("Please enter a username:",this.creator);
+ }
+ this.setProfile();
+
+ //URN isn't complete yet!
+ var urn = BEGIN_OF_URI + ':' + about;
+ //alert('Documentpath: '+documentpath);
+
+ dataSource = new RDFDataSource('file://'+this.getProfileDirectory()+slash+'annotations.rdf');
+
+ this.createComplexRDFEntry(urn);
+ dataSource.save();
+ refreshTree();
+ } else{
+ alert("Error: no alcatraz component. can't create an annotation.");
}
}
-*/
-/**
- * @todo isn't complex yet...
- */
-function createComplexRDFEntry(completeURN) {
- var title = window.prompt("Please enter a title for this Annotation",this.getAttributeOfSelectedNode('name'));
- alert('Title: '+title);
- var echoContainer = dataSource.getNode("urn:echo");
- echoContainer.makeSeq();
-
- echoContainer.addChild(completeURN);
- var node = dataSource.getNode(completeURN);
- 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");
- node.addTarget("http://purl.org/dc/elements/1.0/title",title);
- node.addTarget("http://purl.org/dc/elements/1.0/creator","");
- node.addTarget("http://purl.org/dc/elements/1.0/date","");
- node.addTarget("http://www.w3.org/2000/10/annotation-ns#created","");
- node.addTarget("http://www.w3.org/2000/10/annotation-ns#Annotation","targetof");
- var node2 = dataSource.getNode("targetof");
- node2.addTarget("http://echo.unibe.ch/digilib/rdf#lv","1");
- /*ar subNode = dataSource.getNode('specialised');
- node.addChild(subNode,true);*/
-}
-
-function file_save(){
+/** @todo Allow the users to save their RDF-Files anywhere.
+function saveAs(){
// get Digilib-Parameter form Browser
//alert(window.content.location.href);
@@ -162,44 +415,14 @@
if (documentpath != ''){
//documentpath=documentpath.replace(slash,':');
//alert(documentpath);
- var docPath='urn:echo:'+documentpath;
+ var docPath = BEGIN_OF_URI + ':' + documentpath;
var t=document.getElementById("file_tree");
- dataSource = new RDFDataSource(t.getAttribute("datasources"));
+ dataSource = new RDFDataSource();
this.createComplexRDFEntry(docPath);
-/* //Create new Node
- var node = dataSource.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");
- //Add the node to the Seq
- var seqNode = dataSource.getNode(docPath.substring(0,docPath.lastIndexOf(":")));
- if(seqNode.isContainer()) {
- seqNode.addChild(node);
- } else {
- seqNode.makeSeq();
- seqNode.addChild(node);
- }
-*/
- dataSource.save();
- refreshTree();
-/*
- 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());
+ //dataSource.save();
+ //refreshTree();
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"]
.createInstance(nsIFilePicker);
@@ -232,16 +455,16 @@
//alert(boolFileExists);
f.create();
f.open('w');
- f.write(ds.serializeToString());
+ f.write(dataSource.serializeToString());
f.close();
refreshTree();
}
-//*/
+
} else{
alert("Error: no alcatraz component. can't create an annotation.");
}
}
-
+//*/
function file_local(){
// noch nicht programmiert
@@ -254,25 +477,11 @@
}
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\n'
+ +''
+ +'\n');
+ file.close();
}
function traverse(node){
@@ -425,15 +683,3 @@
var t=document.getElementById("file_tree");
traverse(t);
}
-
-
-/* @beat: ich habe mich erfrecht, diese billige methode in dein
- javascript zu verschieben, weil ich eigentlich jetzt zu
- dir gehoert und nicht mehr in ein alcatraz.js (das gar
- nicht mehr existiert). alcatraz.xul ist nur noch ein
- container fuer andere xul-files und hat deshalb auch
- keine eigenen funktionialitaeten mehr - christian
-*/
-function dialog_annotate() {
- window.openDialog("chrome://alcatraz/content/dialog_annotate.xul", "dialog_annotate", "chrome,dialog,resizable=no", "");
-}
diff -r f1631db2ff3d -r 8e4724b71b67 xul/content/annota.xul
--- a/xul/content/annota.xul Thu Mar 25 11:56:08 2004 +0100
+++ b/xul/content/annota.xul Thu Mar 25 17:45:31 2004 +0100
@@ -2,21 +2,26 @@
-
+
+
+
-
+
@@ -26,6 +31,7 @@
+
@@ -37,29 +43,32 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff -r f1631db2ff3d -r 8e4724b71b67 xul/content/dialog_annotate.js
--- a/xul/content/dialog_annotate.js Thu Mar 25 11:56:08 2004 +0100
+++ b/xul/content/dialog_annotate.js Thu Mar 25 17:45:31 2004 +0100
@@ -1,37 +1,36 @@
-/*
-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.4
-*/
-
-function accept() {
-
- var text = document.getElementById('annotation_value').value;
-
- opener.content.annotation(text);
-
- return true;
-
-}
-
-
-function cancel() {
-
- // 'true' says closing the window
- return true;
-
-}
\ No newline at end of file
+/*
+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.4
+Author: Beat Halter, 18.03.2004, Version Alcatraz ...
+*/
+
+function accept() {
+ var text = document.getElementById('annotation_value').value;
+ addTextAnnotation(text);
+ //opener.content.annotation(text);
+ return true;
+
+}
+
+
+function cancel() {
+
+ // 'true' says closing the window
+ return true;
+
+}