app/assets/javascripts/custom/people.js in artfully_ose-1.2.0.beta.1 vs app/assets/javascripts/custom/people.js in artfully_ose-1.2.0.pre
- old
+ new
@@ -1,18 +1,14 @@
String.prototype.startsWith = function(str)
{return (this.match("^"+str)==str)}
$(document).ready(function() {
- $("#communication-preference input[type=checkbox]").on("click", function(event) {
- $("#communication-preference input[type=submit]").removeClass("hidden");
+ $("#email-subscription input[type=checkbox]").on("click", function(event) {
+ $("#email-subscription input[type=submit]").removeClass("hidden");
});
-
- $("#subscription-listing input[type=checkbox]").on("click", function(event) {
- $("#subscription-listing input[type=submit]").removeClass("hidden");
- });
-
- $("#person_do_not_call").on("click", function(event) {
+
+ $("#person_do_not_email").on("click", function(event) {
$lists = $(".mail-chimp-list");
if ($(this).attr("checked") != "checked") {
$lists.attr("disabled", false);
} else {
$lists.attr("checked", false);
@@ -158,66 +154,7 @@
$("#mailing-address-form").hide();
$("#mailing-address").show();
$("#create-mailing-address, #update-mailing-address").show();
return false;
});
-
- $('#edit_link').click(function(){
- dayDropDownValue.call(this);
- yearDropDownValue.call(this);
- dayValueForSelect.call(this);
- yearValueForSelect.call(this);
- });
-
- $('#birth_month').change(function(){
- dayDropDownValue.call(this);
- });
-});
-function yearDropDownValue(){
- var year_now = getYear();
- var yearsAsString = "";
-
- for(var i = 1920; i <= year_now; i++) {
- yearsAsString += "<option value='" + i + "'>" + i + "</option>";
- }
-
- $('#birth_year').html("<option value=''></option>");
- $('#birth_year').append(yearsAsString);
-}
-
-function dayDropDownValue(){
- var month = $('#birth_month').val();
- var year = $('#birth_year').val();
- var num_days = daysInMonth(month, 2012);
- var days_range = range(1,num_days + 1);
- var daysAsString = "";
-
- for(var i = 1; i < days_range.length; i++) {
- daysAsString += "<option value='" + days_range[i] + "'>" + days_range[i] + "</option>";
- }
-
- $('#birth_day').html("<option value=''></option>");
- $('#birth_day').append(daysAsString);
-}
-
-function yearValueForSelect(){
- var birth_year = $('div.year').data('person-birth_year');
- $('#birth_year').val(birth_year);
-}
-
-function dayValueForSelect(){
- var birth_day = $('div.day').data('person-birth_day');
- $('#birth_day').val(birth_day);
-}
-
-function daysInMonth(month,year) {
- return new Date(year, month, 0).getDate();
-}
-
-function getYear(){
- return new Date().getFullYear();
-}
-
-function range(start,num){
- return Array.apply(start, Array(num)).map(function (_, i) {return i;});
-}
+});