Skip to content

Commit

Permalink
Strip leading and trailing spaces for application code.
Browse files Browse the repository at this point in the history
Vendor libraries have been left alone.  (Well, some have.)
  • Loading branch information
David Yip committed Mar 23, 2012
1 parent 9d9caf6 commit 50a7435
Show file tree
Hide file tree
Showing 341 changed files with 968 additions and 1,132 deletions.
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--colour -fn
--colour -fn
2 changes: 1 addition & 1 deletion Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'config/deploy' # remove this line to skip loading any of the default tasks
load 'deploy/assets'
load 'deploy/assets'
2 changes: 1 addition & 1 deletion app/assets/javascripts/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@
};
}
});
})(jQuery);
})(jQuery);
2 changes: 1 addition & 1 deletion app/assets/javascripts/consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ $(document).ready(function() {
}
window.scroll(0,0);
})
});
});
22 changes: 10 additions & 12 deletions app/assets/javascripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ function check_select_for_other(select_id, other_id) {
if (s.val() == "-5") {
o.removeAttr('disabled');
// to make the change more visible
o.css('background-color', '#FAFAD2');
o.css('border', '2px solid #808080');
o.css('background-color', '#FAFAD2');
o.css('border', '2px solid #808080');
sel.parent('p.ncs_select').next('p.other_field').show();
} else {
// clear the other field
o.val('');
o.attr('disabled', 'disabled');
// to make disabled more visible
o.css('border', '1px solid #ccc');
o.css('background-color', '#ccc');
o.css('border', '1px solid #ccc');
o.css('background-color', '#ccc');
sel.parent('p.ncs_select').next('p.other_field').hide();
}
}
}

function stop_default_action(e) {
if (e &&e.preventDefault) {
// to disable the default event we call the preventDefault() method of the event handler
// to disable the default event we call the preventDefault() method of the event handler
// (for those browsers that recognise standard event listeners)
e.preventDefault();
} else if (window.event && window.event.returnValue) {
// we set the eventReturnValue property to false for Internet Explorer
// we set the eventReturnValue property to false for Internet Explorer
// (which uses its own proprietary means of attaching events)
window.eventReturnValue = false;
}
Expand All @@ -59,13 +59,13 @@ $(document).ready(function() {
changeYear: true,
yearRange: '1920:2020'
});
$("input[type='text'].date").datepicker( {
$("input[type='text'].date").datepicker( {
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
yearRange: '1920:2020'
} );
$("input[type='text'].datepicker").datepicker( {
$("input[type='text'].datepicker").datepicker( {
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
Expand Down Expand Up @@ -103,20 +103,18 @@ $(document).ready(function() {
});
});


$(".help_icon").tooltip();
$(".disposition_icon").tooltip({ position: "bottom left"});
$(".notification_icon").tooltip();
$("#tabs").tabs();

$("#event_show_close_fields a").click(function() {
$('#event_end_date_fields').toggle();
$('#event_show_close_fields').toggle();
});

$("#event_end_date_fields a").click(function() {
$('#event_show_close_fields').toggle();
$('#event_end_date_fields').toggle();
});
});

4 changes: 2 additions & 2 deletions app/assets/javascripts/nested_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ NestedAttributes.prototype = {
$(link).prev("input[type=hidden]").val("1");
if (removeStyle === 'hide' ) {
$(link).closest(".fields").hide();

}
else if (removeStyle === 'clear' ) {
$(link).closest(".fields").find('input').clearFields();
Expand All @@ -63,7 +63,7 @@ NestedAttributes.prototype = {
var new_id = new Date().getTime(),
regexp1 = new RegExp("new_" + association, "g"),
regexp2 = new RegExp("new_nested_record", "g");

content = content.replace(regexp1, new_id);
content = content.replace(regexp2, 'new_nested_record_' + new_id);
$(link).closest("." + association).find('.nested_records_' + association).append(content);
Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/ui/non_interview_reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ NCSCore.UI.NonInterviewReportAssociation = function (config) {
addHandler: null,
caller: this
});

var refusalNonInterviewReportAttributesForm = new NestedAttributes({
container: $('.refusal_non_interview_reports'),
association: 'refusal_non_interview_reports',
content: config.refusalNonInterviewReportTemplate,
addHandler: null,
caller: this
});

var dwellingUnitTypeNonInterviewReportAttributesForm = new NestedAttributes({
container: $('.dwelling_unit_type_non_interview_reports'),
association: 'dwelling_unit_type_non_interview_reports',
content: config.dwellingUnitTypeNonInterviewReportTemplate,
addHandler: null,
caller: this
});

var vacantInterviewReportAttributesForm = new NestedAttributes({
container: $('.vacant_non_interview_reports'),
association: 'vacant_non_interview_reports',
content: config.vacantNonInterviewReportTemplate,
addHandler: null,
caller: this
});
};
};
6 changes: 3 additions & 3 deletions app/assets/javascripts/ui/participants.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
NCSCore.UI.Participants = function (config) {

var onsuccess = function(data) {
var participant_id = data.id;
var url = "/participants/" + participant_id + "/schedule";
$.get(url, null, function (response) {
$('div#participant_schedule_' + participant_id).replaceWith(response);
});
};

var onerror = function(data) {
var participant_id = data["id"];
$('div#participant_schedule_' + participant_id).append("<div class='psc_error'>" + data.errors + "</div>");
Expand All @@ -29,4 +29,4 @@ NCSCore.UI.Participants = function (config) {
}
});
});
}
}
2 changes: 1 addition & 1 deletion app/assets/javascripts/ui/people.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ NCSCore.UI.People = function (config) {
caller: this
});
setupPeopleAutocompleter();
};
};
2 changes: 1 addition & 1 deletion app/assets/javascripts/ui/ppg_status_histories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ NCSCore.UI.PPGStatus = function (config) {
addHandler: null,
caller: this
});
};
};
2 changes: 0 additions & 2 deletions app/assets/javascripts/underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@
return -1;
};


// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
_.lastIndexOf = function(array, item) {
if (array == null) return -1;
Expand Down Expand Up @@ -538,7 +537,6 @@
};
};


// Object Functions
// ----------------

Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
*= require jquery-ui.custom
*= require jquery-ui-timepicker-addon
*= require surveyor
*/
*/
18 changes: 6 additions & 12 deletions app/assets/stylesheets/jquery-ui.custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }


/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }


/* Icons
----------------------------------*/

/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }


/* Misc visuals
----------------------------------*/

/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }


/*
* jQuery UI CSS Framework 1.8.6
*
Expand All @@ -53,7 +49,6 @@
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
*/


/* Component containers
----------------------------------*/
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
Expand Down Expand Up @@ -275,7 +270,6 @@
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }


/* Misc visuals
----------------------------------*/

Expand Down Expand Up @@ -348,7 +342,7 @@
*
* http://docs.jquery.com/UI/Autocomplete#theming
*/
.ui-autocomplete { position: absolute; cursor: default; }
.ui-autocomplete { position: absolute; cursor: default; }

/* workarounds */
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
Expand Down Expand Up @@ -404,8 +398,8 @@
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }
.ui-button-icons-only { width: 3.4em; }
button.ui-button-icons-only { width: 3.7em; }

/*button text element */
.ui-button .ui-button-text { display: block; line-height: 1.4; }
Expand Down Expand Up @@ -441,7 +435,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
*/
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
Expand Down Expand Up @@ -513,7 +507,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
Expand Down Expand Up @@ -569,4 +563,4 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
* http://docs.jquery.com/UI/Progressbar#theming
*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
1 change: 0 additions & 1 deletion app/controllers/contact_links_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def set_instrument_time_and_date(contact)
end
end


def find_or_create_instrument(survey)
@contact_link.instrument
end
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/contacts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,4 @@ def find_or_create_contact_link
link
end


end
end
2 changes: 1 addition & 1 deletion app/controllers/dwelling_units_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ def create_household_unit

end

end
end
2 changes: 1 addition & 1 deletion app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ def set_disposition_group
end
end

end
end
8 changes: 4 additions & 4 deletions app/controllers/household_units_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def index
format.json { render :json => @household_units }
end
end

# GET /household_units/new
# GET /household_units/new.json
def new
Expand All @@ -37,7 +37,7 @@ def create
end
end
end

# GET /household_units/1/edit
def edit
@household_unit = HouseholdUnit.find(params[:id])
Expand All @@ -58,5 +58,5 @@ def update
end
end
end
end

end
2 changes: 1 addition & 1 deletion app/controllers/participants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@ def mark_pending_event_activities_canceled(participant)
end
end

end
end
2 changes: 1 addition & 1 deletion app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ def find_or_create_contact_link
link
end

end
end
5 changes: 2 additions & 3 deletions app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ def case_status
if request.post?
@outfile = "case_status_report_" + Time.now.strftime("%m-%d-%Y") + ".csv"

reporter = Reporting::CaseStatusReport.new(psc,
reporter = Reporting::CaseStatusReport.new(psc,
{ :start_date => @start_date, :end_date => @end_date })
csv_data = reporter.generate_report
send_data csv_data,
:type => 'text/csv; charset=iso-8859-1; header=present',
:disposition => "attachment; filename=#{@outfile}"
end


end

end
end
2 changes: 1 addition & 1 deletion app/controllers/surveyor_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ def update_participant_based_on_survey(response_set)
participant.update_state_after_survey(response_set, psc)
end
end
end
end
Loading

0 comments on commit 50a7435

Please sign in to comment.