Sha256: c1aebebd2408517a2f79697c269b736029cf02c81f511ca5c9040b649895e921
Contents?: true
Size: 1.83 KB
Versions: 2
Compression:
Stored size: 1.83 KB
Contents
YUI.add("formalize",function(a){var b="placeholder"in document.createElement("input"),c="autofocus"in document.createElement("input"),d=parseInt(a.UA.ie,10)===6,e=parseInt(a.UA.ie,10)===7;a.formalize={go:function(){for(var b in a.formalize.init)a.formalize.init[b]()},init:{full_input_size:function(){e&&a.all("textarea, input.input_full")&&a.all("textarea, input.input_full").each(function(b){var c=a.Node.create('<span class="input_full_wrap"></span>');c.append(b.replace(c))})},ie6_skin_inputs:function(){if(d&&a.all("input, select, textarea")){var b=/button|submit|reset/,c=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;a.all("input").each(function(a){a.getAttribute("type").match(b)?(a.addClass("ie6_button"),a.disabled&&a.addClass("ie6_button_disabled")):a.getAttribute("type").match(c)&&(a.addClass("ie6_input"),a.disabled&&a.addClass("ie6_input_disabled"))}),a.all("textarea, select").each(function(a){a.disabled&&a.addClass("ie6_input_disabled")})}},autofocus:function(){c||!a.one("[autofocus]")||a.one("[autofocus]").focus()},placeholder:function(){!b&&!!a.one("[placeholder]")&&(a.formalize.misc.add_placeholder(),a.all("[placeholder]").each(function(b){var c=b.getAttribute("placeholder"),d=b.ancestor("form");b.on("focus",function(){b.get("value")===c&&b.set("value","").removeClass("placeholder_text")}),b.on("blur",function(){a.formalize.misc.add_placeholder()}),d&&d.on("submit",function(){b.get("value")===c&&b.set("value","").removeClass("placeholder_text")}),d&&d.on("reset",function(){setTimeout(a.formalize.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){b||!a.one("[placeholder]")||a.all("[placeholder]").each(function(a){var b=a.getAttribute("placeholder");(!a.get("value")||a.get("value")===b)&&a.set("value",b).addClass("placeholder_text")})}}}},"1.1",{requires:["node","event"]})
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
formalize-rails-0.0.5 | vendor/assets/javascripts/yui.formalize.min.js |
formalize-rails-0.0.4 | vendor/assets/javascripts/yui.formalize.min.js |