Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Qtip Library with Floating ui #3937

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ a.map-of-science-links {
color: #2485AE;
}

.visCommonControllTooltip {
padding: 16px 22px;
max-width: 400px;
}

/* --------------------------------------------------------------> */
/* SPECIAL STYLES FOR THE error */
/* --------------------------------------------------------------> */
Expand Down
83 changes: 0 additions & 83 deletions webapp/src/main/webapp/js/individual/individualQtipBubble.js

This file was deleted.

37 changes: 37 additions & 0 deletions webapp/src/main/webapp/js/individual/individualTooltipBubble.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* $This file is distributed under the terms of the license in LICENSE$ */

$(document).ready(function(){
$.extend(this, i18nStrings);

let tooltips = [
{
querySelector: "#researchAreaIcon",
data: {
title: "<div>" + i18nStrings.researchAreaTooltipOne + "</div><div>" + i18nStrings.researchAreaTooltipTwo + "</div>",
placements: ['top', 'right', 'bottom', 'left'],
customClass: "vitroTooltip"
}
},
{
querySelector: "#fullViewIcon",
data: {
title: i18nStrings.quickviewTooltip,
placements: ['top', 'right', 'bottom', 'left'],
customClass: "vitroTooltip"
}
},
{
querySelector: "#quickViewIcon",
data: {
title: "<div>" + i18nStrings.standardviewTooltipOne + '</div><div>' + i18nStrings.standardviewTooltipTwo + "</div>",
placements: ['top', 'right', 'bottom', 'left'],
customClass: "vitroTooltip"
}
},
]

tooltips.forEach(tooltip => {
setTooltip(tooltip.querySelector, tooltip.data)
})

});
Original file line number Diff line number Diff line change
Expand Up @@ -84,36 +84,40 @@ function initVisModeTypeButton() {
}

function initGlobalToolTips() {
createToolTip($("#imageIconOne"), $('#toolTipOne').html(), "top left");
createToolTip($("#exploreInfoIcon"), $('#exploreTooltipText').html(), "top left");
createToolTip($("#compareInfoIcon"), $('#compareTooltipText').html(), "top left");
createToolTip($("#imageIconThree"), $('#toolTipThree').html(), "top right");
}

var visCommonToolTipInit = true;
function createToolTip(target, tipText, tipLocation) {
if (visCommonToolTipInit) {
$('head').append('<style id="visCommonToolTipCSS">.qtip { font-size: .7em; max-width: none !important; } .visCommonToolTip {'
+ ' background-color: #ffffc0;'
+ ' textAlign: left;'
+ ' padding: 6px 10px 6px 10px;'
+ ' lineHeight: 14px;'
+ '} </style>');

visCommonToolTipInit = false;
}

target.qtip({
content: {
text: tipText
},
position: {
my: tipLocation,
at: 'center'
let tooltips = [
{
querySelector: "#imageIconOne",
data: {
title: "<div class='visCommonControllTooltip'>" + $('#toolTipOne').html() + "</div>",
customClass: "vitroTooltip vitroTooltip-yellow",
placements: ['left', 'top', 'bottom', 'right']
}
},{
querySelector: "#exploreInfoIcon",
data: {
title: "<div class='visCommonControllTooltip'>" + $('#exploreTooltipText').html() + "</div>",
customClass: "vitroTooltip vitroTooltip-yellow",
placements: ['left', 'top', 'bottom', 'right']
}
},{
querySelector: "#compareInfoIcon",
data: {
title: "<div class='visCommonControllTooltip'>" + $('#compareTooltipText').html() + "</div>",
customClass: "vitroTooltip vitroTooltip-yellow",
placements: ['left', 'top', 'bottom', 'right']
}
},{
querySelector: "#imageIconThree",
data: {
title: "<div class='visCommonControllTooltip'>" + $('#toolTipThree').html() + "</div>",
customClass: "vitroTooltip vitroTooltip-yellow",
placements: ['left', 'top', 'bottom', 'right']
}
},
style: {
classes: 'visCommonToolTip',
width: 500,
}
});
]

tooltips.forEach(tooltip => {
setTooltip(tooltip.querySelector, tooltip.data)
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,19 @@ var i18nStringsUriRdf = {
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/individual.css" />',
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-vivo.css" />',
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-2column-view.css" />',
'<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.12.1.css" />',
'<link rel="stylesheet" type="text/css" href="${urls.base}/css/jquery_plugins/qtip/jquery.qtip.min.css" />')}
'<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.12.1.css" />')}

${headScripts.add('<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/json2.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>')}
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>',

'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.core.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.dom.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/tooltip/tooltip-utils.js"></script>')}


