gitdocs 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -1
- data/lib/gitdocs/public/js/app.js +9 -6
- data/lib/gitdocs/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
GitDocs = {
|
2
2
|
// Links all breadcrumb options in the explored path
|
3
3
|
linkBreadcrumbs : function() {
|
4
|
-
var fullPath = $('span.path').text();
|
5
|
-
|
6
|
-
var docIdx = window.location.pathname.match(
|
4
|
+
var fullPath = $('span.path').text().replace(/\/+/g, '/').replace(/\/$/, '');
|
5
|
+
if (fullPath.length == 0) { return; }
|
6
|
+
var docIdx = window.location.pathname.match(/\/(\d+)/);
|
7
7
|
if (!docIdx) return false;
|
8
|
+
var paths = fullPath.split("/");
|
8
9
|
$(paths).each(function(idx, subpath) {
|
9
10
|
var relPath = paths.slice(0, idx+1).join("/");
|
10
11
|
var link = "<a href='/" + docIdx[1] + relPath + "'>" + subpath + "/</a>";
|
@@ -32,8 +33,10 @@ $(document).ready(function() {
|
|
32
33
|
|
33
34
|
// Redirect to edit page for new file when new file form is submitted
|
34
35
|
$('form.add').live('submit', function(e){
|
35
|
-
var docIdx = window.location.pathname.match(
|
36
|
+
var docIdx = window.location.pathname.match(/\/(\d+)/);
|
37
|
+
if (!docIdx) return false;
|
36
38
|
var fullPath = $('span.path').text();
|
37
|
-
|
38
|
-
|
39
|
+
var newPath = "/" + docIdx[1] + (fullPath == "/" ? "/" : fullPath + "/") + $(this).find('input.edit').val();
|
40
|
+
window.location = newPath;
|
41
|
+
e.preventDefault(); return false;
|
39
42
|
});
|
data/lib/gitdocs/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gitdocs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Josh Hull
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2011-12-
|
14
|
+
date: 2011-12-14 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: joshbuddy-guard
|