Skip to content

Commit

Permalink
Merge pull request #107 from consideRatio/app-type-from-query-params
Browse files Browse the repository at this point in the history
Link generator: init application type from query params
  • Loading branch information
consideRatio authored Oct 2, 2019
2 parents a87889c + 7ba4a19 commit e002f7b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/_static/link_gen/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,22 @@ function populateFromQueryString() {
// preseed values if specified in the url
var params = new URLSearchParams(window.location.search);
// Parameters are read from query string, and <input> fields are set to them
var allowedParams = ['hub', 'repo', 'branch'];
var allowedParams = ['hub', 'repo', 'branch', 'app', 'urlpath'];
if (params.has("urlpath")) {
// setting urlpath implies a custom app
document.getElementById('app-custom').checked = true;
}
for (var i = 0; i < allowedParams.length; i++) {
var param = allowedParams[i];
if (params.has(param)) {
document.getElementById(param).value = params.get(param);
if ((param === 'app') && !params.has("urlpath")) {
radioId = 'app-' + params.get(param).toLowerCase();
document.getElementById(radioId).checked = true;
} else {
document.getElementById(param).value = params.get(param);
}
}
}

}

/**
Expand Down

0 comments on commit e002f7b

Please sign in to comment.