formalize-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,6 +2,7 @@ require 'bundler/gem_tasks'
2
2
 
3
3
  desc "Get the newest version of formalize from github"
4
4
  task :update do
5
+ Thread.abort_on_exception = true
5
6
  require 'open-uri'
6
7
 
7
8
  base_url = "https://raw.github.com/nathansmith/formalize/master/assets"
@@ -11,44 +12,54 @@ task :update do
11
12
  css = %w(formalize.css)
12
13
  images = %w(button.png select_arrow.gif)
13
14
 
14
- js.each do |file|
15
- url = File.join(base_url, "js", file)
16
- path = File.join(target, "javascripts", file)
17
- File.open(path, 'w') do |t|
18
- open url do |f|
19
- f.each_line do |line|
20
- t << line
15
+ threads = []
16
+
17
+ threads += js.map do |file|
18
+ Thread.new do
19
+ url = File.join(base_url, "js", file)
20
+ path = File.join(target, "javascripts", file)
21
+ File.open(path, 'w') do |t|
22
+ open url do |f|
23
+ f.each_line do |line|
24
+ t << line
25
+ end
21
26
  end
22
27
  end
28
+ puts "Saved #{path}"
23
29
  end
24
- puts "Saved #{path}"
25
30
  end
26
31
 
27
- images.each do |file|
28
- url = File.join(base_url, "images", file)
29
- path = File.join(target, "images/formalize", file)
30
- File.open(path, 'wb') do |t|
31
- open url do |f|
32
- t << f.read
32
+ threads += images.map do |file|
33
+ Thread.new do
34
+ url = File.join(base_url, "images", file)
35
+ path = File.join(target, "images/formalize", file)
36
+ File.open(path, 'wb') do |t|
37
+ open url do |f|
38
+ t << f.read
39
+ end
33
40
  end
41
+ puts "Saved #{path}"
34
42
  end
35
- puts "Saved #{path}"
36
43
  end
37
44
 
38
45
 
39
- css.each do |file|
40
- url = File.join(base_url, "css", file)
41
- path = File.join(target, "stylesheets", file)
42
- File.open(path, 'w') do |t|
43
- open url do |f|
44
- f.each_line do |line|
45
- t << line.gsub(%r|url\(.+/([^/]+)\)|, "url(/assets/formalize/\\1)")
46
+ threads += css.map do |file|
47
+ Thread.new do
48
+ url = File.join(base_url, "css", file)
49
+ path = File.join(target, "stylesheets", file)
50
+ File.open(path, 'w') do |t|
51
+ open url do |f|
52
+ f.each_line do |line|
53
+ t << line.gsub(%r|url\(.+/([^/]+)\)|, "url(/assets/formalize/\\1)")
54
+ end
46
55
  end
47
56
  end
57
+ puts "Saved #{path}"
48
58
  end
49
- puts "Saved #{path}"
50
59
  end
51
60
 
52
- puts "Done"
61
+ threads.each(&:join)
62
+
63
+ puts "Done!"
53
64
 
54
65
  end
@@ -1,5 +1,5 @@
1
1
  module Formalize
