Update of 
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/popups
In directory 
james.mmbase.org:/tmp/cvs-serv18336/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/popups

Modified Files:
      Tag: b1_5
        insertinline_image.html 
Log Message:
CMSC-1350 - Inserting image in rich text editor returns wrong sizes into 
article: when images are small


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/popups
See also: http://www.mmbase.org/jira/browse/CMSC-1350


Index: insertinline_image.html
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/richtext/src/webapp/mmbase/edit/wizard/xinha/popups/insertinline_image.html,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -b -r1.6 -r1.6.2.1
--- insertinline_image.html     28 Jul 2008 13:07:34 -0000      1.6
+++ insertinline_image.html     27 Mar 2009 11:25:57 -0000      1.6.2.1
@@ -1,6 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
 <html>
-
 <head>
   <title>Insert Inline Image</title>
   <script type="text/javascript" src="popup.js"></script>
@@ -103,21 +102,30 @@
   var imagePosition = document.getElementById("f_align").value
   if ("left" == imagePosition) {
     if (width && height) {
-     // height = (IMAGE_WIDTH_LEFT / width) * height;
+             if (width > IMAGE_WIDTH_LEFT) {
+                  height = Math.round((IMAGE_WIDTH_LEFT / width) * height);
+                width = IMAGE_WIDTH_LEFT;
+             }  
       document.getElementById("f_width").value = width;
       document.getElementById("f_height").value = height;
     }
   }
   if ("right" == imagePosition) {
     if (width && height) {
-      //height = (IMAGE_WIDTH_RIGHT / width) * height;
-      document.getElementById("f_width").value = width;
-      document.getElementById("f_height").value = height;
+         if (width > IMAGE_WIDTH_RIGHT) {
+                  height = Math.round((IMAGE_WIDTH_RIGHT / width) * height);
+            width = IMAGE_WIDTH_RIGHT;
+         }
+         document.getElementById("f_width").value = IMAGE_WIDTH_RIGHT;
+         document.getElementById("f_height").value = width;
     }
   }
   if ("" == imagePosition) {
     if (width && height) {
-      //height = (IMAGE_WIDTH_FULL / width) * height;
+         if (width > IMAGE_WIDTH_FULL) {
+            height = Math.round((IMAGE_WIDTH_FULL / width) * height);
+            width = IMAGE_WIDTH_FULL;
+         }
       document.getElementById("f_width").value = width;
       document.getElementById("f_height").value = height;
     }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to