Mercurial > hg > soundsoftware-site
comparison lib/redmine/helpers/diff.rb @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
| author | Chris Cannam |
|---|---|
| date | Mon, 07 Jan 2013 12:01:42 +0000 |
| parents | cbb26bc654de |
| children | 622f24f53b42 261b3d9a4903 |
comparison
equal
deleted
inserted
replaced
| 929:5f33065ddc4b | 1115:433d4f72a19b |
|---|---|
| 1 # Redmine - project management software | 1 # Redmine - project management software |
| 2 # Copyright (C) 2006-2011 Jean-Philippe Lang | 2 # Copyright (C) 2006-2012 Jean-Philippe Lang |
| 3 # | 3 # |
| 4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
| 5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
| 6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
| 7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
| 48 add_at = pos + dels unless add_at | 48 add_at = pos + dels unless add_at |
| 49 add_to = pos + dels | 49 add_to = pos + dels |
| 50 words_add += 1 | 50 words_add += 1 |
| 51 else | 51 else |
| 52 del_at = pos unless del_at | 52 del_at = pos unless del_at |
| 53 deleted << ' ' + h(change[2]) | 53 deleted << ' ' unless deleted.empty? |
| 54 deleted << h(change[2]) | |
| 54 words_del += 1 | 55 words_del += 1 |
| 55 end | 56 end |
| 56 end | 57 end |
| 57 if add_at | 58 if add_at |
| 58 words[add_at] = '<span class="diff_in">' + words[add_at] | 59 words[add_at] = '<span class="diff_in">'.html_safe + words[add_at] |
| 59 words[add_to] = words[add_to] + '</span>' | 60 words[add_to] = words[add_to] + '</span>'.html_safe |
| 60 end | 61 end |
| 61 if del_at | 62 if del_at |
| 62 words.insert del_at - del_off + dels + words_add, '<span class="diff_out">' + deleted + '</span>' | 63 words.insert del_at - del_off + dels + words_add, '<span class="diff_out">'.html_safe + deleted + '</span>'.html_safe |
| 63 dels += 1 | 64 dels += 1 |
| 64 del_off += words_del | 65 del_off += words_del |
| 65 words_del = 0 | 66 words_del = 0 |
| 66 end | 67 end |
| 67 end | 68 end |
