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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
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
38 changes: 0 additions & 38 deletions webapp/src/main/webapp/css/jquery_plugins/jquery.realperson.css

This file was deleted.

This file was deleted.

64 changes: 62 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 Expand Up @@ -521,3 +529,55 @@ table#table-listing td {
table#table-listing td a {
word-wrap: break-word;
}

/* -------------------------------------------------> */
/* TOOLTIP ----------------------------------------> */
/* -------------------------------------------------> */
.vivoTooltip {
opacity: 1 !important;
--bs-tooltip-max-width: 400px !important;
}

.vivoTooltip > .tooltip-inner {
background-color: #f1f2ee;
border: 1px solid #F1D031;
text-align: left;
border-radius: 0;
}

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

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

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

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

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

.downloadTip {
--bs-tooltip-max-width: 600px !important;
}

.vivoTooltip-yellow {
--bs-tooltip-max-width: 500px !important;
}

.vivoTooltip-yellow > .tooltip-inner {
background-color: #ffffc0;
font-size: 0.8em;
padding: 20px 22px;
text-align: left;
line-height: 12px;
}

111 changes: 35 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,46 @@ $(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>',
html: true,
sanitize: false,
trigger: "click",
customClass: "vivoTooltip",
fallbackPlacements: ['bottom', 'left', 'top', 'right']

$('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>',
html: true,
sanitize: false,
trigger: "click",
customClass: "vivoTooltip",
fallbackPlacements: ['bottom', 'left', 'top', 'right']

$('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>',
html: true,
sanitize: false,
trigger: "click",
customClass: "vivoTooltip",
fallbackPlacements: ['bottom', 'right', 'top', 'left']
}
});
});
},
]

// 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)
})

});
6 changes: 3 additions & 3 deletions webapp/src/main/webapp/js/individual/propertyGroupControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ $(document).ready(function(){
let showAllBtn = $('#show-all-tabs')[0];
let tabList = $('ul.propertyTabsList')[0];

showAllBtn.addEventListener('show.bs.tab', function (event) {
showAllBtn?.addEventListener('show.bs.tab', function (event) {
event.preventDefault()
showAllTabs();
manageLocalStorage();
})

showAllBtn.addEventListener('hide.bs.tab', function (event) {
showAllBtn?.addEventListener('hide.bs.tab', function (event) {
$(".tab-content>section.tab-pane").removeClass('show active')
})

tabList.addEventListener('shown.bs.tab', function (event) {
tabList?.addEventListener('shown.bs.tab', function (event) {
manageLocalStorage();
})

Expand Down

This file was deleted.

Loading
Loading