changeset 223:41de43a00bf8

new relato import
author luginbue
date Fri, 09 Jul 2004 01:55:31 +0200
parents dc38bdeb58d7
children b51840f2ff75
files client/digitallibrary/relato/astro.xml client/digitallibrary/relato/compare.xml client/digitallibrary/relato/digicat-digilib.xml client/digitallibrary/relato/digilib-digilib.xml client/digitallibrary/relato/neugebauer.xml client/digitallibrary/relato/picture.xml client/digitallibrary/relato/relato.js client/digitallibrary/relato/relato.xsl client/digitallibrary/relato/type.xml client/digitallibrary/relato/work.xml
diffstat 10 files changed, 335 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/relato/astro.xml	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/astro.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -74,4 +74,8 @@
     <button name="e-publications" command="navigation.publications()" />
   </buttons>
 
+  <protected>
+    <frame name="navigation" />
+  </protected>
+
 </relato>
--- a/client/digitallibrary/relato/compare.xml	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/compare.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -10,7 +10,7 @@
         <frame name="mainFrameLeft" />
         <frame name="mainFrameRight" />
       </frameset>
-      <frameset cols="12%,40%,48%" border="0" frameborder="0" framespacing="0">
+      <frameset cols="16%,38%,46%" border="0" frameborder="0" framespacing="0">
         <frame name="motiv" />
         <frame name="kriterium" />
         <frame name="krittext" />
@@ -84,7 +84,20 @@
     <button name="home" command="navigation.home()" />
     <button name="relation" command="navigation.relation()" />
     <button name="description" command="navigation.description()" />
+    <!--
     <button name="new window" command="navigation.newwindow()" />
+    -->
   </buttons>
 
+  <protected>
+    <frame name="navigation" />
+    <frame name="title" />
+    <frame name="motiv" />
+    <frame name="kriterium" />
+    <frame name="krittext" />
+  </protected>
+
+  <default>
+  </default>
+
 </relato>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/relato/digicat-digilib.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<relato>
+
+  <frames>
+    <frameset cols="0,256,*" border="1" frameborder="1" framespacing="0">
+      <frame name="navigation" src="http://pythia2.unibe.ch:8080/docuserver/digitallibrary/contexto/contexto.jsp?htmlURL=http://www.philoscience.unibe.ch/docuserver/echo/projekte/neugebauer/navigation.html" />
+      <frame name="digicat" />
+      <frame name="mainFrame" />
+      <noframes>
+        In order to use <i>relato</i> you need to have a frame capable browser.
+      </noframes>
+    </frameset>
+  </frames>
+  
+  <functions>
+    <function name="getParameter" quiet="true">
+      <validInFrame name="digicat" />
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="listParameters" quiet="true">
+      <validInFrame name="digicat" />
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="listParametersAsString" quiet="true">
+      <validInFrame name="digicat" />
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="page">
+      <validInFrame name="digicat" />
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="zoomPoint">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="zoomArea">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="mark">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="ref">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="zoomOut">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="zoomExtends">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="moveTo">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="scale">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="brightnessContrast">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="mirror">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="rotation">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="colors">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="pixelByPixel">
+      <validInFrame name="mainFrame" />
+    </function>
+    <function name="originalSize">
+      <validInFrame name="mainFrame" />
+    </function>
+  </functions>
+
+  <protected>
+    <frame name="digicat" />
+  </protected>
+
+  <default>
+    <frame name="mainFrame" />
+  </default>
+
+</relato>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/relato/digilib-digilib.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<relato>
+
+  <frames>
+    <frameset cols="50%,50%" border="1" frameborder="1" framespacing="0">
+      <frame name="mainFrameLeft" />
+      <frame name="mainFrameRight" />
+      <noframes>
+        In order to use <i>relato</i> you need to have a frame capable browser.
+      </noframes>
+    </frameset>
+  </frames>
+  
+  <functions>
+    <function name="getParameter" quiet="true">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="listParameters" quiet="true">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="listParametersAsString" quiet="true">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="page">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="zoomPoint">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="zoomArea">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="mark">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="ref">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="zoomOut">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="zoomExtends">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="moveTo">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="scale">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="brightnessContrast">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="mirror">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="rotation">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="colors">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="pixelByPixel">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+    <function name="originalSize">
+      <validInFrame name="mainFrameLeft" />
+      <validInFrame name="mainFrameRight" />
+    </function>
+  </functions>
+
+  <protected>
+  </protected>
+
+  <default>
+    <frame name="mainFrameRight" />
+  </default>
+
+</relato>
--- a/client/digitallibrary/relato/neugebauer.xml	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/neugebauer.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -74,4 +74,12 @@
     <button name="database" command="navigation.database()" />
   </buttons>
 
