Registration working until workshops

This commit is contained in:
Godwin
2015-08-04 21:54:04 -07:00
parent bbebefd6bf
commit 9da5f6a223
27 changed files with 1159 additions and 206 deletions
+37 -3
View File
@@ -36,6 +36,40 @@
%footer= render 'shared/footer'
- if content_for?(:footer_scripts)
= yield :footer_scripts
- if content_for?(:scripts) || content_for?(:dom_ready)
:javascript
#{content_for?(:scripts) ? "#{yield :scripts}" : ''}#{content_for?(:dom_ready) ? "$(function(){#{yield :dom_ready}});" : ''}
-# if content_for?(:scripts) || content_for?(:dom_ready)
-# #{content_for?(:scripts) ? "#{yield :scripts}" : ''}#{content_for?(:dom_ready) ? "$(function(){#{yield :dom_ready}});" : ''}
:javascript
(function() {
if (!String.prototype.trim) {
(function() {
var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
String.prototype.trim = function() {
return this.replace(rtrim, '');
};
})();
}
function classExists(elem,className){var p = new RegExp('(^| )'+className+'( |$)');return (elem.className && elem.className.match(p));}
function addClass(elem,className){if(classExists(elem,className)){return true;}elem.className += ' '+className;}
function removeClass(elem,className){var c = elem.className;var p = new RegExp('(^| )'+className+'( |$)');c = c.replace(p,' ').replace(/ /g,' ');elem.className = c.trim();}
[].slice.call(document.querySelectorAll('.input-field input')).forEach(function(inputEl) {
if (inputEl.value.trim() === '') {
inputEl.parentNode.className = inputEl.parentNode.className + ' empty';
}
inputEl.addEventListener('focus', onInputFocus);
inputEl.addEventListener('blur', onInputBlur);
});
function onInputFocus(ev) {
removeClass(ev.target.parentNode, 'empty')
}
function onInputBlur(ev) {
if (ev.target.value.trim() === '') {
addClass(ev.target.parentNode, 'empty');
}
}
})();