diff --git a/flexprofile_mj/views/default/profile/userdetails.php b/flexprofile_mj/views/default/profile/userdetails.php index e802191e7e256f14d68e66081dd9f064c56ae8dd..f840b848457a2df36ee1603ff0d713e73ac4f769 100755 --- a/flexprofile_mj/views/default/profile/userdetails.php +++ b/flexprofile_mj/views/default/profile/userdetails.php @@ -72,7 +72,7 @@ echo "<div id=\"profile_info\">"; //This function controls the alternating class $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $body .= "<p class=\"{$even_odd}\"><b>"; + $body .= "<p id=\"profile_data_" . $item->title . "\" class=\"{$even_odd}\"><b>"; $body .= $item->title.':</b> '; $body .= $item->value; @@ -129,7 +129,7 @@ END; //This function controls the alternating class $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $body .= "<p class=\"{$even_odd}\"><b>"; + $body .= "<p id=\"profile_data_" . str_replace(" ", "_", $item->title) . "\" class=\"{$even_odd}\"><b>"; $body .= $item->title.':</b> '; $body .= $item->value; diff --git a/unl_theme/scripts/social.js b/unl_theme/scripts/social.js index 4e584e81a4a7e2c648818ab163b2cce0cc2803ae..04eaa536326e258c5cd2a460f18997da581796d9 100644 --- a/unl_theme/scripts/social.js +++ b/unl_theme/scripts/social.js @@ -1,15 +1,97 @@ WDN.jQuery(document).ready(function() { - //handle the search form label - WDN.jQuery('form#searchform label').css({display: "block"}); - WDN.jQuery('form#searchform input#search_input').focus(function(){ - WDN.jQuery(this).siblings("label").hide(); + +}); + +(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('form#searchform input#search_input').blur(function(){ - if (WDN.jQuery('form#searchform input#search_input').val() == "") { - WDN.jQuery(this).siblings("label").show(); - }; - }); - //end handling of the search form label - //Add CSS to forms - WDN.jQuery('#maincontent div.formCool form').addClass("cool"); -}); \ No newline at end of file +})(WDN.jQuery); diff --git a/unl_theme/views/default/page_elements/header.php b/unl_theme/views/default/page_elements/header.php index 9e6aba511afe7a2bdc641f2acb0dc288c62d0e95..6c416b665e215405b8b872487cb703afd78b97c4 100644 --- a/unl_theme/views/default/page_elements/header.php +++ b/unl_theme/views/default/page_elements/header.php @@ -173,7 +173,7 @@ if ($vars['title'] == "Edit profile") { var selFrom = document.createElement("select"); selFrom.name = "form_data_profile_attended_from"; x = 1940; - html = "<option></option><option>Did Not Attend UNL</option>"; + html = '<option></option>'; while (x++ < curYear + 6) { html+= '<option'; if (x == from_year) { @@ -188,7 +188,7 @@ if ($vars['title'] == "Edit profile") { var selTo = document.createElement("select"); selTo.name = "form_data_profile_attended_to"; x = 1940; - html = "<option></option><option>Did Not Attend UNL</option>"; + html = '<option></option>'; while (x++ < curYear + 6) { html+= '<option'; if (x == to_year) {