+  <protected>
+    <frame name="navigation" />
+  </protected>
+
+  <default>
+    <frame name="mainFrame" />
+  </default>
+
 </relato>
--- a/client/digitallibrary/relato/picture.xml	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/picture.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -73,6 +73,18 @@
     <button name="work" command="navigation.work()" />
     <button name="type" command="navigation.type()" />
     <button name="relation" command="navigation.relation()" />
+    <!--<button name="new window" command="navigation.newwindow()" />-->
   </buttons>
 
+  <protected>
+    <frame name="navigation" />
+    <frame name="picturelabel" />
+    <frame name="title" />
+    <frame name="text" />
+  </protected>
+
+  <default>
+    <frame name="mainFrame" />
+  </default>
+
 </relato>
--- a/client/digitallibrary/relato/relato.js	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/relato.js	Fri Jul 09 01:55:31 2004 +0200
@@ -1,10 +1,10 @@
-top.name = 'f'
+top.name = 'f';
 
 if ( !top.focused )
-  top.focused = '';
+  top.focused = new Object();
 
 
-function identity() {
+function identify() {
   return 'Relato v0.1';
 }
 
@@ -14,6 +14,19 @@
 }
 
 
+function frameSelectable(name) {
+  // created by xls
+  var frames = protectedFrames();
+  var selectable = true;
+  for (var i=0; i<frames.length; i++) {
+    if (frames[i] == name) {
+      selectable = false;
+    }
+  }
+  return selectable;
+}
+
+
 function noFrameSelected() {
   alert( "No frame activated at the moment - click on the desired frame to activate it!" );
 }
@@ -29,32 +42,6 @@
 }
 
 
-function hex_color(dec) {
-  var hex = "#";
-  for (i = 6; i > 0; i--) {
-    var pow = Math.pow(16, i);
-    if (pow < dec) {
-      val = parseInt(dec / pow);
-      dec -= val*pow;
-      if (val > 9) {
-        switch (val) {
-          case (10): hex += 'A'; break;
-          case (11): hex += 'B'; break;
-          case (12): hex += 'C'; break;
-          case (13): hex += 'D'; break;
-          case (14): hex += 'E'; break;
-          case (15): hex += 'F'; break;
-        }
-      } else {
-        hex += val;
-      }
-    } else {
-      hex += "0";
-    }
-  } 
-  return hex;
-}
-
 function init() {
   // do the initialisation just if it is top-level relato
   if ( top == window ) {
@@ -71,25 +58,59 @@
       if (!current.frames[i].name) {
         current.frames[i].name = name + i;
       }
-      current.frames[i].addEventListener( 'click', focusListener, true );
+      if (frameSelectable(current.frames[i].name)) {
+        current.frames[i].addEventListener( 'click', focusListener, true );
+        if (current.frames[i].name == nameOfSelectedFrame()) {
+          top.focused = current.frames[i];
+        }
+      } else {
+        if (current.frames[i] == selectedFrameObject()) {
+          top.focused = '';
+        }
+      } 
       current.frames[i].addEventListener( 'unload', unloadListener, true );
-      if (current.frames[i] == selectedFrameObject()) {
-//        var color = current.frames[i].document.bgColor;
-//        if (color.match(/#\d{6}/)) { 
-//          color = parseInt('0x' + color.slice(1)) - parseInt('0x222222');
-//          if (color < 0) {
-//            color = 0;
-//          }
-//          current.frames[i].document.bgColor = hex_color(color);
-//        }
-        current.frames[i].document.bgColor = '#444444';
-      }
       init_rec( current.frames[i], current.frames[i].name );
     }
   }    
 }
 
 
+function listFrames() {
+
+  var frames = new Array();
+
+  function listFrames_rec( current )  {
+
+    if (current.frames.length > 0) {
+      for (var i=0; i < current.frames.length; i++) {
+        listFrames_rec(current.frames[i]);
+      }
+    } else {
+      frames.push(current);
+    }
+  }
+
+  listFrames_rec(top);
+
+  return frames;
+
+}
+
+
+function getXML() {
+  query_string = location.search;
+  query_string.search(/xml=([^\&]*)\&/);
+  return RegExp.$1;
+} 
+
+
+function blink() {
+  orig_color = top.focused.document.bgColor;
+  top.focused.document.bgColor="black";
+  setTimeout('top.focused.document.bgColor="' + orig_color + '"', 100);
+}
+
+
 function focusListener( event ) {
 
   var active = this;
@@ -98,10 +119,13 @@
     active = this.parent;
   }
 
