Generate a tooltip for the web help pages which will show the code used to generate... 77/8477/2
Sylvestre Ledru [Wed, 1 Aug 2012 17:58:35 +0000 (19:58 +0200)]
Change-Id: I486f330c00e29fed6c4d152298c56ee7b8ab8fea

scilab/modules/helptools/src/java/org/scilab/modules/helptools/image/ScilabImageConverter.java

index ca26a9a..3aa0407 100644 (file)
@@ -115,6 +115,10 @@ public class ScilabImageConverter implements ExternalImageConverter {
         buffer.append("xend();\n");
         buffer.append("driver(__olddrv__);\n");
 
-        return "<img src=\'" + imageName + "\'/>";
+
+        /* Prepare the code for the html inclusion */
+        code = code.trim().replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br />");
+
+        return " <div rel='tooltip' title='" + code + "'><img src=\'" + imageName + "\'/></div>";
     }
 }
\ No newline at end of file