survivalkit 1.0.beta.11 → 1.0.beta.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/CHANGELOG.markdown +4 -0
  2. data/lib/survivalkit.rb +2 -2
  3. data/stylesheets/survivalkit/fonts/_all.scss +2 -0
  4. data/stylesheets/survivalkit/fonts/_ss-social.scss +136 -0
  5. data/stylesheets/survivalkit/fonts/_ss-standard.scss +426 -0
  6. data/stylesheets/survivalkit/reset/_reset.scss +4 -0
  7. data/templates/clean/manifest.rb +0 -2
  8. data/templates/drupal/manifest.rb +0 -2
  9. data/templates/project/manifest.rb +44 -46
  10. data/templates/project/sources/FitVids/README.md +49 -0
  11. data/templates/project/sources/FitVids/jquery.fitvids.js +80 -0
  12. data/templates/project/sources/FitVids/tests.html +66 -0
  13. data/templates/project/sources/Geared-Scrolling/README.md +31 -0
  14. data/templates/project/sources/Geared-Scrolling/css/specific.css +88 -0
  15. data/templates/project/sources/Geared-Scrolling/images/col1.png +0 -0
  16. data/templates/project/sources/Geared-Scrolling/images/col2.png +0 -0
  17. data/templates/project/sources/Geared-Scrolling/images/col3.png +0 -0
  18. data/templates/project/sources/Geared-Scrolling/images/header.png +0 -0
  19. data/templates/project/sources/Geared-Scrolling/index.html +32 -0
  20. data/templates/project/sources/Geared-Scrolling/js/init.js +11 -0
  21. data/templates/project/sources/Geared-Scrolling/js/jquery.heyday.gearedscrolling.js +283 -0
  22. data/templates/project/sources/Lettering.js/README.md +58 -0
  23. data/templates/project/sources/Lettering.js/examples/index.html +135 -0
  24. data/templates/project/sources/Lettering.js/examples/style.css +171 -0
  25. data/templates/project/sources/Lettering.js/jquery.lettering.js +66 -0
  26. data/templates/project/sources/Respond/README.md +100 -0
  27. data/templates/project/sources/Respond/cross-domain/example.html +24 -0
  28. data/templates/project/sources/Respond/cross-domain/respond-proxy.html +96 -0
  29. data/templates/project/sources/Respond/cross-domain/respond.proxy.gif +0 -0
  30. data/templates/project/sources/Respond/cross-domain/respond.proxy.js +127 -0
  31. data/templates/project/sources/Respond/respond.min.js +6 -0
  32. data/templates/project/sources/Respond/respond.src.js +326 -0
  33. data/templates/project/sources/Respond/test/test.css +80 -0
  34. data/templates/project/sources/Respond/test/test.html +20 -0
  35. data/templates/project/sources/Respond/test/test2.css +8 -0
  36. data/templates/project/sources/Respond/test/unit/index.html +29 -0
  37. data/templates/project/sources/Respond/test/unit/qunit/qunit.css +226 -0
  38. data/templates/project/sources/Respond/test/unit/qunit/qunit.js +1598 -0
  39. data/templates/project/sources/Respond/test/unit/test.css +73 -0
  40. data/templates/project/sources/Respond/test/unit/test2.css +5 -0
  41. data/templates/project/sources/Respond/test/unit/test3.css +5 -0
  42. data/templates/project/sources/Respond/test/unit/tests.js +144 -0
  43. data/templates/project/sources/box-sizing-polyfill/README.md +24 -0
  44. data/templates/project/sources/box-sizing-polyfill/boxsizing.htc +501 -0
  45. data/templates/project/sources/formalize/README.txt +26 -0
  46. data/templates/project/sources/formalize/assets/css/_formalize.sass +326 -0
  47. data/templates/project/sources/formalize/assets/css/demo.css +654 -0
  48. data/templates/project/sources/formalize/assets/css/formalize.css +368 -0
  49. data/templates/project/sources/formalize/assets/css/reset.css +211 -0
  50. data/templates/project/sources/formalize/assets/css/text.css +81 -0
  51. data/templates/project/sources/formalize/assets/images/button.png +0 -0
  52. data/templates/project/sources/formalize/assets/images/select_arrow.gif +0 -0
  53. data/templates/project/sources/formalize/assets/js/dojo.formalize.js +202 -0
  54. data/templates/project/sources/formalize/assets/js/dojo.formalize.min.js +1 -0
  55. data/templates/project/sources/formalize/assets/js/extjs.formalize.js +192 -0
  56. data/templates/project/sources/formalize/assets/js/extjs.formalize.min.js +1 -0
  57. data/templates/project/sources/formalize/assets/js/jquery.formalize.js +181 -0
  58. data/templates/project/sources/formalize/assets/js/jquery.formalize.min.js +1 -0
  59. data/templates/project/sources/formalize/assets/js/mootools.formalize.js +193 -0
  60. data/templates/project/sources/formalize/assets/js/mootools.formalize.min.js +1 -0
  61. data/templates/project/sources/formalize/assets/js/prototype.formalize.js +192 -0
  62. data/templates/project/sources/formalize/assets/js/prototype.formalize.min.js +1 -0
  63. data/templates/project/sources/formalize/assets/js/yui.formalize.js +183 -0
  64. data/templates/project/sources/formalize/assets/js/yui.formalize.min.js +1 -0
  65. data/templates/project/sources/formalize/demo.html +130 -0
  66. data/templates/project/sources/formalize/dojo_demo.html +215 -0
  67. data/templates/project/sources/formalize/dojo_disabled.html +215 -0
  68. data/templates/project/sources/formalize/dojo_errors.html +215 -0
  69. data/templates/project/sources/formalize/extjs_demo.html +215 -0
  70. data/templates/project/sources/formalize/extjs_disabled.html +215 -0
  71. data/templates/project/sources/formalize/extjs_errors.html +215 -0
  72. data/templates/project/sources/formalize/jquery_demo.html +215 -0
  73. data/templates/project/sources/formalize/jquery_disabled.html +215 -0
  74. data/templates/project/sources/formalize/jquery_errors.html +215 -0
  75. data/templates/project/sources/formalize/mootools_demo.html +215 -0
  76. data/templates/project/sources/formalize/mootools_disabled.html +215 -0
  77. data/templates/project/sources/formalize/mootools_errors.html +215 -0
  78. data/templates/project/sources/formalize/prototype_demo.html +215 -0
  79. data/templates/project/sources/formalize/prototype_disabled.html +215 -0
  80. data/templates/project/sources/formalize/prototype_errors.html +215 -0
  81. data/templates/project/sources/formalize/unstyled.html +210 -0
  82. data/templates/project/sources/formalize/yui_demo.html +223 -0
  83. data/templates/project/sources/formalize/yui_disabled.html +223 -0
  84. data/templates/project/sources/formalize/yui_errors.html +223 -0
  85. data/templates/project/sources/iOS-Orientationchange-Fix/README.md +16 -0
  86. data/templates/project/sources/iOS-Orientationchange-Fix/demo.html +43 -0
  87. data/templates/project/sources/iOS-Orientationchange-Fix/ios-orientationchange-fix.js +56 -0
  88. data/templates/project/sources/jQuery-widowFix/index.html +159 -0
  89. data/templates/project/sources/jQuery-widowFix/js/jquery-1.4.3.min.js +166 -0
  90. data/templates/project/sources/jQuery-widowFix/js/jquery.widowFix-1.3.2.js +135 -0
  91. data/templates/project/sources/jQuery-widowFix/js/jquery.widowFix-1.3.2.min.js +10 -0
  92. data/templates/project/sources/jQuery-widowFix/sample.html +84 -0
  93. data/templates/project/sources/jquery-html5-placeholder-shim/jquery.html5-placeholder-shim.js +96 -0
  94. data/templates/project/sources/jquery-html5-placeholder-shim/readme.md +22 -0
  95. data/templates/project/sources/jquery-html5-placeholder-shim/test.html +103 -0
  96. data/templates/project/sources/ss-social/ss-social.js +78 -0
  97. data/templates/project/sources/ss-standard/ss-standard.js +78 -0
  98. data/templates/shared/partials/01-variables/_colors.scss +2 -6
  99. data/templates/shared/partials/01-variables/_fonts.scss +49 -2
  100. data/templates/shared/partials/01-variables/_settings.scss +48 -13
  101. data/templates/shared/partials/04-base/_all.scss +0 -2
  102. data/templates/shared/partials/04-base/_common.scss +0 -4
  103. data/templates/shared/partials/05-layout/_grids-susy.scss +4 -4
  104. data/templates/shared/style.scss +9 -9
  105. metadata +93 -5
  106. data/templates/shared/partials/04-base/_edits.scss +0 -8
  107. data/templates/shared/partials/04-base/_font-face.scss +0 -14
