Browse Source

Changes to be committed:

modified:   public/css/gogs.css
	modified:   public/js/gogs.js
	modified:   templates/repo/view_file.tmpl
pull/4590/head
28111600 8 years ago
parent
commit
773f393afd
  1. 14
      public/css/gogs.css
  2. 8
      public/js/gogs.js
  3. 2
      templates/repo/view_file.tmpl

14
public/css/gogs.css

@ -1480,12 +1480,11 @@ footer .ui.language .menu {
.repository.file.list #file-content .code-view table { .repository.file.list #file-content .code-view table {
width: 100%; width: 100%;
} }
.repository.file.list #file-content .code-view td{ .repository.file.list #file-content .code-view td {
border: none; border: none;
} }
.repository.file.list #file-content .code-view .blob-num { .repository.file.list #file-content .code-view .blob-num {
width: 1%; width: 1%;
min-width: 50px;
line-height: 20px; line-height: 20px;
cursor: pointer; cursor: pointer;
text-align: right; text-align: right;
@ -1505,15 +1504,14 @@ footer .ui.language .menu {
} }
.repository.file.list #file-content .code-view .blob-code pre, .repository.file.list #file-content .code-view .blob-code pre,
.repository.file.list #file-content .code-view .blob-code .hljs { .repository.file.list #file-content .code-view .blob-code .hljs {
background-color: white;
margin: 0; margin: 0;
padding: 0 !important; padding: 0 !important;
} }
.repository.file.list #file-content .code-view .blob-code {
.repository.file.list #file-content .code-view .blob-code pre li.active, background-color: white;
.repository.file.list #file-content .code-view .blob-code ol li.active, }
.repository.file.list #file-content .code-view .blob-code .hljs li.active { .repository.file.list #file-content .code-view .blob-code.active {
background: #ffffdd; background: #ffffdd !important;;
} }
.repository.file.list .sidebar { .repository.file.list .sidebar {

8
public/js/gogs.js

@ -1048,11 +1048,11 @@ function searchRepositories() {
function initCodeView() { function initCodeView() {
if ($('.code-view .linenums').length > 0) { if ($('.code-view .linenums').length > 0) {
$(document).on('click', '.lines-num span', function (e) { $(document).on('click', '.blob-num', function (e) {
var $select = $(this); var $select = $(this);
var $list = $select.parent().siblings('.lines-code').find('ol.linenums > li'); var $code = $select.parent().find('.blob-code');
selectRange($list, $list.filter('[rel=' + $select.attr('id') + ']'), (e.shiftKey ? $list.filter('.active').eq(0) : null)); $select.parent().parent().find(".blob-code").removeClass("active");
deSelect(); $code.addClass("active");
}); });
$(window).on('hashchange', function (e) { $(window).on('hashchange', function (e) {

2
templates/repo/view_file.tmpl

@ -35,7 +35,7 @@
</div> </div>
{{end}} {{end}}
</h4> </h4>
<div class="ui attached table segment"> <div class="ui attached table unstackable segment">
<div id="{{if .IsIPythonNotebook}}ipython-notebook{{end}}" class="file-view {{if .IsMarkdown}}markdown{{else if .IsIPythonNotebook}}ipython-notebook{{else if .ReadmeInList}}plain-text{{else if and .IsTextFile}}code-view{{end}} has-emoji"> <div id="{{if .IsIPythonNotebook}}ipython-notebook{{end}}" class="file-view {{if .IsMarkdown}}markdown{{else if .IsIPythonNotebook}}ipython-notebook{{else if .ReadmeInList}}plain-text{{else if and .IsTextFile}}code-view{{end}} has-emoji">
{{if .IsMarkdown}} {{if .IsMarkdown}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}} {{if .FileContent}}{{.FileContent | Str2html}}{{end}}

Loading…
Cancel
Save