You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ch...@apache.org on 2006/12/06 00:17:16 UTC

svn commit: r482824 - in /lenya/trunk/src/modules/tinymce: config/cocoon-xconf/ resources/javascript/ resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/ usecases/ xslt/

Author: chestnut
Date: Tue Dec  5 15:17:15 2006
New Revision: 482824

URL: http://svn.apache.org/viewvc?view=rev&rev=482824
Log:
links should utilize uuids now

Added:
    lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf   (with props)
    lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf   (with props)
Removed:
    lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-tinymce-insertAsset.xconf
    lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-tinymce-insertImage.xconf
Modified:
    lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js
    lenya/trunk/src/modules/tinymce/resources/javascript/insertLink.js
    lenya/trunk/src/modules/tinymce/resources/javascript/tiny_config.js
    lenya/trunk/src/modules/tinymce/resources/javascript/tiny_lenya_glue.js
    lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin_src.js
    lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx
    lenya/trunk/src/modules/tinymce/xslt/link.xsl

Added: lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf?view=auto&rev=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf (added)
+++ lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf Tue Dec  5 15:17:15 2006
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+    This file defines the publication specific use-cases
+-->
+
+  <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'tinymce.insertAsset']">
+
+    <component-instance name="tinymce.insertAsset" logger="lenya.publication"
+      class="org.apache.lenya.cms.editors.InsertAsset">
+      <view template="modules/tinymce/usecases/insertAsset.jx" menu="false">
+        <parameter name="callbackFunction" value="insertAsset"/>
+      </view>
+      <parameter name="asset-usecase" value="tab.assets"/>
+      <exit usecase="tinymce.insertAsset"/>
+    </component-instance>
+    
+  </xconf>

Propchange: lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Added: lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf?view=auto&rev=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf (added)
+++ lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf Tue Dec  5 15:17:15 2006
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+    This file defines the publication specific use-cases
+-->
+
+  <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'tinymce.insertImage']">
+
+    <component-instance name="tinymce.insertImage" logger="lenya.publication"
+      class="org.apache.lenya.cms.editors.InsertAsset">
+      <view template="modules/tinymce/usecases/insertAsset.jx" menu="false">
+        <parameter name="callbackFunction" value="insertImage"/>
+      </view>
+      <parameter name="mimeTypePrefix" value="image/"/>
+      <parameter name="asset-usecase" value="tab.assets"/>
+      <exit usecase="tinymce.insertImage"/>
+    </component-instance>
+    
+  </xconf>

