gitdocs 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -7,4 +7,8 @@
7
7
 
8
8
  * Fixes search on blank results case
9
9
 
10
- 0.4.3 (Not Yet Released)
10
+ 0.4.3 (12/13/2012)
11
+
12
+ * Javascript fixes for front-end
13
+
14
+ 0.4.4 (Not Yet Released)
@@ -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
- var paths = fullPath.split("/");
6
- var docIdx = window.location.pathname.match(/(\d+)\//);
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(/(\d+)\//);
36
+ var docIdx = window.location.pathname.match(/\/(\d+)/);
37
+ if (!docIdx) return false;
36
38
  var fullPath = $('span.path').text();
37
- window.location = "/" + docIdx[1] + fullPath + "/" + $(this).find('input.edit').val();
38
- e.preventDefault();
39
+ var newPath = "/" + docIdx[1] + (fullPath == "/" ? "/" : fullPath + "/") + $(this).find('input.edit').val();
40
+ window.location = newPath;
41
+ e.preventDefault(); return false;
39
42
  });
@@ -1,3 +1,3 @@
1
1
  module Gitdocs
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gitdocs
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.2
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-13 00:00:00 Z
14
+ date: 2011-12-14 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: joshbuddy-guard