From 15b5d46a5030b82b362bb45fab7037fb491ac9d1 Mon Sep 17 00:00:00 2001 From: turner Date: Fri, 5 Jan 2024 17:13:21 -0500 Subject: [PATCH] Local Track Files Card --- css/_localTrackFileCard.scss | 4 ++++ css/app.css | 5 +++++ css/app.css.map | 2 +- css/app.scss | 2 +- js/app.js | 27 +++++++++++++++++++++++++-- 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 css/_localTrackFileCard.scss diff --git a/css/_localTrackFileCard.scss b/css/_localTrackFileCard.scss new file mode 100644 index 0000000..5f3ab4e --- /dev/null +++ b/css/_localTrackFileCard.scss @@ -0,0 +1,4 @@ +#igv-local-track-file-card.card { + top: 128px; + left: 128px; +} diff --git a/css/app.css b/css/app.css index 58685e4..6a30c64 100644 --- a/css/app.css +++ b/css/app.css @@ -132,6 +132,11 @@ select#igv-app-track-select-modal-select option[disabled] { color: rgb(175, 175, 175); } +#igv-local-track-file-card.card { + top: 128px; + left: 128px; +} + body { padding-top: 48px; } diff --git a/css/app.css.map b/css/app.css.map index 14114af..518a4c9 100644 --- a/css/app.css.map +++ b/css/app.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["_panel.scss","_color.scss","_share-modal.scss","_encode.scss","_track-select.scss","app.scss"],"names":[],"mappings":"AAMA;EACE;EACA;EACA;EAEA;EAEA,OAXuB;EAYvB,QAXwB;EAaxB,cCTmB;EDUnB,kBCNe;EDQf;;AAEA;EAEE;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EAEA;;AAEA;EACE;EACA;EACA;EACA;EACA;EAEA;EACA,QAxCmC;EA0CnC,kBCrCa;EDuCb;EACA;;AAEA;EACE;EACA,OCjDU;EDkDV;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AE5DR;EAEE,OAJmB;;AAMnB;EACE,aAVkB;EAWlB,WAVgB;EAWhB;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE,OAtBmB;EAuBnB;;;AAGF;AAAA;AAAA;EAGE;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AEA;EACE;;;AAMN;EACE;EAEA,QAtRkC;EAwRlC;;;AAIF;EACE,kBAjSmB;;;AAoSrB;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE,OAnTqB;EAoTrB;EACA;;;AAGF;EACE,OAxTmB;EAyTnB,cA1TqB;;;AA6TvB;EACE,kBA9TqB;;;AAiUvB;EACE,kBAjUmB;;;AAoUrB;EACE;;;AAQA;EACE;EACA;EACA;EACA;EACA;EACA;;;AAKJ;EACE;;;AAIF;EACE;EACA;;;AAIF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKF;EACE;;;AAKA;EACE;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;AAGF;EACE;;;AAIJ;EACE;EACA;;;AAGF;EAEE;IACE;IACA;IAEA;IACA,QAzZoB;IA0ZpB,aA1ZoB;IA4ZpB;IACA;IACA;IACA;IACA;;EAEA;IACE,QAnakB;IAoalB,aApakB;IAqalB;IACA;;EACA;IACE,OA7aa;IA8ab;;EAIJ;IACE,QA9akB;IA+alB,aA/akB;IAgblB;IACA;;EAGF;IACE","file":"app.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["_panel.scss","_color.scss","_share-modal.scss","_encode.scss","_track-select.scss","_localTrackFileCard.scss","app.scss"],"names":[],"mappings":"AAMA;EACE;EACA;EACA;EAEA;EAEA,OAXuB;EAYvB,QAXwB;EAaxB,cCTmB;EDUnB,kBCNe;EDQf;;AAEA;EAEE;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EAEA;;AAEA;EACE;EACA;EACA;EACA;EACA;EAEA;EACA,QAxCmC;EA0CnC,kBCrCa;EDuCb;EACA;;AAEA;EACE;EACA,OCjDU;EDkDV;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AE5DR;EAEE,OAJmB;;AAMnB;EACE,aAVkB;EAWlB,WAVgB;EAWhB;;;AAIJ;EACE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Pf;;AAIJ;EACE,QA9PoB;EA+PpB,aA/PoB;EAgQpB;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAMN;EACE;EAEA,QAtRkC;EAwRlC;;;AAIF;EACE,kBAjSmB;;;AAoSrB;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE,OAnTqB;EAoTrB;EACA;;;AAGF;EACE,OAxTmB;EAyTnB,cA1TqB;;;AA6TvB;EACE,kBA9TqB;;;AAiUvB;EACE,kBAjUmB;;;AAoUrB;EACE;;;AAQA;EACE;EACA;EACA;EACA;EACA;EACA;;;AAKJ;EACE;;;AAIF;EACE;EACA;;;AAIF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAKF;EACE;;;AAKA;EACE;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;AAGF;EACE;;;AAIJ;EACE;EACA;;;AAGF;EAEE;IACE;IACA;IAEA;IACA,QAzZoB;IA0ZpB,aA1ZoB;IA4ZpB;IACA;IACA;IACA;IACA;;EAEA;IACE,QAnakB;IAoalB,aApakB;IAqalB;IACA;;EACA;IACE,OA7aa;IA8ab;;EAIJ;IACE,QA9akB;IA+alB,aA/akB;IAgblB;IACA;;EAGF;IACE","file":"app.css"} \ No newline at end of file diff --git a/css/app.scss b/css/app.scss index e11eb83..dc90822 100644 --- a/css/app.scss +++ b/css/app.scss @@ -3,7 +3,7 @@ @import "share-modal"; @import "encode"; @import "track-select"; - +@import "localTrackFileCard"; // $igv-app-light-color: #f7f7f7; $igv-app-medium-color: #a6a6a6; diff --git a/js/app.js b/js/app.js index 8815000..0680280 100644 --- a/js/app.js +++ b/js/app.js @@ -254,6 +254,7 @@ async function initializationHelper(browser, container, options) { 'igv-app-sample-info-from-url-modal', trackLoader) + const sessionSaver = () => { try { return browser.toJSON() @@ -274,8 +275,11 @@ async function initializationHelper(browser, container, options) { // console.log(str) const localTrackFileNames = trackConfigurations.filter((config) => undefined !== config.file).map(({filename}) => filename) - console.log(`Session contains local files that cannot be loaded automatically:\n${ localTrackFileNames.join('\n')}`) - alert(`Session contains local files that cannot be loaded automatically:\n${ localTrackFileNames.join('\n')}`) + + if (localTrackFileNames.length > 0) { + const el = createLocalTrackFileCard('igv-local-track-file-card', localTrackFileNames) + document.getElementById('igv-main').appendChild(el) + } } catch (e) { console.error(e) @@ -364,6 +368,25 @@ async function initializationHelper(browser, container, options) { } +function presentLocalTrackFileModal() { + console.log(`Session contains local files that cannot be loaded automatically:\n${ localTrackFileNames.join('\n')}`) + alert(`Session contains local files that cannot be loaded automatically:\n${ localTrackFileNames.join('\n')}`) +} + +function createLocalTrackFileCard(id, names){ + + const str = names.map(name => `
  • ${ name }
  • `).join('') + const html = + `
    +
    Local Track Files
    + +
    ` + + const fragment = document.createRange().createContextualFragment(html); + + return fragment.firstChild; +} + function createSampleInfoMenu(igvMain, localFileInput, initializeDropbox,