Propchange: lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js Tue Dec  5 15:17:15 2006
@@ -1,57 +1,32 @@
-/*
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/
-
-   function insertAsset(editorInstanceID) {
-      var src = document.forms['asset'].assetName.value;
-      var title = document.forms['asset'].caption.value;
-      var type = document.forms['asset'].type.value;
-      var size = document.forms['asset'].assetSize.value;
-      var content = '<asset xmlns="http://apache.org/cocoon/lenya/page-envelope/1.0" '
-          + 'src="' + src
-          + '" size="' + size 
-          + '" type="' + type
-          + '">' + title + '</asset>';
-      window.opener.insertCallback(content, editorInstanceID);
-   }
+   ext = '';
    
-   function insertImage(editorInstanceID) { 
-      // var link = document.forms['asset'].link.value;
+   function insertAsset(nodeid) {
+      var src = document.forms['image'].assetName.value;
+      var title = document.forms['image'].caption.value;
+      var type = document.forms['image'].type.value;
+      var size = document.forms['image'].assetSize.value;
+      window.top.opener.TinyMCE_SimpleBrowserPlugin.browserCallback(src) ;
+	  window.top.close() ;
+    }
+   
+   function insertImage(nodeid) { 
+      // var link = document.forms['image'].link.value;
       var link = '';
-      var src = document.forms['asset'].assetName.value;
-      var title = document.forms['asset'].caption.value;
-      var type = document.forms['asset'].type.value;
-      var height = document.forms['asset'].height.value;
-      var width = document.forms['asset'].width.value;
-      var content = '<object xmlns="http://www.w3.org/1999/xhtml" '
-          + 'href="' + link
-          + '" title="' + title
-          + '" type="' + type
-          + '" data="' + src
-          + '" height="' + height
-          + '" width="' + width
-          + '">' + src + '</object>'; 
-      window.opener.insertCallback(content, editorInstanceID); 
+      var src = document.forms['image'].assetName.value;
+      var title = document.forms['image'].caption.value;
+      var type = document.forms['image'].type.value;
+      var height = document.forms['image'].height.value;
+      var width = document.forms['image'].width.value;
+      var content = '<object xmlns="'+window.opener.XHTMLNS+'" href="'+link+'" title="'+title+'" type="'+type+'" data="'+src+'" height="'+height+'" width="'+width+'">'+src+'</object>'; 
+      window.top.opener.TinyMCE_SimpleBrowserPlugin.browserCallback(src) ;
+	  window.top.close() ;
    }
 
    function insertCaption(name, caption, type, size) { 
-     document.forms['asset'].assetName.value = name;
-     document.forms['asset'].caption.value = caption;
-     document.forms['asset'].type.value = type;
-     document.forms['asset'].assetSize.value = size;
+     document.forms['image'].assetName.value = name;
+     document.forms['image'].caption.value = caption;
+     document.forms['image'].type.value = type;
+     document.forms['image'].assetSize.value = size;
      focus(); 
    } 
 
@@ -60,39 +35,25 @@
      if (width != 0) {
        ratio = height / width;
      }
-     document.forms['asset'].assetName.value = name;
-     document.forms['asset'].caption.value = caption;
-     document.forms['asset'].type.value = type;
-     document.forms['asset'].assetSize.value = size;
-     document.forms['asset'].height.value = height;
-     document.forms['asset'].width.value = width;
-     document.forms['asset'].ratio.value = ratio;
+     document.forms['image'].assetName.value = name;
+     document.forms['image'].caption.value = caption;
+     document.forms['image'].type.value = type;
+     document.forms['image'].assetSize.value = size;
+     document.forms['image'].height.value = height;
+     document.forms['image'].width.value = width;
+     document.forms['image'].ratio.value = ratio;
      focus(); 
    } 
 
-   // just for debugging:
-   function printFormData() {
-     alert(
-         'assetName = ' + document.forms['asset'].assetName.value + '\n'
-       + 'caption   = ' + document.forms['asset'].caption.value + '\n'
-       + 'type      = ' + document.forms['asset'].type.value + '\n'
-       + 'assetSize = ' + document.forms['asset'].assetSize.value + '\n'
-// FIXME: the whole function will fail if these are not present:
-//       + 'height    = ' + document.forms['asset'].height.value + '\n'
-//       + 'width     = ' + document.forms['asset'].width.value + '\n'
-//       + 'ratio     = ' + document.forms['asset'].ratio.value + '\n'
-     )
-   }
-
    function scaleHeight(width) {
-     var ratio = document.forms['asset'].ratio.value;
-     document.forms['asset'].height.value = width * ratio;
+     var ratio = document.forms['image'].ratio.value;
+     document.forms['image'].height.value = width * ratio;
      focus(); 
    } 
   
    function scaleWidth(height) {
-     var ratio = document.forms['asset'].ratio.value;
-     document.forms['asset'].width.value = height * ratio;
+     var ratio = document.forms['image'].ratio.value;
+     document.forms['image'].width.value = height * ratio;
      focus(); 
    } 
-  
+  
\ No newline at end of file

Modified: lenya/trunk/src/modules/tinymce/resources/javascript/insertLink.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/resources/javascript/insertLink.js?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/javascript/insertLink.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/javascript/insertLink.js Tue Dec  5 15:17:15 2006
@@ -1,21 +1,5 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
 function insertLink() { 
+    var text = document.forms["link"].text.value;
     var title = document.forms["link"].title.value;
     var prefix = '/' + PUBLICATION_ID + '/' + AREA;
     var url = document.forms["link"].url.value;
@@ -23,13 +7,22 @@
      // prepend hostname etc for internal links
      url = prefix + url;
     }
-  	window.top.opener.TinyMCE_SimpleBrowserPlugin.browserCallback(escape(url)) ;
+    var content = '<a xmlns="'+window.opener.XHTMLNS+'" href="'+url+'" title="'+title+'">'+text+'</a>'; 
+    window.top.opener.TinyMCE_SimpleBrowserPlugin.browserCallback(url) ;
 	window.top.close() ;
 }
 
-function setLink(src) { 
-    url = src;
-    document.forms["link"].url.value = url;
+function setLink(uuid) {
+    var language = CHOSEN_LANGUAGE;
+    document.forms["link"].url.value = "lenya-document:" + uuid + ",lang=" + language;
+}
+
+function insertText() { 
+    var selectionContent = window.opener.getSelection().getEditableRange().toString(); 
+    if (selectionContent.length != 0) { 
+        document.forms["link"].text.value = selectionContent;
+    } 
+    focus(); 
 }
 
 function LinkTree(doc, treeElement) {
@@ -41,7 +34,7 @@
 LinkTree.prototype = new NavTree;
 
 LinkTree.prototype.handleItemClick = function(item, event) {
-    setLink(item.href);
+    setLink(item.uuid);
 }
 
 function buildTree() {
@@ -51,3 +44,6 @@
     tree.render();
     tree.loadInitialTree(AREA, DOCUMENT_ID);
 }
+
+var url;
+window.onload = insertText

Modified: lenya/trunk/src/modules/tinymce/resources/javascript/tiny_config.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/resources/javascript/tiny_config.js?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/javascript/tiny_config.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/javascript/tiny_config.js Tue Dec  5 15:17:15 2006
@@ -26,7 +26,7 @@
        plugin_simplebrowser_height : '600', //default
        
        plugin_simplebrowser_browselinkurl : currentURL + '?lenya.module=tinymce&lenya.step=link-show&language=en',
-       plugin_simplebrowser_browseimageurl : '',
+       plugin_simplebrowser_browseimageurl : currentURL + '?lenya.usecase=tinymce.insertAsset',
        plugin_simplebrowser_browseflashurl : '',
      
 

Modified: lenya/trunk/src/modules/tinymce/resources/javascript/tiny_lenya_glue.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/resources/javascript/tiny_lenya_glue.js?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/javascript/tiny_lenya_glue.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/javascript/tiny_lenya_glue.js Tue Dec  5 15:17:15 2006
@@ -15,125 +15,12 @@
   limitations under the License.
 */
 
