mui-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c80c8ba6c71e37c61fbfff418bb0e15a4f38080a
4
+ data.tar.gz: db8f8f2cc9d4cf4e10fa7450f3c9fadc375ba75d
5
+ SHA512:
6
+ metadata.gz: 7e0322aa493a201661e4c6761696a42d10b670d299cd963afc5846d2269a6608f66270c8c4c0f9afcc254c6114d1c0d7a3f72e2f0bebff533ed14de53c253c58
7
+ data.tar.gz: b0e2d92f010f69523716ea2ab46087ee45e9fbc29225a07cfe5d78e7be8200285045b8deac948d02c2686bae58232b4a6a7f8ff69a67b51e25070d904f0b57d6
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mui-rails.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Spring MC
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Mui::Rails
2
+
3
+ [Ratchet](https://github.com/twbs/ratchet) framework for Rails pipeline.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'mui-rails'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install mui-rails
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/mui-rails/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/lib/mui-rails.rb ADDED
@@ -0,0 +1 @@
1
+ require 'mui/rails'
data/lib/mui/rails.rb ADDED
@@ -0,0 +1,8 @@
1
+ require "mui/rails/version"
2
+
3
+ module Mui
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Mui
2
+ module Rails
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
data/mui-rails.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mui/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mui-rails"
8
+ spec.version = Mui::Rails::VERSION
9
+ spec.authors = ["Spring MC"]
10
+ spec.email = ["Heresy.MC@gmail.com"]
11
+ spec.summary = %q{Ratchet framework for Rails pipeline.}
12
+ spec.description = %q{Ratchet framework of version 2.0.2}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.5"
22
+ spec.add_development_dependency "rake"
23
+ end
Binary file
@@ -0,0 +1,61 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="ratchicons" horiz-adv-x="1000" >
7
+ <font-face font-family="ratchicons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="and-caret" unicode="&#xe800;" d="m313 225l375 0v376" horiz-adv-x="1000" />
10
+ <glyph glyph-name="up-nav" unicode="&#xe81f;" d="m65 146l81-83l354 372l353-372l81 83l-434 456l-435-456z" horiz-adv-x="1000" />
11
+ <glyph glyph-name="and-download" unicode="&#xe802;" d="m875 38h-750v62h750v-62z m-312 375v250h-125v-250h-125l187-250l188 250h-125z" horiz-adv-x="1000" />
12
+ <glyph glyph-name="and-left" unicode="&#xe803;" d="m306 349l325 373l67-59l-273-314l273-315l-67-59l-325 373l0 1z" horiz-adv-x="1000" />
13
+ <glyph glyph-name="and-more-vertical" unicode="&#xe804;" d="m406-25v188h188v-188h-188z m0 563h188v188h-188v-188z m188-281v188h-188v-188h188z" horiz-adv-x="1000" />
14
+ <glyph glyph-name="and-more" unicode="&#xe805;" d="m125 444h188v-187h-188v187z m563 0v-187h187v187h-187z m-281-187h187v187h-187v-187z" horiz-adv-x="1000" />
15
+ <glyph glyph-name="and-right" unicode="&#xe806;" d="m698 348l-325-373l-67 59l274 315l-274 314l68 59l324-373l0-1z" horiz-adv-x="1000" />
16
+ <glyph glyph-name="and-search" unicode="&#xe807;" d="m928 51l-167 167c-17 17-47 15-66-4l-3-3l-69 69c42 54 67 121 67 194c0 173-140 313-314 313s-313-140-313-313s140-314 313-314c71 0 137 24 190 64l69-70c-18-19-19-48-2-65l166-166c17-17 47-16 66 4l59 58c19 19 21 49 4 66z m-801 423c0 137 112 249 249 249s249-112 249-249s-111-249-249-249s-249 111-249 249z" horiz-adv-x="1000" />
17
+ <glyph glyph-name="and-share" unicode="&#xe808;" d="m728 215c-33 0-63-14-84-36l-263 153c1 6 2 12 2 18c0 6-1 12-2 18l263 152c21-23 51-37 84-37c62 0 113 51 113 113s-51 114-113 114s-114-51-114-114c0-7 1-14 2-21l-261-150c-21 23-51 38-85 38c-63 0-114-50-114-113s51-113 114-113c33 0 64 15 85 38l261-151c-1-7-2-14-2-22c0-62 51-113 114-113s113 51 113 113s-51 113-113 113z" horiz-adv-x="1000" />
18
+ <glyph glyph-name="and-up" unicode="&#xe809;" d="m500 548l374-325l-59-67l-315 273l-314-273l-59 67l373 325l0 0z" horiz-adv-x="1000" />
19
+ <glyph glyph-name="back" unicode="&#xe80a;" d="m500 174l-313 176l313 176m312-352l-312 176l312 176" horiz-adv-x="1000" />
20
+ <glyph glyph-name="down" unicode="&#xe820;" d="m941 479l-124 127l-317-315l-318 315l-124-127l442-441l441 441z" horiz-adv-x="1000" />
21
+ <glyph glyph-name="gear" unicode="&#xe821;" d="m820 274l118 40l0 72l-118 40c-8 34-22 67-40 97l55 111l-51 51l-111-55c-30 18-62 32-97 40l-39 118l-73 0l-40-118c-34-8-67-22-97-40l-111 55l-51-51l55-111c-18-30-32-62-40-97l-117-39l0-73l117-40c9-34 22-67 41-96l-56-111l52-52l111 56c29-19 62-32 96-40l40-119l73 0l39 119c35 8 67 21 97 40l111-56l51 52l-55 111c18 29 32 62 40 96z m-320-174c-139 0-251 112-251 251s112 250 251 250s250-112 250-250s-112-251-250-251z" horiz-adv-x="1000" />
22
+ <glyph glyph-name="left" unicode="&#xe822;" d="m628-91l127 123l-314 318l314 318l-127 124l-441-442l441-441z" horiz-adv-x="1000" />
23
+ <glyph glyph-name="list" unicode="&#xe823;" d="m1000 632h-750v-62l750-1v63z m0-314v63h-750v-63h750z m-750-187v-61h750v61h-750z m-250 406l125 1v125l-125 0v-126z m0-249h125v125h-125v-125z m0-250h125v125h-125v-125z" horiz-adv-x="1000" />
24
+ <glyph glyph-name="pages" unicode="&#xe824;" d="m63 601v-689h687l0 688l-687 1z m625-63v-563h-563v563h563z m-500 250v-125h62v62h625v-625l-62 0v-62h125v750h-750z" horiz-adv-x="1000" />
25
+ <glyph glyph-name="refresh" unicode="&#xe825;" d="m813 288c-28-145-161-250-313-250c-172 0-312 139-312 312c0 173 141 312 312 313v-98l221 129l-221 128v-95c0-2 0-2 0-2c-206 0-375-167-375-375s169-375 375-375c187 0 347 133 375 313h-62z" horiz-adv-x="1000" />
26
+ <glyph glyph-name="right" unicode="&#xe826;" d="m372 792l-127-124l314-318l-314-318l127-123l441 441l-441 442z" horiz-adv-x="1000" />
27
+ <glyph glyph-name="sound" unicode="&#xe827;" d="m825-22c-2 0-3 0-5 0l-16 7c0 0 0 0 0 1c-5 1-8 3-10 6c-1 3-1 7 1 12c1 1 22 40 43 101c20 58 44 147 44 244c0 98-24 186-44 243c-21 61-42 100-43 102c-4 11-2 15 8 21l17 8c2 1 5 2 7 2c7 0 12-5 17-16c1-2 2-4 4-8c10-19 32-63 52-125c25-78 37-156 37-232c0-94-24-182-44-240c-22-63-44-104-45-104l-1-2c-5-11-9-20-22-20c0 0 0 0 0 0z m-574 248c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z m474-124c-2 0-4 0-6 0l-16 8c0 0 0 0 0 0c-5 1-8 3-9 6c-2 3-2 7 0 12c1 1 16 26 30 64c14 37 30 94 30 157c0 65-16 121-30 157c-14 38-29 62-30 63c-4 11-2 15 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 5-11c17-31 61-115 61-229c0-63-16-120-30-156c-16-39-31-64-31-64c0 0 0 0 0 0l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z m-84 127c-2 0-4 0-6 0l-15 7c0 1 0 1 0 1c-5 1-8 3-9 6c-2 3-2 7 0 12c0 0 20 43 20 94c0 53-20 91-21 93c-4 11-2 16 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 4-9c10-19 23-45 23-104c0-33-21-91-22-93l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z" horiz-adv-x="1000" />
28
+ <glyph glyph-name="sound2" unicode="&#xe828;" d="m251 226c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z m474-124c-2 0-4 0-6 0l-16 8c0 0 0 0 0 0c-5 1-8 3-9 6c-2 3-2 7 0 12c1 1 16 26 30 64c14 37 30 94 30 157c0 65-16 121-30 157c-14 38-29 62-30 63c-4 11-2 15 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 5-11c17-31 61-115 61-229c0-63-16-120-30-156c-16-39-31-64-31-64c0 0 0 0 0 0l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z m-84 127c-2 0-4 0-6 0l-15 7c0 1 0 1 0 1c-5 1-8 3-9 6c-2 3-2 7 0 12c0 0 20 43 20 94c0 53-20 91-21 93c-4 11-2 16 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 4-9c10-19 23-45 23-104c0-33-21-91-22-93l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z" horiz-adv-x="1000" />
29
+ <glyph glyph-name="sound3" unicode="&#xe80b;" d="m251 226c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z m390 3c-2 0-4 0-6 0l-15 7c0 1 0 1 0 1c-5 1-8 3-9 6c-2 3-2 7 0 12c0 0 20 43 20 94c0 53-20 91-21 93c-4 11-2 16 9 21l15 8c3 1 5 2 8 2c6 0 12-5 17-16c1-3 3-6 4-9c10-19 23-45 23-104c0-33-21-91-22-93l-1-2c-6-11-10-20-22-20c0 0 0 0 0 0z" horiz-adv-x="1000" />
30
+ <glyph glyph-name="sound4" unicode="&#xe80c;" d="m251 226c0 0-1 0-1 0h-186v248h186c0 0 1 0 1 0l248 173v-595l-248 174z" horiz-adv-x="1000" />
31
+ <glyph glyph-name="up" unicode="&#xe80d;" d="m58 222l124-126l318 314l317-314l124 126l-441 441l-442-441z" horiz-adv-x="1000" />
32
+ <glyph glyph-name="bars" unicode="&#xe80e;" d="m875 632h-750v-62l750-1l0 63l0 0z m0-314v63h-750v-63h750z m-750-187v-61h750v61h-750z" horiz-adv-x="1000" />
33
+ <glyph glyph-name="caret" unicode="&#xe80f;" d="m438 475h-125l187-250l188 250h-125" horiz-adv-x="1000" />
34
+ <glyph glyph-name="and-down" unicode="&#xe801;" d="m500 156l-373 325l59 67l314-273l315 273l59-67l-374-325l0 0z" horiz-adv-x="1000" />
35
+ <glyph glyph-name="close" unicode="&#xe811;" d="m213 593l530-530l43 44l-529 530l-44-44l0 0z m530 44l-530-530l43-44l531 530l-44 44l0 0z" horiz-adv-x="1000" />
36
+ <glyph glyph-name="code" unicode="&#xe812;" d="m680 608l-74-72l184-186l-184-185l74-73l257 258l-257 258z m-360-516l74 72l-184 186l184 186l-74 72l-258-258l258-258z" horiz-adv-x="1000" />
37
+ <glyph glyph-name="compose" unicode="&#xe813;" d="m890 651l-405-404l-110-22l22 110l404 405l17-17l-405-404l56-56l404 405l17-17z m15 16l20 20c14 13 14 35 0 48l-40 40c-13 14-35 14-48 0l-20-20m-4-272v-445h-625v625h440l63 62h-566v-750h750v570l-62-62z" horiz-adv-x="1000" />
38
+ <glyph glyph-name="down-nav" unicode="&#xe814;" d="m934 537l-81 83l-354-372l-353 372l-81-83l435-455l434 455z" horiz-adv-x="1000" />
39
+ <glyph glyph-name="download" unicode="&#xe815;" d="m875 538h-187v-63h125v-500h-625v500h125v63h-188v-626h750v626z m-344-323v635l-62 0v-635l-115 112l-41-39l187-188l188 188l-42 40l-115-113z" horiz-adv-x="1000" />
40
+ <glyph glyph-name="edit" unicode="&#xe829;" d="m749 511l-404-404l-110-22l22 110l404 404l16-16l-404-405l56-55l404 404l16-16z m16 16l20 20c14 13 14 35 0 48l-40 40c-13 14-35 14-48 0l-20-20" horiz-adv-x="1000" />
41
+ <glyph glyph-name="forward" unicode="&#xe82a;" d="m500 526l313-176l-313-176m-312 352l312-176l-312-176" horiz-adv-x="1000" />
42
+ <glyph glyph-name="home" unicode="&#xe82b;" d="m939 350l-438 438l0 0l0 0l-438-438l48-47l54 54v-444h16h51h168h47h109h46h168h55h12v444l54-54l48 47z m-501-370v245h125v-245h-125z m332 444v-444h-161v291h-16h-30h-125h-34h-12v-291h-160v444h0l269 269l269-269h0z" horiz-adv-x="1000" />
43
+ <glyph glyph-name="info" unicode="&#xe82c;" d="m500 725c-207 0-375-168-375-375s168-375 375-375s375 168 375 375s-168 375-375 375z m63-625h-125v313h125v-313z m-63 375c-34 0-62 28-62 63c0 34 28 62 62 62s63-28 63-62c0-35-28-63-63-63z" horiz-adv-x="1000" />
44
+ <glyph glyph-name="left-nav" unicode="&#xe82d;" d="m663-84l83 81l-372 354l372 354l-83 81l-455-435l455-435z" horiz-adv-x="1000" />
45
+ <glyph glyph-name="more-vertical" unicode="&#xe82e;" d="m500 163c52 0 94-42 94-94c0-52-42-94-94-94s-94 42-94 94c0 52 42 94 94 94z m-94 468c0-51 42-93 94-93s94 42 94 93s-42 94-94 94s-94-42-94-94z m0-281c0-52 42-94 94-94s94 42 94 94s-42 94-94 94s-94-42-94-94z" horiz-adv-x="1000" />
46
+ <glyph glyph-name="more" unicode="&#xe82f;" d="m313 350c0-52-42-94-94-94s-94 42-94 94s42 94 94 94s94-42 94-94z m468 94c-52 0-93-42-93-94s41-94 93-94s94 42 94 94s-42 94-94 94z m-281 0c-52 0-94-42-94-94c0-52 42-94 94-94s94 42 94 94c0 52-42 94-94 94z" horiz-adv-x="1000" />
47
+ <glyph glyph-name="pause" unicode="&#xe830;" d="m438 37h-188v625h188v-625z m312 1h-187v625h187v-625z" horiz-adv-x="1000" />
48
+ <glyph glyph-name="person" unicode="&#xe832;" d="m501 847c-275 0-497-222-497-497s222-496 497-496s496 222 496 496s-222 497-496 497z m315-801c-25 11-53 26-79 28c-149 12-152 43-152 106c0 47 30 8 52 118c8 36 15 29 36 95c13 47-12 41-12 41s8 35 12 72c10 96-32 187-175 187c-64 0-94-27-133-57c-41-32-55-76-44-130c7-39 21-77 12-72c0 0-22 6-12-41c21-59 32-59 38-95c18-107 47-70 53-118c6-63-7-94-148-106c-25-2-55-16-79-27c-76 79-123 186-123 303c0 242 197 439 439 439s438-197 438-439c0-118-47-226-123-304z" horiz-adv-x="1000" />
49
+ <glyph glyph-name="play" unicode="&#xe816;" d="m250 663l567-313l-567-312" horiz-adv-x="1000" />
50
+ <glyph glyph-name="plus" unicode="&#xe817;" d="m469 725v-750h61l1 750l-62 0l0 0z m406-344h-750v-61l750-1l0 62l0 0z" horiz-adv-x="1000" />
51
+ <glyph glyph-name="right-nav" unicode="&#xe818;" d="m291 786l-83-81l372-354l-372-354l83-81l455 435l-455 435z" horiz-adv-x="1000" />
52
+ <glyph glyph-name="search" unicode="&#xe819;" d="m935-10l-279 279c39 54 62 120 62 191c0 181-147 328-328 328s-327-147-327-328s147-327 327-327c71 0 136 22 190 61l279-280l76 76z m-808 470c0 146 118 263 263 263s264-117 264-263s-118-263-264-263s-263 118-263 263z" horiz-adv-x="1000" />
53
+ <glyph glyph-name="share" unicode="&#xe81a;" d="m875 538h-187v-63h125v-500h-625v500h125v63h-188v-626h750v626z m-406 197v-572h62v572l115-112l42 40l-188 187l-187-187l41-41l115 113z" horiz-adv-x="1000" />
54
+ <glyph glyph-name="star-filled" unicode="&#xe81b;" d="m500 812l116-354l371 0l-300-218l115-353l-301 218l-300-218l114 353l-300 218l371 0l114 354z" horiz-adv-x="1000" />
55
+ <glyph glyph-name="star" unicode="&#xe81c;" d="m987 458l-372 0l-115 354l-114-354l-371 0l301-218l-115-353l301 218l299-218l-115 353l301 218z m-252-478l-234 174l-234-174l99 274l-252 171l295 0l92 290l91-290l296 0l-253-175l100-270z" horiz-adv-x="1000" />
56
+ <glyph glyph-name="stop" unicode="&#xe81d;" d="m812 37h-625v625h625v-625z" horiz-adv-x="1000" />
57
+ <glyph glyph-name="trash" unicode="&#xe81e;" d="m875 725h-250c0 22 0 50 0 62c0 18-15 34-34 34h-182c-19 0-34-16-34-34c0-14 0-41 0-62h-250v-63h69l57-715c0-19 16-34 34-34h432c19 0 34 15 34 34l58 715h66v63z m-459 33c0 14 11 25 24 25h120c13 0 24-11 24-25c0-6 0-20 0-33h-168c0 12 0 26 0 33z m287-757c0-15-11-26-26-26h-355c-14 0-25 11-25 26l-42 661h490l-42-661z m-273 37h-47l-39 562l46 0l40-562z m187 0l-46 0l39 562l47 0l-40-562z m-94 0h-47v562h47v-562z" horiz-adv-x="1000" />
58
+ <glyph glyph-name="check" unicode="&#xe810;" d="m857 537l-81 83l-354-372l-135 128l-81-83l216-211l435 455z" horiz-adv-x="1000" />
59
+ </font>
60
+ </defs>
61
+ </svg>
Binary file
Binary file
@@ -0,0 +1,964 @@
1
+ /*!
2
+ * =====================================================
3
+ * Ratchet v2.0.2 (http://goratchet.com)
4
+ * Copyright 2014 Connor Sears
5
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
6
+ *
7
+ * v2.0.2 designed by @connors.
8
+ * =====================================================
9
+ */
10
+ /* ========================================================================
11
+ * Ratchet: modals.js v2.0.2
12
+ * http://goratchet.com/components#modals
13
+ * ========================================================================
14
+ * Copyright 2014 Connor Sears
15
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
16
+ * ======================================================================== */
17
+
18
+ !(function () {
19
+ 'use strict';
20
+
21
+ var findModals = function (target) {
22
+ var i;
23
+ var modals = document.querySelectorAll('a');
24
+
25
+ for (; target && target !== document; target = target.parentNode) {
26
+ for (i = modals.length; i--;) {
27
+ if (modals[i] === target) {
28
+ return target;
29
+ }
30
+ }
31
+ }
32
+ };
33
+
34
+ var getModal = function (event) {
35
+ var modalToggle = findModals(event.target);
36
+ if (modalToggle && modalToggle.hash) {
37
+ return document.querySelector(modalToggle.hash);
38
+ }
39
+ };
40
+
41
+ window.addEventListener('touchend', function (event) {
42
+ var modal = getModal(event);
43
+ if (modal) {
44
+ if (modal && modal.classList.contains('modal')) {
45
+ modal.classList.toggle('active');
46
+ }
47
+ event.preventDefault(); // prevents rewriting url (apps can still use hash values in url)
48
+ }
49
+ });
50
+ }());
51
+
52
+ /* ========================================================================
53
+ * Ratchet: popovers.js v2.0.2
54
+ * http://goratchet.com/components#popovers
55
+ * ========================================================================
56
+ * Copyright 2014 Connor Sears
57
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
58
+ * ======================================================================== */
59
+
60
+ !(function () {
61
+ 'use strict';
62
+
63
+ var popover;
64
+
65
+ var findPopovers = function (target) {
66
+ var i;
67
+ var popovers = document.querySelectorAll('a');
68
+
69
+ for (; target && target !== document; target = target.parentNode) {
70
+ for (i = popovers.length; i--;) {
71
+ if (popovers[i] === target) {
72
+ return target;
73
+ }
74
+ }
75
+ }
76
+ };
77
+
78
+ var onPopoverHidden = function () {
79
+ popover.style.display = 'none';
80
+ popover.removeEventListener('webkitTransitionEnd', onPopoverHidden);
81
+ };
82
+
83
+ var backdrop = (function () {
84
+ var element = document.createElement('div');
85
+
86
+ element.classList.add('backdrop');
87
+
88
+ element.addEventListener('touchend', function () {
89
+ popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
90
+ popover.classList.remove('visible');
91
+ popover.parentNode.removeChild(backdrop);
92
+ });
93
+
94
+ return element;
95
+ }());
96
+
97
+ var getPopover = function (e) {
98
+ var anchor = findPopovers(e.target);
99
+
100
+ if (!anchor || !anchor.hash || (anchor.hash.indexOf('/') > 0)) {
101
+ return;
102
+ }
103
+
104
+ try {
105
+ popover = document.querySelector(anchor.hash);
106
+ }
107
+ catch (error) {
108
+ popover = null;
109
+ }
110
+
111
+ if (popover === null) {
112
+ return;
113
+ }
114
+
115
+ if (!popover || !popover.classList.contains('popover')) {
116
+ return;
117
+ }
118
+
119
+ return popover;
120
+ };
121
+
122
+ var showHidePopover = function (e) {
123
+ var popover = getPopover(e);
124
+
125
+ if (!popover) {
126
+ return;
127
+ }
128
+
129
+ popover.style.display = 'block';
130
+ popover.offsetHeight;
131
+ popover.classList.add('visible');
132
+
133
+ popover.parentNode.appendChild(backdrop);
134
+ };
135
+
136
+ window.addEventListener('touchend', showHidePopover);
137
+
138
+ }());
139
+
140
+ /* ========================================================================
141
+ * Ratchet: push.js v2.0.2
142
+ * http://goratchet.com/components#push
143
+ * ========================================================================
144
+ * inspired by @defunkt's jquery.pjax.js
145
+ * Copyright 2014 Connor Sears
146
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
147
+ * ======================================================================== */
148
+
149
+ /* global _gaq: true */
150
+
151
+ !(function () {
152
+ 'use strict';
153
+
154
+ var noop = function () {};
155
+
156
+
157
+ // Pushstate caching
158
+ // ==================
159
+
160
+ var isScrolling;
161
+ var maxCacheLength = 20;
162
+ var cacheMapping = sessionStorage;
163
+ var domCache = {};
164
+ // Change these to unquoted camelcase in the next major version bump
165
+ var transitionMap = {
166
+ 'slide-in' : 'slide-out',
167
+ 'slide-out' : 'slide-in',
168
+ fade : 'fade'
169
+ };
170
+
171
+ var bars = {
172
+ bartab : '.bar-tab',
173
+ barnav : '.bar-nav',
174
+ barfooter : '.bar-footer',
175
+ barheadersecondary : '.bar-header-secondary'
176
+ };
177
+
178
+ var cacheReplace = function (data, updates) {
179
+ PUSH.id = data.id;
180
+ if (updates) {
181
+ data = getCached(data.id);
182
+ }
183
+ cacheMapping[data.id] = JSON.stringify(data);
184
+ window.history.replaceState(data.id, data.title, data.url);
185
+ };
186
+
187
+ var cachePush = function () {
188
+ var id = PUSH.id;
189
+
190
+ var cacheForwardStack = JSON.parse(cacheMapping.cacheForwardStack || '[]');
191
+ var cacheBackStack = JSON.parse(cacheMapping.cacheBackStack || '[]');
192
+
193
+ cacheBackStack.push(id);
194
+
195
+ while (cacheForwardStack.length) {
196
+ delete cacheMapping[cacheForwardStack.shift()];
197
+ }
198
+ while (cacheBackStack.length > maxCacheLength) {
199
+ delete cacheMapping[cacheBackStack.shift()];
200
+ }
201
+
202
+ window.history.pushState(null, '', getCached(PUSH.id).url);
203
+
204
+ cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack);
205
+ cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack);
206
+ };
207
+
208
+ var cachePop = function (id, direction) {
209
+ var forward = direction === 'forward';
210
+ var cacheForwardStack = JSON.parse(cacheMapping.cacheForwardStack || '[]');
211
+ var cacheBackStack = JSON.parse(cacheMapping.cacheBackStack || '[]');
212
+ var pushStack = forward ? cacheBackStack : cacheForwardStack;
213
+ var popStack = forward ? cacheForwardStack : cacheBackStack;
214
+
215
+ if (PUSH.id) {
216
+ pushStack.push(PUSH.id);
217
+ }
218
+ popStack.pop();
219
+
220
+ cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack);
221
+ cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack);
222
+ };
223
+
224
+ var getCached = function (id) {
225
+ return JSON.parse(cacheMapping[id] || null) || {};
226
+ };
227
+
228
+ var getTarget = function (e) {
229
+ var target = findTarget(e.target);
230
+
231
+ if (!target ||
232
+ e.which > 1 ||
233
+ e.metaKey ||
234
+ e.ctrlKey ||
235
+ isScrolling ||
236
+ location.protocol !== target.protocol ||
237
+ location.host !== target.host ||
238
+ !target.hash && /#/.test(target.href) ||
239
+ target.hash && target.href.replace(target.hash, '') === location.href.replace(location.hash, '') ||
240
+ target.getAttribute('data-ignore') === 'push') { return; }
241
+
242
+ return target;
243
+ };
244
+
245
+
246
+ // Main event handlers (touchend, popstate)
247
+ // ==========================================
248
+
249
+ var touchend = function (e) {
250
+ var target = getTarget(e);
251
+
252
+ if (!target) {
253
+ return;
254
+ }
255
+
256
+ e.preventDefault();
257
+
258
+ PUSH({
259
+ url : target.href,
260
+ hash : target.hash,
261
+ timeout : target.getAttribute('data-timeout'),
262
+ transition : target.getAttribute('data-transition')
263
+ });
264
+ };
265
+
266
+ var popstate = function (e) {
267
+ var key;
268
+ var barElement;
269
+ var activeObj;
270
+ var activeDom;
271
+ var direction;
272
+ var transition;
273
+ var transitionFrom;
274
+ var transitionFromObj;
275
+ var id = e.state;
276
+
277
+ if (!id || !cacheMapping[id]) {
278
+ return;
279
+ }
280
+
281
+ direction = PUSH.id < id ? 'forward' : 'back';
282
+
283
+ cachePop(id, direction);
284
+
285
+ activeObj = getCached(id);
286
+ activeDom = domCache[id];
287
+
288
+ if (activeObj.title) {
289
+ document.title = activeObj.title;
290
+ }
291
+
292
+ if (direction === 'back') {
293
+ transitionFrom = JSON.parse(direction === 'back' ? cacheMapping.cacheForwardStack : cacheMapping.cacheBackStack);
294
+ transitionFromObj = getCached(transitionFrom[transitionFrom.length - 1]);
295
+ } else {
296
+ transitionFromObj = activeObj;
297
+ }
298
+
299
+ if (direction === 'back' && !transitionFromObj.id) {
300
+ return (PUSH.id = id);
301
+ }
302
+
303
+ transition = direction === 'back' ? transitionMap[transitionFromObj.transition] : transitionFromObj.transition;
304
+
305
+ if (!activeDom) {
306
+ return PUSH({
307
+ id : activeObj.id,
308
+ url : activeObj.url,
309
+ title : activeObj.title,
310
+ timeout : activeObj.timeout,
311
+ transition : transition,
312
+ ignorePush : true
313
+ });
314
+ }
315
+
316
+ if (transitionFromObj.transition) {
317
+ activeObj = extendWithDom(activeObj, '.content', activeDom.cloneNode(true));
318
+ for (key in bars) {
319
+ if (bars.hasOwnProperty(key)) {
320
+ barElement = document.querySelector(bars[key]);
321
+ if (activeObj[key]) {
322
+ swapContent(activeObj[key], barElement);
323
+ } else if (barElement) {
324
+ barElement.parentNode.removeChild(barElement);
325
+ }
326
+ }
327
+ }
328
+ }
329
+
330
+ swapContent(
331
+ (activeObj.contents || activeDom).cloneNode(true),
332
+ document.querySelector('.content'),
333
+ transition, function() {
334
+ triggerStateChange();
335
+ }
336
+ );
337
+
338
+ PUSH.id = id;
339
+
340
+ document.body.offsetHeight; // force reflow to prevent scroll
341
+ };
342
+
343
+
344
+ // Core PUSH functionality
345
+ // =======================
346
+
347
+ var PUSH = function (options) {
348
+ var key;
349
+ var xhr = PUSH.xhr;
350
+
351
+ options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
352
+
353
+ for (key in bars) {
354
+ if (bars.hasOwnProperty(key)) {
355
+ options[key] = options[key] || document.querySelector(bars[key]);
356
+ }
357
+ }
358
+
359
+ if (xhr && xhr.readyState < 4) {
360
+ xhr.onreadystatechange = noop;
361
+ xhr.abort();
362
+ }
363
+
364
+ xhr = new XMLHttpRequest();
365
+ xhr.open('GET', options.url, true);
366
+ xhr.setRequestHeader('X-PUSH', 'true');
367
+
368
+ xhr.onreadystatechange = function () {
369
+ if (options._timeout) {
370
+ clearTimeout(options._timeout);
371
+ }
372
+ if (xhr.readyState === 4) {
373
+ xhr.status === 200 ? success(xhr, options) : failure(options.url);
374
+ }
375
+ };
376
+
377
+ if (!PUSH.id) {
378
+ cacheReplace({
379
+ id : +new Date(),
380
+ url : window.location.href,
381
+ title : document.title,
382
+ timeout : options.timeout,
383
+ transition : options.transition
384
+ });
385
+ }
386
+
387
+ cacheCurrentContent();
388
+
389
+ if (options.timeout) {
390
+ options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout);
391
+ }
392
+
393
+ xhr.send();
394
+
395
+ if (xhr.readyState && !options.ignorePush) {
396
+ cachePush();
397
+ }
398
+ };
399
+
400
+ function cacheCurrentContent() {
401
+ domCache[PUSH.id] = document.body.cloneNode(true);
402
+ }
403
+
404
+
405
+ // Main XHR handlers
406
+ // =================
407
+
408
+ var success = function (xhr, options) {
409
+ var key;
410
+ var barElement;
411
+ var data = parseXHR(xhr, options);
412
+
413
+ if (!data.contents) {
414
+ return locationReplace(options.url);
415
+ }
416
+
417
+ if (data.title) {
418
+ document.title = data.title;
419
+ }
420
+
421
+ if (options.transition) {
422
+ for (key in bars) {
423
+ if (bars.hasOwnProperty(key)) {
424
+ barElement = document.querySelector(bars[key]);
425
+ if (data[key]) {
426
+ swapContent(data[key], barElement);
427
+ } else if (barElement) {
428
+ barElement.parentNode.removeChild(barElement);
429
+ }
430
+ }
431
+ }
432
+ }
433
+
434
+ swapContent(data.contents, options.container, options.transition, function () {
435
+ cacheReplace({
436
+ id : options.id || +new Date(),
437
+ url : data.url,
438
+ title : data.title,
439
+ timeout : options.timeout,
440
+ transition : options.transition
441
+ }, options.id);
442
+ triggerStateChange();
443
+ });
444
+
445
+ if (!options.ignorePush && window._gaq) {
446
+ _gaq.push(['_trackPageview']); // google analytics
447
+ }
448
+ if (!options.hash) {
449
+ return;
450
+ }
451
+ };
452
+
453
+ var failure = function (url) {
454
+ throw new Error('Could not get: ' + url);
455
+ };
456
+
457
+
458
+ // PUSH helpers
459
+ // ============
460
+
461
+ var swapContent = function (swap, container, transition, complete) {
462
+ var enter;
463
+ var containerDirection;
464
+ var swapDirection;
465
+
466
+ if (!transition) {
467
+ if (container) {
468
+ container.innerHTML = swap.innerHTML;
469
+ } else if (swap.classList.contains('content')) {
470
+ document.body.appendChild(swap);
471
+ } else {
472
+ document.body.insertBefore(swap, document.querySelector('.content'));
473
+ }
474
+ } else {
475
+ enter = /in$/.test(transition);
476
+
477
+ if (transition === 'fade') {
478
+ container.classList.add('in');
479
+ container.classList.add('fade');
480
+ swap.classList.add('fade');
481
+ }
482
+
483
+ if (/slide/.test(transition)) {
484
+ swap.classList.add('sliding-in', enter ? 'right' : 'left');
485
+ swap.classList.add('sliding');
486
+ container.classList.add('sliding');
487
+ }
488
+
489
+ container.parentNode.insertBefore(swap, container);
490
+ }
491
+
492
+ if (!transition) {
493
+ complete && complete();
494
+ }
495
+
496
+ if (transition === 'fade') {
497
+ container.offsetWidth; // force reflow
498
+ container.classList.remove('in');
499
+ var fadeContainerEnd = function () {
500
+ container.removeEventListener('webkitTransitionEnd', fadeContainerEnd);
501
+ swap.classList.add('in');
502
+ swap.addEventListener('webkitTransitionEnd', fadeSwapEnd);
503
+ };
504
+ var fadeSwapEnd = function () {
505
+ swap.removeEventListener('webkitTransitionEnd', fadeSwapEnd);
506
+ container.parentNode.removeChild(container);
507
+ swap.classList.remove('fade');
508
+ swap.classList.remove('in');
509
+ complete && complete();
510
+ };
511
+ container.addEventListener('webkitTransitionEnd', fadeContainerEnd);
512
+
513
+ }
514
+
515
+ if (/slide/.test(transition)) {
516
+ var slideEnd = function () {
517
+ swap.removeEventListener('webkitTransitionEnd', slideEnd);
518
+ swap.classList.remove('sliding', 'sliding-in');
519
+ swap.classList.remove(swapDirection);
520
+ container.parentNode.removeChild(container);
521
+ complete && complete();
522
+ };
523
+
524
+ container.offsetWidth; // force reflow
525
+ swapDirection = enter ? 'right' : 'left';
526
+ containerDirection = enter ? 'left' : 'right';
527
+ container.classList.add(containerDirection);
528
+ swap.classList.remove(swapDirection);
529
+ swap.addEventListener('webkitTransitionEnd', slideEnd);
530
+ }
531
+ };
532
+
533
+ var triggerStateChange = function () {
534
+ var e = new CustomEvent('push', {
535
+ detail: { state: getCached(PUSH.id) },
536
+ bubbles: true,
537
+ cancelable: true
538
+ });
539
+
540
+ window.dispatchEvent(e);
541
+ };
542
+
543
+ var findTarget = function (target) {
544
+ var i;
545
+ var toggles = document.querySelectorAll('a');
546
+
547
+ for (; target && target !== document; target = target.parentNode) {
548
+ for (i = toggles.length; i--;) {
549
+ if (toggles[i] === target) {
550
+ return target;
551
+ }
552
+ }
553
+ }
554
+ };
555
+
556
+ var locationReplace = function (url) {
557
+ window.history.replaceState(null, '', '#');
558
+ window.location.replace(url);
559
+ };
560
+
561
+ var extendWithDom = function (obj, fragment, dom) {
562
+ var i;
563
+ var result = {};
564
+
565
+ for (i in obj) {
566
+ if (obj.hasOwnProperty(i)) {
567
+ result[i] = obj[i];
568
+ }
569
+ }
570
+
571
+ Object.keys(bars).forEach(function (key) {
572
+ var el = dom.querySelector(bars[key]);
573
+ if (el) {
574
+ el.parentNode.removeChild(el);
575
+ }
576
+ result[key] = el;
577
+ });
578
+
579
+ result.contents = dom.querySelector(fragment);
580
+
581
+ return result;
582
+ };
583
+
584
+ var parseXHR = function (xhr, options) {
585
+ var head;
586
+ var body;
587
+ var data = {};
588
+ var responseText = xhr.responseText;
589
+
590
+ data.url = options.url;
591
+
592
+ if (!responseText) {
593
+ return data;
594
+ }
595
+
596
+ if (/<html/i.test(responseText)) {
597
+ head = document.createElement('div');
598
+ body = document.createElement('div');
599
+ head.innerHTML = responseText.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0];
600
+ body.innerHTML = responseText.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0];
601
+ } else {
602
+ head = body = document.createElement('div');
603
+ head.innerHTML = responseText;
604
+ }
605
+
606
+ data.title = head.querySelector('title');
607
+ var text = 'innerText' in data.title ? 'innerText' : 'textContent';
608
+ data.title = data.title && data.title[text].trim();
609
+
610
+ if (options.transition) {
611
+ data = extendWithDom(data, '.content', body);
612
+ } else {
613
+ data.contents = body;
614
+ }
615
+
616
+ return data;
617
+ };
618
+
619
+
620
+ // Attach PUSH event handlers
621
+ // ==========================
622
+
623
+ window.addEventListener('touchstart', function () { isScrolling = false; });
624
+ window.addEventListener('touchmove', function () { isScrolling = true; });
625
+ window.addEventListener('touchend', touchend);
626
+ window.addEventListener('click', function (e) { if (getTarget(e)) {e.preventDefault();} });
627
+ window.addEventListener('popstate', popstate);
628
+ window.PUSH = PUSH;
629
+
630
+ }());
631
+
632
+ /* ========================================================================
633
+ * Ratchet: segmented-controllers.js v2.0.2
634
+ * http://goratchet.com/components#segmentedControls
635
+ * ========================================================================
636
+ * Copyright 2014 Connor Sears
637
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
638
+ * ======================================================================== */
639
+
640
+ !(function () {
641
+ 'use strict';
642
+
643
+ var getTarget = function (target) {
644
+ var i;
645
+ var segmentedControls = document.querySelectorAll('.segmented-control .control-item');
646
+
647
+ for (; target && target !== document; target = target.parentNode) {
648
+ for (i = segmentedControls.length; i--;) {
649
+ if (segmentedControls[i] === target) {
650
+ return target;
651
+ }
652
+ }
653
+ }
654
+ };
655
+
656
+ window.addEventListener('touchend', function (e) {
657
+ var activeTab;
658
+ var activeBodies;
659
+ var targetBody;
660
+ var targetTab = getTarget(e.target);
661
+ var className = 'active';
662
+ var classSelector = '.' + className;
663
+
664
+ if (!targetTab) {
665
+ return;
666
+ }
667
+
668
+ activeTab = targetTab.parentNode.querySelector(classSelector);
669
+
670
+ if (activeTab) {
671
+ activeTab.classList.remove(className);
672
+ }
673
+
674
+ targetTab.classList.add(className);
675
+
676
+ if (!targetTab.hash) {
677
+ return;
678
+ }
679
+
680
+ targetBody = document.querySelector(targetTab.hash);
681
+
682
+ if (!targetBody) {
683
+ return;
684
+ }
685
+
686
+ activeBodies = targetBody.parentNode.querySelectorAll(classSelector);
687
+
688
+ for (var i = 0; i < activeBodies.length; i++) {
689
+ activeBodies[i].classList.remove(className);
690
+ }
691
+
692
+ targetBody.classList.add(className);
693
+ });
694
+
695
+ window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} });
696
+ }());
697
+
698
+ /* ========================================================================
699
+ * Ratchet: sliders.js v2.0.2
700
+ * http://goratchet.com/components#sliders
701
+ * ========================================================================
702
+ Adapted from Brad Birdsall's swipe
703
+ * Copyright 2014 Connor Sears
704
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
705
+ * ======================================================================== */
706
+
707
+ !(function () {
708
+ 'use strict';
709
+
710
+ var pageX;
711
+ var pageY;
712
+ var slider;
713
+ var deltaX;
714
+ var deltaY;
715
+ var offsetX;
716
+ var lastSlide;
717
+ var startTime;
718
+ var resistance;
719
+ var sliderWidth;
720
+ var slideNumber;
721
+ var isScrolling;
722
+ var scrollableArea;
723
+ var startedMoving;
724
+
725
+ var getSlider = function (target) {
726
+ var i;
727
+ var sliders = document.querySelectorAll('.slider > .slide-group');
728
+
729
+ for (; target && target !== document; target = target.parentNode) {
730
+ for (i = sliders.length; i--;) {
731
+ if (sliders[i] === target) {
732
+ return target;
733
+ }
734
+ }
735
+ }
736
+ };
737
+
738
+ var getScroll = function () {
739
+ if ('webkitTransform' in slider.style) {
740
+ var translate3d = slider.style.webkitTransform.match(/translate3d\(([^,]*)/);
741
+ var ret = translate3d ? translate3d[1] : 0;
742
+ return parseInt(ret, 10);
743
+ }
744
+ };
745
+
746
+ var setSlideNumber = function (offset) {
747
+ var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round';
748
+ slideNumber = Math[round](getScroll() / (scrollableArea / slider.children.length));
749
+ slideNumber += offset;
750
+ slideNumber = Math.min(slideNumber, 0);
751
+ slideNumber = Math.max(-(slider.children.length - 1), slideNumber);
752
+ };
753
+
754
+ var onTouchStart = function (e) {
755
+ slider = getSlider(e.target);
756
+
757
+ if (!slider) {
758
+ return;
759
+ }
760
+
761
+ var firstItem = slider.querySelector('.slide');
762
+
763
+ scrollableArea = firstItem.offsetWidth * slider.children.length;
764
+ isScrolling = undefined;
765
+ sliderWidth = slider.offsetWidth;
766
+ resistance = 1;
767
+ lastSlide = -(slider.children.length - 1);
768
+ startTime = +new Date();
769
+ pageX = e.touches[0].pageX;
770
+ pageY = e.touches[0].pageY;
771
+ deltaX = 0;
772
+ deltaY = 0;
773
+
774
+ setSlideNumber(0);
775
+
776
+ slider.style['-webkit-transition-duration'] = 0;
777
+ };
778
+
779
+ var onTouchMove = function (e) {
780
+ if (e.touches.length > 1 || !slider) {
781
+ return; // Exit if a pinch || no slider
782
+ }
783
+
784
+ // adjust the starting position if we just started to avoid jumpage
785
+ if (!startedMoving) {
786
+ pageX += (e.touches[0].pageX - pageX) - 1;
787
+ }
788
+
789
+ deltaX = e.touches[0].pageX - pageX;
790
+ deltaY = e.touches[0].pageY - pageY;
791
+ pageX = e.touches[0].pageX;
792
+ pageY = e.touches[0].pageY;
793
+
794
+ if (typeof isScrolling === 'undefined' && startedMoving) {
795
+ isScrolling = Math.abs(deltaY) > Math.abs(deltaX);
796
+ }
797
+
798
+ if (isScrolling) {
799
+ return;
800
+ }
801
+
802
+ offsetX = (deltaX / resistance) + getScroll();
803
+
804
+ e.preventDefault();
805
+
806
+ resistance = slideNumber === 0 && deltaX > 0 ? (pageX / sliderWidth) + 1.25 :
807
+ slideNumber === lastSlide && deltaX < 0 ? (Math.abs(pageX) / sliderWidth) + 1.25 : 1;
808
+
809
+ slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)';
810
+
811
+ // started moving
812
+ startedMoving = true;
813
+ };
814
+
815
+ var onTouchEnd = function (e) {
816
+ if (!slider || isScrolling) {
817
+ return;
818
+ }
819
+
820
+ // we're done moving
821
+ startedMoving = false;
822
+
823
+ setSlideNumber(
824
+ (+new Date()) - startTime < 1000 && Math.abs(deltaX) > 15 ? (deltaX < 0 ? -1 : 1) : 0
825
+ );
826
+
827
+ offsetX = slideNumber * sliderWidth;
828
+
829
+ slider.style['-webkit-transition-duration'] = '.2s';
830
+ slider.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)';
831
+
832
+ e = new CustomEvent('slide', {
833
+ detail: { slideNumber: Math.abs(slideNumber) },
834
+ bubbles: true,
835
+ cancelable: true
836
+ });
837
+
838
+ slider.parentNode.dispatchEvent(e);
839
+ };
840
+
841
+ window.addEventListener('touchstart', onTouchStart);
842
+ window.addEventListener('touchmove', onTouchMove);
843
+ window.addEventListener('touchend', onTouchEnd);
844
+
845
+ }());
846
+
847
+ /* ========================================================================
848
+ * Ratchet: toggles.js v2.0.2
849
+ * http://goratchet.com/components#toggles
850
+ * ========================================================================
851
+ Adapted from Brad Birdsall's swipe
852
+ * Copyright 2014 Connor Sears
853
+ * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
854
+ * ======================================================================== */
855
+
856
+ !(function () {
857
+ 'use strict';
858
+
859
+ var start = {};
860
+ var touchMove = false;
861
+ var distanceX = false;
862
+ var toggle = false;
863
+
864
+ var findToggle = function (target) {
865
+ var i;
866
+ var toggles = document.querySelectorAll('.toggle');
867
+
868
+ for (; target && target !== document; target = target.parentNode) {
869
+ for (i = toggles.length; i--;) {
870
+ if (toggles[i] === target) {
871
+ return target;
872
+ }
873
+ }
874
+ }
875
+ };
876
+
877
+ window.addEventListener('touchstart', function (e) {
878
+ e = e.originalEvent || e;
879
+
880
+ toggle = findToggle(e.target);
881
+
882
+ if (!toggle) {
883
+ return;
884
+ }
885
+
886
+ var handle = toggle.querySelector('.toggle-handle');
887
+ var toggleWidth = toggle.clientWidth;
888
+ var handleWidth = handle.clientWidth;
889
+ var offset = toggle.classList.contains('active') ? (toggleWidth - handleWidth) : 0;
890
+
891
+ start = { pageX : e.touches[0].pageX - offset, pageY : e.touches[0].pageY };
892
+ touchMove = false;
893
+ });
894
+
895
+ window.addEventListener('touchmove', function (e) {
896
+ e = e.originalEvent || e;
897
+
898
+ if (e.touches.length > 1) {
899
+ return; // Exit if a pinch
900
+ }
901
+
902
+ if (!toggle) {
903
+ return;
904
+ }
905
+
906
+ var handle = toggle.querySelector('.toggle-handle');
907
+ var current = e.touches[0];
908
+ var toggleWidth = toggle.clientWidth;
909
+ var handleWidth = handle.clientWidth;
910
+ var offset = toggleWidth - handleWidth;
911
+
912
+ touchMove = true;
913
+ distanceX = current.pageX - start.pageX;
914
+
915
+ if (Math.abs(distanceX) < Math.abs(current.pageY - start.pageY)) {
916
+ return;
917
+ }
918
+
919
+ e.preventDefault();
920
+
921
+ if (distanceX < 0) {
922
+ return (handle.style.webkitTransform = 'translate3d(0,0,0)');
923
+ }
924
+ if (distanceX > offset) {
925
+ return (handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)');
926
+ }
927
+
928
+ handle.style.webkitTransform = 'translate3d(' + distanceX + 'px,0,0)';
929
+
930
+ toggle.classList[(distanceX > (toggleWidth / 2 - handleWidth / 2)) ? 'add' : 'remove']('active');
931
+ });
932
+
933
+ window.addEventListener('touchend', function (e) {
934
+ if (!toggle) {
935
+ return;
936
+ }
937
+
938
+ var handle = toggle.querySelector('.toggle-handle');
939
+ var toggleWidth = toggle.clientWidth;
940
+ var handleWidth = handle.clientWidth;
941
+ var offset = (toggleWidth - handleWidth);
942
+ var slideOn = (!touchMove && !toggle.classList.contains('active')) || (touchMove && (distanceX > (toggleWidth / 2 - handleWidth / 2)));
943
+
944
+ if (slideOn) {
945
+ handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)';
946
+ } else {
947
+ handle.style.webkitTransform = 'translate3d(0,0,0)';
948
+ }
949
+
950
+ toggle.classList[slideOn ? 'add' : 'remove']('active');
951
+
952
+ e = new CustomEvent('toggle', {
953
+ detail: { isActive: slideOn },
954
+ bubbles: true,
955
+ cancelable: true
956
+ });
957
+
958
+ toggle.dispatchEvent(e);
959
+
960
+ touchMove = false;
961
+ toggle = false;
962
+ });
963
+
964
+ }());