formalize-rails 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,5 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency "railties", "~> 3.1.0.rc1"
21
+ s.add_dependency "railties", "~> 3.1"
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Formalize
2
2
  module Rails
3
- VERSION = "0.0.5"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*
2
- Formalize - version 1.1
2
+ Formalize - version 1.2
3
3
 
4
4
  Note: This file depends on the Dojo library.
5
5
  */
@@ -7,18 +7,27 @@
7
7
  // Module pattern:
8
8
  // http://yuiblog.com/blog/2007/06/12/module-pattern
9
9
  var FORMALIZE = (function(window, document, undefined) {
10
+ // Internet Explorer detection.
11
+ function IE(version) {
12
+ var b = document.createElement('b');
13
+ b.innerHTML = '<!--[if IE ' + version + ']><br><![endif]-->';
14
+ return !!b.getElementsByTagName('br').length;
15
+ }
16
+
10
17
  // Private constants.
11
18
  var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
12
19
  var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
13
- var IE6 = parseInt(dojo.isIE, 10) === 6;
14
- var IE7 = parseInt(dojo.isIE, 10) === 7;
20
+ var IE6 = IE(6);
21
+ var IE7 = IE(7);
15
22
 
16
23
  // Expose innards of FORMALIZE.
17
24
  return {
18
25
  // FORMALIZE.go
19
26
  go: function() {
20
- for (var i in FORMALIZE.init) {
21
- FORMALIZE.init[i]();
27
+ var i, j = FORMALIZE.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
22
31
  }
23
32
  },
24
33
  // FORMALIZE.init
@@ -102,6 +111,12 @@ var FORMALIZE = (function(window, document, undefined) {
102
111
  FORMALIZE.misc.add_placeholder();
103
112
 
104
113
  dojo.query('[placeholder]').forEach(function(el) {
114
+ // Placeholder obscured in older browsers,
115
+ // so there's no point adding to password.
116
+ if (el.type === 'password') {
117
+ return;
118
+ }
119
+
105
120
  dojo.connect(el, 'onfocus', function() {
106
121
  var text = el.getAttribute('placeholder');
107
122
 
@@ -147,6 +162,12 @@ var FORMALIZE = (function(window, document, undefined) {
147
162
  }
148
163
 
149
164
  dojo.query('[placeholder]').forEach(function(el) {
165
+ // Placeholder obscured in older browsers,
166
+ // so there's no point adding to password.
167
+ if (el.type === 'password') {
168
+ return;
169
+ }
170
+
150
171
  var text = el.getAttribute('placeholder');
151
172
 
152
173
  if (!el.value || el.value === text) {
@@ -1 +1 @@
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
+ 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(){var a,b=FORMALIZE.init;for(a in b)b.hasOwnProperty(a)&&b[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){a.type!=="password"&&(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){if(a.type!=="password"){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,5 +1,5 @@
1
1
  /*
2
- Formalize - version 1.1
2
+ Formalize - version 1.2
3
3
 
4
4
  Note: This file depends on the ExtJS 3.x library.
5
5
  */
@@ -7,18 +7,27 @@
7
7
  // Module pattern:
8
8
  // http://yuiblog.com/blog/2007/06/12/module-pattern
9
9
  var FORMALIZE = (function(window, document, undefined) {
10
+ // Internet Explorer detection.
11
+ function IE(version) {
12
+ var b = document.createElement('b');
13
+ b.innerHTML = '<!--[if IE ' + version + ']><br><![endif]-->';
14
+ return !!b.getElementsByTagName('br').length;
15
+ }
16
+
10
17
  // Private constants.
11
18
  var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
12
19
  var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
13
- var IE6 = Ext.isIE6;
14
- var IE7 = Ext.isIE7;
20
+ var IE6 = IE(6);
21
+ var IE7 = IE(7);
15
22
 
16
23
  // Expose innards of FORMALIZE.
17
24
  return {
18
25
  // FORMALIZE.go
19
26
  go: function() {
20
- for (var i in FORMALIZE.init) {
21
- FORMALIZE.init[i]();
27
+ var i, j = this.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
22
31
  }
23
32
  },
24
33
  // FORMALIZE.init
@@ -97,16 +106,15 @@ var FORMALIZE = (function(window, document, undefined) {
97
106
  FORMALIZE.misc.add_placeholder();
98
107
 
99
108
  Ext.each(Ext.query('[placeholder]'), function(el) {
109
+ // Placeholder obscured in older browsers,
110
+ // so there's no point adding to password.
111
+ if (el.type === 'password') {
112
+ return;
113
+ }
114
+
100
115
  var text = el.getAttribute('placeholder');
101
116
  var form = Ext.get(el).parent('form');
102
117
 
103
- function add_placeholder() {
104
- if (!el.value || el.value === text) {
105
- el.value = text;
106
- Ext.get(el).addClass('placeholder_text');
107
- }
108
- }
109
-
110
118
  Ext.get(el).on('focus', function() {
111
119
  if (el.value === text) {
112
120
  el.value = '';
@@ -144,6 +152,12 @@ var FORMALIZE = (function(window, document, undefined) {
144
152
  }
145
153
 
146
154
  Ext.each(Ext.query('[placeholder]'), function(el) {
155
+ // Placeholder obscured in older browsers,
156
+ // so there's no point adding to password.
157
+ if (el.type === 'password') {
158
+ return;
159
+ }
160
+
147
161
  var text = el.getAttribute('placeholder');
148
162
 
149
163
  if (!el.value || el.value === text) {
@@ -1 +1 @@
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
+ 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(){var a,b=this.init;for(a in b)b.hasOwnProperty(a)&&b[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){if(a.type!=="password"){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){if(a.type!=="password"){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,5 +1,5 @@
1
1
  /*
2
- Formalize - version 1.1
2
+ Formalize - version 1.2
3
3
 
4
4
  Note: This file depends on the jQuery library.
5
5
  */
@@ -7,18 +7,27 @@
7
7
  // Module pattern:
8
8
  // http://yuiblog.com/blog/2007/06/12/module-pattern
9
9
  var FORMALIZE = (function($, window, document, undefined) {
10
+ // Internet Explorer detection.
11
+ function IE(version) {
12
+ var b = document.createElement('b');
13
+ b.innerHTML = '<!--[if IE ' + version + ']><br><![endif]-->';
14
+ return !!b.getElementsByTagName('br').length;
15
+ }
16
+
10
17
  // Private constants.
11
18
  var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
12
19
  var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
13
- var IE6 = !!($.browser.msie && parseInt($.browser.version, 10) === 6);
14
- var IE7 = !!($.browser.msie && parseInt($.browser.version, 10) === 7);
20
+ var IE6 = IE(6);
21
+ var IE7 = IE(7);
15
22
 
16
23
  // Expose innards of FORMALIZE.
17
24
  return {
18
25
  // FORMALIZE.go
19
26
  go: function() {
20
- for (var i in FORMALIZE.init) {
21
- FORMALIZE.init[i]();
27
+ var i, j = this.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
22
31
  }
23
32
  },
24
33
  // FORMALIZE.init
@@ -97,6 +106,12 @@ var FORMALIZE = (function($, window, document, undefined) {
97
106
  FORMALIZE.misc.add_placeholder();
98
107
 
99
108
  $(':input[placeholder]').each(function() {
109
+ // Placeholder obscured in older browsers,
110
+ // so there's no point adding to password.
111
+ if (this.type === 'password') {
112
+ return;
113
+ }
114
+
100
115
  var el = $(this);
101
116
  var text = el.attr('placeholder');
102
117
 
@@ -131,6 +146,12 @@ var FORMALIZE = (function($, window, document, undefined) {
131
146
  }
132
147
 
133
148
  $(':input[placeholder]').each(function() {
149
+ // Placeholder obscured in older browsers,
150
+ // so there's no point adding to password.
151
+ if (this.type === 'password') {
152
+ return;
153
+ }
154
+
134
155
  var el = $(this);
135
156
  var text = el.attr('placeholder');
136
157
 
@@ -1 +1 @@
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
+ var FORMALIZE=function(a,b,c){function d(a){var b=c.createElement("b");return b.innerHTML="<!--[if IE "+a+"]><br><![endif]-->",!!b.getElementsByTagName("br").length}var e="placeholder"in c.createElement("input"),f="autofocus"in c.createElement("input"),g=d(6),h=d(7);return{go:function(){var a,b=this.init;for(a in b)b.hasOwnProperty(a)&&b[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(){if(this.type!=="password"){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(){if(this.type!=="password"){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,5 +1,5 @@
1
1
  /*
2
- Formalize - version 1.1
2
+ Formalize - version 1.2
3
3
 
4
4
  Note: This file depends on the MooTools library.
5
5
  */
@@ -7,18 +7,27 @@
7
7
  // Module pattern:
8
8
  // http://yuiblog.com/blog/2007/06/12/module-pattern
9
9
  var FORMALIZE = (function(window, document, undefined) {
10
+ // Internet Explorer detection.
11
+ function IE(version) {
12
+ var b = document.createElement('b');
13
+ b.innerHTML = '<!--[if IE ' + version + ']><br><![endif]-->';
14
+ return !!b.getElementsByTagName('br').length;
15
+ }
16
+
10
17
  // Private constants.
11
18
  var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
12
19
  var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
13
- var IE6 = Browser.ie6;
14
- var IE7 = Browser.ie7;
20
+ var IE6 = IE(6);
21
+ var IE7 = IE(7);
15
22
 
16
23
  // Expose innards of FORMALIZE.
17
24
  return {
18
25
  // FORMALIZE.go
19
26
  go: function() {
20
- for (var i in FORMALIZE.init) {
21
- FORMALIZE.init[i]();
27
+ var i, j = this.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
22
31
  }
23
32
  },
24
33
  // FORMALIZE.init
@@ -98,6 +107,12 @@ var FORMALIZE = (function(window, document, undefined) {
98
107
  FORMALIZE.misc.add_placeholder();
99
108
 
100
109
  $$('[placeholder]').each(function(el) {
110
+ // Placeholder obscured in older browsers,
111
+ // so there's no point adding to password.
112
+ if (el.type === 'password') {
113
+ return;
114
+ }
115
+
101
116
  var text = el.get('placeholder');
102
117
 
103
118
  el.addEvents({
@@ -113,7 +128,9 @@ var FORMALIZE = (function(window, document, undefined) {
113
128
 
114
129
  // Prevent <form> from accidentally
115
130
  // submitting the placeholder text.
116
- el.getParent('form').addEvents({
131
+ var form = el.getParent('form');
132
+
133
+ form && form.addEvents({
117
134
  'submit': function() {
118
135
  if (el.value === text) {
119
136
  el.set('value', '').removeClass('placeholder_text');
@@ -137,6 +154,12 @@ var FORMALIZE = (function(window, document, undefined) {
137
154
  }
138
155
 
139
156
  $$('[placeholder]').each(function(el) {
157
+ // Placeholder obscured in older browsers,
158
+ // so there's no point adding to password.
159
+ if (el.type === 'password') {
160
+ return;
161
+ }
162
+
140
163
  var text = el.get('placeholder');
141
164
 
142
165
  if (!el.value || el.value === text) {
@@ -1 +1 @@
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
+ 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(){var a,b=this.init;for(a in b)b.hasOwnProperty(a)&&b[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){if(a.type!=="password"){var b=a.get("placeholder");a.addEvents({focus:function(){a.value===b&&a.set("value","").removeClass("placeholder_text")},blur:function(){FORMALIZE.misc.add_placeholder()}});var c=a.getParent("form");c&&c.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){if(a.type!=="password"){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,5 +1,5 @@
1
1
  /*
2
- Formalize - version 1.1
2
+ Formalize - version 1.2
3
3
 
4
4
  Note: This file depends on the Prototype library.
5
5
  */
@@ -7,12 +7,6 @@
7
7
  // Module pattern:
8
8
  // http://yuiblog.com/blog/2007/06/12/module-pattern
9
9
  var FORMALIZE = (function(window, document, undefined) {
10
- // Private constants.
11
- var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
12
- var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
13
- var IE6 = IE(6);
14
- var IE7 = IE(7);
15
-
16
10
  // Internet Explorer detection.
17
11
  function IE(version) {
18
12
  var b = document.createElement('b');
@@ -20,12 +14,20 @@ var FORMALIZE = (function(window, document, undefined) {
20
14
  return !!b.getElementsByTagName('br').length;
21
15
  }
22
16
 
17
+ // Private constants.
18
+ var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
19
+ var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
20
+ var IE6 = IE(6);
21
+ var IE7 = IE(7);
22
+
23
23
  // Expose innards of FORMALIZE.
24
24
  return {
25
25
  // FORMALIZE.go
26
26
  go: function() {
27
- for (var i in FORMALIZE.init) {
28
- FORMALIZE.init[i]();
27
+ var i, j = this.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
29
31
  }
30
32
  },
31
33
  // FORMALIZE.init
@@ -104,6 +106,12 @@ var FORMALIZE = (function(window, document, undefined) {
104
106
  FORMALIZE.misc.add_placeholder();
105
107
 
106
108
  $$('[placeholder]').each(function(el) {
109
+ // Placeholder obscured in older browsers,
110
+ // so there's no point adding to password.
111
+ if (el.type === 'password') {
112
+ return;
113
+ }
114
+
107
115
  var text = el.getAttribute('placeholder');
108
116
  var form = el.up('form');
109
117
 
@@ -144,6 +152,12 @@ var FORMALIZE = (function(window, document, undefined) {
144
152
  }
145
153
 
146
154
  $$('[placeholder]').each(function(el) {
155
+ // Placeholder obscured in older browsers,
156
+ // so there's no point adding to password.
157
+ if (el.type === 'password') {
158
+ return;
159
+ }
160
+
147
161
  var text = el.getAttribute('placeholder');
148
162
 
149
163
  if (!el.value || el.value === text) {
@@ -1 +1 @@
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()})
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(){var a,b=this.init;for(a in b)b.hasOwnProperty(a)&&b[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){if(a.type!=="password"){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){if(a.type!=="password"){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,22 +1,31 @@
1
1
  /*
2
- Formalize - version 1.1
2
+ Formalize - version 1.2
3
3
 
4
4
  Note: This file depends on the YUI library.
5
5
  */
6
6
 
7
7
  YUI.add('formalize', function(Y) {
8
+ // Internet Explorer detection.
9
+ function IE(version) {
10
+ var b = document.createElement('b');
11
+ b.innerHTML = '<!--[if IE ' + version + ']><br><![endif]-->';
12
+ return !!b.getElementsByTagName('br').length;
13
+ }
14
+
8
15
  // Private constants.
9
16
  var PLACEHOLDER_SUPPORTED = 'placeholder' in document.createElement('input');
10
17
  var AUTOFOCUS_SUPPORTED = 'autofocus' in document.createElement('input');
11
- var IE6 = parseInt(Y.UA.ie, 10) === 6;
12
- var IE7 = parseInt(Y.UA.ie, 10) === 7;
18
+ var IE6 = IE(6);
19
+ var IE7 = IE(7);
13
20
 
14
21
  // Expose innards of Formalize.
15
22
  Y.formalize = {
16
23
  // Y.formalize.go
17
24
  go: function() {
18
- for (var i in Y.formalize.init) {
19
- Y.formalize.init[i]();
25
+ var i, j = this.init;
26
+
27
+ for (i in j) {
28
+ j.hasOwnProperty(i) && j[i]();
20
29
  }
21
30
  },
22
31
  // Y.formalize.init
@@ -96,6 +105,12 @@ YUI.add('formalize', function(Y) {
96
105
  Y.formalize.misc.add_placeholder();
97
106
 
98
107
  Y.all('[placeholder]').each(function(el) {
108
+ // Placeholder obscured in older browsers,
109
+ // so there's no point adding to password.
110
+ if (el.getAttribute('type') === 'password') {
111
+ return;
112
+ }
113
+
99
114
  var text = el.getAttribute('placeholder');
100
115
  var form = el.ancestor('form');
101
116
 
@@ -140,6 +155,12 @@ YUI.add('formalize', function(Y) {
140
155
  }
141
156
 
142
157
  Y.all('[placeholder]').each(function(el) {
158
+ // Placeholder obscured in older browsers,
159
+ // so there's no point adding to password.
160
+ if (el.getAttribute('type') === 'password') {
161
+ return;
162
+ }
163
+
143
164
  var text = el.getAttribute('placeholder');
144
165
 
145
166
  if (!el.get('value') || el.get('value') === text) {
@@ -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){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"]})
1
+ YUI.add("formalize",function(a){function b(a){var b=document.createElement("b");return b.innerHTML="<!--[if IE "+a+"]><br><![endif]-->",!!b.getElementsByTagName("br").length}var c="placeholder"in document.createElement("input"),d="autofocus"in document.createElement("input"),e=b(6),f=b(7);a.formalize={go:function(){var a,b=this.init;for(a in b)b.hasOwnProperty(a)&&b[a]()},init:{full_input_size:function(){f&&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(e&&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(){d||!a.one("[autofocus]")||a.one("[autofocus]").focus()},placeholder:function(){!c&&!!a.one("[placeholder]")&&(a.formalize.misc.add_placeholder(),a.all("[placeholder]").each(function(b){if(b.getAttribute("type")!=="password"){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(){c||!a.one("[placeholder]")||a.all("[placeholder]").each(function(a){if(a.getAttribute("type")!=="password"){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,6 +1,3 @@
1
- /* `Widths
2
- ----------------------------------------------------------------------------------------------------*/
3
-
4
1
  .input_tiny {
5
2
  width: 50px;
6
3
  }
@@ -29,71 +26,35 @@
29
26
  width: 100%;
30
27
  }
31
28
 
32
- /*
33
- Added via JS to <textarea> and class="input_full".
34
- Applies only to IE7. Other browsers don't need it.
35
- */
36
29
  .input_full_wrap {
37
30
  display: block;
38
31
  padding-right: 8px;
39
32
  }
40
33
 
41
- /* `UI Consistency
42
- ----------------------------------------------------------------------------------------------------*/
43
-
44
- ::-moz-focus-inner {
45
- border: 0;
46
- padding: 0;
47
- }
48
-
49
34
  input[type="search"]::-webkit-search-decoration {
50
35
  display: none;
51
36
  }
52
37
 
53
- input,
54
- button,
55
- select,
56
- textarea {
57
- margin: 0;
58
- vertical-align: middle;
59
- }
60
-
61
- input[type="radio"],
62
- input[type="checkbox"] {
63
- position: relative;
64
- vertical-align: top;
65
- top: 3px;
66
- /* IE8, IE9, IE10 */
67
- top: 0\0;
68
- /* IE7 */
69
- *top: -3px;
70
- }
71
-
72
- /* iPad */
73
- @media (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 1024px) {
74
- input[type="radio"],
75
- input[type="checkbox"] {
76
- vertical-align: baseline;
77
- top: 2px;
78
- }
79
- }
80
-
81
- /* iPhone 3 */
82
- @media (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 480px) {
83
- input[type="radio"],
84
- input[type="checkbox"] {
85
- vertical-align: baseline;
86
- top: 0;
87
- }
38
+ button:focus,
39
+ input:focus,
40
+ select:focus,
41
+ textarea:focus {
42
+ -webkit-box-shadow: #0066ff 0 0 7px 0;
43
+ -moz-box-shadow: #0066ff 0 0 7px 0;
44
+ -o-box-shadow: #0066ff 0 0 7px 0;
45
+ box-shadow: #0066ff 0 0 7px 0;
46
+ z-index: 1;
88
47
  }
89
48
 
90
- /* iPhone 4 */
91
- @media (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 480px) {
92
- input[type="radio"],
93
- input[type="checkbox"] {
94
- vertical-align: baseline;
95
- top: 0;
96
- }
49
+ input[type="file"]:focus, input[type="file"]:active,
50
+ input[type="radio"]:focus,
51
+ input[type="radio"]:active,
52
+ input[type="checkbox"]:focus,
53
+ input[type="checkbox"]:active {
54
+ -webkit-box-shadow: none;
55
+ -moz-box-shadow: none;
56
+ -o-box-shadow: none;
57
+ box-shadow: none;
97
58
  }
98
59
 
99
60
  button,
@@ -101,37 +62,74 @@ input[type="reset"],
101
62
  input[type="submit"],
102
63
  input[type="button"] {
103
64
  -webkit-appearance: none;
104
- -moz-border-radius: 4px;
105
65
  -webkit-border-radius: 4px;
66
+ -moz-border-radius: 4px;
67
+ -ms-border-radius: 4px;
68
+ -o-border-radius: 4px;
106
69
  border-radius: 4px;
107
- -moz-background-clip: padding;
108
70
  -webkit-background-clip: padding;
71
+ -moz-background-clip: padding;
72
+ -ms-background-clip: padding-box;
73
+ -o-background-clip: padding-box;
109
74
  background-clip: padding-box;
110
- background: #ddd image-url('formalize/button.png') repeat-x;
111
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #ddd));
112
- background: -moz-linear-gradient(top center, #fff 0%, #ddd 100%);
75
+ background: #dddddd image-url('formalize/button.png?1298351022'') repeat-x;
76
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #dddddd));
77
+ background-image: -webkit-linear-gradient(#ffffff, #dddddd);
78
+ background-image: -moz-linear-gradient(#ffffff, #dddddd);
79
+ background-image: -o-linear-gradient(#ffffff, #dddddd);
80
+ background-image: -ms-linear-gradient(#ffffff, #dddddd);
81
+ background-image: linear-gradient(#ffffff, #dddddd);
113
82
  border: 1px solid;
114
- border-color: #ddd #bbb #999;
83
+ border-color: #dddddd #bbbbbb #999999;
115
84
  cursor: pointer;
116
- color: #333;
117
- /*
118
- Helvetica Neue present, because it works better
119
- for line-height on buttons than Arial, on OS X.
120
- */
121
- font: bold 12px/1.3 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
85
+ color: #333333;
86
+ font: bold 12px/1.3 "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;
122
87
  outline: 0;
123
88
  overflow: visible;
89
+ margin: 0;
124
90
  padding: 3px 10px;
125
- text-shadow: #fff 0 1px 1px;
91
+ text-shadow: white 0 1px 1px;
92
+ vertical-align: top;
126
93
  width: auto;
127
-
128
- /* IE7 */
129
94
  *padding-top: 2px;
130
- *padding-bottom: 0px;
95
+ *padding-bottom: 0;
96
+ }
97
+ button:hover,
98
+ input[type="reset"]:hover,
99
+ input[type="submit"]:hover,
100
+ input[type="button"]:hover {
101
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #eeeeee), color-stop(100%, #cccccc));
102
+ background-image: -webkit-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
103
+ background-image: -moz-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
104
+ background-image: -o-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
105
+ background-image: -ms-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
106
+ background-image: linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
107
+ }
108
+ button:active,
109
+ input[type="reset"]:active,
110
+ input[type="submit"]:active,
111
+ input[type="button"]:active {
112
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #dddddd), color-stop(100%, #eeeeee));
113
+ background-image: -webkit-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
114
+ background-image: -moz-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
115
+ background-image: -o-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
116
+ background-image: -ms-linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
117
+ background-image: linear-gradient(#ffffff, #dddddd 1px, #eeeeee);
118
+ -webkit-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
119
+ -moz-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
120
+ -o-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
121
+ box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
122
+ border-color: #999999 #bbbbbb #dddddd;
123
+ }
124
+ button::-moz-focus-inner,
125
+ input[type="reset"]::-moz-focus-inner,
126
+ input[type="submit"]::-moz-focus-inner,
127
+ input[type="button"]::-moz-focus-inner {
128
+ border: 0;
129
+ padding: 0;
131
130
  }
132
131
 
133
132
  button {
134
- /* IE7 */
135
133
  *padding-top: 1px;
136
134
  *padding-bottom: 1px;
137
135
  }
@@ -151,95 +149,39 @@ input[type="text"],
151
149
  input[type="time"],
152
150
  input[type="url"],
153
151
  input[type="week"] {
154
- -webkit-appearance: none;
155
- -moz-border-radius: 0;
156
- -webkit-border-radius: 0;
157
- border-radius: 0;
158
152
  -webkit-box-sizing: border-box;
159
153
  -moz-box-sizing: border-box;
154
+ -ms-box-sizing: border-box;
160
155
  box-sizing: border-box;
161
- -moz-background-clip: padding;
162
156
  -webkit-background-clip: padding;
157
+ -moz-background-clip: padding;
158
+ -ms-background-clip: padding-box;
159
+ -o-background-clip: padding-box;
163
160
  background-clip: padding-box;
164
- background-color: #fff;
161
+ -webkit-border-radius: 0;
162
+ -moz-border-radius: 0;
163
+ -ms-border-radius: 0;
164
+ -o-border-radius: 0;
165
+ border-radius: 0;
166
+ -webkit-appearance: none;
167
+ background-color: white;
165
168
  border: 1px solid;
166
169
  border-color: #848484 #c1c1c1 #e1e1e1;
167
- color: #000;
170
+ color: black;
168
171
  outline: 0;
172
+ margin: 0;
169
173
  padding: 2px 3px;
174
+ text-align: left;
170
175
  font-size: 13px;
171
- /*
172
- Leaving out Helvetica Neue, to not throw off size="..."
173
- on inputs. Arial is more reliable, on Windows and OS X.
174
- */
175
- font-family: Arial, 'Liberation Sans', FreeSans, sans-serif;
176
+ font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
176
177
  height: 1.8em;
177
-
178
- /* IE7 */
178
+ vertical-align: top;
179
179
  *padding-top: 2px;
180
180
  *padding-bottom: 1px;
181
181
  *height: auto;
182
182
  }
183
-
184
- /*
185
- Separate rule for Firefox.
186
- Separate rule for IE, too.
187
- Cannot stack with WebKit's.
188
- */
189
- ::-webkit-input-placeholder {
190
- color: #888;
191
- }
192
-
193
- input:-moz-placeholder,
194
- textarea:-moz-placeholder {
195
- color: #888;
196
- }
197
-
198
- input.placeholder_text,
199
- textarea.placeholder_text {
200
- color: #888;
201
- }
202
-
203
- :invalid {
204
- /*
205
- Suppress red glow that Firefox
206
- adds to form fields by default,
207
- even when user is still typing.
208
- */
209
- -moz-box-shadow: none;
210
- -webkit-box-shadow: none;
211
- box-shadow: none;
212
- }
213
-
214
- button:focus,
215
- button:active,
216
- input:focus,
217
- input:active,
218
- select:focus,
219
- select:active,
220
- textarea:focus,
221
- textarea:active {
222
- -moz-box-shadow: #06f 0 0 7px;
223
- -webkit-box-shadow: #06f 0 0 7px;
224
- box-shadow: #06f 0 0 7px;
225
-
226
- /* for Opera */
227
- z-index: 1;
228
- }
229
-
230
- input[type="file"]:focus,
231
- input[type="file"]:active,
232
- input[type="radio"]:focus,
233
- input[type="radio"]:active,
234
- input[type="checkbox"]:focus,
235
- input[type="checkbox"]:active {
236
- -moz-box-shadow: none;
237
- -webkit-box-shadow: none;
238
- box-shadow: none;
239
- }
240
-
241
- select[disabled],
242
183
  textarea[disabled],
184
+ select[disabled],
243
185
  input[type="date"][disabled],
244
186
  input[type="datetime"][disabled],
245
187
  input[type="datetime-local"][disabled],
@@ -253,7 +195,7 @@ input[type="text"][disabled],
253
195
  input[type="time"][disabled],
254
196
  input[type="url"][disabled],
255
197
  input[type="week"][disabled] {
256
- background-color: #eee;
198
+ background-color: #eeeeee;
257
199
  }
258
200
 
259
201
  button[disabled],
@@ -262,47 +204,73 @@ select[disabled],
262
204
  select[disabled] option,
263
205
  select[disabled] optgroup,
264
206
  textarea[disabled] {
265
- -moz-box-shadow: none;
266
207
  -webkit-box-shadow: none;
208
+ -moz-box-shadow: none;
209
+ -o-box-shadow: none;
267
210
  box-shadow: none;
211
+ -moz-user-select: -moz-none;
268
212
  -webkit-user-select: none;
269
- -moz-user-select: none;
213
+ -khtml-user-select: none;
270
214
  user-select: none;
271
- color: #888;
215
+ color: #888888;
272
216
  cursor: default;
273
217
  }
274
218
 
219
+ input::-webkit-input-placeholder,
220
+ textarea::-webkit-input-placeholder {
221
+ color: #888888;
222
+ }
223
+
224
+ input:-moz-placeholder,
225
+ textarea:-moz-placeholder {
226
+ color: #888888;
227
+ }
228
+
229
+ input.placeholder_text,
230
+ textarea.placeholder_text {
231
+ color: #888888;
232
+ }
233
+
275
234
  textarea,
276
235
  select[size],
277
236
  select[multiple] {
278
237
  height: auto;
279
238
  }
280
239
 
281
- /* Tweaks for Safari + Chrome. */
240
+ select[size="0"],
241
+ select[size="1"] {
242
+ height: 1.8em;
243
+ *height: auto;
244
+ }
245
+
282
246
  @media (-webkit-min-device-pixel-ratio: 0) {
283
- select {
284
- background-image: image-url('formalize/select_arrow.gif');
247
+ select[size],
248
+ select[multiple],
249
+ select[multiple][size] {
250
+ background-image: none;
251
+ padding-right: 3px;
252
+ }
253
+
254
+ select,
255
+ select[size="0"],
256
+ select[size="1"] {
257
+ background-image: image-url('formalize/select_arrow.gif?1298351050'');
285
258
  background-repeat: no-repeat;
286
259
  background-position: right center;
287
260
  padding-right: 20px;
288
261
  }
289
262
 
290
- select[size],
291
- select[multiple] {
292
- background-image: none;
293
- padding: 0;
294
- }
295
-
296
263
  ::-webkit-validation-bubble-message {
297
- box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px;
298
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666), color-stop(1, #000));
264
+ -webkit-box-shadow: none;
265
+ box-shadow: none;
266
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, black));
299
267
  border: 1px solid;
300
268
  border-color: #747474 #5e5e5e #4f4f4f;
301
- color: #fff;
302
- font: 13px/17px 'Lucida Grande', Arial, 'Liberation Sans', FreeSans, sans-serif;
269
+ color: white;
270
+ font: 13px/17px "Lucida Grande", Arial, "Liberation Sans", FreeSans, sans-serif;
303
271
  overflow: hidden;
304
272
  padding: 15px 15px 17px;
305
- text-shadow: #000 0 0 1px;
273
+ text-shadow: black 0 0 1px;
306
274
  height: 16px;
307
275
  }
308
276
 
@@ -311,11 +279,10 @@ select[multiple] {
311
279
  ::-webkit-validation-bubble-top-inner-arrow {
312
280
  -webkit-box-shadow: none;
313
281
  box-shadow: none;
314
- background: #666;
282
+ background: #666666;
315
283
  border: 0;
316
284
  }
317
285
  }
318
-
319
286
  textarea {
320
287
  min-height: 40px;
321
288
  overflow: auto;
@@ -324,43 +291,36 @@ textarea {
324
291
  }
325
292
 
326
293
  optgroup {
327
- color: #000;
294
+ color: black;
328
295
  font-style: normal;
329
296
  font-weight: normal;
297
+ font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
330
298
  }
331
299
 
332
- /* `IE6
333
- ----------------------------------------------------------------------------------------------------*/
334
-
335
- /*
336
- Everything below this line is for IE6.
337
- Delete it if you don't support it! :)
338
-
339
- Classes are added dynamically via JS,
340
- because IE6 doesn't support attribute
341
- selectors: .ie6_button, .ie6_input, etc.
342
-
343
- Note: These style rules are somewhat
344
- duplicated because IE6 bombs out when
345
- it sees attribute selectors. Example:
346
-
347
- .ie6_button {
348
- This works in IE6.
349
- }
350
-
351
- .ie6_button,
352
- input[type=submit] {
353
- This doesn't work.
354
- }
355
- */
300
+ input:invalid,
301
+ button:invalid,
302
+ select:invalid,
303
+ textarea:invalid {
304
+ -webkit-box-shadow: none;
305
+ -moz-box-shadow: none;
306
+ -o-box-shadow: none;
307
+ box-shadow: none;
308
+ }
309
+ input::-moz-focus-inner,
310
+ button::-moz-focus-inner,
311
+ select::-moz-focus-inner,
312
+ textarea::-moz-focus-inner {
313
+ border: 0;
314
+ padding: 0;
315
+ }
356
316
 
357
317
  .ie6_button,
358
318
  * html button {
359
- background: #ddd image-url('formalize/button.png') repeat-x;
319
+ background: #dddddd image-url('formalize/button.png?1298351022'') repeat-x;
360
320
  border: 1px solid;
361
- border-color: #ddd #bbb #999;
321
+ border-color: #dddddd #bbbbbb #999999;
362
322
  cursor: pointer;
363
- color: #333;
323
+ color: #333333;
364
324
  font: bold 12px/1.2 Arial, sans-serif;
365
325
  padding: 2px 10px 0px;
366
326
  overflow: visible;
@@ -375,10 +335,10 @@ optgroup {
375
335
  .ie6_input,
376
336
  * html textarea,
377
337
  * html select {
378
- background: #fff;
338
+ background: white;
379
339
  border: 1px solid;
380
340
  border-color: #848484 #c1c1c1 #e1e1e1;
381
- color: #000;
341
+ color: black;
382
342
  padding: 2px 3px 1px;
383
343
  font-size: 13px;
384
344
  font-family: Arial, sans-serif;
@@ -392,9 +352,9 @@ optgroup {
392
352
  .placeholder_text,
393
353
  .ie6_input_disabled,
394
354
  .ie6_button_disabled {
395
- color: #888;
355
+ color: #888888;
396
356
  }
397
357
 
398
358
  .ie6_input_disabled {
399
- background: #eee;
400
- }
359
+ background: #eeeeee;
360
+ }
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.5
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-29 00:00:00.000000000Z
12
+ date: 2012-01-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &2165401140 !ruby/object:Gem::Requirement
16
+ requirement: &2165826060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.1.0.rc1
21
+ version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2165401140
24
+ version_requirements: *2165826060
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:
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project: formalize-rails
77
- rubygems_version: 1.8.6
77
+ rubygems_version: 1.8.15
78
78
  signing_key:
79
79
  specification_version: 3
80
80
  summary: Use Formalize with the asset pipeline