// // Note: This file depends on the Dojo library. // // Module pattern: // http://yuiblog.com/blog/2007/06/12/module-pattern/ var FORMALIZE = (function(window, document, undefined) { // Private constants. var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input'); var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input'); var WEBKIT = 'webkitAppearance' in document.createElement('select').style; var IE6 = parseInt(dojo.isIE, 10) === 6; var IE7 = parseInt(dojo.isIE, 10) === 7; // Expose innards of FORMALIZE. return { // FORMALIZE.go go: function() { for (var i in FORMALIZE.init) { FORMALIZE.init[i](); } }, // FORMALIZE.init init: { // FORMALIZE.init.detect_webkit detect_webkit: function() { if (!WEBKIT) { return; } // Tweaks for Safari + Chrome. // dojo.addClass(document.documentElement, 'is_webkit'); }, // FORMALIZE.init.full_input_size full_input_size: function() { if (!IE7 || !dojo.query('textarea, input.input_full').length) { return; } // This fixes width: 100% on