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 #439

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d99fbbd
Replaced Qtip with Popper and bootstrap
milospp Jan 30, 2024
81d1a1f
Removed Qtip libraries and modifies style for tooltip
milospp Jan 30, 2024
297afc1
Fixed position of download popup
milospp Jan 30, 2024
ba6162c
Fixed popper for Vitro, Nemo and Tenderfoot themes
milospp Feb 12, 2024
187b91b
Fixed tooltip design and nemo theme search results page
milospp Feb 13, 2024
12ed8b5
Removed !important tags
milospp Nov 19, 2024
4949f0c
Fixed opacity difference
milospp Nov 19, 2024
47cb0f2
Created tooltip css for everytheme to reduce reduntant code
milospp Nov 19, 2024
d2d7884
Renamed vivoToolip to vitroTooltip
milospp Nov 19, 2024
a6b9b9e
Refactored code
milospp Nov 19, 2024
96a22a2
Adding bootstrap-5.3.2
milospp Nov 20, 2024
ec4b39e
Added padding in tooltip
milospp Nov 20, 2024
641146d
Removed bootstrap
milospp Dec 8, 2024
ee61e74
Removed bootstrap
milospp Dec 8, 2024
f0db4ce
excluded bootstrap from popper
milospp Dec 10, 2024
f53c863
Refactored code
milospp Dec 10, 2024
5d6354a
Refactor popper code
milospp Dec 10, 2024
5127bca
Added floating webjar
milospp Dec 11, 2024
a463177
Migraiton popper to floating
milospp Dec 11, 2024
c8e110e
Refactored code, divided in smaller functions
milospp Dec 11, 2024
3ec0d79
Fixed arrows
milospp Dec 11, 2024
d047f30
Deleted unused popper library
milospp Dec 17, 2024
6b6e091
Replace word 'popper' from variables with tooltip
milospp Dec 17, 2024
f9c5f7b
Removed test logs
milospp Jan 23, 2025
6fc495e
Improved readability for tooltip functions
milospp Jan 24, 2025
d6abb7b
Added tooltip-utils.js into vitro individual ftl
milospp Jan 28, 2025
d624a56
Fixed missplaced popper in vitro
milospp Feb 14, 2025
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
40 changes: 40 additions & 0 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,36 @@
</fileMappers>
<outputDirectory>target/${project.artifactId}-${project.version}/webjars/fonts/open-sans/</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.webjars.npm</groupId>
<artifactId>floating-ui__dom</artifactId>
<type>jar</type>
<includes>
META-INF/resources/webjars/floating-ui__dom/*/dist/**</includes>
<fileMappers>
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
<pattern>^META-INF/resources/webjars/floating-ui__dom/[^/]+/dist/</pattern>
<replacement>./</replacement>
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
</fileMappers>
<outputDirectory>
target/${project.artifactId}-${project.version}/webjars/floatingui/</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.webjars.npm</groupId>
<artifactId>floating-ui__core</artifactId>
<type>jar</type>
<includes>
META-INF/resources/webjars/floating-ui__core/*/dist/**</includes>
<fileMappers>
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
<pattern>^META-INF/resources/webjars/floating-ui__core/[^/]+/dist/</pattern>
<replacement>./</replacement>
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
</fileMappers>
<outputDirectory>
target/${project.artifactId}-${project.version}/webjars/floatingui/</outputDirectory>
</artifactItem>
</artifactItems>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
Expand All @@ -157,6 +187,16 @@
</build>

<dependencies>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>floating-ui__dom</artifactId>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>floating-ui__core</artifactId>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jquery-migrate</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions webapp/src/main/webapp/css/individual/individual.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ h2#overview .verbosePropertyListing {
display: block;
}
/* URI/RDF ICON DISPLAY -------> */
.qtip-content h5 {
margin: 0;
padding: 0;
}
input#uriLink {
margin: 0;
width: 350px;
Expand Down

This file was deleted.

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


/* -------------------------------------------------> */
/* TOOLTIP ----------------------------------------> */
/* -------------------------------------------------> */
.vitroTooltip.tooltip {
opacity: 1;
position: absolute;
}

.vitroTooltip.tooltip > .tooltip-inner {
opacity: 1;
max-width: 400px;

background-color: #f1f2ee;
border: 1px solid #F1D031;
text-align: left;
border-radius: 0;

color: #333;
max-width: initial;
padding: 0.25rem;
position: relative;
z-index: 100;
}

.vitroTooltip > .tooltip-inner .close-footer {
display: flex;
}

