Skip to content

Instantly share code, notes, and snippets.

@nickfogle
Last active August 29, 2015 14:01
Show Gist options
  • Save nickfogle/1fc8d920325b1a8dc8c9 to your computer and use it in GitHub Desktop.
Save nickfogle/1fc8d920325b1a8dc8c9 to your computer and use it in GitHub Desktop.
JS Collection for BBNC
<!-- Automatically Update Copyright Date -->
<div id="wrapFooter">
<div class="gutter">&copy; <span id="currentYear">2013</span> Blackbaud, Inc.</div>
</div>
<script type="text/javascript" language="javascript">
$("#currentYear").text((new Date).getFullYear());
</script>
<!-- Load Desktop on iPad -->
<script>
var isiPad = navigator.userAgent.match(/iPad/i) != null;
if(isiPad){BLACKBAUD.netcommunity.ViewAsDesktop();}
</script>
<!-- iPad Redirect Scripts -->
<body>
<style type="text/css">
/* Hide site from general tablet layouts */
@media only screen and (device-width: 768px) {
* { display: none; }
}
</style>
<div class="wrapScript">
<!-- BEGIN Redirect -->
<script type="text/javascript">
var iPad = (/ipad/i.test(navigator.userAgent.toLowerCase()));
if (iPad) {
document.location = "javascript:BLACKBAUD.netcommunity.ViewAsDesktop();";
}
</script>
<!-- END Redirect -->
</div>
<!-- END Scripts -->
<!-- BEGIN Your Code Here -->
</body>
<!-- Modify Label Text for New User Registration Form-->
<script>
function defaultPartner()
{
$("label[for='PC9280_NewUserRegistration1_txtUserID']").text("User Name:");
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(defaultPartner);
</script>
<!-- Fixed Positioning -->
<script type="text/javascript" language="javascript">
function fixPositioning()
{
var _els = document.getElementsByTagName('div');
for (var _i=0;_i<_els.length;_i++)
{
if (_els[_i].id.match(/_panelPopup$/) || _els[_i].id.match(/_panelPopup_DropShadow$/))
document.getElementsByTagName('body')[0].appendChild(_els[_i]);
}
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fixPositioning);
</script>
<!-- Fixed Positioning #2 -->
<script language="javascript" type="text/javascript">
function fixPositioning()
{
$('div[id *= "_panelPopup"]').appendTo('body');
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fixPositioning);
</script>
<!-- Fixes the issue where you can't click to edit parts* -->
<script language="javascript" type="text/javascript">
function fixPositioning()
{
$('div[id *= "_panelPopup"]').appendTo('body');
$('div[id *= "_designPaneCloak"]').css({"top": "0px","left": "0px"});
$('.DesignPane').css("position", "relative");
}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(fixPositioning);
</script>
<!-- Quick Search Text Replacement -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Quick Search Text Replacement</title>
<script type="text/javascript" src="../js/jquery.js"></script>
</head>
<body>
<table class="QuickSearchFormTable" border="0">
<tbody>
<tr>
<td>
<label class="BBFieldCaption QuickSearchFieldCaption">Search:</label>
</td>
<td>
<input type="text" maxlength="255" class="QuickSearchTextbox" />
<input type="text" style="display:none; visibility:hidden" />
</td>
<td>
<input type="submit" value="Search" class="BBFormSubmitButton QuickSearchButton" />
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
/* quick search text replacement */
$(".QuickSearchTextbox").val("Search").click(function(){
if ($(this).val() == "Search") {$(this).val("");}}).blur(function(){
if ($(this).val() == "") {$(this).val("Search");}});
</script>
</body>
</html>
<!-- Swap Table Rows -->
<script type="text/JavaScript">P
$(document).ready(function(){
$(#PC22553_Wizard1_dgEventItems2_dgPriceList_0 .BBListOddRowStyle").append($("#PC22553_Wizard1_dgEventItems2_dgPriceList_0 .BBListEvenRowStyle));
});
</script>
<!-- Force Select Form Option -->
<script>
// Purpose: Force Select Form Option
// Author: Nick Fogle
$(document).ready(function(){
If ($(‘form[action*=”pagedesign”]’).length > 0) {
// run scripts in edit mode
}
Else {
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function() {
$("select.BBFormSelectList.LoginFormSelectList option[selected]").removeAttr("selected");
$("select.BBFormSelectList.LoginFormSelectList option[value='Women of Reform Judaism']").attr("selected", "selected");
});
} //End of the Edit View Check
});
</script>
<!-- Swap Text Strings -->
<script type="text/javascript">
// Purpose: Swap out English with French.
// Author: Nick Fogle
// Case #: 12100773
// BBNC: v6.58
// Created: 05/27/14
// Status: Tested and Released
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function() {
$("label[for='PC1921_txtSearch']").text("Cherche:");
$("#PC1921_resultsId").text($("#PC1921_resultsId").text().replace("Results for", "résultats pour"));
$("#PC1921_resultsId").text($("#PC1921_resultsId").text().replace("No results found for", "Pas de résultats pour"));
});
</script>
<!-- Automatically Mark Checkboxes -->
<script>
// Purpose: Check and Uncheck Checkboxes based on Element ID
// Author: Nick Fogle
// Case #: 12105060
// BBNC: v6.58
// Created: 05/28/14
// Status: Tested and Released
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function () {
$('#PC2587_formWizard_formWizard_45de152c_b4bf_4355_af93_d6c310f2f87d_0').attr('checked', true);
$('#PC2587_formWizard_formWizard_45de152c_b4bf_4355_af93_d6c310f2f87d_0').attr('checked', false);
});
</script>
<script>
// Purpose: Default Dropdown to Value of 'Canada'
// Author: Nick Fogle
// Added by: Nick Fogle
// Case #: 12113251
// BBNC: v 6.58, patch 3
// Created: 6/4/14
// Status: Tested and Released
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function () {
$("select.BBFormSelectList.DonationCaptureSelectList option[selected]").removeAttr("selected");
$("select.BBFormSelectList.DonationCaptureSelectList option[value='CANADA']").attr("selected", "selected");
});
</script>
<script>
// Purpose: Remove Unwanted Profile Dropdown Values
// Author: Nick Fogle
// Added by: Nick Fogle
// Case #: 12118148
// BBNC: v 6.58, patch 3
// Created: 6/10/14
// Status: Tested and Released
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function () {
$("select.BBFormSelectList.ProfileFormSelectList option[value='General'],[value='Admiral'],[value='Colonel'],[value='Sir'],[value='Lord']").remove();
});
</script>
<script>
// Purpose: Remove Unwanted Directory Dropdown Values
// Author: Nick Fogle
// Added by: Nick Fogle
// Case #: 12118148
// BBNC: v 6.58, patch 3
// Created: 6/9/14
// Status: Tested and Released
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function () {
$("select.BBFormSelectList.DirectoryFormSelectList option[value='3129'],[value='3135'],[value='3134'],[value='3133'],[value='3132'],[value='3131'],[value='3130'],[value='3136'],[value='3547'],[value='3566'],[value='3567'],[value='3568'],[value='3569'],[value='3570'],[value='3571'],[value='3572']").remove();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment