[Yanel-commits] rev 40794 - public/yanel/contributions/resources/xinha/htdocs

simon at wyona.com simon at wyona.com
Thu Jan 8 00:57:40 CET 2009


Author: simon
Date: 2009-01-08 00:57:40 +0100 (Thu, 08 Jan 2009)
New Revision: 40794

Modified:
   public/yanel/contributions/resources/xinha/htdocs/xinha.jelly
Log:
improved integration of xinha

Modified: public/yanel/contributions/resources/xinha/htdocs/xinha.jelly
===================================================================
--- public/yanel/contributions/resources/xinha/htdocs/xinha.jelly	2009-01-07 23:53:47 UTC (rev 40793)
+++ public/yanel/contributions/resources/xinha/htdocs/xinha.jelly	2009-01-07 23:57:40 UTC (rev 40794)
@@ -5,32 +5,42 @@
       <title>Edit ${resource.getEditPath()} with Xinha</title>
       <link rel="stylesheet" type="text/css" href="${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::xinha/css/xinha-resource.css"/>
       <script language="javascript" type="text/javascript" src="${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::xinha/xinha/jscripts/xinha/xinha.js"></script>
-      <script language="javascript" type="text/javascript" src="${yanel.back2realm}usecases/xinhainit.js"></script>
       
-      
       <script type="text/javascript">
         _editor_url  = "${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::xinha/xinha/"  // (preferably absolute) URL (including trailing slash) where Xinha is installed
-        _editor_lang = "en";      // And the language we need to use in the editor.
+        _editor_lang = "${resource.getRequestedLanguage()}";      // And the language we need to use in the editor.
         _editor_skin = "silva";   // If you want use a skin, add the name (of the folder) here
       </script>
       <script type="text/javascript" src="${yanel.back2realm}${yanel.reservedPrefix}/resource-types/http://www.wyona.org/yanel/resource/1.0::xinha/xinha/XinhaCore.js"></script>
+      <script type="text/javascript">
+        var editeur = null;
+        function initXinha() {
+         var config = new Xinha.Config();
+         //following would be nice, but unsave since there is no convention on css location and nothing that knows about except the xsl.;
+         //but one could use this in a customized xinha.jelly
+         //config.pageStyleSheets = ["${yanel.back2realm}css/global.css"];
+         config.fullPage = false;
+         
+         editeur = Xinha.makeEditors(['${resource.getEditPath()}'], config);
+         Xinha.startEditors(editeur);
+        }
+        window.onload = initXinha;
+      </script>
     </head>
     <body>
       <p class="yanel-usecase-error">${resource.getErrorMessages()}</p>
       <p>${resource.getInfoMessages()}</p>
       <j:choose>
         <j:when test="${resource.getEditPath() != null &amp;&amp; !resource.getEditPath().equals('')}">
-          <div class="xinha">
-            <form method="post" action="">
-              <input type="hidden" name="edit-path" value="${resource.getEditPath()}"/>
-              <textarea id="${resource.getEditPath()}" name="${resource.getEditPath()}" rows="15" cols="80" style="width: 100%">
-                ${resource.getEditorFormContent()}
-              </textarea>
-              <br />
-              <input type="submit" id="submit" name="submit" value="Save" />
-              <input type="submit" id="submit" name="cancel" value="Cancel" />
-            </form>
-          </div>
+          <form method="post" action="">
+            <input type="hidden" name="edit-path" value="${resource.getEditPath()}"/>
+            <textarea id="${resource.getEditPath()}" name="${resource.getEditPath()}" rows="15" cols="80" style="width: 100%">
+              ${resource.getEditorFormContent()}
+            </textarea>
+            <br />
+            <input type="submit" id="submit" name="submit" value="Save" />
+            <input type="submit" id="submit" name="cancel" value="Cancel" />
+          </form>
         </j:when>
         <j:otherwise>
           ${resource.getLookup()}



More information about the Yanel-commits mailing list