Skip to content

Commit 02d49b3

Browse files
committed
fixed conflicts
2 parents ead0dc7 + 89f6b57 commit 02d49b3

File tree

2 files changed

+19
-36
lines changed

2 files changed

+19
-36
lines changed

_static/link_gen/link.js

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ function generateRegularUrl(hubUrl, urlPath, repoUrl, branch, compressed, conten
55
var url = new URL(hubUrl);
66

77
url.searchParams.set('repo', repoUrl);
8-
98
if(compressed) {
109
url.searchParams.set('content_provider', contentProvider);
1110
}
12-
1311
if (urlPath) {
1412
url.searchParams.set('urlpath', urlPath);
1513
}
@@ -19,7 +17,7 @@ function generateRegularUrl(hubUrl, urlPath, repoUrl, branch, compressed, conten
1917
} else if(contentProvider == "git"){
2018
url.searchParams.set('branch', "main");
2119
}
22-
20+
2321
if (!url.pathname.endsWith('/')) {
2422
url.pathname += '/'
2523
}
@@ -35,11 +33,9 @@ function generateCanvasUrl(hubUrl, urlPath, repoUrl, branch, compressed, content
3533
var nextUrlParams = new URLSearchParams();
3634

3735
nextUrlParams.append('repo', repoUrl);
38-
3936
if(compressed) {
4037
nextUrlParams.append('content_provider', contentProvider);
4138
}
42-
4339
if (urlPath) {
4440
nextUrlParams.append('urlpath', urlPath);
4541
}
@@ -73,7 +69,6 @@ function generateBinderUrl(hubUrl, userName, envRepoName, envGitBranch, urlPath,
7369
if(compressed) {
7470
nextUrlParams.append('content_provider', contentProvider);
7571
}
76-
7772
if (urlPath) {
7873
nextUrlParams.append('urlpath', urlPath);
7974
}
@@ -127,25 +122,21 @@ function clearLinks(){
127122
document.getElementById('canvas-link').value = "";
128123
}
129124

130-
131125
function changeTab(div) {
132126
var hub = document.getElementById("hub");
133127
var hub_help_text = document.getElementById("hub-help-text");
134128
var env_repo_group = document.getElementById("env-repo-group");
135129
var env_repo = document.getElementById("env-repo");
136130
var id = div.id;
137131
var form = document.getElementById('linkgenerator');
138-
139132
clearLinks();
140133
if (id.includes("binder")) {
141134
hub.placeholder = "https://mybinder.org";
142135
hub.value = "https://mybinder.org";
143136
hub_help_text.hidden = true;
144137
hub.labels[0].innerHTML = "BinderHub URL";
145-
146138
env_repo_group.style.display = '';
147139
env_repo.disabled = false;
148-
149140
} else {
150141
hub.placeholder = "https://hub.example.com";
151142
hub.value = "";
@@ -173,7 +164,7 @@ function changeTab(div) {
173164
*/
174165
function generateCloneDirectoryName(gitCloneUrl) {
175166
if(gitCloneUrl.slice(-1) == "/")
176-
gitCloneUrl = gitCloneUrl.slice(0,-1);
167+
gitCloneUrl = gitCloneUrl.slice(0,-1);
177168
var lastPart = gitCloneUrl.split('/').slice(-1)[0];
178169
return lastPart.split(':').slice(-1)[0].replace(/(\.git|\.bundle)?/, '');
179170
}
@@ -216,7 +207,6 @@ function configureContentProviderAttrs(args){
216207

217208
function displayLink() {
218209
var form = document.getElementById('linkgenerator');
219-
220210
form.classList.add('was-validated');
221211
if (form.checkValidity()) {
222212
var hubUrl = document.getElementById('hub').value;
@@ -298,13 +288,13 @@ function populateFromQueryString() {
298288
}
299289

300290
function hideShowByClassName(cls, hideShow){
301-
[].forEach.call(document.querySelectorAll(cls), function (el) {
302-
el.style.display = hideShow;
303-
setDisabled = (hideShow == 'none')
304-
$(el).find("input").each(function(){
305-
$(this).prop("disabled", setDisabled);
291+
[].forEach.call(document.querySelectorAll(cls), function (el) {
292+
el.style.display = hideShow;
293+
setDisabled = (hideShow == 'none')
294+
$(el).find("input").each(function(){
295+
$(this).prop("disabled", setDisabled);
296+
});
306297
});
307-
});
308298
}
309299
/**
310300
* Depending on the content provider selected this hides and shows the appropriate divs
@@ -338,7 +328,6 @@ function render() {
338328
var form = document.getElementById('linkgenerator');
339329
var appName = form.querySelector('input[name="app"]:checked').value;
340330

341-
342331
if (appName == 'custom') {
343332
document.getElementById('urlpath').disabled = false;
344333
document.getElementById('filepath').disabled = true;
@@ -352,7 +341,6 @@ function render() {
352341
document.getElementById('filepath').disabled = false;
353342
}
354343
}
355-
356344
displayLink();
357345
}
358346

@@ -371,11 +359,9 @@ function main() {
371359
element.addEventListener('change', function(){
372360
displayContentProvider();
373361
render();
374-
}
375-
);
362+
});
376363
}
377364
)
378-
379365
document.querySelectorAll('#linkgenerator input[type="text"], #linkgenerator input[type="url"]').forEach(
380366
function (element) {
381367
element.addEventListener('input', render);
@@ -394,7 +380,6 @@ function main() {
394380
}
395381
}
396382

397-
398383
// Do an initial render, to make sure our disabled / enabled properties are correctly set
399384
displayContentProvider();
400385
render();

link.html

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
221221
</small>
222222
</div>
223223
</div>
224-
224+
225225
<div class="form-group row content-provider-env" id="env-repo-group" style="display:none">
226226
<label for="env-repo" class="col-sm-2 col-form-label">Git Environment Repository URL</label>
227227
<div class="col-sm-6">
@@ -230,7 +230,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
230230
<div class="invalid-feedback">
231231
Must be a valid git URL
232232
</div>
233-
<small class="form-text text-muted" id="env-repo-help-text" >
233+
<small class="form-text text-muted" id="env-repo-help-text">
234234
The environment repository must have
235235
<a href="https://github.com/jupyterhub/nbgitpuller">nbgitpuller</a> installed.
236236
</small>
@@ -252,7 +252,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
252252
</div>
253253
</div>
254254
</div>
255-
255+
256256
<div class="form-group row" id="app-content-provider">
257257
<div class="col-sm-2 col-form-label">
258258
<label for="app-content-provider" class=>Notebook Content Provider</label>
@@ -286,7 +286,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
286286
</div>
287287
</div>
288288
</div>
289-
289+
290290

291291

292292
<div class="form-group row content-provider content-provider-git" id="content-repo-group">
@@ -299,15 +299,14 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
299299
</div>
300300
</div>
301301
<div class="col-sm-4">
302-
<div class="input-group" id="content-branch-group" >
302+
<div class="input-group" id="content-branch-group">
303303
<div class="input-group-prepend">
304304
<span class="input-group-text" id="content-branch-prepend-label">branch</span>
305305
</div>
306306
<input name="content-branch" id="content-branch" type="text" placeholder="main" aria-label="Branch Name" aria-describedby="content-branch-prepend-label">
307307
<small id="default-content-message" class="form-text text-muted">
308-
If left blank, the default branch of your repository is used. Also note, Github now names the default branch <code>main</code> instead of <code>master</code> on
309-
<a href="https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/">
310-
new GitHub repositories</a>
308+
If left blank, the default branch of your repository is used. Also note, Github now names the default branch <code>main</code> instead of <code>master</code> on
309+
<a href="https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/">new GitHub repositories</a>
311310
</small>
312311
</div>
313312
</div>
@@ -323,7 +322,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
323322
</div>
324323
</div>
325324
</div>
326-
325+
327326
<div class="form-group row content-provider content-provider-dropbox">
328327
<label for="drop-url" class="col-sm-2 col-form-label">Dropbox Shared Link</label>
329328
<div class="col-sm-10">
@@ -334,7 +333,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
334333
</div>
335334
</div>
336335
</div>
337-
336+
338337
<div class="form-group row content-provider content-provider-generic-web">
339338
<label for="generic-web-url" class="col-sm-2 col-form-label">Public URL to archive</label>
340339
<div class="col-sm-10">
@@ -345,7 +344,6 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
345344
</div>
346345
</div>
347346
</div>
348-
349347
<div class="form-group row" id="filepath-container">
350348
<label for="filepath" class="col-sm-2 col-form-label">File to open</label>
351349
<div class="col-sm-10">
@@ -356,7 +354,7 @@ <h1>nbgitpuller link generator<a class="headerlink" href="#nbgitpuller-link-gene
356354
</small>
357355
</div>
358356
</div>
359-
357+
360358
<div class="form-group row" id="app-container">
361359
<div class="col-sm-2 col-form-label">
362360
<label for="app-container" class=>Application to Open</label>

0 commit comments

Comments
 (0)