+
 function LenyaExecCommandHandler(editor_id, elm, command, user_interface, value) {
 var linkElm, imageElm, inst;
 
-  switch (command) {
-
-    case "mceLink":
-
-      inst = tinyMCE.getInstanceById(editor_id);
-      linkElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "a");
-      if (linkElm) {
-        alert("Link dialog has been overriden. Found link href: " + tinyMCE.getAttrib(linkElm, "href"));
-      } else {
-        var newwindow = '';
-        IUurl = '?lenya.module=tinymce&amp;lenya.step=link-show&amp;language=en';
-        newwindow = self.open(decodeURLWithAmp(IUurl),'hello','location=1,resizable=1,height=600,width=500,scrollbars=1'); 
-      }
-      return true;
 /*
-      var inst = tinyMCE.getInstanceById(editor_id);
-      var doc = inst.getDoc();
-      var selectedText = "";
-  
-      if (tinyMCE.isMSIE) {
-              var rng = doc.selection.createRange();
-              selectedText = rng.text;
-      } else
-              selectedText = inst.getSel().toString();
-  
-      if (!tinyMCE.linkElement) {
-              if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
-                      return true;
-      }
-  
-      var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
-  
-      if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
-              tinyMCE.linkElement = tinyMCE.selectedElement;
-  
-      // Is anchor not a link
-      if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
-              tinyMCE.linkElement = null;
-  
-      if (tinyMCE.linkElement) {
-              href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
-              target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
-              title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
-              onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
-              style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
-  
-              // Try old onclick to if copy/pasted content
-              if (onclick == "")
-                      onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
-  
-              onclick = tinyMCE.cleanupEventStr(onclick);
-  
-              href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
-  
-              // Use mce_href if defined
-              mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
-              if (mceRealHref != "") {
-                      href = mceRealHref;
-  
-                      if (tinyMCE.getParam('convert_urls'))
-                              href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
-              }
-  
-              action = "update";
-      }
-  
-      var template = new Array();
-  
-      template['file'] = 'link.htm';
-      template['width'] = 310;
-      template['height'] = 200;
-  
-      // Language specific width and height addons
-      template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);
-      template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);
-  
-      if (inst.settings['insertlink_callback']) {
-              var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");
-              if (returnVal && returnVal['href'])
-                      TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);
-      } else {
-              tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});
-      }
-  
-      return true;
-*/
-
-    case "mceImage":
-
-      inst = tinyMCE.getInstanceById(editor_id);
-      imageElm = tinyMCE.getParentElement(inst.selection.getFocusElement(), "img");
-      // is the currently selected element an image?
-      if (imageElm) {
-        // yes. the user wants to edit it. return false to pass 
-        // control back to the standard tinymce image dialog.
-        return false;
-      } else {
-        // no. open a lenya insertAsset dialog.
-        alert("mceImage callback invoked.");
-        imageDialog = window.open(
-            "?lenya.usecase=tinymce.insertImage" +
-            "&editors.instance=" + encodeURI(editor_id),
-            "tinymce_insertImage",
-            "dependent=yes," +
-            "height=700," + 
-            "width=580," + 
-            "top=100," + 
-            "width=100," +
-            "location=yes," + 
-            "menubar=yes," +
-            "resizable=yes," + 
-            "scrollbars=yes"
-    
-        );
-      }
-      return true;
+  switch (command) {
 
     case "mceSave":
       
@@ -141,9 +28,11 @@
       return true;
       
   }
+*/
   return false; // Pass to next handler in chain
 }
 
