Changeset 84266 in webkit
- Timestamp:
- Apr 19, 2011 11:08:12 AM (13 years ago)
- Location:
- trunk/Websites/bugs.webkit.org
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/bugs.webkit.org/ChangeLog
r83870 r84266 1 2011-04-19 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 3 Reviewed by Adam Roben. 4 5 PrettyPatch tries to show images for deleted files 6 https://bugs.webkit.org/show_bug.cgi?id=28457 7 8 When the image data is empty, instead of generating an <img> tag, generate 9 a text to indicate the image was deleted. 10 11 * PrettyPatch/PrettyPatch.rb: 12 1 13 2011-04-14 Tony Chang <tony@chromium.org> 2 14 -
trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb
r83870 r84266 515 515 lines_with_contents = lines[startOfSections...lines.length] 516 516 @sections = DiffSection.parse(lines_with_contents) unless @binary 517 if @image 517 if @image and not lines_with_contents.empty? 518 518 @image_url = "data:image/png;base64," + lines_with_contents.join 519 519 @image_checksum = FileDiff.read_checksum_from_png(lines_with_contents.join.unpack("m").join) … … 545 545 end 546 546 547 def image_to_html 548 if not @image_url then 549 return "<span class='text'>Image file removed</span>" 550 end 551 image_snippet = "<img class='image' src='" + @image_url + "' />" 552 if not @image_checksum then 553 return image_snippet 554 end 555 return "<p>" + @image_checksum + "</p>" + image_snippet 556 end 557 547 558 def to_html 548 559 str = "<div class='FileDiff'>\n" 549 560 str += "<h1>#{PrettyPatch.linkifyFilename(@filename)}</h1>\n" 550 561 if @image then 551 if @image_checksum then 552 str += "<p>" + @image_checksum + "</p>" 553 end 554 str += "<img class='image' src='" + @image_url + "' />" 562 str += self.image_to_html 555 563 elsif @git_image then 556 564 if @image_error
Note: See TracChangeset
for help on using the changeset viewer.