@@ -0,0 +1,81 @@
1
+ /*
2
+ 960 Grid System ~ Text CSS.
3
+ Learn more ~ http://960.gs/
4
+
5
+ Licensed under GPL and MIT.
6
+ */
7
+
8
+ /* `Basic HTML
9
+ ----------------------------------------------------------------------------------------------------*/
10
+
11
+ body {
12
+ font: 13px/1.5 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
13
+ }
14
+
15
+ hr {
16
+ border: 0 #ccc solid;
17
+ border-top-width: 1px;
18
+ clear: both;
19
+ height: 0;
20
+ }
21
+
22
+ /* `Headings
23
+ ----------------------------------------------------------------------------------------------------*/
24
+
25
+ h1 {
26
+ font-size: 25px;
27
+ }
28
+
29
+ h2 {
30
+ font-size: 23px;
31
+ }
32
+
33
+ h3 {
34
+ font-size: 21px;
35
+ }
36
+
37
+ h4 {
38
+ font-size: 19px;
39
+ }
40
+
41
+ h5 {
42
+ font-size: 17px;
43
+ }
44
+
45
+ h6 {
46
+ font-size: 15px;
47
+ }
48
+
49
+ /* `Spacing
50
+ ----------------------------------------------------------------------------------------------------*/
51
+
52
+ ol {
53
+ list-style: decimal;
54
+ }
55
+
56
+ ul {
57
+ list-style: disc;
58
+ }
59
+
60
+ li {
61
+ margin-left: 30px;
62
+ }
63
+
64
+ p,
65
+ dl,
66
+ hr,
67
+ h1,
68
+ h2,
69
+ h3,
70
+ h4,
71
+ h5,
72
+ h6,
73
+ ol,
74
+ ul,
75
+ pre,
76
+ table,
77
+ address,
78
+ fieldset,
79
+ figure {
80
+ margin-bottom: 20px;
81
+ }
@@ -0,0 +1,202 @@
1
+ /*
2
+ Formalize - version 1.2
3
+
4
+ Note: This file depends on the Dojo library.
5
+ */
6
+
7
+ // Module pattern:
8
+ // http://yuiblog.com/blog/2007/06/12/module-pattern
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
+
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
+ // Expose innards of FORMALIZE.
24
+ return {
25
+ // FORMALIZE.go
26
+ go: function() {
27
+ var i, j = this.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
31
+ }
32
+ },
33
+ // FORMALIZE.init
34
+ init: {
35
+ // FORMALIZE.init.disable_link_button
36
+ disable_link_button: function() {
37
+ dojo.connect(document.documentElement, 'click', function(ev) {
38
+ var el = ev.target;
39
+ var is_disabled = el.tagName.toLowerCase() === 'a' && el.className.match('button_disabled');
40
+
41
+ if (is_disabled) {
42
+ ev.preventDefault();
43
+ }
44
+ });
45
+ },
46
+ // FORMALIZE.init.full_input_size
47
+ full_input_size: function() {
48
+ if (!IE7 || !dojo.query('textarea, input.input_full').length) {
49
+ return;
50
+ }
51
+
52
+ // This fixes width: 100% on <textarea> and class="input_full".
53
+ // It ensures that form elements don't go wider than container.
54
+ dojo.query('textarea, input.input_full').forEach(function(el) {
55
+ var new_el = el.cloneNode(false);
56
+ var span = document.createElement('span');
57
+
58
+ span.className = 'input_full_wrap';
59
+ span.appendChild(new_el);
60
+ el.parentNode.replaceChild(span, el);
61
+ });
62
+ },
63
+ // FORMALIZE.init.ie6_skin_inputs
64
+ ie6_skin_inputs: function() {
65
+ // Test for Internet Explorer 6.
66
+ if (!IE6 || !dojo.query('input, select, textarea').length) {
67
+ // Exit if the browser is not IE6,
68
+ // or if no form elements exist.
69
+ return;
70
+ }
71
+
72
+ // For <input type="submit" />, etc.
73
+ var button_regex = /button|submit|reset/;
74
+
75
+ // For <input type="text" />, etc.
76
+ var type_regex = /date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;
77
+
78
+ dojo.query('input').forEach(function(el) {
79
+ // Is it a button?
80
+ if (el.getAttribute('type').match(button_regex)) {
81
+ dojo.addClass(el, 'ie6_button');
82
+
83
+ /* Is it disabled? */
84
+ if (el.disabled) {
85
+ dojo.addClass(el, 'ie6_button_disabled');
86
+ }
87
+ }
88
+ // Or is it a textual input?
89
+ else if (el.getAttribute('type').match(type_regex)) {
90
+ dojo.addClass(el, 'ie6_input');
91
+
92
+ /* Is it disabled? */
93
+ if (el.disabled) {
94
+ dojo.addClass(el, 'ie6_input_disabled');
95
+ }
96
+ }
97
+ });
98
+
99
+ dojo.query('textarea, select').forEach(function(el) {
100
+ /* Is it disabled? */
101
+ if (el.disabled) {
102
+ dojo.addClass(el, 'ie6_input_disabled');
103
+ }
104
+ });
105
+ },
106
+ // FORMALIZE.init.autofocus
107
+ autofocus: function() {
108
+ if (AUTOFOCUS_SUPPORTED || !dojo.query('[autofocus]').length) {
109
+ return;
110
+ }
111
+
112
+ var el = dojo.query('[autofocus]')[0];
113
+
114
+ if (!el.disabled) {
115
+ el.focus();
116
+ }
117
+ },
118
+ // FORMALIZE.init.placeholder
119
+ placeholder: function() {
120
+ if (PLACEHOLDER_SUPPORTED || !dojo.query('[placeholder]').length) {
121
+ // Exit if placeholder is supported natively,
122
+ // or if page does not have any placeholder.
123
+ return;
124
+ }
125
+
126
+ FORMALIZE.misc.add_placeholder();
127
+
128
+ dojo.query('[placeholder]').forEach(function(el) {
129
+ // Placeholder obscured in older browsers,
130
+ // so there's no point adding to password.
131
+ if (el.type === 'password') {
132
+ return;
133
+ }
134
+
135
+ dojo.connect(el, 'onfocus', function() {
136
+ var text = el.getAttribute('placeholder');
137
+
138
+ if (el.value === text) {
139
+ el.value = '';
140
+ dojo.removeClass(el, 'placeholder_text');
141
+ }
142
+ });
143
+
144
+ dojo.connect(el, 'onblur', function() {
145
+ FORMALIZE.misc.add_placeholder();
146
+ });
147
+ });
148
+
149
+ // Prevent <form> from accidentally
150
+ // submitting the placeholder text.
151
+ dojo.query('form').forEach(function(form) {
152
+ dojo.connect(form, 'onsubmit', function() {
153
+ dojo.query('[placeholder]', form).forEach(function(el) {
154
+ var text = el.getAttribute('placeholder');
155
+
156
+ if (el.value === text) {
157
+ el.value = '';
158
+ dojo.removeClass(el, 'placeholder_text');
159
+ }
160
+ });
161
+ });
162
+
163
+ dojo.connect(form, 'onreset', function() {
164
+ setTimeout(FORMALIZE.misc.add_placeholder, 50);
165
+ });
166
+ });
167
+ }
168
+ },
169
+ // FORMALIZE.misc
170
+ misc: {
171
+ // FORMALIZE.misc.add_placeholder
172
+ add_placeholder: function() {
173
+ if (PLACEHOLDER_SUPPORTED || !dojo.query('[placeholder]').length) {
174
+ // Exit if placeholder is supported natively,
175
+ // or if page does not have any placeholder.
176
+ return;
177
+ }
178
+
179
+ dojo.query('[placeholder]').forEach(function(el) {
180
+ // Placeholder obscured in older browsers,
181
+ // so there's no point adding to password.
182
+ if (el.type === 'password') {
183
+ return;
184
+ }
185
+
186
+ var text = el.getAttribute('placeholder');
187
+
188
+ if (!el.value || el.value === text) {
189
+ el.value = text;
190
+ dojo.addClass(el, 'placeholder_text');
191
+ }
192
+ });
193
+ }
194
+ }
195
+ };
196
+ // Alias window, document.
197
+ })(this, this.document);
198
+
199
+ // Automatically calls all functions in FORMALIZE.init
200
+ dojo.addOnLoad(function() {
201
+ FORMALIZE.go();
202
+ });
@@ -0,0 +1 @@
1
+ var FORMALIZE=function(e,t,n){function r(e){var n=t.createElement("b");return n.innerHTML="<!--[if IE "+e+"]><br><![endif]-->",!!n.getElementsByTagName("br").length}var i="placeholder"in t.createElement("input"),s="autofocus"in t.createElement("input"),o=r(6),u=r(7);return{go:function(){var e,t=this.init;for(e in t)t.hasOwnProperty(e)&&t[e]()},init:{disable_link_button:function(){dojo.connect(t.documentElement,"click",function(e){var t=e.target,n=t.tagName.toLowerCase()==="a"&&t.className.match("button_disabled");n&&e.preventDefault()})},full_input_size:function(){if(!u||!dojo.query("textarea, input.input_full").length)return;dojo.query("textarea, input.input_full").forEach(function(e){var n=e.cloneNode(!1),r=t.createElement("span");r.className="input_full_wrap",r.appendChild(n),e.parentNode.replaceChild(r,e)})},ie6_skin_inputs:function(){if(!o||!dojo.query("input, select, textarea").length)return;var e=/button|submit|reset/,t=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;dojo.query("input").forEach(function(n){n.getAttribute("type").match(e)?(dojo.addClass(n,"ie6_button"),n.disabled&&dojo.addClass(n,"ie6_button_disabled")):n.getAttribute("type").match(t)&&(dojo.addClass(n,"ie6_input"),n.disabled&&dojo.addClass(n,"ie6_input_disabled"))}),dojo.query("textarea, select").forEach(function(e){e.disabled&&dojo.addClass(e,"ie6_input_disabled")})},autofocus:function(){if(s||!dojo.query("[autofocus]").length)return;var e=dojo.query("[autofocus]")[0];e.disabled||e.focus()},placeholder:function(){if(i||!dojo.query("[placeholder]").length)return;FORMALIZE.misc.add_placeholder(),dojo.query("[placeholder]").forEach(function(e){if(e.type==="password")return;dojo.connect(e,"onfocus",function(){var t=e.getAttribute("placeholder");e.value===t&&(e.value="",dojo.removeClass(e,"placeholder_text"))}),dojo.connect(e,"onblur",function(){FORMALIZE.misc.add_placeholder()})}),dojo.query("form").forEach(function(e){dojo.connect(e,"onsubmit",function(){dojo.query("[placeholder]",e).forEach(function(e){var t=e.getAttribute("placeholder");e.value===t&&(e.value="",dojo.removeClass(e,"placeholder_text"))})}),dojo.connect(e,"onreset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})})}},misc:{add_placeholder:function(){if(i||!dojo.query("[placeholder]").length)return;dojo.query("[placeholder]").forEach(function(e){if(e.type==="password")return;var t=e.getAttribute("placeholder");if(!e.value||e.value===t)e.value=t,dojo.addClass(e,"placeholder_text")})}}}}(this,this.document);dojo.addOnLoad(function(){FORMALIZE.go()})
@@ -0,0 +1,192 @@
1
+ /*
2
+ Formalize - version 1.2
3
+
4
+ Note: This file depends on the ExtJS 3.x library.
5
+ */
6
+
7
+ // Module pattern:
8
+ // http://yuiblog.com/blog/2007/06/12/module-pattern
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
+
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
+ // Expose innards of FORMALIZE.
24
+ return {
25
+ // FORMALIZE.go
26
+ go: function() {
27
+ var i, j = this.init;
28
+
29
+ for (i in j) {
30
+ j.hasOwnProperty(i) && j[i]();
31
+ }
32
+ },
33
+ // FORMALIZE.init
34
+ init: {
35
+ // FORMALIZE.init.disable_link_button
36
+ disable_link_button: function() {
37
+ Ext.getBody().on('click', function(ev) {
38
+ var el = ev.target;
39
+ var is_disabled = el.tagName.toLowerCase() === 'a' && el.className.match('button_disabled');
40
+
41
+ if (is_disabled) {
42
+ ev.preventDefault();
43
+ }
44
+ });
45
+ },
46
+ // FORMALIZE.init.full_input_size
47
+ full_input_size: function() {
48
+ if (!IE7 || !Ext.query('textarea, input.input_full')) {
49
+ return;
50
+ }
51
+
52
+ // This fixes width: 100% on <textarea> and class="input_full".
53
+ // It ensures that form elements don't go wider than container.
54
+ Ext.each(Ext.query('textarea, input.input_full'), function(el) {
55
+ Ext.get(el).wrap('<span class="input_full_wrap"></span>');
56
+ });
57
+ },
58
+ // FORMALIZE.init.ie6_skin_inputs
59
+ ie6_skin_inputs: function() {
60
+ // Test for Internet Explorer 6.
61
+ if (!IE6 || !Ext.query('input, select, textarea')) {
62
+ // Exit if the browser is not IE6,
63
+ // or if no form elements exist.
64
+ return;
65
+ }
66
+
67
+ // For <input type="submit" />, etc.
68
+ var button_regex = /button|submit|reset/;
69
+
70
+ // For <input type="text" />, etc.
71
+ var type_regex = /date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;
72
+
73
+ Ext.each(Ext.query('input'), function(el) {
74
+ // Is it a button?
75
+ if (el.getAttribute('type').match(button_regex)) {
76
+ Ext.get(el).addClass('ie6_button');
77
+
78
+ /* Is it disabled? */
79
+ if (el.disabled) {
80
+ Ext.get(el).addClass('ie6_button_disabled');
81
+ }
82
+ }
83
+ // Or is it a textual input?
84
+ else if (el.getAttribute('type').match(type_regex)) {
85
+ Ext.get(el).addClass('ie6_input');
86
+
87
+ /* Is it disabled? */
88
+ if (el.disabled) {
89
+ Ext.get(el).addClass('ie6_input_disabled');
90
+ }
91
+ }
92
+ });
93
+
94
+ Ext.each(Ext.query('textarea, select'), function(el) {
95
+ /* Is it disabled? */
96
+ if (el.disabled) {
97
+ Ext.get(el).addClass('ie6_input_disabled');
98
+ }
99
+ });
100
+ },
101
+ // FORMALIZE.init.autofocus
102
+ autofocus: function() {
103
+ if (AUTOFOCUS_SUPPORTED || !Ext.query('[autofocus]')) {
104
+ return;
105
+ }
106
+
107
+ var el = Ext.query('[autofocus]')[0];
108
+
109
+ if (!el.disabled) {
110
+ el.focus();
111
+ }
112
+ },
113
+ // FORMALIZE.init.placeholder
114
+ placeholder: function() {
115
+ if (PLACEHOLDER_SUPPORTED || !Ext.query('[placeholder]')) {
116
+ // Exit if placeholder is supported natively,
117
+ // or if page does not have any placeholder.
118
+ return;
119
+ }
120
+
121
+ FORMALIZE.misc.add_placeholder();
122
+
123
+ Ext.each(Ext.query('[placeholder]'), function(el) {
124
+ // Placeholder obscured in older browsers,
125
+ // so there's no point adding to password.
126
+ if (el.type === 'password') {
127
+ return;
128
+ }
129
+
130
+ var text = el.getAttribute('placeholder');
131
+ var form = Ext.get(el).parent('form');
132
+
133
+ Ext.get(el).on('focus', function() {
134
+ if (el.value === text) {
135
+ el.value = '';
136
+ Ext.get(el).removeClass('placeholder_text');
137
+ }
138
+ });
139
+
140
+ Ext.get(el).on('blur', function() {
141
+ FORMALIZE.misc.add_placeholder();
142
+ });
143
+
144
+ // Prevent <form> from accidentally
145
+ // submitting the placeholder text.
146
+ form.on('submit', function() {
147
+ if (el.value === text) {
148
+ el.value = '';
149
+ Ext.get(el).removeClass('placeholder_text');
150
+ }
151
+ });
152
+
153
+ form.on('reset', function() {
154
+ setTimeout(FORMALIZE.misc.add_placeholder, 50);
155
+ });
156
+ });
157
+ }
158
+ },
159
+ // FORMALIZE.misc
160
+ misc: {
161
+ // FORMALIZE.misc.add_placeholder
162
+ add_placeholder: function() {
163
+ if (PLACEHOLDER_SUPPORTED || !Ext.query('[placeholder]')) {
164
+ // Exit if placeholder is supported natively,
165
+ // or if page does not have any placeholder.
166
+ return;
167
+ }
168
+
169
+ Ext.each(Ext.query('[placeholder]'), function(el) {
170
+ // Placeholder obscured in older browsers,
171
+ // so there's no point adding to password.
172
+ if (el.type === 'password') {
173
+ return;
174
+ }
175
+
176
+ var text = el.getAttribute('placeholder');
177
+
178
+ if (!el.value || el.value === text) {
179
+ el.value = text;
180
+ Ext.get(el).addClass('placeholder_text');
181
+ }
182
+ });
183
+ }
184
+ }
185
+ };
186
+ // Alias window, document.
187
+ })(this, this.document);
188
+
189
+ // Automatically calls all functions in FORMALIZE.init
190
+ Ext.onReady(function() {
191
+ FORMALIZE.go();
192
+ });