2
2
  module Rails
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -1 +1 @@
1
- var FORMALIZE=function(a,b,c){var d="placeholder"in b.createElement("input"),e="autofocus"in b.createElement("input"),f=parseInt(dojo.isIE,10)===6,g=parseInt(dojo.isIE,10)===7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){!!g&&!!dojo.query("textarea, input.input_full").length&&dojo.query("textarea, input.input_full").forEach(function(a){var c=a.cloneNode(!1),d=b.createElement("span");d.className="input_full_wrap",d.appendChild(c),a.parentNode.replaceChild(d,a)})},ie6_skin_inputs:function(){if(!!f&&!!dojo.query("input, select, textarea").length){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;dojo.query("input").forEach(function(c){c.getAttribute("type").match(a)?(dojo.addClass(c,"ie6_button"),c.disabled&&dojo.addClass(c,"ie6_button_disabled")):c.getAttribute("type").match(b)&&(dojo.addClass(c,"ie6_input"),c.disabled&&dojo.addClass(c,"ie6_input_disabled"))}),dojo.query("textarea, select").forEach(function(a){a.disabled&&dojo.addClass(a,"ie6_input_disabled")})}},autofocus:function(){!e&&!!dojo.query("[autofocus]").length&&dojo.query("[autofocus]")[0].focus()},placeholder:function(){!d&&!!dojo.query("[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),dojo.query("[placeholder]").forEach(function(a){dojo.connect(a,"onfocus",function(){var b=a.getAttribute("placeholder");a.value===b&&(a.value="",dojo.removeClass(a,"placeholder_text"))}),dojo.connect(a,"onblur",function(){FORMALIZE.misc.add_placeholder()})}),dojo.query("form").forEach(function(a){dojo.connect(a,"onsubmit",function(){dojo.query("[placeholder]",a).forEach(function(a){var b=a.getAttribute("placeholder");a.value===b&&(a.value="",dojo.removeClass(a,"placeholder_text"))})}),dojo.connect(a,"onreset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){!d&&!!dojo.query("[placeholder]").length&&dojo.query("[placeholder]").forEach(function(a){var b=a.getAttribute("placeholder");if(!a.value||a.value===b)a.value=b,dojo.addClass(a,"placeholder_text")})}}}}(this,this.document);dojo.addOnLoad(function(){FORMALIZE.go()})
1
+ var FORMALIZE=function(a,b){var c="placeholder"in b.createElement("input"),d="autofocus"in b.createElement("input"),e=parseInt(dojo.isIE,10)===6,f=parseInt(dojo.isIE,10)===7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){f&&dojo.query("textarea, input.input_full").length&&dojo.query("textarea, input.input_full").forEach(function(a){var c=a.cloneNode(!1),d=b.createElement("span");d.className="input_full_wrap",d.appendChild(c),a.parentNode.replaceChild(d,a)})},ie6_skin_inputs:function(){if(e&&dojo.query("input, select, textarea").length){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;dojo.query("input").forEach(function(c){c.getAttribute("type").match(a)?(dojo.addClass(c,"ie6_button"),c.disabled&&dojo.addClass(c,"ie6_button_disabled")):c.getAttribute("type").match(b)&&(dojo.addClass(c,"ie6_input"),c.disabled&&dojo.addClass(c,"ie6_input_disabled"))}),dojo.query("textarea, select").forEach(function(a){a.disabled&&dojo.addClass(a,"ie6_input_disabled")})}},autofocus:function(){d||!dojo.query("[autofocus]").length||dojo.query("[autofocus]")[0].focus()},placeholder:function(){!c&&!!dojo.query("[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),dojo.query("[placeholder]").forEach(function(a){dojo.connect(a,"onfocus",function(){var b=a.getAttribute("placeholder");a.value===b&&(a.value="",dojo.removeClass(a,"placeholder_text"))}),dojo.connect(a,"onblur",function(){FORMALIZE.misc.add_placeholder()})}),dojo.query("form").forEach(function(a){dojo.connect(a,"onsubmit",function(){dojo.query("[placeholder]",a).forEach(function(a){var b=a.getAttribute("placeholder");a.value===b&&(a.value="",dojo.removeClass(a,"placeholder_text"))})}),dojo.connect(a,"onreset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){c||!dojo.query("[placeholder]").length||dojo.query("[placeholder]").forEach(function(a){var b=a.getAttribute("placeholder");if(!a.value||a.value===b)a.value=b,dojo.addClass(a,"placeholder_text")})}}}}(this,this.document);dojo.addOnLoad(function(){FORMALIZE.go()})
@@ -1 +1 @@
1
- var FORMALIZE=function(a,b,c){var d="placeholder"in b.createElement("input"),e="autofocus"in b.createElement("input"),f=Ext.isIE6,g=Ext.isIE7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){!!g&&!!Ext.query("textarea, input.input_full")&&Ext.each(Ext.query("textarea, input.input_full"),function(a){Ext.get(a).wrap('<span class="input_full_wrap"></span>')})},ie6_skin_inputs:function(){if(!!f&&!!Ext.query("input, select, textarea")){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;Ext.each(Ext.query("input"),function(c){c.getAttribute("type").match(a)?(Ext.get(c).addClass("ie6_button"),c.disabled&&Ext.get(c).addClass("ie6_button_disabled")):c.getAttribute("type").match(b)&&(Ext.get(c).addClass("ie6_input"),c.disabled&&Ext.get(c).addClass("ie6_input_disabled"))}),Ext.each(Ext.query("textarea, select"),function(a){a.disabled&&Ext.get(a).addClass("ie6_input_disabled")})}},autofocus:function(){!e&&!!Ext.query("[autofocus]")&&Ext.query("[autofocus]")[0].focus()},placeholder:function(){!d&&!!Ext.query("[placeholder]")&&(FORMALIZE.misc.add_placeholder(),Ext.each(Ext.query("[placeholder]"),function(a){function d(){if(!a.value||a.value===b)a.value=b,Ext.get(a).addClass("placeholder_text")}var b=a.getAttribute("placeholder"),c=Ext.get(a).parent("form");Ext.get(a).on("focus",function(){a.value===b&&(a.value="",Ext.get(a).removeClass("placeholder_text"))}),Ext.get(a).on("blur",function(){FORMALIZE.misc.add_placeholder()}),c.on("submit",function(){a.value===b&&(a.value="",Ext.get(a).removeClass("placeholder_text"))}),c.on("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){!d&&!!Ext.query("[placeholder]")&&Ext.each(Ext.query("[placeholder]"),function(a){var b=a.getAttribute("placeholder");if(!a.value||a.value===b)a.value=b,Ext.get(a).addClass("placeholder_text")})}}}}(this,this.document);Ext.onReady(function(){FORMALIZE.go()})
1
+ var FORMALIZE=function(a,b){var c="placeholder"in b.createElement("input"),d="autofocus"in b.createElement("input"),e=Ext.isIE6,f=Ext.isIE7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){f&&Ext.query("textarea, input.input_full")&&Ext.each(Ext.query("textarea, input.input_full"),function(a){Ext.get(a).wrap('<span class="input_full_wrap"></span>')})},ie6_skin_inputs:function(){if(e&&Ext.query("input, select, textarea")){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;Ext.each(Ext.query("input"),function(c){c.getAttribute("type").match(a)?(Ext.get(c).addClass("ie6_button"),c.disabled&&Ext.get(c).addClass("ie6_button_disabled")):c.getAttribute("type").match(b)&&(Ext.get(c).addClass("ie6_input"),c.disabled&&Ext.get(c).addClass("ie6_input_disabled"))}),Ext.each(Ext.query("textarea, select"),function(a){a.disabled&&Ext.get(a).addClass("ie6_input_disabled")})}},autofocus:function(){d||!Ext.query("[autofocus]")||Ext.query("[autofocus]")[0].focus()},placeholder:function(){!c&&!!Ext.query("[placeholder]")&&(FORMALIZE.misc.add_placeholder(),Ext.each(Ext.query("[placeholder]"),function(a){var b=a.getAttribute("placeholder"),c=Ext.get(a).parent("form");Ext.get(a).on("focus",function(){a.value===b&&(a.value="",Ext.get(a).removeClass("placeholder_text"))}),Ext.get(a).on("blur",function(){FORMALIZE.misc.add_placeholder()}),c.on("submit",function(){a.value===b&&(a.value="",Ext.get(a).removeClass("placeholder_text"))}),c.on("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){c||!Ext.query("[placeholder]")||Ext.each(Ext.query("[placeholder]"),function(a){var b=a.getAttribute("placeholder");if(!a.value||a.value===b)a.value=b,Ext.get(a).addClass("placeholder_text")})}}}}(this,this.document);Ext.onReady(function(){FORMALIZE.go()})
@@ -1 +1 @@
1
- var FORMALIZE=function(a,b,c,d){var e="placeholder"in c.createElement("input"),f="autofocus"in c.createElement("input"),g=!!a.browser.msie&&parseInt(a.browser.version,10)===6,h=!!a.browser.msie&&parseInt(a.browser.version,10)===7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){!!h&&!!a("textarea, input.input_full").length&&a("textarea, input.input_full").wrap('<span class="input_full_wrap"></span>')},ie6_skin_inputs:function(){if(!!g&&!!a("input, select, textarea").length){var b=/button|submit|reset/,c=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;a("input").each(function(){var d=a(this);this.getAttribute("type").match(b)?(d.addClass("ie6_button"),this.disabled&&d.addClass("ie6_button_disabled")):this.getAttribute("type").match(c)&&(d.addClass("ie6_input"),this.disabled&&d.addClass("ie6_input_disabled"))}),a("textarea, select").each(function(){this.disabled&&a(this).addClass("ie6_input_disabled")})}},autofocus:function(){!f&&!!a(":input[autofocus]").length&&a(":input[autofocus]:visible:first").focus()},placeholder:function(){!e&&!!a(":input[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),a(":input[placeholder]").each(function(){var b=a(this),c=b.attr("placeholder");b.focus(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).blur(function(){FORMALIZE.misc.add_placeholder()}),b.closest("form").submit(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).bind("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){!e&&!!a(":input[placeholder]").length&&a(":input[placeholder]").each(function(){var b=a(this),c=b.attr("placeholder");(!b.val()||b.val()===c)&&b.val(c).addClass("placeholder_text")})}}}}(jQuery,this,this.document);jQuery(document).ready(function(){FORMALIZE.go()})
1
+ var FORMALIZE=function(a,b,c){var d="placeholder"in c.createElement("input"),e="autofocus"in c.createElement("input"),f=!!a.browser.msie&&parseInt(a.browser.version,10)===6,g=!!a.browser.msie&&parseInt(a.browser.version,10)===7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){g&&a("textarea, input.input_full").length&&a("textarea, input.input_full").wrap('<span class="input_full_wrap"></span>')},ie6_skin_inputs:function(){if(f&&a("input, select, textarea").length){var b=/button|submit|reset/,c=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;a("input").each(function(){var d=a(this);this.getAttribute("type").match(b)?(d.addClass("ie6_button"),this.disabled&&d.addClass("ie6_button_disabled")):this.getAttribute("type").match(c)&&(d.addClass("ie6_input"),this.disabled&&d.addClass("ie6_input_disabled"))}),a("textarea, select").each(function(){this.disabled&&a(this).addClass("ie6_input_disabled")})}},autofocus:function(){e||!a(":input[autofocus]").length||a(":input[autofocus]:visible:first").focus()},placeholder:function(){!d&&!!a(":input[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),a(":input[placeholder]").each(function(){var b=a(this),c=b.attr("placeholder");b.focus(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).blur(function(){FORMALIZE.misc.add_placeholder()}),b.closest("form").submit(function(){b.val()===c&&b.val("").removeClass("placeholder_text")}).bind("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){d||!a(":input[placeholder]").length||a(":input[placeholder]").each(function(){var b=a(this),c=b.attr("placeholder");(!b.val()||b.val()===c)&&b.val(c).addClass("placeholder_text")})}}}}(jQuery,this,this.document);jQuery(document).ready(function(){FORMALIZE.go()})
@@ -1 +1 @@
1
- var FORMALIZE=function(a,b,c){var d="placeholder"in b.createElement("input"),e="autofocus"in b.createElement("input"),f=Browser.ie6,g=Browser.ie7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){!!g&&!!$$("textarea, input.input_full").length&&$$("textarea, input.input_full").each(function(a){(new Element("span.input_full_wrap")).wraps(a)})},ie6_skin_inputs:function(){if(!!f&&!!$$("input, select, textarea").length){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;$$("input").each(function(c){c.getAttribute("type").match(a)?(c.addClass("ie6_button"),c.disabled&&c.addClass("ie6_button_disabled")):c.getAttribute("type").match(b)&&(c.addClass("ie6_input"),c.disabled&&c.addClass("ie6_input_disabled"))}),$$("textarea, select").each(function(a){a.disabled&&a.addClass("ie6_input_disabled")})}},autofocus:function(){!e&&!!$$("[autofocus]").length&&$$("[autofocus]")[0].focus()},placeholder:function(){!d&&!!$$("[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),$$("[placeholder]").each(function(a){var b=a.get("placeholder");a.addEvents({focus:function(){a.value===b&&a.set("value","").removeClass("placeholder_text")},blur:function(){FORMALIZE.misc.add_placeholder()}}),a.getParent("form").addEvents({submit:function(){a.value===b&&a.set("value","").removeClass("placeholder_text")},reset:function(){setTimeout(FORMALIZE.misc.add_placeholder,50)}})}))}},misc:{add_placeholder:function(){!d&&!!$$("[placeholder]").length&&$$("[placeholder]").each(function(a){var b=a.get("placeholder");(!a.value||a.value===b)&&a.set("value",b).addClass("placeholder_text")})}}}}(this,this.document);$(document).addEvent("domready",function(){FORMALIZE.go()})
1
+ var FORMALIZE=function(a,b){var c="placeholder"in b.createElement("input"),d="autofocus"in b.createElement("input"),e=Browser.ie6,f=Browser.ie7;return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){f&&$$("textarea, input.input_full").length&&$$("textarea, input.input_full").each(function(a){(new Element("span.input_full_wrap")).wraps(a)})},ie6_skin_inputs:function(){if(e&&$$("input, select, textarea").length){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;$$("input").each(function(c){c.getAttribute("type").match(a)?(c.addClass("ie6_button"),c.disabled&&c.addClass("ie6_button_disabled")):c.getAttribute("type").match(b)&&(c.addClass("ie6_input"),c.disabled&&c.addClass("ie6_input_disabled"))}),$$("textarea, select").each(function(a){a.disabled&&a.addClass("ie6_input_disabled")})}},autofocus:function(){d||!$$("[autofocus]").length||$$("[autofocus]")[0].focus()},placeholder:function(){!c&&!!$$("[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),$$("[placeholder]").each(function(a){var b=a.get("placeholder");a.addEvents({focus:function(){a.value===b&&a.set("value","").removeClass("placeholder_text")},blur:function(){FORMALIZE.misc.add_placeholder()}}),a.getParent("form").addEvents({submit:function(){a.value===b&&a.set("value","").removeClass("placeholder_text")},reset:function(){setTimeout(FORMALIZE.misc.add_placeholder,50)}})}))}},misc:{add_placeholder:function(){c||!$$("[placeholder]").length||$$("[placeholder]").each(function(a){var b=a.get("placeholder");(!a.value||a.value===b)&&a.set("value",b).addClass("placeholder_text")})}}}}(this,this.document);$(document).addEvent("domready",function(){FORMALIZE.go()})
@@ -1 +1 @@
1
- var FORMALIZE=function(a,b,c){function h(a){var c=b.createElement("b");c.innerHTML="<!--[if IE "+a+"]><br><![endif]-->";return!!c.getElementsByTagName("br").length}var d="placeholder"in b.createElement("input"),e="autofocus"in b.createElement("input"),f=h(6),g=h(7);return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){!!g&&!!$$("textarea, input.input_full").length&&$$("textarea, input.input_full").each(function(a){Element.wrap(a,"span",{"class":"input_full_wrap"})})},ie6_skin_inputs:function(){if(!!f&&!!$$("input, select, textarea").length){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;$$("input").each(function(c){c.getAttribute("type").match(a)?(c.addClassName("ie6_button"),c.disabled&&c.addClassName("ie6_button_disabled")):c.getAttribute("type").match(b)&&(c.addClassName("ie6_input"),c.disabled&&c.addClassName("ie6_input_disabled"))}),$$("textarea, select").each(function(a){a.disabled&&a.addClassName("ie6_input_disabled")})}},autofocus:function(){!e&&!!$$("[autofocus]").length&&$$("[autofocus]")[0].focus()},placeholder:function(){!d&&!!$$("[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),$$("[placeholder]").each(function(a){var b=a.getAttribute("placeholder"),c=a.up("form");a.observe("focus",function(){a.value===b&&(a.value="",a.removeClassName("placeholder_text"))}),a.observe("blur",function(){FORMALIZE.misc.add_placeholder()}),c.observe("submit",function(){a.value===b&&(a.value="",a.removeClassName("placeholder_text"))}),c.observe("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){!d&&!!$$("[placeholder]").length&&$$("[placeholder]").each(function(a){var b=a.getAttribute("placeholder");if(!a.value||a.value===b)a.value=b,a.addClassName("placeholder_text")})}}}}(this,this.document);$(document).observe("dom:loaded",function(){FORMALIZE.go()})
1
+ var FORMALIZE=function(a,b){function c(a){var c=b.createElement("b");return c.innerHTML="<!--[if IE "+a+"]><br><![endif]-->",!!c.getElementsByTagName("br").length}var d="placeholder"in b.createElement("input"),e="autofocus"in b.createElement("input"),f=c(6),g=c(7);return{go:function(){for(var a in FORMALIZE.init)FORMALIZE.init[a]()},init:{full_input_size:function(){g&&$$("textarea, input.input_full").length&&$$("textarea, input.input_full").each(function(a){Element.wrap(a,"span",{"class":"input_full_wrap"})})},ie6_skin_inputs:function(){if(f&&$$("input, select, textarea").length){var a=/button|submit|reset/,b=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;$$("input").each(function(c){c.getAttribute("type").match(a)?(c.addClassName("ie6_button"),c.disabled&&c.addClassName("ie6_button_disabled")):c.getAttribute("type").match(b)&&(c.addClassName("ie6_input"),c.disabled&&c.addClassName("ie6_input_disabled"))}),$$("textarea, select").each(function(a){a.disabled&&a.addClassName("ie6_input_disabled")})}},autofocus:function(){e||!$$("[autofocus]").length||$$("[autofocus]")[0].focus()},placeholder:function(){!d&&!!$$("[placeholder]").length&&(FORMALIZE.misc.add_placeholder(),$$("[placeholder]").each(function(a){var b=a.getAttribute("placeholder"),c=a.up("form");a.observe("focus",function(){a.value===b&&(a.value="",a.removeClassName("placeholder_text"))}),a.observe("blur",function(){FORMALIZE.misc.add_placeholder()}),c.observe("submit",function(){a.value===b&&(a.value="",a.removeClassName("placeholder_text"))}),c.observe("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})}))}},misc:{add_placeholder:function(){d||!$$("[placeholder]").length||$$("[placeholder]").each(function(a){var b=a.getAttribute("placeholder");if(!a.value||a.value===b)a.value=b,a.addClassName("placeholder_text")})}}}}(this,this.document);$(document).observe("dom:loaded",function(){FORMALIZE.go()})
@@ -117,13 +117,13 @@ YUI.add('formalize', function(Y) {
117
117
 
118
118
  // Prevent <form> from accidentally
119
119
  // submitting the placeholder text.
120
- form.on('submit', function() {
120
+ form && form.on('submit', function() {
121
121
  if (el.get('value') === text) {
122
122
  el.set('value', '').removeClass('placeholder_text');
123
123
  }
124
124
  });
125
125
 
126
- form.on('reset', function() {
126
+ form && form.on('reset', function() {
127
127
  setTimeout(Y.formalize.misc.add_placeholder, 50);
128
128
  });
129
129
  });
@@ -1 +1 @@
1
- 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){function e(){(!b.get("value")||b.get("value")===c)&&b.set("value",c).addClass("placeholder_text")}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.on("submit",function(){b.get("value")===c&&b.set("value","").removeClass("placeholder_text")}),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"]})
1
+ 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"]})
@@ -299,9 +299,11 @@ select[multiple] {
299
299
  border: 1px solid;
300
300
  border-color: #747474 #5e5e5e #4f4f4f;
301
301
  color: #fff;
302
- font: 11px/1 'Lucida Grande', Arial, 'Liberation Sans', FreeSans, sans-serif;
302
+ font: 13px/17px 'Lucida Grande', Arial, 'Liberation Sans', FreeSans, sans-serif;
303
+ overflow: hidden;
303
304
  padding: 15px 15px 17px;
304
305
  text-shadow: #000 0 0 1px;
306
+ height: 16px;
305
307
  }
306
308
 
307
309
  ::-webkit-validation-bubble-arrow,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formalize-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-18 00:00:00.000000000Z
12
+ date: 2011-09-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70260808824000 !ruby/object:Gem::Requirement
16
+ requirement: &2173464660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.1.0.rc1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70260808824000
24
+ version_requirements: *2173464660
25
25
  description: This gem provides the assets for the formalize form styling, for easy
26
26
  usage with the Rails 3.1 asset pipeline.
27
27
  email: