usastandards-rails 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/usastandards/rails.rb +9 -0
- data/lib/usastandards/rails/version.rb +5 -0
- data/usastandards-rails.gemspec +27 -0
- data/vendor/assets/javascripts/usa-standards.js +378 -0
- data/vendor/assets/stylesheets/usa-standards-fonts.css +102 -0
- data/vendor/assets/stylesheets/usa-standards.css +2297 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b8c7e84429d41a37f6a7badc57553453adc3f6df
|
4
|
+
data.tar.gz: a8d49ab5ee4394d9b7b799a7dfc835ad4c884756
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aeb87da4bb723d125e06d5863202b16c7d4fdc9872b56d849d2b75585b3b4d8ea73e7cbb8f3989a026066924d6124c05e4c3f155eafebb5e0a57d8801b8a0110
|
7
|
+
data.tar.gz: 6a83699d26e3228f3dfc19a858e4401927e61eab2bf7ee60d46347ce1d3cc32f48ab3867fcc9552cf125eaeb87c96ea947bc13de93ae29cdba3bff7ed7bd90c5
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 TODO: Write your name
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# USA Web Standards, for Rails.
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/moss-rb/usastandards-rails.svg)](https://travis-ci.org/moss-rb/usastandards-rails)
|
4
|
+
|
5
|
+
Please see the appropriate guide for your environment of choice:
|
6
|
+
|
7
|
+
* [Ruby on Rails](#a-ruby-on-rails).
|
8
|
+
|
9
|
+
### a. Ruby on Rails
|
10
|
+
|
11
|
+
`usastandards-rails` is easy to drop into Rails with the asset pipeline.
|
12
|
+
|
13
|
+
In your Gemfile you need to add the `usastandards-rails` gem.
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'usastandards-rails', '~> 3.3.5'
|
17
|
+
```
|
18
|
+
|
19
|
+
`bundle install` and restart your server to make the files available through the pipeline.
|
20
|
+
|
21
|
+
Import Standards styles in `app/assets/stylesheets/application.css`:
|
22
|
+
|
23
|
+
```scss
|
24
|
+
// "usastandards-fonts" must be imported before "usastandards"
|
25
|
+
@import "usa-standards-fonts";
|
26
|
+
@import "usa-standards";
|
27
|
+
|
28
|
+
Require Standards Javascripts in `app/assets/javascripts/application.js`:
|
29
|
+
|
30
|
+
```js
|
31
|
+
//= require jquery
|
32
|
+
//= require usa-standards
|
33
|
+
```
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/moss-rb/usastandards-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
38
|
+
|
39
|
+
## License
|
40
|
+
|
41
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "usastandards/rails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'usastandards/rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "usastandards-rails"
|
8
|
+
spec.version = Usastandards::Rails::VERSION
|
9
|
+
spec.authors = "Jon Moss"
|
10
|
+
spec.email = "me@jonathanmoss.me"
|
11
|
+
|
12
|
+
spec.summary = "Rails useable version of the 18F Web Design Standards"
|
13
|
+
spec.description = "Rails useable version of the 18F Web Design Standards"
|
14
|
+
spec.homepage = "https://github.com/moss-rb/usastandards-rails"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_runtime_dependency "rails"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec"
|
27
|
+
end
|
@@ -0,0 +1,378 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
/* globals $: false */
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
/*! politespace - v0.1.5 - 2015-07-09
|
8
|
+
Politely add spaces to input values to increase readability (credit card numbers, phone numbers, etc).
|
9
|
+
* https://github.com/filamentgroup/politespace
|
10
|
+
* Copyright (c) 2015 Filament Group (@filamentgroup)
|
11
|
+
* MIT License */
|
12
|
+
// TODO when moving to import system, install this with npm install politespace
|
13
|
+
(function( w ){
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
var Politespace = function( element ) {
|
17
|
+
if( !element ) {
|
18
|
+
throw new Error( "Politespace requires an element argument." );
|
19
|
+
}
|
20
|
+
|
21
|
+
if( !element.getAttribute ) {
|
22
|
+
// Cut the mustard
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
|
26
|
+
this.element = element;
|
27
|
+
this.type = this.element.getAttribute( "type" );
|
28
|
+
this.delimiter = this.element.getAttribute( "data-delimiter" ) || " ";
|
29
|
+
// https://en.wikipedia.org/wiki/Decimal_mark
|
30
|
+
this.decimalMark = this.element.getAttribute( "data-decimal-mark" ) || "";
|
31
|
+
this.reverse = this.element.getAttribute( "data-reverse" ) !== null;
|
32
|
+
this.groupLength = this.element.getAttribute( "data-grouplength" ) || 3;
|
33
|
+
};
|
34
|
+
|
35
|
+
Politespace.prototype._divideIntoArray = function( value ) {
|
36
|
+
var split = ( '' + this.groupLength ).split( ',' ),
|
37
|
+
isUniformSplit = split.length === 1,
|
38
|
+
dividedValue = [],
|
39
|
+
loopIndex = 0,
|
40
|
+
groupLength,
|
41
|
+
substrStart,
|
42
|
+
useCharCount;
|
43
|
+
|
44
|
+
while( split.length && loopIndex < value.length ) {
|
45
|
+
if( isUniformSplit ) {
|
46
|
+
groupLength = split[ 0 ];
|
47
|
+
} else {
|
48
|
+
// use the next split or the rest of the string if open ended, ala "3,3,"
|
49
|
+
groupLength = split.shift() || value.length - loopIndex;
|
50
|
+
}
|
51
|
+
|
52
|
+
// Use min if we’re at the end of a reversed string
|
53
|
+
// (substrStart below grows larger than the string length)
|
54
|
+
useCharCount = Math.min( parseInt( groupLength, 10 ), value.length - loopIndex );
|
55
|
+
|
56
|
+
if( this.reverse ) {
|
57
|
+
substrStart = -1 * (useCharCount + loopIndex);
|
58
|
+
} else {
|
59
|
+
substrStart = loopIndex;
|
60
|
+
}
|
61
|
+
dividedValue.push( value.substr( substrStart, useCharCount ) );
|
62
|
+
loopIndex += useCharCount;
|
63
|
+
}
|
64
|
+
|
65
|
+
if( this.reverse ) {
|
66
|
+
dividedValue.reverse();
|
67
|
+
}
|
68
|
+
|
69
|
+
return dividedValue;
|
70
|
+
};
|
71
|
+
|
72
|
+
Politespace.prototype.format = function( value ) {
|
73
|
+
var split;
|
74
|
+
var val = this.unformat( value );
|
75
|
+
var suffix = '';
|
76
|
+
|
77
|
+
if( this.decimalMark ) {
|
78
|
+
split = val.split( this.decimalMark );
|
79
|
+
suffix = split.length > 1 ? this.decimalMark + split[ 1 ] : '';
|
80
|
+
val = split[ 0 ];
|
81
|
+
}
|
82
|
+
|
83
|
+
return this._divideIntoArray( val ).join( this.delimiter ) + suffix;
|
84
|
+
};
|
85
|
+
|
86
|
+
Politespace.prototype.trimMaxlength = function( value ) {
|
87
|
+
var maxlength = this.element.getAttribute( "maxlength" );
|
88
|
+
// Note input type="number" maxlength does nothing
|
89
|
+
if( maxlength ) {
|
90
|
+
value = value.substr( 0, maxlength );
|
91
|
+
}
|
92
|
+
return value;
|
93
|
+
};
|
94
|
+
|
95
|
+
Politespace.prototype.getValue = function() {
|
96
|
+
return this.trimMaxlength( this.element.value );
|
97
|
+
};
|
98
|
+
|
99
|
+
Politespace.prototype.update = function() {
|
100
|
+
this.element.value = this.useProxy() ? this.getValue() : this.format( this.getValue() );
|
101
|
+
};
|
102
|
+
|
103
|
+
Politespace.prototype.unformat = function( value ) {
|
104
|
+
return value.replace( new RegExp( this.delimiter, 'g' ), '' );
|
105
|
+
};
|
106
|
+
|
107
|
+
Politespace.prototype.reset = function() {
|
108
|
+
this.element.value = this.unformat( this.element.value );
|
109
|
+
};
|
110
|
+
|
111
|
+
Politespace.prototype.useProxy = function() {
|
112
|
+
return this.type === "number";
|
113
|
+
};
|
114
|
+
|
115
|
+
Politespace.prototype.updateProxy = function() {
|
116
|
+
var proxy;
|
117
|
+
if( this.useProxy() ) {
|
118
|
+
proxy = this.element.parentNode.firstChild;
|
119
|
+
proxy.innerHTML = this.format( this.getValue() );
|
120
|
+
proxy.style.width = this.element.offsetWidth + "px";
|
121
|
+
}
|
122
|
+
};
|
123
|
+
|
124
|
+
Politespace.prototype.createProxy = function() {
|
125
|
+
if( !this.useProxy() ) {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
|
129
|
+
function getStyle( el, prop ) {
|
130
|
+
return window.getComputedStyle( el, null ).getPropertyValue( prop );
|
131
|
+
}
|
132
|
+
function sumStyles( el, props ) {
|
133
|
+
var total = 0;
|
134
|
+
for( var j=0, k=props.length; j<k; j++ ) {
|
135
|
+
total += parseFloat( getStyle( el, props[ j ] ) );
|
136
|
+
}
|
137
|
+
return total;
|
138
|
+
}
|
139
|
+
|
140
|
+
var parent = this.element.parentNode;
|
141
|
+
var el = document.createElement( "div" );
|
142
|
+
var proxy = document.createElement( "div" );
|
143
|
+
proxy.style.font = getStyle( this.element, "font" );
|
144
|
+
proxy.style.paddingLeft = sumStyles( this.element, [ "padding-left", "border-left-width" ] ) + "px";
|
145
|
+
proxy.style.paddingRight = sumStyles( this.element, [ "padding-right", "border-right-width" ] ) + "px";
|
146
|
+
proxy.style.top = sumStyles( this.element, [ "padding-top", "border-top-width", "margin-top" ] ) + "px";
|
147
|
+
|
148
|
+
el.appendChild( proxy );
|
149
|
+
el.className = "politespace-proxy active";
|
150
|
+
var formEl = parent.replaceChild( el, this.element );
|
151
|
+
el.appendChild( formEl );
|
152
|
+
|
153
|
+
this.updateProxy();
|
154
|
+
};
|
155
|
+
|
156
|
+
w.Politespace = Politespace;
|
157
|
+
|
158
|
+
}( this ));
|
159
|
+
|
160
|
+
(function( $ ) {
|
161
|
+
"use strict";
|
162
|
+
|
163
|
+
// jQuery Plugin
|
164
|
+
|
165
|
+
var componentName = "politespace",
|
166
|
+
enhancedAttr = "data-enhanced",
|
167
|
+
initSelector = "[data-" + componentName + "]:not([" + enhancedAttr + "])";
|
168
|
+
|
169
|
+
$.fn[ componentName ] = function(){
|
170
|
+
return this.each( function(){
|
171
|
+
var polite = new Politespace( this );
|
172
|
+
if( polite.type === "number" ) {
|
173
|
+
polite.createProxy();
|
174
|
+
}
|
175
|
+
|
176
|
+
$( this )
|
177
|
+
.bind( "input keydown", function() {
|
178
|
+
polite.updateProxy();
|
179
|
+
})
|
180
|
+
.bind( "blur", function() {
|
181
|
+
$( this ).closest( ".politespace-proxy" ).addClass( "active" );
|
182
|
+
polite.update();
|
183
|
+
polite.updateProxy();
|
184
|
+
})
|
185
|
+
.bind( "focus", function() {
|
186
|
+
$( this ).closest( ".politespace-proxy" ).removeClass( "active" );
|
187
|
+
polite.reset();
|
188
|
+
})
|
189
|
+
.data( componentName, polite );
|
190
|
+
|
191
|
+
polite.update();
|
192
|
+
});
|
193
|
+
};
|
194
|
+
|
195
|
+
// auto-init on enhance (which is called on domready)
|
196
|
+
$(document).ready(function() {
|
197
|
+
$('[data-' + componentName + ']').politespace();
|
198
|
+
});
|
199
|
+
|
200
|
+
}( jQuery ));
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Accordion
|
204
|
+
*
|
205
|
+
* An accordion component.
|
206
|
+
*
|
207
|
+
* @param {jQuery} $el A jQuery html element to turn into an accordion.
|
208
|
+
*/
|
209
|
+
function Accordion($el) {
|
210
|
+
var self = this;
|
211
|
+
this.$root = $el;
|
212
|
+
this.$root.on('click', 'button', function(ev) {
|
213
|
+
var expanded = JSON.parse($(this).attr('aria-expanded'));
|
214
|
+
ev.preventDefault();
|
215
|
+
self.hideAll();
|
216
|
+
if (!expanded) {
|
217
|
+
self.show($(this));
|
218
|
+
}
|
219
|
+
});
|
220
|
+
}
|
221
|
+
|
222
|
+
Accordion.prototype.$ = function(selector) {
|
223
|
+
return this.$root.find(selector);
|
224
|
+
}
|
225
|
+
|
226
|
+
Accordion.prototype.hide = function($button) {
|
227
|
+
var selector = $button.attr('aria-controls'),
|
228
|
+
$content = this.$('#' + selector);
|
229
|
+
|
230
|
+
$button.attr('aria-expanded', false);
|
231
|
+
$content.attr('aria-hidden', true);
|
232
|
+
};
|
233
|
+
|
234
|
+
Accordion.prototype.show = function($button) {
|
235
|
+
var selector = $button.attr('aria-controls'),
|
236
|
+
$content = this.$('#' + selector);
|
237
|
+
|
238
|
+
$button.attr('aria-expanded', true);
|
239
|
+
$content.attr('aria-hidden', false);
|
240
|
+
};
|
241
|
+
|
242
|
+
Accordion.prototype.hideAll = function() {
|
243
|
+
var self = this;
|
244
|
+
this.$('button').each(function() {
|
245
|
+
self.hide($(this));
|
246
|
+
});
|
247
|
+
};
|
248
|
+
|
249
|
+
/**
|
250
|
+
* accordion
|
251
|
+
*
|
252
|
+
* Initialize a new Accordion component.
|
253
|
+
*
|
254
|
+
* @param {jQuery} $el A jQuery html element to turn into an accordion.
|
255
|
+
*/
|
256
|
+
function accordion($el) {
|
257
|
+
return new Accordion($el);
|
258
|
+
}
|
259
|
+
|
260
|
+
function togglePassword($el) {
|
261
|
+
var fieldSelector = '#' + $el.attr('aria-controls'),
|
262
|
+
$field = $el.parents('form').find(fieldSelector),
|
263
|
+
showing = false;
|
264
|
+
|
265
|
+
$el.on('click', function(ev) {
|
266
|
+
ev.preventDefault();
|
267
|
+
toggleFieldMask($field, showing);
|
268
|
+
$el.text(showing ? 'Show password' : 'Hide password');
|
269
|
+
showing = !showing;
|
270
|
+
});
|
271
|
+
}
|
272
|
+
|
273
|
+
function toggleSSN($el) {
|
274
|
+
var fieldSelector = '#' + $el.attr('aria-controls'),
|
275
|
+
$field = $el.parents('form').find(fieldSelector),
|
276
|
+
showing = false;
|
277
|
+
|
278
|
+
$el.on('click', function(ev) {
|
279
|
+
ev.preventDefault();
|
280
|
+
toggleFieldMask($field, showing);
|
281
|
+
$el.text(showing ? 'Show SSN' : 'Hide SSN');
|
282
|
+
showing = !showing;
|
283
|
+
});
|
284
|
+
}
|
285
|
+
|
286
|
+
function toggleMultiPassword($el) {
|
287
|
+
var fieldSelector = '#password, #confirmPassword',
|
288
|
+
$fields = $el.parents('form').find(fieldSelector),
|
289
|
+
showing = false;
|
290
|
+
|
291
|
+
$el.on('click', function(ev) {
|
292
|
+
ev.preventDefault();
|
293
|
+
toggleFieldMask($fields, showing);
|
294
|
+
$el.text(showing ? 'Show my typing' : 'Hide my typing');
|
295
|
+
showing = !showing;
|
296
|
+
});
|
297
|
+
}
|
298
|
+
|
299
|
+
function toggleFieldMask($field, showing) {
|
300
|
+
$field.attr('autocapitalize', 'off');
|
301
|
+
$field.attr('autocorrect', 'off');
|
302
|
+
$field.attr('type', showing ? 'password' : 'text');
|
303
|
+
}
|
304
|
+
|
305
|
+
function validator($el) {
|
306
|
+
var data = $('#password[data-validation-element]').data(),
|
307
|
+
key,
|
308
|
+
validatorName,
|
309
|
+
validatorPattern,
|
310
|
+
$validatorCheckbox,
|
311
|
+
$checkList = $($el.data('validationElement'));
|
312
|
+
|
313
|
+
function validate() {
|
314
|
+
for (key in data) {
|
315
|
+
if (key.startsWith('validate')) {
|
316
|
+
validatorName = key.split('validate')[1];
|
317
|
+
validatorPattern = new RegExp(data[key]);
|
318
|
+
$validatorCheckbox = $checkList.find('[data-validator=' +
|
319
|
+
validatorName.toLowerCase() + ']');
|
320
|
+
|
321
|
+
if (!validatorPattern.test($el.val())) {
|
322
|
+
$validatorCheckbox.toggleClass('usa-checklist-checked', false);
|
323
|
+
}
|
324
|
+
else {
|
325
|
+
$validatorCheckbox.toggleClass('usa-checklist-checked', true);
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
|
331
|
+
$el.on('keyup', validate);
|
332
|
+
}
|
333
|
+
|
334
|
+
$(function() {
|
335
|
+
$('[class^=usa-accordion]').each(function() {
|
336
|
+
accordion($(this));
|
337
|
+
});
|
338
|
+
|
339
|
+
var footerAccordion = function() {
|
340
|
+
if (window.innerWidth < 600) {
|
341
|
+
|
342
|
+
$('.usa-footer-big nav ul').addClass('hidden');
|
343
|
+
|
344
|
+
$('.usa-footer-big nav .usa-footer-primary-link').unbind('click');
|
345
|
+
|
346
|
+
$('.usa-footer-big nav .usa-footer-primary-link').bind('click', function() {
|
347
|
+
$(this).parent().removeClass('hidden')
|
348
|
+
.siblings().addClass('hidden');
|
349
|
+
});
|
350
|
+
} else {
|
351
|
+
|
352
|
+
$('.usa-footer-big nav ul').removeClass('hidden');
|
353
|
+
|
354
|
+
$('.usa-footer-big nav .usa-footer-primary-link').unbind('click');
|
355
|
+
}
|
356
|
+
};
|
357
|
+
|
358
|
+
footerAccordion();
|
359
|
+
|
360
|
+
$(window).resize(function() {
|
361
|
+
footerAccordion();
|
362
|
+
});
|
363
|
+
|
364
|
+
// Fixing skip nav focus behavior in chrome
|
365
|
+
$('.skipnav').click(function(){
|
366
|
+
$('#main-content').attr('tabindex','0');
|
367
|
+
});
|
368
|
+
|
369
|
+
$('#main-content').blur(function(){
|
370
|
+
$(this).attr('tabindex','-1');
|
371
|
+
});
|
372
|
+
|
373
|
+
togglePassword($('.usa-show_password'));
|
374
|
+
toggleMultiPassword($('.usa-show_multipassword'));
|
375
|
+
toggleSSN($('.usa-show_ssn'));
|
376
|
+
validator($('.js-validate_password'));
|
377
|
+
|
378
|
+
});
|