+
 // this function will be called by the generic insertAsset
 // usecase.
 function insertCallback(content, editor_id) {
@@ -167,46 +56,3 @@
 }
 
 
-
-
-
-/*
-
-currently unused:
-
-function decodeURLWithAmp(str) {
-  str = str.replace(/&amp;/g, "&");
-  return str;
-}
-
-function decodeChars(str) {
-  str = str.replace(/&lt;/g, "<");
-  str = str.replace(/&gt;/g, ">");
-return str;
-}
-
-// some AJAX helpers 
-
-// browser abstraction 
-function createXMLHttpRequest() {
-  // Firefox and friends, Opera, Konqueror, Safari:
-  if (window.XMLHttpRequest) return new XMLHttpRequest();
-  // the evil one:
-  if (window.ActiveXObject)  return new ActiveXObject("Microsoft.XMLHTTP");
-  alert(
-      "The Lenya TinyMCE module needs XMLHttpRequest support (aka AJAX).\n" +
-      "It seems like your browser does not provide it. Sorry."
-  );
-  return null;
-}
-
-// some constants to avoid magic numbers in XMLHttpRequest methods 
-const XHR_ASYNC         = true;
-
-const XHR_UNINITIALIZED = "0";
-const XHR_LOADING       = "1";
-const XHR_LOADED        = "2";
-const XHR_INTERACTIVE   = "3";
-const XHR_COMPLETE      = "4";
-
-*/
\ No newline at end of file

Modified: lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin_src.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin_src.js?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin_src.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin_src.js Tue Dec  5 15:17:15 2006
@@ -1,8 +1,4 @@
-/*
- *	Andrew Tetlaw - 2006/02 - for TinyMCE 2.0.3 and above
- *	A port of the FCKEditor file browser as a TinyMCE plugin.
- *	http://tetlaw.id.au/view/blog/fckeditor-file-browser-plugin-for-tinymce-editor/
- */
+
 
 tinyMCE.importPluginLanguagePack('simplebrowser', 'en');
 
@@ -10,11 +6,11 @@
 	options : {},
 	getInfo : function() {
 		return {
-			longname : 'Simple Browser plugin',
-			author : 'Andrew Tetlaw',
-			authorurl : 'http://tetlaw.id.au',
-			infourl : 'http://tetlaw.id.au/view/blog/fckeditor-file-browser-plugin-for-tinymce-editor/',
-			version : "2.1"
+			longname : '',
+			author : '',
+			authorurl : '',
+			infourl : '',
+			version : ""
 		};
 	},
 

Modified: lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx (original)
+++ lenya/trunk/src/modules/tinymce/usecases/insertAsset.jx Tue Dec  5 15:17:15 2006
@@ -16,50 +16,26 @@
   limitations under the License.
 -->
 
-<!-- $Id: insertAsset.jx 448601 2006-09-21 16:30:56Z nettings $ -->
-
-<!--
-  A view for a generic usecase to insert assets, to be used by content editors.
-  Recommended usage is to open it into a new window via JavaScript, possibly
-  by hooking into a button handler of the editor.
-  This usecase view needs a complementing javascript file (insertAsset.js) that 
-  takes care of passing the data back to the opening window by calling its 
-  insertCallback(string) function (which the calling window must provide).
-  "string" will contain an xhtml snippet that should be inserted into the editor
-  widget.
-  Optionally, the opening page can pass an editors.instance parameter to this 
-  usecase which is returned as a second parameter to the insertCallback() 
-  function. This is useful if you have multiple editors on one page and need to
-  tell who called the usecase.
-
-  If you use this view in a usecase that ends in "insertImage", some special
-  fields pertaining to images (width, height, ratio) are displayed. Otherwise
-  only the data for generic assets is handled.
--->
-
+<!-- $Id: insertAsset.jx 473861 2006-11-12 03:51:14Z gregor $ -->
 
 <page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
   xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
   xmlns="http://www.w3.org/1999/xhtml" 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
-
-<jx:set var="isImage" value="${usecase.getName().endsWith('insertImage')}"/>
-<jx:set var="debugFormData" value="printFormData();"/>
-
+  
   <page:head>
     <script src="${request.contextPath}/modules/tinymce/javascript/insertAsset.js"/>
   </page:head>
- 
-  <page:title>
-    <i18n:text>TinyMCE - Insert Lenya resource</i18n:text>
-  </page:title>
- 
+
+   <page:title>
+     <i18n:text>TinyMCE - Insert Lenya resource</i18n:text>
+   </page:title>
+  
   <page:body>
-    <form method="POST" name="asset" id="asset">
+    <form method="POST" name="image" id="image">
       <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>
       <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
       <table class="lenya-table">
-
         <tr>
           <th/>
           <th><i18n:text>Assets</i18n:text></th>
@@ -69,7 +45,6 @@
           <th><i18n:text>Dimension (w x h)</i18n:text></th>
           <th><i18n:text>Creation Date</i18n:text></th>
         </tr>
-
         <jx:forEach var="asset" items="${usecase.getParameter('assets')}">
           <tr>
             <td>
@@ -91,7 +66,6 @@
             <td align="right"><jx:out value="${java.text.DateFormat.getDateInstance().format(asset.getLastModified())}"/></td>
           </tr>
         </jx:forEach>
-
         <tr>
           <td colspan="6">
             <input type="hidden" name="type" value=""/>
@@ -103,8 +77,7 @@
                 <td class="lenya-entry-caption"><label for="caption"><i18n:text>Caption</i18n:text></label>:</td>
                 <td><input class="lenya-form-element" type="text" name="caption"/></td>
               </tr>
-
-              <jx:if test="${isImage}">
+              <jx:if test="${usecase.getName().equals('tinymce.insertImage')}">
                 <tr>
                   <td class="lenya-entry-caption"><label for="width"><i18n:text>width</i18n:text></label>:</td>
                   <td><input class="lenya-form-element" type="text" name="width" onchange="javascript:scaleHeight(this.value)"/></td>
@@ -114,47 +87,30 @@
                   <td><input class="lenya-form-element" type="text" name="height" onchange="javascript:scaleWidth(this.value)"/></td>
                 </tr>
               </jx:if>
-
               <tr>
                 <td colspan="2">
-                  <jx:choose>
-                    <jx:when test="${isImage}">
-                       <input i18n:attr="value" type="submit" name="submit" value="Submit"
-                          onClick="javascript:${debugFormData}insertImage('${usecase.getParameter('editors.instance')}');/*window.close();*/" />
-                    </jx:when>
-                    <jx:otherwise>
-                       <input i18n:attr="value" type="submit" name="submit" value="Submit"
-                          onClick="javascript:${debugFormData}insertAsset('${usecase.getParameter('editors.instance')}');/*window.close();*/" />
-                    </jx:otherwise>
-                  </jx:choose>
+                  <input i18n:attr="value" type="submit" value="Submit"
+                    onClick="javascript:${usecase.getView().getParameter('callbackFunction')}('${usecase.getParameter('document').getName()}');" />
                   &#160;
                   <input i18n:attr="value" type="submit" name="cancel" value="Cancel"
-                    onClick="location.href='javascript:window.close();" />
+                    onClick="location.href='javascript:window.close();';" />
                 </td>
               </tr>
             </table>
           </td>
         </tr>
-
       </table>
     </form>
-
-
     <jx:if test="${usecase.getParameter('document').getArea().equals('authoring')}">
-
       <form method="POST" enctype="multipart/form-data" id="form-add_asset">
         <input type="hidden" name="lenya.usecase" value="${usecase.getName()}"/>
         <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
-        <input type="hidden" name="doctype" value="resource" />
-       
         <table class="lenya-table-noborder">
- 
-         <tr>
+          <tr>
             <td colspan="2">
               <jx:import uri="fallback://lenya/usecases/templates/messages.jx"/>
             </td>
           </tr>
-
           <jx:choose>
             <jx:when test="${usecase.getParameter('pathProvided')}">
               <tr>
@@ -186,13 +142,11 @@
               </tr>
             </jx:otherwise>
           </jx:choose>
-
           <tr>
             <td class="lenya-entry-caption"><label for="file">
               <i18n:text>File</i18n:text> *</label></td>
             <td><input type="file" name="file" class="lenya-form-element"/></td>
           </tr>
-
           <tr>
             <td class="lenya-entry-caption">
               <label for="dublincore.title"><i18n:text>Navigation Title</i18n:text>*:
@@ -202,7 +156,6 @@
                 value="${usecase.getParameter('dublincore.title')}"/>
             </td>
           </tr>
-
           <tr>
             <td class="lenya-entry-caption">
               <label for="visibleinnav"><i18n:text>Document visible in Navigation</i18n:text>*:
@@ -229,7 +182,6 @@
               </select>
             </td>
           </tr>
-
           <jx:if test="${!usecase.getParameter('documentIdProvided')}">
             <tr>
               <td class="lenya-entry-caption">
@@ -254,7 +206,6 @@
               </td>
             </tr>
           </jx:if>
-
           <jx:set var="languages" value="${usecase.getParameter('languages')}"/>
           <jx:choose>
             <jx:when test="${languages.size() &gt; 1}">
@@ -281,13 +232,12 @@
               </tr>
             </jx:otherwise>
           </jx:choose>
