git-object-browser 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,6 +112,11 @@ angular.module('GitObjectBrowser', ['ngResource'])
112
112
  function GitCtrl($scope, $location, $routeParams, $rootScope, $resource, $http) {
113
113
  if (! $rootScope.diffCache) $rootScope.diffCache = {};
114
114
  if (! $rootScope.noteCache) $rootScope.noteCache = {};
115
+ $scope.steps = config.steps;
116
+ $scope.stepLinkEnabled = (config.steps.length > 0);
117
+
118
+ $scope.stepPrev = function() { $scope.$emit('stepPrev', {}); };
119
+ $scope.stepNext = function() { $scope.$emit('stepNext', {}); };
115
120
 
116
121
  // reset scrollBottom event handler
117
122
  angular.element(window).unbind('scroll');
@@ -238,6 +243,10 @@ function GitCtrl($scope, $location, $routeParams, $rootScope, $resource, $http)
238
243
  } else if (json.type == "directory") {
239
244
  template = json.type;
240
245
  loadDiffData();
246
+ } else if (json.type == "pack_index") {
247
+ var last_page = Math.ceil(json.entry_count / json.per_page);
248
+ $scope.scrollBottomEnabled = (json.page < last_page);
249
+ template = json.type;
241
250
  } else {
242
251
  template = json.type;
243
252
  }
