Added some more help for resources and projectId
This commit is contained in:
parent
56018a12af
commit
b893d8933c
|
@ -26,9 +26,47 @@ block content
|
|||
.col-6
|
||||
input.form-control(type="number", value=session.user._projectId.value, name="projectId", id="projectId")
|
||||
.col-2
|
||||
|
||||
.form-group.row
|
||||
.col-2
|
||||
.col-8.form-text.text-muted.
|
||||
If you don't know your resources and your project id, simply go
|
||||
to your edt, click the export button, click on <emp>Generate
|
||||
url</em>, copy the url you get and paste it in the field below,
|
||||
and click the <em>Set from url</em> button.
|
||||
.col-2
|
||||
|
||||
.form-group.row
|
||||
.col-2
|
||||
label.col-2.col-from-label(for="url") Set from url
|
||||
.col-4
|
||||
input.form-control(type="text", id="url", placeholder="Url generated from edt")
|
||||
.col-2
|
||||
#urlButton.btn.btn-primary Set from url
|
||||
|
||||
.form-group.row
|
||||
.col-4
|
||||
.col-4
|
||||
input.btn.btn-primary.form-control(type="submit", value="Submit")
|
||||
.col-4
|
||||
|
||||
block extrajs
|
||||
script.
|
||||
var urlButton = document.getElementById('urlButton');
|
||||
var url = document.getElementById('url');
|
||||
var resources = document.getElementById('resources');
|
||||
var projectId = document.getElementById('projectId');
|
||||
|
||||
urlButton.addEventListener('click', function() {
|
||||
var urlContent = url.value;
|
||||
var values = urlContent.split('?')[1].split('&');
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
var params = values[i].split('=');
|
||||
var key = params[0];
|
||||
if (key === 'resources') {
|
||||
resources.value = parseInt(params[1], 10);
|
||||
} else if (key === 'projectId') {
|
||||
projectId.value = parseInt(params[1], 10);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue