Showing two separate HTML report for the differences in HTML files

65 views
Skip to first unread message

vaibhav shukla

unread,
Oct 1, 2013, 5:15:30 AM10/1/13
to dais...@googlegroups.com
Currently, the diff report in HTML format shows the differences in original and revised HTML source files, marking with red and green. But its in same report.
Is there any way, I could show it in two separate HTML reports, one for original, where elements are marked in red and another one which is for revised, where the changes are marked in green? rest everything remains the same.

I want the user to have an option of toggling between RED and GREEN. I am looking for such thing. Please if somebody could throw some light on this ?

I use Selenium to grab the source code of a webpage from the URL entered, create a HTML file with it. Then compare it with previously captured HTML source file, and result is an HTML report with both red and green.

Please suggest a way to achieve this. 

Thank you so much.

Kostis Kapelonis

unread,
Oct 1, 2013, 11:10:11 AM10/1/13
to dais...@googlegroups.com
You need to write Java code to do this.

The Daisydiff output code clearly gives which changes are green and
red. At the moment everything dumped together as you found out.

You can modify the workflow (perhaps by adding a command line switch)
where only one of the two types of changes is shown.

So you run once daisydiff with the switch enabled (keeping the result)
and then a second time with the switch reversed for the second result.

Just my suggestion.

An alternative way would be to fork the CSS file into two files where
only one of the type of changes is shown in each one. But I am not
sure that this will work in all cases.

Kostis
> --
> You received this message because you are subscribed to the Google Groups
> "DaisyDiff" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to daisydiff+...@googlegroups.com.
> To post to this group, send email to dais...@googlegroups.com.
> Visit this group at http://groups.google.com/group/daisydiff.
> For more options, visit https://groups.google.com/groups/opt_out.

vaibhav shukla

unread,
Oct 4, 2013, 11:15:27 AM10/4/13
to dais...@googlegroups.com
Command Line Switch ?  What to modify in the code is a catch. 

So far, playing with CSS is the easiest way I've figured out. I have added two buttons to the HTML report: red and green (say).
For all  "diff-html-removed" class, I have added  "display:none" and when a user clicks the red button, using jquery I am showing the removed span and hiding the green ones.
Next, when user clicks the green button, removed span are hide and green one are displayed..

Sounds practical ? So far this toggle thing is working fine. But the problem or challenge is with "diff-html-changed" span elements.

Still would love if this could be controlled via Java Program. Also, I need to discuss one more thing and would like to have some inputs if this could work out :

Is there a way, I could enable the changes in an HTML page on user click? I mean , I don't want all the changes to appear in one go rather I should have some pagination-type buttons clicking which should show me the change one by one(based on click) from top to bottom ? Just like we can do with daisydiff toolbar.
Please suggest a way to achieve this.
Thank you!


You received this message because you are subscribed to a topic in the Google Groups "DaisyDiff" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/daisydiff/8SsMGLggNfE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to daisydiff+...@googlegroups.com.

To post to this group, send email to dais...@googlegroups.com.
Visit this group at http://groups.google.com/group/daisydiff.
For more options, visit https://groups.google.com/groups/opt_out.



--
best wishes!!
 Vaibhav

Kostis Kapelonis

unread,
Oct 22, 2013, 8:32:34 AM10/22/13
to dais...@googlegroups.com
To enable showing/hiding of diffs on the client you need to play with
Javascript (completely unrelated to Java and Daisydiff).

Have a look at jQuery (just on suggestion)

Here is a starting point.

http://api.jquery.com/show/

Kostis

vaibhav shukla

unread,
Oct 22, 2013, 11:09:01 AM10/22/13
to dais...@googlegroups.com
yeah. I have figured that out. Thanks!
Reply all
Reply to author
Forward
0 new messages