diff --git a/bower.json b/bower.json index 369de6c24..4006fab2d 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,6 @@ { "name": "shepherd", - "main": "shepherd.js", - "version": "0.7.1", + "version": "0.7.2", "homepage": "https://github.com/HubSpot/shepherd", "authors": [ "Zack Bloom ", @@ -22,7 +21,8 @@ "test", "tests" ], + "main": "shepherd.js", "dependencies": { - "tether": "~0.6.5" + "tether": "~0.7.2" } } diff --git a/css/shepherd-theme-arrows-plain-buttons.css b/css/shepherd-theme-arrows-plain-buttons.css index 4b0798175..0f944392d 100644 --- a/css/shepherd-theme-arrows-plain-buttons.css +++ b/css/shepherd-theme-arrows-plain-buttons.css @@ -1,6 +1,4 @@ .shepherd-element, .shepherd-element:after, .shepherd-element:before, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } .shepherd-element { @@ -13,8 +11,6 @@ max-width: 100%; max-height: 100%; } .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; position: relative; font-family: inherit; @@ -23,12 +19,10 @@ padding: 1em; font-size: 1.1em; line-height: 1.5em; - -moz-transform: translateZ(0); - -ms-transform: translateZ(0); -webkit-transform: translateZ(0); - transform: translateZ(0); + transform: translateZ(0); -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); - filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); } + filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); } .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content:before { content: ""; display: block; @@ -117,20 +111,21 @@ .shepherd-element.shepherd-theme-arrows-plain-buttons.shepherd-element-attached-top.shepherd-element-attached-center.shepherd-has-title .shepherd-content:before, .shepherd-element.shepherd-theme-arrows-plain-buttons.shepherd-element-attached-top.shepherd-element-attached-right.shepherd-target-attached-bottom.shepherd-has-title .shepherd-content:before, .shepherd-element.shepherd-theme-arrows-plain-buttons.shepherd-element-attached-top.shepherd-element-attached-left.shepherd-target-attached-bottom.shepherd-has-title .shepherd-content:before { border-bottom-color: #eee; } + .shepherd-element.shepherd-theme-arrows-plain-buttons.shepherd-has-title .shepherd-content header { background: #eee; padding: 1em; } .shepherd-element.shepherd-theme-arrows-plain-buttons.shepherd-has-title .shepherd-content header a.shepherd-cancel-link { padding: 0; margin-bottom: 0; } + .shepherd-element.shepherd-theme-arrows-plain-buttons.shepherd-has-cancel-link .shepherd-content header h3 { float: left; } + .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content { padding: 0; } .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content header { *zoom: 1; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px; border-radius: 5px 5px 0 0; } .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content header:after { content: ""; @@ -144,14 +139,14 @@ float: right; text-decoration: none; font-size: 1.25em; - line-height: 0.8em; + line-height: .8em; font-weight: normal; color: rgba(0, 0, 0, 0.5); opacity: 0.25; position: relative; - top: 0.1em; - padding: 0.8em; - margin-bottom: -0.8em; } + top: .1em; + padding: .8em; + margin-bottom: -.8em; } .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content header a.shepherd-cancel-link:hover { opacity: 1; } .shepherd-element.shepherd-theme-arrows-plain-buttons .shepherd-content .shepherd-text { diff --git a/css/shepherd-theme-arrows.css b/css/shepherd-theme-arrows.css index 673b535c4..a26cb35dd 100644 --- a/css/shepherd-theme-arrows.css +++ b/css/shepherd-theme-arrows.css @@ -1,6 +1,4 @@ .shepherd-element, .shepherd-element:after, .shepherd-element:before, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } .shepherd-element { @@ -13,8 +11,6 @@ max-width: 100%; max-height: 100%; } .shepherd-element.shepherd-theme-arrows .shepherd-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; position: relative; font-family: inherit; @@ -23,12 +19,10 @@ padding: 1em; font-size: 1.1em; line-height: 1.5em; - -moz-transform: translateZ(0); - -ms-transform: translateZ(0); -webkit-transform: translateZ(0); - transform: translateZ(0); + transform: translateZ(0); -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); - filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); } + filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); } .shepherd-element.shepherd-theme-arrows .shepherd-content:before { content: ""; display: block; @@ -117,22 +111,23 @@ .shepherd-element.shepherd-theme-arrows.shepherd-element-attached-top.shepherd-element-attached-center.shepherd-has-title .shepherd-content:before, .shepherd-element.shepherd-theme-arrows.shepherd-element-attached-top.shepherd-element-attached-right.shepherd-target-attached-bottom.shepherd-has-title .shepherd-content:before, .shepherd-element.shepherd-theme-arrows.shepherd-element-attached-top.shepherd-element-attached-left.shepherd-target-attached-bottom.shepherd-has-title .shepherd-content:before { border-bottom-color: #eee; } + .shepherd-element.shepherd-theme-arrows.shepherd-has-title .shepherd-content header { background: #eee; padding: 1em; } .shepherd-element.shepherd-theme-arrows.shepherd-has-title .shepherd-content header a.shepherd-cancel-link { padding: 0; margin-bottom: 0; } + .shepherd-element.shepherd-theme-arrows.shepherd-has-cancel-link .shepherd-content header h3 { float: left; } + .shepherd-element.shepherd-theme-arrows .shepherd-content { padding: 0; } .shepherd-element.shepherd-theme-arrows .shepherd-content * { font-size: inherit; } .shepherd-element.shepherd-theme-arrows .shepherd-content header { *zoom: 1; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px; border-radius: 5px 5px 0 0; } .shepherd-element.shepherd-theme-arrows .shepherd-content header:after { content: ""; @@ -146,14 +141,14 @@ float: right; text-decoration: none; font-size: 1.25em; - line-height: 0.8em; + line-height: .8em; font-weight: normal; color: rgba(0, 0, 0, 0.5); opacity: 0.25; position: relative; - top: 0.1em; - padding: 0.8em; - margin-bottom: -0.8em; } + top: .1em; + padding: .8em; + margin-bottom: -.8em; } .shepherd-element.shepherd-theme-arrows .shepherd-content header a.shepherd-cancel-link:hover { opacity: 1; } .shepherd-element.shepherd-theme-arrows .shepherd-content .shepherd-text { @@ -180,16 +175,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; diff --git a/css/shepherd-theme-dark.css b/css/shepherd-theme-dark.css index d079dc713..1ecc91c62 100644 --- a/css/shepherd-theme-dark.css +++ b/css/shepherd-theme-dark.css @@ -1,6 +1,4 @@ .shepherd-element, .shepherd-element:after, .shepherd-element:before, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } .shepherd-element { @@ -13,8 +11,6 @@ max-width: 100%; max-height: 100%; } .shepherd-element.shepherd-theme-dark .shepherd-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; position: relative; font-family: inherit; @@ -124,16 +120,12 @@ .shepherd-element.shepherd-theme-dark.shepherd-has-cancel-link .shepherd-content header h3 { float: left; } .shepherd-element.shepherd-theme-dark .shepherd-content { - -moz-box-shadow: 0 0 1em rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 0 1em rgba(0, 0, 0, 0.2); box-shadow: 0 0 1em rgba(0, 0, 0, 0.2); padding: 0; } .shepherd-element.shepherd-theme-dark .shepherd-content * { font-size: inherit; } .shepherd-element.shepherd-theme-dark .shepherd-content header { *zoom: 1; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px; border-radius: 5px 5px 0 0; } .shepherd-element.shepherd-theme-dark .shepherd-content header:after { content: ""; @@ -147,14 +139,14 @@ float: right; text-decoration: none; font-size: 1.25em; - line-height: 0.8em; + line-height: .8em; font-weight: normal; color: rgba(0, 0, 0, 0.5); opacity: 0.25; position: relative; - top: 0.1em; - padding: 0.8em; - margin-bottom: -0.8em; } + top: .1em; + padding: .8em; + margin-bottom: -.8em; } .shepherd-element.shepherd-theme-dark .shepherd-content header a.shepherd-cancel-link:hover { opacity: 1; } .shepherd-element.shepherd-theme-dark .shepherd-content .shepherd-text { @@ -181,16 +173,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; @@ -207,16 +197,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; diff --git a/css/shepherd-theme-default.css b/css/shepherd-theme-default.css index b6ab7e766..42744f856 100644 --- a/css/shepherd-theme-default.css +++ b/css/shepherd-theme-default.css @@ -1,6 +1,4 @@ .shepherd-element, .shepherd-element:after, .shepherd-element:before, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } .shepherd-element { @@ -13,8 +11,6 @@ max-width: 100%; max-height: 100%; } .shepherd-element.shepherd-theme-default .shepherd-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; position: relative; font-family: inherit; @@ -124,16 +120,12 @@ .shepherd-element.shepherd-theme-default.shepherd-has-cancel-link .shepherd-content header h3 { float: left; } .shepherd-element.shepherd-theme-default .shepherd-content { - -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); - -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); padding: 0; } .shepherd-element.shepherd-theme-default .shepherd-content * { font-size: inherit; } .shepherd-element.shepherd-theme-default .shepherd-content header { *zoom: 1; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px; border-radius: 5px 5px 0 0; } .shepherd-element.shepherd-theme-default .shepherd-content header:after { content: ""; @@ -147,14 +139,14 @@ float: right; text-decoration: none; font-size: 1.25em; - line-height: 0.8em; + line-height: .8em; font-weight: normal; color: rgba(0, 0, 0, 0.5); opacity: 0.25; position: relative; - top: 0.1em; - padding: 0.8em; - margin-bottom: -0.8em; } + top: .1em; + padding: .8em; + margin-bottom: -.8em; } .shepherd-element.shepherd-theme-default .shepherd-content header a.shepherd-cancel-link:hover { opacity: 1; } .shepherd-element.shepherd-theme-default .shepherd-content .shepherd-text { @@ -181,16 +173,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; @@ -207,16 +197,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; diff --git a/css/shepherd-theme-square-dark.css b/css/shepherd-theme-square-dark.css index c94128051..e15c63143 100644 --- a/css/shepherd-theme-square-dark.css +++ b/css/shepherd-theme-square-dark.css @@ -1,6 +1,4 @@ .shepherd-element, .shepherd-element:after, .shepherd-element:before, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } .shepherd-element { @@ -13,8 +11,6 @@ max-width: 100%; max-height: 100%; } .shepherd-element.shepherd-theme-square-dark .shepherd-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; position: relative; font-family: inherit; @@ -110,8 +106,6 @@ border-right-color: #232323; } .shepherd-element.shepherd-theme-square-dark { - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; z-index: 9999; max-width: 24em; @@ -127,19 +121,13 @@ .shepherd-element.shepherd-theme-square-dark.shepherd-has-cancel-link .shepherd-content header h3 { float: left; } .shepherd-element.shepherd-theme-square-dark .shepherd-content { - -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); - -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; padding: 0; } .shepherd-element.shepherd-theme-square-dark .shepherd-content * { font-size: inherit; } .shepherd-element.shepherd-theme-square-dark .shepherd-content header { *zoom: 1; - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; } .shepherd-element.shepherd-theme-square-dark .shepherd-content header:after { content: ""; @@ -153,14 +141,14 @@ float: right; text-decoration: none; font-size: 1.25em; - line-height: 0.8em; + line-height: .8em; font-weight: normal; color: rgba(0, 0, 0, 0.5); opacity: 0.25; position: relative; - top: 0.1em; - padding: 0.8em; - margin-bottom: -0.8em; } + top: .1em; + padding: .8em; + margin-bottom: -.8em; } .shepherd-element.shepherd-theme-square-dark .shepherd-content header a.shepherd-cancel-link:hover { opacity: 1; } .shepherd-element.shepherd-theme-square-dark .shepherd-content .shepherd-text { @@ -187,16 +175,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; @@ -213,16 +199,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; diff --git a/css/shepherd-theme-square.css b/css/shepherd-theme-square.css index 4faba44d9..60d42df30 100644 --- a/css/shepherd-theme-square.css +++ b/css/shepherd-theme-square.css @@ -1,6 +1,4 @@ .shepherd-element, .shepherd-element:after, .shepherd-element:before, .shepherd-element *, .shepherd-element *:after, .shepherd-element *:before { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; box-sizing: border-box; } .shepherd-element { @@ -13,8 +11,6 @@ max-width: 100%; max-height: 100%; } .shepherd-element.shepherd-theme-square .shepherd-content { - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; position: relative; font-family: inherit; @@ -110,8 +106,6 @@ border-right-color: #f6f6f6; } .shepherd-element.shepherd-theme-square { - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; z-index: 9999; max-width: 24em; @@ -127,19 +121,13 @@ .shepherd-element.shepherd-theme-square.shepherd-has-cancel-link .shepherd-content header h3 { float: left; } .shepherd-element.shepherd-theme-square .shepherd-content { - -moz-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); - -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.17); - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; padding: 0; } .shepherd-element.shepherd-theme-square .shepherd-content * { font-size: inherit; } .shepherd-element.shepherd-theme-square .shepherd-content header { *zoom: 1; - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; } .shepherd-element.shepherd-theme-square .shepherd-content header:after { content: ""; @@ -153,14 +141,14 @@ float: right; text-decoration: none; font-size: 1.25em; - line-height: 0.8em; + line-height: .8em; font-weight: normal; color: rgba(0, 0, 0, 0.5); opacity: 0.25; position: relative; - top: 0.1em; - padding: 0.8em; - margin-bottom: -0.8em; } + top: .1em; + padding: .8em; + margin-bottom: -.8em; } .shepherd-element.shepherd-theme-square .shepherd-content header a.shepherd-cancel-link:hover { opacity: 1; } .shepherd-element.shepherd-theme-square .shepherd-content .shepherd-text { @@ -187,16 +175,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; @@ -213,16 +199,14 @@ *vertical-align: auto; *zoom: 1; *display: inline; - -moz-border-radius: 0; - -webkit-border-radius: 0; border-radius: 0; cursor: pointer; border: 0; margin: 0 0.5em 0 0; font-family: inherit; text-transform: uppercase; - letter-spacing: 0.1em; - font-size: 0.8em; + letter-spacing: .1em; + font-size: .8em; line-height: 1em; padding: 0.75em 2em; background: #3288e6; diff --git a/docs/welcome/css/welcome.css b/docs/welcome/css/welcome.css index 7553c436f..1e868c927 100644 --- a/docs/welcome/css/welcome.css +++ b/docs/welcome/css/welcome.css @@ -5,16 +5,14 @@ html, body { body { margin: 0; background-color: #62c462; - background-image: -webkit-linear-gradient(-45deg, #62c462, #75beaa); - background-image: -moz-linear-gradient(-45deg, #62c462, #75beaa); - background-image: -o-linear-gradient(-45deg, #62c462, #75beaa); + background-image: -webkit-linear-gradient(135deg, #62c462, #75beaa); background-image: linear-gradient(-45deg, #62c462, #75beaa); font-family: "proxima-nova", "Helvetica Neue", sans-serif; } .button { display: inline-block; - border: 2px solid white; - color: white; + border: 2px solid #fff; + color: #fff; padding: 1em 1.25em; font-weight: 500; text-transform: uppercase; @@ -22,10 +20,10 @@ body { text-decoration: none; cursor: pointer; width: 140px; - font-size: 0.8em; + font-size: .8em; line-height: 1.3em; } .button.dark { - background: white; + background: #fff; color: #75beaa; } @media (max-width: 568px) { .button { @@ -39,8 +37,6 @@ body { overflow: auto; } .hero-outer { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; box-sizing: border-box; padding: 20px 0; height: 100%; @@ -53,7 +49,7 @@ body { .hero-outer .hero-inner h1, .hero-outer .hero-inner h2, .hero-outer .hero-inner h3, .hero-outer .hero-inner p { margin: 0 0 20px; line-height: 1; - color: white; + color: #fff; font-weight: normal; } .hero-outer .hero-inner h3 { font-size: 1.3em; @@ -62,9 +58,7 @@ body { padding-top: 10px; } .hero-outer .hero-inner > * { -webkit-transition: opacity 0.4s; - -moz-transition: opacity 0.4s; - -o-transition: opacity 0.4s; - transition: opacity 0.4s; + transition: opacity 0.4s; opacity: 0.3; } body:not(.shepherd-active) .hero-outer .hero-inner > * { opacity: 1; } @@ -84,6 +78,7 @@ body { .shepherd-element.shepherd-theme-arrows.shepherd-transparent-text .shepherd-text { color: #3b744f; } + .shepherd-element.shepherd-theme-arrows .shepherd-content { width: 400px; max-width: 100%; } diff --git a/docs/welcome/sass/welcome.sass b/docs/welcome/sass/welcome.sass index 07989d7b5..3b6fac9e3 100644 --- a/docs/welcome/sass/welcome.sass +++ b/docs/welcome/sass/welcome.sass @@ -1,5 +1,3 @@ -@import compass/css3 - html, body height: 100% overflow: hidden @@ -7,7 +5,7 @@ html, body body margin: 0 background-color: rgb(98, 196, 98) - +background-image(linear-gradient(-45deg, rgb(98, 196, 98), rgb(117, 190, 170))) + background-image: linear-gradient(-45deg, rgb(98, 196, 98), rgb(117, 190, 170)) font-family: "proxima-nova", "Helvetica Neue", sans-serif .button @@ -39,7 +37,7 @@ body overflow: auto .hero-outer - +box-sizing(border-box) + box-sizing: border-box padding: 20px 0 height: 100% width: 100% @@ -64,7 +62,7 @@ body padding-top: 10px > * - +transition(opacity .4s) + transition: opacity .4s opacity: 0.3 body:not(.shepherd-active) & @@ -103,4 +101,4 @@ body pre line-height: 1.4em - border: 1px solid rgba(0, 0, 0, 0.15) \ No newline at end of file + border: 1px solid rgba(0, 0, 0, 0.15) diff --git a/gulpfile.coffee b/gulpfile.coffee index 474353c19..2c64ef226 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -1,13 +1,14 @@ -gulp = require('gulp') -coffee = require('gulp-coffee') -compass = require('gulp-compass') -concat = require('gulp-concat') -uglify = require('gulp-uglify') -header = require('gulp-header') -rename = require('gulp-rename') -bower = require('gulp-bower') -gutil = require('gulp-util') -wrap = require('gulp-wrap-umd') +gulp = require('gulp') +bower = require('gulp-bower') +coffee = require('gulp-coffee') +concat = require('gulp-concat') +gutil = require('gulp-util') +header = require('gulp-header') +prefixer = require('gulp-autoprefixer') +rename = require('gulp-rename') +sass = require('gulp-sass') +uglify = require('gulp-uglify') +wrap = require('gulp-wrap-umd') pkg = require('./package.json') banner = "/*! #{ pkg.name } #{ pkg.version } */\n" @@ -66,25 +67,22 @@ gulp.task 'js', -> gulp.run 'concat', -> gulp.run 'uglify', -> -gulp.task 'compass', -> +gulp.task 'sass', -> for path in ['', 'docs/welcome/'] gulp.src("./#{ path }sass/*") - .pipe(compass( - sass: "#{ path }sass" - css: "#{ path }css" - comments: false - )) + .pipe(sass()) + .pipe(prefixer()) .pipe(gulp.dest("./#{ path }css")) gulp.task 'default', -> gulp.run 'bower', -> - gulp.run 'js', 'compass', -> + gulp.run 'js', 'sass', -> gulp.watch './**/*.coffee', -> gulp.run 'js' gulp.watch './**/*.sass', -> - gulp.run 'compass' + gulp.run 'sass' gulp.watch './bower.json', -> gulp.run 'bower' diff --git a/package.json b/package.json index 5154aac77..f6d5ab78a 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,28 @@ { - "name": "shepherd", - "version": "0.7.1", - "description": "Guide your users through a tour of your app.", - "authors": [ - "Adam Schwartz ", - "Zack Bloom " - ], - "license": "MIT", - "devDependencies": { - "coffee-script": "~1.6.3", - "gulp": "~3.4.0", - "gulp-header": "~1.0.2", - "gulp-uglify": "~0.1.0", - "gulp-compass": "~1.0.3", - "gulp-coffee": "~1.2.5", - "gulp-concat": "~2.1.7", - "gulp-rename": "~0.2.1", - "gulp-util": "~2.2.9", - "gulp-bower": "0.0.1", - "gulp-wrap-umd": "*" - }, - "main": "shepherd.js", - "spm": { - "main": "shepherd.js" - } + "name": "shepherd", + "version": "0.7.2", + "description": "Guide your users through a tour of your app.", + "authors": [ + "Adam Schwartz ", + "Zack Bloom " + ], + "license": "MIT", + "main": "shepherd.js", + "spm": { + "main": "shepherd.js" + }, + "devDependencies": { + "coffee-script": "~1.6.3", + "gulp": "~3.4.0", + "gulp-autoprefixer": "^2.2.0", + "gulp-bower": "0.0.1", + "gulp-coffee": "~1.2.5", + "gulp-concat": "~2.1.7", + "gulp-header": "~1.0.2", + "gulp-rename": "~0.2.1", + "gulp-sass": "^2.0.0", + "gulp-uglify": "~0.1.0", + "gulp-util": "~2.2.9", + "gulp-wrap-umd": "*" + } } diff --git a/sass/shepherd-theme-arrows-plain-buttons.sass b/sass/shepherd-theme-arrows-plain-buttons.sass index ccf945871..576ad6ac7 100644 --- a/sass/shepherd-theme-arrows-plain-buttons.sass +++ b/sass/shepherd-theme-arrows-plain-buttons.sass @@ -1,10 +1,5 @@ -@import compass/css3 -@import compass/utilities/general/clearfix - -@import ../bower_components/tether/sass/mixins/pointer-events - -// Bring in base shepherd styles come from a tether helpers - +@import ../bower_components/tether/sass/mixins/pie-clearfix +@import ../bower_components/tether/sass/mixins/inline-block @import ../bower_components/tether/sass/helpers/tether @import ../bower_components/tether/sass/helpers/tether-theme-arrows @@ -47,7 +42,7 @@ $headerBackgroundColor: #eee header +pie-clearfix - +border-radius(5px 5px 0 0) + border-radius: 5px 5px 0 0 h3 margin: 0 @@ -101,4 +96,4 @@ $headerBackgroundColor: #eee text-decoration: none &:last-child .shepherd-button - margin-right: 0 \ No newline at end of file + margin-right: 0 diff --git a/sass/shepherd-theme-arrows.sass b/sass/shepherd-theme-arrows.sass index 60fec4f3c..4e51afd8f 100644 --- a/sass/shepherd-theme-arrows.sass +++ b/sass/shepherd-theme-arrows.sass @@ -1,10 +1,5 @@ -@import compass/css3 -@import compass/utilities/general/clearfix - -@import ../bower_components/tether/sass/mixins/pointer-events - -// Bring in base shepherd styles come from a tether helpers - +@import ../bower_components/tether/sass/mixins/pie-clearfix +@import ../bower_components/tether/sass/mixins/inline-block @import ../bower_components/tether/sass/helpers/tether @import ../bower_components/tether/sass/helpers/tether-theme-arrows @@ -49,7 +44,7 @@ $headerBackgroundColor: #eee header +pie-clearfix - +border-radius(5px 5px 0 0) + border-radius: 5px 5px 0 0 h3 margin: 0 @@ -98,7 +93,7 @@ $headerBackgroundColor: #eee .shepherd-button +inline-block - +border-radius(3px) + border-radius: 3px cursor: pointer border: 0 margin: 0 .5em 0 0 diff --git a/sass/shepherd-theme-dark.sass b/sass/shepherd-theme-dark.sass index 0adeb622e..c3bf84106 100644 --- a/sass/shepherd-theme-dark.sass +++ b/sass/shepherd-theme-dark.sass @@ -1,10 +1,5 @@ -@import compass/css3 -@import compass/utilities/general/clearfix - -@import ../bower_components/tether/sass/mixins/pointer-events - -// Bring in base shepherd styles come from a tether helpers - +@import ../bower_components/tether/sass/mixins/pie-clearfix +@import ../bower_components/tether/sass/mixins/inline-block @import ../bower_components/tether/sass/helpers/tether @import ../bower_components/tether/sass/helpers/tether-theme-arrows @@ -48,7 +43,7 @@ $maxWidth: 24em float: left .#{ $themePrefix }-content - +box-shadow(0 0 1em rgba(0, 0, 0, .2)) + box-shadow: 0 0 1em rgba(0, 0, 0, .2) padding: 0 * @@ -56,7 +51,7 @@ $maxWidth: 24em header +pie-clearfix - +border-radius(5px 5px 0 0) + border-radius: 5px 5px 0 0 h3 margin: 0 @@ -105,7 +100,7 @@ $maxWidth: 24em .shepherd-button +inline-block - +border-radius(3px) + border-radius: 3px cursor: pointer border: 0 margin: 0 .5em 0 0 @@ -127,7 +122,7 @@ $maxWidth: 24em .#{ $themePrefix }-start-tour-button.#{ $themePrefix }-theme-#{ $themeName } +inline-block - +border-radius(3px) + border-radius: 3px cursor: pointer border: 0 margin: 0 .5em 0 0 diff --git a/sass/shepherd-theme-default.sass b/sass/shepherd-theme-default.sass index d5717af87..ccf1d4d35 100644 --- a/sass/shepherd-theme-default.sass +++ b/sass/shepherd-theme-default.sass @@ -1,10 +1,5 @@ -@import compass/css3 -@import compass/utilities/general/clearfix - -@import ../bower_components/tether/sass/mixins/pointer-events - -// Bring in base shepherd styles come from a tether helpers - +@import ../bower_components/tether/sass/mixins/pie-clearfix +@import ../bower_components/tether/sass/mixins/inline-block @import ../bower_components/tether/sass/helpers/tether @import ../bower_components/tether/sass/helpers/tether-theme-arrows @@ -48,7 +43,7 @@ $maxWidth: 24em float: left .#{ $themePrefix }-content - +box-shadow(0 0 0 1px rgba(0, 0, 0, .17)) + box-shadow: 0 0 0 1px rgba(0, 0, 0, .17) padding: 0 * @@ -56,7 +51,7 @@ $maxWidth: 24em header +pie-clearfix - +border-radius(5px 5px 0 0) + border-radius: 5px 5px 0 0 h3 margin: 0 @@ -105,7 +100,7 @@ $maxWidth: 24em .shepherd-button +inline-block - +border-radius(3px) + border-radius: 3px cursor: pointer border: 0 margin: 0 .5em 0 0 @@ -127,7 +122,7 @@ $maxWidth: 24em .#{ $themePrefix }-start-tour-button.#{ $themePrefix }-theme-#{ $themeName } +inline-block - +border-radius(3px) + border-radius: 3px cursor: pointer border: 0 margin: 0 .5em 0 0 diff --git a/sass/shepherd-theme-square-dark.sass b/sass/shepherd-theme-square-dark.sass index 170002414..0031b6be9 100644 --- a/sass/shepherd-theme-square-dark.sass +++ b/sass/shepherd-theme-square-dark.sass @@ -1,10 +1,5 @@ -@import compass/css3 -@import compass/utilities/general/clearfix - -@import ../bower_components/tether/sass/mixins/pointer-events - -// Bring in base shepherd styles come from a tether helpers - +@import ../bower_components/tether/sass/mixins/pie-clearfix +@import ../bower_components/tether/sass/mixins/inline-block @import ../bower_components/tether/sass/helpers/tether @import ../bower_components/tether/sass/helpers/tether-theme-arrows @@ -25,7 +20,7 @@ $maxWidth: 24em // Shepherd specific styles .#{ $themePrefix }-element.#{ $themePrefix }-theme-#{ $themeName } - +border-radius(0) + border-radius: 0 z-index: $zIndex max-width: $maxWidth font-size: 1em @@ -49,8 +44,8 @@ $maxWidth: 24em float: left .#{ $themePrefix }-content - +box-shadow(0 0 0 1px rgba(0, 0, 0, .17)) - +border-radius(0) + box-shadow: 0 0 0 1px rgba(0, 0, 0, .17) + border-radius: 0 padding: 0 * @@ -58,7 +53,7 @@ $maxWidth: 24em header +pie-clearfix - +border-radius(0) + border-radius: 0 h3 margin: 0 @@ -107,7 +102,7 @@ $maxWidth: 24em .shepherd-button +inline-block - +border-radius(0) + border-radius: 0 cursor: pointer border: 0 margin: 0 .5em 0 0 @@ -129,7 +124,7 @@ $maxWidth: 24em .#{ $themePrefix }-start-tour-button.#{ $themePrefix }-theme-#{ $themeName } +inline-block - +border-radius(0) + border-radius: 0 cursor: pointer border: 0 margin: 0 .5em 0 0 diff --git a/sass/shepherd-theme-square.sass b/sass/shepherd-theme-square.sass index b6de1906c..060c7079e 100644 --- a/sass/shepherd-theme-square.sass +++ b/sass/shepherd-theme-square.sass @@ -1,10 +1,5 @@ -@import compass/css3 -@import compass/utilities/general/clearfix - -@import ../bower_components/tether/sass/mixins/pointer-events - -// Bring in base shepherd styles come from a tether helpers - +@import ../bower_components/tether/sass/mixins/pie-clearfix +@import ../bower_components/tether/sass/mixins/inline-block @import ../bower_components/tether/sass/helpers/tether @import ../bower_components/tether/sass/helpers/tether-theme-arrows @@ -25,7 +20,7 @@ $maxWidth: 24em // Shepherd specific styles .#{ $themePrefix }-element.#{ $themePrefix }-theme-#{ $themeName } - +border-radius(0) + border-radius: 0 z-index: $zIndex max-width: $maxWidth font-size: 1em @@ -49,8 +44,8 @@ $maxWidth: 24em float: left .#{ $themePrefix }-content - +box-shadow(0 0 0 1px rgba(0, 0, 0, .17)) - +border-radius(0) + box-shadow: 0 0 0 1px rgba(0, 0, 0, .17) + border-radius: 0 padding: 0 * @@ -58,7 +53,7 @@ $maxWidth: 24em header +pie-clearfix - +border-radius(0) + border-radius: 0 h3 margin: 0 @@ -107,7 +102,7 @@ $maxWidth: 24em .shepherd-button +inline-block - +border-radius(0) + border-radius: 0 cursor: pointer border: 0 margin: 0 .5em 0 0 @@ -129,7 +124,7 @@ $maxWidth: 24em .#{ $themePrefix }-start-tour-button.#{ $themePrefix }-theme-#{ $themeName } +inline-block - +border-radius(0) + border-radius: 0 cursor: pointer border: 0 margin: 0 .5em 0 0 diff --git a/shepherd-amd.js b/shepherd-amd.js index c13efb77d..2de3c4129 100644 --- a/shepherd-amd.js +++ b/shepherd-amd.js @@ -9,7 +9,7 @@ } }(this, function(Tether) { -/*! shepherd 0.7.1 */ +/*! shepherd 0.7.2 */ (function() { var ATTACHMENT, Evented, Shepherd, Step, Tour, addClass, createFromHTML, extend, getBounds, hasClass, matchesSelector, parseShorthand, removeClass, uniqueId, _ref, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, diff --git a/shepherd-amd.min.js b/shepherd-amd.min.js index 7e874d732..db96d854f 100644 --- a/shepherd-amd.min.js +++ b/shepherd-amd.min.js @@ -1,2 +1,2 @@ -/*! shepherd 0.7.1 */ +/*! shepherd 0.7.2 */ !function(t,e){"function"==typeof define&&define.amd?define(["tether"],e):"object"==typeof exports?module.exports=e(require("tether")):t.Shepherd=e(t.Tether)}(this,function(t){return function(){var e,n,i,r,s,o,h,l,u,p,c,d,a,f,v,m=function(t,e){return function(){return t.apply(e,arguments)}},g={}.hasOwnProperty,y=function(t,e){function n(){this.constructor=t}for(var i in e)g.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};v=t.Utils,l=v.extend,a=v.removeClass,o=v.addClass,p=v.hasClass,n=v.Evented,u=v.getBounds,f=v.uniqueId,i=new n,e={top:"bottom center",left:"middle right",right:"middle left",bottom:"top center",center:"middle center"},h=function(t){var e;return e=document.createElement("div"),e.innerHTML=t,e.children[0]},c=function(t,e){var n,i,r,s,o,h;return n=null!=(i=null!=(r=null!=(s=null!=(o=null!=(h=t.matches)?h:t.matchesSelector)?o:t.msMatchesSelector)?s:t.webkitMatchesSelector)?r:t.mozMatchesSelector)?i:t.oMatchesSelector,n.call(t,e)},d=function(t,e){var n,i,r,s,o,h;if(null==t)return t;if("object"==typeof t)return t;for(s=t.split(" "),s.length>e.length&&(s[0]=s.slice(0,+(s.length-e.length)+1||9e9).join(" "),s.splice(1,s.length-e.length)),i={},n=o=0,h=e.length;h>o;n=++o)r=e[n],i[r]=s[n];return i},r=function(n){function i(t,e){this.tour=t,this.destroy=m(this.destroy,this),this.scrollTo=m(this.scrollTo,this),this.complete=m(this.complete,this),this.cancel=m(this.cancel,this),this.isOpen=m(this.isOpen,this),this.hide=m(this.hide,this),this._show=m(this._show,this),this.show=m(this.show,this),this.setOptions(e)}return y(i,n),i.prototype.setOptions=function(t){var e,n,i,r;if(this.options=null!=t?t:{},this.destroy(),this.id=this.options.id||this.id||"step-"+f(),this.options.when){r=this.options.when;for(e in r)n=r[e],this.on(e,n,this)}return null!=(i=this.options).buttons?(i=this.options).buttons:i.buttons=[{text:"Next",action:this.tour.next}]},i.prototype.getTour=function(){return this.tour},i.prototype.bindAdvance=function(){var t,e,n,i,r=this;return i=d(this.options.advanceOn,["selector","event"]),t=i.event,n=i.selector,e=function(t){if(r.isOpen())if(null!=n){if(c(t.target,n))return r.tour.next()}else if(r.el&&t.target===r.el)return r.tour.next()},document.body.addEventListener(t,e),this.on("destroy",function(){return document.body.removeEventListener(t,e)})},i.prototype.getAttachTo=function(){var t,e;if(t=d(this.options.attachTo,["element","on"]),null==t&&(t={}),e=t.element,"string"==typeof t.element&&(t.element=document.querySelector(t.element),null==t.element))throw new Error("The element for this Shepherd step was not found "+e);return t},i.prototype.setupTether=function(){var n,i,r;if("undefined"==typeof t||null===t)throw new Error("Using the attachment feature of Shepherd requires the Tether library");return i=this.getAttachTo(),n=e[i.on||"right"],null==i.element&&(i.element="viewport",n="middle center"),r={classPrefix:"shepherd",element:this.el,constraints:[{to:"window",pin:!0,attachment:"together"}],target:i.element,offset:i.offset||"0 0",attachment:n},this.tether=new t(l(r,this.options.tetherOptions))},i.prototype.show=function(){var t,e,n,i=this;return null!=(e="function"==typeof(t=this.options).beforeShowPromise&&null!=(n=t.beforeShowPromise())?n.then(function(){return i._show()}):void 0)?e:this._show()},i.prototype._show=function(){var t=this;return this.trigger("before-show"),null==this.el&&this.render(),o(this.el,"shepherd-open"),document.body.setAttribute("data-shepherd-step",this.id),this.setupTether(),this.options.scrollTo&&setTimeout(function(){return t.scrollTo()}),this.trigger("show")},i.prototype.hide=function(){var t;return this.trigger("before-hide"),a(this.el,"shepherd-open"),document.body.removeAttribute("data-shepherd-step"),null!=(t=this.tether)&&t.destroy(),this.tether=null,this.trigger("hide")},i.prototype.isOpen=function(){return p(this.el,"shepherd-open")},i.prototype.cancel=function(){return this.tour.cancel(),this.trigger("cancel")},i.prototype.complete=function(){return this.tour.complete(),this.trigger("complete")},i.prototype.scrollTo=function(){var t;return t=this.getAttachTo().element,null!=this.options.scrollToHandler?this.options.scrollToHandler(t):null!=t?t.scrollIntoView():void 0},i.prototype.destroy=function(){var t;return null!=this.el&&(document.body.removeChild(this.el),delete this.el),null!=(t=this.tether)&&t.destroy(),this.tether=null,this.trigger("destroy")},i.prototype.render=function(){var t,e,n,i,r,s,o,l,u,p,c,d,a,f,v,m,g;if(null!=this.el&&this.destroy(),this.el=h("
"),i=document.createElement("div"),i.className="shepherd-content",this.el.appendChild(i),s=document.createElement("header"),i.appendChild(s),null!=this.options.title&&(s.innerHTML+="

"+this.options.title+"

",this.el.className+=" shepherd-has-title"),this.options.showCancelLink&&(o=h(""),s.appendChild(o),this.el.className+=" shepherd-has-cancel-link",this.bindCancelLink(o)),null!=this.options.text){if(p=h("
"),u=this.options.text,"function"==typeof u&&(u=this.options.text.call(this,p)),u instanceof HTMLElement)p.appendChild(u);else for("string"==typeof u&&(u=[u]),c=0,a=u.length;a>c;c++)l=u[c],p.innerHTML+="

"+l+"

";i.appendChild(p)}if(r=document.createElement("footer"),this.options.buttons){for(e=h("
    "),m=this.options.buttons,d=0,f=m.length;f>d;d++)n=m[d],t=h("
  • "+n.text+""),e.appendChild(t),this.bindButtonEvents(n,t.querySelector("a"));r.appendChild(e)}return i.appendChild(r),document.body.appendChild(this.el),this.setupTether(),this.options.advanceOn?this.bindAdvance():void 0},i.prototype.bindCancelLink=function(t){var e=this;return t.addEventListener("click",function(t){return t.preventDefault(),e.cancel()})},i.prototype.bindButtonEvents=function(t,e){var n,i,r,s,o=this;null==t.events&&(t.events={}),null!=t.action&&(t.events.click=t.action),s=t.events;for(n in s)i=s[n],"string"==typeof i&&(r=i,i=function(){return o.tour.show(r)}),e.addEventListener(n,i);return this.on("destroy",function(){var r,s;r=t.events,s=[];for(n in r)i=r[n],s.push(e.removeEventListener(n,i));return s})},i}(n),s=function(t){function e(t){var e,n,r,s,o,h,l=this;for(this.options=null!=t?t:{},this.hide=m(this.hide,this),this.complete=m(this.complete,this),this.cancel=m(this.cancel,this),this.back=m(this.back,this),this.next=m(this.next,this),this.steps=null!=(o=this.options.steps)?o:[],h=["complete","cancel","hide","start","show","active","inactive"],n=function(t){return l.on(t,function(e){return null==e&&(e={}),e.tour=l,i.trigger(t,e)})},r=0,s=h.length;s>r;r++)e=h[r],n(e)}return y(e,t),e.prototype.addStep=function(t,e){var n;return null==e&&(e=t),e instanceof r?e.tour=this:(("string"==(n=typeof t)||"number"===n)&&(e.id=t.toString()),e=l({},this.options.defaults,e),e=new r(this,e)),this.steps.push(e),this},e.prototype.getById=function(t){var e,n,i,r;for(r=this.steps,n=0,i=r.length;i>n;n++)if(e=r[n],e.id===t)return e},e.prototype.getCurrentStep=function(){return this.currentStep},e.prototype.next=function(){var t;return t=this.steps.indexOf(this.currentStep),t===this.steps.length-1?(this.hide(t),this.trigger("complete"),this.done()):this.show(t+1)},e.prototype.back=function(){var t;return t=this.steps.indexOf(this.currentStep),this.show(t-1)},e.prototype.cancel=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("cancel"),this.done()},e.prototype.complete=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("complete"),this.done()},e.prototype.hide=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("hide"),this.done()},e.prototype.done=function(){return i.activeTour=null,a(document.body,"shepherd-active"),this.trigger("inactive",{tour:this})},e.prototype.show=function(t){var e;return null==t&&(t=0),this.currentStep?this.currentStep.hide():(o(document.body,"shepherd-active"),this.trigger("active",{tour:this})),i.activeTour=this,e="string"==typeof t?this.getById(t):this.steps[t],e?(this.trigger("show",{step:e,previous:this.currentStep}),this.currentStep=e,e.show()):void 0},e.prototype.start=function(){return this.trigger("start"),this.currentStep=null,this.next()},e}(n),l(i,{Tour:s,Step:r,Evented:n}),window.Shepherd=i}.call(this),Shepherd}); \ No newline at end of file diff --git a/shepherd.js b/shepherd.js index dbe0aebb3..3d2d331fb 100644 --- a/shepherd.js +++ b/shepherd.js @@ -1,5 +1,5 @@ -/*! shepherd 0.7.1 */ -/*! tether 0.6.5 */ +/*! shepherd 0.7.2 */ +/*! tether 0.7.2 */ (function(root, factory) { @@ -13,7 +13,7 @@ }(this, function(require,exports,module) { (function() { - var Evented, addClass, defer, deferred, extend, flush, getBounds, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, uniqueId, updateClasses, zeroPosCache, + var Evented, addClass, defer, deferred, extend, flush, getBounds, getClassName, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, setClassName, uniqueId, updateClasses, zeroPosCache, __hasProp = {}.hasOwnProperty, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, __slice = [].slice; @@ -39,7 +39,7 @@ if (style == null) { return parent; } - if (/(auto|scroll)/.test(style['overflow'] + style['overflow-y'] + style['overflow-x'])) { + if (/(auto|scroll)/.test(style['overflow'] + style['overflowY'] + style['overflowX'])) { if (position !== 'absolute' || ((_ref = style['position']) === 'relative' || _ref === 'absolute' || _ref === 'fixed')) { return parent; } @@ -178,7 +178,7 @@ }; removeClass = function(el, name) { - var cls, _i, _len, _ref, _results; + var className, cls, _i, _len, _ref, _results; if (el.classList != null) { _ref = name.split(' '); _results = []; @@ -190,7 +190,8 @@ } return _results; } else { - return el.className = el.className.replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' '); + className = getClassName(el).replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' '); + return setClassName(el, className); } }; @@ -208,7 +209,8 @@ return _results; } else { removeClass(el, name); - return el.className += " " + name; + cls = getClassName(el) + (" " + name); + return setClassName(el, cls); } }; @@ -216,10 +218,22 @@ if (el.classList != null) { return el.classList.contains(name); } else { - return new RegExp("(^| )" + name + "( |$)", 'gi').test(el.className); + return new RegExp("(^| )" + name + "( |$)", 'gi').test(getClassName(el)); } }; + getClassName = function(el) { + if (el.className instanceof SVGAnimatedString) { + return el.className.baseVal; + } else { + return el.className; + } + }; + + setClassName = function(el, className) { + return el.setAttribute('class', className); + }; + updateClasses = function(el, add, all) { var cls, _i, _j, _len, _len1, _results; for (_i = 0, _len = all.length; _i < _len; _i++) { @@ -575,7 +589,9 @@ } } addClass(this.element, this.getClass('element')); - addClass(this.target, this.getClass('target')); + if (this.options.addTargetClasses !== false) { + addClass(this.target, this.getClass('target')); + } if (!this.options.attachment) { throw new Error("Tether Error: You must provide an attachment"); } @@ -695,7 +711,9 @@ if (position == null) { position = true; } - addClass(this.target, this.getClass('enabled')); + if (this.options.addTargetClasses !== false) { + addClass(this.target, this.getClass('enabled')); + } addClass(this.element, this.getClass('enabled')); this.enabled = true; if (this.scrollParent !== document) { @@ -771,7 +789,9 @@ return; } updateClasses(_this.element, _this._addAttachClasses, all); - updateClasses(_this.target, _this._addAttachClasses, all); + if (_this.options.addTargetClasses !== false) { + updateClasses(_this.target, _this._addAttachClasses, all); + } return _this._addAttachClasses = void 0; }); }; @@ -833,10 +853,10 @@ manualTargetOffset: manualTargetOffset, scrollbarSize: scrollbarSize }); - if ((ret == null) || typeof ret !== 'object') { - continue; - } else if (ret === false) { + if (ret === false) { return false; + } else if ((ret == null) || typeof ret !== 'object') { + continue; } else { top = ret.top, left = ret.left; } @@ -1328,7 +1348,9 @@ } } defer(function() { - updateClasses(_this.target, addClasses, allClasses); + if (_this.options.addTargetClasses !== false) { + updateClasses(_this.target, addClasses, allClasses); + } return updateClasses(_this.element, addClasses, allClasses); }); return { @@ -1391,7 +1413,9 @@ addClasses.push("" + (this.getClass('abutted')) + "-" + side); } defer(function() { - updateClasses(_this.target, addClasses, allClasses); + if (_this.options.addTargetClasses !== false) { + updateClasses(_this.target, addClasses, allClasses); + } return updateClasses(_this.element, addClasses, allClasses); }); return true; diff --git a/shepherd.min.js b/shepherd.min.js index bf8026556..c40f9df29 100644 --- a/shepherd.min.js +++ b/shepherd.min.js @@ -1,2 +1,2 @@ -/*! shepherd 0.7.1 */ -!function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e(require,exports,module):t.Tether=e()}(this,function(){return function(){var t,e,i,o,n,s,r,h,l,a,p,u,f,c,d,g,m,v={}.hasOwnProperty,b=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1},y=[].slice;null==this.Tether&&(this.Tether={modules:[]}),p=function(t){var e,i,o,n,s;if(i=getComputedStyle(t).position,"fixed"===i)return t;for(o=void 0,e=t;e=e.parentNode;){try{n=getComputedStyle(e)}catch(r){}if(null==n)return e;if(/(auto|scroll)/.test(n.overflow+n["overflow-y"]+n["overflow-x"])&&("absolute"!==i||"relative"===(s=n.position)||"absolute"===s||"fixed"===s))return e}return document.body},d=function(){var t;return t=0,function(){return t++}}(),m={},l=function(t){var e,o,s,r,h;if(s=t._tetherZeroElement,null==s&&(s=t.createElement("div"),s.setAttribute("data-tether-id",d()),n(s.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(s),t._tetherZeroElement=s),e=s.getAttribute("data-tether-id"),null==m[e]){m[e]={},h=s.getBoundingClientRect();for(o in h)r=h[o],m[e][o]=r;i(function(){return m[e]=void 0})}return m[e]},f=null,r=function(t){var e,i,o,n,s,r,h;t===document?(i=document,t=document.documentElement):i=t.ownerDocument,o=i.documentElement,e={},h=t.getBoundingClientRect();for(n in h)r=h[n],e[n]=r;return s=l(i),e.top-=s.top,e.left-=s.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-o.clientTop,e.left=e.left-o.clientLeft,e.right=i.body.clientWidth-e.width-e.left,e.bottom=i.body.clientHeight-e.height-e.top,e},h=function(t){return t.offsetParent||document.documentElement},a=function(){var t,e,i,o,s;return t=document.createElement("div"),t.style.width="100%",t.style.height="200px",e=document.createElement("div"),n(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e),o=t.offsetWidth,e.style.overflow="scroll",s=t.offsetWidth,o===s&&(s=e.clientWidth),document.body.removeChild(e),i=o-s,{width:i,height:i}},n=function(t){var e,i,o,n,s,r,h;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),h=e.slice(1),s=0,r=h.length;r>s;s++)if(o=h[s])for(i in o)v.call(o,i)&&(n=o[i],t[i]=n);return t},c=function(t,e){var i,o,n,s,r;if(null!=t.classList){for(s=e.split(" "),r=[],o=0,n=s.length;n>o;o++)i=s[o],i.trim()&&r.push(t.classList.remove(i));return r}return t.className=t.className.replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," ")},e=function(t,e){var i,o,n,s,r;if(null!=t.classList){for(s=e.split(" "),r=[],o=0,n=s.length;n>o;o++)i=s[o],i.trim()&&r.push(t.classList.add(i));return r}return c(t,e),t.className+=" "+e},u=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},g=function(t,i,o){var n,s,r,h,l,a;for(s=0,h=o.length;h>s;s++)n=o[s],b.call(i,n)<0&&u(t,n)&&c(t,n);for(a=[],r=0,l=i.length;l>r;r++)n=i[r],a.push(u(t,n)?void 0:e(t,n));return a},o=[],i=function(t){return o.push(t)},s=function(){var t,e;for(e=[];t=o.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,i,o){var n;return null==o&&(o=!1),null==this.bindings&&(this.bindings={}),null==(n=this.bindings)[t]&&(n[t]=[]),this.bindings[t].push({handler:e,ctx:i,once:o})},t.prototype.once=function(t,e,i){return this.on(t,e,i,!0)},t.prototype.off=function(t,e){var i,o,n;if(null!=(null!=(o=this.bindings)?o[t]:void 0)){if(null==e)return delete this.bindings[t];for(i=0,n=[];i=e&&e>=t-i},x=function(){var t,e,i,o,n;for(t=document.createElement("div"),n=["transform","webkitTransform","OTransform","MozTransform","msTransform"],i=0,o=n.length;o>i;i++)if(e=n[i],void 0!==t.style[e])return e}(),O=[],C=function(){var t,e,i;for(e=0,i=O.length;i>e;e++)t=O[e],t.position(!1);return p()},v=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?t:+new Date},function(){var t,e,i,o,n,s,r,h,l;for(e=null,i=null,o=null,n=function(){if(null!=i&&i>16)return i=Math.min(i-16,250),void(o=setTimeout(n,250));if(!(null!=e&&v()-e<10))return null!=o&&(clearTimeout(o),o=null),e=v(),C(),i=v()-e},h=["resize","scroll","touchmove"],l=[],s=0,r=h.length;r>s;s++)t=h[s],l.push(window.addEventListener(t,n));return l}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},i={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},h=function(i,o){var n,s;return n=i.left,s=i.top,"auto"===n&&(n=t[o.left]),"auto"===s&&(s=e[o.top]),{left:n,top:s}},r=function(t){var e,o;return{left:null!=(e=i[t.left])?e:t.left,top:null!=(o=i[t.top])?o:t.top}},s=function(){var t,e,i,o,n,s,r;for(e=1<=arguments.length?L.call(arguments,0):[],i={top:0,left:0},n=0,s=e.length;s>n;n++)r=e[n],o=r.top,t=r.left,"string"==typeof o&&(o=parseFloat(o,10)),"string"==typeof t&&(t=parseFloat(t,10)),i.top+=o,i.left+=t;return i},b=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},y=w=function(t){var e,i,o;return o=t.split(" "),i=o[0],e=o[1],{top:i,left:e}},A=function(){function t(t){this.position=_(this.position,this);var e,i,n,s,r;for(O.push(this),this.history=[],this.setOptions(t,!1),s=o.modules,i=0,n=s.length;n>i;i++)e=s[i],null!=(r=e.initialize)&&r.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,i;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(i=this.options.classes)?i[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var i,o,s,r,h,l;for(this.options=t,null==e&&(e=!0),i={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=a(i,this.options),h=this.options,this.element=h.element,this.target=h.target,this.targetModifier=h.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),l=["element","target"],s=0,r=l.length;r>s;s++){if(o=l[s],null==this[o])throw new Error("Tether Error: Both element and target must be defined");null!=this[o].jquery?this[o]=this[o][0]:"string"==typeof this[o]&&(this[o]=document.querySelector(this[o]))}if(n(this.element,this.getClass("element")),n(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=y(this.options.targetAttachment),this.attachment=y(this.options.attachment),this.offset=w(this.options.offset),this.targetOffset=w(this.options.targetOffset),null!=this.scrollParent&&this.disable(),this.scrollParent="scroll-handle"===this.targetModifier?this.target:g(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,i,o,n,s,r,h,l;if(null==this.targetModifier)return u(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=u(this.target),n={height:t.height,width:t.width,top:t.top,left:t.left},n.height=Math.min(n.height,t.height-(pageYOffset-t.top)),n.height=Math.min(n.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),n.height=Math.min(innerHeight,n.height),n.height-=2,n.width=Math.min(n.width,t.width-(pageXOffset-t.left)),n.width=Math.min(n.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),n.width=Math.min(innerWidth,n.width),n.width-=2,n.topl.clientWidth||"scroll"===[h.overflow,h.overflowX]||this.target!==document.body,s=0,i&&(s=15),o=t.height-parseFloat(h.borderTopWidth)-parseFloat(h.borderBottomWidth)-s,n={width:15,height:.975*o*(o/l.scrollHeight),left:t.left+t.width-parseFloat(h.borderLeftWidth)-15},e=0,408>o&&this.target===document.body&&(e=-11e-5*Math.pow(o,2)-.00727*o+22.58),this.target!==document.body&&(n.height=Math.max(n.height,24)),r=this.target.scrollTop/(l.scrollHeight-o),n.top=r*(o-n.height-e)+t.top+parseFloat(h.borderTopWidth),this.target===document.body&&(n.height=Math.max(n.height,24)),n}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),n(this.target,this.getClass("enabled")),n(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return T(this.target,this.getClass("enabled")),T(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,i,o,n;for(this.disable(),n=[],t=i=0,o=O.length;o>i;t=++i){if(e=O[t],e===this){O.splice(t,1);break}n.push(void 0)}return n},t.prototype.updateAttachClasses=function(t,e){var i,o,n,s,r,h,a,p,u,f=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),s=["left","top","bottom","right","middle","center"],(null!=(u=this._addAttachClasses)?u.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),i=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&i.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&i.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&i.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&i.push(""+this.getClass("target-attached")+"-"+e.left),o=[],r=0,a=s.length;a>r;r++)n=s[r],o.push(""+this.getClass("element-attached")+"-"+n);for(h=0,p=s.length;p>h;h++)n=s[h],o.push(""+this.getClass("target-attached")+"-"+n);return l(function(){return null!=f._addAttachClasses?(S(f.element,f._addAttachClasses,o),S(f.target,f._addAttachClasses,o),f._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,i,n,l,a,c,g,m,v,y,w,C,T,O,x,S,E,A,M,L,_,B,W,P,z,H,F,k,N,Y,X,j,q,U,I,R=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),L=h(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,L),e=this.cache("element-bounds",function(){return u(R.element)}),z=e.width,n=e.height,0===z&&0===n&&null!=this.lastSize?(Y=this.lastSize,z=Y.width,n=Y.height):this.lastSize={width:z,height:n},W=B=this.cache("target-bounds",function(){return R.getTargetBounds()}),v=b(r(this.attachment),{width:z,height:n}),_=b(r(L),W),a=b(this.offset,{width:z,height:n}),c=b(this.targetOffset,W),v=s(v,a),_=s(_,c),l=B.left+_.left-v.left,P=B.top+_.top-v.top,X=o.modules,H=0,k=X.length;k>H;H++)if(g=X[H],x=g.position.call(this,{left:l,top:P,targetAttachment:L,targetPos:B,attachment:this.attachment,elementPos:e,offset:v,targetOffset:_,manualOffset:a,manualTargetOffset:c,scrollbarSize:A}),null!=x&&"object"==typeof x){if(x===!1)return!1;P=x.top,l=x.left}if(m={page:{top:P,left:l},viewport:{top:P-pageYOffset,bottom:pageYOffset-P-n+innerHeight,left:l-pageXOffset,right:pageXOffset-l-z+innerWidth}},document.body.scrollWidth>window.innerWidth&&(A=this.cache("scrollbar-size",d),m.viewport.bottom-=A.height),document.body.scrollHeight>window.innerHeight&&(A=this.cache("scrollbar-size",d),m.viewport.right-=A.width),(""!==(j=document.body.style.position)&&"static"!==j||""!==(q=document.body.parentElement.style.position)&&"static"!==q)&&(m.page.bottom=document.body.scrollHeight-P-n,m.page.right=document.body.scrollWidth-l-z),(null!=(U=this.options.optimizations)?U.moveElement:void 0)!==!1&&null==this.targetModifier){for(w=this.cache("target-offsetparent",function(){return f(R.target)}),O=this.cache("target-offsetparent-bounds",function(){return u(w)}),T=getComputedStyle(w),i=getComputedStyle(this.element),C=O,y={},I=["Top","Left","Bottom","Right"],F=0,N=I.length;N>F;F++)M=I[F],y[M.toLowerCase()]=parseFloat(T["border"+M+"Width"]);O.right=document.body.scrollWidth-O.left-C.width+y.right,O.bottom=document.body.scrollHeight-O.top-C.height+y.bottom,m.page.top>=O.top+y.top&&m.page.bottom>=O.bottom&&m.page.left>=O.left+y.left&&m.page.right>=O.right&&(E=w.scrollTop,S=w.scrollLeft,m.offset={top:m.page.top-O.top+E-y.top,left:m.page.left-O.left+S-y.left})}return this.move(m),this.history.unshift(m),this.history.length>3&&this.history.pop(),t&&p(),!0}},t.prototype.move=function(t){var e,i,o,n,s,r,h,p,u,c,d,g,m,v,b,y,w,C=this;if(null!=this.element.parentNode){p={};for(c in t){p[c]={};for(n in t[c]){for(o=!1,y=this.history,v=0,b=y.length;b>v;v++)if(h=y[v],!E(null!=(w=h[c])?w[n]:void 0,t[c][n])){o=!0;break}o||(p[c][n]=!0)}}e={top:"",left:"",right:"",bottom:""},u=function(t,i){var o,n,s;return(null!=(s=C.options.optimizations)?s.gpu:void 0)===!1?(t.top?e.top=""+i.top+"px":e.bottom=""+i.bottom+"px",t.left?e.left=""+i.left+"px":e.right=""+i.right+"px"):(t.top?(e.top=0,n=i.top):(e.bottom=0,n=-i.bottom),t.left?(e.left=0,o=i.left):(e.right=0,o=-i.right),e[x]="translateX("+Math.round(o)+"px) translateY("+Math.round(n)+"px)","msTransform"!==x?e[x]+=" translateZ(0)":void 0)},s=!1,(p.page.top||p.page.bottom)&&(p.page.left||p.page.right)?(e.position="absolute",u(p.page,t.page)):(p.viewport.top||p.viewport.bottom)&&(p.viewport.left||p.viewport.right)?(e.position="fixed",u(p.viewport,t.viewport)):null!=p.offset&&p.offset.top&&p.offset.left?(e.position="absolute",r=this.cache("target-offsetparent",function(){return f(C.target)}),f(this.element)!==r&&l(function(){return C.element.parentNode.removeChild(C.element),r.appendChild(C.element)}),u(p.offset,t.offset),s=!0):(e.position="absolute",u({top:!0,left:!0},t.page)),s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),m={},g=!1;for(n in e)d=e[n],i=this.element.style[n],""===i||""===d||"top"!==n&&"left"!==n&&"bottom"!==n&&"right"!==n||(i=parseFloat(i),d=parseFloat(d)),i!==d&&(g=!0,m[n]=e[n]);return g?l(function(){return a(C.element.style,m)}):void 0}},t}(),o.position=C,this.Tether=a(A,o)}.call(this),function(){var t,e,i,o,n,s,r,h,l,a,p=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1};a=this.Tether.Utils,r=a.getOuterSize,s=a.getBounds,h=a.getSize,o=a.extend,l=a.updateClasses,i=a.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],n=function(e,i){var o,n,r,h,l,a,p;if("scrollParent"===i?i=e.scrollParent:"window"===i&&(i=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),i===document&&(i=i.documentElement),null!=i.nodeType)for(n=h=s(i),l=getComputedStyle(i),i=[n.left,n.top,h.width+n.left,h.height+n.top],o=a=0,p=t.length;p>a;o=++a)r=t[o],r=r[0].toUpperCase()+r.substr(1),"Top"===r||"Left"===r?i[o]+=parseFloat(l["border"+r+"Width"]):i[o]-=parseFloat(l["border"+r+"Width"]);return i},this.Tether.modules.push({position:function(e){var r,h,a,u,f,c,d,g,m,v,b,y,w,C,T,O,x,S,E,A,M,L,_,B,W,P,z,H,F,k,N,Y,X,j,q,U,I,R,D,Z,$,V,G,J,K,Q,te,ee=this;if(P=e.top,b=e.left,M=e.targetAttachment,!this.options.constraints)return!0;for(S=function(e){var i,o,n,s;for(ee.removeClass(e),s=[],o=0,n=t.length;n>o;o++)i=t[o],s.push(ee.removeClass(""+e+"-"+i));return s},Z=this.cache("element-bounds",function(){return s(ee.element)}),v=Z.height,z=Z.width,0===z&&0===v&&null!=this.lastSize&&($=this.lastSize,z=$.width,v=$.height),_=this.cache("target-bounds",function(){return ee.getTargetBounds()}),L=_.height,B=_.width,A={},m={},h=[this.getClass("pinned"),this.getClass("out-of-bounds")],V=this.options.constraints,H=0,Y=V.length;Y>H;H++)g=V[H],g.outOfBoundsClass&&h.push(g.outOfBoundsClass),g.pinnedClass&&h.push(g.pinnedClass);for(F=0,X=h.length;X>F;F++)for(d=h[F],G=["left","top","right","bottom"],k=0,j=G.length;j>k;k++)E=G[k],h.push(""+d+"-"+E);for(r=[],A=o({},M),m=o({},this.attachment),J=this.options.constraints,N=0,q=J.length;q>N;N++){if(g=J[N],W=g.to,a=g.attachment,T=g.pin,null==a&&(a=""),p.call(a," ")>=0?(K=a.split(" "),c=K[0],f=K[1]):f=c=a,u=n(this,W),("target"===c||"both"===c)&&(Pu[3]&&"bottom"===A.top&&(P-=L,A.top="top")),"together"===c&&(Pu[3]&&"bottom"===A.top&&("top"===m.top?(P-=L,A.top="top",P-=v,m.top="bottom"):"bottom"===m.top&&(P-=L,A.top="top",P+=v,m.top="top")),"middle"===A.top&&(P+v>u[3]&&"top"===m.top?(P-=v,m.top="bottom"):Pu[2]&&"right"===A.left&&(b-=B,A.left="left")),"together"===f&&(bu[2]&&"right"===A.left?"left"===m.left?(b-=B,A.left="left",b-=z,m.left="right"):"right"===m.left&&(b-=B,A.left="left",b+=z,m.left="left"):"center"===A.left&&(b+z>u[2]&&"left"===m.left?(b-=z,m.left="right"):bu[3]&&"top"===m.top&&(P-=v,m.top="bottom")),("element"===f||"both"===f)&&(bu[2]&&"left"===m.left&&(b-=z,m.left="right")),"string"==typeof T?T=function(){var t,e,i,o;for(i=T.split(","),o=[],e=0,t=i.length;t>e;e++)C=i[e],o.push(C.trim());return o}():T===!0&&(T=["top","left","right","bottom"]),T||(T=[]),O=[],y=[],P=0?(P=u[1],O.push("top")):y.push("top")),P+v>u[3]&&(p.call(T,"bottom")>=0?(P=u[3]-v,O.push("bottom")):y.push("bottom")),b=0?(b=u[0],O.push("left")):y.push("left")),b+z>u[2]&&(p.call(T,"right")>=0?(b=u[2]-z,O.push("right")):y.push("right")),O.length)for(x=null!=(Q=this.options.pinnedClass)?Q:this.getClass("pinned"),r.push(x),R=0,U=O.length;U>R;R++)E=O[R],r.push(""+x+"-"+E);if(y.length)for(w=null!=(te=this.options.outOfBoundsClass)?te:this.getClass("out-of-bounds"),r.push(w),D=0,I=y.length;I>D;D++)E=y[D],r.push(""+w+"-"+E);(p.call(O,"left")>=0||p.call(O,"right")>=0)&&(m.left=A.left=!1),(p.call(O,"top")>=0||p.call(O,"bottom")>=0)&&(m.top=A.top=!1),(A.top!==M.top||A.left!==M.left||m.top!==this.attachment.top||m.left!==this.attachment.left)&&this.updateAttachClasses(m,A)}return i(function(){return l(ee.target,r,h),l(ee.element,r,h)}),{top:P,left:b}}})}.call(this),function(){var t,e,i,o;o=this.Tether.Utils,e=o.getBounds,i=o.updateClasses,t=o.defer,this.Tether.modules.push({position:function(o){var n,s,r,h,l,a,p,u,f,c,d,g,m,v,b,y,w,C,T,O,x,S,E,A,M,L=this;if(d=o.top,a=o.left,x=this.cache("element-bounds",function(){return e(L.element)}),l=x.height,g=x.width,c=this.getTargetBounds(),h=d+l,p=a+g,n=[],d<=c.bottom&&h>=c.top)for(S=["left","right"],m=0,w=S.length;w>m;m++)u=S[m],((E=c[u])===a||E===p)&&n.push(u);if(a<=c.right&&p>=c.left)for(A=["top","bottom"],v=0,C=A.length;C>v;v++)u=A[v],((M=c[u])===d||M===h)&&n.push(u);for(r=[],s=[],f=["left","top","right","bottom"],r.push(this.getClass("abutted")),b=0,T=f.length;T>b;b++)u=f[b],r.push(""+this.getClass("abutted")+"-"+u);for(n.length&&s.push(this.getClass("abutted")),y=0,O=n.length;O>y;y++)u=n[y],s.push(""+this.getClass("abutted")+"-"+u);return t(function(){return i(L.target,s,r),i(L.element,s,r)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(t){var e,i,o,n,s,r,h;return r=t.top,e=t.left,this.options.shift?(i=function(t){return"function"==typeof t?t.call(this,{top:r,left:e}):t},o=i(this.options.shift),"string"==typeof o?(o=o.split(" "),o[1]||(o[1]=o[0]),s=o[0],n=o[1],s=parseFloat(s,10),n=parseFloat(n,10)):(h=[o.top,o.left],s=h[0],n=h[1]),r+=s,e+=n,{top:r,left:e}):void 0}})}.call(this),this.Tether}),function(){var t,e,i,o,n,s,r,h,l,a,p,u,f,c,d,g=function(t,e){return function(){return t.apply(e,arguments)}},m={}.hasOwnProperty,v=function(t,e){function i(){this.constructor=t}for(var o in e)m.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t};d=Tether.Utils,h=d.extend,f=d.removeClass,s=d.addClass,a=d.hasClass,e=d.Evented,l=d.getBounds,c=d.uniqueId,i=new e,t={top:"bottom center",left:"middle right",right:"middle left",bottom:"top center",center:"middle center"},r=function(t){var e;return e=document.createElement("div"),e.innerHTML=t,e.children[0]},p=function(t,e){var i,o,n,s,r,h;return i=null!=(o=null!=(n=null!=(s=null!=(r=null!=(h=t.matches)?h:t.matchesSelector)?r:t.msMatchesSelector)?s:t.webkitMatchesSelector)?n:t.mozMatchesSelector)?o:t.oMatchesSelector,i.call(t,e)},u=function(t,e){var i,o,n,s,r,h;if(null==t)return t;if("object"==typeof t)return t;for(s=t.split(" "),s.length>e.length&&(s[0]=s.slice(0,+(s.length-e.length)+1||9e9).join(" "),s.splice(1,s.length-e.length)),o={},i=r=0,h=e.length;h>r;i=++r)n=e[i],o[n]=s[i];return o},o=function(e){function i(t,e){this.tour=t,this.destroy=g(this.destroy,this),this.scrollTo=g(this.scrollTo,this),this.complete=g(this.complete,this),this.cancel=g(this.cancel,this),this.isOpen=g(this.isOpen,this),this.hide=g(this.hide,this),this._show=g(this._show,this),this.show=g(this.show,this),this.setOptions(e)}return v(i,e),i.prototype.setOptions=function(t){var e,i,o,n;if(this.options=null!=t?t:{},this.destroy(),this.id=this.options.id||this.id||"step-"+c(),this.options.when){n=this.options.when;for(e in n)i=n[e],this.on(e,i,this)}return null!=(o=this.options).buttons?(o=this.options).buttons:o.buttons=[{text:"Next",action:this.tour.next}]},i.prototype.getTour=function(){return this.tour},i.prototype.bindAdvance=function(){var t,e,i,o,n=this;return o=u(this.options.advanceOn,["selector","event"]),t=o.event,i=o.selector,e=function(t){if(n.isOpen())if(null!=i){if(p(t.target,i))return n.tour.next()}else if(n.el&&t.target===n.el)return n.tour.next()},document.body.addEventListener(t,e),this.on("destroy",function(){return document.body.removeEventListener(t,e)})},i.prototype.getAttachTo=function(){var t,e;if(t=u(this.options.attachTo,["element","on"]),null==t&&(t={}),e=t.element,"string"==typeof t.element&&(t.element=document.querySelector(t.element),null==t.element))throw new Error("The element for this Shepherd step was not found "+e);return t},i.prototype.setupTether=function(){var e,i,o;if("undefined"==typeof Tether||null===Tether)throw new Error("Using the attachment feature of Shepherd requires the Tether library");return i=this.getAttachTo(),e=t[i.on||"right"],null==i.element&&(i.element="viewport",e="middle center"),o={classPrefix:"shepherd",element:this.el,constraints:[{to:"window",pin:!0,attachment:"together"}],target:i.element,offset:i.offset||"0 0",attachment:e},this.tether=new Tether(h(o,this.options.tetherOptions))},i.prototype.show=function(){var t,e,i,o=this;return null!=(e="function"==typeof(t=this.options).beforeShowPromise&&null!=(i=t.beforeShowPromise())?i.then(function(){return o._show()}):void 0)?e:this._show()},i.prototype._show=function(){var t=this;return this.trigger("before-show"),null==this.el&&this.render(),s(this.el,"shepherd-open"),document.body.setAttribute("data-shepherd-step",this.id),this.setupTether(),this.options.scrollTo&&setTimeout(function(){return t.scrollTo()}),this.trigger("show")},i.prototype.hide=function(){var t;return this.trigger("before-hide"),f(this.el,"shepherd-open"),document.body.removeAttribute("data-shepherd-step"),null!=(t=this.tether)&&t.destroy(),this.tether=null,this.trigger("hide")},i.prototype.isOpen=function(){return a(this.el,"shepherd-open")},i.prototype.cancel=function(){return this.tour.cancel(),this.trigger("cancel")},i.prototype.complete=function(){return this.tour.complete(),this.trigger("complete")},i.prototype.scrollTo=function(){var t;return t=this.getAttachTo().element,null!=this.options.scrollToHandler?this.options.scrollToHandler(t):null!=t?t.scrollIntoView():void 0},i.prototype.destroy=function(){var t;return null!=this.el&&(document.body.removeChild(this.el),delete this.el),null!=(t=this.tether)&&t.destroy(),this.tether=null,this.trigger("destroy")},i.prototype.render=function(){var t,e,i,o,n,s,h,l,a,p,u,f,c,d,g,m,v;if(null!=this.el&&this.destroy(),this.el=r("
    "),o=document.createElement("div"),o.className="shepherd-content",this.el.appendChild(o),s=document.createElement("header"),o.appendChild(s),null!=this.options.title&&(s.innerHTML+="

    "+this.options.title+"

    ",this.el.className+=" shepherd-has-title"),this.options.showCancelLink&&(h=r(""),s.appendChild(h),this.el.className+=" shepherd-has-cancel-link",this.bindCancelLink(h)),null!=this.options.text){if(p=r("
    "),a=this.options.text,"function"==typeof a&&(a=this.options.text.call(this,p)),a instanceof HTMLElement)p.appendChild(a);else for("string"==typeof a&&(a=[a]),u=0,c=a.length;c>u;u++)l=a[u],p.innerHTML+="

    "+l+"

    ";o.appendChild(p)}if(n=document.createElement("footer"),this.options.buttons){for(e=r("
      "),m=this.options.buttons,f=0,d=m.length;d>f;f++)i=m[f],t=r("
    • "+i.text+""),e.appendChild(t),this.bindButtonEvents(i,t.querySelector("a"));n.appendChild(e)}return o.appendChild(n),document.body.appendChild(this.el),this.setupTether(),this.options.advanceOn?this.bindAdvance():void 0},i.prototype.bindCancelLink=function(t){var e=this;return t.addEventListener("click",function(t){return t.preventDefault(),e.cancel()})},i.prototype.bindButtonEvents=function(t,e){var i,o,n,s,r=this;null==t.events&&(t.events={}),null!=t.action&&(t.events.click=t.action),s=t.events;for(i in s)o=s[i],"string"==typeof o&&(n=o,o=function(){return r.tour.show(n)}),e.addEventListener(i,o);return this.on("destroy",function(){var n,s;n=t.events,s=[];for(i in n)o=n[i],s.push(e.removeEventListener(i,o));return s})},i}(e),n=function(t){function e(t){var e,o,n,s,r,h,l=this;for(this.options=null!=t?t:{},this.hide=g(this.hide,this),this.complete=g(this.complete,this),this.cancel=g(this.cancel,this),this.back=g(this.back,this),this.next=g(this.next,this),this.steps=null!=(r=this.options.steps)?r:[],h=["complete","cancel","hide","start","show","active","inactive"],o=function(t){return l.on(t,function(e){return null==e&&(e={}),e.tour=l,i.trigger(t,e)})},n=0,s=h.length;s>n;n++)e=h[n],o(e)}return v(e,t),e.prototype.addStep=function(t,e){var i;return null==e&&(e=t),e instanceof o?e.tour=this:(("string"==(i=typeof t)||"number"===i)&&(e.id=t.toString()),e=h({},this.options.defaults,e),e=new o(this,e)),this.steps.push(e),this},e.prototype.getById=function(t){var e,i,o,n;for(n=this.steps,i=0,o=n.length;o>i;i++)if(e=n[i],e.id===t)return e},e.prototype.getCurrentStep=function(){return this.currentStep},e.prototype.next=function(){var t;return t=this.steps.indexOf(this.currentStep),t===this.steps.length-1?(this.hide(t),this.trigger("complete"),this.done()):this.show(t+1)},e.prototype.back=function(){var t;return t=this.steps.indexOf(this.currentStep),this.show(t-1)},e.prototype.cancel=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("cancel"),this.done()},e.prototype.complete=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("complete"),this.done()},e.prototype.hide=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("hide"),this.done()},e.prototype.done=function(){return i.activeTour=null,f(document.body,"shepherd-active"),this.trigger("inactive",{tour:this})},e.prototype.show=function(t){var e;return null==t&&(t=0),this.currentStep?this.currentStep.hide():(s(document.body,"shepherd-active"),this.trigger("active",{tour:this})),i.activeTour=this,e="string"==typeof t?this.getById(t):this.steps[t],e?(this.trigger("show",{step:e,previous:this.currentStep}),this.currentStep=e,e.show()):void 0},e.prototype.start=function(){return this.trigger("start"),this.currentStep=null,this.next()},e}(e),h(i,{Tour:n,Step:o,Evented:e}),window.Shepherd=i}.call(this); \ No newline at end of file +/*! shepherd 0.7.2 */ +!function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e(require,exports,module):t.Tether=e()}(this,function(t,e,i){return function(){var t,e,i,o,n,s,r,h,l,a,p,u,f,d,c,g,m,v,b,y={}.hasOwnProperty,w=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1},C=[].slice;null==this.Tether&&(this.Tether={modules:[]}),u=function(t){var e,i,o,n,s;if(i=getComputedStyle(t).position,"fixed"===i)return t;for(o=void 0,e=t;e=e.parentNode;){try{n=getComputedStyle(e)}catch(r){}if(null==n)return e;if(/(auto|scroll)/.test(n.overflow+n.overflowY+n.overflowX)&&("absolute"!==i||"relative"===(s=n.position)||"absolute"===s||"fixed"===s))return e}return document.body},m=function(){var t;return t=0,function(){return t++}}(),b={},a=function(t){var e,o,s,r,h;if(s=t._tetherZeroElement,null==s&&(s=t.createElement("div"),s.setAttribute("data-tether-id",m()),n(s.style,{top:0,left:0,position:"absolute"}),t.body.appendChild(s),t._tetherZeroElement=s),e=s.getAttribute("data-tether-id"),null==b[e]){b[e]={},h=s.getBoundingClientRect();for(o in h)r=h[o],b[e][o]=r;i(function(){return b[e]=void 0})}return b[e]},d=null,r=function(t){var e,i,o,n,s,r,h;t===document?(i=document,t=document.documentElement):i=t.ownerDocument,o=i.documentElement,e={},h=t.getBoundingClientRect();for(n in h)r=h[n],e[n]=r;return s=a(i),e.top-=s.top,e.left-=s.left,null==e.width&&(e.width=document.body.scrollWidth-e.left-e.right),null==e.height&&(e.height=document.body.scrollHeight-e.top-e.bottom),e.top=e.top-o.clientTop,e.left=e.left-o.clientLeft,e.right=i.body.clientWidth-e.width-e.left,e.bottom=i.body.clientHeight-e.height-e.top,e},l=function(t){return t.offsetParent||document.documentElement},p=function(){var t,e,i,o,s;return t=document.createElement("div"),t.style.width="100%",t.style.height="200px",e=document.createElement("div"),n(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e),o=t.offsetWidth,e.style.overflow="scroll",s=t.offsetWidth,o===s&&(s=e.clientWidth),document.body.removeChild(e),i=o-s,{width:i,height:i}},n=function(t){var e,i,o,n,s,r,h;for(null==t&&(t={}),e=[],Array.prototype.push.apply(e,arguments),h=e.slice(1),s=0,r=h.length;r>s;s++)if(o=h[s])for(i in o)y.call(o,i)&&(n=o[i],t[i]=n);return t},c=function(t,e){var i,o,n,s,r,l;if(null!=t.classList){for(r=e.split(" "),l=[],n=0,s=r.length;s>n;n++)o=r[n],o.trim()&&l.push(t.classList.remove(o));return l}return i=h(t).replace(new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi")," "),g(t,i)},e=function(t,e){var i,o,n,s,r;if(null!=t.classList){for(s=e.split(" "),r=[],o=0,n=s.length;n>o;o++)i=s[o],i.trim()&&r.push(t.classList.add(i));return r}return c(t,e),i=h(t)+(" "+e),g(t,i)},f=function(t,e){return null!=t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(h(t))},h=function(t){return t.className instanceof SVGAnimatedString?t.className.baseVal:t.className},g=function(t,e){return t.setAttribute("class",e)},v=function(t,i,o){var n,s,r,h,l,a;for(s=0,h=o.length;h>s;s++)n=o[s],w.call(i,n)<0&&f(t,n)&&c(t,n);for(a=[],r=0,l=i.length;l>r;r++)n=i[r],a.push(f(t,n)?void 0:e(t,n));return a},o=[],i=function(t){return o.push(t)},s=function(){var t,e;for(e=[];t=o.pop();)e.push(t());return e},t=function(){function t(){}return t.prototype.on=function(t,e,i,o){var n;return null==o&&(o=!1),null==this.bindings&&(this.bindings={}),null==(n=this.bindings)[t]&&(n[t]=[]),this.bindings[t].push({handler:e,ctx:i,once:o})},t.prototype.once=function(t,e,i){return this.on(t,e,i,!0)},t.prototype.off=function(t,e){var i,o,n;if(null!=(null!=(o=this.bindings)?o[t]:void 0)){if(null==e)return delete this.bindings[t];for(i=0,n=[];i=e&&e>=t-i},S=function(){var t,e,i,o,n;for(t=document.createElement("div"),n=["transform","webkitTransform","OTransform","MozTransform","msTransform"],i=0,o=n.length;o>i;i++)if(e=n[i],void 0!==t.style[e])return e}(),O=[],C=function(){var t,e,i;for(e=0,i=O.length;i>e;e++)t=O[e],t.position(!1);return p()},v=function(){var t;return null!=(t="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?t:+new Date},function(){var t,e,i,o,n,s,r,h,l;for(e=null,i=null,o=null,n=function(){if(null!=i&&i>16)return i=Math.min(i-16,250),void(o=setTimeout(n,250));if(!(null!=e&&v()-e<10))return null!=o&&(clearTimeout(o),o=null),e=v(),C(),i=v()-e},h=["resize","scroll","touchmove"],l=[],s=0,r=h.length;r>s;s++)t=h[s],l.push(window.addEventListener(t,n));return l}(),t={center:"center",left:"right",right:"left"},e={middle:"middle",top:"bottom",bottom:"top"},i={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},h=function(i,o){var n,s;return n=i.left,s=i.top,"auto"===n&&(n=t[o.left]),"auto"===s&&(s=e[o.top]),{left:n,top:s}},r=function(t){var e,o;return{left:null!=(e=i[t.left])?e:t.left,top:null!=(o=i[t.top])?o:t.top}},s=function(){var t,e,i,o,n,s,r;for(e=1<=arguments.length?L.call(arguments,0):[],i={top:0,left:0},n=0,s=e.length;s>n;n++)r=e[n],o=r.top,t=r.left,"string"==typeof o&&(o=parseFloat(o,10)),"string"==typeof t&&(t=parseFloat(t,10)),i.top+=o,i.left+=t;return i},b=function(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t},y=w=function(t){var e,i,o;return o=t.split(" "),i=o[0],e=o[1],{top:i,left:e}},A=function(){function t(t){this.position=_(this.position,this);var e,i,n,s,r;for(O.push(this),this.history=[],this.setOptions(t,!1),s=o.modules,i=0,n=s.length;n>i;i++)e=s[i],null!=(r=e.initialize)&&r.call(this);this.position()}return t.modules=[],t.prototype.getClass=function(t){var e,i;return(null!=(e=this.options.classes)?e[t]:void 0)?this.options.classes[t]:(null!=(i=this.options.classes)?i[t]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+t:t:""},t.prototype.setOptions=function(t,e){var i,o,s,r,h,l;for(this.options=t,null==e&&(e=!0),i={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=a(i,this.options),h=this.options,this.element=h.element,this.target=h.target,this.targetModifier=h.targetModifier,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),l=["element","target"],s=0,r=l.length;r>s;s++){if(o=l[s],null==this[o])throw new Error("Tether Error: Both element and target must be defined");null!=this[o].jquery?this[o]=this[o][0]:"string"==typeof this[o]&&(this[o]=document.querySelector(this[o]))}if(n(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&n(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=y(this.options.targetAttachment),this.attachment=y(this.options.attachment),this.offset=w(this.options.offset),this.targetOffset=w(this.options.targetOffset),null!=this.scrollParent&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParent=this.target:this.scrollParent=g(this.target),this.options.enabled!==!1?this.enable(e):void 0},t.prototype.getTargetBounds=function(){var t,e,i,o,n,s,r,h,l;if(null==this.targetModifier)return u(this.target);switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=u(this.target),n={height:t.height,width:t.width,top:t.top,left:t.left},n.height=Math.min(n.height,t.height-(pageYOffset-t.top)),n.height=Math.min(n.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),n.height=Math.min(innerHeight,n.height),n.height-=2,n.width=Math.min(n.width,t.width-(pageXOffset-t.left)),n.width=Math.min(n.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),n.width=Math.min(innerWidth,n.width),n.width-=2,n.topl.clientWidth||"scroll"===[h.overflow,h.overflowX]||this.target!==document.body,s=0,i&&(s=15),o=t.height-parseFloat(h.borderTopWidth)-parseFloat(h.borderBottomWidth)-s,n={width:15,height:.975*o*(o/l.scrollHeight),left:t.left+t.width-parseFloat(h.borderLeftWidth)-15},e=0,408>o&&this.target===document.body&&(e=-11e-5*Math.pow(o,2)-.00727*o+22.58),this.target!==document.body&&(n.height=Math.max(n.height,24)),r=this.target.scrollTop/(l.scrollHeight-o),n.top=r*(o-n.height-e)+t.top+parseFloat(h.borderTopWidth),this.target===document.body&&(n.height=Math.max(n.height,24)),n}},t.prototype.clearCache=function(){return this._cache={}},t.prototype.cache=function(t,e){return null==this._cache&&(this._cache={}),null==this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]},t.prototype.enable=function(t){return null==t&&(t=!0),this.options.addTargetClasses!==!1&&n(this.target,this.getClass("enabled")),n(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),t?this.position():void 0},t.prototype.disable=function(){return T(this.target,this.getClass("enabled")),T(this.element,this.getClass("enabled")),this.enabled=!1,null!=this.scrollParent?this.scrollParent.removeEventListener("scroll",this.position):void 0},t.prototype.destroy=function(){var t,e,i,o,n;for(this.disable(),n=[],t=i=0,o=O.length;o>i;t=++i){if(e=O[t],e===this){O.splice(t,1);break}n.push(void 0)}return n},t.prototype.updateAttachClasses=function(t,e){var i,o,n,s,r,h,a,p,u,f=this;for(null==t&&(t=this.attachment),null==e&&(e=this.targetAttachment),s=["left","top","bottom","right","middle","center"],(null!=(u=this._addAttachClasses)?u.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),i=null!=this._addAttachClasses?this._addAttachClasses:this._addAttachClasses=[],t.top&&i.push(""+this.getClass("element-attached")+"-"+t.top),t.left&&i.push(""+this.getClass("element-attached")+"-"+t.left),e.top&&i.push(""+this.getClass("target-attached")+"-"+e.top),e.left&&i.push(""+this.getClass("target-attached")+"-"+e.left),o=[],r=0,a=s.length;a>r;r++)n=s[r],o.push(""+this.getClass("element-attached")+"-"+n);for(h=0,p=s.length;p>h;h++)n=s[h],o.push(""+this.getClass("target-attached")+"-"+n);return l(function(){return null!=f._addAttachClasses?(x(f.element,f._addAttachClasses,o),f.options.addTargetClasses!==!1&&x(f.target,f._addAttachClasses,o),f._addAttachClasses=void 0):void 0})},t.prototype.position=function(t){var e,i,n,l,a,d,g,m,v,y,w,C,T,O,S,x,E,A,M,L,_,B,P,W,z,H,F,Y,k,N,X,j,q,U,I,R=this;if(null==t&&(t=!0),this.enabled){for(this.clearCache(),L=h(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,L),e=this.cache("element-bounds",function(){return u(R.element)}),z=e.width,n=e.height,0===z&&0===n&&null!=this.lastSize?(N=this.lastSize,z=N.width,n=N.height):this.lastSize={width:z,height:n},P=B=this.cache("target-bounds",function(){return R.getTargetBounds()}),v=b(r(this.attachment),{width:z,height:n}),_=b(r(L),P),a=b(this.offset,{width:z,height:n}),d=b(this.targetOffset,P),v=s(v,a),_=s(_,d),l=B.left+_.left-v.left,W=B.top+_.top-v.top,X=o.modules,H=0,Y=X.length;Y>H;H++){if(g=X[H],S=g.position.call(this,{left:l,top:W,targetAttachment:L,targetPos:B,attachment:this.attachment,elementPos:e,offset:v,targetOffset:_,manualOffset:a,manualTargetOffset:d,scrollbarSize:A}),S===!1)return!1;null!=S&&"object"==typeof S&&(W=S.top,l=S.left)}if(m={page:{top:W,left:l},viewport:{top:W-pageYOffset,bottom:pageYOffset-W-n+innerHeight,left:l-pageXOffset,right:pageXOffset-l-z+innerWidth}},document.body.scrollWidth>window.innerWidth&&(A=this.cache("scrollbar-size",c),m.viewport.bottom-=A.height),document.body.scrollHeight>window.innerHeight&&(A=this.cache("scrollbar-size",c),m.viewport.right-=A.width),(""!==(j=document.body.style.position)&&"static"!==j||""!==(q=document.body.parentElement.style.position)&&"static"!==q)&&(m.page.bottom=document.body.scrollHeight-W-n,m.page.right=document.body.scrollWidth-l-z),(null!=(U=this.options.optimizations)?U.moveElement:void 0)!==!1&&null==this.targetModifier){for(w=this.cache("target-offsetparent",function(){return f(R.target)}),O=this.cache("target-offsetparent-bounds",function(){return u(w)}),T=getComputedStyle(w),i=getComputedStyle(this.element),C=O,y={},I=["Top","Left","Bottom","Right"],F=0,k=I.length;k>F;F++)M=I[F],y[M.toLowerCase()]=parseFloat(T["border"+M+"Width"]);O.right=document.body.scrollWidth-O.left-C.width+y.right,O.bottom=document.body.scrollHeight-O.top-C.height+y.bottom,m.page.top>=O.top+y.top&&m.page.bottom>=O.bottom&&m.page.left>=O.left+y.left&&m.page.right>=O.right&&(E=w.scrollTop,x=w.scrollLeft,m.offset={top:m.page.top-O.top+E-y.top,left:m.page.left-O.left+x-y.left})}return this.move(m),this.history.unshift(m),this.history.length>3&&this.history.pop(),t&&p(),!0}},t.prototype.move=function(t){var e,i,o,n,s,r,h,p,u,d,c,g,m,v,b,y,w,C=this;if(null!=this.element.parentNode){p={};for(d in t){p[d]={};for(n in t[d]){for(o=!1,y=this.history,v=0,b=y.length;b>v;v++)if(h=y[v],!E(null!=(w=h[d])?w[n]:void 0,t[d][n])){o=!0;break}o||(p[d][n]=!0)}}e={top:"",left:"",right:"",bottom:""},u=function(t,i){var o,n,s;return(null!=(s=C.options.optimizations)?s.gpu:void 0)===!1?(t.top?e.top=""+i.top+"px":e.bottom=""+i.bottom+"px",t.left?e.left=""+i.left+"px":e.right=""+i.right+"px"):(t.top?(e.top=0,n=i.top):(e.bottom=0,n=-i.bottom),t.left?(e.left=0,o=i.left):(e.right=0,o=-i.right),e[S]="translateX("+Math.round(o)+"px) translateY("+Math.round(n)+"px)","msTransform"!==S?e[S]+=" translateZ(0)":void 0)},s=!1,(p.page.top||p.page.bottom)&&(p.page.left||p.page.right)?(e.position="absolute",u(p.page,t.page)):(p.viewport.top||p.viewport.bottom)&&(p.viewport.left||p.viewport.right)?(e.position="fixed",u(p.viewport,t.viewport)):null!=p.offset&&p.offset.top&&p.offset.left?(e.position="absolute",r=this.cache("target-offsetparent",function(){return f(C.target)}),f(this.element)!==r&&l(function(){return C.element.parentNode.removeChild(C.element),r.appendChild(C.element)}),u(p.offset,t.offset),s=!0):(e.position="absolute",u({top:!0,left:!0},t.page)),s||"BODY"===this.element.parentNode.tagName||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element)),m={},g=!1;for(n in e)c=e[n],i=this.element.style[n],""===i||""===c||"top"!==n&&"left"!==n&&"bottom"!==n&&"right"!==n||(i=parseFloat(i),c=parseFloat(c)),i!==c&&(g=!0,m[n]=e[n]);return g?l(function(){return a(C.element.style,m)}):void 0}},t}(),o.position=C,this.Tether=a(A,o)}.call(this),function(){var t,e,i,o,n,s,r,h,l,a,p=[].indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(e in this&&this[e]===t)return e;return-1};a=this.Tether.Utils,r=a.getOuterSize,s=a.getBounds,h=a.getSize,o=a.extend,l=a.updateClasses,i=a.defer,e={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"},t=["left","top","right","bottom"],n=function(e,i){var o,n,r,h,l,a,p;if("scrollParent"===i?i=e.scrollParent:"window"===i&&(i=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),i===document&&(i=i.documentElement),null!=i.nodeType)for(n=h=s(i),l=getComputedStyle(i),i=[n.left,n.top,h.width+n.left,h.height+n.top],o=a=0,p=t.length;p>a;o=++a)r=t[o],r=r[0].toUpperCase()+r.substr(1),"Top"===r||"Left"===r?i[o]+=parseFloat(l["border"+r+"Width"]):i[o]-=parseFloat(l["border"+r+"Width"]);return i},this.Tether.modules.push({position:function(e){var r,h,a,u,f,d,c,g,m,v,b,y,w,C,T,O,S,x,E,A,M,L,_,B,P,W,z,H,F,Y,k,N,X,j,q,U,I,R,D,V,Z,$,G,J,K,Q,tt,et=this;if(W=e.top,b=e.left,M=e.targetAttachment,!this.options.constraints)return!0;for(x=function(e){var i,o,n,s;for(et.removeClass(e),s=[],o=0,n=t.length;n>o;o++)i=t[o],s.push(et.removeClass(""+e+"-"+i));return s},V=this.cache("element-bounds",function(){return s(et.element)}),v=V.height,z=V.width,0===z&&0===v&&null!=this.lastSize&&(Z=this.lastSize,z=Z.width,v=Z.height),_=this.cache("target-bounds",function(){return et.getTargetBounds()}),L=_.height,B=_.width,A={},m={},h=[this.getClass("pinned"),this.getClass("out-of-bounds")],$=this.options.constraints,H=0,N=$.length;N>H;H++)g=$[H],g.outOfBoundsClass&&h.push(g.outOfBoundsClass),g.pinnedClass&&h.push(g.pinnedClass);for(F=0,X=h.length;X>F;F++)for(c=h[F],G=["left","top","right","bottom"],Y=0,j=G.length;j>Y;Y++)E=G[Y],h.push(""+c+"-"+E);for(r=[],A=o({},M),m=o({},this.attachment),J=this.options.constraints,k=0,q=J.length;q>k;k++){if(g=J[k],P=g.to,a=g.attachment,T=g.pin,null==a&&(a=""),p.call(a," ")>=0?(K=a.split(" "),d=K[0],f=K[1]):f=d=a,u=n(this,P),("target"===d||"both"===d)&&(Wu[3]&&"bottom"===A.top&&(W-=L,A.top="top")),"together"===d&&(Wu[3]&&"bottom"===A.top&&("top"===m.top?(W-=L,A.top="top",W-=v,m.top="bottom"):"bottom"===m.top&&(W-=L,A.top="top",W+=v,m.top="top")),"middle"===A.top&&(W+v>u[3]&&"top"===m.top?(W-=v,m.top="bottom"):Wu[2]&&"right"===A.left&&(b-=B,A.left="left")),"together"===f&&(bu[2]&&"right"===A.left?"left"===m.left?(b-=B,A.left="left",b-=z,m.left="right"):"right"===m.left&&(b-=B,A.left="left",b+=z,m.left="left"):"center"===A.left&&(b+z>u[2]&&"left"===m.left?(b-=z,m.left="right"):bu[3]&&"top"===m.top&&(W-=v,m.top="bottom")),("element"===f||"both"===f)&&(bu[2]&&"left"===m.left&&(b-=z,m.left="right")),"string"==typeof T?T=function(){var t,e,i,o;for(i=T.split(","),o=[],e=0,t=i.length;t>e;e++)C=i[e],o.push(C.trim());return o}():T===!0&&(T=["top","left","right","bottom"]),T||(T=[]),O=[],y=[],W=0?(W=u[1],O.push("top")):y.push("top")),W+v>u[3]&&(p.call(T,"bottom")>=0?(W=u[3]-v,O.push("bottom")):y.push("bottom")),b=0?(b=u[0],O.push("left")):y.push("left")),b+z>u[2]&&(p.call(T,"right")>=0?(b=u[2]-z,O.push("right")):y.push("right")),O.length)for(S=null!=(Q=this.options.pinnedClass)?Q:this.getClass("pinned"),r.push(S),R=0,U=O.length;U>R;R++)E=O[R],r.push(""+S+"-"+E);if(y.length)for(w=null!=(tt=this.options.outOfBoundsClass)?tt:this.getClass("out-of-bounds"),r.push(w),D=0,I=y.length;I>D;D++)E=y[D],r.push(""+w+"-"+E);(p.call(O,"left")>=0||p.call(O,"right")>=0)&&(m.left=A.left=!1),(p.call(O,"top")>=0||p.call(O,"bottom")>=0)&&(m.top=A.top=!1),(A.top!==M.top||A.left!==M.left||m.top!==this.attachment.top||m.left!==this.attachment.left)&&this.updateAttachClasses(m,A)}return i(function(){return et.options.addTargetClasses!==!1&&l(et.target,r,h),l(et.element,r,h)}),{top:W,left:b}}})}.call(this),function(){var t,e,i,o;o=this.Tether.Utils,e=o.getBounds,i=o.updateClasses,t=o.defer,this.Tether.modules.push({position:function(o){var n,s,r,h,l,a,p,u,f,d,c,g,m,v,b,y,w,C,T,O,S,x,E,A,M,L=this;if(c=o.top,a=o.left,S=this.cache("element-bounds",function(){return e(L.element)}),l=S.height,g=S.width,d=this.getTargetBounds(),h=c+l,p=a+g,n=[],c<=d.bottom&&h>=d.top)for(x=["left","right"],m=0,w=x.length;w>m;m++)u=x[m],((E=d[u])===a||E===p)&&n.push(u);if(a<=d.right&&p>=d.left)for(A=["top","bottom"],v=0,C=A.length;C>v;v++)u=A[v],((M=d[u])===c||M===h)&&n.push(u);for(r=[],s=[],f=["left","top","right","bottom"],r.push(this.getClass("abutted")),b=0,T=f.length;T>b;b++)u=f[b],r.push(""+this.getClass("abutted")+"-"+u);for(n.length&&s.push(this.getClass("abutted")),y=0,O=n.length;O>y;y++)u=n[y],s.push(""+this.getClass("abutted")+"-"+u);return t(function(){return L.options.addTargetClasses!==!1&&i(L.target,s,r),i(L.element,s,r)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(t){var e,i,o,n,s,r,h;return r=t.top,e=t.left,this.options.shift?(i=function(t){return"function"==typeof t?t.call(this,{top:r,left:e}):t},o=i(this.options.shift),"string"==typeof o?(o=o.split(" "),o[1]||(o[1]=o[0]),s=o[0],n=o[1],s=parseFloat(s,10),n=parseFloat(n,10)):(h=[o.top,o.left],s=h[0],n=h[1]),r+=s,e+=n,{top:r,left:e}):void 0}})}.call(this),this.Tether}),function(){var t,e,i,o,n,s,r,h,l,a,p,u,f,d,c,g=function(t,e){return function(){return t.apply(e,arguments)}},m={}.hasOwnProperty,v=function(t,e){function i(){this.constructor=t}for(var o in e)m.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t};c=Tether.Utils,h=c.extend,f=c.removeClass,s=c.addClass,a=c.hasClass,e=c.Evented,l=c.getBounds,d=c.uniqueId,i=new e,t={top:"bottom center",left:"middle right",right:"middle left",bottom:"top center",center:"middle center"},r=function(t){var e;return e=document.createElement("div"),e.innerHTML=t,e.children[0]},p=function(t,e){var i,o,n,s,r,h;return i=null!=(o=null!=(n=null!=(s=null!=(r=null!=(h=t.matches)?h:t.matchesSelector)?r:t.msMatchesSelector)?s:t.webkitMatchesSelector)?n:t.mozMatchesSelector)?o:t.oMatchesSelector,i.call(t,e)},u=function(t,e){var i,o,n,s,r,h;if(null==t)return t;if("object"==typeof t)return t;for(s=t.split(" "),s.length>e.length&&(s[0]=s.slice(0,+(s.length-e.length)+1||9e9).join(" "),s.splice(1,s.length-e.length)),o={},i=r=0,h=e.length;h>r;i=++r)n=e[i],o[n]=s[i];return o},o=function(e){function i(t,e){this.tour=t,this.destroy=g(this.destroy,this),this.scrollTo=g(this.scrollTo,this),this.complete=g(this.complete,this),this.cancel=g(this.cancel,this),this.isOpen=g(this.isOpen,this),this.hide=g(this.hide,this),this._show=g(this._show,this),this.show=g(this.show,this),this.setOptions(e)}return v(i,e),i.prototype.setOptions=function(t){var e,i,o,n;if(this.options=null!=t?t:{},this.destroy(),this.id=this.options.id||this.id||"step-"+d(),this.options.when){n=this.options.when;for(e in n)i=n[e],this.on(e,i,this)}return null!=(o=this.options).buttons?(o=this.options).buttons:o.buttons=[{text:"Next",action:this.tour.next}]},i.prototype.getTour=function(){return this.tour},i.prototype.bindAdvance=function(){var t,e,i,o,n=this;return o=u(this.options.advanceOn,["selector","event"]),t=o.event,i=o.selector,e=function(t){if(n.isOpen())if(null!=i){if(p(t.target,i))return n.tour.next()}else if(n.el&&t.target===n.el)return n.tour.next()},document.body.addEventListener(t,e),this.on("destroy",function(){return document.body.removeEventListener(t,e)})},i.prototype.getAttachTo=function(){var t,e;if(t=u(this.options.attachTo,["element","on"]),null==t&&(t={}),e=t.element,"string"==typeof t.element&&(t.element=document.querySelector(t.element),null==t.element))throw new Error("The element for this Shepherd step was not found "+e);return t},i.prototype.setupTether=function(){var e,i,o;if("undefined"==typeof Tether||null===Tether)throw new Error("Using the attachment feature of Shepherd requires the Tether library");return i=this.getAttachTo(),e=t[i.on||"right"],null==i.element&&(i.element="viewport",e="middle center"),o={classPrefix:"shepherd",element:this.el,constraints:[{to:"window",pin:!0,attachment:"together"}],target:i.element,offset:i.offset||"0 0",attachment:e},this.tether=new Tether(h(o,this.options.tetherOptions))},i.prototype.show=function(){var t,e,i,o=this;return null!=(e="function"==typeof(t=this.options).beforeShowPromise&&null!=(i=t.beforeShowPromise())?i.then(function(){return o._show()}):void 0)?e:this._show()},i.prototype._show=function(){var t=this;return this.trigger("before-show"),null==this.el&&this.render(),s(this.el,"shepherd-open"),document.body.setAttribute("data-shepherd-step",this.id),this.setupTether(),this.options.scrollTo&&setTimeout(function(){return t.scrollTo()}),this.trigger("show")},i.prototype.hide=function(){var t;return this.trigger("before-hide"),f(this.el,"shepherd-open"),document.body.removeAttribute("data-shepherd-step"),null!=(t=this.tether)&&t.destroy(),this.tether=null,this.trigger("hide")},i.prototype.isOpen=function(){return a(this.el,"shepherd-open")},i.prototype.cancel=function(){return this.tour.cancel(),this.trigger("cancel")},i.prototype.complete=function(){return this.tour.complete(),this.trigger("complete")},i.prototype.scrollTo=function(){var t;return t=this.getAttachTo().element,null!=this.options.scrollToHandler?this.options.scrollToHandler(t):null!=t?t.scrollIntoView():void 0},i.prototype.destroy=function(){var t;return null!=this.el&&(document.body.removeChild(this.el),delete this.el),null!=(t=this.tether)&&t.destroy(),this.tether=null,this.trigger("destroy")},i.prototype.render=function(){var t,e,i,o,n,s,h,l,a,p,u,f,d,c,g,m,v;if(null!=this.el&&this.destroy(),this.el=r("
      "),o=document.createElement("div"),o.className="shepherd-content",this.el.appendChild(o),s=document.createElement("header"),o.appendChild(s),null!=this.options.title&&(s.innerHTML+="

      "+this.options.title+"

      ",this.el.className+=" shepherd-has-title"),this.options.showCancelLink&&(h=r(""),s.appendChild(h),this.el.className+=" shepherd-has-cancel-link",this.bindCancelLink(h)),null!=this.options.text){if(p=r("
      "),a=this.options.text,"function"==typeof a&&(a=this.options.text.call(this,p)),a instanceof HTMLElement)p.appendChild(a);else for("string"==typeof a&&(a=[a]),u=0,d=a.length;d>u;u++)l=a[u],p.innerHTML+="

      "+l+"

      ";o.appendChild(p)}if(n=document.createElement("footer"),this.options.buttons){for(e=r("
        "),m=this.options.buttons,f=0,c=m.length;c>f;f++)i=m[f],t=r("
      • "+i.text+""),e.appendChild(t),this.bindButtonEvents(i,t.querySelector("a"));n.appendChild(e)}return o.appendChild(n),document.body.appendChild(this.el),this.setupTether(),this.options.advanceOn?this.bindAdvance():void 0},i.prototype.bindCancelLink=function(t){var e=this;return t.addEventListener("click",function(t){return t.preventDefault(),e.cancel()})},i.prototype.bindButtonEvents=function(t,e){var i,o,n,s,r=this;null==t.events&&(t.events={}),null!=t.action&&(t.events.click=t.action),s=t.events;for(i in s)o=s[i],"string"==typeof o&&(n=o,o=function(){return r.tour.show(n)}),e.addEventListener(i,o);return this.on("destroy",function(){var n,s;n=t.events,s=[];for(i in n)o=n[i],s.push(e.removeEventListener(i,o));return s})},i}(e),n=function(t){function e(t){var e,o,n,s,r,h,l=this;for(this.options=null!=t?t:{},this.hide=g(this.hide,this),this.complete=g(this.complete,this),this.cancel=g(this.cancel,this),this.back=g(this.back,this),this.next=g(this.next,this),this.steps=null!=(r=this.options.steps)?r:[],h=["complete","cancel","hide","start","show","active","inactive"],o=function(t){return l.on(t,function(e){return null==e&&(e={}),e.tour=l,i.trigger(t,e)})},n=0,s=h.length;s>n;n++)e=h[n],o(e)}return v(e,t),e.prototype.addStep=function(t,e){var i;return null==e&&(e=t),e instanceof o?e.tour=this:(("string"==(i=typeof t)||"number"===i)&&(e.id=t.toString()),e=h({},this.options.defaults,e),e=new o(this,e)),this.steps.push(e),this},e.prototype.getById=function(t){var e,i,o,n;for(n=this.steps,i=0,o=n.length;o>i;i++)if(e=n[i],e.id===t)return e},e.prototype.getCurrentStep=function(){return this.currentStep},e.prototype.next=function(){var t;return t=this.steps.indexOf(this.currentStep),t===this.steps.length-1?(this.hide(t),this.trigger("complete"),this.done()):this.show(t+1)},e.prototype.back=function(){var t;return t=this.steps.indexOf(this.currentStep),this.show(t-1)},e.prototype.cancel=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("cancel"),this.done()},e.prototype.complete=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("complete"),this.done()},e.prototype.hide=function(){var t;return null!=(t=this.currentStep)&&t.hide(),this.trigger("hide"),this.done()},e.prototype.done=function(){return i.activeTour=null,f(document.body,"shepherd-active"),this.trigger("inactive",{tour:this})},e.prototype.show=function(t){var e;return null==t&&(t=0),this.currentStep?this.currentStep.hide():(s(document.body,"shepherd-active"),this.trigger("active",{tour:this})),i.activeTour=this,e="string"==typeof t?this.getById(t):this.steps[t],e?(this.trigger("show",{step:e,previous:this.currentStep}),this.currentStep=e,e.show()):void 0},e.prototype.start=function(){return this.trigger("start"),this.currentStep=null,this.next()},e}(e),h(i,{Tour:n,Step:o,Evented:e}),window.Shepherd=i}.call(this); \ No newline at end of file