Browse Source

Adding possible fix to the long url (chamilo in a folder) only to the images. Need feedback, don't be mad for this change :) just testing! see #3933

Julio Montoya 12 years ago
parent
commit
9ee380ce63

+ 5 - 7
main/inc/lib/fckeditor/editor/dialog/fck_image/fck_image.js

@@ -437,19 +437,17 @@ var sActualBrowser ;
 function SetUrl( url, width, height, alt )
 {
 	url = FCK.GetSelectedUrl ( url ) ;
+
 	// search the URLPrefix like it is the configuration.php file
+    /*
 	PrefixeUrl = self.location.href.replace(/\/main\/inc\/lib\/fckeditor\/editor\/dialog\/fck_image.\html/, "");
 	PrefixeUrl = PrefixeUrl.replace(/http:\/\/[^\/]+/, "");
 	url = PrefixeUrl + url ;
-	// 
-
-	if ( sActualBrowser == 'Link' )
-	{
+    */
+	if ( sActualBrowser == 'Link' ) {
 		GetE('txtLnkUrl').value = url ;
 		UpdatePreview() ;
-	}
-	else
-	{
+	} else {
 		GetE('txtUrl').value = url ;
 		GetE('txtWidth').value = width ? width : '' ;
 		GetE('txtHeight').value = height ? height : '' ;

+ 6 - 4
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js

@@ -1830,13 +1830,15 @@ FCK.GetSelectedFlashUrl = function ( url )
 // Conversion of selected by the file managers URLs.
 FCK.GetSelectedUrl = function ( url )
 {
-    url = FCK.GetUrl ( url, DOCUMENT_RELATIVE_URL ) ;
+    /* Why you suppose that the url is relative? */
+    //url = FCK.GetUrl ( url, DOCUMENT_RELATIVE_URL ) ;
 
-    if ( FCK.GetUrlType (url) != RELATIVE_URL )
-    {
+    //Searching the correct type
+    my_type =  FCK.GetUrlType (url)
+    url = FCK.GetUrl ( url, my_type);
+    if ( FCK.GetUrlType (url) != RELATIVE_URL ) {
         url = FCK.GetUrl ( url, SEMI_ABSOLUTE_URL ) ;
     }
-
     return url ;
 }