-
+          <input type="hidden" name="doctype" value="resource" />
           <tr>
             <td class="lenya-entry-caption">*
               <i18n:text>required fields</i18n:text>
             </td>
           </tr>
-
           <tr>
             <td/>
             <td>
@@ -295,12 +245,8 @@
                 value="New Asset"/>
             </td>
           </tr>
-
         </table>
-
       </form>
-
     </jx:if>
-
   </page:body>
 </page:page>

Modified: lenya/trunk/src/modules/tinymce/xslt/link.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/xslt/link.xsl?view=diff&rev=482824&r1=482823&r2=482824
==============================================================================
--- lenya/trunk/src/modules/tinymce/xslt/link.xsl (original)
+++ lenya/trunk/src/modules/tinymce/xslt/link.xsl Tue Dec  5 15:17:15 2006
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,37 +16,41 @@
   limitations under the License.
 -->
 
-<xsl:stylesheet version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns="http://www.w3.org/1999/xhtml"
-	xmlns:xhtml="http://www.w3.org/1999/xhtml"
-    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
-    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
-    xmlns:usecase="http://apache.org/cocoon/lenya/usecase/1.0"     
-    >
-
-<xsl:param name="contextprefix"/>
-<xsl:param name="publicationid"/>
-<xsl:param name="area"/>
-<xsl:param name="tab"/>
-<xsl:param name="documentid"/>
-<xsl:param name="documentextension"/>
-<xsl:param name="documenturl"/>
-<xsl:param name="languages"/>
-<xsl:param name="chosenlanguage"/>
-<xsl:param name="defaultlanguage"/>
+<!--
+  $Id: link.xsl 473861 2006-11-12 03:51:14Z gregor $
+-->
 
-<xsl:variable name="extension"><xsl:if test="$documentextension != ''">.</xsl:if><xsl:value-of select="$documentextension"/></xsl:variable>
+<xsl:stylesheet version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"    
+  xmlns:usecase="http://apache.org/cocoon/lenya/usecase/1.0"     
+  >
   
-<xsl:template match="/">
+  <xsl:param name="contextprefix"/>
+  <xsl:param name="publicationid"/>
+  <xsl:param name="area"/>
+  <xsl:param name="tab"/>
+  <xsl:param name="documentid"/>
+  <xsl:param name="documentextension"/>
+  <xsl:param name="documenturl"/>
+  <xsl:param name="languages"/>
+  <xsl:param name="chosenlanguage"/>
+  <xsl:param name="defaultlanguage"/>
+  
+  <xsl:variable name="extension"><xsl:if test="$documentextension != ''">.</xsl:if><xsl:value-of select="$documentextension"/></xsl:variable>
+  
+  <xsl:template match="/">
     <page:page>
       <page:title>Insert Link</page:title>
       <page:body>
-      <script type="text/javascript" src="{$contextprefix}/modules/sitetree/javascript/tree.js">&#160;</script>
-      <script type="text/javascript" src="{$contextprefix}/modules/sitetree/javascript/lenyatree.js">&#160;</script>
-      <script type="text/javascript" src="{$contextprefix}/modules/sitetree/javascript/navtree.js">&#160;</script>
-      <script type="text/javascript" src="{$contextprefix}/modules/tinymce/javascript/insertLink.js">&#160;</script>
-      <script type="text/javascript" >
+        <script type="text/javascript" src="{$contextprefix}/modules/sitetree/javascript/tree.js">&#160;</script>
+        <script type="text/javascript" src="{$contextprefix}/modules/sitetree/javascript/lenyatree.js">&#160;</script>
+        <script type="text/javascript" src="{$contextprefix}/modules/sitetree/javascript/navtree.js">&#160;</script>
+        <script type="text/javascript" src="{$contextprefix}/modules/tinymce/javascript/insertLink.js">&#160;</script>
+        <script type="text/javascript" >
           AREA = "<xsl:value-of select="$area"/>";
           DOCUMENT_ID = "<xsl:value-of select="$documentid"/>";
           CONTEXT_PREFIX = "<xsl:value-of select="$contextprefix"/>";
@@ -57,122 +61,128 @@
           CUT_DOCUMENT_ID = '';
           ALL_AREAS = "authoring"
           PIPELINE_PATH = '/authoring/sitetree-fragment.xml'
