svn commit: r602596 - /lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin.js

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: ragaller
Date: Sat Dec  8 16:47:24 2007
New Revision: 602596

URL: http://svn.apache.org/viewvc?rev=602596&view=rev
Log:
tinymce: fix javascript error in internal link insertion (sorry for breaking it with an earlier commit) - if someone finds the time to doublecheck this, my thanks in advance.

Modified:
    lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin.js

Modified: lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin.js?rev=602596&r1=602595&r2=602596&view=diff
==============================================================================
--- lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin.js (original)
+++ lenya/trunk/src/modules/tinymce/resources/tinymce/jscripts/tiny_mce/plugins/simplebrowser/editor_plugin.js Sat Dec  8 16:47:24 2007
@@ -92,9 +92,18 @@
 	browserCallback : function(returnValue) {
 		if(!returnValue) return;
 		TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements[TinyMCE_SimpleBrowserPlugin.options['field']].value = returnValue.url;
-		TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.width.value = returnValue.width;
-		TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.height.value = returnValue.height;
-		TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.alt.value = returnValue.title;
+		
+		// the following checks are necessary because this script is used
+		// for image insertion AND link insertion (where the returnValue.width (height and title)  are null)
+		if (returnValue.width != null) {
+		    TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.width.value = returnValue.width;
+		}
+		if (returnValue.height != null) {
+		    TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.height.value = returnValue.height;
+		}
+		if ((returnValue.title != null) && (TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.alt != null)) {    		
+    		TinyMCE_SimpleBrowserPlugin.options['target'].document.forms[0].elements.alt.value = returnValue.title;
+		}
 	}
 };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.