Skip to content

Commit

Permalink
Don't require including cloned dir name in path to open (#79)
Browse files Browse the repository at this point in the history
Don't require including cloned dir name in path to open
  • Loading branch information
choldgraf authored May 2, 2019
2 parents 6ba3672 + 2d4b825 commit f940781
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
21 changes: 11 additions & 10 deletions docs/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ <h1>nbgitpuller link generator</h1>
</div>
</div>

<div class="form-group row" id="filepath-container">
<label for="filepath" class="col-sm-2 col-form-label">File to open</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="filepath" placeholder="index.ipynb"
oninput="displayLink()">
<small class="form-text text-muted">
This file or directory from within the repo will open when user clicks the link.
</small>
</div>
</div>

<div class="form-group row" id="app-container">
<div class="col-sm-2 col-form-label">
<label for="app" class=>Application to Open</label>
Expand Down Expand Up @@ -119,16 +130,6 @@ <h1>nbgitpuller link generator</h1>
</div>
</div>

<div class="form-group row" id="filepath-container">
<label for="filepath" class="col-sm-2 col-form-label">File to open</label>
<div class="col-sm-10">
<input class="form-control" type="text" id="filepath" placeholder="index.ipynb"
oninput="displayLink()">
<small class="form-text text-muted">
This file or directory from within the repo will open when user clicks the link.
</small>
</div>
</div>
</form>
</div>
</body>
Expand Down
3 changes: 2 additions & 1 deletion docs/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function displayLink() {
if (appName === 'custom') {
var urlPath = document.getElementById('urlpath').value;
} else {
var urlPath = apps[appName].generateUrlPath(filePath);
var repoName = new URL(repoUrl).pathname.split('/').pop().replace(/\.git$/, '');
var urlPath = apps[appName].generateUrlPath(repoName + '/' + filePath);
}

document.getElementById('default-link').value = generateRegularUrl(
Expand Down

0 comments on commit f940781

Please sign in to comment.