ustyle 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.rbenv-gemsets +1 -0
- data/.ruby-version +1 -0
- data/CONTRIBUTING.md +68 -0
- data/Gemfile +4 -0
- data/Gruntfile.js +189 -0
- data/JAVASCRIPT_STANDARDS.md +88 -0
- data/LICENSE.txt +13 -0
- data/README.md +93 -0
- data/Rakefile +6 -0
- data/bower.json +54 -0
- data/config/.jscsrc +76 -0
- data/config/autoprefixer.yml +6 -0
- data/config/scss-lint.yml +54 -0
- data/dist/ustyle-content.css +1 -0
- data/dist/ustyle-icons.css +1 -0
- data/dist/ustyle-latest.css +1 -0
- data/dist/ustyle.js +799 -0
- data/dist/ustyle.json +1 -0
- data/grunt/modules/dss-helper.js +117 -0
- data/grunt/modules/file.js +26 -0
- data/grunt/modules/templates.js +59 -0
- data/grunt/tasks/browser-sync.js +19 -0
- data/grunt/tasks/builder.js +72 -0
- data/grunt/tasks/styleguide.js +290 -0
- data/grunt/tasks/svg2png.js +57 -0
- data/lib/ustyle/deploy.rb +31 -0
- data/lib/ustyle/engine.rb +24 -0
- data/lib/ustyle/hash.rb +44 -0
- data/lib/ustyle/icons.rb +13 -0
- data/lib/ustyle/sass_functions.rb +104 -0
- data/lib/ustyle/sinatra.rb +34 -0
- data/lib/ustyle/sprockets.rb +6 -0
- data/lib/ustyle/utils.rb +40 -0
- data/lib/ustyle/version.rb +4 -0
- data/lib/ustyle.rb +54 -0
- data/package.json +74 -0
- data/styleguide/CNAME +1 -0
- data/styleguide/assets/images/bower-logo.png +0 -0
- data/styleguide/assets/images/cloudfront-logo.png +0 -0
- data/styleguide/assets/images/illustration-01.png +0 -0
- data/styleguide/assets/images/illustration-02.png +0 -0
- data/styleguide/assets/images/illustration-03.png +0 -0
- data/styleguide/assets/images/illustration-04.png +0 -0
- data/styleguide/assets/images/illustration-05.png +0 -0
- data/styleguide/assets/images/illustration-06.png +0 -0
- data/styleguide/assets/images/illustration-07.png +0 -0
- data/styleguide/assets/images/illustration-08.png +0 -0
- data/styleguide/assets/images/infographic-01.png +0 -0
- data/styleguide/assets/images/infographic-02.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-01.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-02.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-03.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-04.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-05.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-06.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-07.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-08.png +0 -0
- data/styleguide/assets/images/npm-logo.png +0 -0
- data/styleguide/assets/images/object-photography-01.png +0 -0
- data/styleguide/assets/images/object-photography-02.png +0 -0
- data/styleguide/assets/images/object-photography-03.png +0 -0
- data/styleguide/assets/images/object-photography-04.png +0 -0
- data/styleguide/assets/images/object-photography-05.png +0 -0
- data/styleguide/assets/images/object-photography-06.png +0 -0
- data/styleguide/assets/images/object-photography-07.png +0 -0
- data/styleguide/assets/images/object-photography-08.png +0 -0
- data/styleguide/assets/images/ruby-logo.png +0 -0
- data/styleguide/assets/images/ustyle.svg +73 -0
- data/styleguide/assets/javascripts/app.js +91 -0
- data/styleguide/assets/javascripts/modules/cleanWhiteSpace.js +34 -0
- data/styleguide/assets/javascripts/modules/stats.js +51 -0
- data/styleguide/assets/javascripts/vendor/highlight.js +1 -0
- data/styleguide/assets/sass/main.scss +152 -0
- data/styleguide/assets/sass/modules/_code.scss +8 -0
- data/styleguide/assets/sass/modules/_colours.scss +25 -0
- data/styleguide/assets/sass/modules/_copyright.scss +4 -0
- data/styleguide/assets/sass/modules/_grid.scss +12 -0
- data/styleguide/assets/sass/modules/_home.scss +5 -0
- data/styleguide/assets/sass/modules/_links.scss +3 -0
- data/styleguide/assets/sass/modules/_logo.scss +56 -0
- data/styleguide/assets/sass/modules/_made-at.scss +6 -0
- data/styleguide/assets/sass/modules/_markdown.scss +7 -0
- data/styleguide/assets/sass/modules/_nav-mobile.scss +72 -0
- data/styleguide/assets/sass/modules/_nav.scss +32 -0
- data/styleguide/assets/sass/modules/_sidebar.scss +94 -0
- data/styleguide/assets/sass/modules/_states.scss +4 -0
- data/styleguide/assets/sass/modules/_styleguide.scss +134 -0
- data/styleguide/assets/sass/modules/_table.scss +3 -0
- data/styleguide/assets/sass/modules/_tooltip.scss +9 -0
- data/styleguide/assets/sass/modules/_typography.scss +14 -0
- data/styleguide/assets/sass/modules/_version.scss +11 -0
- data/styleguide/assets/sass/structure/_base.scss +18 -0
- data/styleguide/assets/sass/structure/_header.scss +12 -0
- data/styleguide/assets/sass/vendor/_highlight.scss +139 -0
- data/styleguide/assets/sass/vendor/_pure-table.scss +75 -0
- data/styleguide/content/brand/index.md +47 -0
- data/styleguide/content/brand/language.md +102 -0
- data/styleguide/content/brand/logo.tpl +102 -0
- data/styleguide/content/design/index.tpl +79 -0
- data/styleguide/content/design/typography.md +30 -0
- data/styleguide/content/index.tpl +44 -0
- data/styleguide/content/pattern-library/grid.tpl +64 -0
- data/styleguide/content/pattern-library/index.tpl +92 -0
- data/styleguide/partials/_footer.tpl +8 -0
- data/styleguide/partials/_head.tpl +20 -0
- data/styleguide/partials/_header.tpl +7 -0
- data/styleguide/partials/_sidebar.tpl +22 -0
- data/styleguide/partials/colour.tpl +24 -0
- data/styleguide/partials/icons.tpl +28 -0
- data/styleguide/partials/style_block.tpl +44 -0
- data/styleguide/templates/simple.tpl +15 -0
- data/styleguide/templates/stats.tpl +50 -0
- data/styleguide/templates/styleguide.tpl +33 -0
- data/tasks/publish.rake +65 -0
- data/ustyle.gemspec +34 -0
- data/vendor/assets/images/icons/16px/alarm.png +0 -0
- data/vendor/assets/images/icons/16px/android.png +0 -0
- data/vendor/assets/images/icons/16px/angry.png +0 -0
- data/vendor/assets/images/icons/16px/apple.png +0 -0
- data/vendor/assets/images/icons/16px/arrow-circle.png +0 -0
- data/vendor/assets/images/icons/16px/arrow-up-left.png +0 -0
- data/vendor/assets/images/icons/16px/arrow-up.png +0 -0
- data/vendor/assets/images/icons/16px/barchart.png +0 -0
- data/vendor/assets/images/icons/16px/blackberry.png +0 -0
- data/vendor/assets/images/icons/16px/book.png +0 -0
- data/vendor/assets/images/icons/16px/bookmark.png +0 -0
- data/vendor/assets/images/icons/16px/breadcrumb.png +0 -0
- data/vendor/assets/images/icons/16px/calculator.png +0 -0
- data/vendor/assets/images/icons/16px/calendar.png +0 -0
- data/vendor/assets/images/icons/16px/car.png +0 -0
- data/vendor/assets/images/icons/16px/checkbox-tick.png +0 -0
- data/vendor/assets/images/icons/16px/clock.png +0 -0
- data/vendor/assets/images/icons/16px/close.png +0 -0
- data/vendor/assets/images/icons/16px/cog.png +0 -0
- data/vendor/assets/images/icons/16px/controller.png +0 -0
- data/vendor/assets/images/icons/16px/credit-card.png +0 -0
- data/vendor/assets/images/icons/16px/cross.png +0 -0
- data/vendor/assets/images/icons/16px/desktop.png +0 -0
- data/vendor/assets/images/icons/16px/doc.png +0 -0
- data/vendor/assets/images/icons/16px/down-arrow.png +0 -0
- data/vendor/assets/images/icons/16px/dual-fuel.png +0 -0
- data/vendor/assets/images/icons/16px/electric-light.png +0 -0
- data/vendor/assets/images/icons/16px/envelope.png +0 -0
- data/vendor/assets/images/icons/16px/exit-noexit.png +0 -0
- data/vendor/assets/images/icons/16px/facebook.png +0 -0
- data/vendor/assets/images/icons/16px/filter.png +0 -0
- data/vendor/assets/images/icons/16px/fixed-variable.png +0 -0
- data/vendor/assets/images/icons/16px/gas.png +0 -0
- data/vendor/assets/images/icons/16px/gauge.png +0 -0
- data/vendor/assets/images/icons/16px/github.png +0 -0
- data/vendor/assets/images/icons/16px/google.png +0 -0
- data/vendor/assets/images/icons/16px/graph-up.png +0 -0
- data/vendor/assets/images/icons/16px/happy.png +0 -0
- data/vendor/assets/images/icons/16px/home.png +0 -0
- data/vendor/assets/images/icons/16px/hot.png +0 -0
- data/vendor/assets/images/icons/16px/info.png +0 -0
- data/vendor/assets/images/icons/16px/kettle.png +0 -0
- data/vendor/assets/images/icons/16px/key.png +0 -0
- data/vendor/assets/images/icons/16px/laptop.png +0 -0
- data/vendor/assets/images/icons/16px/lock.png +0 -0
- data/vendor/assets/images/icons/16px/magnify-in.png +0 -0
- data/vendor/assets/images/icons/16px/magnify-out.png +0 -0
- data/vendor/assets/images/icons/16px/magnify.png +0 -0
- data/vendor/assets/images/icons/16px/menu.png +0 -0
- data/vendor/assets/images/icons/16px/message.png +0 -0
- data/vendor/assets/images/icons/16px/mobile.png +0 -0
- data/vendor/assets/images/icons/16px/monthly-dd.png +0 -0
- data/vendor/assets/images/icons/16px/neutral.png +0 -0
- data/vendor/assets/images/icons/16px/no-exit.png +0 -0
- data/vendor/assets/images/icons/16px/pdf.png +0 -0
- data/vendor/assets/images/icons/16px/pencil.png +0 -0
- data/vendor/assets/images/icons/16px/person-add.png +0 -0
- data/vendor/assets/images/icons/16px/person.png +0 -0
- data/vendor/assets/images/icons/16px/phone.png +0 -0
- data/vendor/assets/images/icons/16px/piggy-bank.png +0 -0
- data/vendor/assets/images/icons/16px/pin.png +0 -0
- data/vendor/assets/images/icons/16px/play.png +0 -0
- data/vendor/assets/images/icons/16px/pound-circle.png +0 -0
- data/vendor/assets/images/icons/16px/pound-note.png +0 -0
- data/vendor/assets/images/icons/16px/power.png +0 -0
- data/vendor/assets/images/icons/16px/present.png +0 -0
- data/vendor/assets/images/icons/16px/print.png +0 -0
- data/vendor/assets/images/icons/16px/quarterly-dd.png +0 -0
- data/vendor/assets/images/icons/16px/question-circle.png +0 -0
- data/vendor/assets/images/icons/16px/question.png +0 -0
- data/vendor/assets/images/icons/16px/quote.png +0 -0
- data/vendor/assets/images/icons/16px/recycle.png +0 -0
- data/vendor/assets/images/icons/16px/remove.png +0 -0
- data/vendor/assets/images/icons/16px/renewable.png +0 -0
- data/vendor/assets/images/icons/16px/results.png +0 -0
- data/vendor/assets/images/icons/16px/sad.png +0 -0
- data/vendor/assets/images/icons/16px/save.png +0 -0
- data/vendor/assets/images/icons/16px/share.png +0 -0
- data/vendor/assets/images/icons/16px/sim.png +0 -0
- data/vendor/assets/images/icons/16px/smiley.png +0 -0
- data/vendor/assets/images/icons/16px/sort.png +0 -0
- data/vendor/assets/images/icons/16px/speech-circle.png +0 -0
- data/vendor/assets/images/icons/16px/speech.png +0 -0
- data/vendor/assets/images/icons/16px/spinner 2.png +0 -0
- data/vendor/assets/images/icons/16px/spinner.png +0 -0
- data/vendor/assets/images/icons/16px/star-half.png +0 -0
- data/vendor/assets/images/icons/16px/star.png +0 -0
- data/vendor/assets/images/icons/16px/starline-half.png +0 -0
- data/vendor/assets/images/icons/16px/starline.png +0 -0
- data/vendor/assets/images/icons/16px/tablet.png +0 -0
- data/vendor/assets/images/icons/16px/talk.png +0 -0
- data/vendor/assets/images/icons/16px/tick-circle.png +0 -0
- data/vendor/assets/images/icons/16px/tick.png +0 -0
- data/vendor/assets/images/icons/16px/tv.png +0 -0
- data/vendor/assets/images/icons/16px/twitter.png +0 -0
- data/vendor/assets/images/icons/16px/ustyle.png +0 -0
- data/vendor/assets/images/icons/16px/uswitch.png +0 -0
- data/vendor/assets/images/icons/16px/variable.png +0 -0
- data/vendor/assets/images/icons/16px/warning-circle.png +0 -0
- data/vendor/assets/images/icons/16px/warning.png +0 -0
- data/vendor/assets/images/icons/16px/wifi.png +0 -0
- data/vendor/assets/images/icons/16px/wiki.png +0 -0
- data/vendor/assets/images/icons/16px/windows.png +0 -0
- data/vendor/assets/images/icons/16px/wondering.png +0 -0
- data/vendor/assets/images/icons/16px/world.png +0 -0
- data/vendor/assets/images/icons/16px/xml.png +0 -0
- data/vendor/assets/images/icons/32px/alarm.png +0 -0
- data/vendor/assets/images/icons/32px/android.png +0 -0
- data/vendor/assets/images/icons/32px/angry.png +0 -0
- data/vendor/assets/images/icons/32px/apple.png +0 -0
- data/vendor/assets/images/icons/32px/arrow-circle.png +0 -0
- data/vendor/assets/images/icons/32px/arrow-up-left.png +0 -0
- data/vendor/assets/images/icons/32px/arrow-up.png +0 -0
- data/vendor/assets/images/icons/32px/barchart.png +0 -0
- data/vendor/assets/images/icons/32px/blackberry.png +0 -0
- data/vendor/assets/images/icons/32px/book.png +0 -0
- data/vendor/assets/images/icons/32px/bookmark.png +0 -0
- data/vendor/assets/images/icons/32px/breadcrumb.png +0 -0
- data/vendor/assets/images/icons/32px/calculator.png +0 -0
- data/vendor/assets/images/icons/32px/calendar.png +0 -0
- data/vendor/assets/images/icons/32px/car.png +0 -0
- data/vendor/assets/images/icons/32px/checkbox-tick.png +0 -0
- data/vendor/assets/images/icons/32px/clock.png +0 -0
- data/vendor/assets/images/icons/32px/close.png +0 -0
- data/vendor/assets/images/icons/32px/cog.png +0 -0
- data/vendor/assets/images/icons/32px/controller.png +0 -0
- data/vendor/assets/images/icons/32px/credit-card.png +0 -0
- data/vendor/assets/images/icons/32px/cross.png +0 -0
- data/vendor/assets/images/icons/32px/desktop.png +0 -0
- data/vendor/assets/images/icons/32px/doc.png +0 -0
- data/vendor/assets/images/icons/32px/down-arrow.png +0 -0
- data/vendor/assets/images/icons/32px/dual-fuel.png +0 -0
- data/vendor/assets/images/icons/32px/electric-light.png +0 -0
- data/vendor/assets/images/icons/32px/envelope.png +0 -0
- data/vendor/assets/images/icons/32px/exit-noexit.png +0 -0
- data/vendor/assets/images/icons/32px/facebook.png +0 -0
- data/vendor/assets/images/icons/32px/filter.png +0 -0
- data/vendor/assets/images/icons/32px/fixed-variable.png +0 -0
- data/vendor/assets/images/icons/32px/gas.png +0 -0
- data/vendor/assets/images/icons/32px/gauge.png +0 -0
- data/vendor/assets/images/icons/32px/github.png +0 -0
- data/vendor/assets/images/icons/32px/google.png +0 -0
- data/vendor/assets/images/icons/32px/graph-up.png +0 -0
- data/vendor/assets/images/icons/32px/happy.png +0 -0
- data/vendor/assets/images/icons/32px/home.png +0 -0
- data/vendor/assets/images/icons/32px/hot.png +0 -0
- data/vendor/assets/images/icons/32px/info.png +0 -0
- data/vendor/assets/images/icons/32px/kettle.png +0 -0
- data/vendor/assets/images/icons/32px/key.png +0 -0
- data/vendor/assets/images/icons/32px/laptop.png +0 -0
- data/vendor/assets/images/icons/32px/lock.png +0 -0
- data/vendor/assets/images/icons/32px/magnify-in.png +0 -0
- data/vendor/assets/images/icons/32px/magnify-out.png +0 -0
- data/vendor/assets/images/icons/32px/magnify.png +0 -0
- data/vendor/assets/images/icons/32px/menu.png +0 -0
- data/vendor/assets/images/icons/32px/message.png +0 -0
- data/vendor/assets/images/icons/32px/mobile.png +0 -0
- data/vendor/assets/images/icons/32px/monthly-dd.png +0 -0
- data/vendor/assets/images/icons/32px/neutral.png +0 -0
- data/vendor/assets/images/icons/32px/no-exit.png +0 -0
- data/vendor/assets/images/icons/32px/pdf.png +0 -0
- data/vendor/assets/images/icons/32px/pencil.png +0 -0
- data/vendor/assets/images/icons/32px/person-add.png +0 -0
- data/vendor/assets/images/icons/32px/person.png +0 -0
- data/vendor/assets/images/icons/32px/phone.png +0 -0
- data/vendor/assets/images/icons/32px/piggy-bank.png +0 -0
- data/vendor/assets/images/icons/32px/pin.png +0 -0
- data/vendor/assets/images/icons/32px/play.png +0 -0
- data/vendor/assets/images/icons/32px/pound-circle.png +0 -0
- data/vendor/assets/images/icons/32px/pound-note.png +0 -0
- data/vendor/assets/images/icons/32px/power.png +0 -0
- data/vendor/assets/images/icons/32px/present.png +0 -0
- data/vendor/assets/images/icons/32px/print.png +0 -0
- data/vendor/assets/images/icons/32px/quarterly-dd.png +0 -0
- data/vendor/assets/images/icons/32px/question-circle.png +0 -0
- data/vendor/assets/images/icons/32px/question.png +0 -0
- data/vendor/assets/images/icons/32px/quote.png +0 -0
- data/vendor/assets/images/icons/32px/recycle.png +0 -0
- data/vendor/assets/images/icons/32px/remove.png +0 -0
- data/vendor/assets/images/icons/32px/renewable.png +0 -0
- data/vendor/assets/images/icons/32px/results.png +0 -0
- data/vendor/assets/images/icons/32px/sad.png +0 -0
- data/vendor/assets/images/icons/32px/save.png +0 -0
- data/vendor/assets/images/icons/32px/share.png +0 -0
- data/vendor/assets/images/icons/32px/sim.png +0 -0
- data/vendor/assets/images/icons/32px/smiley.png +0 -0
- data/vendor/assets/images/icons/32px/sort.png +0 -0
- data/vendor/assets/images/icons/32px/speech-circle.png +0 -0
- data/vendor/assets/images/icons/32px/speech.png +0 -0
- data/vendor/assets/images/icons/32px/spinner 2.png +0 -0
- data/vendor/assets/images/icons/32px/spinner.png +0 -0
- data/vendor/assets/images/icons/32px/star-half.png +0 -0
- data/vendor/assets/images/icons/32px/star.png +0 -0
- data/vendor/assets/images/icons/32px/starline-half.png +0 -0
- data/vendor/assets/images/icons/32px/starline.png +0 -0
- data/vendor/assets/images/icons/32px/tablet.png +0 -0
- data/vendor/assets/images/icons/32px/talk.png +0 -0
- data/vendor/assets/images/icons/32px/tick-circle.png +0 -0
- data/vendor/assets/images/icons/32px/tick.png +0 -0
- data/vendor/assets/images/icons/32px/tv.png +0 -0
- data/vendor/assets/images/icons/32px/twitter.png +0 -0
- data/vendor/assets/images/icons/32px/ustyle.png +0 -0
- data/vendor/assets/images/icons/32px/uswitch.png +0 -0
- data/vendor/assets/images/icons/32px/variable.png +0 -0
- data/vendor/assets/images/icons/32px/warning-circle.png +0 -0
- data/vendor/assets/images/icons/32px/warning.png +0 -0
- data/vendor/assets/images/icons/32px/wifi.png +0 -0
- data/vendor/assets/images/icons/32px/wiki.png +0 -0
- data/vendor/assets/images/icons/32px/windows.png +0 -0
- data/vendor/assets/images/icons/32px/wondering.png +0 -0
- data/vendor/assets/images/icons/32px/world.png +0 -0
- data/vendor/assets/images/icons/32px/xml.png +0 -0
- data/vendor/assets/images/icons/64px/alarm.png +0 -0
- data/vendor/assets/images/icons/64px/android.png +0 -0
- data/vendor/assets/images/icons/64px/angry.png +0 -0
- data/vendor/assets/images/icons/64px/apple.png +0 -0
- data/vendor/assets/images/icons/64px/arrow-circle.png +0 -0
- data/vendor/assets/images/icons/64px/arrow-up-left.png +0 -0
- data/vendor/assets/images/icons/64px/arrow-up.png +0 -0
- data/vendor/assets/images/icons/64px/barchart.png +0 -0
- data/vendor/assets/images/icons/64px/blackberry.png +0 -0
- data/vendor/assets/images/icons/64px/book.png +0 -0
- data/vendor/assets/images/icons/64px/bookmark.png +0 -0
- data/vendor/assets/images/icons/64px/breadcrumb.png +0 -0
- data/vendor/assets/images/icons/64px/calculator.png +0 -0
- data/vendor/assets/images/icons/64px/calendar.png +0 -0
- data/vendor/assets/images/icons/64px/car.png +0 -0
- data/vendor/assets/images/icons/64px/checkbox-tick.png +0 -0
- data/vendor/assets/images/icons/64px/clock.png +0 -0
- data/vendor/assets/images/icons/64px/close.png +0 -0
- data/vendor/assets/images/icons/64px/cog.png +0 -0
- data/vendor/assets/images/icons/64px/controller.png +0 -0
- data/vendor/assets/images/icons/64px/credit-card.png +0 -0
- data/vendor/assets/images/icons/64px/cross.png +0 -0
- data/vendor/assets/images/icons/64px/desktop.png +0 -0
- data/vendor/assets/images/icons/64px/doc.png +0 -0
- data/vendor/assets/images/icons/64px/down-arrow.png +0 -0
- data/vendor/assets/images/icons/64px/dual-fuel.png +0 -0
- data/vendor/assets/images/icons/64px/electric-light.png +0 -0
- data/vendor/assets/images/icons/64px/envelope.png +0 -0
- data/vendor/assets/images/icons/64px/exit-noexit.png +0 -0
- data/vendor/assets/images/icons/64px/facebook.png +0 -0
- data/vendor/assets/images/icons/64px/filter.png +0 -0
- data/vendor/assets/images/icons/64px/fixed-variable.png +0 -0
- data/vendor/assets/images/icons/64px/gas.png +0 -0
- data/vendor/assets/images/icons/64px/gauge.png +0 -0
- data/vendor/assets/images/icons/64px/github.png +0 -0
- data/vendor/assets/images/icons/64px/google.png +0 -0
- data/vendor/assets/images/icons/64px/graph-up.png +0 -0
- data/vendor/assets/images/icons/64px/happy.png +0 -0
- data/vendor/assets/images/icons/64px/home.png +0 -0
- data/vendor/assets/images/icons/64px/hot.png +0 -0
- data/vendor/assets/images/icons/64px/info.png +0 -0
- data/vendor/assets/images/icons/64px/kettle.png +0 -0
- data/vendor/assets/images/icons/64px/key.png +0 -0
- data/vendor/assets/images/icons/64px/laptop.png +0 -0
- data/vendor/assets/images/icons/64px/lock.png +0 -0
- data/vendor/assets/images/icons/64px/magnify-in.png +0 -0
- data/vendor/assets/images/icons/64px/magnify-out.png +0 -0
- data/vendor/assets/images/icons/64px/magnify.png +0 -0
- data/vendor/assets/images/icons/64px/menu.png +0 -0
- data/vendor/assets/images/icons/64px/message.png +0 -0
- data/vendor/assets/images/icons/64px/mobile.png +0 -0
- data/vendor/assets/images/icons/64px/monthly-dd.png +0 -0
- data/vendor/assets/images/icons/64px/neutral.png +0 -0
- data/vendor/assets/images/icons/64px/no-exit.png +0 -0
- data/vendor/assets/images/icons/64px/pdf.png +0 -0
- data/vendor/assets/images/icons/64px/pencil.png +0 -0
- data/vendor/assets/images/icons/64px/person-add.png +0 -0
- data/vendor/assets/images/icons/64px/person.png +0 -0
- data/vendor/assets/images/icons/64px/phone.png +0 -0
- data/vendor/assets/images/icons/64px/piggy-bank.png +0 -0
- data/vendor/assets/images/icons/64px/pin.png +0 -0
- data/vendor/assets/images/icons/64px/play.png +0 -0
- data/vendor/assets/images/icons/64px/pound-circle.png +0 -0
- data/vendor/assets/images/icons/64px/pound-note.png +0 -0
- data/vendor/assets/images/icons/64px/power.png +0 -0
- data/vendor/assets/images/icons/64px/present.png +0 -0
- data/vendor/assets/images/icons/64px/print.png +0 -0
- data/vendor/assets/images/icons/64px/quarterly-dd.png +0 -0
- data/vendor/assets/images/icons/64px/question-circle.png +0 -0
- data/vendor/assets/images/icons/64px/question.png +0 -0
- data/vendor/assets/images/icons/64px/quote.png +0 -0
- data/vendor/assets/images/icons/64px/recycle.png +0 -0
- data/vendor/assets/images/icons/64px/remove.png +0 -0
- data/vendor/assets/images/icons/64px/renewable.png +0 -0
- data/vendor/assets/images/icons/64px/results.png +0 -0
- data/vendor/assets/images/icons/64px/sad.png +0 -0
- data/vendor/assets/images/icons/64px/save.png +0 -0
- data/vendor/assets/images/icons/64px/share.png +0 -0
- data/vendor/assets/images/icons/64px/sim.png +0 -0
- data/vendor/assets/images/icons/64px/smiley.png +0 -0
- data/vendor/assets/images/icons/64px/sort.png +0 -0
- data/vendor/assets/images/icons/64px/speech-circle.png +0 -0
- data/vendor/assets/images/icons/64px/speech.png +0 -0
- data/vendor/assets/images/icons/64px/spinner 2.png +0 -0
- data/vendor/assets/images/icons/64px/spinner.png +0 -0
- data/vendor/assets/images/icons/64px/star-half.png +0 -0
- data/vendor/assets/images/icons/64px/star.png +0 -0
- data/vendor/assets/images/icons/64px/starline-half.png +0 -0
- data/vendor/assets/images/icons/64px/starline.png +0 -0
- data/vendor/assets/images/icons/64px/tablet.png +0 -0
- data/vendor/assets/images/icons/64px/talk.png +0 -0
- data/vendor/assets/images/icons/64px/tick-circle.png +0 -0
- data/vendor/assets/images/icons/64px/tick.png +0 -0
- data/vendor/assets/images/icons/64px/tv.png +0 -0
- data/vendor/assets/images/icons/64px/twitter.png +0 -0
- data/vendor/assets/images/icons/64px/ustyle.png +0 -0
- data/vendor/assets/images/icons/64px/uswitch.png +0 -0
- data/vendor/assets/images/icons/64px/variable.png +0 -0
- data/vendor/assets/images/icons/64px/warning-circle.png +0 -0
- data/vendor/assets/images/icons/64px/warning.png +0 -0
- data/vendor/assets/images/icons/64px/wifi.png +0 -0
- data/vendor/assets/images/icons/64px/wiki.png +0 -0
- data/vendor/assets/images/icons/64px/windows.png +0 -0
- data/vendor/assets/images/icons/64px/wondering.png +0 -0
- data/vendor/assets/images/icons/64px/world.png +0 -0
- data/vendor/assets/images/icons/64px/xml.png +0 -0
- data/vendor/assets/images/icons/alarm.svg +1 -0
- data/vendor/assets/images/icons/android.svg +1 -0
- data/vendor/assets/images/icons/angry.svg +1 -0
- data/vendor/assets/images/icons/apple.svg +1 -0
- data/vendor/assets/images/icons/arrow-circle.svg +1 -0
- data/vendor/assets/images/icons/arrow-up-left.svg +1 -0
- data/vendor/assets/images/icons/arrow-up.svg +1 -0
- data/vendor/assets/images/icons/barchart.svg +1 -0
- data/vendor/assets/images/icons/blackberry.svg +1 -0
- data/vendor/assets/images/icons/book.svg +1 -0
- data/vendor/assets/images/icons/bookmark.svg +1 -0
- data/vendor/assets/images/icons/breadcrumb.svg +1 -0
- data/vendor/assets/images/icons/calculator.svg +1 -0
- data/vendor/assets/images/icons/calendar.svg +1 -0
- data/vendor/assets/images/icons/car.svg +1 -0
- data/vendor/assets/images/icons/checkbox-tick.svg +1 -0
- data/vendor/assets/images/icons/clock.svg +1 -0
- data/vendor/assets/images/icons/close.svg +1 -0
- data/vendor/assets/images/icons/cog.svg +1 -0
- data/vendor/assets/images/icons/controller.svg +1 -0
- data/vendor/assets/images/icons/credit-card.svg +1 -0
- data/vendor/assets/images/icons/cross.svg +1 -0
- data/vendor/assets/images/icons/desktop.svg +1 -0
- data/vendor/assets/images/icons/doc.svg +1 -0
- data/vendor/assets/images/icons/down-arrow.svg +1 -0
- data/vendor/assets/images/icons/dual-fuel.svg +1 -0
- data/vendor/assets/images/icons/electric-light.svg +1 -0
- data/vendor/assets/images/icons/envelope.svg +1 -0
- data/vendor/assets/images/icons/exit-noexit.svg +1 -0
- data/vendor/assets/images/icons/facebook.svg +1 -0
- data/vendor/assets/images/icons/filter.svg +1 -0
- data/vendor/assets/images/icons/fixed-variable.svg +1 -0
- data/vendor/assets/images/icons/gas.svg +1 -0
- data/vendor/assets/images/icons/gauge.svg +1 -0
- data/vendor/assets/images/icons/github.svg +1 -0
- data/vendor/assets/images/icons/google.svg +1 -0
- data/vendor/assets/images/icons/graph-up.svg +1 -0
- data/vendor/assets/images/icons/happy.svg +1 -0
- data/vendor/assets/images/icons/home.svg +1 -0
- data/vendor/assets/images/icons/hot.svg +1 -0
- data/vendor/assets/images/icons/info.svg +1 -0
- data/vendor/assets/images/icons/kettle.svg +1 -0
- data/vendor/assets/images/icons/key.svg +1 -0
- data/vendor/assets/images/icons/laptop.svg +1 -0
- data/vendor/assets/images/icons/lock.svg +1 -0
- data/vendor/assets/images/icons/magnify-in.svg +1 -0
- data/vendor/assets/images/icons/magnify-out.svg +1 -0
- data/vendor/assets/images/icons/magnify.svg +1 -0
- data/vendor/assets/images/icons/menu.svg +1 -0
- data/vendor/assets/images/icons/message.svg +1 -0
- data/vendor/assets/images/icons/mobile.svg +1 -0
- data/vendor/assets/images/icons/monthly-dd.svg +1 -0
- data/vendor/assets/images/icons/neutral.svg +1 -0
- data/vendor/assets/images/icons/no-exit.svg +1 -0
- data/vendor/assets/images/icons/pdf.svg +1 -0
- data/vendor/assets/images/icons/pencil.svg +1 -0
- data/vendor/assets/images/icons/person-add.svg +1 -0
- data/vendor/assets/images/icons/person.svg +1 -0
- data/vendor/assets/images/icons/phone.svg +1 -0
- data/vendor/assets/images/icons/piggy-bank.svg +1 -0
- data/vendor/assets/images/icons/pin.svg +1 -0
- data/vendor/assets/images/icons/play.svg +1 -0
- data/vendor/assets/images/icons/pound-circle.svg +1 -0
- data/vendor/assets/images/icons/pound-note.svg +1 -0
- data/vendor/assets/images/icons/power.svg +1 -0
- data/vendor/assets/images/icons/present.svg +1 -0
- data/vendor/assets/images/icons/print.svg +1 -0
- data/vendor/assets/images/icons/quarterly-dd.svg +1 -0
- data/vendor/assets/images/icons/question-circle.svg +1 -0
- data/vendor/assets/images/icons/question.svg +1 -0
- data/vendor/assets/images/icons/quote.svg +1 -0
- data/vendor/assets/images/icons/recycle.svg +1 -0
- data/vendor/assets/images/icons/remove.svg +1 -0
- data/vendor/assets/images/icons/renewable.svg +1 -0
- data/vendor/assets/images/icons/results.svg +1 -0
- data/vendor/assets/images/icons/sad.svg +1 -0
- data/vendor/assets/images/icons/save.svg +1 -0
- data/vendor/assets/images/icons/share.svg +1 -0
- data/vendor/assets/images/icons/sim.svg +1 -0
- data/vendor/assets/images/icons/smiley.svg +1 -0
- data/vendor/assets/images/icons/sort.svg +1 -0
- data/vendor/assets/images/icons/speech-circle.svg +1 -0
- data/vendor/assets/images/icons/speech.svg +1 -0
- data/vendor/assets/images/icons/spinner 2.svg +1 -0
- data/vendor/assets/images/icons/spinner.svg +1 -0
- data/vendor/assets/images/icons/spinner_fallback.gif +0 -0
- data/vendor/assets/images/icons/star-half.svg +1 -0
- data/vendor/assets/images/icons/star.svg +1 -0
- data/vendor/assets/images/icons/starline-half.svg +1 -0
- data/vendor/assets/images/icons/starline.svg +1 -0
- data/vendor/assets/images/icons/tablet.svg +1 -0
- data/vendor/assets/images/icons/talk.svg +1 -0
- data/vendor/assets/images/icons/tick-circle.svg +1 -0
- data/vendor/assets/images/icons/tick.svg +1 -0
- data/vendor/assets/images/icons/tv.svg +1 -0
- data/vendor/assets/images/icons/twitter.svg +1 -0
- data/vendor/assets/images/icons/ustyle.svg +1 -0
- data/vendor/assets/images/icons/uswitch.svg +1 -0
- data/vendor/assets/images/icons/variable.svg +1 -0
- data/vendor/assets/images/icons/warning-circle.svg +1 -0
- data/vendor/assets/images/icons/warning.svg +1 -0
- data/vendor/assets/images/icons/wifi.svg +1 -0
- data/vendor/assets/images/icons/wiki.svg +1 -0
- data/vendor/assets/images/icons/windows.svg +1 -0
- data/vendor/assets/images/icons/wondering.svg +1 -0
- data/vendor/assets/images/icons/world.svg +1 -0
- data/vendor/assets/images/icons/xml.svg +1 -0
- data/vendor/assets/javascripts/ustyle/anchor.js +300 -0
- data/vendor/assets/javascripts/ustyle/backdrop.js +56 -0
- data/vendor/assets/javascripts/ustyle/classtoggler.js +58 -0
- data/vendor/assets/javascripts/ustyle/login/login.js +165 -0
- data/vendor/assets/javascripts/ustyle/login/password-helper.js +151 -0
- data/vendor/assets/javascripts/ustyle/overlay.js +125 -0
- data/vendor/assets/javascripts/ustyle/radioToggle.js +28 -0
- data/vendor/assets/javascripts/ustyle/tabs.js +120 -0
- data/vendor/assets/javascripts/ustyle/utils.js +106 -0
- data/vendor/assets/javascripts/ustyle.js +7 -0
- data/vendor/assets/stylesheets/ustyle/_all.scss +50 -0
- data/vendor/assets/stylesheets/ustyle/_content.scss +5 -0
- data/vendor/assets/stylesheets/ustyle/_global.scss +24 -0
- data/vendor/assets/stylesheets/ustyle/_icons.scss +20 -0
- data/vendor/assets/stylesheets/ustyle/articles/_base.scss +88 -0
- data/vendor/assets/stylesheets/ustyle/articles/_guide.scss +57 -0
- data/vendor/assets/stylesheets/ustyle/articles/_more.scss +31 -0
- data/vendor/assets/stylesheets/ustyle/articles/_news.scss +214 -0
- data/vendor/assets/stylesheets/ustyle/articles/_related.scss +74 -0
- data/vendor/assets/stylesheets/ustyle/basics/_extends.scss +69 -0
- data/vendor/assets/stylesheets/ustyle/basics/_font-face-ie.scss +31 -0
- data/vendor/assets/stylesheets/ustyle/basics/_font-face.scss +31 -0
- data/vendor/assets/stylesheets/ustyle/basics/_fonts.scss +27 -0
- data/vendor/assets/stylesheets/ustyle/basics/_functions.scss +78 -0
- data/vendor/assets/stylesheets/ustyle/basics/_grid.scss +86 -0
- data/vendor/assets/stylesheets/ustyle/basics/_typography.scss +123 -0
- data/vendor/assets/stylesheets/ustyle/basics/_variables.scss +188 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_colors.scss +95 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_forms.scss +65 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_icons.scss +166 -0
- data/vendor/assets/stylesheets/ustyle/components/_anchor.scss +134 -0
- data/vendor/assets/stylesheets/ustyle/components/_backdrop.scss +19 -0
- data/vendor/assets/stylesheets/ustyle/components/_breadcrumbs.scss +59 -0
- data/vendor/assets/stylesheets/ustyle/components/_button.scss +184 -0
- data/vendor/assets/stylesheets/ustyle/components/_content-group.scss +33 -0
- data/vendor/assets/stylesheets/ustyle/components/_cta.scss +64 -0
- data/vendor/assets/stylesheets/ustyle/components/_featured.scss +112 -0
- data/vendor/assets/stylesheets/ustyle/components/_grid-classes.scss +52 -0
- data/vendor/assets/stylesheets/ustyle/components/_hero.scss +42 -0
- data/vendor/assets/stylesheets/ustyle/components/_links.scss +30 -0
- data/vendor/assets/stylesheets/ustyle/components/_lists-li.scss +89 -0
- data/vendor/assets/stylesheets/ustyle/components/_lists.scss +46 -0
- data/vendor/assets/stylesheets/ustyle/components/_loader.scss +142 -0
- data/vendor/assets/stylesheets/ustyle/components/_overlay.scss +183 -0
- data/vendor/assets/stylesheets/ustyle/components/_progress.scss +126 -0
- data/vendor/assets/stylesheets/ustyle/components/_tabs.scss +239 -0
- data/vendor/assets/stylesheets/ustyle/components/_tooltip.scss +244 -0
- data/vendor/assets/stylesheets/ustyle/components/_usp.scss +69 -0
- data/vendor/assets/stylesheets/ustyle/content/_base.scss +195 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-header.scss +30 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-social.scss +10 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-tabs.scss +30 -0
- data/vendor/assets/stylesheets/ustyle/forms/_base.scss +9 -0
- data/vendor/assets/stylesheets/ustyle/forms/_fields.scss +75 -0
- data/vendor/assets/stylesheets/ustyle/forms/_input-group.scss +101 -0
- data/vendor/assets/stylesheets/ustyle/forms/_input.scss +63 -0
- data/vendor/assets/stylesheets/ustyle/forms/_radio-checkbox.scss +133 -0
- data/vendor/assets/stylesheets/ustyle/forms/_reset.scss +23 -0
- data/vendor/assets/stylesheets/ustyle/forms/_select.scss +125 -0
- data/vendor/assets/stylesheets/ustyle/forms/_textarea.scss +33 -0
- data/vendor/assets/stylesheets/ustyle/forms/_toggle.scss +125 -0
- data/vendor/assets/stylesheets/ustyle/forms/_validation.scss +104 -0
- data/vendor/assets/stylesheets/ustyle/icons/_base.scss +239 -0
- data/vendor/assets/stylesheets/ustyle/icons/_png.scss +37 -0
- data/vendor/assets/stylesheets/ustyle/icons/_svg.scss +29 -0
- data/vendor/assets/stylesheets/ustyle/login/_base.scss +81 -0
- data/vendor/assets/stylesheets/ustyle/login/_password-help.scss +61 -0
- data/vendor/assets/stylesheets/ustyle/login/_social.scss +63 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_arrow.scss +51 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_base.scss +8 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_baseline.scss +41 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_forms.scss +62 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_general.scss +24 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_link-colors.scss +44 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_media-query.scss +116 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_rgba-inline.scss +18 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_typography.scss +98 -0
- data/vendor/assets/stylesheets/ustyle/tables/_base.scss +4 -0
- data/vendor/assets/stylesheets/ustyle/tables/_tables-basic.scss +72 -0
- data/vendor/assets/stylesheets/ustyle/tables/_tables-sortable.scss +72 -0
- data/vendor/assets/stylesheets/ustyle/tables/_tables-with-key-cells.scss +18 -0
- data/vendor/assets/stylesheets/ustyle/tables/_variables.scss +15 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_general.scss +106 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_grid.scss +13 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_images.scss +34 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_responsive.scss +101 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_spacing.scss +74 -0
- data/vendor/assets/stylesheets/ustyle/vendor/normalize.scss +427 -0
- data/vendor/assets/stylesheets/ustyle-content.scss +2 -0
- data/vendor/assets/stylesheets/ustyle-icons.scss +1 -0
- data/vendor/assets/stylesheets/ustyle.scss +1 -0
- metadata +822 -0
data/dist/ustyle.js
ADDED
@@ -0,0 +1,799 @@
|
|
1
|
+
var slice = [].slice;
|
2
|
+
var hasProp = {}.hasOwnProperty;
|
3
|
+
|
4
|
+
if (this.Utils == null) {
|
5
|
+
this.Utils = {
|
6
|
+
modules: []
|
7
|
+
};
|
8
|
+
}
|
9
|
+
|
10
|
+
var addClass = function(element, name) {
|
11
|
+
removeClass(element, name);
|
12
|
+
return element.className += " " + name + " ";
|
13
|
+
};
|
14
|
+
|
15
|
+
var removeClass = function(element, name) {
|
16
|
+
var regExp = new RegExp("(\\s|^)" + name + "(\\s|$)", "gi");
|
17
|
+
return element.className = element.className.replace(regExp, "");
|
18
|
+
};
|
19
|
+
|
20
|
+
var hasClass = function(element, name) {
|
21
|
+
return new RegExp("(^| )" + name + "( |$)", "gi").test(element.className);
|
22
|
+
};
|
23
|
+
|
24
|
+
var merge = function() {
|
25
|
+
var extension;
|
26
|
+
var i;
|
27
|
+
var len;
|
28
|
+
var property;
|
29
|
+
var target = arguments[0];
|
30
|
+
var extensions = 2 <= arguments.length ? slice.call(arguments, 1) : [];
|
31
|
+
|
32
|
+
for (i = 0, len = extensions.length; i < len; i++) {
|
33
|
+
extension = extensions[i];
|
34
|
+
for (property in extension) {
|
35
|
+
if (!hasProp.call(extension, property)) continue;
|
36
|
+
target[property] = extension[property];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
return target;
|
41
|
+
};
|
42
|
+
|
43
|
+
var setOptions = function(options, defaults) {
|
44
|
+
return merge({}, defaults, options);
|
45
|
+
};
|
46
|
+
|
47
|
+
var deleteUndefined = function(obj) {
|
48
|
+
var key;
|
49
|
+
var value;
|
50
|
+
var results = [];
|
51
|
+
for (key in obj) {
|
52
|
+
value = obj[key];
|
53
|
+
if (value === null || value === void 0) {
|
54
|
+
results.push(delete obj[key]);
|
55
|
+
} else {
|
56
|
+
results.push(void 0);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
return results;
|
61
|
+
};
|
62
|
+
|
63
|
+
var transformKey = (function() {
|
64
|
+
var i;
|
65
|
+
var key;
|
66
|
+
var len;
|
67
|
+
var el = document.createElement("div");
|
68
|
+
var transforms = ["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"];
|
69
|
+
for (i = 0, len = transforms.length; i < len; i++) {
|
70
|
+
key = transforms[i];
|
71
|
+
if (el.style[key] !== void 0) {
|
72
|
+
return key;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
})();
|
76
|
+
|
77
|
+
var requestAnimationFrame = (function(window) {
|
78
|
+
var i;
|
79
|
+
var len;
|
80
|
+
var vendor;
|
81
|
+
var ref = ["ms", "moz", "webkit", "o"];
|
82
|
+
|
83
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
84
|
+
vendor = ref[i];
|
85
|
+
if (window.requestAnimationFrame) {
|
86
|
+
break;
|
87
|
+
}
|
88
|
+
|
89
|
+
window.requestAnimationFrame = window[vendor + "RequestAnimationFrame"];
|
90
|
+
}
|
91
|
+
|
92
|
+
return window.requestAnimationFrame || (window.requestAnimationFrame = function(callback) {
|
93
|
+
return setTimeout(callback, 1000 / 60);
|
94
|
+
});
|
95
|
+
})(window);
|
96
|
+
|
97
|
+
this.Utils = {
|
98
|
+
addClass: addClass,
|
99
|
+
removeClass: removeClass,
|
100
|
+
hasClass: hasClass,
|
101
|
+
merge: merge,
|
102
|
+
setOptions: setOptions,
|
103
|
+
deleteUndefined: deleteUndefined,
|
104
|
+
transformKey: transformKey,
|
105
|
+
requestAnimationFrame: requestAnimationFrame
|
106
|
+
};
|
107
|
+
|
108
|
+
var createContext;
|
109
|
+
var ref = this.Utils;
|
110
|
+
var merge = ref.merge;
|
111
|
+
var addClass = ref.addClass;
|
112
|
+
var hasClass = ref.hasClass;
|
113
|
+
var setOptions = ref.setOptions;
|
114
|
+
var removeClass = ref.removeClass;
|
115
|
+
var transformKey = ref.transformKey;
|
116
|
+
|
117
|
+
var indexOf = [].indexOf || function(item) {
|
118
|
+
for (var i = 0, l = this.length; i < l; i++) {
|
119
|
+
if (i in this && this[i] === item) {
|
120
|
+
return i;
|
121
|
+
}
|
122
|
+
} return -1;
|
123
|
+
};
|
124
|
+
|
125
|
+
createContext = function(options) {
|
126
|
+
var Anchor;
|
127
|
+
return Anchor = (function() {
|
128
|
+
var documentYBoundary;
|
129
|
+
var getXBounds;
|
130
|
+
var getYBounds;
|
131
|
+
|
132
|
+
Anchor.prototype.defaults = {
|
133
|
+
classPrefix: "us-anchor",
|
134
|
+
openEvent: "click",
|
135
|
+
showClose: true,
|
136
|
+
isAjax: false
|
137
|
+
};
|
138
|
+
|
139
|
+
function Anchor(options) {
|
140
|
+
var ref1 = this.options = setOptions(options, this.defaults);
|
141
|
+
var ref2;
|
142
|
+
this.target = ref1.target;
|
143
|
+
this.classPrefix = ref1.classPrefix;
|
144
|
+
|
145
|
+
if (this.target === null) {
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
|
149
|
+
this._boundEvents = [];
|
150
|
+
this._closeTargets = [];
|
151
|
+
ref2 = this.create(),
|
152
|
+
this.anchor = ref2.anchor,
|
153
|
+
this.arrow = ref2.arrow,
|
154
|
+
this.content = ref2.content;
|
155
|
+
this.setEvents(this.anchor);
|
156
|
+
this.watchWindow();
|
157
|
+
}
|
158
|
+
|
159
|
+
Anchor.prototype.setEvents = function(anchor) {
|
160
|
+
var toggle = (function(_this) {
|
161
|
+
return function(event) {
|
162
|
+
event.preventDefault();
|
163
|
+
event.stopPropagation();
|
164
|
+
if (!_this.isOpen()) {
|
165
|
+
return _this.show(anchor);
|
166
|
+
} else {
|
167
|
+
return _this.hide(anchor);
|
168
|
+
}
|
169
|
+
};
|
170
|
+
})(this);
|
171
|
+
|
172
|
+
var hide = (function(_this) {
|
173
|
+
return function(event) {
|
174
|
+
var ref1;
|
175
|
+
if (!_this.isOpen()) {
|
176
|
+
return;
|
177
|
+
}
|
178
|
+
|
179
|
+
if (ref1 = event.target, indexOf.call(_this._closeTargets, ref1) >= 0) {
|
180
|
+
event.preventDefault();
|
181
|
+
event.stopPropagation();
|
182
|
+
_this.hide(anchor);
|
183
|
+
}
|
184
|
+
|
185
|
+
if (event.target === anchor || anchor.contains(event.target)) {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
|
189
|
+
if (event.target === _this.target || _this.target.contains(event.target)) {
|
190
|
+
return;
|
191
|
+
}
|
192
|
+
|
193
|
+
return _this.hide(anchor);
|
194
|
+
};
|
195
|
+
})(this);
|
196
|
+
|
197
|
+
this._on(this.target, this.options.openEvent, toggle);
|
198
|
+
|
199
|
+
return this._on(document, this.options.openEvent, hide);
|
200
|
+
};
|
201
|
+
|
202
|
+
Anchor.prototype._on = function(element, event, handler) {
|
203
|
+
this._boundEvents.push({
|
204
|
+
element: element,
|
205
|
+
event: event,
|
206
|
+
handler: handler
|
207
|
+
});
|
208
|
+
|
209
|
+
return element.addEventListener(event, handler, false);
|
210
|
+
};
|
211
|
+
|
212
|
+
Anchor.prototype.show = function(anchor) {
|
213
|
+
var ref1;
|
214
|
+
var ref2;
|
215
|
+
|
216
|
+
var fire = (function(_this) {
|
217
|
+
return function() {
|
218
|
+
_this.content.appendChild(_this.options.content);
|
219
|
+
|
220
|
+
if (!anchor.parentNode) {
|
221
|
+
document.body.appendChild(anchor);
|
222
|
+
}
|
223
|
+
|
224
|
+
addClass(anchor, _this.classPrefix + "--open");
|
225
|
+
setTimeout(function() {
|
226
|
+
return addClass(anchor, _this.classPrefix + "--after-open");
|
227
|
+
});
|
228
|
+
|
229
|
+
return _this.setPosition();
|
230
|
+
};
|
231
|
+
})(this);
|
232
|
+
|
233
|
+
if (this.options.isAjax) {
|
234
|
+
return (ref1 = this.options.onOpen) != null ? ref1.call().done(function() {
|
235
|
+
return fire();
|
236
|
+
}) : void 0;
|
237
|
+
} else {
|
238
|
+
fire();
|
239
|
+
return (ref2 = this.options.onOpen) != null ? ref2.call() : void 0;
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
Anchor.prototype.hide = function(anchor) {
|
244
|
+
var ref1;
|
245
|
+
removeClass(anchor, this.classPrefix + "--open");
|
246
|
+
removeClass(anchor, this.classPrefix + "--after-open");
|
247
|
+
return (ref1 = this.options.onClose) != null ? ref1.call() : void 0;
|
248
|
+
};
|
249
|
+
|
250
|
+
Anchor.prototype.isOpen = function() {
|
251
|
+
return hasClass(this.anchor, this.classPrefix + "--open");
|
252
|
+
};
|
253
|
+
|
254
|
+
Anchor.prototype.create = function() {
|
255
|
+
var anchor;
|
256
|
+
var anchorCss;
|
257
|
+
var closeButton;
|
258
|
+
var arrow = document.createElement("div");
|
259
|
+
var content = document.createElement("div");
|
260
|
+
var arrowInner = document.createElement("div");
|
261
|
+
|
262
|
+
addClass(content, this.classPrefix + "__content");
|
263
|
+
addClass(arrowInner, this.classPrefix + "__arrow-inner");
|
264
|
+
addClass(arrow, this.classPrefix + "__arrow");
|
265
|
+
arrow.appendChild(arrowInner);
|
266
|
+
content.appendChild(arrow);
|
267
|
+
|
268
|
+
if (this.options.showClose) {
|
269
|
+
closeButton = document.createElement("a");
|
270
|
+
closeButton.href = "#";
|
271
|
+
addClass(closeButton, this.classPrefix + "__close-button");
|
272
|
+
content.appendChild(closeButton);
|
273
|
+
this._closeTargets.push(closeButton);
|
274
|
+
}
|
275
|
+
|
276
|
+
anchor = document.createElement("div");
|
277
|
+
addClass(anchor, this.classPrefix);
|
278
|
+
anchorCss = anchor.style;
|
279
|
+
anchorCss.position = "absolute";
|
280
|
+
anchorCss.zIndex = "9999";
|
281
|
+
anchorCss.top = "0px";
|
282
|
+
anchorCss.left = "0px";
|
283
|
+
anchor.appendChild(content);
|
284
|
+
addClass(document.documentElement, this.classPrefix + "--ready");
|
285
|
+
|
286
|
+
return {
|
287
|
+
anchor: anchor,
|
288
|
+
arrow: arrow,
|
289
|
+
content: content
|
290
|
+
};
|
291
|
+
};
|
292
|
+
|
293
|
+
Anchor.prototype.setPosition = function() {
|
294
|
+
var style;
|
295
|
+
var bottomOffset;
|
296
|
+
var transformXOrigin;
|
297
|
+
var transformYOrigin;
|
298
|
+
var leftOffset = getXBounds(this.target, this.anchor, this.arrow);
|
299
|
+
var targetBounds = this.target.getBoundingClientRect();
|
300
|
+
|
301
|
+
if (documentYBoundary(targetBounds, this.anchor)) {
|
302
|
+
addClass(this.anchor, this.classPrefix + "--bottom");
|
303
|
+
removeClass(this.anchor, this.classPrefix + "--top");
|
304
|
+
transformYOrigin = "calc(100% + 12px)";
|
305
|
+
bottomOffset = getYBounds(this.target, this.anchor, this.arrow);
|
306
|
+
} else {
|
307
|
+
addClass(this.anchor, this.classPrefix + "--top");
|
308
|
+
removeClass(this.anchor, this.classPrefix + "--bottom");
|
309
|
+
transformYOrigin = "-12px";
|
310
|
+
bottomOffset = getYBounds(this.target, this.anchor, this.arrow);
|
311
|
+
}
|
312
|
+
|
313
|
+
style = "translateX(" + (Math.round(leftOffset)) + "px) ";
|
314
|
+
style += "translateY(" + (Math.round(bottomOffset)) + "px)";
|
315
|
+
|
316
|
+
if (transformKey !== "msTransform") {
|
317
|
+
style += " translateZ(0)";
|
318
|
+
}
|
319
|
+
|
320
|
+
this.anchor.style[transformKey] = style;
|
321
|
+
transformXOrigin = (targetBounds.left - this.anchor.getBoundingClientRect().left) + (this.target.offsetWidth / 2);
|
322
|
+
this.arrow.style.left = transformXOrigin + "px";
|
323
|
+
return this.content.style[transformKey + "Origin"] = transformXOrigin + "px " + transformYOrigin;
|
324
|
+
};
|
325
|
+
|
326
|
+
getXBounds = function(target, anchor, arrow) {
|
327
|
+
var targetBounds = target.getBoundingClientRect();
|
328
|
+
var calculatedWidth = targetBounds.left + (anchor.offsetWidth / 2) + (target.offsetWidth / 2);
|
329
|
+
var centerPoint = targetBounds.left + target.offsetWidth / 2;
|
330
|
+
|
331
|
+
if (document.body.offsetWidth < calculatedWidth) {
|
332
|
+
return document.body.offsetWidth - anchor.offsetWidth;
|
333
|
+
} else if (centerPoint - anchor.offsetWidth / 2 < 0) {
|
334
|
+
return 0;
|
335
|
+
} else {
|
336
|
+
return targetBounds.left - (anchor.offsetWidth / 2) + (target.offsetWidth / 2);
|
337
|
+
}
|
338
|
+
};
|
339
|
+
|
340
|
+
getYBounds = function(target, anchor, arrow) {
|
341
|
+
var targetBounds = target.getBoundingClientRect();
|
342
|
+
|
343
|
+
if (documentYBoundary(targetBounds, anchor)) {
|
344
|
+
return targetBounds.top - (anchor.offsetHeight - window.pageYOffset) + arrow.offsetHeight - target.offsetHeight;
|
345
|
+
} else {
|
346
|
+
return targetBounds.top + arrow.offsetHeight + target.offsetHeight + window.pageYOffset;
|
347
|
+
}
|
348
|
+
};
|
349
|
+
|
350
|
+
documentYBoundary = function(target, anchor) {
|
351
|
+
if (target.top < anchor.offsetHeight) {
|
352
|
+
return;
|
353
|
+
}
|
354
|
+
|
355
|
+
return (window.innerHeight - target.top) < anchor.offsetHeight;
|
356
|
+
};
|
357
|
+
|
358
|
+
Anchor.prototype.watchWindow = function() {
|
359
|
+
var event;
|
360
|
+
var i;
|
361
|
+
var len;
|
362
|
+
var ref1 = ["resize", "scroll", "touchmove"];
|
363
|
+
var results = [];
|
364
|
+
|
365
|
+
for (i = 0, len = ref1.length; i < len; i++) {
|
366
|
+
event = ref1[i];
|
367
|
+
results.push(window.addEventListener(event, (function(_this) {
|
368
|
+
return function(event) {
|
369
|
+
var lastFired;
|
370
|
+
var maxWait;
|
371
|
+
var now;
|
372
|
+
var throttle;
|
373
|
+
var timer;
|
374
|
+
|
375
|
+
if (!_this.isOpen()) {
|
376
|
+
return;
|
377
|
+
}
|
378
|
+
|
379
|
+
now = +(new Date);
|
380
|
+
throttle = 16;
|
381
|
+
maxWait = throttle * 3;
|
382
|
+
|
383
|
+
if (!timer) {
|
384
|
+
if (now - lastFired > maxWait) {
|
385
|
+
_this.setPosition();
|
386
|
+
lastFired = now;
|
387
|
+
}
|
388
|
+
|
389
|
+
return timer = setTimeout(function(o) {
|
390
|
+
timer = null;
|
391
|
+
lastFired = +(new Date);
|
392
|
+
return _this.setPosition();
|
393
|
+
}, throttle);
|
394
|
+
}
|
395
|
+
};
|
396
|
+
})(this), false));
|
397
|
+
}
|
398
|
+
|
399
|
+
return results;
|
400
|
+
};
|
401
|
+
|
402
|
+
return Anchor;
|
403
|
+
|
404
|
+
})();
|
405
|
+
};
|
406
|
+
|
407
|
+
window.Anchor = createContext();
|
408
|
+
|
409
|
+
window.Backdrop = (function() {
|
410
|
+
var holds = 0;
|
411
|
+
var backdrop = null;
|
412
|
+
var createBackdrop;
|
413
|
+
|
414
|
+
function Backdrop() {
|
415
|
+
backdrop = document.querySelector(".us-backdrop");
|
416
|
+
if (backdrop == null) {
|
417
|
+
backdrop = createBackdrop();
|
418
|
+
}
|
419
|
+
}
|
420
|
+
|
421
|
+
Backdrop.prototype.element = backdrop;
|
422
|
+
|
423
|
+
createBackdrop = function() {
|
424
|
+
backdrop = document.createElement("div");
|
425
|
+
Utils.addClass(backdrop, "us-backdrop");
|
426
|
+
return document.body.appendChild(backdrop);
|
427
|
+
};
|
428
|
+
|
429
|
+
Backdrop.prototype.retain = function() {
|
430
|
+
var onFrame;
|
431
|
+
holds++;
|
432
|
+
if (holds === 1) {
|
433
|
+
Utils.addClass(backdrop, "us-backdrop--visible");
|
434
|
+
onFrame = function() {
|
435
|
+
if (holds >= 1) {
|
436
|
+
return Utils.addClass(backdrop, "us-backdrop--active");
|
437
|
+
}
|
438
|
+
};
|
439
|
+
|
440
|
+
return Utils.requestAnimationFrame.call(window, onFrame);
|
441
|
+
}
|
442
|
+
};
|
443
|
+
|
444
|
+
Backdrop.prototype.release = function() {
|
445
|
+
var onFrame;
|
446
|
+
if (holds === 1) {
|
447
|
+
Utils.removeClass(backdrop, "us-backdrop--active");
|
448
|
+
onFrame = function() {
|
449
|
+
return setTimeout(function() {
|
450
|
+
if (holds === 0) {
|
451
|
+
return Utils.removeClass(backdrop, "us-backdrop--visible");
|
452
|
+
}
|
453
|
+
}, 300);
|
454
|
+
};
|
455
|
+
|
456
|
+
Utils.requestAnimationFrame.call(window, onFrame);
|
457
|
+
}
|
458
|
+
|
459
|
+
return holds = Math.max(0, holds - 1);
|
460
|
+
};
|
461
|
+
|
462
|
+
return Backdrop;
|
463
|
+
|
464
|
+
})();
|
465
|
+
|
466
|
+
window.Overlay = (function(Utils) {
|
467
|
+
var addClass = Utils.addClass;
|
468
|
+
var hasClass = Utils.hasClass;
|
469
|
+
var removeClass = Utils.removeClass;
|
470
|
+
var setOptions = Utils.setOptions;
|
471
|
+
var requestAnimationFrame = Utils.requestAnimationFrame;
|
472
|
+
|
473
|
+
var defaults = {
|
474
|
+
bodyActiveClass: "us-overlay--open",
|
475
|
+
activeClass: "us-overlay-parent--active",
|
476
|
+
visibleClass: "us-overlay-parent--visible",
|
477
|
+
overlay: $(".us-overlay-parent"),
|
478
|
+
openButton: ".js-open-overlay",
|
479
|
+
closeButton: ".js-close-overlay",
|
480
|
+
historyStatus: "#seedeal",
|
481
|
+
history: false,
|
482
|
+
preventDefault: true,
|
483
|
+
animationSpeed: 300
|
484
|
+
};
|
485
|
+
|
486
|
+
function Overlay(options) {
|
487
|
+
this.overlay = (this.options = setOptions(options, defaults)).overlay;
|
488
|
+
if ((this.overlay != null) && (typeof Backdrop !== "undefined" && Backdrop !== null)) {
|
489
|
+
this.backdrop = new Backdrop();
|
490
|
+
this.addEventListeners();
|
491
|
+
} else {
|
492
|
+
throw new Error("There's no overlay or you haven't included Backdrop");
|
493
|
+
}
|
494
|
+
}
|
495
|
+
|
496
|
+
Overlay.prototype.addEventListeners = function() {
|
497
|
+
$(this.options.openButton).on("click.open-overlay", (function(_this) {
|
498
|
+
return function(e) {
|
499
|
+
if (_this.options.preventDefault) {
|
500
|
+
e.preventDefault();
|
501
|
+
}
|
502
|
+
|
503
|
+
return _this.show(e);
|
504
|
+
};
|
505
|
+
})(this));
|
506
|
+
|
507
|
+
this.overlay.on("click.close-overlay", (function(_this) {
|
508
|
+
return function(e) {
|
509
|
+
var results = [];
|
510
|
+
var closeTargets = _this.overlay.find(_this.options.closeButton).toArray();
|
511
|
+
var targets = [_this.overlay[0]].concat(closeTargets);
|
512
|
+
|
513
|
+
for (var i = targets.length - 1; i >= 0; i--) {
|
514
|
+
var target = targets[i];
|
515
|
+
if (e.target === target) {
|
516
|
+
if (_this.options.preventDefault) {
|
517
|
+
e.preventDefault();
|
518
|
+
}
|
519
|
+
|
520
|
+
_this.hide(e);
|
521
|
+
break;
|
522
|
+
} else {
|
523
|
+
results.push(void 0);
|
524
|
+
}
|
525
|
+
};
|
526
|
+
|
527
|
+
return results;
|
528
|
+
};
|
529
|
+
})(this));
|
530
|
+
|
531
|
+
if (this.hasHistory()) {
|
532
|
+
return window.onpopstate = (function(_this) {
|
533
|
+
return function(e) {
|
534
|
+
if (_this.isOpen()) {
|
535
|
+
return _this.hide(e);
|
536
|
+
}
|
537
|
+
};
|
538
|
+
})(this);
|
539
|
+
}
|
540
|
+
};
|
541
|
+
|
542
|
+
Overlay.prototype.show = function(e) {
|
543
|
+
var onFrame;
|
544
|
+
var _this = this;
|
545
|
+
$(document.body).addClass(this.options.bodyActiveClass);
|
546
|
+
this.backdrop.retain();
|
547
|
+
addClass(this.overlay[0], this.options.visibleClass);
|
548
|
+
onFrame = function() {
|
549
|
+
addClass(_this.overlay[0], _this.options.activeClass);
|
550
|
+
return setTimeout(function() {
|
551
|
+
var base;
|
552
|
+
return typeof (base = _this.options).onOpen === "function" ? base.onOpen(e) : void 0;
|
553
|
+
}, _this.options.animationSpeed);
|
554
|
+
};
|
555
|
+
|
556
|
+
requestAnimationFrame.call(window, onFrame);
|
557
|
+
if (this.hasHistory()) {
|
558
|
+
return history.pushState("open", window.document.title, this.options.historyStatus);
|
559
|
+
}
|
560
|
+
};
|
561
|
+
|
562
|
+
Overlay.prototype.hide = function(e) {
|
563
|
+
var onFrame;
|
564
|
+
var _this = this;
|
565
|
+
$(document.body).removeClass(this.options.bodyActiveClass);
|
566
|
+
this.backdrop.release();
|
567
|
+
onFrame = function() {
|
568
|
+
removeClass(_this.overlay[0], _this.options.activeClass);
|
569
|
+
return setTimeout(function() {
|
570
|
+
var base;
|
571
|
+
removeClass(_this.overlay[0], _this.options.visibleClass);
|
572
|
+
return typeof (base = _this.options).onClose === "function" ? base.onClose(e) : void 0;
|
573
|
+
}, _this.options.animationSpeed);
|
574
|
+
};
|
575
|
+
|
576
|
+
requestAnimationFrame.call(window, onFrame);
|
577
|
+
if (this.hasHistory() && history.state === "open") return history.back();
|
578
|
+
};
|
579
|
+
|
580
|
+
Overlay.prototype.isOpen = function() {
|
581
|
+
return hasClass(this.overlay[0], this.options.activeClass);
|
582
|
+
};
|
583
|
+
|
584
|
+
Overlay.prototype.hasHistory = function() {
|
585
|
+
return this.options.history && window.history && window.history.pushState;
|
586
|
+
};
|
587
|
+
|
588
|
+
return Overlay;
|
589
|
+
|
590
|
+
})(this.Utils);
|
591
|
+
|
592
|
+
var setOptions = this.Utils.setOptions;
|
593
|
+
|
594
|
+
window.Tabs = (function(options) {
|
595
|
+
var Tabs;
|
596
|
+
return Tabs = (function() {
|
597
|
+
var getSelector;
|
598
|
+
|
599
|
+
Tabs.prototype.defaults = {
|
600
|
+
tabContainer: ".us-tabs",
|
601
|
+
tabLinks: ".us-tabs-nav-mainlink",
|
602
|
+
tabNav: ".us-tabs-nav",
|
603
|
+
changeUrls: true,
|
604
|
+
activeClass: "active",
|
605
|
+
collapsible: false,
|
606
|
+
autoScroll: true
|
607
|
+
};
|
608
|
+
|
609
|
+
function Tabs(options) {
|
610
|
+
var ref = this.options = setOptions(options, this.defaults);
|
611
|
+
var tabContainer = ref.tabContainer;
|
612
|
+
var tabLinks = ref.tabLinks;
|
613
|
+
|
614
|
+
this.tabs = $(tabContainer).find(tabLinks);
|
615
|
+
this.filter = this.tabs.data("target") ? "data-target" : "href";
|
616
|
+
this.init();
|
617
|
+
this.tabs.on("click.ustyle.tab", (function(_this) {
|
618
|
+
return function(e) {
|
619
|
+
var $target = $(e.currentTarget);
|
620
|
+
if (_this.isAccordion() && _this.options.collapsible && _this.isActive($target)) {
|
621
|
+
_this.collapse($target);
|
622
|
+
_this.hashClear();
|
623
|
+
} else {
|
624
|
+
_this.navigateTo($target);
|
625
|
+
_this.scrollToTab($target);
|
626
|
+
_this.hashChange($target);
|
627
|
+
}
|
628
|
+
|
629
|
+
return e.preventDefault();
|
630
|
+
};
|
631
|
+
})(this));
|
632
|
+
}
|
633
|
+
|
634
|
+
Tabs.prototype.init = function() {
|
635
|
+
var $activeTab = this.activeTab();
|
636
|
+
var $initialHash = this.tabFromHash();
|
637
|
+
|
638
|
+
if ($initialHash.length) {
|
639
|
+
return this.navigateTo($initialHash);
|
640
|
+
} else if ($activeTab.length) {
|
641
|
+
return this.navigateTo($activeTab);
|
642
|
+
} else if (!this.options.collapsible || !this.isAccordion()) {
|
643
|
+
return this.navigateTo(this.tabs.first());
|
644
|
+
}
|
645
|
+
};
|
646
|
+
|
647
|
+
Tabs.prototype.hashChange = function(target) {
|
648
|
+
if (!this.options.changeUrls) {
|
649
|
+
return;
|
650
|
+
}
|
651
|
+
|
652
|
+
return location.replace("#!" + (getSelector(target).replace(/#/, "")));
|
653
|
+
};
|
654
|
+
|
655
|
+
Tabs.prototype.hashClear = function() {
|
656
|
+
if (!this.options.changeUrls) {
|
657
|
+
return;
|
658
|
+
}
|
659
|
+
|
660
|
+
var url = window.location.pathname + window.location.search;
|
661
|
+
return typeof history.replaceState === "function" ? history.replaceState("", document.title, url) : void 0;
|
662
|
+
};
|
663
|
+
|
664
|
+
Tabs.prototype.navigateTo = function(target) {
|
665
|
+
var selector = getSelector(target);
|
666
|
+
var $selected = $(selector);
|
667
|
+
this.tabs.removeClass(this.options.activeClass).end();
|
668
|
+
this.tabs.filter("[" + this.filter + "='" + selector + "']").addClass(this.options.activeClass);
|
669
|
+
$selected.siblings("." + this.options.activeClass).removeClass(this.options.activeClass).end().addClass(this.options.activeClass);
|
670
|
+
return $selected.trigger("ustyle.tab.active");
|
671
|
+
};
|
672
|
+
|
673
|
+
Tabs.prototype.collapse = function(target) {
|
674
|
+
var $selected = $(getSelector(target));
|
675
|
+
this.tabs.removeClass(this.options.activeClass).end();
|
676
|
+
return $selected.removeClass(this.options.activeClass);
|
677
|
+
};
|
678
|
+
|
679
|
+
Tabs.prototype.scrollToTab = function(target) {
|
680
|
+
if (!(this.isAccordion() && this.options.autoScroll)) {
|
681
|
+
return;
|
682
|
+
}
|
683
|
+
|
684
|
+
var $selected = $(getSelector(target));
|
685
|
+
return $("html,body").scrollTop($selected.offset().top);
|
686
|
+
};
|
687
|
+
|
688
|
+
Tabs.prototype.activeTab = function() {
|
689
|
+
return this.tabs.filter("." + this.options.activeClass);
|
690
|
+
};
|
691
|
+
|
692
|
+
Tabs.prototype.tabFromHash = function() {
|
693
|
+
var tabId = location.hash.replace("!", "");
|
694
|
+
return this.tabs.filter("[" + this.filter + "='" + tabId + "']");
|
695
|
+
};
|
696
|
+
|
697
|
+
Tabs.prototype.isActive = function(target) {
|
698
|
+
return getSelector(target) === getSelector(this.activeTab());
|
699
|
+
};
|
700
|
+
|
701
|
+
Tabs.prototype.isAccordion = function() {
|
702
|
+
return !$(this.options.tabNav).is(":visible");
|
703
|
+
};
|
704
|
+
|
705
|
+
getSelector = function(clicked) {
|
706
|
+
return clicked.data("target") || clicked.attr("href");
|
707
|
+
};
|
708
|
+
|
709
|
+
return Tabs;
|
710
|
+
})();
|
711
|
+
})();
|
712
|
+
|
713
|
+
window.ClassToggler = (function() {
|
714
|
+
var defaults;
|
715
|
+
|
716
|
+
defaults = {
|
717
|
+
containerClass: null,
|
718
|
+
$target: null,
|
719
|
+
activeClass: "active",
|
720
|
+
inactiveClass: null,
|
721
|
+
toggleOn: "click"
|
722
|
+
};
|
723
|
+
|
724
|
+
function ClassToggler(options) {
|
725
|
+
this.options = Utils.setOptions(options, defaults);
|
726
|
+
if (this.options.$target) {
|
727
|
+
this.addEventListeners();
|
728
|
+
} else {
|
729
|
+
console.trace("ClassToggle", this.options);
|
730
|
+
}
|
731
|
+
}
|
732
|
+
|
733
|
+
ClassToggler.prototype.addEventListeners = function() {
|
734
|
+
return this.options.$target.on(this.options.toggleOn, (function(_this) {
|
735
|
+
return function(e) {
|
736
|
+
var $togglableElement = _this.options.containerClass ? $(e.target).closest(_this.options.containerClass) : $(e.delegateTarget);
|
737
|
+
if (_this.isActive($togglableElement)) {
|
738
|
+
return _this.hide($togglableElement, e);
|
739
|
+
} else {
|
740
|
+
return _this.show($togglableElement, e);
|
741
|
+
}
|
742
|
+
};
|
743
|
+
})(this));
|
744
|
+
};
|
745
|
+
|
746
|
+
ClassToggler.prototype.isActive = function($togglableElement) {
|
747
|
+
return $togglableElement.hasClass(this.options.activeClass);
|
748
|
+
};
|
749
|
+
|
750
|
+
ClassToggler.prototype.show = function($togglableElement, e) {
|
751
|
+
var base;
|
752
|
+
if (typeof (base = this.options).onShow === "function") {
|
753
|
+
base.onShow($togglableElement, e);
|
754
|
+
}
|
755
|
+
|
756
|
+
return $togglableElement.addClass(this.options.activeClass);
|
757
|
+
};
|
758
|
+
|
759
|
+
ClassToggler.prototype.hide = function($togglableElement, e) {
|
760
|
+
var base;
|
761
|
+
if (typeof (base = this.options).onHide === "function") {
|
762
|
+
base.onHide($togglableElement, e);
|
763
|
+
}
|
764
|
+
|
765
|
+
return $togglableElement.removeClass(this.options.activeClass);
|
766
|
+
};
|
767
|
+
|
768
|
+
return ClassToggler;
|
769
|
+
|
770
|
+
})();
|
771
|
+
|
772
|
+
window.RadioToggle = (function() {
|
773
|
+
var defaults = {
|
774
|
+
$target: $(".us-toggle")
|
775
|
+
};
|
776
|
+
|
777
|
+
function RadioToggle(options) {
|
778
|
+
this.options = Utils.setOptions(options, defaults);
|
779
|
+
if (this.options.$target) {
|
780
|
+
this.addEventListeners();
|
781
|
+
} else {
|
782
|
+
throw new Error("No target defined");
|
783
|
+
}
|
784
|
+
}
|
785
|
+
|
786
|
+
RadioToggle.prototype.addEventListeners = function() {
|
787
|
+
return this.options.$target.on("change", "input:radio", function(e) {
|
788
|
+
$("input[name='" + this.name + "']").removeClass("checked");
|
789
|
+
if (this.checked) {
|
790
|
+
$(this).addClass("checked");
|
791
|
+
}
|
792
|
+
|
793
|
+
return e.stopPropagation();
|
794
|
+
});
|
795
|
+
};
|
796
|
+
|
797
|
+
return RadioToggle;
|
798
|
+
|
799
|
+
})();
|