-  markActiveFrame_rec( top, active );
+  // can be used in future to mark several frames 
+  // markActiveFrame_rec( top, active );
 
   top.focused = active;
 
+  blink();
+
   // just debug information
   window.status = top.focused.name;
 }
@@ -111,6 +135,7 @@
   setTimeout('init()', 250);
 }
 
+
 function markActiveFrame_rec(current, active) {
   
   if ( current.frames.length > 0 ) {
@@ -119,14 +144,6 @@
     }
   } else {
     if ( current.name.indexOf(active.name) == 0 ) {
-//      var color = current.document.bgColor;
-//      if (color.match(/#\d{6}/)) {
-//        color = parseInt('0x' + color.slice(1)) - parseInt('0x222222');
-//        if (color < 0) {
-//          color = 0;
-//        }
-//        current.document.bgColor = hex_color(color);
-//      }
       current.document.bgColor = '#444444';
     } else {
       current.document.bgColor = '#666666';
--- a/client/digitallibrary/relato/relato.xsl	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/relato.xsl	Fri Jul 09 01:55:31 2004 +0200
@@ -8,11 +8,17 @@
   <xsl:template match="relato">
     <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
+        <script type="text/javascript" src="relato/relato.js">
+        // this comment has to be here, otherwise xerces translates this
+        // empty tag to a self-closing one, which is bad for HTML that
+        // needs a closing script-tag
+        </script>
         <script type="text/javascript">
           <xsl:apply-templates select="functions" />
           <xsl:apply-templates select="buttons" />
+          <xsl:apply-templates select="protected" />
+          <xsl:apply-templates select="default" />
         </script>
-        <script type="text/javascript" src="relato/relato.js"></script>
       </head>
       <xsl:apply-templates select="frames" />
     </html>
@@ -29,7 +35,9 @@
           <xsl:for-each select="validInFrame">
             if (nameOfSelectedFrame() == "<xsl:value-of select="@name" />") {
               id = selectedFrameObject();
-              return id.<xsl:value-of select="../@name" />(<xsl:value-of select="../@name" />.arguments[0], <xsl:value-of select="../@name" />.arguments[1], <xsl:value-of select="../@name" />.arguments[2], <xsl:value-of select="../@name" />.arguments[3]);
+              if (typeof(id.<xsl:value-of select="../@name" />) == 'function') {
+                return id.<xsl:value-of select="../@name" />(<xsl:value-of select="../@name" />.arguments[0], <xsl:value-of select="../@name" />.arguments[1], <xsl:value-of select="../@name" />.arguments[2], <xsl:value-of select="../@name" />.arguments[3]);
+              }
             }
           </xsl:for-each>
         } else {
@@ -57,4 +65,17 @@
     }
   </xsl:template>
 
+  <xsl:template match="protected">
+    function protectedFrames() {
+      var frames = new Array ();
+      <xsl:for-each select="frame">
+      frames.push('<xsl:value-of select="@name" />');</xsl:for-each>
+      return frames;
+    }
+  </xsl:template>
+
+  <xsl:template match="default">
+    top.focused.name = '<xsl:value-of select="frame/@name" />';
+  </xsl:template>
+
 </xsl:stylesheet>
--- a/client/digitallibrary/relato/type.xml	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/type.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -70,4 +70,14 @@
     <button name="relation" command="navigation.relation()" />
   </buttons>
 
+  <protected>
+    <frame name="navigation" />
+    <frame name="links" />
+    <frame name="text" />
+  </protected>
+
+  <default>
+    <frame name="mainFrame" />
+  </default>
+
 </relato>
--- a/client/digitallibrary/relato/work.xml	Fri Jul 09 01:55:31 2004 +0200
+++ b/client/digitallibrary/relato/work.xml	Fri Jul 09 01:55:31 2004 +0200
@@ -70,8 +70,23 @@
 
   <buttons>
     <button name="home" command="navigation.home()" />
+    <!--
     <button name="description" command="navigation.description()" />
+    -->
+    <!--
     <button name="new window" command="navigation.newwindow()" />
+    -->
   </buttons>
 
+  <protected>
+    <frame name="navigation" />
+    <frame name="links" />
+    <frame name="title" />
+    <frame name="text" />
+  </protected>
+
+  <default>
+    <frame name="mainFrame" />
+  </default>
+
 </relato>