NIHVIVO-3418: Done some refactoring, so the Individual link icon for URI/RDF works properly in a VITRO instance.
This commit is contained in:
parent
5b73abf962
commit
0ca8bb4c3e
2 changed files with 44 additions and 1 deletions
42
webapp/web/js/individual/individualUriRdf.js
Normal file
42
webapp/web/js/individual/individualUriRdf.js
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
// 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.
|
||||||
|
$('#uriIcon').each(function()
|
||||||
|
{
|
||||||
|
$(this).qtip(
|
||||||
|
{
|
||||||
|
content: {
|
||||||
|
prerender: true, // We need this for the .click() event listener on 'a.close'
|
||||||
|
text: '<h5>share the URI for this profile</h5> <input id="uriLink" type="text" value="' + $('#uriIcon').attr('title') + '" /><h5><a class ="rdf-url" href="' + individualRdfUrl + '">view profile in RDF format</a></h5><a class="close" href="#">close</a>'
|
||||||
|
},
|
||||||
|
position: {
|
||||||
|
corner: {
|
||||||
|
target: 'bottomLeft',
|
||||||
|
tooltip: 'topLeft'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
show: {
|
||||||
|
when: {event: 'click'}
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
fixed: true, // Make it fixed so it can be hovered over and interacted with
|
||||||
|
when: {
|
||||||
|
target: $('a.close'),
|
||||||
|
event: 'click'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
padding: '1em',
|
||||||
|
width: 400,
|
||||||
|
backgroundColor: '#f1f2ee'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Prevent close link for URI qTip from requesting bogus '#' href
|
||||||
|
$('a.close').click(function() {
|
||||||
|
$('#uriIcon').qtip("hide");
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
|
@ -65,4 +65,5 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/individual/indi
|
||||||
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></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>')}
|
'<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>')}
|
${scripts.add('<script type="text/javascript" src="${urls.base}/js/imageUpload/imageUploadUtils.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/individual/individualUriRdf.js"></script>')}
|
||||||
|
|
Loading…
Add table
Reference in a new issue