function FormLoginLink() {
var PageID = BLACKBAUD.netcommunity.PageID;
var loginLink = $('.conditionalLogin').attr('href');
$('.conditionalLogin').attr('href', loginLink + '?rcpid=' + PageID);
}
function DonationForm() {
$('.DonationGrid .DonationGridCell input[id*="_dgCart_btnRemove"]').each(function(){
$(this).val("X");
});
var givingSearchLink = 'giving-search';
$('select[id$="_ddlDesignations"]').parent('td').append('
search designations
');
$('input[id*="rdoGiftType"][value*="Recurring"]').on('click', function(){
setTimeout(function(){
$('select[id*="Recurrence_ddlFrequency"]').val('2');
$('select[id*="Recurrence_ddlFrequency"] option[value="1"]').remove();
},500);
});
if ( $('span[id*="lblDesignationValue"]').length > 0 ) {
var designationValue = $('span[id*="lblDesignationValue"]').text();
var designationLabel = 'Your Gift To: ';
$('.DonationListingHeading > span:contains(Donation Information)').each(function(){
$(designationLabel).insertBefore(this);
$(this).empty().append(designationValue);
});
$('span[id*="lblDesignationValue"]').parent().parent().remove();
}
}
function EcardSteps() {
$('.ECardProgressIndicator div[class*="ECard"][class*="Step"]').each(function(index) {
var eCardStepText = $(this).html();
var eCardStepTextSplit = eCardStepText.split('
');
$(this).html('' + (index+1) + '' + eCardStepTextSplit[1] + '');
});
}
function EventCalendar() {
$('.CalendarViewEventItemContainer').each(function(){
if ($(this).children().length > 0) {
$(this).parent().addClass('hasEvent');
}
});
$('.CalendarViewDayHeader').each(function() {
var firstLetter = $(this).text().charAt(0);
$(this).text(firstLetter);
});
$('.CalendarViewEvent').attr('onmouseover','');
$('.CalendarViewAllDayEvent').unbind('onmouseover');
$('.CalendarViewTopLeft').append('Prev
');
$('.CalendarViewTopRight').append('Next
');
var currMonth = $('.CalendarViewTopLeft option:selected');
$('#prevMonth').click(function(){
currMonth.prev().attr('selected','selected');
currMonth.parent().change();
});
$('#nextMonth').click(function(){
currMonth.next().attr('selected','selected');
currMonth.parent().change();
});
var EventContents = "";
var EventListingContainerOffset = 0;
var ListingOpen = false;
$('.hasEvent').click(function(){
try{UnTip()}catch(x){}
EventContents = $(this).children('.CalendarViewEventItemContainer').html();
$("#EventListingContainer .EventListing").html(EventContents);
if($("#EventListingContainer:visible").length == 0){
$("#EventListingContainer").slideDown();
ListingOpen = false;
}
else{
ListingOpen = true;
}
if(!ListingOpen){
EventListingContainerOffset = $("#EventListingContainer").offset().top;
$('html, body').animate({scrollTop: EventListingContainerOffset}, 1000);
}
});
$('#printStartCV').append('');
$('.closeEventItem').click(function(e){ $('#EventListingContainer').slideUp();});
if ( $('.CalendarViewContainer').length > 0 ) {
$('#EventListingContainer').wrap('')
}
}
function EVClassicPart() {
$('.EventTable table[id$="tblProgress"] th').each(function(index) {
var stepText = $(this).html();
var stepTextSplit = stepText.split('>');
$(this).html('' + (index+1) + '' + stepTextSplit[1] + '');
});
$('.EventTable table[id$="tblProgress"] th').last().addClass('last');
$('div.LoginFormCheckListContainer').parent().prev('td').addClass('checklistLabelContainer');
$('td.EventItemRegistrantControlCellName').parent().parent().parent().addClass('eventAttributeContainer');
}
function EventCaptureTable() {
var amountCaption = $('.DonationCaptureFormTable tr[id*="trAmount"] .DonationCaptureFieldCaption').html();
var amountTotal = $('.DonationCaptureFormTable tr[id*="trAmount"] .DonationCaptureFieldControlCellAmount').html();
$('.DonationCaptureFormTable tr[id*="trAmount"]').append(' | ');
$('.DonationCaptureFormTable tr[id*="trAmount"] .eventTransactionAmount').append(amountCaption,amountTotal);
$('.DonationCaptureFormTable tr[id*="trAmount"] .DonationCaptureFieldCaption').remove();
$('.DonationCaptureFormTable tr[id*="trAmount"] .DonationCaptureFieldControlCellAmount').remove();
}
function EV2Part() {
$('div [id*="ev2wiz"] .BBEventRegSequenceMap').addClass('clearfix');
$('div.Ev2_PriceTypesHeader, div.Ev2_PriceTypesRow, div.Ev2_SummaryTotal, div.Ev2_RegistrantFieldCell').addClass('clearfix');
$('input[id*="txtQty"]').blur(function() {
var $targetSpan = $(this).parent().nextAll('.Ev2_PriceTypeValidatorColumn').children('span.Ev2_Step1QtyValidation');
setTimeout(function(){
if ($targetSpan.css('visibility') == 'visible') {
$targetSpan.parent().addClass('validationActive');
} else {
$targetSpan.parent().removeClass('validationActive');
}
},500);
});
}
function givingSearch() {
$('.GivingSearchSearchForm tbody:last tr:last td').removeAttr('colspan');
$(' | ').prependTo('.GivingSearchSearchForm tbody:last tr:last');
$('br[style=" clear: both;"]').remove();
$('div[id*="_ResultsRepeater_ResultRow_"]').wrapAll('');
$('.GivingSearchPagination').addClass("clearfix");
$('div[id*="_ResultsRepeater_ResultRow_"]').each(function(){
var fundGiftLink = $(this).find('.GivingSearchResultLink a').attr('href');
var fundGiftButton = 'Give Now';
$(fundGiftButton).insertAfter($(this).find('.GivingSearchResultDetails'));
});
}
function ProfileUpdateForm() {
$('label[for*="private"]').each(function(){
$(this).html("Private");
});
}
function jobBoard() {
$('.JobResultsDeleteButton').each(function(){
$(this).text('Delete');
});
}
function PersonalNotesPart() {
$('#tblNote #trNote .BBNotesNoteCell').each(function(){
$(this).attr('colspan',"5");
});
$('#tblNote #trNoteData').each(function(){
$('+ | ').appendTo(this);
$(this).on('click',function(){
$(this).siblings('#tblNote #trNote').slideToggle(300);
});
});
}
function billMeLaterForm() {
$('.BML_Content > div').addClass('clearfix');
$('.BML_Content div[id*="ctlBillMeLater_divADDR"] > div').addClass('clearfix');
}
function quickSearch() {
$('.QuickSearchTextbox').attr('placeholder',"Search UTSW Giving");
}
// Functions for BBNC
// var bbpage = Sys.WebForms.PageRequestManager.getInstance();
// bbpage.add_pageLoaded(function(){
$(document).ready(function(){
// fire custom login link function
if ($('.conditionalLogin').length > 0) {
FormLoginLink();
}
// fire donation form functions
if ($('.DonationFormTable').length > 0) {
DonationForm();
}
// Ecards
if ($('.ECardProgressIndicator').length > 0) {
EcardSteps();
}
// Event Calendar
if ($('.CalendarViewContainer').length > 0) {
EventCalendar();
};
// Event Registration Classic Form
if($('.EventTable .EventProgressCell').length > 0) {
EVClassicPart();
};
// Event Registration Classic Form - Payment
if ($('.EventTable .DonationCaptureFormTable').length > 0) {
EventCaptureTable();
}
// Event Registration 2.0 classes and behavior for responsive
if ($('.BBEventRegSequenceMap').length > 0) {
EV2Part();
};
if ($('.GivingSearchPagination').length > 0) {
givingSearch();
}
// User Profile Form
if ($('.ProfileFormTable').length > 0) {
ProfileUpdateForm();
}
// job board part
if ($('.JobBoardListingTable').length > 0) {
jobBoard();
}
// fire personal notes functions
if ($('.BBNotesList').length > 0) {
PersonalNotesPart();
}
// bill me later classes and behavior for responsive
if ( $('.BML_Content').length > 0 ) {
billMeLaterForm();
}
if ($('.QuickSearchTextbox').length > 0) {
quickSearch();
}
});