From 17d432f6d5ac3cefa63ecd585ef7c065f4bd775c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 12 Dec 2012 03:07:36 +0000 Subject: [PATCH] * finish task #821. --- module/action/lang/en.php | 2 +- module/action/lang/zh-cn.php | 2 +- module/action/model.php | 11 ++++++----- module/common/view/action.html.php | 9 +++++++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index a59ced7c51..ccb7f4a0a5 100644 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -78,7 +78,7 @@ $lang->action->desc->canceled = '$date, canceled by $actor. $lang->action->desc->svncommited = '$date, $actor commited to svn,revision is #$extra.' . "\n"; $lang->action->desc->finished = '$date, finished by $actor.'; $lang->action->desc->diff1 = 'changed %s, old is "%s", new is "%s".
'; -$lang->action->desc->diff2 = 'changed %s, the diff is:
%s
' . "\n"; +$lang->action->desc->diff2 = 'changed %s, the diff is:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = "changed file's name %s to %s."; /* The action labels. */ diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 5180929f8c..d9a3c04d62 100644 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -78,7 +78,7 @@ $lang->action->desc->canceled = '$date, 由 $actor 取消 $lang->action->desc->svncommited = '$date, 由 $actor 提交代码,版本为#$extra。' . "\n"; $lang->action->desc->finished = '$date, 由 $actor 完成。' . "\n"; $lang->action->desc->diff1 = '修改了 %s,旧值为 "%s",新值为 "%s"。
' . "\n"; -$lang->action->desc->diff2 = '修改了 %s,区别为:' . "\n" . '
%s
' . "\n"; +$lang->action->desc->diff2 = '修改了 %s,区别为:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n"; /* 用来显示动态信息。*/ diff --git a/module/action/model.php b/module/action/model.php index 092ac5d4a4..9688628a21 100644 --- a/module/action/model.php +++ b/module/action/model.php @@ -603,11 +603,12 @@ class actionModel extends model $history->fieldLabel = str_pad($history->fieldLabel, $maxLength, $this->lang->action->label->space); if($history->diff != '') { - $history->diff = str_replace(array('', '', '', ''), array('[ins]', '[/ins]', '[del]', '[/del]'), $history->diff); - $history->diff = $history->field != 'subversion' ? htmlspecialchars($history->diff) : $history->diff; // Keep the diff link. - $history->diff = str_replace(array('[ins]', '[/ins]', '[del]', '[/del]'), array('', '', '', ''), $history->diff); - $history->diff = nl2br($history->diff); - printf($this->lang->action->desc->diff2, $history->fieldLabel, $history->diff); + $history->diff = str_replace(array('', '', '', ''), array('[ins]', '[/ins]', '[del]', '[/del]'), $history->diff); + $history->diff = $history->field != 'subversion' ? htmlspecialchars($history->diff) : $history->diff; // Keep the diff link. + $history->diff = str_replace(array('[ins]', '[/ins]', '[del]', '[/del]'), array('', '', '', ''), $history->diff); + $history->diff = nl2br($history->diff); + $history->noTagDiff = preg_replace('/<\/?([a-z][a-z0-9]*)[^\/]*\/?>/Ui', '', $history->diff); + printf($this->lang->action->desc->diff2, $history->fieldLabel, $history->noTagDiff, $history->diff); } else { diff --git a/module/common/view/action.html.php b/module/common/view/action.html.php index 8c62023968..f5c83e1d2a 100644 --- a/module/common/view/action.html.php +++ b/module/common/view/action.html.php @@ -14,6 +14,15 @@ function switchChange(historyID,type) $('#changeBox' + historyID).hide(); } } + +function toggleStripTags(obj) +{ + var boxObj = $(obj).parent(); + var oldDiff = $(boxObj).find('blockquote').html(); + var newDiff = $(boxObj).find('#hideDiff').html(); + $(boxObj).find('blockquote').html(newDiff); + $(boxObj).find('#hideDiff').html(oldDiff); +} getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>