0029015: Testdiff - possibility to visualize image differences by toggling - correction
authorabv <abv@opencascade.com>
Tue, 29 Aug 2017 10:51:49 +0000 (13:51 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 30 Aug 2017 10:52:41 +0000 (13:52 +0300)
Javascript code is corrected to not depend on values of URLs of images

src/DrawResources/TestCommands.tcl

index c985269..bcf3e27 100644 (file)
@@ -2162,10 +2162,10 @@ proc _log_html_diff {file log dir1 dir2 highlight_percent} {
     puts $fd "<script type=\"text/javascript\">"
     puts $fd "  function diffimage_toggle(img,url1,url2)"
     puts $fd "  {"
-    puts $fd "    if (img.src.match(url2)) img.src = url1;"
-    puts $fd "    else img.src = url2;"
+    puts $fd "    if (img.show2nd) { img.src = url1; img.show2nd = false; }"
+    puts $fd "    else { img.src = url2; img.show2nd = true; }"
     puts $fd "  }"
-    puts $fd "  function diffimage_reset(img,url) { img.src = url; }"
+    puts $fd "  function diffimage_reset(img,url) { img.src = url; img.show2nd = true; }"
     puts $fd "</script>"
     puts $fd ""