.vitroTooltip > .tooltip-inner .close-footer a.close {
margin-left: auto;
}

.vitroTooltip > .tooltip-inner h5 {
padding-bottom: 0;
}

.vitroTooltip > .tooltip-arrow::before {
--bs-tooltip-bg: #F1D031;
}

.tooltip > .tooltip-arrow {
position: absolute;
z-index: 50;
width: 8px;
height: 8px;
transform: rotate(45deg);
background: #F1D031;
}

.tooltip:not(.vitroTooltip) > .tooltip-inner, .tooltip:not(.vitroTooltip) > .tooltip-inner * {
color: unset;
}

div.vitroTooltip.downloadTip {
max-width: 600px;
--bs-tooltip-max-width: 600px;
}

div.tooltip.vitroTooltip.vitroTooltip-yellow {
max-width: 500px;
--bs-tooltip-max-width: 500px;
}

.tooltip.vitroTooltip-yellow > .tooltip-inner {
background-color: #ffffc0;
font-size: 0.8em;
padding: 20px 22px;
text-align: left;
line-height: 12px;
}
12 changes: 10 additions & 2 deletions webapp/src/main/webapp/css/vitro.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@
.contentNote p {
font-size: .8em;
}

.clearfix:before,
.clearfix:after {
display: table;
content: " ";
}
.clearfix:after {
clear: both;
}

/* <------ INDEX PAGE*/
.siteMap h2 {
Expand Down Expand Up @@ -147,7 +154,8 @@
float:left;
}
a.close {
float: right;
display: block;
text-align: right;
margin-right: .3em;
font-size: .8em;
}
Expand Down
105 changes: 29 additions & 76 deletions webapp/src/main/webapp/js/individual/individualUriRdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,40 @@ $(document).ready(function(){

$.extend(this, i18nStringsUriRdf);

$('head').append('<style id="uriIconCSS">.qtip { font-size: 14px; max-width: none !important; } .uriIconTip { background-color: #f1f2ee; } </style>');

// This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon.
$('span#iconControlsLeftSide').children('img#uriIcon').each(function()
{
$(this).qtip(
let tooltips = [
{
prerender: true, // We need this for the .click() event listener on 'a.close'
content: {
text: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a>'
},
position: {
my: 'top left',
at: 'bottom left'
},
show: {
event: 'click'
},
hide: {
event: 'click'
},
style: {
classes: 'uriIconTip',
width: 400
}
});
});
querySelector: "span#iconControlsLeftSide > img#uriIcon",
data: {
title: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><div class="close-footer"><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a></div>',
trigger: "click",
customClass: "vitroTooltip",
placements: ['top', 'right', 'bottom', 'left'],

$('span#iconControlsVitro').children('img#uriIcon').each(function()
{
$(this).qtip(
{
prerender: true, // We need this for the .click() event listener on 'a.close'
content: {
text: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a>'
},
position: {
my: 'top left',
at: 'bottom left'
},
show: {
event: 'click'
},
hide: {
event: 'click'
},
style: {
classes: 'uriIconTip',
width: 400
}
});
});
},
{
querySelector: "span#iconControlsVitro > img#uriIcon",
data: {
title: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><div class="close-footer"><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a></div>',
trigger: "click",
customClass: "vitroTooltip",
placements: ['top', 'right', 'bottom', 'left'],

$('span#iconControlsRightSide').children('img#uriIcon').each(function()
{
$(this).qtip(
}
},
{
prerender: true, // We need this for the .click() event listener on 'a.close'
content: {
text: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a>'
},
position: {
my: 'top right',
at: 'bottom right'
},
show: {
event: 'click'
},
hide: {
event: 'click'
},
style: {
classes: 'uriIconTip',
width: 400
querySelector: "span#iconControlsRightSide > img#uriIcon",
data: {
title: '<h5>' + i18nStringsUriRdf.shareProfileUri + '</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">' + i18nStringsUriRdf.viewRDFProfile + '</a></h5><div class="close-footer"><a class="close" href="#">' + i18nStringsUriRdf.closeString + '</a></div>',
trigger: "click",
customClass: "vitroTooltip",
placements: ['top', 'left', 'bottom', 'right'],
}
});
});
},
]

// Prevent close link for URI qTip from requesting bogus '#' href
$('a.close').click(function() {
$('#uriIcon').qtip("hide");
return false;
});
tooltips.forEach(tooltip => {
setTooltip(tooltip.querySelector, tooltip.data)
})

});

This file was deleted.

Loading