forked from gitea/gitea
1
0
Fork 0

Changed name from inline to unified

This commit is contained in:
Kim "BKC" Carlbäcker 2016-01-02 23:13:47 +01:00
parent 4e6d048ba1
commit 8fe5d887ae
8 changed files with 13 additions and 33 deletions

View File

@ -669,7 +669,7 @@ diff.commit = commit
diff.data_not_available = Diff Data Not Available.
diff.show_diff_stats = Show Diff Stats
diff.show_split_view = Split View
diff.show_inline_view = Inline View
diff.show_unified_view = Unified View
diff.stats_desc = <strong> %d changed files</strong> with <strong>%d additions</strong> and <strong>%d deletions</strong>
diff.bin = BIN
diff.view_file = View File

File diff suppressed because one or more lines are too long

View File

@ -738,14 +738,7 @@ pre.raw {
pre.wrap {
white-space: pre-wrap;
/* CSS 3 */
white-space: -moz-pre-wrap;
/* Mozilla, since 1999 */
white-space: -pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
word-break: break-word;
}
.full.height {
padding: 0;

View File

@ -21,10 +21,10 @@ pre {
}
&.wrap {
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
// white-space: -moz-normal; /* Mozilla, since 1999 */
// white-space: -normal; /* Opera 4-6 */
// white-space: -o-normal; /* Opera 7 */
word-break: break-word;
}
}
.full.height {

View File

@ -168,7 +168,7 @@ func Diff(ctx *middleware.Context) {
}
}
ctx.Data["Style"] = ctx.Query("style") == "split"
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName
ctx.Data["IsImageFile"] = commit.IsImageFile
@ -214,7 +214,7 @@ func CompareDiff(ctx *middleware.Context) {
}
commits = models.ValidateCommitsWithEmails(commits)
ctx.Data["Style"] = ctx.Query("style") == "split"
ctx.Data["IsSplitStyle"] = ctx.Query("style") == "split"
ctx.Data["CommitRepoLink"] = ctx.Repo.RepoLink
ctx.Data["Commits"] = commits
ctx.Data["CommitCount"] = commits.Len()

View File

@ -6,7 +6,7 @@
<i class="fa fa-retweet"></i>
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
<div class="ui right">
<a class="ui tiny basic toggle button" href="?style={{if .Style}}inline{{else}}split{{end}}">{{ if .Style }}{{.i18n.Tr "repo.diff.show_inline_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}">{{ if .IsSplitStyle }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}</a>
<a class="ui tiny basic toggle button" data-target="#diff-files">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
</div>
</div>
@ -33,9 +33,9 @@
</ol>
</div>
{{if .Style}}
{{if .IsSplitStyle}}
{{ template "repo/diff_box_split" . }}
{{else}}
{{ template "repo/diff_box_inline" . }}
{{ template "repo/diff_box_unified" . }}
{{end}}
{{end}}

View File

@ -81,10 +81,6 @@
prev.children().eq(2).html($(this).children().eq(2).html());
prev.children().eq(3).addClass('add-code');
prev.children().eq(2).addClass('add-code');
// prev.children().eq(2).attr('style', 'background-color: #eaffea !important');
// prev.children().eq(2).children().eq(0).attr('style', 'background-color: #eaffea !important');
// prev.children().eq(3).attr('style', 'background-color: #eaffea !important');
// prev.children().eq(3).children().eq(0).attr('style', 'background-color: #eaffea !important');
$(this).remove();
}
});

View File

@ -57,15 +57,6 @@
</tbody>
</table>
</div>
<script>
(function() {
$('tr.del-code').each(function() {
if($(this).next().hasClass('add-code')) {
// $($(this).children()[3]).replaceWith($(this).next().children()[3]);
}
});
}());
</script>
{{end}}
{{end}}
</div>