${scripts.add('<script async type="text/javascript" src="${urls.base}/js/individual/individualUriRdf.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/individualQtipBubble.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/individualTooltipBubble.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.12.1.min.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/individualUtils.js?vers=1.5.1"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/moreLessController.js"></script>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,19 @@ var i18nStringsUriRdf = {
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/individual.css" />',
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-vivo.css" />',
'<link rel="stylesheet" href="${urls.base}/css/individual/individual-quick-view.css" />',
'<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.12.1.css" />',
'<link rel="stylesheet" type="text/css" href="${urls.base}/css/jquery_plugins/qtip/jquery.qtip.min.css" />')}
'<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.12.1.css" />')}

${headScripts.add('<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/amplify/amplify.store.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/json2.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>')}
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>',

'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.core.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.dom.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/tooltip/tooltip-utils.js"></script>')}

${scripts.add('<script async type="text/javascript" src="${urls.base}/js/individual/individualUriRdf.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/individualQtipBubble.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/individualTooltipBubble.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.12.1.min.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/individualUtils.js"></script>',
'<script async type="text/javascript" src="${urls.base}/js/individual/moreLessController.js"></script>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ corresponding changes in the included Templates. -->
</div>
</div>

${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip.min.js"></script>')}

${stylesheets.add('<link rel="stylesheet" type="text/css" href="${urls.base}/css/visualization/visualization.css" />',
'<link rel="stylesheet" type="text/css" href="${urls.base}/css/jquery_plugins/qtip/jquery.qtip.min.css" />')}
${stylesheets.add('<link rel="stylesheet" type="text/css" href="${urls.base}/css/visualization/visualization.css" />')}

${headScripts.add('<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.core.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.dom.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/tooltip/tooltip-utils.js"></script>'
)}
5 changes: 5 additions & 0 deletions webapp/src/main/webapp/themes/nemo/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ a.map-of-science-links {
color: #2485AE;
}

.visCommonControllTooltip {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed? Seems like the same css as in webapp/src/main/webapp/css/visualization/mapofscience/layout.css

Copy link
Contributor Author

@milospp milospp Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webapp/src/main/webapp/css/visualization/mapofscience/layout.css
This CSS is loaded only in Vitro theme and

webapp/src/main/webapp/themes/nemo/css/layout.css
this CSS is loaded only in the Nemo theme

so this should be in both file

padding: 16px 22px;
max-width: 400px;
}

/* --------------------------------------------------------------> */
/* SPECIAL STYLES FOR THE error */
/* --------------------------------------------------------------> */
Expand Down
5 changes: 5 additions & 0 deletions webapp/src/main/webapp/themes/nemo/templates/head.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
</#if>
</#if>


<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.core.umd.js"></script>
<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.dom.umd.js"></script>
<script src="${urls.base}/js/tooltip/tooltip-utils.js"></script>

<#include "stylesheets.ftl">
<#-- <link rel="stylesheet" href="${urls.theme}/css/screen.css" /> -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,16 @@ Add divs and wrapper to create funnelback basket controls. MUST BE REMOVED BEFOR
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}

${headScripts.add('<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.truncator.js"></script>',
'<script type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>')}
'<script type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script>',

'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.core.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.dom.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/tooltip/tooltip-utils.js"></script>'
)}

${scripts.add('<script type="text/javascript" src="${urls.base}/js/individual/individualUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/individual/individualQtipBubble.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/individual/individualTooltipBubble.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/individual/individualUriRdf.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/individual/moreLessController.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@
</script>


${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>')}
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>')}

${scripts.add('<script type="text/javascript" src="${urls.base}/js/imageUpload/imageUploadUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/individual/moreLessController.js"></script>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,8 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
'<link rel="stylesheet" href="${urls.base}/js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css" />',
'<link rel="stylesheet" href="${urls.theme}/css/layout.css" />')}


${headScripts.add('<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.core.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/webjars/floatingui/floating-ui.dom.umd.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/tooltip/tooltip-utils.js"></script>'
)}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,4 @@ corresponding changes in the included Templates. -->
</div>
</div>

${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>')}

${stylesheets.add('<link rel="stylesheet" type="text/css" href="${urls.base}/css/visualization/visualization.css" />')}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<!-- vitro base styles (application-wide) -->
<#-- <link rel="stylesheet" href="${urls.base}/css/vitro.css" /> -->
<link rel="stylesheet" href="${urls.base}/css/tooltip.css" />


<!-- <link rel="stylesheet" href="${urls.theme}/css/bootstrap.min.css" /> -->
Expand Down
19 changes: 19 additions & 0 deletions webapp/src/main/webapp/themes/tenderfoot/css/tenderfoot.css
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,22 @@ img.add-individual {
height: 15px;
width: 15px;
}

#individual-intro {
overflow: unset;
}

/* -------------------------------------------------> */
/* TOOLTIP ----------------------------------------> */
/* -------------------------------------------------> */

#qrCodeContainer {
position: absolute;
right: 380px;
}

span#qrCodeImage.bottomLeftAnchor {
top: 23px;
right: 25px;
left: initial;
}
Loading
Loading