YaleSTC / shifts

Application to easily track shifts, reports, and payforms for employees.
MIT License
23 stars 18 forks source link

Deprecated: no_js fallbacks #292

Closed dgoerger closed 10 years ago

dgoerger commented 10 years ago

JS is a web standard. We should remove uncalled legacy code hidden under the no_js class.

dgoerger commented 10 years ago

see comments in pull request #278.

jasonkliu commented 10 years ago

I agree, let's nuke the no-js pages. All of the plugin collection_multiple_select uses are on no-js pages anyway, which makes removing the plugin even easier.

The behavior of no-js isi described in app/assets/javascripts/application.js

//Don't load anything before the document is ready.
$(document).ready(function() {

    // If javascript is enabled, anything with the class 'no_js' will be hidden
    $('.no_js').hide();

    // If javascript is enabled, anything with the class 'no_js' will be shown
    $('.only_js').show();
    ...
});

Nuke these files:

app/views/payform_item_sets/_form.html.erb (uses multiple-select plugin)
app/views/shifts/_view_preferences.html.erb (uses multiple-select plugin)

app/views/payforms/_date_select.html.erb:3:  <%= submit_tag "Change Date", :id => 'submit_date', :class => 'no_js' %>
app/views/time_slots/index.html.erb:3:<h1 class="no_js"><%= link_to "New Time Slot", new_time_slot_path(:date => params[:date]) %></h1>
jasonkliu commented 10 years ago

Yup, this is done > all files are removed and copies of original "multiple-select" lines are removed.

njlxyaoxinwei commented 10 years ago

Some elements (e.g. checkboxes in the partial notices/locations) still have class "only_js" and are hidden by default

njlxyaoxinwei commented 10 years ago

A quick search shows that repeating_events/form and shifts/view_preferences still have hidden elements of class "only_js". These three are the only places

jasonkliu commented 10 years ago

r+

also, notices/_locations. there's 2 occurrences in that file (not sure if you're working off another branch than master which already changed that file)

njlxyaoxinwei commented 10 years ago

correct, I fixed 4 occurrences in all

mnquintana commented 10 years ago

Resolved in #357