-      </script>
-    <table border="0" cellpadding="0" cellspacing="0" width="100%">
-<tr>
-<td valign="top" width="50%">
-    <div id="lenya-info-treecanvas">
-<!-- Build the tree. -->
-	<table border="0" cellpadding="0" cellspacing="0">
-                <tr>
-                      <xsl:call-template name="languagetabs">
-                        <xsl:with-param name="tablanguages">
-                          <xsl:value-of select="$languages"/>
-                        </xsl:with-param>
-                      </xsl:call-template>
-                </tr>
-        </table>
-
-                 <div id="lenya-info-tree">
-                    <div id="tree">
-                      <script type="text/javascript">
-                        buildTree();
-                      </script>
-                    </div>
+        </script>
+        <table border="0" cellpadding="0" cellspacing="0" width="100%">
+          <tr>
+            <td valign="top" width="20%">
+              <div id="lenya-info-treecanvas">
+                <!-- Build the tree. -->
+                <table border="0" cellpadding="0" cellspacing="0">
+                  <tr>
+                    <xsl:call-template name="languagetabs">
+                      <xsl:with-param name="tablanguages">
+                        <xsl:value-of select="$languages"/>
+                      </xsl:with-param>
+                    </xsl:call-template>
+                  </tr>
+                </table>
+                
+                <div id="lenya-info-tree">
+                  <div id="tree">
+                    <script type="text/javascript">
+                      buildTree();
+                    </script>
                   </div>
-</div>
-</td>
-<td>
- <form action="" name="link" id="link" onsubmit="insertLink()">
-                        <table class="lenya-table-noborder">
-                                <tr>
-                                <td colspan="2" class="lenya-form-caption">You can either click on a node in the tree for an internal link or enter a link in the URL field. </td>
-                                </tr>
-                            <tr>
-                                <td colspan="2">&#160;</td>
-                            </tr>
-                                <tr>
-                                <td class="lenya-form-caption">URL:</td>
-                                <td>
-                                    <input class="lenya-form-element" 
-                                        type="text" 
-                                        name="url"/>
-                                </td>
-                            </tr>
-                                 <tr>
-                                <td class="lenya-form-caption">Title:</td>
-                                <td>
-                                    <input class="lenya-form-element" 
-                                        type="text" 
-                                        name="title"/>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td colspan="2">&#160;</td>
-                            </tr>
-                            <tr>
-                                <td/>
-                                <td> <input type="submit" 
-                                    value="Insert" name="input-insert"/>
-                                </td>
-                            </tr>
-                        </table>
- </form>   
-</td>
-</tr></table>
+                </div>
+              </div>
+            </td>
+            <td>
+              <form action="" name="link" id="link" onsubmit="insertLink()">
+                <table class="lenya-table-noborder">
+                  <tr>
+                    <td colspan="2" class="lenya-form-caption">You can either click on a node in the tree for an internal link or enter a link in the URL field. </td>
+                  </tr>
+                  <tr>
+                    <td colspan="2">&#160;</td>
+                  </tr>
+                  <tr>
+                    <td class="lenya-form-caption"><i18n:text>URL</i18n:text>:</td>
+                    <td>
+                      <input class="lenya-form-element" type="text" name="url"/>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td class="lenya-form-caption"><i18n:text>Title</i18n:text>:</td>
+                    <td>
+                      <input class="lenya-form-element" type="text" name="title"/>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td class="lenya-form-caption">Link text:</td>
+                    <td>
+                      <input class="lenya-form-element" 
+                        type="text" 
+                        name="text"/>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td colspan="2">&#160;</td>
+                  </tr>
+                  <tr>
+                    <td/>
+                    <td> <input type="submit" 
+                      value="Insert" name="input-insert"/>
+                    </td>
+                  </tr>
+                </table>
+              </form>   
+            </td>
+          </tr></table>
       </page:body>
     </page:page>
