Bläddra i källkod

Changed name from inline to unified

Kim "BKC" Carlbäcker 9 år sedan
förälder
incheckning
8fe5d887ae

+ 1 - 1
conf/locale/locale_en-US.ini

@@ -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

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
modules/bindata/bindata.go


+ 1 - 8
public/css/gogs.css

@@ -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;

+ 4 - 4
public/less/_base.less

@@ -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 {

+ 2 - 2
routers/repo/commit.go

@@ -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()

+ 3 - 3
templates/repo/diff_box.tmpl

@@ -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}}

+ 0 - 4
templates/repo/diff_box_split.tmpl

@@ -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();
 							}
 						});

+ 0 - 9
templates/repo/diff_box_inline.tmpl → templates/repo/diff_box_unified.tmpl

@@ -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>

Vissa filer visades inte eftersom för många filer har ändrats