summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-20 21:29:02 +0800
committerFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-20 21:29:02 +0800
commit7f1fdf441fa9b4bee05de5abdb94191a4b8971c8 (patch)
treefa2d758e4c626875604b8a8b75798e0a161bb920 /public
parent42b08ff26158b9c815d13a427c596bd76468beb8 (diff)
parentc8790eb7d367cec25f1201f923ca017268fe157d (diff)
downloadgitea-7f1fdf441fa9b4bee05de5abdb94191a4b8971c8.tar.gz
gitea-7f1fdf441fa9b4bee05de5abdb94191a4b8971c8.zip
Merge remote-tracking branch 'origin/master'
Conflicts: public/js/app.js
Diffstat (limited to 'public')
-rwxr-xr-xpublic/css/gogs.css3
-rw-r--r--public/js/app.js48
2 files changed, 25 insertions, 26 deletions
diff --git a/public/css/gogs.css b/public/css/gogs.css
index 41e4be9a4c..3a8760c355 100755
--- a/public/css/gogs.css
+++ b/public/css/gogs.css
@@ -647,6 +647,9 @@ html, body {
padding: 30px 30px 50px;
border: none;
background-color: #FFF;
+ overflow: auto;
+ overflow-x: auto;
+ overflow-y: hidden;
}
.file-content .file-body pre {
diff --git a/public/js/app.js b/public/js/app.js
index 64cc980fd8..a39976006f 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -72,18 +72,16 @@ var Gogits = {
prettyPrint();
var $lineNums = $pre.parent().siblings('.lines-num');
- if ($lineNums.length > 0) {
+ if($lineNums.length > 0){
var nums = $pre.find('ol.linenums > li').length;
- for (var i = 1; i <= nums; i++) {
- $lineNums.append('<span id="L' + i + '" rel=".L' + i + '">' + i + '</span>');
+ for(var i=0;i < nums;i++){
+ $lineNums.append('<span id="L'+i+'" rel=".L'+i+'">'+(i+1)+'</span>');
}
var last;
- $(document).on('click', '.lines-num span', function () {
+ $(document).on('click', '.lines-num span', function(){
var $e = $(this);
- console.log($e.parent().siblings('.lines-code').find('ol.linenums > ' + $e.attr('rel')));
- console.log('ol.linenums > ' + $e.attr('rel'));
- if (last) {
+ if(last){
last.removeClass('active');
}
last = $e.parent().siblings('.lines-code').find('ol.linenums > ' + $e.attr('rel'));
@@ -98,12 +96,12 @@ var Gogits = {
var node = $(this);
var val = encodeURIComponent(node.text().toLowerCase().replace(/[^\w\- ]/g, '').replace(/[ ]/g, '-'));
var name = val;
- if (headers[val] > 0) {
+ if(headers[val] > 0){
name = val + '-' + headers[val];
}
- if (headers[val] == undefined) {
+ if(headers[val] == undefined){
headers[val] = 1;
- } else {
+ }else{
headers[val] += 1;
}
node = node.wrap('<div id="' + name + '" class="anchor-wrap" ></div>');
@@ -183,22 +181,20 @@ function initUserSetting() {
}
function initRepository() {
- (function () {
- var $guide = $('.guide-box');
- if ($guide.length) {
- var $url = $('#guide-clone-url');
- $guide.find('button[data-url]').on("click",function () {
- var $this = $(this);
- if (!$this.hasClass('btn-primary')) {
- $guide.find('.btn-primary').removeClass('btn-primary').addClass("btn-default");
- $(this).addClass('btn-primary').removeClass('btn-default');
- $url.val($this.data("url"));
- $guide.find('span.clone-url').text($this.data('url'));
- }
- }).eq(0).trigger("click");
- // todo copy to clipboard
- }
- })();
+ var $guide = $('.guide-box');
+ if ($guide.length) {
+ var $url = $('#guide-clone-url');
+ $guide.find('button[data-url]').on("click",function () {
+ var $this = $(this);
+ if (!$this.hasClass('btn-primary')) {
+ $guide.find('.btn-primary').removeClass('btn-primary').addClass("btn-default");
+ $(this).addClass('btn-primary').removeClass('btn-default');
+ $url.val($this.data("url"));
+ $guide.find('span.clone-url').text($this.data('url'));
+ }
+ }).eq(0).trigger("click");
+ // todo copy to clipboard
+ }
}
(function ($) {