sfu/canvas-lms — pull request #21 by grahamb (2013-02-27 21:15:38+00:00)
Title: Refactor course request form JavaScript

Notable highlights:
- Move JS into its own file
- Encapsulate everything into an IIFE. Closures FTW!
- Remove 'clear on focus' behaviour from username field
- Remove inline onChange handlers from the template and utilize
$.fn.on instead. Separation of concerns FTW!
- Use a simple jQuery plugin for Spin

prevent enter in #username from submitting form

trigger a click on the button instead

Signed-off-by: Graham Ballantyne

whitespace, yo

Signed-off-by: Graham Ballantyne

don't clear the username field on click

clearing the username field on a click isn't user-friendly -- what if they wanted to fix a typo?

Signed-off-by: Graham Ballantyne

convert $.getJSON calls to use $.ajax and provide error handlers

$.getJSON doesn't support providing an error handler

Signed-off-by: Graham Ballantyne

use an object instead of an array to hold term codes

Signed-off-by: Graham Ballantyne

change wording of cross-list checkbox text

Signed-off-by: Graham Ballantyne

move course request form javascript into external file

Signed-off-by: Graham Ballantyne

move click handlers into ready fn

Signed-off-by: Graham Ballantyne

add a jquery plugin for spin.js

Signed-off-by: Graham Ballantyne

rename opts -> spinnerOpts

Signed-off-by: Graham Ballantyne

use spin plugin

Signed-off-by: Graham Ballantyne

remove un-used variables to make jshint less angry

Signed-off-by: Graham Ballantyne

remove inline onchange handlers

inline handlers are evil

Signed-off-by: Graham Ballantyne

add click handlers for checkboxes

replaces inline handlers

Signed-off-by: Graham Ballantyne

fix selectors

Signed-off-by: Graham Ballantyne

whitespace fixes

Signed-off-by: Graham Ballantyne