You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by rf...@apache.org on 2007/06/18 21:39:45 UTC

svn commit: r548462 - /lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js

Author: rfrovarp
Date: Mon Jun 18 12:39:44 2007
New Revision: 548462

URL: http://svn.apache.org/viewvc?view=rev&rev=548462
Log:
Fixed code passing values back to TinyMCE image popup. Now passes back title, width, and height information along with URL.

Modified:
    lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js

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=548462&r1=548461&r2=548462
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/javascript/insertAsset.js Mon Jun 18 12:39:44 2007
@@ -15,15 +15,17 @@
   limitations under the License.
 */
 
-   ext = '';
-   
+   ext = ''; 
+
    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() ;
+      var win = window.top.opener.tinyMCE.getWindowArg("window");
+      win.document.getElementById('alt').value = title;
+      win.document.getElementById('src').value = src;
+      window.top.close() ;
     }
    
    function insertImage(nodeid) { 
@@ -34,9 +36,16 @@
       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() ;
+      var win = window.top.opener.tinyMCE.getWindowArg("window");
+      win.document.getElementById('alt').value = title;
+      win.document.getElementById('src').value = src;
+      if(height > 0 && width > 0) {
+         win.document.getElementById('width').value = width;
+         win.document.getElementById('height').value = height;
+     } else {
+        win.getImageData();
+     }
+     window.top.close() ;
    }
 
    function insertCaption(name, caption, type, size) { 
@@ -73,4 +82,4 @@
      document.forms['image'].width.value = height * ratio;
      focus(); 
    } 
-  
\ No newline at end of file
+  



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