Sha256: 9f5a8986cb41f364e0690b3e201c8519f1c8458ede9bc60a343c71727b250e86

Contents?: true

Size: 872 Bytes

Versions: 7

Compression:

Stored size: 872 Bytes

Contents

GitDocs = {
  // Links all breadcrumb options in the explored path
  linkBreadcrumbs : function() {
    var fullPath = $('span.path').text();
    var paths = fullPath.split("/");
    var docIdx = window.location.pathname.match(/(\d+)\//);
    if (!docIdx) return false;
    $(paths).each(function(idx, subpath) {
      var relPath = paths.slice(0, idx+1).join("/");
      var link = "<a href='/" + docIdx[1] + relPath + "'>" + subpath + "/</a>";
      fullPath = fullPath.replace(subpath + "/", link);
    });
    $('span.path').html(fullPath);
  }
};

$(document).ready(function() {
  GitDocs.linkBreadcrumbs();
});

$('form.add').live('submit', function(e){
  var docIdx = window.location.pathname.match(/(\d+)\//);
  var fullPath = $('span.path').text();
  window.location = "/" + docIdx[1] + fullPath + "/" + $(this).find('input.edit').val();
  e.preventDefault();
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gitdocs-0.3.6 lib/gitdocs/public/js/app.js
gitdocs-0.3.5 lib/gitdocs/public/js/app.js
gitdocs-0.3.4 lib/gitdocs/public/js/app.js
gitdocs-0.3.3 lib/gitdocs/public/js/app.js
gitdocs-0.3.2 lib/gitdocs/public/js/app.js
gitdocs-0.3.1 lib/gitdocs/public/js/app.js
gitdocs-0.3.0 lib/gitdocs/public/js/app.js