You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ra...@apache.org on 2007/12/09 01:47:25 UTC

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

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;
+		}
 	}
 };
 



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