Commit 0e232b5c authored by David Hoksza's avatar David Hoksza
Browse files

first three plugins working

parent 17521111
Pipeline #8650 passed with stage
in 54 seconds
......@@ -11,6 +11,7 @@ const pluginVersion = '1.0.0';
const settings = {
disableInteraction: false
, padding: 30
};
// ******************************************************************************
......@@ -207,12 +208,27 @@ function startIntro($introContainer, intro, step = 0) {
cleanStory($introContainer);
//TODO the calc should be changed so that when the calc changes in the minerva code, the plugin still works correctly
// pluginContainer.closest('.tab-pane').css('height', 'calc(100vh - 42px - 30px)');
// $('#minervaAppDiv').css('padding', '30px');
if (settings.padding > 0) {
pluginContainer.closest('.tab-pane').css('height', `calc(100vh - 42px - ${settings.padding}px)`);
$('#minervaAppDiv').css('padding', `${settings.padding}px`);
intro.start();
//now we need to let Minerva know that a resize of the map happend which can be done only
//by simulating what Minerva does when plugin split bar is moved
$('.minerva-header-hide-button').click();
$('.minerva-header-hide-button').click();
}
// intro.start();
// for (let i = 0; i < step; i++) {
// intro.nextStep();
// }
let chain = new Promise(resolve=> {intro.start(); setTimeout(()=>resolve(), 200)});
for (let i = 0; i < step; i++) {
intro.nextStep();
chain.then(function () {
return new Promise(resolve=> {intro.nextStep(); setTimeout(()=>resolve(), 200)});
})
}
}
......@@ -236,13 +252,18 @@ function intializeIntroJs(){
, initializeDrugsStory(params)
].forEach( intro => {
intro.onexit(function () {
// $('#minervaAppDiv').css('padding', '0px');
// //TODO the calc should be changed so that when the calc changes in the minerva code, the plugin still works correctly
// pluginContainer.closest('.tab-pane').css('height', 'calc(100vh - 42px)');
if (settings.padding) {
$('#minervaAppDiv').css('padding', '0px');
//TODO the calc should be changed so that when the calc changes in the minerva code, the plugin still works correctly
pluginContainer.closest('.tab-pane').css('height', 'calc(100vh - 42px)');
//now we need to let Minerva know that a resize of the map happend which can be done only
//by simulating what Minerva does when plugin split bar is moved
$('.minerva-header-hide-button').click();
$('.minerva-header-hide-button').click();
}
});
});
// initializeIntroJsStory1();
}
......@@ -265,7 +286,11 @@ function cleanMinerva(){
$('div[role="dialog"]').css('display', 'none');
$('table[name="generalOverlaysTab"] td:contains("Pathways")').parent().find('a').click();
// $('table[name="generalOverlaysTab"] td:contains("Network")').parent().find('a').click();
$('table[name="generalOverlaysTab"] input').prop('checked', false);
$('table[name="generalOverlaysTab"] input').each(function(ix, e) {
if ($(e).prop('checked')){
$(e).click();
};
});
$($('div[name="tabView"]:contains("SEARCH") .nav:has(i.fa-search) a')[0]).click();
$('a:contains("GENERIC")').click();
......
......@@ -171,7 +171,7 @@ function initializeStoryContet($introContainer, params){
event.clientX = $img.width() * relPos[0];
event.clientY = $img.height() * relPos[1];
$img.trigger(event);
}, 100);
}, 30);
}
if (steps.indexOf(4) >= 0) {
// TODO: remove setTimeout
......@@ -184,7 +184,7 @@ function initializeStoryContet($introContainer, params){
event.clientX = $img.width() * relPos[0];
event.clientY = $img.height() * relPos[1];
$img.trigger(event);
}, 100);
}, 30);
}
if (steps.indexOf(5) >= 0) {
$(selections.genericSearchInput).val("reaction:re1338");
......
......@@ -14,6 +14,7 @@ const selections = {
, contextMenuMolArt: 'a:contains("MolArt")'
, prknMolArtLink: 'a:contains("O60260")'
, centerMapLink: '[title="center map"]'
, introJsFloatingDiv: '.introjs-tooltip.introjs-floating'
};
function getPrknCoordinates(params){
......@@ -114,6 +115,8 @@ function initializeStoryContet($introContainer, params){
$(el).removeClass('list-group-item-success');
}
});
$('.introjs-tooltip.introjs-floating').css('left', 50)
});
intro.onbeforechange(function (target) {
......@@ -132,6 +135,7 @@ function initializeStoryContet($introContainer, params){
minerva.GuiConnector.yPos = $canvas.offset().top + $canvas.height()/2;
event.clientY = minerva.GuiConnector.yPos ;
$canvas.parent()[0].dispatchEvent(event);
//TODO remove setTimeout
setTimeout(function() {
$(selections.contextMenuMolArt).parent().find('ul').css('display', 'block')
}, 100);
......@@ -167,11 +171,22 @@ function initializeStoryContet($introContainer, params){
params.addDisabledInteractionMessage();
// if (this._currentStep == 7){
// $(selections.genericSearchInput).val("PRKN")
// } else if (this._currentStep == 8){
// $(selections.genericSearchLink).click();
// }
if (this._currentStep == 3){
setTimeout(function () {
//it can happen that after 1s, molart plugin is not there any more and in such a case
//we don't want to do the transition
if (selections.molArt.length > 0) {
$(selections.introJsFloatingDiv).animate({
left: '88%'
, top: '80%'
}, 300);
}
}, 500);
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment