/* Formalize - version 1.2 Note: This file depends on the ExtJS 3.x library. */ // Module pattern: // http://yuiblog.com/blog/2007/06/12/module-pattern var FORMALIZE = (function(window, document, undefined) { // Internet Explorer detection. function IE(version) { var b = document.createElement('b'); b.innerHTML = ''; return !!b.getElementsByTagName('br').length; } // Private constants. var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input'); var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input'); var IE6 = IE(6); var IE7 = IE(7); // Expose innards of FORMALIZE. return { // FORMALIZE.go go: function() { var i, j = this.init; for (i in j) { j.hasOwnProperty(i) && j[i](); } }, // FORMALIZE.init init: { // FORMALIZE.init.disable_link_button disable_link_button: function() { Ext.getBody().on('click', function(ev) { var el = ev.target; var is_disabled = el.tagName.toLowerCase() === 'a' && el.className.match('button_disabled'); if (is_disabled) { ev.preventDefault(); } }); }, // FORMALIZE.init.full_input_size full_input_size: function() { if (!IE7 || !Ext.query('textarea, input.input_full')) { return; } // This fixes width: 100% on