-</xsl:template>
-
-
-<xsl:template name="selecttab">
-  <xsl:text>?lenya.usecase=</xsl:text>
-  <xsl:choose>
-    <xsl:when test="$tab"><xsl:value-of select="$tab"/></xsl:when>
-    <xsl:otherwise>bxe</xsl:otherwise>
-  </xsl:choose>
-  <xsl:text>&amp;lenya.step=link-show</xsl:text>
-</xsl:template>
-
-
-<xsl:template name="languagetabs">
-  <xsl:param name="tablanguages"/>
-  <xsl:choose>
-    <xsl:when test="not(contains($tablanguages,','))">
-      <xsl:call-template name="languagetab">
-        <xsl:with-param name="tablanguage">
-          <xsl:value-of select="$tablanguages"/>
-        </xsl:with-param>
-      </xsl:call-template>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:variable name="head" select="substring-before($tablanguages,',')" />
-      <xsl:variable name="tail" select="substring-after($tablanguages,',')" />
-      <xsl:call-template name="languagetab">
-        <xsl:with-param name="tablanguage" select="$head"/>
-      </xsl:call-template>
-      <xsl:call-template name="languagetabs">
-        <xsl:with-param name="tablanguages" select="$tail"/>
-      </xsl:call-template>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:template>
-
-
-<xsl:template name="languagetab">
-  <xsl:param name="tablanguage"/>
-  <td><a id="{$tablanguage}">
-      <xsl:call-template name="activate">
-        <xsl:with-param name="tablanguage" select="$tablanguage"/>
-      </xsl:call-template>
-    </a></td>
-</xsl:template>
-
-
-<xsl:template name="activate">
-  <xsl:param name="tablanguage"/>
-  <xsl:attribute name="href"><xsl:value-of select="$contextprefix"/>/<xsl:value-of select="$publicationid"/>/<xsl:value-of select="$area"/><xsl:value-of select="$documentid"/>_<xsl:value-of select="$tablanguage"/><xsl:value-of select="$extension"/>?lenya.module=bxe&amp;lenya.step=link-show</xsl:attribute>
-  <xsl:attribute name="class">lenya-tablink<xsl:choose><xsl:when test="$chosenlanguage = $tablanguage">-active</xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute><xsl:value-of select="$tablanguage"/>
-</xsl:template>
-
+  </xsl:template>
+  
+  
+  <xsl:template name="selecttab">
+    <xsl:text>?lenya.usecase=</xsl:text>
+    <xsl:choose>
+      <xsl:when test="$tab"><xsl:value-of select="$tab"/></xsl:when>
+      <xsl:otherwise>tinymce</xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>&amp;lenya.step=link-show</xsl:text>
+  </xsl:template>
+  
+  
+  <xsl:template name="languagetabs">
+    <xsl:param name="tablanguages"/>
+    <xsl:choose>
+      <xsl:when test="not(contains($tablanguages,','))">
+        <xsl:call-template name="languagetab">
+          <xsl:with-param name="tablanguage">
+            <xsl:value-of select="$tablanguages"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="head" select="substring-before($tablanguages,',')" />
+        <xsl:variable name="tail" select="substring-after($tablanguages,',')" />
+        <xsl:call-template name="languagetab">
+          <xsl:with-param name="tablanguage" select="$head"/>
+        </xsl:call-template>
+        <xsl:call-template name="languagetabs">
+          <xsl:with-param name="tablanguages" select="$tail"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  
+  <xsl:template name="languagetab">
+    <xsl:param name="tablanguage"/>
+    <td>
+      <a id="{$tablanguage}">
+        <xsl:call-template name="activate">
+          <xsl:with-param name="tablanguage" select="$tablanguage"/>
+        </xsl:call-template>
+      </a>
+    </td>
+  </xsl:template>
+  
+  
+  <xsl:template name="activate">
+    <xsl:param name="tablanguage"/>
+    <xsl:attribute name="href"><xsl:value-of select="$contextprefix"/>/<xsl:value-of select="$publicationid"/>/<xsl:value-of select="$area"/><xsl:value-of select="$documentid"/>_<xsl:value-of select="$tablanguage"/><xsl:value-of select="$extension"/>?lenya.module=tinymce&amp;lenya.step=link-show</xsl:attribute>
+    <xsl:attribute name="class">lenya-tablink<xsl:choose><xsl:when test="$chosenlanguage = $tablanguage">-active</xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute><xsl:value-of select="$tablanguage"/>
+  </xsl:template>
+  
 </xsl:stylesheet> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org


Re: svn commit: r482824 - in /lenya/trunk/src/modules/tinymce: config/cocoon-xconf/ resources/javascript/ resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/ usecases/ xslt/

Posted by Doug Chestnut <dh...@virginia.edu>.

Andreas Hartmann wrote:
> chestnut@apache.org schrieb:
> 
>>Author: chestnut
>>Date: Tue Dec  5 15:17:15 2006
>>New Revision: 482824
>>
>>URL: http://svn.apache.org/viewvc?view=rev&rev=482824
>>Log:
>>links should utilize uuids now
> 
> 
> Cool :)
Yeah, great work on the uuid integration Andreas!  I need to dig into 
the mail list and see what other cool stuff I have missed lately.

--Doug
> 
> -- Andreas
> 
> 
>>Added:
>>    lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf   (with props)
>>    lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf   (with props)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: svn commit: r482824 - in /lenya/trunk/src/modules/tinymce: config/cocoon-xconf/ resources/javascript/ resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/ usecases/ xslt/

Posted by Andreas Hartmann <an...@apache.org>.
chestnut@apache.org schrieb:
> Author: chestnut
> Date: Tue Dec  5 15:17:15 2006
> New Revision: 482824
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=482824
> Log:
> links should utilize uuids now

Cool :)

-- Andreas

> 
> Added:
>     lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertAsset.xconf   (with props)
>     lenya/trunk/src/modules/tinymce/config/cocoon-xconf/usecase-insertImage.xconf   (with props)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org