diff options
author | Dave Whiteland <dave@mysociety.org> | 2012-06-25 14:33:57 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2012-06-25 14:33:57 +0100 |
commit | f9fe02f91ac72ea2954ee68a5f32d96a237fcd67 (patch) | |
tree | f91d63ab3d6b9cd3555587090a541c870ecd3363 /phonegap/www/js/southampton.js | |
parent | 67da8efc720d2d0bd22bd9fe8655b7e983b35bb4 (diff) | |
parent | 45b3040884d7089e7d8c6f4acccd657b91c92a04 (diff) |
Merge branch 'master' into fmb-read-only
Conflicts:
.gitignore
bin/make_css
perllib/FixMyStreet/Cobrand/FixMyStreet.pm
Diffstat (limited to 'phonegap/www/js/southampton.js')
-rw-r--r-- | phonegap/www/js/southampton.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/phonegap/www/js/southampton.js b/phonegap/www/js/southampton.js new file mode 100644 index 000000000..e7af4fcaf --- /dev/null +++ b/phonegap/www/js/southampton.js @@ -0,0 +1,50 @@ +/* + * southampton.js + * FixMyStreet JavaScript for Southampton + */ + + +$(function(){ + + $('[placeholder]').focus(function(){ + var input = $(this); + if (input.val() == input.attr('placeholder')) { + input.val(''); + input.removeClass('placeholder'); + input.css({ 'color': '#000000' }); + } + }).blur(function(){ + var input = $(this); + if (input.val() === '' || input.val() == input.attr('placeholder')) { + input.css({ 'color': '#999999' }); + input.val(input.attr('placeholder')); + } + }).blur(); + + $('#form_category').change(function(){ + var category = $(this).val(); + if ('Potholes' == category) { + if (!$('#potholes_extra').length) { + var qns = '<div id="potholes_extra" style="margin:0; display:none;">' + + '<div class="form-field"><label for="form_size">Size:</label>' + + '<select name="detail_size"><option>-- Please select --<option>Unknown' + + '<option>Small: No larger than a dinner plate (up to 30cm/12inches)' + + '<option>Medium: No larger than a dustbin lid (up to 60cm/24inches)' + + '<option>Large: Larger than a dustbin lid (over 60cm/24inches)' + + '</select></div>' + + '<div class="form-field"><label for="form_depth">Depth:</label>' + + '<select name="detail_depth"><option>-- Please select --<option>Unknown' + + '<option>No deeper than a golf ball (up to 4cm/1.5inches)' + + '<option>No deeper than a tennis ball (up to 6.5cm/2.5inches)' + + '<option>Deeper than a tennis ball' + + '</select></div></div>'; + $('#form_title').closest('div.form-field').after(qns); + } + $('#potholes_extra').show('fast'); + } else { + $('#potholes_extra').hide('fast'); + } + }).change(); + +}); + |