multiple updates and new files to support multiple foaf person profile pages

This commit is contained in:
tworrall 2013-01-31 11:15:48 -05:00
parent 3b051ecffd
commit 9cde935cc7
50 changed files with 2005 additions and 249 deletions

View file

@ -0,0 +1,78 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var profilePageType = {
/* *** Initial page setup *** */
onLoad: function() {
this.mixIn();
// in the event that the individual does not have a profile type set,
// the controller returns "none" and the select is set to "standard".
// we need to distinguish these when it comes time to do a retraction or
// not. So "default" = the type defined by the triple; "selected" =
// the selected option.
var selectedProfileType = "";
this.initPage();
},
mixIn: function() {
// Get the custom form data from the page
$.extend(this, profileTypeData);
},
// Initial page setup. Called only at page load.
initPage: function() {
profilePageType.selectedProfileType = $('select#profilePageType').val();
this.bindEventListeners();
},
bindEventListeners: function() {
$('select#profilePageType').change( function() {
profilePageType.processSelection($('select#profilePageType').val())
});
},
processSelection: function(newType) {
// if no profile page type is defined for this individual, don't do a retraction but pass an empty string to the controller
var retract = "";
var add = "<" + profilePageType.individualUri + "> <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#hasDefaultProfilePageType> "
+ "<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#" + newType + "> .";
if ( profilePageType.defaultProfileType != "none" ) {
retract = "<" + profilePageType.individualUri + "> <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#hasDefaultProfilePageType> "
+ "<http://vitro.mannlib.cornell.edu/ontologies/display/1.1#" + profilePageType.selectedProfileType + "> .";
}
$.ajax({
url: profilePageType.processingUrl,
type: 'POST',
data: {
additions: add,
retractions: retract
},
dataType: 'json',
context: newType, // context for callback
complete: function(request, status) {
if (status == 'success') {
location.reload(true);
}
else {
alert('Error processing request: the unchecked labels could not be deleted.');
$('select#profilePageType').val(profilePageType.selectedProfileType);
}
}
});
}
};
$(document).ready(function() {
profilePageType.onLoad();
});

View file

@ -0,0 +1,119 @@
/* $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 bubble text when the user hovers
// over the research area "group" icon.
$('#researchAreaIcon').each(function()
{
$(this).qtip(
{
content: {
prerender: true,
text: '&nbsp;'
},
position: {
corner: {
target: 'topleft',
tooltip: 'bottomcenter'
},
adjust: {
x:22,
y:30
}
},
show: {
when: {
event: 'mouseenter'
}
},
hide: {
fixed: false,
when: {
event: 'mouseleave'
}
},
style: {
padding: '0em',
height: 56,
width: 180,
border: 'none',
background:'url(' + imagesPath + '/individual/researchAreaBubble.png) no-repeat'
}
});
});
$('#fullViewIcon').each(function()
{
$(this).qtip(
{
content: {
text: '&nbsp;'
},
position: {
corner: {
target: 'topleft',
tooltip: 'bottomcenter'
},
adjust: {
x:27,
y:30
}
},
show: {
when: {
event: 'mouseenter'
}
},
hide: {
fixed: false,
when: {
event: 'mouseleave'
}
},
style: {
padding: '0em',
height: 56,
width: 140,
border: 'none',
background: 'url(' + imagesPath + '/individual/quickViewBubble.png) no-repeat'
}
});
});
$('#quickViewIcon').each(function()
{
$(this).qtip(
{
content: {
text: '&nbsp;'
},
position: {
corner: {
target: 'topleft',
tooltip: 'bottomcenter'
},
adjust: {
x:28,
y:30
}
},
show: {
when: {event: 'mouseenter'}
},
hide: {
fixed: false,
when: {
event: 'mouseleave'
}
},
style: {
padding: '0em',
height: 56,
width: 144,
border: 'none',
background: 'url(' + imagesPath + '/individual/fullViewBubble.png) no-repeat'
}
});
});
});

View file

@ -131,8 +131,10 @@ $(document).ready(function(){
}
// if there are webpages but no contacts (email/phone), extend
// the webpage border the full width. Used with "standard" profile view.
// the webpage border the full width. Used with "2 column" profile view.
if ( $('h2#contactHeading').length < 1 ) {
$('div#webpagesContainer').css('width', '100%').css('clear','both');
if ( $('div#webpagesContainer').length ) {
$('div#webpagesContainer').css('width', '100%').css('clear','both');
}
}
});