Select Git revision
social.js 3.18 KiB
WDN.jQuery(document).ready(function() {
});
(function($) {
$(document).ready(function(){
//handle the search form label
$('form#searchform label').css({display: "block"});
$('form#searchform input#search_input').focus(function(){
$(this).siblings("label").hide();
});
$('form#searchform input#search_input').blur(function(){
if ($('form#searchform input#search_input').val() == "") {
$(this).siblings("label").show();
};
});
//end handling of the search form label
//Add CSS to forms
WDN.jQuery('#maincontent div.formCool form').addClass("cool");
$("#profile_data_Hometown_City a,p.odd a[href*=profile_city]").css("text-transform","capitalize");
if ($("#profile_info").length > 0) {
// fix the profile display
// fix the current/map location display
var city = $("#profile_data_City a").html(), state, country;
if (city){
$("#profile_data_State b, #profile_data_Country b").remove();
state = $("#profile_data_State").html();
country = $("#profile_data_Country").html();
$("#profile_data_City b").html("Location:");
if (state) {
$("#profile_data_City").append(", " + state);
$("#profile_data_State").remove();
}
if (country) {
$("#profile_data_City").append(", " + country);
$("#profile_data_Country").remove();
}
}
//$("#profile_data_Explanation b").remove();
// fix the hometown location display
var hcity = $("#profile_data_Hometown_City a").html(), hstate, hcountry;
if (hcity){
$("#profile_data_Hometown_State b, #profile_data_Hometown_Country b").remove();
$("#profile_data_Hometown_City b").html("Hometown:");
hstate = $("#profile_data_Hometown_State").html();
hcountry = $("#profile_data_Hometown_Country").html();
if (hstate) {
$("#profile_data_Hometown_City").append(", " + hstate);
$("#profile_data_Hometown_State").remove();
}
if (hcountry) {
$("#profile_data_Hometown_City").append(", " + hcountry);
$("#profile_data_Hometown_Country").remove();
}
}
// fix the years attended
if ($("#profile_data_To").length > 0) {
if ($("#profile_data_Years_Attended_UNL").length > 0) {
// we have to and from here
$("#profile_data_To b").remove();
var to = $("#profile_data_To").html();
$("#profile_data_Years_Attended_UNL").append(" to " + to);
$("#profile_data_To").remove();
} else {
$("#profile_data_To b").html("Year Attended UNL: ");
}
}
// fix birthday (set up to handle various cases, even though right now we require all fields)
if ($("#profile_data_Month").length > 0){
$("#profile_data_Month b").html("Birthday:");
$("#profile_data_Day b").remove();
$("#profile_data_Day").append(", ");
$("#profile_data_Month").append($("#profile_data_Day").html());
$("#profile_data_Day").remove();
$("#profile_data_Year b").remove();
$("#profile_data_Month").append($("#profile_data_Year").html());
$("#profile_data_Year").remove();
} else if ($("#profile_data_Year").length > 0) {
// just birth year should be displayed
$("#profile_data_Day").remove();
$("#profile_data_Year b").html("Birthday");
}
}
});
})(WDN.jQuery);