Skip to content

Commit

Permalink
add upload to hololink foolproof instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
EiffelFly committed Nov 1, 2020
1 parent 47ccb9b commit dec73d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<small id="userIndicator" class="form-text text-muted web-title-help"></small>
</div>
<div class="searchable-project-dropdown" style="margin: 20px 5%;">
<select class="selectpicker form-control" multiple id="select-project" aria-placeholder="Choose project" data-live-search="true">
<select class="selectpicker form-control" multiple id="select-project" aria-placeholder="Choose project" data-live-search="true" title="Upload to one or multiple galaxies">
</select>
<small class="form-text text-muted" style="padding-left: 10px;">If you doesn't get any option, please create galaxy at home page first.</small>
</div>
Expand All @@ -94,7 +94,7 @@
<hr>

<div class="popup_spacing" row='2'></div>
<button id="upload_hololink_button" class="btn btn-light upload_hololink_button">Upload Hololink</button>
<button id="upload_hololink_button" class="btn btn-light upload_hololink_button">Upload to Hololink</button>
<small class="upload_warning" id="upload_warning"></small>
</div>
</body>
Expand Down
4 changes: 3 additions & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(function(){

// Upload foolproof
$('#upload_hololink_button').prop("disabled", true);
$('#upload_warning').html(`Please choose project`)
$('#upload_hololink_button').html(`Galaxy is not selected`)

chrome.tabs.query({active:true, currentWindow:true},function(tab){ /*之所以要放上 currentWindow 的原因在於如果不加這個指令,系統會以為你是指 popup,這樣會回傳 undefined */

Expand Down Expand Up @@ -81,8 +81,10 @@ $(function(){

if ( !Array.isArray(userSelectedProjectsId) || !userSelectedProjectsId.length ){
$('#upload_hololink_button').prop("disabled", true);
$('#upload_hololink_button').html(`Galaxy is not selected`)
} else {
$('#upload_hololink_button').prop("disabled", false);
$('#upload_hololink_button').html(`Upload to Hololink`)
}
console.log(userSelectedProjectsId)
});
Expand Down

0 comments on commit dec73d4

Please sign in to comment.