Diff.cfc - A ColdFusion text diff component
Posted At : November 3, 2005 4:52 PM
A couple of weeks ago I was playing with Sean Corfield's MachWiki. It was really cool to go through the code (I always enjoy Sean's code).
I eventually decided to use MediaWiki for my company's standards wiki. I had to dig back, way back, for my php skills and managed to get it up and running with mods and all.
Of course I really wanted to rewrite the thing in ColdFusion, so I started from what seemed like an interesting part - the diff tool.
<cfobject component="diff" name="cfcDiff">
<cfoutput>#cfcDiff.diffFormat(form.txt1,form.txt2)#</cfoutput>
<cfoutput>#cfcDiff.diffFormat(form.txt1,form.txt2)#</cfoutput>
| # | line | # | line |
| 1 | <html> | 1 | <html> |
| 2 | <head><title>Text 2 </title></head> | 2 | <head><title>Text 1 </title></head> |
| 3 | <body> | 3 | <body> |
| 4 | Hello, my name is Shlomy Gantz, how are you doing? | 4 | Hello, my name is Inigo Montoya ,You killed my father. |
| 5 | <font color="#FF0000"> This text is in red </font> | 5 | <font color="#00FF00"> This text is in green </font> |
| 6 | I have more lines | . | |
| 7 | I have more lines | . | |
| 8 | </body> | 6 | </body> |
| 9 | </html> | 7 | </html> |
You can download diff.cfc (beta) at http://www.shlomygantz.com/customtags/diff_cfc/diff_readme.cfm
Little did I know that Raymond Camden was about to release his Wiki called Canvas as part of DRK 13.



![Validate my RSS feed [Valid RSS]](http://www.shlomygantz.com/blog/valid-rss.png)
There are no comments for this entry.
[Add Comment]