@@ -455,7 +464,7 @@ function PackIndexCtrl($scope, $location, $routeParams, $rootScope, $resource, $
455
464
 
456
465
  $scope.packUrl = $scope.path.replace(/.idx$/, '.pack');
457
466
  $scope.lastPage = 1;
458
- $scope.scrollBottomEnabled = true;
467
+ $scope.scrollBottomEnabled = $scope.$parent.scrollBottomEnabled;
459
468
 
460
469
  var resourceLoaded = function(json) {
461
470
  $scope.object.entries = $scope.object.entries.concat(json.object.entries);
@@ -481,23 +490,34 @@ function PackIndexCtrl($scope, $location, $routeParams, $rootScope, $resource, $
481
490
 
482
491
  }
483
492
 
484
- function MenuCtrl($scope, $location, $routeParams) {
493
+ function MenuCtrl($scope, $location, $routeParams, $rootScope) {
485
494
  $scope.steps = config.steps;
486
495
 
487
- $scope.stepPrev = function() {
496
+ $scope.stepPrev = function(goRoot = true) {
488
497
  var idx = getStepIndex();
489
498
  if (idx.index > 0) {
490
- $location.path('/' + $scope.steps[idx.index - 1].name + '/' + idx.file);
499
+ if (goRoot) {
500
+ $location.path('/' + $scope.steps[idx.index - 1].name + '/.git/');
501
+ } else {
502
+ $location.path('/' + $scope.steps[idx.index - 1].name + '/' + idx.file);
503
+ }
491
504
  }
492
505
  }
493
506
 
494
- $scope.stepNext = function() {
507
+ $scope.stepNext = function(goRoot = true) {
495
508
  var idx = getStepIndex();
496
509
  if (idx.index < $scope.steps.length - 1) {
497
- $location.path('/' + $scope.steps[idx.index + 1].name + '/' + idx.file);
510
+ if (goRoot) {
511
+ $location.path('/' + $scope.steps[idx.index + 1].name + '/.git/');
512
+ } else {
513
+ $location.path('/' + $scope.steps[idx.index + 1].name + '/' + idx.file);
514
+ }
498
515
  }
499
516
  }
500
517
 
518
+ $rootScope.$on('stepPrev', function() { $scope.stepPrev(false); });
519
+ $rootScope.$on('stepNext', function() { $scope.stepNext(false); });
520
+
501
521
  var getStepIndex = function() {
502
522
  var path = $location.path();
503
523
  if (! path.match(/\/([^\/]+)\/(.+)/)) return null;
@@ -3,6 +3,15 @@
3
3
  <span data-ng-repeat="token in pathTokens"><a href="#{{basedir}}/{{token.path}}" style="color:black">{{token.label}}</a><span data-ng-hide="token.last">/</span></span>
4
4
  <small>Directory</small></h1>
5
5
 
6
+ <div class="tabbable">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="">List</a></li>
9
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
11
+ </ul>
12
+ <div class="tab-content">
13
+ <div class="tab-pane active" id="list">
14
+
6
15
  <table class="table table-striped table-condensed">
7
16
  <thead>
8
17
  <th>file</th>
@@ -24,4 +33,7 @@
24
33
  </tbody>
25
34
  </table>
26
35
 
36
+ </div>
37
+ </div>
38
+ </div>
27
39
  </article>
@@ -3,6 +3,18 @@
3
3
  <span data-ng-repeat="token in pathTokens"><a href="#{{basedir}}/{{token.path}}" style="color:black">{{token.label}}</a><span data-ng-hide="token.last">/</span></span>
4
4
  <small>File</small></h1>
5
5
 
6
- <pre>{{object.content}}</pre>
6
+ <div class="tabbable">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="">Plain</a></li>
9
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
11
+ </ul>
12
+
13
+ <div class="tab-content">
14
+ <div class="tab-pane active" id="plain">
15
+ <pre>{{object.content}}</pre>
16
+ </div>
17
+ </div>
18
+ </div>
7
19
 
8
20
  </article>
@@ -3,6 +3,15 @@
3
3
  <span data-ng-repeat="token in pathTokens"><a href="#{{basedir}}/{{token.path}}" style="color:black">{{token.label}}</a><span data-ng-hide="token.last">/</span></span>
4
4
  <small>Index</small></h1>
5
5
 
6
+ <div class="tabbable">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="">Parsed</a></li>
9
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
11
+ </ul>
12
+ <div class="tab-content">
13
+ <div class="tab-pane active" id="parsed">
14
+
6
15
  <table class="table">
7
16
  <tr>
8
17
  <th>version</th>
@@ -42,5 +51,9 @@
42
51
 
43
52
  </table>
44
53
 
54
+ </div>
55
+ </div>
56
+ </div>
57
+
45
58
  </article>
46
59
 
@@ -3,6 +3,15 @@
3
3
  <span data-ng-repeat="token in pathTokens"><a href="#{{basedir}}/{{token.path}}" style="color:black">{{token.label}}</a><span data-ng-hide="token.last">/</span></span>
4
4
  <small>Index Entry</small></h1>
5
5
 
6
+ <div class="tabbable">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="">Parsed</a></li>
9
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
11
+ </ul>
12
+ <div class="tab-content">
13
+ <div class="tab-pane active" id="parsed">
14
+
6
15
  <table class="table">
7
16
  <tr>
8
17
  <th>version</th>
@@ -52,5 +61,9 @@
52
61
  </tbody>
53
62
  </table>
54
63
 
64
+ </div>
65
+ </div>
66
+ </div>
67
+
55
68
  </article>
56
69
 
@@ -3,6 +3,15 @@
3
3
  <span data-ng-repeat="token in pathTokens"><a href="#{{basedir}}/{{token.path}}" style="color:black">{{token.label}}</a><span data-ng-hide="token.last">/</span></span>
4
4
  <small>References</small></h1>
5
5
 
6
+ <div class="tabbable">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="">Parsed</a></li>
9
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
11
+ </ul>
12
+ <div class="tab-content">
13
+ <div class="tab-pane active" id="parsed">
14
+
6
15
  <table class="table table-striped">
7
16
  <thead>
8
17
  <tr>
@@ -26,4 +35,9 @@
26
35
  </table>
27
36
 
28
37
  <a href="#{{basedir}}/.git/packed-refs" data-ng-show="limited">Show All</a>
38
+
39
+ </div>
40
+ </div>
41
+ </div>
42
+
29
43
  </article>
@@ -7,6 +7,8 @@
7
7
  <ul class="nav nav-tabs">
8
8
  <li class="active"><a href="#parsed" data-toggle="tab">Parsed</a></li>
9
9
  <li><a href="#plain" data-toggle="tab">Plain</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
11
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
10
12
  </ul>
11
13
  <div class="tab-content">
12
14
  <div class="tab-pane active" id="parsed">
@@ -1,7 +1,17 @@
1
+ <article>
1
2
  <h1><i class="icon-folder-open"></i>
2
3
  <span data-ng-repeat="token in pathTokens"><a href="#{{basedir}}/{{token.path}}" style="color:black">{{token.label}}</a><span data-ng-hide="token.last">/</span></span>
3
4
  <small>Directory</small></h1>
4
5
 
6
+ <div class="tabbable">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="#">List</a></li>
9
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
11
+ </ul>
12
+ <div class="tab-content">
13
+ <div class="tab-pane active" id="parsed">
14
+
5
15
  <p><i class="icon-folder-open"></i> <a href="#{{basedir}}/.git/objects/pack">pack</a></p>
6
16
 
7
17
  <table class="table table-bordered table-hover">
@@ -16,3 +26,8 @@
16
26
  </tr>
17
27
  </tbody>
18
28
  </table>
29
+
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </article>
@@ -7,6 +7,8 @@
7
7
  <ul class="nav nav-tabs">
8
8
  <li class="active"><a href="#parsed" data-toggle="tab">Parsed</a></li>
9
9
  <li><a href="#plain" data-toggle="tab">Plain</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
11
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
10
12
  </ul>
11
13
  <div class="tab-content">
12
14
  <div class="tab-pane active" id="parsed">
@@ -41,5 +43,3 @@
41
43
  </div>
42
44
  </div>
43
45
  </article>
44
-
45
- </article>
@@ -7,6 +7,8 @@
7
7
  <ul class="nav nav-tabs">
8
8
  <li class="active"><a href="#parsed" data-toggle="tab">Parsed</a></li>
9
9
  <li><a href="#plain" data-toggle="tab">Plain</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
11
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
10
12
  </ul>
11
13
  <div class="tab-content">
12
14
  <div class="tab-pane active" id="parsed">
@@ -29,5 +31,4 @@
29
31
  </div>
30
32
  </div>
31
33
 
32
-
33
34
  </article>
@@ -7,6 +7,8 @@
7
7
  <ul class="nav nav-tabs">
8
8
  <li class="active"><a href="#parsed" data-toggle="tab">Parsed</a></li>
9
9
  <li><a href="#plain" data-toggle="tab">Plain</a></li>
10
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepPrev()">&laquo; Prev</a></li>
11
+ <li data-ng-show="stepLinkEnabled"><a href="" data-ng-click="stepNext()">Next &raquo;</a></li>
10
12
  </ul>
11
13
  <div class="tab-content">
12
14
  <div class="tab-pane active" id="parsed">
@@ -1,3 +1,3 @@
1
1
  module GitObjectBrowser
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-object-browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-21 00:00:00.000000000 Z
12
+ date: 2013-11-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Browse git raw objects.
15
15
  email:
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  segments:
203
203
  - 0
204
- hash: 229082046391325280
204
+ hash: -4245997658270478478
205
205
  requirements: []
206
206
  rubyforge_project:
207
207
  rubygems_version: 1.8.24