diff --git a/examples/login/.project b/examples/login/.project new file mode 100644 index 00000000..6b522dce --- /dev/null +++ b/examples/login/.project @@ -0,0 +1,22 @@ + + + login + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + com.pandora.projects.ui.MKeyBuilder + + + + + + com.pandora.projects.ui.MKeyNature + + diff --git a/examples/login/css/mui.css b/examples/login/css/mui.css new file mode 100644 index 00000000..d27fb376 --- /dev/null +++ b/examples/login/css/mui.css @@ -0,0 +1,3567 @@ +/*! + * ===================================================== + * Mui v1.2.0 (https://github.com/dcloudio/mui) + * ===================================================== + */ + +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; +} + +body { + margin: 0; +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} + +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} + +audio:not([controls]) { + display: none; + height: 0; +} + +[hidden], +template { + display: none; +} + +a { + background: transparent; +} + +a:active, +a:hover { + outline: 0; +} + +abbr[title] { + border-bottom: 1px dotted; +} + +b, +strong { + font-weight: bold; +} + +dfn { + font-style: italic; +} + +h1 { + margin: .67em 0; + font-size: 2em; +} + +mark { + color: #000; + background: #ff0; +} + +small { + font-size: 80%; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sup { + top: -.5em; +} + +sub { + bottom: -.25em; +} + +img { + border: 0; +} + +svg:not(:root) { + overflow: hidden; +} + +figure { + margin: 1em 40px; +} + +hr { + height: 0; + box-sizing: content-box; +} + +pre { + overflow: auto; +} + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} + +button { + overflow: visible; +} + +button, +select { + text-transform: none; +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} + +button[disabled], +html input[disabled] { + cursor: default; +} + +input { + line-height: normal; +} + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +input[type="search"] { + -webkit-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +fieldset { + padding: .35em .625em .75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} + +legend { + padding: 0; + border: 0; +} + +textarea { + overflow: auto; +} + +optgroup { + font-weight: bold; +} + +table { + border-spacing: 0; + border-collapse: collapse; +} + +td, +th { + padding: 0; +} + +* { + -webkit-box-sizing: border-box; + box-sizing: border-box; + -webkit-user-select: none; + outline: none; + + -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; +} + +body { + -webkit-overflow-scrolling: touch; + font-family: "Helvetica Neue", Helvetica, sans-serif; + font-size: 17px; + line-height: 21px; + color: #000; + background-color: #fff; +} + +a { + color: #007aff; + text-decoration: none; +} +a:active { + color: #0062cc; +} + +.mui-content { + -webkit-overflow-scrolling: touch; + background-color: #efeff4; +} + +.mui-bar-nav ~ .mui-content { + padding-top: 44px; +} +.mui-bar-nav ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical { + top: 44px; +} + +.mui-bar-header-secondary ~ .mui-content { + padding-top: 88px; +} +.mui-bar-header-secondary ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical { + top: 88px; +} + +.mui-bar-footer ~ .mui-content { + padding-bottom: 44px; +} +.mui-bar-footer ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical { + bottom: 44px; +} + +.mui-bar-footer-secondary ~ .mui-content { + padding-bottom: 88px; +} +.mui-bar-footer-secondary ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical { + bottom: 88px; +} + +.mui-bar-tab ~ .mui-content { + padding-bottom: 50px; +} +.mui-bar-tab ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical { + bottom: 50px; +} + +.mui-bar-footer-secondary-tab ~ .mui-content { + padding-bottom: 94px; +} +.mui-bar-footer-secondary-tab ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical { + bottom: 94px; +} + +.mui-content-padded { + margin: 10px; +} + +.mui-inline { + display: inline-block; + vertical-align: top; +} + +.mui-block { + display: block !important; +} + +.mui-visibility { + visibility: visible !important; +} + +.mui-hidden { + display: none !important; +} + +.mui-ellipsis { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.mui-ellipsis-2 { + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; + white-space: normal !important; + + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.mui-table { + display: table; + width: 100%; + table-layout: fixed; +} + +.mui-table-cell { + position: relative; + display: table-cell; +} + +.mui-text-left { + text-align: left !important; +} + +.mui-text-center { + text-align: center !important; +} + +.mui-text-justify { + text-align: justify !important; +} + +.mui-text-right { + text-align: right !important; +} + +.mui-pull-left { + float: left; +} + +.mui-pull-right { + float: right; +} + +.mui-list-unstyled { + padding-left: 0; + list-style: none; +} + +.mui-list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; +} + +.mui-list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} + +.mui-clearfix:before, .mui-clearfix:after { + display: table; + content: " "; +} +.mui-clearfix:after { + clear: both; +} + +.mui-bg-primary { + background-color: #007aff; +} + +.mui-bg-positive { + background-color: #4cd964; +} + +.mui-bg-negative { + background-color: #dd524d; +} + +.mui-error { + padding: 10px; + margin: 88px 35px; + background-color: #bbb; + border-radius: 6px; +} + +h1, h2, h3, h4, h5, h6 { + margin-top: 5px; + margin-bottom: 5px; + line-height: 1; +} + +h1, .mui-h1 { + font-size: 36px; +} + +h2, .mui-h2 { + font-size: 30px; +} + +h3, .mui-h3 { + font-size: 24px; +} + +h4, .mui-h4 { + font-size: 18px; +} + +h5, .mui-h5 { + font-size: 14px; + font-weight: normal; + color: #8f8f94; +} + +h6, .mui-h6 { + font-size: 12px; + font-weight: normal; + color: #8f8f94; +} + +p { + margin-top: 0; + margin-bottom: 10px; + font-size: 14px; + color: #8f8f94; +} + +.mui-col-xs-12 { + width: 100%; +} + +.mui-col-xs-11 { + width: 91.66666667%; +} + +.mui-col-xs-10 { + width: 83.33333333%; +} + +.mui-col-xs-9 { + width: 75%; +} + +.mui-col-xs-8 { + width: 66.66666667%; +} + +.mui-col-xs-7 { + width: 58.33333333%; +} + +.mui-col-xs-6 { + width: 50%; +} + +.mui-col-xs-5 { + width: 41.66666667%; +} + +.mui-col-xs-4 { + width: 33.33333333%; +} + +.mui-col-xs-3 { + width: 25%; +} + +.mui-col-xs-2 { + width: 16.66666667%; +} + +.mui-col-xs-1 { + width: 8.33333333%; +} + +@media (min-width: 400px) { + .mui-col-sm-12 { + width: 100%; + } + + .mui-col-sm-11 { + width: 91.66666667%; + } + + .mui-col-sm-10 { + width: 83.33333333%; + } + + .mui-col-sm-9 { + width: 75%; + } + + .mui-col-sm-8 { + width: 66.66666667%; + } + + .mui-col-sm-7 { + width: 58.33333333%; + } + + .mui-col-sm-6 { + width: 50%; + } + + .mui-col-sm-5 { + width: 41.66666667%; + } + + .mui-col-sm-4 { + width: 33.33333333%; + } + + .mui-col-sm-3 { + width: 25%; + } + + .mui-col-sm-2 { + width: 16.66666667%; + } + + .mui-col-sm-1 { + width: 8.33333333%; + } +} +.mui-scroll-wrapper { + position: absolute; + top: 0; + bottom: 0; + left: 0; + z-index: 1; + width: 100%; + overflow: hidden; + + -webkit-backface-visibility: hidden; +} + +.mui-scroll { + position: absolute; + z-index: 1; + width: 100%; + -webkit-transform: translateZ(0); + transform: translateZ(0); + + -webkit-backface-visibility: hidden; +} + +.mui-scrollbar { + position: absolute; + z-index: 9998; + overflow: hidden; + pointer-events: none; + opacity: 0; + -webkit-transition: 500ms; + transition: 500ms; + transform: translateZ(0px); +} + +.mui-scrollbar-vertical { + top: 0; + right: 1px; + bottom: 2px; + width: 4px; +} +.mui-scrollbar-vertical .mui-scrollbar-indicator { + width: 100%; +} + +.mui-scrollbar-horizontal { + right: 2px; + bottom: 0; + left: 2px; + height: 4px; +} +.mui-scrollbar-horizontal .mui-scrollbar-indicator { + height: 100%; +} + +.mui-scrollbar-indicator { + position: absolute; + display: block; + box-sizing: border-box; + background: rgba(0, 0, 0, .39804); + border: 1px solid rgba(255, 255, 255, .80196); + border-radius: 2px; + -webkit-transition: .01s cubic-bezier(.1, .57, .1, 1); + transition: .01s cubic-bezier(.1, .57, .1, 1); + transform: translate(0px, 0px) translateZ(0px); +} + +.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll-wrapper, .mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll-wrapper { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + overflow: hidden; +} +.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll, .mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll { + position: absolute; + width: 100%; +} +.mui-plus-pullrefresh .mui-scroll-wrapper, .mui-plus-pullrefresh .mui-slider-group { + position: static; + top: auto; + bottom: auto; + left: auto; + width: auto; + overflow: auto; +} +.mui-plus-pullrefresh .mui-scroll { + position: static; + width: auto; +} + +.mui-off-canvas-wrap .mui-bar { + position: absolute !important; +} + +.mui-off-canvas-wrap { + position: relative; + z-index: 1; + width: 100%; + height: 100%; + overflow: hidden; +} +.mui-off-canvas-wrap .mui-inner-wrap { + position: relative; + z-index: 1; + width: 100%; + height: 100%; +} +.mui-off-canvas-wrap .mui-inner-wrap.mui-transitioning { + -webkit-transition: -webkit-transform 200ms ease; + transition: transform 200ms ease; +} +.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); +} +.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); +} +.mui-off-canvas-wrap.mui-active { + height: 100%; + overflow: hidden; +} +.mui-off-canvas-wrap.mui-active .mui-off-canvas-backdrop { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 998; + display: block; + background: rgba(0, 0, 0, .4); + box-shadow: -4px 0 4px rgba(0, 0, 0, .5), 4px 0 4px rgba(0, 0, 0, .5); + transition: background 200ms ease; + + -webkit-backface-visibility: hidden; + -webkit-tap-highlight-color: transparent; +} +.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-right { + z-index: 10000 !important; + -webkit-transform: translate3d(100%, 0px, 0px); +} +.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-left { + z-index: 10000 !important; + -webkit-transform: translate3d(-100%, 0px, 0px); +} + +.mui-off-canvas-left, .mui-off-canvas-right { + position: absolute; + top: 0; + bottom: 0; + z-index: -1; + width: 70%; + min-height: 100%; + box-sizing: content-box; + -webkit-overflow-scrolling: touch; + visibility: hidden; + background: #333; + + -webkit-backface-visibility: hidden; +} +.mui-off-canvas-left.mui-transitioning, .mui-off-canvas-right.mui-transitioning { + -webkit-transition: -webkit-transform 200ms ease; + transition: transform 200ms ease; +} + +.mui-off-canvas-left { + left: 0; +} + +.mui-off-canvas-right { + right: 0; +} + +.mui-loading .mui-spinner { + display: block; + margin: 0 auto; +} + +.mui-spinner { + display: inline-block; + width: 24px; + height: 24px; + -webkit-transform-origin: 50%; + transform-origin: 50%; + -webkit-animation: spinner-spin 1s step-end infinite; + animation: spinner-spin 1s step-end infinite; +} + +.mui-spinner:after { + display: block; + width: 100%; + height: 100%; + content: ""; + background-image: url("data:image/svg+xml;charset=utf-8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; +} + +.mui-spinner-white:after { + background-image: url("data:image/svg+xml;charset=utf-8,"); +} + +@-webkit-keyframes spinner-spin { + 0% { + -webkit-transform: rotate(0deg); + } + 8.33333333% { + -webkit-transform: rotate(30deg); + } + 16.66666667% { + -webkit-transform: rotate(60deg); + } + 25% { + -webkit-transform: rotate(90deg); + } + 33.33333333% { + -webkit-transform: rotate(120deg); + } + 41.66666667% { + -webkit-transform: rotate(150deg); + } + 50% { + -webkit-transform: rotate(180deg); + } + 58.33333333% { + -webkit-transform: rotate(210deg); + } + 66.66666667% { + -webkit-transform: rotate(240deg); + } + 75% { + -webkit-transform: rotate(270deg); + } + 83.33333333% { + -webkit-transform: rotate(300deg); + } + 91.66666667% { + -webkit-transform: rotate(330deg); + } + 100% { + -webkit-transform: rotate(360deg); + } +} +@keyframes spinner-spin { + 0% { + transform: rotate(0deg); + } + 8.33333333% { + transform: rotate(30deg); + } + 16.66666667% { + transform: rotate(60deg); + } + 25% { + transform: rotate(90deg); + } + 33.33333333% { + transform: rotate(120deg); + } + 41.66666667% { + transform: rotate(150deg); + } + 50% { + transform: rotate(180deg); + } + 58.33333333% { + transform: rotate(210deg); + } + 66.66666667% { + transform: rotate(240deg); + } + 75% { + transform: rotate(270deg); + } + 83.33333333% { + transform: rotate(300deg); + } + 91.66666667% { + transform: rotate(330deg); + } + 100% { + transform: rotate(360deg); + } +} +input[type="button"], +input[type="submit"], +input[type="reset"], +button, +.mui-btn { + position: relative; + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 1.42; + color: #333; + text-align: center; + white-space: nowrap; + vertical-align: top; + cursor: pointer; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ccc; + border-radius: 3px; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-transition: all; + transition: all; + -webkit-transition-timing-function: linear; + transition-timing-function: linear; + -webkit-transition-duration: .2s; + transition-duration: .2s; +} +input[type="button"]:active, input[type="button"].mui-active, +input[type="submit"]:active, +input[type="submit"].mui-active, +input[type="reset"]:active, +input[type="reset"].mui-active, +button:active, +button.mui-active, +.mui-btn:active, +.mui-btn.mui-active { + color: #fff; + background-color: #929292; +} +input[type="button"]:disabled, input[type="button"].mui-disabled, +input[type="submit"]:disabled, +input[type="submit"].mui-disabled, +input[type="reset"]:disabled, +input[type="reset"].mui-disabled, +button:disabled, +button.mui-disabled, +.mui-btn:disabled, +.mui-btn.mui-disabled { + opacity: .6; +} + +input[type="submit"], +.mui-btn-primary, .mui-btn-blue { + color: #fff; + background-color: #007aff; + border: 1px solid #007aff; +} +input[type="submit"]:active, input[type="submit"].mui-active, +.mui-btn-primary:active, +.mui-btn-primary.mui-active, .mui-btn-blue:active, .mui-btn-blue.mui-active { + color: #fff; + background-color: #0062cc; + border: 1px solid #0062cc; +} + +.mui-btn-positive, .mui-btn-success, .mui-btn-green { + color: #fff; + background-color: #4cd964; + border: 1px solid #4cd964; +} +.mui-btn-positive:active, .mui-btn-positive.mui-active, .mui-btn-success:active, .mui-btn-success.mui-active, .mui-btn-green:active, .mui-btn-green.mui-active { + color: #fff; + background-color: #2ac845; + border: 1px solid #2ac845; +} + +.mui-btn-warning, .mui-btn-yellow { + color: #fff; + background-color: #f0ad4e; + border: 1px solid #f0ad4e; +} +.mui-btn-warning:active, .mui-btn-warning.mui-active, .mui-btn-yellow:active, .mui-btn-yellow.mui-active { + color: #fff; + background-color: #ec971f; + border: 1px solid #ec971f; +} + +.mui-btn-negative, .mui-btn-danger, .mui-btn-red { + color: #fff; + background-color: #dd524d; + border: 1px solid #dd524d; +} +.mui-btn-negative:active, .mui-btn-negative.mui-active, .mui-btn-danger:active, .mui-btn-danger.mui-active, .mui-btn-red:active, .mui-btn-red.mui-active { + color: #fff; + background-color: #cf2d28; + border: 1px solid #cf2d28; +} + +.mui-btn-royal, .mui-btn-purple { + color: #fff; + background-color: #8a6de9; + border: 1px solid #8a6de9; +} +.mui-btn-royal:active, .mui-btn-royal.mui-active, .mui-btn-purple:active, .mui-btn-purple.mui-active { + color: #fff; + background-color: #6641e2; + border: 1px solid #6641e2; +} + +.mui-btn-grey { + color: #fff; + background-color: #c7c7cc; + border: 1px solid #c7c7cc; +} +.mui-btn-grey:active, .mui-btn-grey.mui-active { + color: #fff; + background-color: #acacb4; + border: 1px solid #acacb4; +} + +.mui-btn-outlined { + background-color: transparent; +} +.mui-btn-outlined.mui-btn-primary, .mui-btn-outlined.mui-btn-blue { + color: #007aff; +} +.mui-btn-outlined.mui-btn-positive, .mui-btn-outlined.mui-btn-success, .mui-btn-outlined.mui-btn-green { + color: #4cd964; +} +.mui-btn-outlined.mui-btn-warning, .mui-btn-outlined.mui-btn-yellow { + color: #f0ad4e; +} +.mui-btn-outlined.mui-btn-negative, .mui-btn-outlined.mui-btn-danger, .mui-btn-outlined.mui-btn-red { + color: #dd524d; +} +.mui-btn-outlined.mui-btn-royal, .mui-btn-outlined.mui-btn-purple { + color: #8a6de9; +} +.mui-btn-outlined.mui-btn-primary:active, .mui-btn-outlined.mui-btn-blue:active, .mui-btn-outlined.mui-btn-positive:active, .mui-btn-outlined.mui-btn-success:active, .mui-btn-outlined.mui-btn-green:active, .mui-btn-outlined.mui-btn-warning:active, .mui-btn-outlined.mui-btn-yellow:active, .mui-btn-outlined.mui-btn-negative:active, .mui-btn-outlined.mui-btn-danger:active, .mui-btn-outlined.mui-btn-red:active, .mui-btn-outlined.mui-btn-royal:active, .mui-btn-outlined.mui-btn-purple:active { + color: #fff; +} + +.mui-btn-link { + padding-top: 6px; + padding-bottom: 6px; + color: #007aff; + background-color: transparent; + border: 0; +} +.mui-btn-link:active, .mui-btn-link.mui-active { + color: #0062cc; + background-color: transparent; +} + +.mui-btn-block { + display: block; + width: 100%; + padding: 15px 0; + margin-bottom: 10px; + font-size: 18px; +} + +.mui-btn .mui-badge { + margin: -2px -4px -2px 4px; + font-size: 14px; + background-color: rgba(0, 0, 0, .15); +} + +.mui-btn .mui-badge-inverted, +.mui-btn:active .mui-badge-inverted { + background-color: transparent; +} + +.mui-btn-primary:active .mui-badge-inverted, +.mui-btn-positive:active .mui-badge-inverted, +.mui-btn-negative:active .mui-badge-inverted { + color: #fff; +} + +.mui-btn-block .mui-badge { + position: absolute; + right: 0; + margin-right: 10px; +} + +.mui-btn .mui-icon { + font-size: inherit; +} + +.mui-btn.mui-icon { + font-size: 14px; + line-height: 1.42; +} + +.mui-btn.mui-fab { + width: 56px; + height: 56px; + padding: 16px; + border-radius: 50%; + outline: none; +} +.mui-btn.mui-fab.mui-btn-mini { + width: 40px; + height: 40px; + padding: 8px; +} +.mui-btn.mui-fab .mui-icon { + width: 24px; + height: 24px; + font-size: 24px; + line-height: 24px; +} + +.mui-bar { + position: fixed; + right: 0; + left: 0; + z-index: 10; + height: 44px; + padding-right: 10px; + padding-left: 10px; + background-color: rgba(247, 247, 247, .98); + border-bottom: 0; + -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, .85); + box-shadow: 0 0 1px rgba(0, 0, 0, .85); + + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} + +.mui-bar .mui-title { + right: 40px; + left: 40px; + width: auto; + margin: 0; + overflow: hidden; + text-overflow: ellipsis; +} +.mui-bar .mui-backdrop { + background: none; +} + +.mui-bar-header-secondary { + top: 44px; +} + +.mui-bar-footer { + bottom: 0; +} + +.mui-bar-footer-secondary { + bottom: 44px; +} + +.mui-bar-footer-secondary-tab { + bottom: 50px; +} + +.mui-bar-footer, +.mui-bar-footer-secondary, +.mui-bar-footer-secondary-tab { + border-top: 0; +} + +.mui-bar-nav { + top: 0; + -webkit-box-shadow: 0 1px 6px #ccc; + box-shadow: 0 1px 6px #ccc; +} +.mui-bar-nav ~ .mui-content .mui-anchor { + display: block; + height: 45px; + margin-top: -45px; + visibility: hidden; +} +.mui-bar-nav.mui-bar .mui-icon { + padding-right: 10px; + padding-left: 10px; + margin-right: -10px; + margin-left: -10px; +} + +.mui-title { + position: absolute; + display: block; + width: 100%; + padding: 0; + margin: 0 -10px; + font-size: 17px; + font-weight: 500; + line-height: 44px; + color: #000; + text-align: center; + white-space: nowrap; +} + +.mui-title a { + color: inherit; +} + +.mui-bar-tab { + bottom: 0; + display: table; + width: 100%; + height: 50px; + padding: 0; + table-layout: fixed; + border-top: 0; + border-bottom: 0; + + -webkit-touch-callout: none; +} +.mui-bar-tab .mui-tab-item { + display: table-cell; + width: 1%; + height: 50px; + overflow: hidden; + color: #929292; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: middle; +} +.mui-bar-tab .mui-tab-item.mui-active { + color: #007aff; +} +.mui-bar-tab .mui-tab-item .mui-icon { + top: 3px; + width: 24px; + height: 24px; + padding-top: 0; + padding-bottom: 0; +} +.mui-bar-tab .mui-tab-item .mui-icon ~ .mui-tab-label { + display: block; + overflow: hidden; + font-size: 11px; + text-overflow: ellipsis; +} +.mui-bar-tab .mui-tab-item .mui-icon:active { + background: none; +} + +.mui-focusin > .mui-bar { + position: absolute; +} + +.mui-bar .mui-btn { + position: relative; + top: 7px; + z-index: 20; + padding: 6px 12px 7px; + margin-top: 0; + font-weight: 400; +} +.mui-bar .mui-btn.mui-pull-right { + margin-left: 10px; +} +.mui-bar .mui-btn.mui-pull-left { + margin-right: 10px; +} + +.mui-bar .mui-btn-link { + top: 0; + padding: 0; + font-size: 16px; + line-height: 44px; + color: #007aff; + border: 0; +} +.mui-bar .mui-btn-link:active, .mui-bar .mui-btn-link.mui-active { + color: #0062cc; +} + +.mui-bar .mui-btn-block { + top: 6px; + padding: 5px 0; + margin-bottom: 0; + font-size: 16px; +} + +.mui-bar .mui-btn-nav.mui-pull-left { + margin-left: -5px; +} +.mui-bar .mui-btn-nav.mui-pull-left .mui-icon-left-nav { + margin-right: -3px; +} +.mui-bar .mui-btn-nav.mui-pull-right { + margin-right: -5px; +} +.mui-bar .mui-btn-nav.mui-pull-right .mui-icon-right-nav { + margin-left: -3px; +} +.mui-bar .mui-btn-nav:active { + opacity: .3; +} + +.mui-bar .mui-icon { + position: relative; + z-index: 20; + padding-top: 10px; + padding-bottom: 10px; + font-size: 24px; +} +.mui-bar .mui-icon:active { + opacity: .3; +} +.mui-bar .mui-btn .mui-icon { + top: 1px; + padding: 0; + margin: 0; +} +.mui-bar .mui-title .mui-icon { + padding: 0; + margin: 0; +} +.mui-bar .mui-title .mui-icon.mui-icon-caret { + top: 4px; + margin-left: -5px; +} + +.mui-bar input[type="search"] { + height: 29px; + margin: 6px 0; +} + +.mui-bar .mui-input-row .mui-btn { + padding: 12px 10px; +} + +.mui-bar .mui-search:before { + margin-top: -10px; +} + +.mui-bar .mui-input-row .mui-input-clear ~ .mui-icon-clear, .mui-bar .mui-input-row .mui-input-speech ~ .mui-icon-speech { + top: 0; + right: 12px; +} + +.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-clear ~ .mui-icon-clear, .mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-speech ~ .mui-icon-speech { + top: 0; + right: 0; +} + +.mui-bar .mui-segmented-control { + top: 7px; + width: auto; + margin: 0 auto; +} + +.mui-badge { + display: inline-block; + padding: 3px 6px; + font-size: 12px; + line-height: 1; + color: #333; + background-color: rgba(0, 0, 0, .15); + border-radius: 100px; +} +.mui-badge.mui-badge-inverted { + padding: 0 5px 0 0; + color: #929292; + background-color: transparent; +} + +.mui-badge-primary, .mui-badge-blue { + color: #fff; + background-color: #007aff; +} +.mui-badge-primary.mui-badge-inverted, .mui-badge-blue.mui-badge-inverted { + color: #007aff; + background-color: transparent; +} + +.mui-badge-success, .mui-badge-green { + color: #fff; + background-color: #4cd964; +} +.mui-badge-success.mui-badge-inverted, .mui-badge-green.mui-badge-inverted { + color: #4cd964; + background-color: transparent; +} + +.mui-badge-warning, .mui-badge-yellow { + color: #fff; + background-color: #f0ad4e; +} +.mui-badge-warning.mui-badge-inverted, .mui-badge-yellow.mui-badge-inverted { + color: #f0ad4e; + background-color: transparent; +} + +.mui-badge-danger, .mui-badge-red { + color: #fff; + background-color: #dd524d; +} +.mui-badge-danger.mui-badge-inverted, .mui-badge-red.mui-badge-inverted { + color: #dd524d; + background-color: transparent; +} + +.mui-badge-royal, .mui-badge-purple { + color: #fff; + background-color: #8a6de9; +} +.mui-badge-royal.mui-badge-inverted, .mui-badge-purple.mui-badge-inverted { + color: #8a6de9; + background-color: transparent; +} + +.mui-icon .mui-badge { + position: absolute; + top: -2px; + left: 100%; + padding: 1px 5px; + margin-left: -10px; + font-size: 10px; + line-height: 1.4; + color: white; + background: red; +} + +.mui-card { + margin: 0 15px; + overflow: hidden; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ddd; + border-radius: 6px; +} + +.mui-content > .mui-card:first-child { + margin-top: 15px; +} + +.mui-card .mui-input-group:before, .mui-card .mui-input-group:after { + height: 0; +} +.mui-card .mui-input-group .mui-input-row:last-child:before, .mui-card .mui-input-group .mui-input-row:last-child:after { + height: 0; +} + +.mui-card .mui-table-view { + margin-bottom: 0; + border-top: 0; + border-bottom: 0; + border-radius: 6px; +} +.mui-card .mui-table-view .mui-table-view-divider:first-child { + top: 0; + border-top-left-radius: 6px; + border-top-right-radius: 6px; +} +.mui-card .mui-table-view .mui-table-view-divider:last-child { + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; +} +.mui-card .mui-table-view:before, .mui-card .mui-table-view:after { + height: 0; +} + +.mui-card > .mui-table-view > .mui-table-view-cell:last-child:before, .mui-card > .mui-table-view > .mui-table-view-cell:last-child:after { + height: 0; +} + +.mui-table-view { + position: relative; + padding-left: 0; + margin-top: 0; + margin-bottom: 0; + list-style: none; + background-color: #fff; +} +.mui-table-view:after { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view:before { + position: absolute; + top: 0; + right: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-table-view-chevron .mui-table-view-cell { + padding-right: 65px; +} +.mui-table-view-chevron .mui-table-view-cell > a:not(.mui-btn) { + margin-right: -65px; +} + +.mui-table-view-inverted { + color: #fff; + background: #333; +} +.mui-table-view-inverted:after { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 1px; + content: ''; + background-color: #222; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view-inverted:before { + position: absolute; + top: 0; + right: 0; + left: 0; + height: 1px; + content: ''; + background-color: #222; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view-inverted .mui-table-view-cell:after { + position: absolute; + right: 0; + bottom: 0; + left: 15px; + height: 1px; + content: ''; + background-color: #222; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view-inverted .mui-table-view-cell.mui-active { + background-color: #242424; +} +.mui-table-view-inverted .mui-table-view-cell > a:not(.mui-btn).mui-active { + background-color: #242424; +} + +.mui-table-view-cell { + position: relative; + padding: 11px 15px; + overflow: hidden; + background-color: inherit; + + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-touch-callout: none; +} +.mui-table-view-cell:after { + position: absolute; + right: 0; + bottom: 0; + left: 15px; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view-cell.mui-radio input[type=radio], .mui-table-view-cell.mui-checkbox input[type=checkbox] { + top: 8px; +} +.mui-table-view-cell.mui-radio.mui-left, .mui-table-view-cell.mui-checkbox.mui-left { + padding-left: 58px; +} +.mui-table-view-cell.mui-active { + background-color: #eee; +} +.mui-table-view-cell:last-child:before, .mui-table-view-cell:last-child:after { + height: 0; +} +.mui-table-view-cell > a:not(.mui-btn) { + position: relative; + display: block; + padding: inherit; + margin: -11px -15px; + overflow: hidden; + color: inherit; + text-overflow: ellipsis; + white-space: nowrap; + /*&:active { + background-color: #eee; + }*/ +} +.mui-table-view-cell > a:not(.mui-btn).mui-active { + background-color: #eee; +} +.mui-table-view-cell p { + margin-bottom: 0; +} + +.mui-table-view-cell.mui-transitioning > .mui-slider-handle, .mui-table-view-cell.mui-transitioning > .mui-slider-left .mui-btn, .mui-table-view-cell.mui-transitioning > .mui-slider-right .mui-btn { + -webkit-transition: -webkit-transform 300ms ease; + transition: transform 300ms ease; +} +.mui-table-view-cell > .mui-slider-handle { + background-color: #fff; +} +.mui-table-view-cell > .mui-slider-handle, .mui-table-view-cell > .mui-slider-left .mui-btn, .mui-table-view-cell > .mui-slider-right .mui-btn { + -webkit-transition: -webkit-transform 0ms ease; + transition: transform 0ms ease; + + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +.mui-table-view-cell > .mui-slider-left, .mui-table-view-cell > .mui-slider-right { + position: absolute; + top: 0; + display: -webkit-box; + display: -webkit-flex; + display: flex; + height: 100%; + + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} +.mui-table-view-cell > .mui-slider-left > .mui-btn, .mui-table-view-cell > .mui-slider-right > .mui-btn { + position: relative; + left: 0; + display: -webkit-box; + display: -webkit-flex; + display: flex; + padding: 0 30px; + color: #fff; + border: 0; + border-radius: 0; + + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; +} +.mui-table-view-cell > .mui-slider-left > .mui-btn:after, .mui-table-view-cell > .mui-slider-right > .mui-btn:after { + position: absolute; + top: 0; + z-index: -1; + width: 600%; + height: 100%; + content: ''; + background: inherit; +} +.mui-table-view-cell > .mui-slider-left > .mui-btn.mui-icon, .mui-table-view-cell > .mui-slider-right > .mui-btn.mui-icon { + font-size: 30px; +} +.mui-table-view-cell > .mui-slider-right { + right: 0; + -webkit-transition: -webkit-transform 0ms ease; + transition: transform 0ms ease; + -webkit-transform: translateX(100%); + transform: translateX(100%); +} +.mui-table-view-cell > .mui-slider-left { + left: 0; + -webkit-transition: -webkit-transform 0ms ease; + transition: transform 0ms ease; + -webkit-transform: translateX(-100%); + transform: translateX(-100%); +} +.mui-table-view-cell > .mui-slider-left > .mui-btn:after { + right: 100%; + margin-right: -1px; +} + +.mui-table-view-divider { + position: relative; + padding-top: 6px; + padding-bottom: 6px; + padding-left: 15px; + margin-top: -1px; + margin-left: 0; + font-weight: 500; + color: #999; + background-color: #fafafa; +} +.mui-table-view-divider:after { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view-divider:before { + position: absolute; + top: 0; + right: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-table-view .mui-media, +.mui-table-view .mui-media-body { + overflow: hidden; +} + +.mui-table-view .mui-media-object { + max-width: 42px; + height: 42px; + line-height: 42px; +} +.mui-table-view .mui-media-object.mui-pull-left { + margin-right: 10px; +} +.mui-table-view .mui-media-object.mui-pull-right { + margin-left: 10px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object { + max-width: 29px; + height: 29px; + margin: -4px 0; + line-height: 29px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object img { + max-width: 29px; + height: 29px; + line-height: 29px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object.mui-pull-left { + margin-right: 10px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object .mui-icon { + font-size: 29px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-body:after { + position: absolute; + right: 0; + bottom: 0; + left: 55px; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-table-view .mui-table-view-cell.mui-media-icon:after { + height: 0 !important; +} + +.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view { + display: block; +} +.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:before, .mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:after { + height: 0 !important; +} +.mui-table-view.mui-unfold .mui-table-view-cell.mui-media-icon.mui-collapse .mui-media-body:after { + position: absolute; + right: 0; + bottom: 0; + left: 70px; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-table-view-cell > .mui-btn, +.mui-table-view-cell > .mui-badge, +.mui-table-view-cell > .mui-switch, +.mui-table-view-cell > a > .mui-btn, +.mui-table-view-cell > a > .mui-badge, +.mui-table-view-cell > a > .mui-switch { + position: absolute; + top: 50%; + right: 15px; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} +.mui-table-view-cell .mui-navigate-left > .mui-btn, +.mui-table-view-cell .mui-navigate-left > .mui-badge, +.mui-table-view-cell .mui-navigate-left > .mui-switch, +.mui-table-view-cell .mui-navigate-right > .mui-btn, +.mui-table-view-cell .mui-navigate-right > .mui-badge, +.mui-table-view-cell .mui-navigate-right > .mui-switch, +.mui-table-view-cell .mui-push-left > .mui-btn, +.mui-table-view-cell .mui-push-left > .mui-badge, +.mui-table-view-cell .mui-push-left > .mui-switch, +.mui-table-view-cell .mui-push-right > .mui-btn, +.mui-table-view-cell .mui-push-right > .mui-badge, +.mui-table-view-cell .mui-push-right > .mui-switch, +.mui-table-view-cell > a .mui-navigate-left > .mui-btn, +.mui-table-view-cell > a .mui-navigate-left > .mui-badge, +.mui-table-view-cell > a .mui-navigate-left > .mui-switch, +.mui-table-view-cell > a .mui-navigate-right > .mui-btn, +.mui-table-view-cell > a .mui-navigate-right > .mui-badge, +.mui-table-view-cell > a .mui-navigate-right > .mui-switch, +.mui-table-view-cell > a .mui-push-left > .mui-btn, +.mui-table-view-cell > a .mui-push-left > .mui-badge, +.mui-table-view-cell > a .mui-push-left > .mui-switch, +.mui-table-view-cell > a .mui-push-right > .mui-btn, +.mui-table-view-cell > a .mui-push-right > .mui-badge, +.mui-table-view-cell > a .mui-push-right > .mui-switch { + right: 35px; +} + +.mui-content > .mui-table-view:first-child { + margin-top: 15px; +} + +.mui-table-view-cell.mui-collapse > .mui-navigate-right:after, .mui-table-view-cell.mui-collapse > .mui-push-right:after { + content: '\e581'; +} +.mui-table-view-cell.mui-collapse.mui-active .mui-table-view, .mui-table-view-cell.mui-collapse.mui-active .mui-collapse-content { + display: block; +} +.mui-table-view-cell.mui-collapse.mui-active > .mui-navigate-right:after, .mui-table-view-cell.mui-collapse.mui-active > .mui-push-right:after { + content: '\e580'; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content { + position: relative; + display: none; + padding: 8px 15px; + margin: 11px -15px -11px; + overflow: hidden; + background: white; + border: 1px solid #ddd; + -webkit-transition: height .35s ease; + -o-transition: height .35s ease; + transition: height .35s ease; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content > .mui-input-group, .mui-table-view-cell.mui-collapse .mui-collapse-content > .mui-slider { + width: auto; + height: auto; + margin: -8px -15px; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content > .mui-slider { + margin: -8px -16px; +} +.mui-table-view-cell.mui-collapse .mui-table-view { + display: none; + margin-top: 11px; + margin-right: -15px; + margin-bottom: -11px; + margin-left: -15px; + border: 0; +} +.mui-table-view-cell.mui-collapse .mui-table-view.mui-table-view-chevron { + margin-right: -65px; +} +.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell { + padding-left: 31px; + background-position: 31px 100%; +} +.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:after { + position: absolute; + right: 0; + bottom: 0; + left: 30px; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-table-view.mui-grid-view { + display: block; + width: 100%; + padding: 0 10px 10px 0; + font-size: 0; + white-space: normal; +} +.mui-table-view.mui-grid-view .mui-table-view-cell { + display: inline-block; + padding: 10px 0 0 14px; + margin-right: -4px; + font-size: 17px; + text-align: center; + vertical-align: middle; + background: none; +} +.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-object { + width: 100%; + max-width: 100%; + height: auto; +} +.mui-table-view.mui-grid-view .mui-table-view-cell > a:not(.mui-btn) { + margin: -10px 0 0 -14px; +} +.mui-table-view.mui-grid-view .mui-table-view-cell > a:not(.mui-btn):active, .mui-table-view.mui-grid-view .mui-table-view-cell > a:not(.mui-btn).mui-active { + background: none; +} +.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body { + display: block; + width: 100%; + height: 15px; + margin-top: 8px; + font-size: 15px; + line-height: 15px; + color: #333; + text-overflow: ellipsis; +} +.mui-table-view.mui-grid-view .mui-table-view-cell:before, .mui-table-view.mui-grid-view .mui-table-view-cell:after { + height: 0; +} + +.mui-grid-view.mui-grid-9 { + padding: 1px 0 1px 0; + padding-right: 0; + background-color: #f2f2f2; +} +.mui-grid-view.mui-grid-9 .mui-table-view-cell { + padding: 11px 15px; + margin: -1px 0 0 -1px; + vertical-align: top; + border-top: 1px solid #eee; + border-left: 1px solid #eee; +} +.mui-grid-view.mui-grid-9 .mui-table-view-cell.mui-active { + background-color: #eee; +} +.mui-grid-view.mui-grid-9 .mui-table-view-cell > a:not(.mui-btn) { + padding: 10px 0; + margin: 0; +} +.mui-grid-view.mui-grid-9:before { + height: 0; +} +.mui-grid-view.mui-grid-9 .mui-media { + color: #797979; +} +.mui-grid-view.mui-grid-9 .mui-media .mui-icon { + position: relative; + font-size: 2.4em; +} + +.mui-slider-cell { + position: relative; +} +.mui-slider-cell > .mui-slider-handle { + z-index: 1; +} +.mui-slider-cell > .mui-slider-left, .mui-slider-cell > .mui-slider-right { + position: absolute; + top: 0; + bottom: 0; + z-index: 0; +} +.mui-slider-cell > .mui-slider-left { + left: 0; +} +.mui-slider-cell > .mui-slider-right { + right: 0; +} + +input, +textarea, +select { + font-family: "Helvetica Neue", Helvetica, sans-serif; + font-size: 17px; + + -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; +} +input:focus, +textarea:focus, +select:focus { + -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; + -webkit-user-modify: read-write-plaintext-only; +} + +select, +textarea, +input[type="text"], +input[type="search"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="tel"], +input[type="color"] { + width: 100%; + height: 40px; + -webkit-appearance: none; + padding: 10px 15px; + margin-bottom: 15px; + line-height: 21px; + -webkit-user-select: text; + background-color: #fff; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 3px; + outline: none; +} + +input[type=number]::-webkit-outer-spin-button { + margin: 0; +} + +input[type="search"] { + height: 34px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + font-size: 16px; + text-align: center; + background-color: rgba(0, 0, 0, .1); + border: 0; + border-radius: 6px; +} + +input[type="search"]:focus { + text-align: left; +} + +textarea { + height: auto; + resize: none; +} + +select { + height: auto; + margin-top: 1px; + font-size: 14px; + background-color: #fff; + border: 0 !important; +} +select:focus { + -webkit-user-modify: read-only; +} + +.mui-input-group { + position: relative; + padding: 0; + background-color: #fff; + border: 0; +} +.mui-input-group:after { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-input-group:before { + position: absolute; + top: 0; + right: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-input-group input[type=text], +.mui-input-group textarea { + margin-bottom: 0; + background-color: transparent; + border: 0; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; +} +.mui-input-group input[type=text]:after, +.mui-input-group textarea:after { + position: absolute; + right: 0; + bottom: 0; + left: 15px; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-input-group input[type="search"] { + background: none; +} + +.mui-input-group input:last-child { + background-image: none; +} + +.mui-input-row { + overflow: hidden; + clear: left; +} +.mui-input-row select { + height: 37px; + padding: 0; + font-size: 17px; +} + +.mui-input-row:last-child, +.mui-input-row label + input, .mui-input-row .mui-btn + input { + background-image: none; +} + +.mui-input-group .mui-input-row { + height: 40px; +} +.mui-input-group .mui-input-row:after { + position: absolute; + right: 0; + bottom: 0; + left: 15px; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} + +.mui-input-row label { + float: left; + width: 35%; + padding: 10px 15px; + font-family: "Helvetica Neue", Helvetica, sans-serif; + line-height: 1.1; +} + +.mui-input-row label ~ input, .mui-input-row label ~ select, .mui-input-row label ~ textarea { + float: right; + width: 65%; + padding-left: 0; + margin-bottom: 0; + border: 0; +} + +.mui-input-row .mui-btn { + float: right; + width: 15%; + padding: 10px 15px; + font-family: "Helvetica Neue", Helvetica, sans-serif; + line-height: 1.1; +} + +.mui-input-row .mui-btn ~ input, .mui-input-row .mui-btn ~ select, .mui-input-row .mui-btn ~ textarea { + float: left; + width: 85%; + padding-left: 0; + margin-bottom: 0; + border: 0; +} + +.mui-button-row { + position: relative; + padding-top: 5px; + text-align: center; +} + +.mui-input-group .mui-button-row { + height: 45px; +} + +.mui-input-row { + position: relative; +} +.mui-input-row.mui-input-range { + padding-right: 20px; + overflow: visible; +} +.mui-input-row .mui-inline { + padding: 8px 0; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear, .mui-input-row .mui-input-speech ~ .mui-icon-speech { + position: absolute; + top: 10px; + right: 0; + z-index: 1; + width: 38px; + height: 38px; + font-size: 20px; + color: #999; + text-align: center; +} +.mui-input-row .mui-input-speech ~ .mui-icon-speech { + top: 8px; + font-size: 24px; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear ~ .mui-icon-speech { + display: none; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear.mui-hidden ~ .mui-icon-speech { + display: inline-block; +} +.mui-input-row .mui-icon-speech ~ .mui-placeholder { + right: 38px; +} +.mui-input-row.mui-search .mui-icon-clear { + top: 7px; +} +.mui-input-row.mui-search .mui-icon-speech { + top: 5px; +} + +.mui-radio, .mui-checkbox { + position: relative; +} +.mui-radio label, .mui-checkbox label { + display: inline-block; + float: none; + width: 100%; +} + +.mui-radio.mui-left input[type="radio"], .mui-checkbox.mui-left input[type="checkbox"] { + left: 20px; +} + +.mui-radio.mui-left label, .mui-checkbox.mui-left label { + padding-left: 58px; +} + +.mui-radio input[type="radio"], .mui-checkbox input[type="checkbox"] { + position: absolute; + top: 4px; + right: 20px; + display: inline-block; + width: 28px; + height: 26px; + -webkit-appearance: none; + background-color: transparent; + border: 0; + outline: 0 !important; +} +.mui-radio input[type="radio"]:before, .mui-checkbox input[type="checkbox"]:before { + font-family: Muiicons; + font-size: 28px; + font-weight: normal; + line-height: 1; + color: rgba(170, 170, 170, .6); + text-decoration: none; + background: none; + border-radius: 0; + + -webkit-font-smoothing: antialiased; +} +.mui-radio input[type="radio"]:checked:before, .mui-checkbox input[type="checkbox"]:checked:before { + color: #007aff; +} + +.mui-radio input[type="radio"]:before { + content: "\e411"; +} + +.mui-radio input[type="radio"]:checked:before { + content: "\e441"; +} + +.mui-checkbox input[type="checkbox"]:before { + content: "\e411"; +} + +.mui-checkbox input[type="checkbox"]:checked:before { + content: "\e442"; +} + +.mui-select { + position: relative; +} + +.mui-select:before { + position: absolute; + top: 8px; + right: 21px; + font-family: Muiicons; + color: rgba(170, 170, 170, .6); + content: '\e581'; +} + +.mui-input-row .mui-switch { + float: right; + margin-top: 5px; + margin-right: 20px; +} + +.mui-input-range { + /*input[type="range"] { + -webkit-appearance: none; + background: #999; + height: 36px; + border-radius: 1px; + overflow: hidden; + margin-top: 2px; + margin-bottom: 2px; + outline:none; + position:relative; + width:100%; + }*/ + /*input[type='range']::-webkit-slider-thumb { + -webkit-appearance: none!important; + opacity: 0.5; + height:28px; + width:28px; + border-radius: 50%; + background:#00b7fb; + position: relative; + pointer-events: none; + -webkit-box-sizing: border-box; + box-sizing: border-box; + &:before{ + position: absolute; + top: 13px; + left: -2000px; + width: 2000px; + height: 2px; + background: #00b7fb; + content:' '; + } + }*/ +} +.mui-input-range input[type="range"] { + position: relative; + width: 100%; + height: 2px; + -webkit-appearance: none !important; + padding: 0; + margin: 17px 0; + cursor: pointer; + background-color: #999; + border: 0; + border-radius: 3px; + outline: none; +} +.mui-input-range input[type='range']::-webkit-slider-thumb { + width: 28px; + height: 28px; + -webkit-appearance: none !important; + background-color: #007aff; + background-clip: padding-box; + border-color: #0062cc; + border-radius: 50%; +} +.mui-input-range label ~ input[type="range"] { + width: 65%; +} +.mui-input-range .mui-tooltip { + position: absolute; + top: -70px; + z-index: 1; + width: 64px; + height: 64px; + font-size: 36px; + line-height: 64px; + color: #333; + text-align: center; + text-shadow: 0 1px 0 #f3f3f3; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 6px; + opacity: .8; +} + +.mui-search { + position: relative; +} +.mui-search input[type="search"] { + padding-left: 30px; +} +.mui-search .mui-placeholder { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + display: inline-block; + height: 34px; + font-size: 16px; + line-height: 34px; + color: #999; + text-align: center; + background: none; + border: 0; + border-radius: 6px; +} +.mui-search .mui-placeholder .mui-icon { + font-size: 20px; + color: #333; +} +.mui-search:before { + position: absolute; + top: 50%; + right: 50%; + display: none; + margin-top: -18px; + margin-right: 31px; + font-family: Muiicons; + font-size: 20px; + font-weight: normal; + content: '\e466'; +} +.mui-search.mui-active:before { + right: auto; + left: 5px; + display: block; + margin-right: 0; + font-size: 20px; +} +.mui-search.mui-active input[type="search"] { + text-align: left; +} +.mui-search.mui-active .mui-placeholder { + display: none; +} + +.mui-segmented-control { + position: relative; + display: table; + width: 100%; + overflow: hidden; + font-size: 15px; + font-weight: 400; + table-layout: fixed; + background-color: transparent; + border: 1px solid #007aff; + border-radius: 3px; + + -webkit-touch-callout: none; +} +.mui-segmented-control.mui-scroll-wrapper { + height: 38px; +} +.mui-segmented-control.mui-scroll-wrapper .mui-scroll { + width: auto; + height: 40px; + white-space: nowrap; +} +.mui-segmented-control.mui-scroll-wrapper .mui-control-item { + display: inline-block; + width: auto; + padding: 0 20px; + border: 0; +} +.mui-segmented-control .mui-control-item { + display: table-cell; + width: 1%; + overflow: hidden; + line-height: 38px; + color: #007aff; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; + border-color: #007aff; + border-left: 1px solid #007aff; + -webkit-transition: background-color .1s linear; + transition: background-color .1s linear; +} +.mui-segmented-control .mui-control-item:first-child { + border-left-width: 0; +} +.mui-segmented-control .mui-control-item.mui-active { + color: #fff; + background-color: #007aff; +} +.mui-segmented-control.mui-segmented-control-inverted { + width: 100%; + border: 0; + border-radius: 0; +} +.mui-segmented-control.mui-segmented-control-inverted .mui-control-item { + color: inherit; + border: 0; +} +.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active { + color: #007aff; + background: none; + border-bottom: 2px solid #007aff; +} +.mui-segmented-control.mui-segmented-control-inverted ~ .mui-slider-progress-bar { + background-color: #007aff; +} + +.mui-segmented-control-positive { + border: 1px solid #4cd964; +} +.mui-segmented-control-positive .mui-control-item { + color: #4cd964; + border-color: inherit; +} +.mui-segmented-control-positive .mui-control-item.mui-active { + color: #fff; + background-color: #4cd964; +} +.mui-segmented-control-positive.mui-segmented-control-inverted .mui-control-item.mui-active { + color: #4cd964; + background: none; + border-bottom: 2px solid #4cd964; +} +.mui-segmented-control-positive.mui-segmented-control-inverted ~ .mui-slider-progress-bar { + background-color: #4cd964; +} + +.mui-segmented-control-negative { + border: 1px solid #dd524d; +} +.mui-segmented-control-negative .mui-control-item { + color: #dd524d; + border-color: inherit; +} +.mui-segmented-control-negative .mui-control-item.mui-active { + color: #fff; + background-color: #dd524d; +} +.mui-segmented-control-negative.mui-segmented-control-inverted .mui-control-item.mui-active { + color: #dd524d; + background: none; + border-bottom: 2px solid #dd524d; +} +.mui-segmented-control-negative.mui-segmented-control-inverted ~ .mui-slider-progress-bar { + background-color: #dd524d; +} + +.mui-control-content { + position: relative; + display: none; +} +.mui-control-content.mui-active { + display: block; +} + +.mui-popover { + position: absolute; + z-index: 999; + display: none; + width: 280px; + background-color: rgba(247, 247, 247, .98); + border-radius: 7px; + -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, .1); + box-shadow: 0 0 15px rgba(0, 0, 0, .1); + opacity: 0; + -webkit-transition: opacity .3s; + transition: opacity .3s; + -webkit-transition-property: opacity; + transition-property: opacity; + -webkit-transform: none; + transform: none; +} +.mui-popover .mui-popover-arrow { + position: absolute; + top: -25px; + left: 0; + z-index: 1000; + width: 26px; + height: 26px; + overflow: hidden; +} +.mui-popover .mui-popover-arrow:after { + position: absolute; + top: 19px; + left: 0; + width: 26px; + height: 26px; + content: ' '; + background: rgba(247, 247, 247, .98); + border-radius: 3px; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +.mui-popover .mui-popover-arrow.mui-bottom { + top: 100%; + left: -26px; + margin-top: -1px; +} +.mui-popover .mui-popover-arrow.mui-bottom:after { + top: -19px; + left: 0; +} +.mui-popover.mui-popover-action { + bottom: 0; + width: 100%; + background: none; + border-radius: 0; + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transition: -webkit-transform .3s, opacity .3s; + transition: transform .3s, opacity .3s; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.mui-popover.mui-popover-action .mui-popover-arrow { + display: none; +} +.mui-popover.mui-popover-action.mui-active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.mui-popover.mui-popover-action .mui-table-view { + margin: 8px; + color: #007aff; + text-align: center; + border-radius: 4px; +} +.mui-popover.mui-popover-action .mui-table-view .mui-table-view-cell:after { + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 1px; + content: ''; + background-color: #c8c7cc; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); +} +.mui-popover.mui-popover-action .mui-table-view small { + display: block; + font-weight: 400; + line-height: 1.3; +} +.mui-popover.mui-active { + display: block; + opacity: 1; +} +.mui-popover .mui-bar ~ .mui-table-view { + padding-top: 44px; +} + +.mui-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 998; + background-color: rgba(0, 0, 0, .3); +} + +.mui-bar-backdrop.mui-backdrop { + bottom: 50px; + background: none; +} + +.mui-backdrop-action.mui-backdrop { + background-color: rgba(0, 0, 0, .3); +} + +.mui-bar-backdrop.mui-backdrop, .mui-backdrop-action.mui-backdrop { + opacity: 0; +} +.mui-bar-backdrop.mui-backdrop.mui-active, .mui-backdrop-action.mui-backdrop.mui-active { + opacity: 1; + -webkit-transition: all .4s ease; + transition: all .4s ease; +} + +.mui-popover .mui-btn-block { + margin-bottom: 5px; +} +.mui-popover .mui-btn-block:last-child { + margin-bottom: 0; +} + +.mui-popover .mui-bar { + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-popover .mui-bar-nav { + border-bottom: 1px solid rgba(0, 0, 0, .15); + border-top-left-radius: 12px; + border-top-right-radius: 12px; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-popover .mui-scroll-wrapper { + margin: 7px 0; + background-clip: padding-box; + border-radius: 7px; +} + +.mui-popover .mui-scroll .mui-table-view { + max-height: none; +} + +.mui-popover .mui-table-view { + max-height: 300px; + margin-bottom: 0; + overflow: auto; + -webkit-overflow-scrolling: touch; + background-color: rgba(247, 247, 247, .98); + background-image: none; + border-radius: 7px; +} +.mui-popover .mui-table-view:before, .mui-popover .mui-table-view:after { + height: 0; +} +.mui-popover .mui-table-view .mui-table-view-cell:first-child, +.mui-popover .mui-table-view .mui-table-view-cell:first-child > a:not(.mui-btn) { + border-top-left-radius: 12px; + border-top-right-radius: 12px; +} +.mui-popover .mui-table-view .mui-table-view-cell:last-child, +.mui-popover .mui-table-view .mui-table-view-cell:last-child > a:not(.mui-btn) { + border-bottom-right-radius: 12px; + border-bottom-left-radius: 12px; +} + +.mui-popover.mui-bar-popover .mui-table-view { + width: 106px; +} +.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell { + padding: 11px 15px 11px 15px; + background-position: 0 100%; +} +.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell > a:not(.mui-btn) { + margin: -11px -15px -11px -15px; +} + +.mui-pagination { + display: inline-block; + padding-left: 0; + margin: 0 auto; + border-radius: 6px; +} +.mui-pagination > li { + display: inline; +} +.mui-pagination > li > a, +.mui-pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.428571429; + color: #007aff; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.mui-pagination > li:first-child > a, +.mui-pagination > li:first-child > span { + margin-left: 0; + background-clip: padding-box; + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.mui-pagination > li:last-child > a, +.mui-pagination > li:last-child > span { + background-clip: padding-box; + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.mui-pagination > li:active > a, .mui-pagination > li:active > a:active, +.mui-pagination > li:active > span, +.mui-pagination > li:active > span:active, +.mui-pagination > li.mui-active > a, +.mui-pagination > li.mui-active > a:active, +.mui-pagination > li.mui-active > span, +.mui-pagination > li.mui-active > span:active { + z-index: 2; + color: #fff; + cursor: default; + background-color: #007aff; + border-color: #007aff; +} +.mui-pagination > li.mui-disabled > span, +.mui-pagination > li.mui-disabled > span:active, +.mui-pagination > li.mui-disabled > a, +.mui-pagination > li.mui-disabled > a:active { + color: #777; + background-color: #fff; + border: 1px solid #ddd; + opacity: .6; +} + +.mui-pagination-lg > li > a, +.mui-pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} + +.mui-pagination-sm > li > a, +.mui-pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} + +.mui-pager { + padding-left: 0; + text-align: center; + list-style: none; +} +.mui-pager:before, .mui-pager:after { + display: table; + content: " "; +} +.mui-pager:after { + clear: both; +} +.mui-pager li { + display: inline; +} +.mui-pager li > a, +.mui-pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ddd; + border-radius: 6px; +} +.mui-pager li:active > a, .mui-pager li:active > span, .mui-pager li.mui-active > a, .mui-pager li.mui-active > span { + color: #fff; + text-decoration: none; + cursor: default; + background-color: #007aff; + border-color: #007aff; +} +.mui-pager .mui-next > a, +.mui-pager .mui-next > span { + float: right; +} +.mui-pager .mui-previous > a, +.mui-pager .mui-previous > span { + float: left; +} +.mui-pager .mui-disabled > a, +.mui-pager .mui-disabled > a:active, +.mui-pager .mui-disabled > span, +.mui-pager .mui-disabled > span:active { + color: #777; + background-color: #fff; + border: 1px solid #ddd; + opacity: .6; +} + +.mui-modal { + position: fixed; + top: 0; + z-index: 999; + width: 100%; + min-height: 100%; + overflow: hidden; + background-color: #fff; + opacity: 0; + -webkit-transition: -webkit-transform .25s, opacity 1ms .25s; + transition: transform .25s, opacity 1ms .25s; + -webkit-transition-timing-function: cubic-bezier(.1, .5, .1, 1); + transition-timing-function: cubic-bezier(.1, .5, .1, 1); + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.mui-modal.mui-active { + height: 100%; + opacity: 1; + -webkit-transition: -webkit-transform .25s; + transition: transform .25s; + -webkit-transition-timing-function: cubic-bezier(.1, .5, .1, 1); + transition-timing-function: cubic-bezier(.1, .5, .1, 1); + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} + +.mui-android .mui-modal .mui-bar { + position: static; +} + +.mui-android .mui-modal .mui-bar-nav ~ .mui-content { + padding-top: 0; +} + +.mui-slider { + position: relative; + width: 100%; + overflow: hidden; +} +.mui-slider .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active { + border-bottom: 0; +} +.mui-slider .mui-segmented-control.mui-segmented-control-inverted ~ .mui-slider-group .mui-slider-item { + border-top: 1px solid #c8c7cc; + border-bottom: 1px solid #c8c7cc; +} +.mui-slider .mui-slider-group { + position: relative; + font-size: 0; + white-space: nowrap; + -webkit-transition: all 0s linear; + transition: all 0s linear; +} +.mui-slider .mui-slider-group .mui-slider-item { + position: relative; + display: inline-block; + width: 100%; + height: 100%; + font-size: 14px; + vertical-align: top; +} +.mui-slider .mui-slider-group .mui-slider-item > a:not(.mui-control-item) { + position: relative; + display: block; + line-height: 0; +} +.mui-slider .mui-slider-group .mui-slider-item img { + width: 100%; +} +.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:before, .mui-slider .mui-slider-group .mui-slider-item .mui-table-view:after { + height: 0; +} +.mui-slider .mui-slider-group.mui-slider-loop { + -webkit-transform: translate(-100%, 0px); + transform: translate(-100%, 0px); +} + +.mui-slider-title { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 30px; + margin: 0; + line-height: 30px; + text-align: left; + text-indent: 12px; + background-color: #000; + opacity: .8; +} + +.mui-slider-indicator { + position: absolute; + bottom: 8px; + width: 100%; + text-align: center; + background: none; +} +.mui-slider-indicator.mui-segmented-control { + position: relative; + bottom: auto; +} +.mui-slider-indicator .mui-indicator { + display: inline-block; + width: 6px; + height: 6px; + margin: 1px 6px; + cursor: pointer; + background: #aaa; + border-radius: 50%; + -webkit-box-shadow: 0 0 1px 1px rgba(130, 130, 130, .7); + box-shadow: 0 0 1px 1px rgba(130, 130, 130, .7); +} +.mui-slider-indicator .mui-active.mui-indicator { + background: #fff; +} +.mui-slider-indicator .mui-icon { + width: 40px; + height: 30px; + margin: 3px; + font-size: 20px; + line-height: 30px; + text-align: center; + border: 1px solid #ddd; +} +.mui-slider-indicator .mui-number { + display: inline-block; + width: 58px; + line-height: 32px; +} +.mui-slider-indicator .mui-number span { + color: #ff5053; +} + +.mui-slider-progress-bar { + z-index: 1; + height: 2px; + -webkit-transform: translateZ(0); + transform: translateZ(0); + + -webkit-backface-visibility: hidden; +} + +.mui-switch { + position: relative; + display: block; + width: 74px; + height: 30px; + background-color: #fff; + background-clip: padding-box; + border: 2px solid #ddd; + border-radius: 20px; + -webkit-transition-timing-function: ease-in-out; + transition-timing-function: ease-in-out; + -webkit-transition-duration: .2s; + transition-duration: .2s; + -webkit-transition-property: background-color, border; + transition-property: background-color, border; +} +.mui-switch.mui-disabled { + opacity: .3; +} +.mui-switch .mui-switch-handle { + position: absolute; + top: -1px; + left: -1px; + z-index: 1; + width: 28px; + height: 28px; + background-color: #fff; + background-clip: padding-box; + border-radius: 16px; + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, .4); + box-shadow: 0 2px 5px rgba(0, 0, 0, .4); + -webkit-transition: .2s ease-in-out; + transition: .2s ease-in-out; + -webkit-transition-property: -webkit-transform, width,left; + transition-property: transform, width,left; +} +.mui-switch:before { + position: absolute; + top: 3px; + right: 11px; + font-size: 13px; + color: #999; + text-transform: uppercase; + content: "Off"; +} +.mui-switch.mui-dragging { + background-color: rgba(247, 247, 247, .98); + border-color: rgba(247, 247, 247, .98); +} +.mui-switch.mui-dragging .mui-switch-handle { + width: 38px; +} +.mui-switch.mui-dragging.mui-active .mui-switch-handle { + left: -11px; + width: 38px; +} +.mui-switch.mui-active { + background-color: #4cd964; + border-color: #4cd964; +} +.mui-switch.mui-active .mui-switch-handle { + -webkit-transform: translate3d(43px, 0, 0); + transform: translate3d(43px, 0, 0); +} +.mui-switch.mui-active:before { + right: auto; + left: 15px; + color: #fff; + content: "On"; +} +.mui-switch input[type="checkbox"] { + display: none; +} + +.mui-switch-mini { + width: 47px; +} +.mui-switch-mini:before { + display: none; +} +.mui-switch-mini.mui-active .mui-switch-handle { + -webkit-transform: translate3d(16px, 0, 0); + transform: translate3d(16px, 0, 0); +} + +.mui-switch-blue.mui-active { + background-color: #007aff; + border: 2px solid #007aff; +} + +.mui-content.mui-fade { + left: 0; + opacity: 0; +} +.mui-content.mui-fade.mui-in { + opacity: 1; +} +.mui-content.mui-sliding { + z-index: 2; + -webkit-transition: -webkit-transform .4s; + transition: transform .4s; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.mui-content.mui-sliding.mui-left { + z-index: 1; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); +} +.mui-content.mui-sliding.mui-right { + z-index: 3; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); +} + +.mui-navigate-left:after, +.mui-navigate-right:after, +.mui-push-left:after, +.mui-push-right:after { + position: absolute; + top: 50%; + display: inline-block; + font-family: Muiicons; + font-size: inherit; + line-height: 1; + color: #bbb; + text-decoration: none; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + + -webkit-font-smoothing: antialiased; +} + +.mui-navigate-left:after, +.mui-push-left:after { + left: 15px; + content: '\e582'; +} + +.mui-navigate-right:after, +.mui-push-right:after { + right: 15px; + content: '\e583'; +} + +.mui-pull-top-pocket, .mui-pull-bottom-pocket { + position: absolute; + left: 0; + display: block; + width: 100%; + height: 50px; + overflow: hidden; + visibility: hidden; +} + +.mui-plus-pullrefresh .mui-pull-top-pocket, .mui-plus-pullrefresh .mui-pull-bottom-pocket { + display: none; + visibility: visible; +} + +.mui-pull-top-pocket { + top: 0; +} + +.mui-bar-nav ~ .mui-content .mui-pull-top-pocket { + top: 44px; +} + +.mui-bar-nav ~ .mui-bar-header-secondary ~ .mui-content .mui-pull-top-pocket { + top: 88px; +} + +.mui-pull-bottom-pocket { + position: relative; + bottom: 0; + height: 40px; +} +.mui-pull-bottom-pocket .mui-pull-loading { + visibility: hidden; +} +.mui-pull-bottom-pocket .mui-pull-loading.mui-in { + display: inline-block; +} + +.mui-pull { + position: absolute; + right: 0; + bottom: 10px; + left: 0; + font-weight: bold; + color: #777; + text-align: center; +} + +.mui-pull-loading { + margin-right: 10px; + vertical-align: middle; + -webkit-transition: -webkit-transform .4s; + transition: transform .4s; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + + -webkit-backface-visibility: hidden; +} + +.mui-pull-loading.mui-reverse { + -webkit-transform: rotate(180deg) translateZ(0); + transform: rotate(180deg) translateZ(0); +} + +.mui-pull-caption { + position: relative; + display: inline-block; + margin-top: 0; + overflow: visible; + font-size: 15px; + line-height: 24px; + vertical-align: middle; +} +.mui-pull-caption span { + display: none; +} +.mui-pull-caption span.mui-in { + display: inline; +} + +.mui-toast-container { + position: fixed; + bottom: 50px; + z-index: 9999; + width: 100%; +} + +.mui-toast-message { + width: 270px; + padding: 5px 5px 5px 5px; + margin: 5px auto 5px auto; + font-size: 14px; + color: #000; + text-align: center; + background-color: #d8d8d8; + border-radius: 7px; +} + +@font-face { + font-family: Muiicons; + font-style: normal; + font-weight: normal; + + src: url("../fonts/mui.ttf") format("truetype"); +} +.mui-icon { + display: inline-block; + font-family: Muiicons; + font-size: 24px; + font-style: normal; + font-weight: normal; + line-height: 1; + text-decoration: none; + + -webkit-font-smoothing: antialiased; +} +.mui-icon.mui-right:before { + float: right; + padding-left: .2em; +} + +.mui-icon-contact:before { + content: "\e100"; +} + +.mui-icon-person:before { + content: "\e101"; +} + +.mui-icon-personadd:before { + content: "\e102"; +} + +.mui-icon-contact-filled:before { + content: "\e130"; +} + +.mui-icon-person-filled:before { + content: "\e131"; +} + +.mui-icon-personadd-filled:before { + content: "\e132"; +} + +.mui-icon-phone:before { + content: "\e200"; +} + +.mui-icon-email:before { + content: "\e201"; +} + +.mui-icon-chatbubble:before { + content: "\e202"; +} + +.mui-icon-chatboxes:before { + content: "\e203"; +} + +.mui-icon-phone-filled:before { + content: "\e230"; +} + +.mui-icon-email-filled:before { + content: "\e231"; +} + +.mui-icon-chatbubble-filled:before { + content: "\e232"; +} + +.mui-icon-chatboxes-filled:before { + content: "\e233"; +} + +.mui-icon-weibo:before { + content: "\e260"; +} + +.mui-icon-weixin:before { + content: "\e261"; +} + +.mui-icon-pengyouquan:before { + content: "\e262"; +} + +.mui-icon-chat:before { + content: "\e263"; +} + +.mui-icon-videocam:before { + content: "\e300"; +} + +.mui-icon-camera:before { + content: "\e301"; +} + +.mui-icon-mic:before { + content: "\e302"; +} + +.mui-icon-location:before { + content: "\e303"; +} + +.mui-icon-mic-filled:before, .mui-icon-speech:before { + content: "\e332"; +} + +.mui-icon-location-filled:before { + content: "\e333"; +} + +.mui-icon-micoff:before { + content: "\e360"; +} + +.mui-icon-image:before { + content: "\e363"; +} + +.mui-icon-map:before { + content: "\e364"; +} + +.mui-icon-compose:before { + content: "\e400"; +} + +.mui-icon-trash:before { + content: "\e401"; +} + +.mui-icon-upload:before { + content: "\e402"; +} + +.mui-icon-download:before { + content: "\e403"; +} + +.mui-icon-close:before { + content: "\e404"; +} + +.mui-icon-redo:before { + content: "\e405"; +} + +.mui-icon-undo:before { + content: "\e406"; +} + +.mui-icon-refresh:before { + content: "\e407"; +} + +.mui-icon-star:before { + content: "\e408"; +} + +.mui-icon-plus:before { + content: "\e409"; +} + +.mui-icon-minus:before { + content: "\e410"; +} + +.mui-icon-circle:before, .mui-icon-checkbox:before { + content: "\e411"; +} + +.mui-icon-close-filled:before, .mui-icon-clear:before { + content: "\e434"; +} + +.mui-icon-refresh-filled:before { + content: "\e437"; +} + +.mui-icon-star-filled:before { + content: "\e438"; +} + +.mui-icon-plus-filled:before { + content: "\e439"; +} + +.mui-icon-minus-filled:before { + content: "\e440"; +} + +.mui-icon-circle-filled:before { + content: "\e441"; +} + +.mui-icon-checkbox-filled:before { + content: "\e442"; +} + +.mui-icon-closeempty:before { + content: "\e460"; +} + +.mui-icon-refreshempty:before { + content: "\e461"; +} + +.mui-icon-reload:before { + content: "\e462"; +} + +.mui-icon-starhalf:before { + content: "\e463"; +} + +.mui-icon-spinner:before { + content: "\e464"; +} + +.mui-icon-spinner-cycle:before { + content: "\e465"; +} + +.mui-icon-search:before { + content: "\e466"; +} + +.mui-icon-plusempty:before { + content: "\e468"; +} + +.mui-icon-forward:before { + content: "\e470"; +} + +.mui-icon-back:before, .mui-icon-left-nav:before { + content: "\e471"; +} + +.mui-icon-checkmarkempty:before { + content: "\e472"; +} + +.mui-icon-home:before { + content: "\e500"; +} + +.mui-icon-navigate:before { + content: "\e501"; +} + +.mui-icon-gear:before { + content: "\e502"; +} + +.mui-icon-paperplane:before { + content: "\e503"; +} + +.mui-icon-info:before { + content: "\e504"; +} + +.mui-icon-help:before { + content: "\e505"; +} + +.mui-icon-locked:before { + content: "\e506"; +} + +.mui-icon-more:before { + content: "\e507"; +} + +.mui-icon-flag:before { + content: "\e508"; +} + +.mui-icon-home-filled:before { + content: "\e530"; +} + +.mui-icon-gear-filled:before { + content: "\e532"; +} + +.mui-icon-info-filled:before { + content: "\e534"; +} + +.mui-icon-help-filled:before { + content: "\e535"; +} + +.mui-icon-more-filled:before { + content: "\e537"; +} + +.mui-icon-settings:before { + content: "\e560"; +} + +.mui-icon-list:before { + content: "\e562"; +} + +.mui-icon-bars:before { + content: "\e563"; +} + +.mui-icon-loop:before { + content: "\e565"; +} + +.mui-icon-paperclip:before { + content: "\e567"; +} + +.mui-icon-arrowup:before { + content: "\e580"; +} + +.mui-icon-arrowdown:before { + content: "\e581"; +} + +.mui-icon-arrowleft:before { + content: "\e582"; +} + +.mui-icon-arrowright:before { + content: "\e583"; +} + +.mui-icon-arrowthinup:before { + content: "\e584"; +} + +.mui-icon-arrowthindown:before { + content: "\e585"; +} + +.mui-icon-arrowthinleft:before { + content: "\e586"; +} + +.mui-icon-arrowthinright:before { + content: "\e587"; +} + +.mui-icon-pulldown:before { + content: "\e588"; +} + +.mui-fullscreen { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; +} +.mui-fullscreen .mui-slider-group { + height: 100%; +} +.mui-fullscreen .mui-segmented-control ~ .mui-slider-group { + position: absolute; + top: 40px; + bottom: 0; + width: 100%; + height: auto; +} +.mui-fullscreen .mui-slider-item > a { + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} + +.mui-bar-tab ~ .mui-content .mui-slider.mui-fullscreen .mui-segmented-control ~ .mui-slider-group { + bottom: 50px; +} + +.mui-android.mui-android-4-0 input:focus, +.mui-android.mui-android-4-0 textarea:focus { + -webkit-user-modify: inherit; +} + +/*# sourceMappingURL=mui.css.map */ diff --git a/examples/login/css/mui.min.css b/examples/login/css/mui.min.css new file mode 100644 index 00000000..38be90ab --- /dev/null +++ b/examples/login/css/mui.min.css @@ -0,0 +1,5 @@ +/*! + * ===================================================== + * Mui v1.2.0 (https://github.com/dcloudio/mui) + * ===================================================== + *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;outline:0;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent}body{-webkit-overflow-scrolling:touch;font-family:"Helvetica Neue",Helvetica,sans-serif;font-size:17px;line-height:21px;color:#000;background-color:#fff}a{color:#007aff;text-decoration:none}a:active{color:#0062cc}.mui-content{-webkit-overflow-scrolling:touch;background-color:#efeff4}.mui-bar-nav~.mui-content{padding-top:44px}.mui-bar-nav~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{top:44px}.mui-bar-header-secondary~.mui-content{padding-top:88px}.mui-bar-header-secondary~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{top:88px}.mui-bar-footer~.mui-content{padding-bottom:44px}.mui-bar-footer~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:44px}.mui-bar-footer-secondary~.mui-content{padding-bottom:88px}.mui-bar-footer-secondary~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:88px}.mui-bar-tab~.mui-content{padding-bottom:50px}.mui-bar-tab~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:50px}.mui-bar-footer-secondary-tab~.mui-content{padding-bottom:94px}.mui-bar-footer-secondary-tab~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:94px}.mui-content-padded{margin:10px}.mui-inline{display:inline-block;vertical-align:top}.mui-block{display:block!important}.mui-visibility{visibility:visible!important}.mui-hidden{display:none!important}.mui-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mui-ellipsis-2{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;word-wrap:break-word;white-space:normal!important;-webkit-line-clamp:2;-webkit-box-orient:vertical}.mui-table{display:table;width:100%;table-layout:fixed}.mui-table-cell{position:relative;display:table-cell}.mui-text-left{text-align:left!important}.mui-text-center{text-align:center!important}.mui-text-justify{text-align:justify!important}.mui-text-right{text-align:right!important}.mui-pull-left{float:left}.mui-pull-right{float:right}.mui-list-unstyled{padding-left:0;list-style:none}.mui-list-inline{padding-left:0;margin-left:-5px;list-style:none}.mui-list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.mui-clearfix:after,.mui-clearfix:before{display:table;content:" "}.mui-clearfix:after{clear:both}.mui-bg-primary{background-color:#007aff}.mui-bg-positive{background-color:#4cd964}.mui-bg-negative{background-color:#dd524d}.mui-error{padding:10px;margin:88px 35px;background-color:#bbb;border-radius:6px}h1,h2,h3,h4,h5,h6{margin-top:5px;margin-bottom:5px;line-height:1}.mui-h1,h1{font-size:36px}.mui-h2,h2{font-size:30px}.mui-h3,h3{font-size:24px}.mui-h4,h4{font-size:18px}.mui-h5,h5{font-size:14px;font-weight:400;color:#8f8f94}.mui-h6,h6{font-size:12px;font-weight:400;color:#8f8f94}p{margin-top:0;margin-bottom:10px;font-size:14px;color:#8f8f94}.mui-col-xs-12{width:100%}.mui-col-xs-11{width:91.66666667%}.mui-col-xs-10{width:83.33333333%}.mui-col-xs-9{width:75%}.mui-col-xs-8{width:66.66666667%}.mui-col-xs-7{width:58.33333333%}.mui-col-xs-6{width:50%}.mui-col-xs-5{width:41.66666667%}.mui-col-xs-4{width:33.33333333%}.mui-col-xs-3{width:25%}.mui-col-xs-2{width:16.66666667%}.mui-col-xs-1{width:8.33333333%}@media (min-width:400px){.mui-col-sm-12{width:100%}.mui-col-sm-11{width:91.66666667%}.mui-col-sm-10{width:83.33333333%}.mui-col-sm-9{width:75%}.mui-col-sm-8{width:66.66666667%}.mui-col-sm-7{width:58.33333333%}.mui-col-sm-6{width:50%}.mui-col-sm-5{width:41.66666667%}.mui-col-sm-4{width:33.33333333%}.mui-col-sm-3{width:25%}.mui-col-sm-2{width:16.66666667%}.mui-col-sm-1{width:8.33333333%}}.mui-scroll-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:1;width:100%;overflow:hidden;-webkit-backface-visibility:hidden}.mui-scroll{position:absolute;z-index:1;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden}.mui-scrollbar{position:absolute;z-index:9998;overflow:hidden;pointer-events:none;opacity:0;-webkit-transition:500ms;transition:500ms;transform:translateZ(0px)}.mui-scrollbar-vertical{top:0;right:1px;bottom:2px;width:4px}.mui-scrollbar-vertical .mui-scrollbar-indicator{width:100%}.mui-scrollbar-horizontal{right:2px;bottom:0;left:2px;height:4px}.mui-scrollbar-horizontal .mui-scrollbar-indicator{height:100%}.mui-scrollbar-indicator{position:absolute;display:block;box-sizing:border-box;background:rgba(0,0,0,.39804);border:1px solid rgba(255,255,255,.80196);border-radius:2px;-webkit-transition:.01s cubic-bezier(.1,.57,.1,1);transition:.01s cubic-bezier(.1,.57,.1,1);transform:translate(0px,0) translateZ(0px)}.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll-wrapper,.mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll-wrapper{position:absolute;top:0;bottom:0;left:0;width:100%;overflow:hidden}.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll,.mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll{position:absolute;width:100%}.mui-plus-pullrefresh .mui-scroll-wrapper,.mui-plus-pullrefresh .mui-slider-group{position:static;top:auto;bottom:auto;left:auto;width:auto;overflow:auto}.mui-plus-pullrefresh .mui-scroll{position:static;width:auto}.mui-off-canvas-wrap .mui-bar{position:absolute!important}.mui-off-canvas-wrap{position:relative;z-index:1;width:100%;height:100%;overflow:hidden}.mui-off-canvas-wrap .mui-inner-wrap{position:relative;z-index:1;width:100%;height:100%}.mui-off-canvas-wrap .mui-inner-wrap.mui-transitioning{-webkit-transition:-webkit-transform 200ms ease;transition:transform 200ms ease}.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-left{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-right{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mui-off-canvas-wrap.mui-active{height:100%;overflow:hidden}.mui-off-canvas-wrap.mui-active .mui-off-canvas-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:998;display:block;background:rgba(0,0,0,.4);box-shadow:-4px 0 4px rgba(0,0,0,.5),4px 0 4px rgba(0,0,0,.5);transition:background 200ms ease;-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent}.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-right{z-index:10000!important;-webkit-transform:translate3d(100%,0,0)}.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-left{z-index:10000!important;-webkit-transform:translate3d(-100%,0,0)}.mui-off-canvas-left,.mui-off-canvas-right{position:absolute;top:0;bottom:0;z-index:-1;width:70%;min-height:100%;box-sizing:content-box;-webkit-overflow-scrolling:touch;visibility:hidden;background:#333;-webkit-backface-visibility:hidden}.mui-off-canvas-left.mui-transitioning,.mui-off-canvas-right.mui-transitioning{-webkit-transition:-webkit-transform 200ms ease;transition:transform 200ms ease}.mui-off-canvas-left{left:0}.mui-off-canvas-right{right:0}.mui-loading .mui-spinner{display:block;margin:0 auto}.mui-spinner{display:inline-block;width:24px;height:24px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:spinner-spin 1s step-end infinite;animation:spinner-spin 1s step-end infinite}.mui-spinner:after{display:block;width:100%;height:100%;content:"";background-image:url("data:image/svg+xml;charset=utf-8,");background-repeat:no-repeat;background-position:50%;background-size:100%}.mui-spinner-white:after{background-image:url("data:image/svg+xml;charset=utf-8,")}@-webkit-keyframes spinner-spin{0%{-webkit-transform:rotate(0deg)}8.33333333%{-webkit-transform:rotate(30deg)}16.66666667%{-webkit-transform:rotate(60deg)}25%{-webkit-transform:rotate(90deg)}33.33333333%{-webkit-transform:rotate(120deg)}41.66666667%{-webkit-transform:rotate(150deg)}50%{-webkit-transform:rotate(180deg)}58.33333333%{-webkit-transform:rotate(210deg)}66.66666667%{-webkit-transform:rotate(240deg)}75%{-webkit-transform:rotate(270deg)}83.33333333%{-webkit-transform:rotate(300deg)}91.66666667%{-webkit-transform:rotate(330deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spinner-spin{0%{transform:rotate(0deg)}8.33333333%{transform:rotate(30deg)}16.66666667%{transform:rotate(60deg)}25%{transform:rotate(90deg)}33.33333333%{transform:rotate(120deg)}41.66666667%{transform:rotate(150deg)}50%{transform:rotate(180deg)}58.33333333%{transform:rotate(210deg)}66.66666667%{transform:rotate(240deg)}75%{transform:rotate(270deg)}83.33333333%{transform:rotate(300deg)}91.66666667%{transform:rotate(330deg)}100%{transform:rotate(360deg)}}.mui-btn,button,input[type=button],input[type=reset],input[type=submit]{position:relative;display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42;color:#333;text-align:center;white-space:nowrap;vertical-align:top;cursor:pointer;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-transition:all;transition:all;-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-duration:.2s;transition-duration:.2s}.mui-btn.mui-active,.mui-btn:active,button.mui-active,button:active,input[type=button].mui-active,input[type=button]:active,input[type=reset].mui-active,input[type=reset]:active,input[type=submit].mui-active,input[type=submit]:active{color:#fff;background-color:#929292}.mui-btn.mui-disabled,.mui-btn:disabled,button.mui-disabled,button:disabled,input[type=button].mui-disabled,input[type=button]:disabled,input[type=reset].mui-disabled,input[type=reset]:disabled,input[type=submit].mui-disabled,input[type=submit]:disabled{opacity:.6}.mui-btn-blue,.mui-btn-primary,input[type=submit]{color:#fff;background-color:#007aff;border:1px solid #007aff}.mui-btn-blue.mui-active,.mui-btn-blue:active,.mui-btn-primary.mui-active,.mui-btn-primary:active,input[type=submit].mui-active,input[type=submit]:active{color:#fff;background-color:#0062cc;border:1px solid #0062cc}.mui-btn-green,.mui-btn-positive,.mui-btn-success{color:#fff;background-color:#4cd964;border:1px solid #4cd964}.mui-btn-green.mui-active,.mui-btn-green:active,.mui-btn-positive.mui-active,.mui-btn-positive:active,.mui-btn-success.mui-active,.mui-btn-success:active{color:#fff;background-color:#2ac845;border:1px solid #2ac845}.mui-btn-warning,.mui-btn-yellow{color:#fff;background-color:#f0ad4e;border:1px solid #f0ad4e}.mui-btn-warning.mui-active,.mui-btn-warning:active,.mui-btn-yellow.mui-active,.mui-btn-yellow:active{color:#fff;background-color:#ec971f;border:1px solid #ec971f}.mui-btn-danger,.mui-btn-negative,.mui-btn-red{color:#fff;background-color:#dd524d;border:1px solid #dd524d}.mui-btn-danger.mui-active,.mui-btn-danger:active,.mui-btn-negative.mui-active,.mui-btn-negative:active,.mui-btn-red.mui-active,.mui-btn-red:active{color:#fff;background-color:#cf2d28;border:1px solid #cf2d28}.mui-btn-purple,.mui-btn-royal{color:#fff;background-color:#8a6de9;border:1px solid #8a6de9}.mui-btn-purple.mui-active,.mui-btn-purple:active,.mui-btn-royal.mui-active,.mui-btn-royal:active{color:#fff;background-color:#6641e2;border:1px solid #6641e2}.mui-btn-grey{color:#fff;background-color:#c7c7cc;border:1px solid #c7c7cc}.mui-btn-grey.mui-active,.mui-btn-grey:active{color:#fff;background-color:#acacb4;border:1px solid #acacb4}.mui-btn-outlined{background-color:transparent}.mui-btn-outlined.mui-btn-blue,.mui-btn-outlined.mui-btn-primary{color:#007aff}.mui-btn-outlined.mui-btn-green,.mui-btn-outlined.mui-btn-positive,.mui-btn-outlined.mui-btn-success{color:#4cd964}.mui-btn-outlined.mui-btn-warning,.mui-btn-outlined.mui-btn-yellow{color:#f0ad4e}.mui-btn-outlined.mui-btn-danger,.mui-btn-outlined.mui-btn-negative,.mui-btn-outlined.mui-btn-red{color:#dd524d}.mui-btn-outlined.mui-btn-purple,.mui-btn-outlined.mui-btn-royal{color:#8a6de9}.mui-btn-outlined.mui-btn-blue:active,.mui-btn-outlined.mui-btn-danger:active,.mui-btn-outlined.mui-btn-green:active,.mui-btn-outlined.mui-btn-negative:active,.mui-btn-outlined.mui-btn-positive:active,.mui-btn-outlined.mui-btn-primary:active,.mui-btn-outlined.mui-btn-purple:active,.mui-btn-outlined.mui-btn-red:active,.mui-btn-outlined.mui-btn-royal:active,.mui-btn-outlined.mui-btn-success:active,.mui-btn-outlined.mui-btn-warning:active,.mui-btn-outlined.mui-btn-yellow:active{color:#fff}.mui-btn-link{padding-top:6px;padding-bottom:6px;color:#007aff;background-color:transparent;border:0}.mui-btn-link.mui-active,.mui-btn-link:active{color:#0062cc;background-color:transparent}.mui-btn-block{display:block;width:100%;padding:15px 0;margin-bottom:10px;font-size:18px}.mui-btn .mui-badge{margin:-2px -4px -2px 4px;font-size:14px;background-color:rgba(0,0,0,.15)}.mui-btn .mui-badge-inverted,.mui-btn:active .mui-badge-inverted{background-color:transparent}.mui-btn-negative:active .mui-badge-inverted,.mui-btn-positive:active .mui-badge-inverted,.mui-btn-primary:active .mui-badge-inverted{color:#fff}.mui-btn-block .mui-badge{position:absolute;right:0;margin-right:10px}.mui-btn .mui-icon{font-size:inherit}.mui-btn.mui-icon{font-size:14px;line-height:1.42}.mui-btn.mui-fab{width:56px;height:56px;padding:16px;border-radius:50%;outline:0}.mui-btn.mui-fab.mui-btn-mini{width:40px;height:40px;padding:8px}.mui-btn.mui-fab .mui-icon{width:24px;height:24px;font-size:24px;line-height:24px}.mui-bar{position:fixed;right:0;left:0;z-index:10;height:44px;padding-right:10px;padding-left:10px;background-color:rgba(247,247,247,.98);border-bottom:0;-webkit-box-shadow:0 0 1px rgba(0,0,0,.85);box-shadow:0 0 1px rgba(0,0,0,.85);-webkit-backface-visibility:hidden;backface-visibility:hidden}.mui-bar .mui-title{right:40px;left:40px;width:auto;margin:0;overflow:hidden;text-overflow:ellipsis}.mui-bar .mui-backdrop{background:0 0}.mui-bar-header-secondary{top:44px}.mui-bar-footer{bottom:0}.mui-bar-footer-secondary{bottom:44px}.mui-bar-footer-secondary-tab{bottom:50px}.mui-bar-footer,.mui-bar-footer-secondary,.mui-bar-footer-secondary-tab{border-top:0}.mui-bar-nav{top:0;-webkit-box-shadow:0 1px 6px #ccc;box-shadow:0 1px 6px #ccc}.mui-bar-nav~.mui-content .mui-anchor{display:block;height:45px;margin-top:-45px;visibility:hidden}.mui-bar-nav.mui-bar .mui-icon{padding-right:10px;padding-left:10px;margin-right:-10px;margin-left:-10px}.mui-title{position:absolute;display:block;width:100%;padding:0;margin:0 -10px;font-size:17px;font-weight:500;line-height:44px;color:#000;text-align:center;white-space:nowrap}.mui-title a{color:inherit}.mui-bar-tab{bottom:0;display:table;width:100%;height:50px;padding:0;table-layout:fixed;border-top:0;border-bottom:0;-webkit-touch-callout:none}.mui-bar-tab .mui-tab-item{display:table-cell;width:1%;height:50px;overflow:hidden;color:#929292;text-align:center;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.mui-bar-tab .mui-tab-item.mui-active{color:#007aff}.mui-bar-tab .mui-tab-item .mui-icon{top:3px;width:24px;height:24px;padding-top:0;padding-bottom:0}.mui-bar-tab .mui-tab-item .mui-icon~.mui-tab-label{display:block;overflow:hidden;font-size:11px;text-overflow:ellipsis}.mui-bar-tab .mui-tab-item .mui-icon:active{background:0 0}.mui-focusin>.mui-bar{position:absolute}.mui-bar .mui-btn{position:relative;top:7px;z-index:20;padding:6px 12px 7px;margin-top:0;font-weight:400}.mui-bar .mui-btn.mui-pull-right{margin-left:10px}.mui-bar .mui-btn.mui-pull-left{margin-right:10px}.mui-bar .mui-btn-link{top:0;padding:0;font-size:16px;line-height:44px;color:#007aff;border:0}.mui-bar .mui-btn-link.mui-active,.mui-bar .mui-btn-link:active{color:#0062cc}.mui-bar .mui-btn-block{top:6px;padding:5px 0;margin-bottom:0;font-size:16px}.mui-bar .mui-btn-nav.mui-pull-left{margin-left:-5px}.mui-bar .mui-btn-nav.mui-pull-left .mui-icon-left-nav{margin-right:-3px}.mui-bar .mui-btn-nav.mui-pull-right{margin-right:-5px}.mui-bar .mui-btn-nav.mui-pull-right .mui-icon-right-nav{margin-left:-3px}.mui-bar .mui-btn-nav:active{opacity:.3}.mui-bar .mui-icon{position:relative;z-index:20;padding-top:10px;padding-bottom:10px;font-size:24px}.mui-bar .mui-icon:active{opacity:.3}.mui-bar .mui-btn .mui-icon{top:1px;padding:0;margin:0}.mui-bar .mui-title .mui-icon{padding:0;margin:0}.mui-bar .mui-title .mui-icon.mui-icon-caret{top:4px;margin-left:-5px}.mui-bar input[type=search]{height:29px;margin:6px 0}.mui-bar .mui-input-row .mui-btn{padding:12px 10px}.mui-bar .mui-search:before{margin-top:-10px}.mui-bar .mui-input-row .mui-input-clear~.mui-icon-clear,.mui-bar .mui-input-row .mui-input-speech~.mui-icon-speech{top:0;right:12px}.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-clear~.mui-icon-clear,.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-speech~.mui-icon-speech{top:0;right:0}.mui-bar .mui-segmented-control{top:7px;width:auto;margin:0 auto}.mui-badge{display:inline-block;padding:3px 6px;font-size:12px;line-height:1;color:#333;background-color:rgba(0,0,0,.15);border-radius:100px}.mui-badge.mui-badge-inverted{padding:0 5px 0 0;color:#929292;background-color:transparent}.mui-badge-blue,.mui-badge-primary{color:#fff;background-color:#007aff}.mui-badge-blue.mui-badge-inverted,.mui-badge-primary.mui-badge-inverted{color:#007aff;background-color:transparent}.mui-badge-green,.mui-badge-success{color:#fff;background-color:#4cd964}.mui-badge-green.mui-badge-inverted,.mui-badge-success.mui-badge-inverted{color:#4cd964;background-color:transparent}.mui-badge-warning,.mui-badge-yellow{color:#fff;background-color:#f0ad4e}.mui-badge-warning.mui-badge-inverted,.mui-badge-yellow.mui-badge-inverted{color:#f0ad4e;background-color:transparent}.mui-badge-danger,.mui-badge-red{color:#fff;background-color:#dd524d}.mui-badge-danger.mui-badge-inverted,.mui-badge-red.mui-badge-inverted{color:#dd524d;background-color:transparent}.mui-badge-purple,.mui-badge-royal{color:#fff;background-color:#8a6de9}.mui-badge-purple.mui-badge-inverted,.mui-badge-royal.mui-badge-inverted{color:#8a6de9;background-color:transparent}.mui-icon .mui-badge{position:absolute;top:-2px;left:100%;padding:1px 5px;margin-left:-10px;font-size:10px;line-height:1.4;color:#fff;background:red}.mui-card{margin:0 15px;overflow:hidden;background-color:#fff;background-clip:padding-box;border:1px solid #ddd;border-radius:6px}.mui-content>.mui-card:first-child{margin-top:15px}.mui-card .mui-input-group .mui-input-row:last-child:after,.mui-card .mui-input-group .mui-input-row:last-child:before,.mui-card .mui-input-group:after,.mui-card .mui-input-group:before{height:0}.mui-card .mui-table-view{margin-bottom:0;border-top:0;border-bottom:0;border-radius:6px}.mui-card .mui-table-view .mui-table-view-divider:first-child{top:0;border-top-left-radius:6px;border-top-right-radius:6px}.mui-card .mui-table-view .mui-table-view-divider:last-child{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.mui-card .mui-table-view:after,.mui-card .mui-table-view:before,.mui-card>.mui-table-view>.mui-table-view-cell:last-child:after,.mui-card>.mui-table-view>.mui-table-view-cell:last-child:before{height:0}.mui-table-view{position:relative;padding-left:0;margin-top:0;margin-bottom:0;list-style:none;background-color:#fff}.mui-table-view:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-chevron .mui-table-view-cell{padding-right:65px}.mui-table-view-chevron .mui-table-view-cell>a:not(.mui-btn){margin-right:-65px}.mui-table-view-inverted{color:#fff;background:#333}.mui-table-view-inverted:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';background-color:#222;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-inverted:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';background-color:#222;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-inverted .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';background-color:#222;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-inverted .mui-table-view-cell.mui-active,.mui-table-view-inverted .mui-table-view-cell>a:not(.mui-btn).mui-active{background-color:#242424}.mui-table-view-cell{position:relative;padding:11px 15px;overflow:hidden;background-color:inherit;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-touch-callout:none}.mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-cell.mui-checkbox input[type=checkbox],.mui-table-view-cell.mui-radio input[type=radio]{top:8px}.mui-table-view-cell.mui-checkbox.mui-left,.mui-table-view-cell.mui-radio.mui-left{padding-left:58px}.mui-table-view-cell.mui-active{background-color:#eee}.mui-table-view-cell:last-child:after,.mui-table-view-cell:last-child:before{height:0}.mui-table-view-cell>a:not(.mui-btn){position:relative;display:block;padding:inherit;margin:-11px -15px;overflow:hidden;color:inherit;text-overflow:ellipsis;white-space:nowrap}.mui-table-view-cell>a:not(.mui-btn).mui-active{background-color:#eee}.mui-table-view-cell p{margin-bottom:0}.mui-table-view-cell.mui-transitioning>.mui-slider-handle,.mui-table-view-cell.mui-transitioning>.mui-slider-left .mui-btn,.mui-table-view-cell.mui-transitioning>.mui-slider-right .mui-btn{-webkit-transition:-webkit-transform 300ms ease;transition:transform 300ms ease}.mui-table-view-cell>.mui-slider-handle{background-color:#fff}.mui-table-view-cell>.mui-slider-handle,.mui-table-view-cell>.mui-slider-left .mui-btn,.mui-table-view-cell>.mui-slider-right .mui-btn{-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-backface-visibility:hidden;backface-visibility:hidden}.mui-table-view-cell>.mui-slider-left,.mui-table-view-cell>.mui-slider-right{position:absolute;top:0;display:-webkit-box;display:-webkit-flex;display:flex;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}.mui-table-view-cell>.mui-slider-left>.mui-btn,.mui-table-view-cell>.mui-slider-right>.mui-btn{position:relative;left:0;display:-webkit-box;display:-webkit-flex;display:flex;padding:0 30px;color:#fff;border:0;border-radius:0;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-table-view-cell>.mui-slider-left>.mui-btn:after,.mui-table-view-cell>.mui-slider-right>.mui-btn:after{position:absolute;top:0;z-index:-1;width:600%;height:100%;content:'';background:inherit}.mui-table-view-cell>.mui-slider-left>.mui-btn.mui-icon,.mui-table-view-cell>.mui-slider-right>.mui-btn.mui-icon{font-size:30px}.mui-table-view-cell>.mui-slider-right{right:0;-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-transform:translateX(100%);transform:translateX(100%)}.mui-table-view-cell>.mui-slider-left{left:0;-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.mui-table-view-cell>.mui-slider-left>.mui-btn:after{right:100%;margin-right:-1px}.mui-table-view-divider{position:relative;padding-top:6px;padding-bottom:6px;padding-left:15px;margin-top:-1px;margin-left:0;font-weight:500;color:#999;background-color:#fafafa}.mui-table-view-divider:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-divider:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view .mui-media,.mui-table-view .mui-media-body{overflow:hidden}.mui-table-view .mui-media-object{max-width:42px;height:42px;line-height:42px}.mui-table-view .mui-media-object.mui-pull-left{margin-right:10px}.mui-table-view .mui-media-object.mui-pull-right{margin-left:10px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object{max-width:29px;height:29px;margin:-4px 0;line-height:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object img{max-width:29px;height:29px;line-height:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object.mui-pull-left{margin-right:10px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object .mui-icon{font-size:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-body:after{position:absolute;right:0;bottom:0;left:55px;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view .mui-table-view-cell.mui-media-icon:after{height:0!important}.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view{display:block}.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:after,.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:before{height:0!important}.mui-table-view.mui-unfold .mui-table-view-cell.mui-media-icon.mui-collapse .mui-media-body:after{position:absolute;right:0;bottom:0;left:70px;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view-cell>.mui-badge,.mui-table-view-cell>.mui-btn,.mui-table-view-cell>.mui-switch,.mui-table-view-cell>a>.mui-badge,.mui-table-view-cell>a>.mui-btn,.mui-table-view-cell>a>.mui-switch{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mui-table-view-cell .mui-navigate-left>.mui-badge,.mui-table-view-cell .mui-navigate-left>.mui-btn,.mui-table-view-cell .mui-navigate-left>.mui-switch,.mui-table-view-cell .mui-navigate-right>.mui-badge,.mui-table-view-cell .mui-navigate-right>.mui-btn,.mui-table-view-cell .mui-navigate-right>.mui-switch,.mui-table-view-cell .mui-push-left>.mui-badge,.mui-table-view-cell .mui-push-left>.mui-btn,.mui-table-view-cell .mui-push-left>.mui-switch,.mui-table-view-cell .mui-push-right>.mui-badge,.mui-table-view-cell .mui-push-right>.mui-btn,.mui-table-view-cell .mui-push-right>.mui-switch,.mui-table-view-cell>a .mui-navigate-left>.mui-badge,.mui-table-view-cell>a .mui-navigate-left>.mui-btn,.mui-table-view-cell>a .mui-navigate-left>.mui-switch,.mui-table-view-cell>a .mui-navigate-right>.mui-badge,.mui-table-view-cell>a .mui-navigate-right>.mui-btn,.mui-table-view-cell>a .mui-navigate-right>.mui-switch,.mui-table-view-cell>a .mui-push-left>.mui-badge,.mui-table-view-cell>a .mui-push-left>.mui-btn,.mui-table-view-cell>a .mui-push-left>.mui-switch,.mui-table-view-cell>a .mui-push-right>.mui-badge,.mui-table-view-cell>a .mui-push-right>.mui-btn,.mui-table-view-cell>a .mui-push-right>.mui-switch{right:35px}.mui-content>.mui-table-view:first-child{margin-top:15px}.mui-table-view-cell.mui-collapse>.mui-navigate-right:after,.mui-table-view-cell.mui-collapse>.mui-push-right:after{content:'\e581'}.mui-table-view-cell.mui-collapse.mui-active .mui-collapse-content,.mui-table-view-cell.mui-collapse.mui-active .mui-table-view{display:block}.mui-table-view-cell.mui-collapse.mui-active>.mui-navigate-right:after,.mui-table-view-cell.mui-collapse.mui-active>.mui-push-right:after{content:'\e580'}.mui-table-view-cell.mui-collapse .mui-collapse-content{position:relative;display:none;padding:8px 15px;margin:11px -15px -11px;overflow:hidden;background:#fff;border:1px solid #ddd;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-input-group,.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-slider{width:auto;height:auto;margin:-8px -15px}.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-slider{margin:-8px -16px}.mui-table-view-cell.mui-collapse .mui-table-view{display:none;margin-top:11px;margin-right:-15px;margin-bottom:-11px;margin-left:-15px;border:0}.mui-table-view-cell.mui-collapse .mui-table-view.mui-table-view-chevron{margin-right:-65px}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell{padding-left:31px;background-position:31px 100%}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:30px;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-table-view.mui-grid-view{display:block;width:100%;padding:0 10px 10px 0;font-size:0;white-space:normal}.mui-table-view.mui-grid-view .mui-table-view-cell{display:inline-block;padding:10px 0 0 14px;margin-right:-4px;font-size:17px;text-align:center;vertical-align:middle;background:0 0}.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-object{width:100%;max-width:100%;height:auto}.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn){margin:-10px 0 0 -14px}.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn).mui-active,.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn):active{background:0 0}.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{display:block;width:100%;height:15px;margin-top:8px;font-size:15px;line-height:15px;color:#333;text-overflow:ellipsis}.mui-table-view.mui-grid-view .mui-table-view-cell:after,.mui-table-view.mui-grid-view .mui-table-view-cell:before{height:0}.mui-grid-view.mui-grid-9{padding:1px 0;padding-right:0;background-color:#f2f2f2}.mui-grid-view.mui-grid-9 .mui-table-view-cell{padding:11px 15px;margin:-1px 0 0 -1px;vertical-align:top;border-top:1px solid #eee;border-left:1px solid #eee}.mui-grid-view.mui-grid-9 .mui-table-view-cell.mui-active{background-color:#eee}.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn){padding:10px 0;margin:0}.mui-grid-view.mui-grid-9:before{height:0}.mui-grid-view.mui-grid-9 .mui-media{color:#797979}.mui-grid-view.mui-grid-9 .mui-media .mui-icon{position:relative;font-size:2.4em}.mui-slider-cell{position:relative}.mui-slider-cell>.mui-slider-handle{z-index:1}.mui-slider-cell>.mui-slider-left,.mui-slider-cell>.mui-slider-right{position:absolute;top:0;bottom:0;z-index:0}.mui-slider-cell>.mui-slider-left{left:0}.mui-slider-cell>.mui-slider-right{right:0}input,select,textarea{font-family:"Helvetica Neue",Helvetica,sans-serif;font-size:17px;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent}input:focus,select:focus,textarea:focus{-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent;-webkit-user-modify:read-write-plaintext-only}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{width:100%;height:40px;-webkit-appearance:none;padding:10px 15px;margin-bottom:15px;line-height:21px;-webkit-user-select:text;background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:3px;outline:0}input[type=number]::-webkit-outer-spin-button{margin:0}input[type=search]{height:34px;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:16px;text-align:center;background-color:rgba(0,0,0,.1);border:0;border-radius:6px}input[type=search]:focus{text-align:left}textarea{height:auto;resize:none}select{height:auto;margin-top:1px;font-size:14px;background-color:#fff;border:0!important}select:focus{-webkit-user-modify:read-only}.mui-input-group{position:relative;padding:0;background-color:#fff;border:0}.mui-input-group:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-input-group:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-input-group input[type=text],.mui-input-group textarea{margin-bottom:0;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.mui-input-group input[type=text]:after,.mui-input-group textarea:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-input-group input[type=search]{background:0 0}.mui-input-group input:last-child{background-image:none}.mui-input-row{overflow:hidden;clear:left}.mui-input-row select{height:37px;padding:0;font-size:17px}.mui-input-row .mui-btn+input,.mui-input-row label+input,.mui-input-row:last-child{background-image:none}.mui-input-group .mui-input-row{height:40px}.mui-input-group .mui-input-row:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-input-row label{float:left;width:35%;padding:10px 15px;font-family:"Helvetica Neue",Helvetica,sans-serif;line-height:1.1}.mui-input-row label~input,.mui-input-row label~select,.mui-input-row label~textarea{float:right;width:65%;padding-left:0;margin-bottom:0;border:0}.mui-input-row .mui-btn{float:right;width:15%;padding:10px 15px;font-family:"Helvetica Neue",Helvetica,sans-serif;line-height:1.1}.mui-input-row .mui-btn~input,.mui-input-row .mui-btn~select,.mui-input-row .mui-btn~textarea{float:left;width:85%;padding-left:0;margin-bottom:0;border:0}.mui-button-row{position:relative;padding-top:5px;text-align:center}.mui-input-group .mui-button-row{height:45px}.mui-input-row{position:relative}.mui-input-row.mui-input-range{padding-right:20px;overflow:visible}.mui-input-row .mui-inline{padding:8px 0}.mui-input-row .mui-input-clear~.mui-icon-clear,.mui-input-row .mui-input-speech~.mui-icon-speech{position:absolute;top:10px;right:0;z-index:1;width:38px;height:38px;font-size:20px;color:#999;text-align:center}.mui-input-row .mui-input-speech~.mui-icon-speech{top:8px;font-size:24px}.mui-input-row .mui-input-clear~.mui-icon-clear~.mui-icon-speech{display:none}.mui-input-row .mui-input-clear~.mui-icon-clear.mui-hidden~.mui-icon-speech{display:inline-block}.mui-input-row .mui-icon-speech~.mui-placeholder{right:38px}.mui-input-row.mui-search .mui-icon-clear{top:7px}.mui-input-row.mui-search .mui-icon-speech{top:5px}.mui-checkbox,.mui-radio{position:relative}.mui-checkbox label,.mui-radio label{display:inline-block;float:none;width:100%}.mui-checkbox.mui-left input[type=checkbox],.mui-radio.mui-left input[type=radio]{left:20px}.mui-checkbox.mui-left label,.mui-radio.mui-left label{padding-left:58px}.mui-checkbox input[type=checkbox],.mui-radio input[type=radio]{position:absolute;top:4px;right:20px;display:inline-block;width:28px;height:26px;-webkit-appearance:none;background-color:transparent;border:0;outline:0!important}.mui-checkbox input[type=checkbox]:before,.mui-radio input[type=radio]:before{font-family:Muiicons;font-size:28px;font-weight:400;line-height:1;color:rgba(170,170,170,.6);text-decoration:none;background:0 0;border-radius:0;-webkit-font-smoothing:antialiased}.mui-checkbox input[type=checkbox]:checked:before,.mui-radio input[type=radio]:checked:before{color:#007aff}.mui-radio input[type=radio]:before{content:"\e411"}.mui-radio input[type=radio]:checked:before{content:"\e441"}.mui-checkbox input[type=checkbox]:before{content:"\e411"}.mui-checkbox input[type=checkbox]:checked:before{content:"\e442"}.mui-select{position:relative}.mui-select:before{position:absolute;top:8px;right:21px;font-family:Muiicons;color:rgba(170,170,170,.6);content:'\e581'}.mui-input-row .mui-switch{float:right;margin-top:5px;margin-right:20px}.mui-input-range input[type=range]{position:relative;width:100%;height:2px;-webkit-appearance:none!important;padding:0;margin:17px 0;cursor:pointer;background-color:#999;border:0;border-radius:3px;outline:0}.mui-input-range input[type=range]::-webkit-slider-thumb{width:28px;height:28px;-webkit-appearance:none!important;background-color:#007aff;background-clip:padding-box;border-color:#0062cc;border-radius:50%}.mui-input-range label~input[type=range]{width:65%}.mui-input-range .mui-tooltip{position:absolute;top:-70px;z-index:1;width:64px;height:64px;font-size:36px;line-height:64px;color:#333;text-align:center;text-shadow:0 1px 0 #f3f3f3;background-color:#fff;border:1px solid #ddd;border-radius:6px;opacity:.8}.mui-search{position:relative}.mui-search input[type=search]{padding-left:30px}.mui-search .mui-placeholder{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;display:inline-block;height:34px;font-size:16px;line-height:34px;color:#999;text-align:center;background:0 0;border:0;border-radius:6px}.mui-search .mui-placeholder .mui-icon{font-size:20px;color:#333}.mui-search:before{position:absolute;top:50%;right:50%;display:none;margin-top:-18px;margin-right:31px;font-family:Muiicons;font-size:20px;font-weight:400;content:'\e466'}.mui-search.mui-active:before{right:auto;left:5px;display:block;margin-right:0;font-size:20px}.mui-search.mui-active input[type=search]{text-align:left}.mui-search.mui-active .mui-placeholder{display:none}.mui-segmented-control{position:relative;display:table;width:100%;overflow:hidden;font-size:15px;font-weight:400;table-layout:fixed;background-color:transparent;border:1px solid #007aff;border-radius:3px;-webkit-touch-callout:none}.mui-segmented-control.mui-scroll-wrapper{height:38px}.mui-segmented-control.mui-scroll-wrapper .mui-scroll{width:auto;height:40px;white-space:nowrap}.mui-segmented-control.mui-scroll-wrapper .mui-control-item{display:inline-block;width:auto;padding:0 20px;border:0}.mui-segmented-control .mui-control-item{display:table-cell;width:1%;overflow:hidden;line-height:38px;color:#007aff;text-align:center;text-overflow:ellipsis;white-space:nowrap;border-color:#007aff;border-left:1px solid #007aff;-webkit-transition:background-color .1s linear;transition:background-color .1s linear}.mui-segmented-control .mui-control-item:first-child{border-left-width:0}.mui-segmented-control .mui-control-item.mui-active{color:#fff;background-color:#007aff}.mui-segmented-control.mui-segmented-control-inverted{width:100%;border:0;border-radius:0}.mui-segmented-control.mui-segmented-control-inverted .mui-control-item{color:inherit;border:0}.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{color:#007aff;background:0 0;border-bottom:2px solid #007aff}.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#007aff}.mui-segmented-control-positive{border:1px solid #4cd964}.mui-segmented-control-positive .mui-control-item{color:#4cd964;border-color:inherit}.mui-segmented-control-positive .mui-control-item.mui-active{color:#fff;background-color:#4cd964}.mui-segmented-control-positive.mui-segmented-control-inverted .mui-control-item.mui-active{color:#4cd964;background:0 0;border-bottom:2px solid #4cd964}.mui-segmented-control-positive.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#4cd964}.mui-segmented-control-negative{border:1px solid #dd524d}.mui-segmented-control-negative .mui-control-item{color:#dd524d;border-color:inherit}.mui-segmented-control-negative .mui-control-item.mui-active{color:#fff;background-color:#dd524d}.mui-segmented-control-negative.mui-segmented-control-inverted .mui-control-item.mui-active{color:#dd524d;background:0 0;border-bottom:2px solid #dd524d}.mui-segmented-control-negative.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#dd524d}.mui-control-content{position:relative;display:none}.mui-control-content.mui-active{display:block}.mui-popover{position:absolute;z-index:999;display:none;width:280px;background-color:rgba(247,247,247,.98);border-radius:7px;-webkit-box-shadow:0 0 15px rgba(0,0,0,.1);box-shadow:0 0 15px rgba(0,0,0,.1);opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transform:none;transform:none}.mui-popover .mui-popover-arrow{position:absolute;top:-25px;left:0;z-index:1000;width:26px;height:26px;overflow:hidden}.mui-popover .mui-popover-arrow:after{position:absolute;top:19px;left:0;width:26px;height:26px;content:' ';background:rgba(247,247,247,.98);border-radius:3px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.mui-popover .mui-popover-arrow.mui-bottom{top:100%;left:-26px;margin-top:-1px}.mui-popover .mui-popover-arrow.mui-bottom:after{top:-19px;left:0}.mui-popover.mui-popover-action{bottom:0;width:100%;background:0 0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:-webkit-transform .3s,opacity .3s;transition:transform .3s,opacity .3s;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.mui-popover.mui-popover-action .mui-popover-arrow{display:none}.mui-popover.mui-popover-action.mui-active{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-popover.mui-popover-action .mui-table-view{margin:8px;color:#007aff;text-align:center;border-radius:4px}.mui-popover.mui-popover-action .mui-table-view .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';background-color:#c8c7cc;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.mui-popover.mui-popover-action .mui-table-view small{display:block;font-weight:400;line-height:1.3}.mui-popover.mui-active{display:block;opacity:1}.mui-popover .mui-bar~.mui-table-view{padding-top:44px}.mui-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:998;background-color:rgba(0,0,0,.3)}.mui-bar-backdrop.mui-backdrop{bottom:50px;background:0 0}.mui-backdrop-action.mui-backdrop{background-color:rgba(0,0,0,.3)}.mui-backdrop-action.mui-backdrop,.mui-bar-backdrop.mui-backdrop{opacity:0}.mui-backdrop-action.mui-backdrop.mui-active,.mui-bar-backdrop.mui-backdrop.mui-active{opacity:1;-webkit-transition:all .4s ease;transition:all .4s ease}.mui-popover .mui-btn-block{margin-bottom:5px}.mui-popover .mui-btn-block:last-child{margin-bottom:0}.mui-popover .mui-bar{-webkit-box-shadow:none;box-shadow:none}.mui-popover .mui-bar-nav{border-bottom:1px solid rgba(0,0,0,.15);border-top-left-radius:12px;border-top-right-radius:12px;-webkit-box-shadow:none;box-shadow:none}.mui-popover .mui-scroll-wrapper{margin:7px 0;background-clip:padding-box;border-radius:7px}.mui-popover .mui-scroll .mui-table-view{max-height:none}.mui-popover .mui-table-view{max-height:300px;margin-bottom:0;overflow:auto;-webkit-overflow-scrolling:touch;background-color:rgba(247,247,247,.98);background-image:none;border-radius:7px}.mui-popover .mui-table-view:after,.mui-popover .mui-table-view:before{height:0}.mui-popover .mui-table-view .mui-table-view-cell:first-child,.mui-popover .mui-table-view .mui-table-view-cell:first-child>a:not(.mui-btn){border-top-left-radius:12px;border-top-right-radius:12px}.mui-popover .mui-table-view .mui-table-view-cell:last-child,.mui-popover .mui-table-view .mui-table-view-cell:last-child>a:not(.mui-btn){border-bottom-right-radius:12px;border-bottom-left-radius:12px}.mui-popover.mui-bar-popover .mui-table-view{width:106px}.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell{padding:11px 15px;background-position:0 100%}.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell>a:not(.mui-btn){margin:-11px -15px -11px -15px}.mui-pagination{display:inline-block;padding-left:0;margin:0 auto;border-radius:6px}.mui-pagination>li{display:inline}.mui-pagination>li>a,.mui-pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;color:#007aff;text-decoration:none;background-color:#fff;border:1px solid #ddd}.mui-pagination>li:first-child>a,.mui-pagination>li:first-child>span{margin-left:0;background-clip:padding-box;border-top-left-radius:6px;border-bottom-left-radius:6px}.mui-pagination>li:last-child>a,.mui-pagination>li:last-child>span{background-clip:padding-box;border-top-right-radius:6px;border-bottom-right-radius:6px}.mui-pagination>li.mui-active>a,.mui-pagination>li.mui-active>a:active,.mui-pagination>li.mui-active>span,.mui-pagination>li.mui-active>span:active,.mui-pagination>li:active>a,.mui-pagination>li:active>a:active,.mui-pagination>li:active>span,.mui-pagination>li:active>span:active{z-index:2;color:#fff;cursor:default;background-color:#007aff;border-color:#007aff}.mui-pagination>li.mui-disabled>a,.mui-pagination>li.mui-disabled>a:active,.mui-pagination>li.mui-disabled>span,.mui-pagination>li.mui-disabled>span:active{color:#777;background-color:#fff;border:1px solid #ddd;opacity:.6}.mui-pagination-lg>li>a,.mui-pagination-lg>li>span{padding:10px 16px;font-size:18px}.mui-pagination-sm>li>a,.mui-pagination-sm>li>span{padding:5px 10px;font-size:12px}.mui-pager{padding-left:0;text-align:center;list-style:none}.mui-pager:after,.mui-pager:before{display:table;content:" "}.mui-pager:after{clear:both}.mui-pager li{display:inline}.mui-pager li>a,.mui-pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;background-clip:padding-box;border:1px solid #ddd;border-radius:6px}.mui-pager li.mui-active>a,.mui-pager li.mui-active>span,.mui-pager li:active>a,.mui-pager li:active>span{color:#fff;text-decoration:none;cursor:default;background-color:#007aff;border-color:#007aff}.mui-pager .mui-next>a,.mui-pager .mui-next>span{float:right}.mui-pager .mui-previous>a,.mui-pager .mui-previous>span{float:left}.mui-pager .mui-disabled>a,.mui-pager .mui-disabled>a:active,.mui-pager .mui-disabled>span,.mui-pager .mui-disabled>span:active{color:#777;background-color:#fff;border:1px solid #ddd;opacity:.6}.mui-modal{position:fixed;top:0;z-index:999;width:100%;min-height:100%;overflow:hidden;background-color:#fff;opacity:0;-webkit-transition:-webkit-transform .25s,opacity 1ms .25s;transition:transform .25s,opacity 1ms .25s;-webkit-transition-timing-function:cubic-bezier(.1,.5,.1,1);transition-timing-function:cubic-bezier(.1,.5,.1,1);-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.mui-modal.mui-active{height:100%;opacity:1;-webkit-transition:-webkit-transform .25s;transition:transform .25s;-webkit-transition-timing-function:cubic-bezier(.1,.5,.1,1);transition-timing-function:cubic-bezier(.1,.5,.1,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-android .mui-modal .mui-bar{position:static}.mui-android .mui-modal .mui-bar-nav~.mui-content{padding-top:0}.mui-slider{position:relative;width:100%;overflow:hidden}.mui-slider .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{border-bottom:0}.mui-slider .mui-segmented-control.mui-segmented-control-inverted~.mui-slider-group .mui-slider-item{border-top:1px solid #c8c7cc;border-bottom:1px solid #c8c7cc}.mui-slider .mui-slider-group{position:relative;font-size:0;white-space:nowrap;-webkit-transition:all 0s linear;transition:all 0s linear}.mui-slider .mui-slider-group .mui-slider-item{position:relative;display:inline-block;width:100%;height:100%;font-size:14px;vertical-align:top}.mui-slider .mui-slider-group .mui-slider-item>a:not(.mui-control-item){position:relative;display:block;line-height:0}.mui-slider .mui-slider-group .mui-slider-item img{width:100%}.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:after,.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:before{height:0}.mui-slider .mui-slider-group.mui-slider-loop{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}.mui-slider-title{position:absolute;bottom:0;left:0;width:100%;height:30px;margin:0;line-height:30px;text-align:left;text-indent:12px;background-color:#000;opacity:.8}.mui-slider-indicator{position:absolute;bottom:8px;width:100%;text-align:center;background:0 0}.mui-slider-indicator.mui-segmented-control{position:relative;bottom:auto}.mui-slider-indicator .mui-indicator{display:inline-block;width:6px;height:6px;margin:1px 6px;cursor:pointer;background:#aaa;border-radius:50%;-webkit-box-shadow:0 0 1px 1px rgba(130,130,130,.7);box-shadow:0 0 1px 1px rgba(130,130,130,.7)}.mui-slider-indicator .mui-active.mui-indicator{background:#fff}.mui-slider-indicator .mui-icon{width:40px;height:30px;margin:3px;font-size:20px;line-height:30px;text-align:center;border:1px solid #ddd}.mui-slider-indicator .mui-number{display:inline-block;width:58px;line-height:32px}.mui-slider-indicator .mui-number span{color:#ff5053}.mui-slider-progress-bar{z-index:1;height:2px;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden}.mui-switch{position:relative;display:block;width:74px;height:30px;background-color:#fff;background-clip:padding-box;border:2px solid #ddd;border-radius:20px;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:background-color,border;transition-property:background-color,border}.mui-switch.mui-disabled{opacity:.3}.mui-switch .mui-switch-handle{position:absolute;top:-1px;left:-1px;z-index:1;width:28px;height:28px;background-color:#fff;background-clip:padding-box;border-radius:16px;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.4);box-shadow:0 2px 5px rgba(0,0,0,.4);-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out;-webkit-transition-property:-webkit-transform,width,left;transition-property:transform,width,left}.mui-switch:before{position:absolute;top:3px;right:11px;font-size:13px;color:#999;text-transform:uppercase;content:"Off"}.mui-switch.mui-dragging{background-color:rgba(247,247,247,.98);border-color:rgba(247,247,247,.98)}.mui-switch.mui-dragging .mui-switch-handle{width:38px}.mui-switch.mui-dragging.mui-active .mui-switch-handle{left:-11px;width:38px}.mui-switch.mui-active{background-color:#4cd964;border-color:#4cd964}.mui-switch.mui-active .mui-switch-handle{-webkit-transform:translate3d(43px,0,0);transform:translate3d(43px,0,0)}.mui-switch.mui-active:before{right:auto;left:15px;color:#fff;content:"On"}.mui-switch input[type=checkbox]{display:none}.mui-switch-mini{width:47px}.mui-switch-mini:before{display:none}.mui-switch-mini.mui-active .mui-switch-handle{-webkit-transform:translate3d(16px,0,0);transform:translate3d(16px,0,0)}.mui-switch-blue.mui-active{background-color:#007aff;border:2px solid #007aff}.mui-content.mui-fade{left:0;opacity:0}.mui-content.mui-fade.mui-in{opacity:1}.mui-content.mui-sliding{z-index:2;-webkit-transition:-webkit-transform .4s;transition:transform .4s;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-content.mui-sliding.mui-left{z-index:1;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mui-content.mui-sliding.mui-right{z-index:3;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mui-navigate-left:after,.mui-navigate-right:after,.mui-push-left:after,.mui-push-right:after{position:absolute;top:50%;display:inline-block;font-family:Muiicons;font-size:inherit;line-height:1;color:#bbb;text-decoration:none;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-font-smoothing:antialiased}.mui-navigate-left:after,.mui-push-left:after{left:15px;content:'\e582'}.mui-navigate-right:after,.mui-push-right:after{right:15px;content:'\e583'}.mui-pull-bottom-pocket,.mui-pull-top-pocket{position:absolute;left:0;display:block;width:100%;height:50px;overflow:hidden;visibility:hidden}.mui-plus-pullrefresh .mui-pull-bottom-pocket,.mui-plus-pullrefresh .mui-pull-top-pocket{display:none;visibility:visible}.mui-pull-top-pocket{top:0}.mui-bar-nav~.mui-content .mui-pull-top-pocket{top:44px}.mui-bar-nav~.mui-bar-header-secondary~.mui-content .mui-pull-top-pocket{top:88px}.mui-pull-bottom-pocket{position:relative;bottom:0;height:40px}.mui-pull-bottom-pocket .mui-pull-loading{visibility:hidden}.mui-pull-bottom-pocket .mui-pull-loading.mui-in{display:inline-block}.mui-pull{position:absolute;right:0;bottom:10px;left:0;font-weight:700;color:#777;text-align:center}.mui-pull-loading{margin-right:10px;vertical-align:middle;-webkit-transition:-webkit-transform .4s;transition:transform .4s;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-backface-visibility:hidden}.mui-pull-loading.mui-reverse{-webkit-transform:rotate(180deg) translateZ(0);transform:rotate(180deg) translateZ(0)}.mui-pull-caption{position:relative;display:inline-block;margin-top:0;overflow:visible;font-size:15px;line-height:24px;vertical-align:middle}.mui-pull-caption span{display:none}.mui-pull-caption span.mui-in{display:inline}.mui-toast-container{position:fixed;bottom:50px;z-index:9999;width:100%}.mui-toast-message{width:270px;padding:5px;margin:5px auto;font-size:14px;color:#000;text-align:center;background-color:#d8d8d8;border-radius:7px}@font-face{font-family:Muiicons;font-style:normal;font-weight:400;src:url(../fonts/mui.ttf) format("truetype")}.mui-icon{display:inline-block;font-family:Muiicons;font-size:24px;font-style:normal;font-weight:400;line-height:1;text-decoration:none;-webkit-font-smoothing:antialiased}.mui-icon.mui-right:before{float:right;padding-left:.2em}.mui-icon-contact:before{content:"\e100"}.mui-icon-person:before{content:"\e101"}.mui-icon-personadd:before{content:"\e102"}.mui-icon-contact-filled:before{content:"\e130"}.mui-icon-person-filled:before{content:"\e131"}.mui-icon-personadd-filled:before{content:"\e132"}.mui-icon-phone:before{content:"\e200"}.mui-icon-email:before{content:"\e201"}.mui-icon-chatbubble:before{content:"\e202"}.mui-icon-chatboxes:before{content:"\e203"}.mui-icon-phone-filled:before{content:"\e230"}.mui-icon-email-filled:before{content:"\e231"}.mui-icon-chatbubble-filled:before{content:"\e232"}.mui-icon-chatboxes-filled:before{content:"\e233"}.mui-icon-weibo:before{content:"\e260"}.mui-icon-weixin:before{content:"\e261"}.mui-icon-pengyouquan:before{content:"\e262"}.mui-icon-chat:before{content:"\e263"}.mui-icon-videocam:before{content:"\e300"}.mui-icon-camera:before{content:"\e301"}.mui-icon-mic:before{content:"\e302"}.mui-icon-location:before{content:"\e303"}.mui-icon-mic-filled:before,.mui-icon-speech:before{content:"\e332"}.mui-icon-location-filled:before{content:"\e333"}.mui-icon-micoff:before{content:"\e360"}.mui-icon-image:before{content:"\e363"}.mui-icon-map:before{content:"\e364"}.mui-icon-compose:before{content:"\e400"}.mui-icon-trash:before{content:"\e401"}.mui-icon-upload:before{content:"\e402"}.mui-icon-download:before{content:"\e403"}.mui-icon-close:before{content:"\e404"}.mui-icon-redo:before{content:"\e405"}.mui-icon-undo:before{content:"\e406"}.mui-icon-refresh:before{content:"\e407"}.mui-icon-star:before{content:"\e408"}.mui-icon-plus:before{content:"\e409"}.mui-icon-minus:before{content:"\e410"}.mui-icon-checkbox:before,.mui-icon-circle:before{content:"\e411"}.mui-icon-clear:before,.mui-icon-close-filled:before{content:"\e434"}.mui-icon-refresh-filled:before{content:"\e437"}.mui-icon-star-filled:before{content:"\e438"}.mui-icon-plus-filled:before{content:"\e439"}.mui-icon-minus-filled:before{content:"\e440"}.mui-icon-circle-filled:before{content:"\e441"}.mui-icon-checkbox-filled:before{content:"\e442"}.mui-icon-closeempty:before{content:"\e460"}.mui-icon-refreshempty:before{content:"\e461"}.mui-icon-reload:before{content:"\e462"}.mui-icon-starhalf:before{content:"\e463"}.mui-icon-spinner:before{content:"\e464"}.mui-icon-spinner-cycle:before{content:"\e465"}.mui-icon-search:before{content:"\e466"}.mui-icon-plusempty:before{content:"\e468"}.mui-icon-forward:before{content:"\e470"}.mui-icon-back:before,.mui-icon-left-nav:before{content:"\e471"}.mui-icon-checkmarkempty:before{content:"\e472"}.mui-icon-home:before{content:"\e500"}.mui-icon-navigate:before{content:"\e501"}.mui-icon-gear:before{content:"\e502"}.mui-icon-paperplane:before{content:"\e503"}.mui-icon-info:before{content:"\e504"}.mui-icon-help:before{content:"\e505"}.mui-icon-locked:before{content:"\e506"}.mui-icon-more:before{content:"\e507"}.mui-icon-flag:before{content:"\e508"}.mui-icon-home-filled:before{content:"\e530"}.mui-icon-gear-filled:before{content:"\e532"}.mui-icon-info-filled:before{content:"\e534"}.mui-icon-help-filled:before{content:"\e535"}.mui-icon-more-filled:before{content:"\e537"}.mui-icon-settings:before{content:"\e560"}.mui-icon-list:before{content:"\e562"}.mui-icon-bars:before{content:"\e563"}.mui-icon-loop:before{content:"\e565"}.mui-icon-paperclip:before{content:"\e567"}.mui-icon-arrowup:before{content:"\e580"}.mui-icon-arrowdown:before{content:"\e581"}.mui-icon-arrowleft:before{content:"\e582"}.mui-icon-arrowright:before{content:"\e583"}.mui-icon-arrowthinup:before{content:"\e584"}.mui-icon-arrowthindown:before{content:"\e585"}.mui-icon-arrowthinleft:before{content:"\e586"}.mui-icon-arrowthinright:before{content:"\e587"}.mui-icon-pulldown:before{content:"\e588"}.mui-fullscreen{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.mui-fullscreen .mui-slider-group{height:100%}.mui-fullscreen .mui-segmented-control~.mui-slider-group{position:absolute;top:40px;bottom:0;width:100%;height:auto}.mui-fullscreen .mui-slider-item>a{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mui-bar-tab~.mui-content .mui-slider.mui-fullscreen .mui-segmented-control~.mui-slider-group{bottom:50px}.mui-android.mui-android-4-0 input:focus,.mui-android.mui-android-4-0 textarea:focus{-webkit-user-modify:inherit} \ No newline at end of file diff --git a/examples/login/css/style.css b/examples/login/css/style.css new file mode 100644 index 00000000..f76e53c9 --- /dev/null +++ b/examples/login/css/style.css @@ -0,0 +1,8 @@ +.ui-page-login, +body { + width: 100%; + height: 100%; + margin: 0px; + padding: 0px; +} +.mui-content{height: 100%;} diff --git a/examples/login/fonts/mui.ttf b/examples/login/fonts/mui.ttf new file mode 100644 index 00000000..eced387e Binary files /dev/null and b/examples/login/fonts/mui.ttf differ diff --git a/examples/login/images/icon100.png b/examples/login/images/icon100.png new file mode 100644 index 00000000..8a91df09 Binary files /dev/null and b/examples/login/images/icon100.png differ diff --git a/examples/login/images/user-photo.png b/examples/login/images/user-photo.png new file mode 100644 index 00000000..051b92ea Binary files /dev/null and b/examples/login/images/user-photo.png differ diff --git a/examples/login/index.html b/examples/login/index.html new file mode 100644 index 00000000..3cbf5eb9 --- /dev/null +++ b/examples/login/index.html @@ -0,0 +1,81 @@ + + + + + + + + + + + +
+ 正在启动应用... +
+ + + + + + \ No newline at end of file diff --git a/examples/login/js/app.js b/examples/login/js/app.js new file mode 100644 index 00000000..97d28245 --- /dev/null +++ b/examples/login/js/app.js @@ -0,0 +1,57 @@ +(function($, owner) { + owner.login = function(loginInfo, callback) { + callback = callback || $.noop; + loginInfo = loginInfo || {}; + loginInfo.account = loginInfo.account || ''; + loginInfo.password = loginInfo.password || ''; + var users = JSON.parse(localStorage.getItem('$users') || '[]'); + var authed = users.some(function(user) { + return loginInfo.account == user.account && loginInfo.password == user.password; + }); + if (authed) { + var state = owner.getState(); + state.account = loginInfo.account; + state.token = "token123456789"; + owner.setState(state); + return callback(); + } else { + return callback('用户名或密码错误'); + } + }; + owner.reg = function(regInfo, callback) { + callback = callback || $.noop; + regInfo = regInfo || {}; + regInfo.account = regInfo.account || ''; + regInfo.password = regInfo.password || ''; + if (regInfo.account.length < 5) { + return callback('用户名最短需要 5 个字符'); + } + if (regInfo.password.length < 6) { + return callback('密码最短需要 6 个字符'); + } + var users = JSON.parse(localStorage.getItem('$users') || '[]'); + users.push(regInfo); + localStorage.setItem('$users', JSON.stringify(users)); + return callback(); + }; + + owner.getState = function() { + var stateText = localStorage.getItem('$state') || "{}"; + return JSON.parse(stateText); + }; + owner.setState = function(state) { + state = state || {}; + localStorage.setItem('$state', JSON.stringify(state)); + var settings = owner.getSettings(); + settings.gestures = ''; + owner.setSettings(settings); + }; + owner.setSettings = function(settings) { + settings = settings || {}; + localStorage.setItem('$settings', JSON.stringify(settings)); + } + owner.getSettings = function() { + var settingsText = localStorage.getItem('$settings') || "{}"; + return JSON.parse(settingsText); + } +}(mui, window.app = {})); \ No newline at end of file diff --git a/examples/login/js/mui.js b/examples/login/js/mui.js new file mode 100644 index 00000000..f9488c4c --- /dev/null +++ b/examples/login/js/mui.js @@ -0,0 +1,5988 @@ +/*! + * ===================================================== + * Mui v1.2.0 (https://github.com/dcloudio/mui) + * ===================================================== + */ +/** + * MUI核心JS + * @type _L4.$|Function + */ +var mui = (function(document, undefined) { + var readyRE = /complete|loaded|interactive/; + var idSelectorRE = /^#([\w-]+)$/; + var classSelectorRE = /^\.([\w-]+)$/; + var tagSelectorRE = /^[\w-]+$/; + var translateRE = /translate(?:3d)?\((.+?)\)/; + var translateMatrixRE = /matrix(3d)?\((.+?)\)/; + + var $ = function(selector, context) { + context = context || document; + if (!selector) + return wrap(); + if (typeof selector === 'object') + return wrap([selector], null); + if (typeof selector === 'function') + return $.ready(selector); + if (typeof selector === 'string') { + try { + selector = selector.trim(); + if (idSelectorRE.test(selector)) { + var found = document.getElementById(RegExp.$1); + return wrap(found ? [found] : []); + } + return wrap($.qsa(selector, context), selector); + } catch (e) {} + } + return wrap(); + }; + + var wrap = function(dom, selector) { + dom = dom || []; + Object.setPrototypeOf(dom, $.fn); + dom.selector = selector || ''; + return dom; + }; + + $.uuid = 0; + + $.data = {}; + /** + * extend(simple) + * @param {type} target + * @param {type} source + * @param {type} deep + * @returns {unresolved} + */ + $.extend = function() { //from jquery2 + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + if (typeof target === "boolean") { + deep = target; + + target = arguments[i] || {}; + i++; + } + + if (typeof target !== "object" && !$.isFunction(target)) { + target = {}; + } + + if (i === length) { + target = this; + i--; + } + + for (; i < length; i++) { + if ((options = arguments[i]) != null) { + for (name in options) { + src = target[name]; + copy = options[name]; + + if (target === copy) { + continue; + } + + if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && $.isArray(src) ? src : []; + + } else { + clone = src && $.isPlainObject(src) ? src : {}; + } + + target[name] = $.extend(deep, clone, copy); + + } else if (copy !== undefined) { + target[name] = copy; + } + } + } + } + + return target; + }; + /** + * mui noop(function) + */ + $.noop = function() {}; + /** + * mui slice(array) + */ + $.slice = [].slice; + + $.type = function(obj) { + return obj == null ? String(obj) : class2type[{}.toString.call(obj)] || "object"; + }; + /** + * mui isArray + */ + $.isArray = Array.isArray || + function(object) { + return object instanceof Array; + }; + /** + * mui isWindow(需考虑obj为undefined的情况) + */ + $.isWindow = function(obj) { + return obj != null && obj === obj.window; + }; + /** + * mui isObject + */ + $.isObject = function(obj) { + return $.type(obj) === "object"; + }; + /** + * mui isPlainObject + */ + $.isPlainObject = function(obj) { + return $.isObject(obj) && !$.isWindow(obj) && Object.getPrototypeOf(obj) === Object.prototype; + }; + /** + * mui isFunction + */ + $.isFunction = function(value) { + return $.type(value) === "function"; + }; + /** + * mui querySelectorAll + * @param {type} selector + * @param {type} context + * @returns {Array} + */ + $.qsa = function(selector, context) { + context = context || document; + return $.slice.call(classSelectorRE.test(selector) ? context.getElementsByClassName(RegExp.$1) : tagSelectorRE.test(selector) ? context.getElementsByTagName(selector) : context.querySelectorAll(selector)); + }; + /** + * ready(DOMContentLoaded) + * @param {type} callback + * @returns {_L6.$} + */ + $.ready = function(callback) { + if (readyRE.test(document.readyState)) { + callback($); + } else { + document.addEventListener('DOMContentLoaded', function() { + callback($); + }, false); + } + return this; + }; + /** + * map + */ + $.map = function(elements, callback) { + var value, values = [], + i, key; + if (typeof elements.length === 'number') { //TODO 此处逻辑不严谨,可能会有Object:{a:'b',length:1}的情况未处理 + for (i = 0, len = elements.length; i < len; i++) { + value = callback(elements[i], i); + if (value != null) values.push(value); + } + } else { + for (key in elements) { + value = callback(elements[key], key); + if (value != null) values.push(value); + } + } + return values.length > 0 ? [].concat.apply([], values) : values; + }; + /** + * each + * @param {type} elements + * @param {type} callback + * @returns {_L8.$} + */ + $.each = function(elements, callback) { + if (!elements) { + return this; + } + if (typeof elements.length === 'number') { + [].every.call(elements, function(el, idx) { + return callback.call(el, idx, el) !== false; + }); + } else { + for (var key in elements) { + if (callback.call(elements[key], key, elements[key]) === false) return elements; + } + } + return this; + }; + $.focus = function(element) { + if ($.os.ios) { + setTimeout(function() { + element.focus(); + }, 10); + } else { + element.focus(); + } + }; + /** + * trigger event + * @param {type} element + * @param {type} eventType + * @param {type} eventData + * @returns {_L8.$} + */ + $.trigger = function(element, eventType, eventData) { + element.dispatchEvent(new CustomEvent(eventType, { + detail: eventData, + bubbles: true, + cancelable: true + })); + return this; + }; + /** + * getStyles + * @param {type} element + * @param {type} property + * @returns {styles} + */ + $.getStyles = function(element, property) { + var styles = element.ownerDocument.defaultView.getComputedStyle(element, null); + if (property) { + return styles.getPropertyValue(property) || styles[property]; + } + return styles; + }; + /** + * parseTranslate + * @param {type} translateString + * @param {type} position + * @returns {Object} + */ + $.parseTranslate = function(translateString, position) { + var result = translateString.match(translateRE || ''); + if (!result || !result[1]) { + result = ['', '0,0,0']; + } + result = result[1].split(","); + result = { + x: parseFloat(result[0]), + y: parseFloat(result[1]), + z: parseFloat(result[2]) + }; + if (position && result.hasOwnProperty(position)) { + return result[position]; + } + return result; + }; + /** + * parseTranslateMatrix + * @param {type} translateString + * @param {type} position + * @returns {Object} + */ + $.parseTranslateMatrix = function(translateString, position) { + var matrix = translateString.match(translateMatrixRE); + var is3D = matrix && matrix[1]; + if (matrix) { + matrix = matrix[2].split(","); + if (is3D === "3d") + matrix = matrix.slice(12, 15); + else { + matrix.push(0); + matrix = matrix.slice(4, 7); + } + } else { + matrix = [0, 0, 0]; + } + var result = { + x: parseFloat(matrix[0]), + y: parseFloat(matrix[1]), + z: parseFloat(matrix[2]) + }; + if (position && result.hasOwnProperty(position)) { + return result[position]; + } + return result; + }; + + $.registerHandler = function(type, handler) { + var handlers = $[type]; + if (!handlers) { + handlers = []; + } + handler.index = handler.index || 1000; + handlers.push(handler); + handlers.sort(function(a, b) { + return a.index - b.index; + }); + $[type] = handlers; + return $[type]; + }; + var class2type = {}; + $.each(['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Object', 'Error'], function(i, name) { + class2type["[object " + name + "]"] = name.toLowerCase(); + }); + if (window.JSON) { + $.parseJSON = JSON.parse; + } + /** + * $.fn + */ + $.fn = { + each: function(callback) { + [].every.call(this, function(el, idx) { + return callback.call(el, idx, el) !== false; + }); + return this; + } + }; + return $; +})(document); +//window.mui = mui; +//'$' in window || (window.$ = mui); +/** + * $.os + * @param {type} $ + * @returns {undefined} + */ +(function($, window) { + function detect(ua) { + this.os = {}; + var funcs = [ + + function() { //android + var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + if (android) { + this.os.android = true; + this.os.version = android[2]; + + this.os.isBadAndroid = !(/Chrome\/\d/.test(window.navigator.appVersion)); + } + return this.os.android === true; + }, + function() { //ios + var iphone = ua.match(/(iPhone\sOS)\s([\d_]+)/); + if (iphone) { //iphone + this.os.ios = this.os.iphone = true; + this.os.version = iphone[2].replace(/_/g, '.'); + } else { + var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + if (ipad) { //ipad + this.os.ios = this.os.ipad = true; + this.os.version = ipad[2].replace(/_/g, '.'); + } + } + return this.os.ios === true; + } + ]; + [].every.call(funcs, function(func) { + return !func.call($); + }); + } + detect.call($, navigator.userAgent); +})(mui, window); +/** + * $.os.plus + * @param {type} $ + * @returns {undefined} + */ +(function($) { + function detect(ua) { + this.os = this.os || {}; + var plus = ua.match(/Html5Plus/i);//TODO 5\+Browser? + if (plus) { + this.os.plus = true; + } + } + detect.call($, navigator.userAgent); +})(mui); + +/** + * mui target(action>popover>modal>tab>toggle) + */ +(function($, window, document) { + /** + * targets + */ + $.targets = {}; + /** + * target handles + */ + $.targetHandles = []; + /** + * register target + * @param {type} target + * @returns {$.targets} + */ + $.registerTarget = function(target) { + + target.index = target.index || 1000; + + $.targetHandles.push(target); + + $.targetHandles.sort(function(a, b) { + return a.index - b.index; + }); + + return $.targetHandles; + }; + window.addEventListener('touchstart', function(event) { + var target = event.target; + var founds = {}; + for (; target && target !== document; target = target.parentNode) { + var isFound = false; + $.each($.targetHandles, function(index, targetHandle) { + var name = targetHandle.name; + if (!isFound && !founds[name] && targetHandle.hasOwnProperty('handle')) { + $.targets[name] = targetHandle.handle(event, target); + if ($.targets[name]) { + founds[name] = true; + if (targetHandle.isContinue !== true) { + isFound = true; + } + } + } else { + if (!founds[name]) { + if (targetHandle.isReset !== false) + $.targets[name] = false; + } + } + }); + if (isFound) { + break; + } + } + + }); +})(mui, window, document); + +/** + * fixed trim + * @param {type} undefined + * @returns {undefined} + */ +(function(undefined) { + if (String.prototype.trim === undefined) { // fix for iOS 3.2 + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + }; + } + Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) { + obj['__proto__'] = proto; + return obj; + }; + +})(); +/** + * fixed CustomEvent + */ +(function() { + if (typeof window.CustomEvent === 'undefined') { + function CustomEvent(event, params) { + params = params || { + bubbles: false, + cancelable: false, + detail: undefined + }; + var evt = document.createEvent('Events'); + var bubbles = true; + for (var name in params) { + (name === 'bubbles') ? (bubbles = !!params[name]) : (evt[name] = params[name]); + } + evt.initEvent(event, bubbles, true); + return evt; + }; + CustomEvent.prototype = window.Event.prototype; + window.CustomEvent = CustomEvent; + } +})(); +/** + * mui fixed classList + * @param {type} document + * @returns {undefined} + */ +(function(document) { + if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') { + + Object.defineProperty(HTMLElement.prototype, 'classList', { + get: function() { + var self = this; + function update(fn) { + return function(value) { + var classes = self.className.split(/\s+/), + index = classes.indexOf(value); + + fn(classes, index, value); + self.className = classes.join(" "); + }; + } + + var ret = { + add: update(function(classes, index, value) { + ~index || classes.push(value); + }), + remove: update(function(classes, index) { + ~index && classes.splice(index, 1); + }), + toggle: update(function(classes, index, value) { + ~index ? classes.splice(index, 1) : classes.push(value); + }), + contains: function(value) { + return !!~self.className.split(/\s+/).indexOf(value); + }, + item: function(i) { + return self.className.split(/\s+/)[i] || null; + } + }; + + Object.defineProperty(ret, 'length', { + get: function() { + return self.className.split(/\s+/).length; + } + }); + + return ret; + } + }); + } +})(document); + +/** + * mui fixed requestAnimationFrame + * @param {type} window + * @returns {undefined} + */ +(function(window) { + if (!window.requestAnimationFrame) { + var lastTime = 0; + window.requestAnimationFrame = window.webkitRequestAnimationFrame || function(callback, element) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16.7 - (currTime - lastTime)); + var id = window.setTimeout(function() { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + window.cancelAnimationFrame = window.webkitCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || function(id) { + clearTimeout(id); + }; + }; +}(window)); +/** + * fastclick(only for radio,checkbox) + */ +(function($, window, name) { + if (window.FastClick) { + return; + } + + var handle = function(event, target) { + if (target.tagName === 'LABEL') { + if (target.parentNode) { + target = target.parentNode.querySelector('input'); + } + } + if (target.type === 'radio' || target.type === 'checkbox') { + if (!target.disabled) { //disabled + return target; + } + } + return false; + }; + + $.registerTarget({ + name: name, + index: 40, + handle: handle, + target: false + }); + var dispatchEvent = function(event) { + var targetElement = $.targets.click; + if (targetElement) { + var clickEvent, touch; + // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect + if (document.activeElement && document.activeElement !== targetElement) { + document.activeElement.blur(); + } + touch = event.detail.gesture.changedTouches[0]; + // Synthesise a click event, with an extra attribute so it can be tracked + clickEvent = document.createEvent('MouseEvents'); + clickEvent.initMouseEvent('click', true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); + clickEvent.forwardedTouchEvent = true; + targetElement.dispatchEvent(clickEvent); + } + }; + window.addEventListener('tap', dispatchEvent); + window.addEventListener('doubletap', dispatchEvent); + //捕获 + window.addEventListener('click', function(event) { + if ($.targets.click) { + if (!event.forwardedTouchEvent) { //stop click + if (event.stopImmediatePropagation) { + event.stopImmediatePropagation(); + } else { + // Part of the hack for browsers that don't support Event#stopImmediatePropagation + event.propagationStopped = true; + } + event.stopPropagation(); + event.preventDefault(); + return false; + } + } + }, true); + +})(mui, window, 'click'); +(function($, document) { + $(function() { + if (!$.os.ios) { + return; + } + var CLASS_FOCUSIN = 'mui-focusin'; + var CLASS_BAR_TAB = 'mui-bar-tab'; + var CLASS_BAR_FOOTER = 'mui-bar-footer'; + var CLASS_BAR_FOOTER_SECONDARY = 'mui-bar-footer-secondary'; + var CLASS_BAR_FOOTER_SECONDARY_TAB = 'mui-bar-footer-secondary-tab'; + // var content = document.querySelector('.' + CLASS_CONTENT); + // if (content) { + // document.body.insertBefore(content, document.body.firstElementChild); + // } + document.addEventListener('focusin', function(e) { + if ($.os.plus) { //在父webview里边不fix + if (window.plus) { + if (plus.webview.currentWebview().children().length > 0) { + return; + } + } + } + var target = e.target; + if (target.tagName && target.tagName === 'INPUT' && target.type === 'text') { + document.body.classList.add(CLASS_FOCUSIN); + var isFooter = false; + for (; target && target !== document; target = target.parentNode) { + var classList = target.classList; + if (classList && classList.contains(CLASS_BAR_TAB) || classList.contains(CLASS_BAR_FOOTER) || classList.contains(CLASS_BAR_FOOTER_SECONDARY) || classList.contains(CLASS_BAR_FOOTER_SECONDARY_TAB)) { + isFooter = true; + break; + } + } + if (isFooter) { + var scrollTop = document.body.scrollHeight; + var scrollLeft = document.body.scrollLeft; + setTimeout(function() { + window.scrollTo(scrollLeft, scrollTop); + }, 20); + } + } + }); + document.addEventListener('focusout', function(e) { + var classList = document.body.classList; + if (classList.contains(CLASS_FOCUSIN)) { + classList.remove(CLASS_FOCUSIN); + setTimeout(function() { + window.scrollTo(document.body.scrollLeft, document.body.scrollTop); + }, 20); + } + }); + }); +})(mui, document); +/** + * mui namespace(optimization) + * @param {type} $ + * @returns {undefined} + */ +(function($) { + $.namespace = 'mui'; + $.classNamePrefix = $.namespace + '-'; + $.classSelectorPrefix = '.' + $.classNamePrefix; + /** + * 返回正确的className + * @param {type} className + * @returns {String} + */ + $.className = function(className) { + return $.classNamePrefix + className; + }; + /** + * 返回正确的classSelector + * @param {type} classSelector + * @returns {String} + */ + $.classSelector = function(classSelector) { + return classSelector.replace(/\./g, $.classSelectorPrefix); + }; + /** + * 返回正确的eventName + * @param {type} event + * @param {type} module + * @returns {String} + */ + $.eventName = function(event, module) { + return event + ($.namespace ? ('.' + $.namespace) : '') + ( module ? ('.' + module) : ''); + }; +})(mui); + +/** + * mui gestures + * @param {type} $ + * @param {type} window + * @returns {undefined} + */ +(function($, window) { + $.EVENT_START = 'touchstart'; + $.EVENT_MOVE = 'touchmove'; + $.EVENT_END = 'touchend'; + $.EVENT_CANCEL = 'touchcancel'; + $.EVENT_CLICK = 'click'; + /** + * Gesture preventDefault + * @param {type} e + * @returns {undefined} + */ + $.preventDefault = function(e) { + e.preventDefault(); + }; + /** + * Gesture stopPropagation + * @param {type} e + * @returns {undefined} + */ + $.stopPropagation = function(e) { + e.stopPropagation(); + }; + + /** + * register gesture + * @param {type} gesture + * @returns {$.gestures} + */ + $.registerGesture = function(gesture) { + return $.registerHandler('gestures', gesture); + + }; + /** + * distance + * @param {type} p1 + * @param {type} p2 + * @returns {Number} + */ + var getDistance = function(p1, p2) { + var x = p2.x - p1.x; + var y = p2.y - p1.y; + return Math.sqrt((x * x) + (y * y)); + }; + /** + * angle + * @param {type} p1 + * @param {type} p2 + * @returns {Number} + */ + var getAngle = function(p1, p2) { + return Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI; + }; + /** + * direction + * @param {type} angle + * @returns {unresolved} + */ + var getDirectionByAngle = function(angle) { + if (angle < -45 && angle > -135) { + return 'up'; + } else if (angle >= 45 && angle < 135) { + return 'down'; + } else if (angle >= 135 || angle <= -135) { + return 'left'; + } else if (angle >= -45 && angle <= 45) { + return 'right'; + } + return null; + }; + /** + * detect gestures + * @param {type} event + * @param {type} touch + * @returns {undefined} + */ + var detect = function(event, touch) { + if ($.gestures.stoped) { + return; + } + $.each($.gestures, function(index, gesture) { + if (!$.gestures.stoped) { + if ($.options.gestureConfig[gesture.name] !== false) { + gesture.handle(event, touch); + } + } + }); + }; + var detectTouchStart = function(event) { + $.gestures.stoped = false; + var now = Date.now(); + var point = event.touches ? event.touches[0] : event; + $.gestures.touch = { + target: event.target, + lastTarget: ($.gestures.touch && $.gestures.touch.lastTarget ? $.gestures.touch.lastTarget : null), + startTime: now, + touchTime: 0, + flickStartTime: now, + lastTapTime: ($.gestures.touch && $.gestures.touch.lastTapTime ? $.gestures.touch.lastTapTime : 0), + start: { + x: point.pageX, + y: point.pageY + }, + flickStart: { + x: point.pageX, + y: point.pageY + }, + flickDistanceX: 0, + flickDistanceY: 0, + move: { + x: 0, + y: 0 + }, + deltaX: 0, + deltaY: 0, + lastDeltaX: 0, + lastDeltaY: 0, + angle: '', + direction: '', + lockDirection: false, + startDirection: '', + distance: 0, + drag: false, + swipe: false, + hold: false, + gesture: event + }; + + detect(event, $.gestures.touch); + }; + var detectTouchMove = function(event) { + if ($.gestures.stoped) { + return; + } + var touch = $.gestures.touch; + if (event.target != touch.target) { + return; + } + var now = Date.now(); + var point = event.touches ? event.touches[0] : event; + touch.touchTime = now - touch.startTime; + touch.move = { + x: point.pageX, + y: point.pageY + }; + if (now - touch.flickStartTime > 300) { + touch.flickStartTime = now; + touch.flickStart = touch.move; + } + touch.distance = getDistance(touch.start, touch.move); + touch.angle = getAngle(touch.start, touch.move); + touch.direction = getDirectionByAngle(touch.angle); + touch.lastDeltaX = touch.deltaX; + touch.lastDeltaY = touch.deltaY; + touch.deltaX = touch.move.x - touch.start.x; + touch.deltaY = touch.move.y - touch.start.y; + touch.gesture = event; + + detect(event, touch); + }; + var detectTouchEnd = function(event) { + if ($.gestures.stoped) { + return; + } + var touch = $.gestures.touch; + if (event.target != touch.target) { + return; + } + var now = Date.now(); + touch.touchTime = now - touch.startTime; + touch.flickTime = now - touch.flickStartTime; + touch.flickDistanceX = touch.move.x - touch.flickStart.x; + touch.flickDistanceY = touch.move.y - touch.flickStart.y; + touch.gesture = event; + + detect(event, touch); + }; + + window.addEventListener($.EVENT_START, detectTouchStart); + window.addEventListener($.EVENT_MOVE, detectTouchMove); + window.addEventListener($.EVENT_END, detectTouchEnd); + window.addEventListener($.EVENT_CANCEL, detectTouchEnd); + //fixed hashchange(android) + window.addEventListener($.EVENT_CLICK, function(e) { + //TODO 应该判断当前target是不是在targets.popover内部,而不是非要相等 + if (($.targets.popover && e.target === $.targets.popover) || ($.targets.tab) || $.targets.offcanvas || $.targets.modal) { + e.preventDefault(); + } + }, true); + + /** + * mui delegate events + * @param {type} event + * @param {type} selector + * @param {type} callback + * @returns {undefined} + */ + $.fn.on = function(event, selector, callback) { + this.each(function() { + var element = this; + element.addEventListener(event, function(e) { + var delegates = $.qsa(selector, element); + var target = e.target; + if (delegates && delegates.length > 0) { + for (; target && target !== document; target = target.parentNode) { + if (target === element) { + break; + } + if (target && ~delegates.indexOf(target)) { + if (!e.detail) { + e.detail = { + currentTarget: target + }; + } else { + e.detail.currentTarget = target; + } + callback.call(target, e); + } + } + } + }); + ////避免多次on的时候重复绑定 + element.removeEventListener($.EVENT_CLICK, preventDefault); + //click event preventDefault + element.addEventListener($.EVENT_CLICK, preventDefault); + }); + }; + var preventDefault = function(e) { + var tagName = e.target && e.target.tagName; + if (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && tagName !== 'SELECT') { + e.preventDefault(); + } + }; + //增加原生滚动识别 + $.isScrolling = false; + var scrollingTimeout = null; + window.addEventListener('scroll', function() { + $.isScrolling = true; + scrollingTimeout && clearTimeout(scrollingTimeout); + scrollingTimeout = setTimeout(function() { + $.isScrolling = false; + }, 250); + }); +})(mui, window); +/** + * mui gesture flick[left|right|up|down] + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var handle = function(event, touch) { + if (event.type === $.EVENT_END || event.type === $.EVENT_CANCEL) { + var options = this.options; + if (touch.direction && options.flickMaxTime > touch.flickTime && touch.distance > options.flickMinDistince) { + touch.flick = true; + $.trigger(event.target, name, touch); + $.trigger(event.target, name + touch.direction, touch); + } + } + }; + /** + * mui gesture flick + */ + $.registerGesture({ + name: name, + index: 5, + handle: handle, + options: { + flickMaxTime: 200, + flickMinDistince: 10 + } + }); +})(mui, 'flick'); +/** + * mui gesture swipe[left|right|up|down] + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var handle = function(event, touch) { + if (event.type === $.EVENT_END || event.type === $.EVENT_CANCEL) { + var options = this.options; + if (touch.direction && options.swipeMaxTime > touch.touchTime && touch.distance > options.swipeMinDistince) { + touch.swipe = true; + $.trigger(event.target, name + touch.direction, touch); + } + } + }; + /** + * mui gesture swipe + */ + $.registerGesture({ + name: name, + index: 10, + handle: handle, + options: { + swipeMaxTime: 300, + swipeMinDistince: 18 + } + }); +})(mui, 'swipe'); +/** + * mui gesture drag[start|left|right|up|down|end] + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var handle = function(event, touch) { + switch (event.type) { + case $.EVENT_MOVE: + if (touch.direction) { //drag + //修正direction + //默认锁定单向drag(后续可能需要额外配置支持) + if (touch.lockDirection && touch.startDirection) { + if (touch.startDirection && touch.startDirection !== touch.direction) { + if (touch.startDirection === 'up' || touch.startDirection === 'down') { + touch.direction = touch.deltaY < 0 ? 'up' : 'down'; + } else { + touch.direction = touch.deltaX < 0 ? 'left' : 'right'; + } + } + } + if (!touch.drag) { + touch.drag = true; + $.trigger(event.target, name + 'start', touch); + } + $.trigger(event.target, name, touch); + $.trigger(event.target, name + touch.direction, touch); + } + break; + case $.EVENT_END: + case $.EVENT_CANCEL: + if (touch.drag) { + $.trigger(event.target, name + 'end', touch); + } + break; + } + }; + /** + * mui gesture drag + */ + $.registerGesture({ + name: name, + index: 20, + handle: handle, + options: {} + }); +})(mui, 'drag'); +/** + * mui gesture tap and doubleTap + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var handle = function(event, touch) { + //if (event.type === $.EVENT_END || event.type === $.EVENT_CANCEL) { + if (event.type === $.EVENT_END) { //ignore touchcancel + var options = this.options; + if (touch.distance < options.tapMaxDistance && touch.touchTime < options.tapMaxTime) { + if ($.options.gestureConfig.doubletap && touch.lastTarget && (touch.lastTarget === event.target)) { //same target + if (touch.lastTapTime && (touch.startTime - touch.lastTapTime) < options.tapMaxInterval) { + $.trigger(event.target, 'doubletap', touch); + touch.lastTapTime = Date.now(); + touch.lastTarget = event.target; + return; + } + } + $.trigger(event.target, name, touch); + touch.lastTapTime = Date.now(); + touch.lastTarget = event.target; + } + } + }; + /** + * mui gesture tap + */ + $.registerGesture({ + name: name, + index: 30, + handle: handle, + options: { + tapMaxInterval: 300, + tapMaxDistance: 5, + tapMaxTime: 250 + } + }); +})(mui, 'tap'); +/** + * mui gesture longtap + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var timer; + var handle = function(event, touch) { + var options = this.options; + switch (event.type) { + case $.EVENT_START: + clearTimeout(timer); + timer = setTimeout(function() { + if (!touch.drag) { + $.trigger(event.target, name, touch); + } + }, options.holdTimeout); + break; + case $.EVENT_MOVE: + if (touch.distance > options.holdThreshold) { + clearTimeout(timer); + } + break; + case $.EVENT_END: + case $.EVENT_CANCEL: + clearTimeout(timer); + break; + } + }; + /** + * mui gesture longtap + */ + $.registerGesture({ + name: name, + index: 10, + handle: handle, + options: { + holdTimeout: 500, + holdThreshold: 2 + } + }); +})(mui, 'longtap'); +/** + * mui gesture hold + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var timer; + var handle = function(event, touch) { + var options = this.options; + switch (event.type) { + case $.EVENT_START: + clearTimeout(timer); + timer = setTimeout(function() { + touch.hold = true; + $.trigger(event.target, name, touch); + }, options.holdTimeout); + break; + case $.EVENT_MOVE: + break; + case $.EVENT_END: + case $.EVENT_CANCEL: + clearTimeout(timer); + if ($.options.gestureConfig.hold && touch.hold) { + $.trigger(event.target, 'release', touch); + } + break; + } + }; + /** + * mui gesture hold + */ + $.registerGesture({ + name: name, + index: 10, + handle: handle, + options: { + holdTimeout: 0 + } + }); +})(mui, 'hold'); +/** + * mui.init + * @param {type} $ + * @returns {undefined} + */ +(function($) { + $.global = $.options = { + gestureConfig: { + tap: true, + doubletap: false, + longtap: false, + hold: false, + flick: true, + swipe: true, + drag: true + } + }; + /** + * + * @param {type} options + * @returns {undefined} + */ + $.initGlobal = function(options) { + $.options = $.extend(true, $.global, options); + return this; + }; + var inits = {}; + + var isInitialized = false; + //TODO 自动调用init?因为用户自己调用init的时机可能不确定,如果晚于自动init,则会有潜在问题 + // $.ready(function() { + // setTimeout(function() { + // if (!isInitialized) { + // $.init(); + // } + // }, 300); + // }); + /** + * 单页配置 初始化 + * @param {object} options + */ + $.init = function(options) { + isInitialized = true; + $.options = $.extend(true, $.global, options || {}); + $.ready(function() { + $.each($.inits, function(index, init) { + var isInit = !!(!inits[init.name] || init.repeat); + if (isInit) { + init.handle.call($); + inits[init.name] = true; + } + }); + }); + return this; + }; + + /** + * 增加初始化执行流程 + * @param {function} init + */ + $.registerInit = function(init) { + return $.registerHandler('inits', init); + }; + $(function() { + var classList = document.body.classList; + var os = ''; + if ($.os.ios) { + os = 'ios'; + classList.add('mui-ios'); + } else if ($.os.android) { + os = 'android'; + classList.add('mui-android'); + } + if (os && $.os.version) { + var version = ''; + var classArray = []; + $.each($.os.version.split('.'), function(i, v) { + version = version + (version ? '-' : '') + v; + classList.add($.className(os + '-' + version)); + }); + } + }); +})(mui); +/** + * mui.init 5+ + * @param {type} $ + * @returns {undefined} + */ +(function($) { + var defaultOptions = { + swipeBack: false, + preloadPages: [], //5+ lazyLoad webview + preloadLimit: 10, //预加载窗口的数量限制(一旦超出,先进先出) + keyEventBind: { + backbutton: true, + menubutton: true + } + }; + + //默认页面动画 + var defaultShow = { + autoShow: true, + duration: $.os.ios ? 200 : 100, + aniShow: 'slide-in-right' + }; + //若执行了显示动画初始化操作,则要覆盖默认配置 + if ($.options.show) { + defaultShow = $.extend(true, defaultShow, $.options.show); + } + + $.currentWebview = null; + $.isHomePage = false; + + $.extend(true, $.global, defaultOptions); + $.extend(true, $.options, defaultOptions); + /** + * 等待动画配置 + * @param {type} options + * @returns {Object} + */ + $.waitingOptions = function(options) { + return $.extend({ + autoShow: true, + title: '' + }, options); + }; + /** + * 窗口显示配置 + * @param {type} options + * @returns {Object} + */ + $.showOptions = function(options) { + return $.extend(defaultShow, options); + }; + /** + * 窗口默认配置 + * @param {type} options + * @returns {Object} + */ + $.windowOptions = function(options) { + return $.extend({ + scalable: false, + bounce: "" //vertical + }, options); + }; + /** + * plusReady + * @param {type} callback + * @returns {_L6.$} + */ + $.plusReady = function(callback) { + if (window.plus) { + callback(); + } else { + document.addEventListener("plusready", function() { + callback(); + }, false); + } + return this; + }; + /** + * 5+ event(5+没提供之前我自己实现) + * @param {type} webview + * @param {type} eventType + * @param {type} data + * @returns {undefined} + */ + $.fire = function(webview, eventType, data) { + if (webview) { + webview.evalJS("typeof mui!=='undefined'&&mui.receive('" + eventType + "','" + JSON.stringify(data || {}) + "')"); + } + }; + /** + * 5+ event(5+没提供之前我自己实现) + * @param {type} eventType + * @param {type} data + * @returns {undefined} + */ + $.receive = function(eventType, data) { + if (eventType) { + data = JSON.parse(data); + $.trigger(document, eventType, data); + } + }; + var triggerPreload = function(webview) { + if (!webview.preloaded) { + $.fire(webview, 'preload'); + var list = webview.children(); + for (var i = 0; i < list.length; i++) { + $.fire(list[i], 'preload'); + } + webview.preloaded = true; + } + }; + var trigger = function(webview, eventType, timeChecked) { + if (timeChecked) { + if (!webview[eventType + 'ed']) { + $.fire(webview, eventType); + var list = webview.children(); + for (var i = 0; i < list.length; i++) { + $.fire(list[i], eventType); + } + webview[eventType + 'ed'] = true; + } + } else { + $.fire(webview, eventType); + var list = webview.children(); + for (var i = 0; i < list.length; i++) { + $.fire(list[i], eventType); + } + } + + }; + /** + * 打开新窗口 + * @param {string} url 要打开的页面地址 + * @param {string} id 指定页面ID + * @param {object} options 可选:参数,等待,窗口,显示配置{params:{},waiting:{},styles:{},show:{}} + */ + $.openWindow = function(url, id, options) { + + if (!window.plus) { + return; + } + if (typeof url === 'object') { + options = url; + url = options.url; + id = options.id || url; + } else { + if (typeof id === 'object') { + options = id; + id = url; + } else { + id = id || url; + } + } + options = options || {}; + var params = options.params || {}; + var webview, nShow, nWaiting; + if ($.webviews[id]) { //已缓存 + var webviewCache = $.webviews[id]; + webview = webviewCache.webview; + //需要处理用户手动关闭窗口的情况,此时webview应该是空的; + if (!webview || !webview.getURL()) { + //再次新建一个webview; + options = $.extend(options, { + id: id, + url: url, + preload: true + }, true); + webview = $.createWindow(options); + } + //每次show都需要传递动画参数; + //预加载的动画参数优先级:openWindow配置>preloadPages配置>mui默认配置; + nShow = webviewCache.show; + nShow = options.show ? $.extend(nShow, options.show) : nShow; + webview.show(nShow.aniShow, nShow.duration, function() { + triggerPreload(webview); + trigger(webview, 'pagebeforeshow', false); + }); + + webviewCache.afterShowMethodName && webview.evalJS(webviewCache.afterShowMethodName + '(\'' + JSON.stringify(params) + '\')'); + return webview; + } else { //新窗口 + //显示waiting + var waitingConfig = $.waitingOptions(options.waiting); + if (waitingConfig.autoShow) { + nWaiting = plus.nativeUI.showWaiting(waitingConfig.title, waitingConfig.options); + } + //创建页面 + options = $.extend(options, { + id: id, + url: url + }); + webview = $.createWindow(options); + //显示 + nShow = $.showOptions(options.show); + if (nShow.autoShow) { + webview.addEventListener("loaded", function() { + //关闭等待框 + if (nWaiting) { + nWaiting.close(); + } + //显示页面 + webview.show(nShow.aniShow, nShow.duration, function() { + triggerPreload(webview); + trigger(webview, 'pagebeforeshow', false); + }); + webview.showed = true; + options.afterShowMethodName && webview.evalJS(options.afterShowMethodName + '(\'' + JSON.stringify(params) + '\')'); + }, false); + } + } + return webview; + }; + /** + * 根据配置信息创建一个webview + * @param {type} options + * @param {type} isCreate + * @returns {webview} + */ + $.createWindow = function(options, isCreate) { + if (!window.plus) { + return; + } + var id = options.id || options.url; + var webview; + if (options.preload) { + if ($.webviews[id] && $.webviews[id].webview.getURL()) { //已经cache + webview = $.webviews[id].webview; + } else { //新增预加载窗口 + //preload + webview = plus.webview.create(options.url, id, $.windowOptions(options.styles), $.extend({ + preload: true + }, options.extras)); + if (options.subpages) { + $.each(options.subpages, function(index, subpage) { + //TODO 子窗口也可能已经创建,比如公用模板的情况; + var subWebview = plus.webview.create(subpage.url, subpage.id || subpage.url, $.windowOptions(subpage.styles), $.extend({ + preload: true + }, subpage.extras)); + webview.append(subWebview); + }); + } + } + + //TODO 理论上,子webview也应该计算到预加载队列中,但这样就麻烦了,要退必须退整体,否则可能出现问题; + $.webviews[id] = { + webview: webview, //目前仅preload的缓存webview + preload: true, + show: $.showOptions(options.show), + afterShowMethodName: options.afterShowMethodName //就不应该用evalJS。应该是通过事件消息通讯 + }; + //索引该预加载窗口 + var preloads = $.data.preloads; + var index = preloads.indexOf(id); + if (~index) { //删除已存在的(变相调整插入位置) + preloads.splice(index, 1); + } + preloads.push(id); + if (preloads.length > $.options.preloadLimit) { + //先进先出 + var first = $.data.preloads.shift(); + var webviewCache = $.webviews[first]; + if (webviewCache && webviewCache.webview) { + //需要将自己打开的所有页面,全部close; + //关闭该预加载webview + $.closeAll(webviewCache.webview); + } + //删除缓存 + delete $.webviews[first]; + } + } else { + if (isCreate !== false) { //直接创建非预加载窗口 + webview = plus.webview.create(options.url, id, $.windowOptions(options.styles), options.extras); + if (options.subpages) { + $.each(options.subpages, function(index, subpage) { + var subWebview = plus.webview.create(subpage.url, subpage.id || subpage.url, $.windowOptions(subpage.styles), subpage.extras); + webview.append(subWebview); + }); + } + } + } + return webview; + }; + + /** + * 预加载 + */ + $.preload = function(options) { + //调用预加载函数,不管是否传递preload参数,强制变为true + if (!options.preload) { + options.preload = true; + } + return $.createWindow(options); + }; + + /** + *关闭当前webview打开的所有webview; + */ + $.closeOpened = function(webview) { + var opened = webview.opened(); + if (opened) { + for (var i = 0, len = opened.length; i < len; i++) { + var openedWebview = opened[i]; + var open_open = openedWebview.opened(); + if (open_open && open_open.length > 0) { + $.closeOpened(openedWebview); + } else { + //如果直接孩子节点,就不用关闭了,因为父关闭的时候,会自动关闭子; + if (openedWebview.parent() !== webview) { + openedWebview.close('none'); + } + } + } + } + }; + $.closeAll = function(webview, aniShow) { + $.closeOpened(webview); + if (aniShow) { + webview.close(aniShow); + } else { + webview.close(); + } + }; + + /** + * 批量创建webview + * @param {type} options + * @returns {undefined} + */ + $.createWindows = function(options) { + $.each(options, function(index, option) { + //初始化预加载窗口(创建)和非预加载窗口(仅配置,不创建) + $.createWindow(option, false); + }); + }; + /** + * 创建当前页面的子webview + * @param {type} options + * @returns {webview} + */ + $.appendWebview = function(options) { + if (!window.plus) { + return; + } + var id = options.id || options.url; + var webview; + if (!$.webviews[id]) { //保证执行一遍 + //TODO 这里也有隐患,比如某个webview不是作为subpage创建的,而是作为target webview的话; + webview = plus.webview.create(options.url, id, options.styles, options.extras); + //TODO 理论上,子webview也应该计算到预加载队列中,但这样就麻烦了,要退必须退整体,否则可能出现问题; + webview.addEventListener('loaded', function() { + plus.webview.currentWebview().append(webview); + }); + $.webviews[id] = options; + } + return webview; + }; + + //全局webviews + $.webviews = {}; + //预加载窗口索引 + $.data.preloads = []; + //$.currentWebview + $.plusReady(function() { + $.currentWebview = plus.webview.currentWebview(); + }); + $.registerInit({ + name: '5+', + index: 100, + handle: function() { + var options = $.options; + var subpages = options.subpages || []; + if ($.os.plus) { + $.plusReady(function() { + //TODO 这里需要判断一下,最好等子窗口加载完毕后,再调用主窗口的show方法; + //或者:在openwindow方法中,监听实现; + $.each(subpages, function(index, subpage) { + $.appendWebview(subpage); + }); + //判断是否首页 + if (plus.webview.currentWebview() === plus.webview.getWebviewById(plus.runtime.appid)) { + $.isHomePage = true; + //首页需要自己激活预加载; + //timeout因为子页面loaded之后才append的,防止子页面尚未append、从而导致其preload未触发的问题; + setTimeout(function() { + triggerPreload(plus.webview.currentWebview()); + }, 300); + } + //设置ios顶部状态栏颜色; + if ($.os.ios && $.options.statusBarBackground) { + plus.navigator.setStatusBarBackground($.options.statusBarBackground); + } + if ($.os.android && parseFloat($.os.version) < 4.4) { + //解决Android平台4.4版本以下,resume后,父窗体标题延迟渲染的问题; + if (plus.webview.currentWebview().parent() == null) { + document.addEventListener("resume", function() { + var body = document.body; + body.style.display = 'none'; + setTimeout(function() { + body.style.display = ''; + }, 10); + }); + } + } + }); + } else { + if (subpages.length > 0) { + var err = document.createElement('div'); + err.className = 'mui-error'; + //文字描述 + var span = document.createElement('span'); + span.innerHTML = '在该浏览器下,不支持创建子页面,具体参考'; + err.appendChild(span); + var a = document.createElement('a'); + a.innerHTML = '"mui框架适用场景"'; + a.href = 'http://ask.dcloud.net.cn/article/113'; + err.appendChild(a); + document.body.appendChild(err); + console.log('在该浏览器下,不支持创建子页面'); + } + + } + + } + }); + window.addEventListener('preload', function() { + //处理预加载部分 + var webviews = $.options.preloadPages || []; + $.plusReady(function() { + $.each(webviews, function(index, webview) { + $.createWindow($.extend(webview, { + preload: true + })); + }); + + }); + }); +})(mui); +/** + * mui back + * @param {type} $ + * @param {type} window + * @returns {undefined} + */ +(function($, window) { + /** + * register back + * @param {type} back + * @returns {$.gestures} + */ + $.registerBack = function(back) { + return $.registerHandler('backs', back); + }; + /** + * default + */ + $.registerBack({ + name: 'browser', + index: 100, + handle: function() { + if (window.history.length > 1) { + window.history.back(); + return true; + } + return false; + } + }); + /** + * 后退 + */ + $.back = function() { + if (typeof $.options.beforeback === 'function') { + if ($.options.beforeback() === false) { + return; + } + } + $.each($.backs, function(index, back) { + return !back.handle(); + }); + }; + window.addEventListener('tap', function(e) { + var action = $.targets.action; + if (action && action.classList.contains('mui-action-back')) { + $.back(); + } + }); + window.addEventListener('swiperight', function(e) { + var detail = e.detail; + if ($.options.swipeBack === true && Math.abs(detail.angle) < 3) { + $.back(); + } + }); + +})(mui, window); +/** + * mui back 5+ + * @param {type} $ + * @param {type} window + * @returns {undefined} + */ +(function($, window) { + if ($.os.plus && $.os.android) { + $.registerBack({ + name: 'mui', + index: 5, + handle: function() { + //popover + if ($.targets._popover) { + $($.targets._popover).popover('hide'); + return true; + } + //offcanvas + var offCanvas = document.querySelector('.mui-off-canvas-wrap.mui-active'); + if (offCanvas) { + $(offCanvas).offCanvas('close'); + return true; + } + } + }); + } + /** + * 5+ back + */ + $.registerBack({ + name: '5+', + index: 10, + handle: function() { + if (!window.plus) { + return false; + } + var wobj = plus.webview.currentWebview(); + var parent = wobj.parent(); + if (parent) { + parent.evalJS('mui&&mui.back();'); + }else{ + wobj.canBack(function(e) { + //by chb 暂时注释,在碰到类似popover之类的锚点的时候,需多次点击才能返回; + if (e.canBack) { //webview history back + window.history.back(); + } else { //webview close or hide + var opener = wobj.opener(); + if (opener) { + if (wobj.preload) { + wobj.hide("auto"); + } else { + //关闭页面时,需要将其打开的所有子页面全部关闭; + $.closeAll(wobj); + } + } else { + //首页不存在opener的情况下,后退实际上应该是退出应用; + //这个交给项目具体实现,框架暂不处理; + //plus.runtime.quit(); + } + } + }); + } + return true; + } + }); + + + $.menu = function() { + var menu = document.querySelector('.mui-action-menu'); + if (menu) { + $.trigger(menu, 'touchstart');//临时处理menu无touchstart的话,找不到当前targets的问题 + $.trigger(menu, 'tap'); + } else { //执行父窗口的menu + if (window.plus) { + var wobj = $.currentWebview; + var parent = wobj.parent(); + if (parent) { //又得evalJS + parent.evalJS('mui&&mui.menu();'); + } + } + } + }; + //处理按键监听事件 + $.registerInit({ + name: 'keyEventBind', + index: 1000, + handle: function() { + $.plusReady(function() { + if ($.options.keyEventBind.backbutton) { + plus.key.addEventListener('backbutton', $.back, false); + } + if ($.options.keyEventBind.menubutton) { + plus.key.addEventListener('menubutton', $.menu, false); + } + }); + } + }); +})(mui, window); +/** + * mui.init pulldownRefresh + * @param {type} $ + * @returns {undefined} + */ +(function($) { + $.registerInit({ + name: 'pullrefresh', + index: 1000, + handle: function() { + var options = $.options; + var pullRefreshOptions = options.pullRefresh || {}; + var hasPulldown = pullRefreshOptions.down && pullRefreshOptions.down.hasOwnProperty('callback'); + var hasPullup = pullRefreshOptions.up && pullRefreshOptions.up.hasOwnProperty('callback'); + if (hasPulldown || hasPullup) { + var container = pullRefreshOptions.container; + if (container) { + var $container = $(container); + if ($container.length === 1) { + if ($.os.plus && $.os.android) { //android 5+ + $.plusReady(function() { + var webview = plus.webview.currentWebview(); + if (hasPullup) { + //当前页面初始化pullup + var upOptions = {}; + upOptions.up = pullRefreshOptions.up; + upOptions.webviewId = webview.id || webview.getURL(); + $container.pullRefresh(upOptions); + } + if (hasPulldown) { + var parent = webview.parent(); + var id = webview.id || webview.getURL(); + if (parent) { + if (!hasPullup) { //如果没有上拉加载,需要手动初始化一个默认的pullRefresh,以便当前页面容器可以调用endPulldownToRefresh等方法 + $container.pullRefresh({ + webviewId: id + }); + } + var downOptions = { + webviewId: id + }; + downOptions.down = $.extend({}, pullRefreshOptions.down); + downOptions.down.callback = '_CALLBACK'; + //父页面初始化pulldown + parent.evalJS("mui&&mui(document.querySelector('.mui-content')).pullRefresh('" + JSON.stringify(downOptions) + "')"); + } + } + }); + } else { + $container.pullRefresh(pullRefreshOptions); + } + } + } + } + } + }); +})(mui); +/** + * mui ajax + * @param {type} $ + * @returns {undefined} + */ +(function($, window, undefined) { + + var jsonType = 'application/json'; + var htmlType = 'text/html'; + var rscript = /)<[^<]*)*<\/script>/gi; + var scriptTypeRE = /^(?:text|application)\/javascript/i; + var xmlTypeRE = /^(?:text|application)\/xml/i; + var blankRE = /^\s*$/; + + $.ajaxSettings = { + type: 'GET', + beforeSend: $.noop, + success: $.noop, + error: $.noop, + complete: $.noop, + context: null, + xhr: function(protocol) { + return new window.XMLHttpRequest(); + }, + accepts: { + script: 'text/javascript, application/javascript, application/x-javascript', + json: jsonType, + xml: 'application/xml, text/xml', + html: htmlType, + text: 'text/plain' + }, + timeout: 0, + processData: true, + cache: true + }; + var ajaxBeforeSend = function(xhr, settings) { + var context = settings.context + if (settings.beforeSend.call(context, xhr, settings) === false) { + return false; + } + }; + var ajaxSuccess = function(data, xhr, settings) { + settings.success.call(settings.context, data, 'success', xhr); + ajaxComplete('success', xhr, settings); + }; + // type: "timeout", "error", "abort", "parsererror" + var ajaxError = function(error, type, xhr, settings) { + settings.error.call(settings.context, xhr, type, error); + ajaxComplete(type, xhr, settings); + }; + // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" + var ajaxComplete = function(status, xhr, settings) { + settings.complete.call(settings.context, xhr, status); + }; + + var serialize = function(params, obj, traditional, scope) { + var type, array = $.isArray(obj), + hash = $.isPlainObject(obj); + $.each(obj, function(key, value) { + type = $.type(value); + if (scope) { + key = traditional ? scope : + scope + '[' + (hash || type === 'object' || type === 'array' ? key : '') + ']'; + } + // handle data in serializeArray() format + if (!scope && array) { + params.add(value.name, value.value); + } + // recurse into nested objects + else if (type === "array" || (!traditional && type === "object")) { + serialize(params, value, traditional, key); + } else { + params.add(key, value); + } + }); + }; + var serializeData = function(options) { + if (options.processData && options.data && typeof options.data !== "string") { + options.data = $.param(options.data, options.traditional); + } + if (options.data && (!options.type || options.type.toUpperCase() === 'GET')) { + options.url = appendQuery(options.url, options.data); + options.data = undefined; + } + }; + var appendQuery = function(url, query) { + if (query === '') { + return url; + } + return (url + '&' + query).replace(/[&?]{1,2}/, '?'); + }; + var mimeToDataType = function(mime) { + if (mime) { + mime = mime.split(';', 2)[0]; + } + return mime && (mime === htmlType ? 'html' : + mime === jsonType ? 'json' : + scriptTypeRE.test(mime) ? 'script' : + xmlTypeRE.test(mime) && 'xml') || 'text'; + }; + var parseArguments = function(url, data, success, dataType) { + if ($.isFunction(data)) { + dataType = success, success = data, data = undefined; + } + if (!$.isFunction(success)) { + dataType = success, success = undefined; + } + return { + url: url, + data: data, + success: success, + dataType: dataType + }; + }; + $.ajax = function(url, options) { + if (typeof url === "object") { + options = url; + url = undefined; + } + var settings = options || {}; + settings.url = url || settings.url; + for (var key in $.ajaxSettings) { + if (settings[key] === undefined) { + settings[key] = $.ajaxSettings[key]; + } + } + serializeData(settings); + var dataType = settings.dataType; + + if (settings.cache === false || ((!options || options.cache !== true) && ('script' === dataType))) { + settings.url = appendQuery(settings.url, '_=' + Date.now()); + } + var mime = settings.accepts[dataType]; + var headers = {}; + var setHeader = function(name, value) { + headers[name.toLowerCase()] = [name, value]; + }; + var protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol; + var xhr = settings.xhr(protocol); + var nativeSetHeader = xhr.setRequestHeader; + var abortTimeout; + + setHeader('X-Requested-With', 'XMLHttpRequest'); + setHeader('Accept', mime || '*/*'); + if (!!(mime = settings.mimeType || mime)) { + if (mime.indexOf(',') > -1) { + mime = mime.split(',', 2)[0]; + } + xhr.overrideMimeType && xhr.overrideMimeType(mime); + } + if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() !== 'GET')) { + setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded'); + } + if (settings.headers) { + for (var name in settings.headers) + setHeader(name, settings.headers[name]); + } + xhr.setRequestHeader = setHeader; + + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + xhr.onreadystatechange = $.noop; + clearTimeout(abortTimeout); + var result, error = false; + if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || (xhr.status === 0 && protocol === 'file:')) { + dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')); + result = xhr.responseText; + try { + // http://perfectionkills.com/global-eval-what-are-the-options/ + if (dataType === 'script') { + (1, eval)(result); + } else if (dataType === 'xml') { + result = xhr.responseXML; + } else if (dataType === 'json') { + result = blankRE.test(result) ? null : $.parseJSON(result); + } + } catch (e) { + error = e; + } + + if (error) { + ajaxError(error, 'parsererror', xhr, settings); + } else { + ajaxSuccess(result, xhr, settings); + } + } else { + ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings); + } + } + }; + if (ajaxBeforeSend(xhr, settings) === false) { + xhr.abort(); + ajaxError(null, 'abort', xhr, settings); + return xhr; + } + + if (settings.xhrFields) { + for (var name in settings.xhrFields) { + xhr[name] = settings.xhrFields[name]; + } + } + + var async = 'async' in settings ? settings.async : true; + + xhr.open(settings.type.toUpperCase(), settings.url, async, settings.username, settings.password); + + for (var name in headers) { + nativeSetHeader.apply(xhr, headers[name]); + } + if (settings.timeout > 0) { + abortTimeout = setTimeout(function() { + xhr.onreadystatechange = $.noop; + xhr.abort(); + ajaxError(null, 'timeout', xhr, settings); + }, settings.timeout); + } + xhr.send(settings.data ? settings.data : null); + return xhr; + }; + + + $.param = function(obj, traditional) { + var params = []; + params.add = function(k, v) { + this.push(encodeURIComponent(k) + '=' + encodeURIComponent(v)); + }; + serialize(params, obj, traditional); + return params.join('&').replace(/%20/g, '+'); + }; + $.get = function( /* url, data, success, dataType */ ) { + return $.ajax(parseArguments.apply(null, arguments)); + }; + + $.post = function( /* url, data, success, dataType */ ) { + var options = parseArguments.apply(null, arguments); + options.type = 'POST'; + return $.ajax(options); + }; + + $.getJSON = function( /* url, data, success */ ) { + var options = parseArguments.apply(null, arguments); + options.dataType = 'json'; + return $.ajax(options); + }; + + $.fn.load = function(url, data, success) { + if (!this.length) + return this; + var self = this, + parts = url.split(/\s/), + selector, + options = parseArguments(url, data, success), + callback = options.success; + if (parts.length > 1) + options.url = parts[0], selector = parts[1]; + options.success = function(response) { + if (selector) { + var div = document.createElement('div'); + div.innerHTML = response.replace(rscript, ""); + var selectorDiv = document.createElement('div'); + var childs = div.querySelectorAll(selector); + if (childs && childs.length > 0) { + for (var i = 0, len = childs.length; i < len; i++) { + selectorDiv.appendChild(childs[i]); + } + } + self[0].innerHTML = selectorDiv.innerHTML; + } else { + self[0].innerHTML = response; + } + callback && callback.apply(self, arguments); + }; + $.ajax(options); + return this; + }; + +})(mui, window); +/** + * 5+ ajax + */ +(function($) { + $.plusReady(function() { + $.ajaxSettings = $.extend($.ajaxSettings, { + xhr: function(protocol) { + if (protocol === 'file:') { //本地文件使用标准XMLHttpRequest + return new window.XMLHttpRequest(); + } + return new plus.net.XMLHttpRequest(); + } + }); + }); +})(mui); +/** + * mui layout(offset[,position,width,height...]) + * @param {type} $ + * @param {type} window + * @param {type} undefined + * @returns {undefined} + */ +(function($, window, undefined) { + $.offset = function(element) { + var box = { + top : 0, + left : 0 + }; + if ( typeof element.getBoundingClientRect !== undefined) { + box = element.getBoundingClientRect(); + } + return { + top : box.top + window.pageYOffset - element.clientTop, + left : box.left + window.pageXOffset - element.clientLeft + }; + }; +})(mui, window); +/** + * mui animation + */ +(function($, window) { + /** + * scrollTo + */ + $.scrollTo = function(scrollTop, duration, callback) { + duration = duration || 1000; + var scroll = function(duration) { + if (duration <= 0) { + callback && callback(); + return; + } + var distaince = scrollTop - window.scrollY; + setTimeout(function() { + window.scrollTo(0, window.scrollY + distaince / duration * 10); + scroll(duration - 10); + }, 16.7); + }; + scroll(duration); + }; + $.animationFrame = function(cb) { + var args, isQueued, context; + return function() { + args = arguments; + context = this; + if (!isQueued) { + isQueued = true; + requestAnimationFrame(function() { + cb.apply(context, args); + isQueued = false; + }); + } + }; + }; + +})(mui, window); +(function($) { + var initializing = false, + fnTest = /xyz/.test(function() { + xyz; + }) ? /\b_super\b/ : /.*/; + + var Class = function() {}; + Class.extend = function(prop) { + var _super = this.prototype; + initializing = true; + var prototype = new this(); + initializing = false; + for (var name in prop) { + prototype[name] = typeof prop[name] == "function" && + typeof _super[name] == "function" && fnTest.test(prop[name]) ? + (function(name, fn) { + return function() { + var tmp = this._super; + + this._super = _super[name]; + + var ret = fn.apply(this, arguments); + this._super = tmp; + + return ret; + }; + })(name, prop[name]) : + prop[name]; + } + function Class() { + if (!initializing && this.init) + this.init.apply(this, arguments); + } + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.extend = arguments.callee; + return Class; + }; + $.Class = Class; +})(mui); +(function($, document, undefined) { + var CLASS_PULL_TOP_POCKET = 'mui-pull-top-pocket'; + var CLASS_PULL_BOTTOM_POCKET = 'mui-pull-bottom-pocket'; + var CLASS_PULL = 'mui-pull'; + var CLASS_PULL_LOADING = 'mui-pull-loading'; + var CLASS_PULL_CAPTION = 'mui-pull-caption'; + + var CLASS_ICON = 'mui-icon'; + var CLASS_SPINNER = 'mui-spinner'; + var CLASS_ICON_PULLDOWN = 'mui-icon-pulldown'; + + var CLASS_BLOCK = 'mui-block'; + var CLASS_HIDDEN = 'mui-hidden'; + var CLASS_VISIBILITY = 'mui-visibility'; + + var CLASS_LOADING_UP = CLASS_PULL_LOADING + ' ' + CLASS_ICON + ' ' + CLASS_ICON_PULLDOWN; + var CLASS_LOADING_DOWN = CLASS_PULL_LOADING + ' ' + CLASS_ICON + ' ' + CLASS_ICON_PULLDOWN; + var CLASS_LOADING = CLASS_PULL_LOADING + ' ' + CLASS_ICON + ' ' + CLASS_SPINNER; + + var pocketHtml = ['
', '
', '
{contentrefresh}
', '
'].join(''); + + var PullRefresh = { + init: function(element, options) { + this._super(element, $.extend(true, { + scrollY: true, + scrollX: false, + indicators: true, + down: { + height: 50, + contentdown: '下拉可以刷新', + contentover: '释放立即刷新', + contentrefresh: '正在刷新...' + }, + up: { + height: 50, + contentdown: '上拉显示更多', + contentrefresh: '正在加载...', + contentnomore: '没有更多数据了', + duration: 300 + } + }, options)); + }, + _init: function() { + this._super(); + this._initPocket(); + }, + _initPulldownRefresh: function() { + this.pulldown = true; + this.pullPocket = this.topPocket; + this.pullPocket.classList.add(CLASS_BLOCK); + this.pullPocket.classList.add(CLASS_VISIBILITY); + this.pullCaption = this.topCaption; + this.pullLoading = this.topLoading; + }, + _initPullupRefresh: function() { + this.pulldown = false; + this.pullPocket = this.bottomPocket; + this.pullPocket.classList.add(CLASS_BLOCK); + this.pullPocket.classList.add(CLASS_VISIBILITY); + this.pullCaption = this.bottomCaption; + this.pullLoading = this.bottomLoading; + }, + _initPocket: function() { + var options = this.options; + if (options.down && options.down.hasOwnProperty('callback')) { + this.topPocket = this.scroller.querySelector('.' + CLASS_PULL_TOP_POCKET); + if (!this.topPocket) { + this.topPocket = this._createPocket(CLASS_PULL_TOP_POCKET, options.down, CLASS_LOADING_DOWN); + this.wrapper.insertBefore(this.topPocket, this.wrapper.firstChild); + } + this.topLoading = this.topPocket.querySelector('.' + CLASS_PULL_LOADING); + this.topCaption = this.topPocket.querySelector('.' + CLASS_PULL_CAPTION); + } + if (options.up && options.up.hasOwnProperty('callback')) { + this.bottomPocket = this.scroller.querySelector('.' + CLASS_PULL_BOTTOM_POCKET); + if (!this.bottomPocket) { + this.bottomPocket = this._createPocket(CLASS_PULL_BOTTOM_POCKET, options.up, CLASS_LOADING); + this.scroller.appendChild(this.bottomPocket); + } + this.bottomLoading = this.bottomPocket.querySelector('.' + CLASS_PULL_LOADING); + this.bottomCaption = this.bottomPocket.querySelector('.' + CLASS_PULL_CAPTION); + //TODO only for h5 + this.wrapper.addEventListener('scrollbottom', this); + } + }, + _createPocket: function(clazz, options, iconClass) { + var pocket = document.createElement('div'); + pocket.className = clazz; + pocket.innerHTML = pocketHtml.replace('{contentrefresh}', options.contentrefresh).replace('{icon}', iconClass); + return pocket; + }, + _resetPullDownLoading: function() { + var loading = this.pullLoading; + if (loading) { + this.pullCaption.innerHTML = this.options.down.contentdown; + loading.style.webkitTransition = ""; + loading.style.webkitTransform = ""; + loading.style.webkitAnimation = ""; + loading.className = CLASS_LOADING_DOWN; + } + }, + _setCaption: function(title, reset) { + if (this.loading) { + return; + } + var options = this.options; + var pocket = this.pullPocket; + var caption = this.pullCaption; + var loading = this.pullLoading; + var isPulldown = this.pulldown; + if (pocket) { + if (reset) { + setTimeout(function() { + caption.innerHTML = title; + if (isPulldown) { + loading.className = CLASS_LOADING_DOWN; + } else { + loading.className = CLASS_LOADING; + } + loading.style.webkitAnimation = ""; + loading.style.webkitTransition = ""; + loading.style.webkitTransform = ""; + }, 100); + } else { + if (title !== this.lastTitle) { + caption.innerHTML = title; + if (isPulldown) { + if (title === options.down.contentrefresh) { + loading.className = CLASS_LOADING; + loading.style.webkitAnimation = "spinner-spin 1s step-end infinite"; + } else if (title === options.down.contentover) { + loading.className = CLASS_LOADING_UP; + loading.style.webkitTransition = "-webkit-transform 0.3s ease-in"; + loading.style.webkitTransform = "rotate(180deg)"; + } else if (title === options.down.contentdown) { + loading.className = CLASS_LOADING_DOWN; + loading.style.webkitTransition = "-webkit-transform 0.3s ease-in"; + loading.style.webkitTransform = "rotate(0deg)"; + } + } else { + if (title === options.up.contentrefresh) { + loading.className = CLASS_LOADING + ' ' + CLASS_VISIBILITY; + } else { + loading.className = CLASS_LOADING + ' ' + CLASS_HIDDEN; + } + } + this.lastTitle = title; + } + } + + } + } + }; + $.PullRefresh = PullRefresh; +})(mui, document); +(function($, window, document, undefined) { + var CLASS_SCROLLBAR = 'mui-scrollbar'; + var CLASS_INDICATOR = 'mui-scrollbar-indicator'; + var CLASS_SCROLLBAR_VERTICAL = CLASS_SCROLLBAR + '-vertical'; + var CLASS_SCROLLBAR_HORIZONTAL = CLASS_SCROLLBAR + '-horizontal'; + + var CLASS_ACTIVE = 'mui-active'; + + var ease = { + quadratic: { + style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', + fn: function(k) { + return k * (2 - k); + } + }, + circular: { + style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', + fn: function(k) { + return Math.sqrt(1 - (--k * k)); + } + } + } + var Scroll = $.Class.extend({ + init: function(element, options) { + this.wrapper = this.element = element; + this.scroller = this.wrapper.children[0]; + this.scrollerStyle = this.scroller && this.scroller.style; + this.stopped = false; + + this.options = $.extend(true, { + scrollY: true, + scrollX: false, + startX: 0, + startY: 0, + indicators: true, + stopPropagation: false, + hardwareAccelerated: true, + fixedBadAndorid: false, + preventDefaultException: { + tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ + }, + momentum: true, + + snap: false, + + bounce: true, + bounceTime: 300, + bounceEasing: ease.circular.style, + + directionLockThreshold: 5, + + parallaxElement: false, + parallaxRatio: 0.5 + }, options); + + this.x = 0; + this.y = 0; + this.translateZ = this.options.hardwareAccelerated ? ' translateZ(0)' : ''; + + this._init(); + if (this.scroller) { + this.refresh(); + // if (this.options.startX !== 0 || this.options.startY !== 0) { //需要判断吗?后续根据实际情况再看看 + this.scrollTo(this.options.startX, this.options.startY); + // } + } + }, + _init: function() { + this._initParallax(); + this._initIndicators(); + this._initEvent(); + }, + _initParallax: function() { + if (this.options.parallaxElement) { + this.parallaxElement = document.querySelector(this.options.parallaxElement); + this.parallaxStyle = this.parallaxElement.style; + this.parallaxHeight = this.parallaxElement.offsetHeight; + this.parallaxImgStyle = this.parallaxElement.querySelector('img').style; + } + }, + _initIndicators: function() { + var self = this; + self.indicators = []; + if (!this.options.indicators) { + return; + } + var indicators = [], + indicator; + + // Vertical scrollbar + if (self.options.scrollY) { + indicator = { + el: this._createScrollBar(CLASS_SCROLLBAR_VERTICAL), + listenX: false + }; + + this.wrapper.appendChild(indicator.el); + indicators.push(indicator); + } + + // Horizontal scrollbar + if (this.options.scrollX) { + indicator = { + el: this._createScrollBar(CLASS_SCROLLBAR_HORIZONTAL), + listenY: false + }; + + this.wrapper.appendChild(indicator.el); + indicators.push(indicator); + } + + for (var i = indicators.length; i--;) { + this.indicators.push(new Indicator(this, indicators[i])); + } + + this.wrapper.addEventListener('scrollend', function() { + self.indicators.map(function(indicator) { + indicator.fade(); + }); + }); + + this.wrapper.addEventListener('scrollstart', function() { + self.indicators.map(function(indicator) { + indicator.fade(1); + }); + }); + + // this.wrapper.addEventListener('beforescrollstart', function() { + // self.indicators.map(function(indicator) { + // indicator.fade(1, true); + // }); + // }); + + this.wrapper.addEventListener('refresh', function() { + self.indicators.map(function(indicator) { + indicator.refresh(); + }); + }); + }, + _initSnap: function() { + this.currentPage = {}; + this.pages = []; + var snaps = this.snaps; + var length = snaps.length; + var m = 0; + var n = -1; + var x = 0; + var cx = 0; + for (var i = 0; i < length; i++) { + var snap = snaps[i]; + var offsetLeft = snap.offsetLeft; + var offsetWidth = snap.offsetWidth; + if (i === 0 || offsetLeft <= snaps[i - 1].offsetLeft) { + m = 0; + n++; + } + if (!this.pages[m]) { + this.pages[m] = []; + } + x = this._getSnapX(offsetLeft); + cx = x - Math.round((offsetWidth) / 2); + this.pages[m][n] = { + x: x, + cx: cx, + pageX: m, + element: snap + } + if (snap.classList.contains(CLASS_ACTIVE)) { + this.currentPage = this.pages[m][0]; + } + if (x >= this.maxScrollX) { + m++; + } + } + this.options.startX = this.currentPage.x || 0; + }, + _getSnapX: function(offsetLeft) { + return Math.max(Math.min(0, -offsetLeft + (this.wrapperWidth / 2)), this.maxScrollX); + }, + _gotoPage: function(index) { + this.currentPage = this.pages[Math.min(index, this.pages.length - 1)][0]; + for (var i = 0, len = this.snaps.length; i < len; i++) { + if (i === index) { + this.snaps[i].classList.add(CLASS_ACTIVE); + } else { + this.snaps[i].classList.remove(CLASS_ACTIVE); + } + } + this.scrollTo(this.currentPage.x, 0, this.options.bounceTime); + }, + _nearestSnap: function(x) { + if (!this.pages.length) { + return { + x: 0, + pageX: 0 + }; + } + var i = 0; + var length = this.pages.length; + + if (x > 0) { + x = 0; + } else if (x < this.maxScrollX) { + x = this.maxScrollX; + } + + for (; i < length; i++) { + if (x >= this.pages[i][0].cx) { + return this.pages[i][0]; + } + } + return { + x: 0, + pageX: 0 + }; + }, + _initEvent: function() { + window.addEventListener('orientationchange', this); + window.addEventListener('resize', this); + + this.scroller.addEventListener('webkitTransitionEnd', this); + + this.wrapper.addEventListener('touchstart', this); + this.wrapper.addEventListener('touchcancel', this); + this.wrapper.addEventListener('touchend', this); + this.wrapper.addEventListener('drag', this); + this.wrapper.addEventListener('dragend', this); + this.wrapper.addEventListener('flick', this); + this.wrapper.addEventListener('scrollend', this); + if (this.options.scrollX) { + this.wrapper.addEventListener('swiperight', this); + } + var segmentedControl = this.wrapper.querySelector('.mui-segmented-control'); + if (segmentedControl) { //靠,这个bug排查了一下午,阻止hash跳转,一旦hash跳转会导致可拖拽选项卡的tab不见 + mui(segmentedControl).on('click', 'a', $.preventDefault); + } + }, + handleEvent: function(e) { + if (this.stopped) { + this.resetPosition(); + return; + } + + switch (e.type) { + case 'touchstart': + this._start(e); + break; + case 'drag': + this.options.stopPropagation && e.stopPropagation(); + this._drag(e); + break; + case 'dragend': + case 'flick': + this.options.stopPropagation && e.stopPropagation(); + this._flick(e); + break; + case 'touchcancel': + case 'touchend': + this._end(e); + break; + case 'webkitTransitionEnd': + this._transitionEnd(e); + break; + case 'scrollend': + this._scrollend(e); + break; + case 'orientationchange': + case 'resize': + this._resize(); + break; + case 'swiperight': + e.stopPropagation(); + break; + + } + }, + _start: function(e) { + this.moved = this.needReset = false; + this._transitionTime(); + if (this.isInTransition) { + this.needReset = true; + this.isInTransition = false; + var pos = $.parseTranslateMatrix($.getStyles(this.scroller, 'webkitTransform')); + this.setTranslate(Math.round(pos.x), Math.round(pos.y)); + this.resetPosition(); //reset + $.trigger(this.wrapper, 'scrollend', this); + // e.stopPropagation(); + e.preventDefault(); + } + this.reLayout(); + $.trigger(this.wrapper, 'beforescrollstart', this); + }, + _getDirectionByAngle: function(angle) { + if (angle < -80 && angle > -100) { + return 'up'; + } else if (angle >= 80 && angle < 100) { + return 'down'; + } else if (angle >= 170 || angle <= -170) { + return 'left'; + } else if (angle >= -35 && angle <= 10) { + return 'right'; + } + return null; + }, + _drag: function(e) { + // if (this.needReset) { + // e.stopPropagation(); //disable parent drag(nested scroller) + // return; + // } + var detail = e.detail; + if (this.options.scrollY || detail.direction === 'up' || detail.direction === 'down') { //如果是竖向滚动或手势方向是上或下 + //ios8 hack + if ($.os.ios && parseFloat($.os.version) >= 8) { //多webview时,离开当前webview会导致后续touch事件不触发 + var clientY = detail.gesture.touches[0].clientY; + //下拉刷新 or 上拉加载 + if ((clientY + 10) > window.innerHeight || clientY < 10) { + this.resetPosition(this.options.bounceTime); + return; + } + } + } + var isPreventDefault = isReturn = false; + var direction = this._getDirectionByAngle(detail.angle); + if (detail.direction === 'left' || detail.direction === 'right') { + if (this.options.scrollX) { + isPreventDefault = true; + if (!this.moved) { //识别角度 + if (direction !== 'left' && direction !== 'right') { + isReturn = true; + } else { + $.gestures.touch.lockDirection = true; //锁定方向 + $.gestures.touch.startDirection = detail.direction; + } + } + } else if (this.options.scrollY && !this.moved) { + isReturn = true; + } + } else if (detail.direction === 'up' || detail.direction === 'down') { + if (this.options.scrollY) { + isPreventDefault = true; + // if (!this.moved) { //识别角度,竖向滚动似乎没必要进行小角度验证 + // if (direction !== 'up' && direction !== 'down') { + // isReturn = true; + // } + // } + if (!this.moved) { + $.gestures.touch.lockDirection = true; //锁定方向 + $.gestures.touch.startDirection = detail.direction; + } + } else if (this.options.scrollX && !this.moved) { + isReturn = true; + } + } else { + isReturn = true; + } + if (isPreventDefault) { + e.stopPropagation(); //阻止冒泡(scroll类嵌套) + detail.gesture && detail.gesture.preventDefault(); + } + if (isReturn) { //禁止非法方向滚动 + return; + } + if (!this.moved) { + $.trigger(this.wrapper, 'scrollstart', this); + } else { + e.stopPropagation(); //move期间阻止冒泡(scroll嵌套) + } + var deltaX = 0; + var deltaY = 0; + if (!this.moved) { //start + deltaX = detail.deltaX; + deltaY = detail.deltaY; + } else { //move + deltaX = detail.deltaX - detail.lastDeltaX; + deltaY = detail.deltaY - detail.lastDeltaY; + } + var absDeltaX = Math.abs(detail.deltaX); + var absDeltaY = Math.abs(detail.deltaY); + if (absDeltaX > absDeltaY + this.options.directionLockThreshold) { + deltaY = 0; + } else if (absDeltaY >= absDeltaX + this.options.directionLockThreshold) { + deltaX = 0; + } + + deltaX = this.hasHorizontalScroll ? deltaX : 0; + deltaY = this.hasVerticalScroll ? deltaY : 0; + var newX = this.x + deltaX; + var newY = this.y + deltaY; + // Slow down if outside of the boundaries + if (newX > 0 || newX < this.maxScrollX) { + newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX; + } + if (newY > 0 || newY < this.maxScrollY) { + newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY; + } + + if (!this.requestAnimationFrame) { + this._updateTranslate(); + } + + this.moved = true; + this.x = newX; + this.y = newY; + $.trigger(this.wrapper, 'scroll', this); + }, + _flick: function(e) { + // if (!this.moved || this.needReset) { + // return; + // } + if (!this.moved) { + return; + } + e.stopPropagation(); + var detail = e.detail; + this._clearRequestAnimationFrame(); + if (e.type === 'dragend' && detail.flick) { //dragend + return; + } + + var newX = Math.round(this.x); + var newY = Math.round(this.y); + + this.isInTransition = false; + // reset if we are outside of the boundaries + if (this.resetPosition(this.options.bounceTime)) { + return; + } + + this.scrollTo(newX, newY); // ensures that the last position is rounded + + if (e.type === 'dragend') { //dragend + $.trigger(this.wrapper, 'scrollend', this); + return; + } + var time = 0; + var easing = ''; + // start momentum animation if needed + if (this.options.momentum && detail.flickTime < 300) { + momentumX = this.hasHorizontalScroll ? this._momentum(this.x, detail.flickDistanceX, detail.flickTime, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { + destination: newX, + duration: 0 + }; + momentumY = this.hasVerticalScroll ? this._momentum(this.y, detail.flickDistanceY, detail.flickTime, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { + destination: newY, + duration: 0 + }; + newX = momentumX.destination; + newY = momentumY.destination; + time = Math.max(momentumX.duration, momentumY.duration); + this.isInTransition = true; + } + + if (newX != this.x || newY != this.y) { + if (newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY) { + easing = ease.quadratic; + } + this.scrollTo(newX, newY, time, easing); + return; + } + + $.trigger(this.wrapper, 'scrollend', this); + // e.stopPropagation(); + }, + _end: function(e) { + this.needReset = false; + if ((!this.moved && this.needReset) || e.type === 'touchcancel') { + this.resetPosition(); + } + }, + _transitionEnd: function(e) { + if (e.target != this.scroller || !this.isInTransition) { + return; + } + this._transitionTime(); + if (!this.resetPosition(this.options.bounceTime)) { + this.isInTransition = false; + $.trigger(this.wrapper, 'scrollend', this); + } + }, + _scrollend: function(e) { + if (Math.abs(this.y) > 0 && this.y <= this.maxScrollY) { + $.trigger(this.wrapper, 'scrollbottom', this); + } + }, + _resize: function() { + var that = this; + clearTimeout(that.resizeTimeout); + that.resizeTimeout = setTimeout(function() { + that.refresh(); + }, that.options.resizePolling); + }, + _transitionTime: function(time) { + time = time || 0; + this.scrollerStyle['webkitTransitionDuration'] = time + 'ms'; + if (this.parallaxElement && this.options.scrollY) { //目前仅支持竖向视差效果 + this.parallaxStyle['webkitTransitionDuration'] = time + 'ms'; + } + if (this.options.fixedBadAndorid && !time && $.os.isBadAndroid) { + this.scrollerStyle['webkitTransitionDuration'] = '0.001s'; + if (this.parallaxElement && this.options.scrollY) { //目前仅支持竖向视差效果 + this.parallaxStyle['webkitTransitionDuration'] = '0.001s'; + } + } + if (this.indicators) { + for (var i = this.indicators.length; i--;) { + this.indicators[i].transitionTime(time); + } + } + }, + _transitionTimingFunction: function(easing) { + this.scrollerStyle['webkitTransitionTimingFunction'] = easing; + if (this.parallaxElement && this.options.scrollY) { //目前仅支持竖向视差效果 + this.parallaxStyle['webkitTransitionDuration'] = easing; + } + if (this.indicators) { + for (var i = this.indicators.length; i--;) { + this.indicators[i].transitionTimingFunction(easing); + } + } + }, + _translate: function(x, y) { + this.x = x; + this.y = y; + }, + _clearRequestAnimationFrame: function() { + if (this.requestAnimationFrame) { + cancelAnimationFrame(this.requestAnimationFrame); + this.requestAnimationFrame = null; + } + }, + _updateTranslate: function() { + var self = this; + if (self.x !== self.lastX || self.y !== self.lastY) { + self.setTranslate(self.x, self.y); + } + self.requestAnimationFrame = requestAnimationFrame(function() { + self._updateTranslate(); + }); + }, + _createScrollBar: function(clazz) { + var scrollbar = document.createElement('div'); + var indicator = document.createElement('div'); + scrollbar.className = CLASS_SCROLLBAR + ' ' + clazz; + indicator.className = CLASS_INDICATOR; + scrollbar.appendChild(indicator); + if (clazz === CLASS_SCROLLBAR_VERTICAL) { + this.scrollbarY = scrollbar; + this.scrollbarIndicatorY = indicator; + } else if (clazz === CLASS_SCROLLBAR_HORIZONTAL) { + this.scrollbarX = scrollbar; + this.scrollbarIndicatorX = indicator; + } + this.wrapper.appendChild(scrollbar); + return scrollbar; + }, + _preventDefaultException: function(el, exceptions) { + for (var i in exceptions) { + if (exceptions[i].test(el[i])) { + return true; + } + } + return false; + }, + _reLayout: function() { + if (!this.hasHorizontalScroll) { + this.maxScrollX = 0; + this.scrollerWidth = this.wrapperWidth; + } + + if (!this.hasVerticalScroll) { + this.maxScrollY = 0; + this.scrollerHeight = this.wrapperHeight; + } + + this.indicators.map(function(indicator) { + indicator.refresh(); + }); + + //以防slider类嵌套使用 + if (this.options.snap && typeof this.options.snap === 'string') { + var items = this.scroller.querySelectorAll(this.options.snap); + this.itemLength = 0; + this.snaps = []; + for (var i = 0, len = items.length; i < len; i++) { + var item = items[i]; + if (item.parentNode === this.scroller) { + this.itemLength++; + this.snaps.push(item); + } + } + this._initSnap(); //需要每次都_initSnap么。其实init的时候执行一次,后续resize的时候执行一次就行了吧.先这么做吧,如果影响性能,再调整 + } + }, + _momentum: function(current, distance, time, lowerMargin, wrapperSize, deceleration) { + var speed = parseFloat(Math.abs(distance) / time), + destination, + duration; + + deceleration = deceleration === undefined ? 0.0006 : deceleration; + destination = current + (speed * speed) / (2 * deceleration) * (distance < 0 ? -1 : 1); + duration = speed / deceleration; + if (destination < lowerMargin) { + destination = wrapperSize ? lowerMargin - (wrapperSize / 2.5 * (speed / 8)) : lowerMargin; + distance = Math.abs(destination - current); + duration = distance / speed; + } else if (destination > 0) { + destination = wrapperSize ? wrapperSize / 2.5 * (speed / 8) : 0; + distance = Math.abs(current) + destination; + duration = distance / speed; + } + + return { + destination: Math.round(destination), + duration: duration + }; + }, + _getTranslateStr: function(x, y) { + if (this.options.hardwareAccelerated) { + return 'translate3d(' + x + 'px,' + y + 'px,0px) ' + this.translateZ; + } + return 'translate(' + x + 'px,' + y + 'px) '; + }, + //API + setStopped: function(stopped) { + this.stopped = !!stopped; + }, + setTranslate: function(x, y) { + this.x = x; + this.y = y; + this.scrollerStyle['webkitTransform'] = this._getTranslateStr(x, y); + if (this.parallaxElement && this.options.scrollY) { //目前仅支持竖向视差效果 + var parallaxY = y * this.options.parallaxRatio; + var scale = 1 + parallaxY / ((this.parallaxHeight - parallaxY) / 2); + if (scale > 1) { + this.parallaxImgStyle['opacity'] = 1 - parallaxY / 100 * this.options.parallaxRatio; + this.parallaxStyle['webkitTransform'] = this._getTranslateStr(0, -parallaxY) + ' scale(' + scale + ',' + scale + ')'; + } else { + this.parallaxImgStyle['opacity'] = 1; + this.parallaxStyle['webkitTransform'] = this._getTranslateStr(0, -10) + ' scale(1,1)'; + } + } + if (this.indicators) { + for (var i = this.indicators.length; i--;) { + this.indicators[i].updatePosition(); + } + } + this.lastX = this.x; + this.lastY = this.y; + }, + reLayout: function() { + this.wrapper.offsetHeight; + + var paddingLeft = parseFloat($.getStyles(this.wrapper, 'padding-left')) || 0; + var paddingRight = parseFloat($.getStyles(this.wrapper, 'padding-right')) || 0; + var paddingTop = parseFloat($.getStyles(this.wrapper, 'padding-top')) || 0; + var paddingBottom = parseFloat($.getStyles(this.wrapper, 'padding-bottom')) || 0; + + var clientWidth = this.wrapper.clientWidth; + var clientHeight = this.wrapper.clientHeight; + + this.scrollerWidth = this.scroller.offsetWidth; + this.scrollerHeight = this.scroller.offsetHeight; + + this.wrapperWidth = clientWidth - paddingLeft - paddingRight; + this.wrapperHeight = clientHeight - paddingTop - paddingBottom; + + this.maxScrollX = Math.min(this.wrapperWidth - this.scrollerWidth, 0); + this.maxScrollY = Math.min(this.wrapperHeight - this.scrollerHeight, 0); + this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0; + this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0; + this._reLayout(); + }, + resetPosition: function(time) { + var x = this.x, + y = this.y; + + time = time || 0; + if (!this.hasHorizontalScroll || this.x > 0) { + x = 0; + } else if (this.x < this.maxScrollX) { + x = this.maxScrollX; + } + + if (!this.hasVerticalScroll || this.y > 0) { + y = 0; + } else if (this.y < this.maxScrollY) { + y = this.maxScrollY; + } + + if (x == this.x && y == this.y) { + return false; + } + this.scrollTo(x, y, time, this.options.bounceEasing); + + return true; + }, + refresh: function() { + this.reLayout(); + $.trigger(this.wrapper, 'refresh', this); + this.resetPosition(); + }, + scrollTo: function(x, y, time, easing) { + var easing = easing || ease.circular; + this.isInTransition = time > 0 && (this.lastX != x || this.lastY != y); + if (this.isInTransition) { + this._clearRequestAnimationFrame(); + this._transitionTimingFunction(easing.style); + this._transitionTime(time); + this.setTranslate(x, y); + } else { + this.setTranslate(x, y); + } + + }, + scrollToBottom: function(time, easing) { + time = time || this.options.bounceTime; + this.scrollTo(0, this.maxScrollY, time, easing); + }, + gotoPage: function(index) { + this._gotoPage(index); + } + }); + //Indicator + var Indicator = function(scroller, options) { + this.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el; + this.wrapperStyle = this.wrapper.style; + this.indicator = this.wrapper.children[0]; + this.indicatorStyle = this.indicator.style; + this.scroller = scroller; + + this.options = $.extend({ + listenX: true, + listenY: true, + fade: false, + speedRatioX: 0, + speedRatioY: 0 + }, options); + + + this.sizeRatioX = 1; + this.sizeRatioY = 1; + this.maxPosX = 0; + this.maxPosY = 0; + + if (this.options.fade) { + this.wrapperStyle['webkitTransform'] = this.scroller.translateZ; + this.wrapperStyle['webkitTransitionDuration'] = this.options.fixedBadAndorid && $.os.isBadAndroid ? '0.001s' : '0ms'; + this.wrapperStyle.opacity = '0'; + } + } + Indicator.prototype = { + handleEvent: function(e) { + + }, + transitionTime: function(time) { + time = time || 0; + this.indicatorStyle['webkitTransitionDuration'] = time + 'ms'; + if (this.scroller.options.fixedBadAndorid && !time && $.os.isBadAndroid) { + this.indicatorStyle['webkitTransitionDuration'] = '0.001s'; + } + }, + transitionTimingFunction: function(easing) { + this.indicatorStyle['webkitTransitionTimingFunction'] = easing; + }, + refresh: function() { + this.transitionTime(); + + if (this.options.listenX && !this.options.listenY) { + this.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none'; + } else if (this.options.listenY && !this.options.listenX) { + this.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none'; + } else { + this.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none'; + } + + this.wrapper.offsetHeight; // force refresh + + if (this.options.listenX) { + this.wrapperWidth = this.wrapper.clientWidth; + this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8); + this.indicatorStyle.width = this.indicatorWidth + 'px'; + + this.maxPosX = this.wrapperWidth - this.indicatorWidth; + + this.minBoundaryX = 0; + this.maxBoundaryX = this.maxPosX; + + this.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX)); + } + + if (this.options.listenY) { + this.wrapperHeight = this.wrapper.clientHeight; + this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8); + this.indicatorStyle.height = this.indicatorHeight + 'px'; + + this.maxPosY = this.wrapperHeight - this.indicatorHeight; + + this.minBoundaryY = 0; + this.maxBoundaryY = this.maxPosY; + + this.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY)); + } + + this.updatePosition(); + }, + + updatePosition: function() { + var x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0, + y = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0; + + if (x < this.minBoundaryX) { + this.width = Math.max(this.indicatorWidth + x, 8); + this.indicatorStyle.width = this.width + 'px'; + x = this.minBoundaryX; + } else if (x > this.maxBoundaryX) { + this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8); + this.indicatorStyle.width = this.width + 'px'; + x = this.maxPosX + this.indicatorWidth - this.width; + } else if (this.width != this.indicatorWidth) { + this.width = this.indicatorWidth; + this.indicatorStyle.width = this.width + 'px'; + } + + if (y < this.minBoundaryY) { + this.height = Math.max(this.indicatorHeight + y * 3, 8); + this.indicatorStyle.height = this.height + 'px'; + y = this.minBoundaryY; + } else if (y > this.maxBoundaryY) { + this.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8); + this.indicatorStyle.height = this.height + 'px'; + y = this.maxPosY + this.indicatorHeight - this.height; + } else if (this.height != this.indicatorHeight) { + this.height = this.indicatorHeight; + this.indicatorStyle.height = this.height + 'px'; + } + + this.x = x; + this.y = y; + + this.indicatorStyle['webkitTransform'] = this.scroller._getTranslateStr(x, y); + + }, + fade: function(val, hold) { + if (hold && !this.visible) { + return; + } + + clearTimeout(this.fadeTimeout); + this.fadeTimeout = null; + + var time = val ? 250 : 500, + delay = val ? 0 : 300; + + val = val ? '1' : '0'; + + this.wrapperStyle['webkitTransitionDuration'] = time + 'ms'; + + this.fadeTimeout = setTimeout((function(val) { + this.wrapperStyle.opacity = val; + this.visible = +val; + }).bind(this, val), delay); + } + }; + + $.Scroll = Scroll; + + $.fn.scroll = function(options) { + var scrollApis = []; + this.each(function() { + var scrollApi = null; + var self = this; + var id = self.getAttribute('data-scroll'); + if (!id) { + id = ++$.uuid; + var _options = $.extend({}, options); + if (self.classList.contains('mui-segmented-control')) { + _options = $.extend(_options, { + scrollY: false, + scrollX: true, + indicators: false, + snap: '.mui-control-item' + }); + } + $.data[id] = scrollApi = new Scroll(self, _options); + self.setAttribute('data-scroll', id); + } else { + scrollApi = $.data[id]; + } + scrollApis.push(scrollApi); + }); + return scrollApis.length === 1 ? scrollApis[0] : scrollApis; + }; +})(mui, window, document); +(function($, window, document, undefined) { + + var CLASS_VISIBILITY = 'mui-visibility'; + var CLASS_HIDDEN = 'mui-hidden'; + + var PullRefresh = $.Scroll.extend($.extend({ + handleEvent: function(e) { + this._super(e); + if (e.type === 'scrollbottom') { + this._scrollbottom(); + } + }, + _scrollbottom: function() { + if (!this.pulldown && !this.loading) { + this.pulldown = false; + this._initPullupRefresh(); + this.pullupLoading(); + } + }, + _start: function(e) { + if (!this.loading) { + this.pulldown = this.pullPocket = this.pullCaption = this.pullLoading = false + } + this._super(e); + }, + _drag: function(e) { + this._super(e); + if (!this.pulldown && !this.loading && this.topPocket && e.detail.direction === 'down' && this.y >= 0) { + this._initPulldownRefresh(); + } + if (this.pulldown) { + this._setCaption(this.y > this.options.down.height ? this.options.down.contentover : this.options.down.contentdown); + } + }, + + _reLayout: function() { + this.hasVerticalScroll = true; + this._super(); + }, + //API + resetPosition: function(time) { + if (this.pulldown && this.y >= this.options.down.height) { + this.pulldownLoading(0, time || 0); + return true; + } + return this._super(time); + }, + pulldownLoading: function(x, time) { + x = x || 0; + this.scrollTo(x, this.options.down.height, time, this.options.bounceEasing); + if (this.loading) { + return; + } + if (!this.pulldown) { + this._initPulldownRefresh(); + } + this._setCaption(this.options.down.contentrefresh); + this.loading = true; + this.indicators.map(function(indicator) { + indicator.fade(0); + }); + var callback = this.options.down.callback; + callback && callback.call(this); + }, + endPulldownToRefresh: function() { + var self = this; + if (self.topPocket && self.loading && this.pulldown) { + self.scrollTo(0, 0, self.options.bounceTime, self.options.bounceEasing); + self.loading = false; + self._setCaption(self.options.down.contentdown, true); + setTimeout(function() { + self.loading || self.topPocket.classList.remove(CLASS_VISIBILITY); + }, 350); + } + }, + pullupLoading: function(callback, x, time) { + x = x || 0; + this.scrollTo(x, this.maxScrollY, time, this.options.bounceEasing); + if (this.loading) { + return; + } + this._initPullupRefresh(); + this._setCaption(this.options.up.contentrefresh); + this.indicators.map(function(indicator) { + indicator.fade(0); + }); + this.loading = true; + callback = callback || this.options.up.callback; + callback && callback.call(this); + }, + endPullupToRefresh: function(finished) { + var self = this; + if (self.bottomPocket && self.loading && !this.pulldown) { + self.loading = false; + if (finished) { + self._setCaption(self.options.up.contentnomore); + // self.bottomPocket.classList.remove(CLASS_VISIBILITY); + // self.bottomPocket.classList.add(CLASS_HIDDEN); + self.wrapper.removeEventListener('scrollbottom', self); + } else { + self._setCaption(self.options.up.contentdown); + setTimeout(function() { + self.loading || self.bottomPocket.classList.remove(CLASS_VISIBILITY); + }, 350); + } + } + }, + refresh: function(isReset) { + if (isReset) { + // var classList = this.bottomPocket.classList; + // if (classList.contains(CLASS_HIDDEN)) { + // classList.remove(CLASS_HIDDEN); + // this._setCaption(self.options.up.contentdown); + this.wrapper.addEventListener('scrollbottom', this); + // } + } + this._super(); + }, + }, $.PullRefresh)); + $.fn.pullRefresh = function(options) { + if (this.length === 1) { + var self = this[0]; + var pullrefreshApi = null; + var id = self.getAttribute('data-pullrefresh'); + if (!id) { + id = ++$.uuid; + $.data[id] = pullrefreshApi = new PullRefresh(self, options); + self.setAttribute('data-pullrefresh', id); + } else { + pullrefreshApi = $.data[id]; + } + //暂不提供这种调用方式吧 + // if (typeof options === 'string') { + // var methodValue = pullrefreshApi[options].apply(pullrefreshApi, $.slice.call(arguments, 1)); + // if (methodValue !== undefined) { + // return methodValue; + // } + // } + return pullrefreshApi; + } + }; +})(mui, window, document); +/** + * snap 重构 + * @param {Object} $ + * @param {Object} window + */ +(function($, window) { + var CLASS_SLIDER = 'mui-slider'; + var CLASS_SLIDER_GROUP = 'mui-slider-group'; + var CLASS_SLIDER_LOOP = 'mui-slider-loop'; + var CLASS_SLIDER_INDICATOR = 'mui-slider-indicator'; + var CLASS_ACTION_PREVIOUS = 'mui-action-previous'; + var CLASS_ACTION_NEXT = 'mui-action-next'; + var CLASS_SLIDER_ITEM = 'mui-slider-item'; + + var CLASS_ACTIVE = 'mui-active'; + + var SELECTOR_SLIDER_ITEM = '.' + CLASS_SLIDER_ITEM; + var SELECTOR_SLIDER_INDICATOR = '.' + CLASS_SLIDER_INDICATOR; + var SELECTOR_SLIDER_PROGRESS_BAR = '.mui-slider-progress-bar'; + + + var Slider = $.Scroll.extend({ + init: function(element, options) { + this._super(element, $.extend(true, { + interval: 0, //设置为0,则不定时轮播 + scrollY: false, + scrollX: true, + indicators: false, + bounceTime: 200, + startX: false, + snap: SELECTOR_SLIDER_ITEM + }, options)); + if (this.options.startX) { + // $.trigger(this.wrapper, 'scrollend', this); + } + }, + _init: function() { + var groups = this.wrapper.querySelectorAll('.' + CLASS_SLIDER_GROUP); + for (var i = 0, len = groups.length; i < len; i++) { + if (groups[i].parentNode === this.wrapper) { + this.scroller = groups[i]; + break; + } + } + if (this.scroller) { + this.scrollerStyle = this.scroller.style; + this.progressBar = this.wrapper.querySelector(SELECTOR_SLIDER_PROGRESS_BAR); + if (this.progressBar) { + this.progressBarWidth = this.progressBar.offsetWidth; + this.progressBarStyle = this.progressBar.style; + } + //忘记这个代码是干什么的了? + // this.x = this._getScroll(); + // if (this.options.startX === false) { + // this.options.startX = this.x; + // } + //根据active修正startX + + this._super(); + this._initTimer(); + } + }, + _initEvent: function() { + var self = this; + self._super(); + self.wrapper.addEventListener('swiperight', $.stopPropagation); + self.wrapper.addEventListener('scrollend', function() { + self.isInTransition = false; + var page = self.currentPage; + var oldSlideNumber = self.slideNumber; + self.slideNumber = self._fixedSlideNumber(); + if (self.loop) { + if (self.slideNumber === 0) { + self.setTranslate(self.pages[1][0].x, 0); + } else if (self.slideNumber === self.itemLength - 3) { + self.setTranslate(self.pages[self.itemLength - 2][0].x, 0); + } + } + if (oldSlideNumber != self.slideNumber) { + $.trigger(self.wrapper, 'slide', { + slideNumber: self.slideNumber + }); + } + }); + + self.wrapper.addEventListener('slide', function(e) { + if (e.target !== self.wrapper) { + return; + } + var detail = e.detail; + detail.slideNumber = detail.slideNumber || 0; + var items = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM); + var _slideNumber = detail.slideNumber; + if (self.loop) { + _slideNumber += 1; + } + if (!self.wrapper.classList.contains('mui-segmented-control')) { + for (var i = 0, len = items.length; i < len; i++) { + var item = items[i]; + if (item.parentNode === self.scroller) { + if (i === _slideNumber) { + item.classList.add(CLASS_ACTIVE); + } else { + item.classList.remove(CLASS_ACTIVE); + } + } + } + } + var indicatorWrap = self.wrapper.querySelector('.mui-slider-indicator'); + if (indicatorWrap) { + if (indicatorWrap.getAttribute('data-scroll')) { //scroll + $(indicatorWrap).scroll().gotoPage(detail.slideNumber); + } + var indicators = indicatorWrap.querySelectorAll('.mui-indicator'); + if (indicators.length > 0) { //图片轮播 + for (var i = 0, len = indicators.length; i < len; i++) { + indicators[i].classList[i === detail.slideNumber ? 'add' : 'remove'](CLASS_ACTIVE); + } + } else { + var number = indicatorWrap.querySelector('.mui-number span'); + if (number) { //图文表格 + number.innerText = (detail.slideNumber + 1); + } else { //segmented controls + var controlItems = self.wrapper.querySelectorAll('.mui-control-item'); + for (var i = 0, len = controlItems.length; i < len; i++) { + controlItems[i].classList[i === detail.slideNumber ? 'add' : 'remove'](CLASS_ACTIVE); + } + } + } + } + e.stopPropagation(); + }); + + self.wrapper.addEventListener($.eventName('shown', 'tab'), function(e) { //tab + self.gotoItem((e.detail.tabNumber || 0), self.options.bounceTime); + }); + //indicator + var indicator = self.wrapper.querySelector(SELECTOR_SLIDER_INDICATOR); + if (indicator) { + indicator.addEventListener('tap', function(event) { + var target = event.target; + if (target.classList.contains(CLASS_ACTION_PREVIOUS) || target.classList.contains(CLASS_ACTION_NEXT)) { + self[target.classList.contains(CLASS_ACTION_PREVIOUS) ? 'prevItem' : 'nextItem'](); + event.stopPropagation(); + } + }); + } + }, + _drag: function(e) { + this._super(e); + var direction = e.detail.direction; + if (direction === 'left' || direction === 'right') { + e.stopPropagation(); + } + }, + _initTimer: function() { + var self = this; + var slider = self.wrapper; + var interval = self.options.interval; + var slidershowTimer = slider.getAttribute('data-slidershowTimer'); + slidershowTimer && window.clearTimeout(slidershowTimer); + if (interval) { + slidershowTimer = window.setTimeout(function() { + if (!slider) { + return; + } + //仅slider显示状态进行自动轮播 + if (!!(slider.offsetWidth || slider.offsetHeight)) { + self.nextItem(true); + //下一个 + } + self._initTimer(); + }, interval); + slider.setAttribute('data-slidershowTimer', slidershowTimer); + } + }, + + _fixedSlideNumber: function(page) { + page = page || this.currentPage; + var slideNumber = page.pageX; + if (this.loop) { + if (page.pageX === 0) { + slideNumber = this.itemLength - 3; + } else if (page.pageX === (this.itemLength - 1)) { + slideNumber = 0; + } else { + slideNumber = page.pageX - 1; + } + } + return slideNumber; + }, + _reLayout: function() { + this.hasHorizontalScroll = true; + this.loop = this.scroller.classList.contains(CLASS_SLIDER_LOOP); + this._super(); + }, + _getScroll: function() { + var result = $.parseTranslateMatrix($.getStyles(this.scroller, 'webkitTransform')); + return result ? result.x : 0; + }, + _transitionEnd: function(e) { + if (e.target !== this.scroller || !this.isInTransition) { + return; + } + this._transitionTime(); + this.isInTransition = false; + $.trigger(this.wrapper, 'scrollend', this); + }, + _flick: function(e) { + if (!this.moved) { //无moved + return; + } + var detail = e.detail; + var direction = detail.direction; + this._clearRequestAnimationFrame(); + this.isInTransition = true; + // if (direction === 'up' || direction === 'down') { + // this.resetPosition(this.options.bounceTime); + // return; + // } + if (e.type === 'flick') { + if (detail.touchTime < 200) { //flick,太容易触发,额外校验一下touchtime + this.x = this._getPage((this.slideNumber + (direction === 'right' ? -1 : 1)), true).x; + } + this.resetPosition(this.options.bounceTime); + } else if (e.type === 'dragend' && !detail.flick) { + this.resetPosition(this.options.bounceTime); + } + e.stopPropagation(); + }, + _initSnap: function() { + this.scrollerWidth = this.itemLength * this.scrollerWidth; + this.maxScrollX = Math.min(this.wrapperWidth - this.scrollerWidth, 0); + this._super(); + if (!this.currentPage.x) { + //当slider处于隐藏状态时,导致snap计算是错误的,临时先这么判断一下,后续要考虑解决所有scroll在隐藏状态下初始化属性不正确的问题 + var currentPage = this.pages[this.loop ? 1 : 0]; + currentPage = currentPage || this.pages[0]; + if (!currentPage) { + return; + } + this.currentPage = currentPage[0]; + this.slideNumber = 0; + } else { + this.slideNumber = this._fixedSlideNumber(); + } + this.options.startX = this.currentPage.x || 0; + }, + _getSnapX: function(offsetLeft) { + return Math.max(-offsetLeft, this.maxScrollX); + }, + _getPage: function(slideNumber, isFlick) { + if (this.loop) { + if (slideNumber > (this.itemLength - (isFlick ? 2 : 3))) { + slideNumber = 1; + time = 0; + } else if (slideNumber < (isFlick ? -1 : 0)) { + slideNumber = this.itemLength - 2; + time = 0; + } else { + slideNumber += 1; + } + } else { + if (!isFlick) { + if (slideNumber > (this.itemLength - 1)) { + slideNumber = 0; + time = 0; + } else if (slideNumber < 0) { + slideNumber = this.itemLength - 1; + time = 0; + } + } + slideNumber = Math.min(Math.max(0, slideNumber), this.itemLength - 1); + } + return this.pages[slideNumber][0]; + }, + _gotoItem: function(slideNumber, time) { + this.currentPage = this._getPage(slideNumber); + this.scrollTo(this.currentPage.x, 0, time, this.options.bounceEasing); + if (time === 0) { + $.trigger(this.wrapper, 'scrollend', this); + } + this._initTimer(); + }, + //API + setTranslate: function(x, y) { + this._super(x, y); + var progressBar = this.progressBar; + if (progressBar) { + this.progressBarStyle.webkitTransform = this._getTranslateStr((-x * (this.progressBarWidth / this.wrapperWidth)), 0); + } + }, + resetPosition: function(time) { + time = time || 0; + if (this.x > 0) { + this.x = 0; + } else if (this.x < this.maxScrollX) { + this.x = this.maxScrollX; + } + this.currentPage = this._nearestSnap(this.x); + this.scrollTo(this.currentPage.x, 0, time); + return true; + }, + gotoItem: function(slideNumber, time) { + this._gotoItem(slideNumber, time || this.options.bounceTime); + }, + nextItem: function() { + this._gotoItem(this.slideNumber + 1, this.options.bounceTime); + }, + prevItem: function() { + this._gotoItem(this.slideNumber - 1, this.options.bounceTime); + }, + getSlideNumber: function() { + return this.slideNumber || 0; + }, + refresh: function(options) { + if (options) { + $.extend(this.options, options); + this._super(); + this.nextItem(); + } else { + this._super(); + } + } + }); + $.fn.slider = function(options) { + var slider = null; + this.each(function() { + var sliderElement = this; + if (!this.classList.contains(CLASS_SLIDER)) { + sliderElement = this.querySelector('.' + CLASS_SLIDER); + } + if (sliderElement) { + var id = sliderElement.getAttribute('data-slider'); + if (!id) { + id = ++$.uuid; + $.data[id] = slider = new Slider(sliderElement, options); + sliderElement.setAttribute('data-slider', id); + } else { + slider = $.data[id]; + if (slider && options) { + slider.refresh(options); + } + } + } + }); + return slider; + }; + $.ready(function() { + // setTimeout(function() { + $('.mui-slider').slider(); + $('.mui-scroll-wrapper.mui-slider-indicator.mui-segmented-control').scroll({ + scrollY: false, + scrollX: true, + indicators: false, + snap: '.mui-control-item' + }); + // }, 500); //临时处理slider宽度计算不正确的问题(初步确认是scrollbar导致的) + + }); +})(mui, window); +/** + * pullRefresh 5+ + * @param {type} $ + * @returns {undefined} + */ +(function($, document) { + if (!($.os.plus && $.os.android)) { //仅在android的5+版本使用 + return; + } + var CLASS_PLUS_PULLREFRESH = 'mui-plus-pullrefresh'; + var CLASS_VISIBILITY = 'mui-visibility'; + var CLASS_HIDDEN = 'mui-hidden'; + var CLASS_BLOCK = 'mui-block'; + + var PlusPullRefresh = $.Class.extend({ + init: function(element, options) { + this.element = element; + this.options = options; + this.wrapper = this.scroller = element; + this._init(); + this._initPulldownRefreshEvent(); + }, + _init: function() { + var self = this; + // document.addEventListener('plusscrollbottom', this); + window.addEventListener('dragup', self); + self.scrollInterval = window.setInterval(function() { + if (self.isScroll && !self.loading) { + if (window.pageYOffset + window.innerHeight + 10 >= document.documentElement.scrollHeight) { + self.isScroll = false; //放在这里是因为快速滚动的话,有可能检测时,还没到底,所以只要有滚动,没到底之前一直检测高度变化 + if (self.bottomPocket) { + self.pullupLoading(); + } + } + } + }, 100); + }, + _initPulldownRefreshEvent: function() { + var self = this; + if (self.topPocket && self.options.webviewId) { + $.plusReady(function() { + var webview = plus.webview.getWebviewById(self.options.webviewId); + if (!webview) { + return; + } + self.options.webview = webview; + var downOptions = self.options.down; + var height = downOptions.height; + webview.addEventListener("dragBounce", function(e) { + if (!self.pulldown) { + self._initPulldownRefresh(); + } else { + self.pullPocket.classList.add(CLASS_BLOCK); + } + switch (e.status) { + case "beforeChangeOffset": //下拉可刷新状态 + self._setCaption(downOptions.contentdown); + break; + case "afterChangeOffset": //松开可刷新状态 + self._setCaption(downOptions.contentover); + break; + case "dragEndAfterChangeOffset": //正在刷新状态 + //执行下拉刷新所在webview的回调函数 + webview.evalJS("mui&&mui.options.pullRefresh.down.callback()"); + self._setCaption(downOptions.contentrefresh); + break; + default: + break; + } + }, false); + webview.setBounce({ + position: { + top: height * 2 + 'px' + }, + changeoffset: { + top: height + 'px' + } + }); + }); + } + }, + handleEvent: function(e) { + var self = this; + if (self.stopped) { + return; + } + //5+的plusscrollbottom当页面内容较少时,不触发 + // if (e.type === 'plusscrollbottom') { + // if (this.bottomPocket) { + // this.pullupLoading(); + // } + // } + self.isScroll = false; + if (e.type === 'dragup') { + self.isScroll = true; + setTimeout(function() { + self.isScroll = false; + }, 1000); + } + } + }).extend($.extend({ + setStopped: function(stopped) { //该方法是子页面调用的 + this.stopped = !!stopped; + //TODO 此处需要设置当前webview的bounce为none,目前5+有BUG + var webview = plus.webview.currentWebview(); + if (this.stopped) { + webview.setStyle({ + bounce: 'none' + }); + webview.setBounce({ + position: { + top: 'none' + } + }); + } else { + var height = this.options.down.height; + webview.setStyle({ + bounce: 'vertical' + }); + webview.setBounce({ + position: { + top: height * 2 + 'px' + }, + changeoffset: { + top: height + 'px' + } + }); + } + }, + pulldownLoading: function() { + //TODO + throw new Error('暂不支持'); + }, + endPulldownToRefresh: function() { //该方法是子页面调用的 + var webview = plus.webview.currentWebview(); + webview.parent().evalJS("mui&&mui(document.querySelector('.mui-content')).pullRefresh('" + JSON.stringify({ + webviewId: webview.id + }) + "')._endPulldownToRefresh()"); + }, + _endPulldownToRefresh: function() { //该方法是父页面调用的 + var self = this; + if (self.topPocket && self.options.webview) { + self.options.webview.endPullToRefresh(); //下拉刷新所在webview回弹 + self.loading = false; + self._setCaption(self.options.down.contentdown, true); + setTimeout(function() { + self.loading || self.topPocket.classList.remove(CLASS_BLOCK); + }, 350); + } + }, + pullupLoading: function(callback) { + var self = this; + if (self.isLoading) return; + self.isLoading = true; + if (self.pulldown !== false) { + self._initPullupRefresh(); + } else { + this.pullPocket.classList.add(CLASS_BLOCK); + } + setTimeout(function() { + self.pullLoading.classList.add(CLASS_VISIBILITY); + self.pullLoading.classList.remove(CLASS_HIDDEN); + self.pullCaption.innerHTML = ''; //修正5+里边第一次加载时,文字显示的bug(还会显示出来个“多”,猜测应该是渲染问题导致的) + self.pullCaption.innerHTML = self.options.up.contentrefresh; + callback = callback || self.options.up.callback; + callback && callback.call(self); + }, 300); + }, + endPullupToRefresh: function(finished) { + var self = this; + if (self.pullLoading) { + self.pullLoading.classList.remove(CLASS_VISIBILITY); + self.pullLoading.classList.add(CLASS_HIDDEN); + self.isLoading = false; + if (finished) { + self.pullCaption.innerHTML = self.options.up.contentnomore; + // self.bottomPocket.classList.remove(CLASS_BLOCK); + // self.bottomPocket.classList.add(CLASS_HIDDEN); + // document.removeEventListener('plusscrollbottom', self); + window.removeEventListener('dragup', self); + } else { //初始化时隐藏,后续不再隐藏 + self.pullCaption.innerHTML = self.options.up.contentdown; + // setTimeout(function() { + // self.loading || self.bottomPocket.classList.remove(CLASS_BLOCK); + // }, 350); + } + } + }, + scrollTo: function(x, y, time) { + $.scrollTo(x, y, time); + }, + refresh: function(isReset) { + if (isReset) { + // var classList = this.bottomPocket.classList; + // if (classList.contains(CLASS_HIDDEN)) { + // classList.remove(CLASS_HIDDEN); + // document.addEventListener('plusscrollbottom', this); + window.addEventListener('dragup', this); + // } + } + } + }, $.PullRefresh)); + + //override h5 pullRefresh + $.fn.pullRefresh = function(options) { + var self; + if (this.length === 0) { + self = document.createElement('div'); + self.className = 'mui-content'; + document.body.appendChild(self); + } else { + self = this[0]; + } + //一个父需要支持多个子下拉刷新 + options = options || { + webviewId: plus.webview.currentWebview().id || plus.webview.currentWebview().getURL() + } + if (typeof options === 'string') { + options = $.parseJSON(options); + } + var pullRefreshApi = null; + var attrWebviewId = options.webviewId && options.webviewId.replace(/\//g, "_"); //替换所有"/" + var id = self.getAttribute('data-pullrefresh-plus-' + attrWebviewId); + if (!id) { //避免重复初始化5+ pullrefresh + id = ++$.uuid; + self.setAttribute('data-pullrefresh-plus-' + attrWebviewId, id); + document.body.classList.add(CLASS_PLUS_PULLREFRESH); + $.data[id] = pullRefreshApi = new PlusPullRefresh(self, options); + } else { + pullRefreshApi = $.data[id]; + } + return pullRefreshApi; + }; +})(mui, document); +/** + * off-canvas + * @param {type} $ + * @param {type} window + * @param {type} document + * @param {type} action + * @returns {undefined} + */ +(function($, window, document, name) { + var CLASS_OFF_CANVAS_LEFT = 'mui-off-canvas-left'; + var CLASS_OFF_CANVAS_RIGHT = 'mui-off-canvas-right'; + var CLASS_ACTION_BACKDEOP = 'mui-off-canvas-backdrop'; + var CLASS_OFF_CANVAS_WRAP = 'mui-off-canvas-wrap'; + + var CLASS_SLIDE_IN = 'mui-slide-in'; + var CLASS_ACTIVE = 'mui-active'; + + + var CLASS_TRANSITIONING = 'mui-transitioning'; + + var SELECTOR_INNER_WRAP = '.mui-inner-wrap'; + + + var OffCanvas = $.Class.extend({ + init: function(element, options) { + this.wrapper = this.element = element; + this.scroller = this.wrapper.querySelector(SELECTOR_INNER_WRAP); + this.classList = this.wrapper.classList; + if (this.scroller) { + this.options = $.extend(true, { + dragThresholdX: 10 + }, options); + document.body.classList.add('mui-fullscreen'); //fullscreen + this.refresh(); + this.initEvent(); + } + }, + refresh: function() { + this.classList.remove(CLASS_ACTIVE); + this.slideIn = this.classList.contains(CLASS_SLIDE_IN); + this.scroller = this.wrapper.querySelector(SELECTOR_INNER_WRAP); + this.scroller.classList.remove(CLASS_TRANSITIONING); + this.scroller.setAttribute('style', ''); + this.offCanvasRight = this.wrapper.querySelector('.' + CLASS_OFF_CANVAS_RIGHT); + this.offCanvasLeft = this.wrapper.querySelector('.' + CLASS_OFF_CANVAS_LEFT); + this.offCanvasRightWidth = this.offCanvasLeftWidth = 0; + this.offCanvasLeftSlideIn = this.offCanvasRightSlideIn = false; + if (this.offCanvasRight) { + this.offCanvasRightWidth = this.offCanvasRight.offsetWidth; + this.offCanvasRightSlideIn = this.slideIn && (this.offCanvasRight.parentNode === this.wrapper); + this.offCanvasRight.classList.remove(CLASS_TRANSITIONING); + this.offCanvasRight.classList.remove(CLASS_ACTIVE); + this.offCanvasRight.setAttribute('style', ''); + } + if (this.offCanvasLeft) { + this.offCanvasLeftWidth = this.offCanvasLeft.offsetWidth; + this.offCanvasLeftSlideIn = this.slideIn && (this.offCanvasLeft.parentNode === this.wrapper); + this.offCanvasLeft.classList.remove(CLASS_TRANSITIONING); + this.offCanvasLeft.classList.remove(CLASS_ACTIVE); + this.offCanvasLeft.setAttribute('style', ''); + } + this.backdrop = this.scroller.querySelector('.' + CLASS_ACTION_BACKDEOP); + + this.options.dragThresholdX = this.options.dragThresholdX || 10; + + this.visible = false; + this.startX = null; + this.lastX = null; + this.offsetX = null; + this.lastTranslateX = null; + }, + handleEvent: function(e) { + switch (e.type) { + case 'touchstart': + var tagName = e.target && e.target.tagName; + if (tagName !== 'INPUT' && tagName !== 'TEXTAREA' && tagName !== 'SELECT') { + e.preventDefault(); + } + break; + case 'webkitTransitionEnd': //有个bug需要处理,需要考虑假设没有触发webkitTransitionEnd的情况 + if (e.target === this.scroller) { + this._dispatchEvent(); + } + break; + case 'drag': + var detail = e.detail; + if (!this.startX) { + this.startX = detail.move.x; + this.lastX = this.startX; + } else { + this.lastX = detail.move.x; + } + if (!this.isDragging && Math.abs(this.lastX - this.startX) > this.options.dragThresholdX && (detail.direction === 'left' || (detail.direction === 'right'))) { + if (this.slideIn) { + if (this.classList.contains(CLASS_ACTIVE)) { + this.scroller = this.offCanvasRight && this.offCanvasRight.classList.contains(CLASS_ACTIVE) ? this.offCanvasRight : this.offCanvasLeft; + } else { + if (detail.direction === 'left' && this.offCanvasRight) { + this.scroller = this.offCanvasRight; + } else if (detail.direction === 'right' && this.offCanvasLeft) { + this.scroller = this.offCanvasLeft; + } else { + this.scroller = null; + } + } + } + if (this.scroller) { + this.startX = this.lastX; + this.isDragging = true; + + $.gestures.touch.lockDirection = true; //锁定方向 + $.gestures.touch.startDirection = detail.direction; + + this.scroller.classList.remove(CLASS_TRANSITIONING); + this.offsetX = this.getTranslateX(); + this._initOffCanvasVisible(); + } + } + if (this.isDragging) { + this.updateTranslate(this.offsetX + (this.lastX - this.startX)); + detail.gesture.preventDefault(); + e.stopPropagation(); + } + break; + case 'dragend': + if (this.isDragging) { + var detail = e.detail; + var direction = detail.direction; + this.isDragging = false; + this.scroller.classList.add(CLASS_TRANSITIONING); + var ratio = 0; + var x = this.getTranslateX(); + + if (!this.slideIn) { + if (x >= 0) { + ratio = (this.offCanvasLeftWidth && (x / this.offCanvasLeftWidth)) || 0; + } else { + ratio = (this.offCanvasRightWidth && (x / this.offCanvasRightWidth)) || 0; + } + if (ratio === 0) { + this.openPercentage(0); + this._dispatchEvent(); //此处不触发webkitTransitionEnd,所以手动dispatch + return; + } + if (ratio > 0 && ratio < 0.5 && direction === 'right') { + this.openPercentage(0); + } else if (ratio > 0.5 && direction === 'left') { + this.openPercentage(100); + } else if (ratio < 0 && ratio > -0.5 && direction === 'left') { + this.openPercentage(0); + } else if (direction === 'right' && ratio < 0 && ratio > -0.5) { + this.openPercentage(0); + } else if (ratio < 0.5 && direction === 'right') { + this.openPercentage(-100); + } else if (direction === 'right' && ratio >= 0 && (ratio >= 0.5 || detail.flick)) { + this.openPercentage(100); + } else if (direction === 'left' && ratio <= 0 && (ratio <= -0.5 || detail.flick)) { + this.openPercentage(-100); + } else { + this.openPercentage(0); + } + if (ratio === 1 || ratio === -1) { //此处不触发webkitTransitionEnd,所以手动dispatch + this._dispatchEvent(); + } + } else { + if (x >= 0) { + ratio = (this.offCanvasRightWidth && (x / this.offCanvasRightWidth)) || 0; + } else { + ratio = (this.offCanvasLeftWidth && (x / this.offCanvasLeftWidth)) || 0; + } + if (ratio >= 0.5 && direction === 'left') { + this.openPercentage(0); + } else if (ratio > 0 && ratio <= 0.5 && direction === 'left') { + this.openPercentage(-100); + } else if (ratio >= 0.5 && direction === 'right') { + this.openPercentage(0); + } else if (ratio >= -0.5 && ratio < 0 && direction === 'left') { + this.openPercentage(100); + } else if (ratio > 0 && ratio <= 0.5 && direction === 'right') { + this.openPercentage(-100); + } else if (ratio <= -0.5 && direction === 'right') { + this.openPercentage(0); + } else if (ratio >= -0.5 && direction === 'right') { + this.openPercentage(100); + } else if (ratio <= -0.5 && direction === 'left') { + this.openPercentage(0); + } else if (ratio >= -0.5 && direction === 'left') { + this.openPercentage(-100); + } else { + this.openPercentage(0); + } + if (ratio === 1 || ratio === -1 || ratio === 0) { + this._dispatchEvent(); + return; + } + + } + } + break; + } + }, + _dispatchEvent: function() { + if (this.classList.contains(CLASS_ACTIVE)) { + $.trigger(this.wrapper, 'shown', this); + } else { + $.trigger(this.wrapper, 'hidden', this); + } + }, + _initOffCanvasVisible: function() { + if (!this.visible) { + this.visible = true; + if (this.offCanvasLeft) { + this.offCanvasLeft.style.visibility = 'visible'; + } + if (this.offCanvasRight) { + this.offCanvasRight.style.visibility = 'visible'; + } + } + }, + initEvent: function() { + var self = this; + if (self.backdrop) { + self.backdrop.addEventListener('tap', function(e) { + self.close(); + e.detail.gesture.preventDefault(); + }); + } + if (this.classList.contains('mui-draggable')) { + this.wrapper.addEventListener('touchstart', this); //临时处理 + this.wrapper.addEventListener('drag', this); + this.wrapper.addEventListener('dragend', this); + } + this.wrapper.addEventListener('webkitTransitionEnd', this); + }, + openPercentage: function(percentage) { + var p = percentage / 100; + if (!this.slideIn) { + if (this.offCanvasLeft && percentage >= 0) { + this.updateTranslate(this.offCanvasLeftWidth * p); + this.offCanvasLeft.classList[p !== 0 ? 'add' : 'remove'](CLASS_ACTIVE); + } else if (this.offCanvasRight && percentage <= 0) { + this.updateTranslate(this.offCanvasRightWidth * p); + this.offCanvasRight.classList[p !== 0 ? 'add' : 'remove'](CLASS_ACTIVE); + } + this.classList[p !== 0 ? 'add' : 'remove'](CLASS_ACTIVE); + } else { + if (this.offCanvasLeft && percentage >= 0) { + p = p === 0 ? -1 : 0; + this.updateTranslate(this.offCanvasLeftWidth * p); + this.offCanvasLeft.classList[percentage !== 0 ? 'add' : 'remove'](CLASS_ACTIVE); + } else if (this.offCanvasRight && percentage <= 0) { + p = p === 0 ? 1 : 0; + this.updateTranslate(this.offCanvasRightWidth * p); + this.offCanvasRight.classList[percentage !== 0 ? 'add' : 'remove'](CLASS_ACTIVE); + } + this.classList[percentage !== 0 ? 'add' : 'remove'](CLASS_ACTIVE); + } + + }, + updateTranslate: function(x) { + if (x !== this.lastTranslateX) { + if (!this.slideIn) { + if ((!this.offCanvasLeft && x > 0) || (!this.offCanvasRight && x < 0)) { + this.setTranslateX(0); + return; + } + if (this.leftShowing && x > this.offCanvasLeftWidth) { + this.setTranslateX(this.offCanvasLeftWidth); + return; + } + if (this.rightShowing && x < -this.offCanvasRightWidth) { + this.setTranslateX(-this.offCanvasRightWidth); + return; + } + this.setTranslateX(x); + if (x >= 0) { + this.leftShowing = true; + this.rightShowing = false; + if (x > 0) { + if (this.offCanvasLeft) { + this.offCanvasLeft.style.zIndex = 0; + } + if (this.offCanvasRight) { + this.offCanvasRight.style.zIndex = -1; + } + } + } else { + this.rightShowing = true; + this.leftShowing = false; + if (this.offCanvasRight) { + this.offCanvasRight.style.zIndex = 0; + } + if (this.offCanvasLeft) { + this.offCanvasLeft.style.zIndex = -1; + } + } + } else { + if (this.scroller.classList.contains(CLASS_OFF_CANVAS_RIGHT)) { + if (x < 0) { + this.setTranslateX(0); + return; + } + if (x > this.offCanvasRightWidth) { + this.setTranslateX(this.offCanvasRightWidth); + return; + } + } else { + if (x > 0) { + this.setTranslateX(0); + return; + } + if (x < -this.offCanvasLeftWidth) { + this.setTranslateX(-this.offCanvasLeftWidth); + return; + } + } + this.setTranslateX(x); + } + this.lastTranslateX = x; + } + }, + setTranslateX: $.animationFrame(function(x) { + if (this.scroller) { + this.scroller.style.webkitTransform = 'translate3d(' + x + 'px,0,0)'; + } + }), + getTranslateX: function() { + if (this.scroller) { + var result = $.parseTranslateMatrix($.getStyles(this.scroller, 'webkitTransform')); + return (result && result.x) || 0; + } + return 0; + }, + isShown: function(direction) { + var shown = false; + if (!this.slideIn) { + var x = this.getTranslateX(); + if (direction === 'right') { + shown = this.classList.contains(CLASS_ACTIVE) && x < 0; + } else if (direction === 'left') { + shown = this.classList.contains(CLASS_ACTIVE) && x > 0; + } else { + shown = this.classList.contains(CLASS_ACTIVE) && x !== 0; + } + } else { + if (direction === 'left') { + shown = this.offCanvasLeft && this.offCanvasLeft.classList.contains(CLASS_ACTIVE); + } else if (direction === 'right') { + shown = this.offCanvasRight && this.offCanvasRight.classList.contains(CLASS_ACTIVE); + } else { + shown = (this.offCanvasLeft && this.offCanvasLeft.classList.contains(CLASS_ACTIVE)) || (this.offCanvasRight && this.offCanvasRight.classList.contains(CLASS_ACTIVE)); + } + } + return shown; + }, + close: function() { + this._initOffCanvasVisible(); + if (this.slideIn) { + this.scroller = this.offCanvasRight && this.offCanvasRight.classList.contains(CLASS_ACTIVE) ? this.offCanvasRight : this.offCanvasLeft; + } + if (this.scroller) { + this.scroller.classList.add(CLASS_TRANSITIONING); + this.openPercentage(0); + } + }, + show: function(direction) { + this._initOffCanvasVisible(); + if (this.isShown(direction)) { + return; + } + if (!direction) { + direction = this.wrapper.querySelector('.' + CLASS_OFF_CANVAS_RIGHT) ? 'right' : 'left'; + } + if (this.slideIn) { + this.scroller = direction === 'right' ? this.offCanvasRight : this.offCanvasLeft; + } + if (this.scroller) { + this.scroller.classList.add(CLASS_TRANSITIONING); + this.openPercentage(direction === 'left' ? 100 : -100); + } + }, + toggle: function(direction) { + if (this.isShown(direction)) { + this.close(); + } else { + this.show(direction); + } + } + }); + + //hash to offcanvas + var findOffCanvasContainer = function(target) { + parentNode = target.parentNode; + if (parentNode) { + if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { + return parentNode; + } else { + parentNode = parentNode.parentNode; + if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { + return parentNode; + } + } + } + }; + var handle = function(event, target) { + if (target.tagName === 'A' && target.hash) { + var offcanvas = document.getElementById(target.hash.replace('#', '')); + if (offcanvas) { + var container = findOffCanvasContainer(offcanvas); + if (container) { + $.targets._container = container; + event.preventDefault(); //fixed hashchange + return offcanvas; + } + } + } + return false; + }; + + $.registerTarget({ + name: name, + index: 60, + handle: handle, + target: false, + isReset: false, + isContinue: true + }); + + window.addEventListener('tap', function(e) { + if (!$.targets.offcanvas) { + return; + } + //TODO 此处类型的代码后续考虑统一优化(target机制),现在的实现费力不讨好 + var target = e.target; + for (; target && target !== document; target = target.parentNode) { + if (target.tagName === 'A' && target.hash && target.hash === ('#' + $.targets.offcanvas.id)) { + $($.targets._container).offCanvas().toggle($.targets.offcanvas.classList.contains(CLASS_OFF_CANVAS_LEFT) ? 'left' : 'right'); + $.targets.offcanvas = $.targets._container = null; + break; + } + } + }); + + $.fn.offCanvas = function(options) { + var offCanvasApis = []; + this.each(function() { + var offCanvasApi = null; + var self = this; + //hack old version + if (!self.classList.contains(CLASS_OFF_CANVAS_WRAP)) { + self = findOffCanvasContainer(self); + } + var id = self.getAttribute('data-offCanvas'); + if (!id) { + id = ++$.uuid; + $.data[id] = offCanvasApi = new OffCanvas(self, options); + self.setAttribute('data-offCanvas', id); + } else { + offCanvasApi = $.data[id]; + } + if (options === 'show' || options === 'close' || options === 'toggle') { + offCanvasApi.toggle(); + } + offCanvasApis.push(offCanvasApi); + }); + return offCanvasApis.length === 1 ? offCanvasApis[0] : offCanvasApis; + }; + $.ready(function() { + $('.mui-off-canvas-wrap').offCanvas(); + }); +})(mui, window, document, 'offcanvas'); +/** + * actions + * @param {type} $ + * @param {type} name + * @returns {undefined} + */ +(function($, name) { + var CLASS_ACTION = 'mui-action'; + + var handle = function(event, target) { + if (target.className && ~target.className.indexOf(CLASS_ACTION)) { + event.preventDefault(); + return target; + } + return false; + }; + + $.registerTarget({ + name: name, + index: 50, + handle: handle, + target: false, + isContinue: true + }); + +})(mui, 'action'); +/** + * Modals + * @param {type} $ + * @param {type} window + * @param {type} document + * @param {type} name + * @returns {undefined} + */ +(function($, window, document, name) { + var CLASS_MODAL = 'mui-modal'; + + var handle = function(event, target) { + if (target.tagName === 'A' && target.hash) { + var modal = document.getElementById(target.hash.replace('#', '')); + if (modal && modal.classList.contains(CLASS_MODAL)) { + event.preventDefault(); //fixed hashchange + return modal; + } + } + return false; + }; + + $.registerTarget({ + name: name, + index: 50, + handle: handle, + target: false, + isReset: false, + isContinue: true + }); + + window.addEventListener('tap', function(event) { + if ($.targets.modal) { + $.targets.modal.classList.toggle('mui-active'); + } + }); +})(mui, window, document, 'modal'); +/** + * Popovers + * @param {type} $ + * @param {type} window + * @param {type} document + * @param {type} name + * @param {type} undefined + * @returns {undefined} + */ +(function($, window, document, name) { + + var CLASS_POPOVER = 'mui-popover'; + var CLASS_POPOVER_ARROW = 'mui-popover-arrow'; + var CLASS_ACTION_POPOVER = 'mui-popover-action'; + var CLASS_BACKDROP = 'mui-backdrop'; + var CLASS_BAR_POPOVER = 'mui-bar-popover'; + var CLASS_BAR_BACKDROP = 'mui-bar-backdrop'; + var CLASS_ACTION_BACKDROP = 'mui-backdrop-action'; + var CLASS_ACTIVE = 'mui-active'; + var CLASS_BOTTOM = 'mui-bottom'; + + + + var handle = function(event, target) { + if (target.tagName === 'A' && target.hash) { + $.targets._popover = document.getElementById(target.hash.replace('#', '')); + if ($.targets._popover && $.targets._popover.classList.contains(CLASS_POPOVER)) { + event.preventDefault(); //fixed hashchange + return target; + } else { + $.targets._popover = null; + } + } + return false; + }; + + $.registerTarget({ + name: name, + index: 60, + handle: handle, + target: false, + isReset: false, + isContinue: true + }); + + var fixedPopoverScroll = function(isPopoverScroll) { + // if (isPopoverScroll) { + // document.body.setAttribute('style', 'overflow:hidden;'); + // } else { + // document.body.setAttribute('style', ''); + // } + }; + var onPopoverShown = function(e) { + this.removeEventListener('webkitTransitionEnd', onPopoverShown); + this.addEventListener('touchmove', $.preventDefault); + $.trigger(this, 'shown', this); + } + var onPopoverHidden = function(e) { + this.setAttribute('style', ''); + this.removeEventListener('webkitTransitionEnd', onPopoverHidden); + this.removeEventListener('touchmove', $.preventDefault); + fixedPopoverScroll(false); + $.trigger(this, 'hidden', this); + }; + + var backdrop = (function() { + var element = document.createElement('div'); + element.classList.add(CLASS_BACKDROP); + element.addEventListener('touchmove', $.preventDefault); + element.addEventListener('tap', function(e) { + var popover = $.targets._popover; + if (popover) { + popover.addEventListener('webkitTransitionEnd', onPopoverHidden); + popover.classList.remove(CLASS_ACTIVE); + removeBackdrop(popover); + document.body.setAttribute('style', ''); //webkitTransitionEnd有时候不触发? + } + }); + + return element; + }()); + var removeBackdrop = function(popover) { + backdrop.setAttribute('style', 'opacity:0'); + $.targets.popover = $.targets._popover = null; //reset + setTimeout(function() { + if (!popover.classList.contains(CLASS_ACTIVE) && backdrop.parentNode && backdrop.parentNode === document.body) { + document.body.removeChild(backdrop); + } + }, 350); + }; + window.addEventListener('tap', function(e) { + if (!$.targets.popover) { + return; + } + var toggle = false; + var target = e.target; + for (; target && target !== document; target = target.parentNode) { + if (target === $.targets.popover) { + toggle = true; + } + } + if (toggle) { + togglePopover($.targets._popover, $.targets.popover); + } + + }); + + var togglePopover = function(popover, anchor) { + //remove一遍,以免来回快速切换,导致webkitTransitionEnd不触发,无法remove + popover.removeEventListener('webkitTransitionEnd', onPopoverShown); + popover.removeEventListener('webkitTransitionEnd', onPopoverHidden); + backdrop.classList.remove(CLASS_BAR_BACKDROP); + backdrop.classList.remove(CLASS_ACTION_BACKDROP); + var _popover = document.querySelector('.mui-popover.mui-active'); + if (_popover) { + // _popover.setAttribute('style', ''); + _popover.addEventListener('webkitTransitionEnd', onPopoverHidden); + _popover.classList.remove(CLASS_ACTIVE); + // _popover.removeEventListener('webkitTransitionEnd', onPopoverHidden); + // fixedPopoverScroll(false); + //同一个弹出则直接返回,解决同一个popover的toggle + if (popover === _popover) { + removeBackdrop(_popover); + return; + } + } + var isActionSheet = false; + if (popover.classList.contains(CLASS_BAR_POPOVER) || popover.classList.contains(CLASS_ACTION_POPOVER)) { //navBar + if (popover.classList.contains(CLASS_ACTION_POPOVER)) { //action sheet popover + isActionSheet = true; + backdrop.classList.add(CLASS_ACTION_BACKDROP); + } else { //bar popover + backdrop.classList.add(CLASS_BAR_BACKDROP); + // if (anchor) { + // if (anchor.parentNode) { + // var offsetWidth = anchor.offsetWidth; + // var offsetLeft = anchor.offsetLeft; + // var innerWidth = window.innerWidth; + // popover.style.left = (Math.min(Math.max(offsetLeft, defaultPadding), innerWidth - offsetWidth - defaultPadding)) + "px"; + // } else { + // //TODO anchor is position:{left,top,bottom,right} + // } + // } + } + } + popover.setAttribute('style', 'display:block'); //actionsheet transform + popover.offsetHeight; + popover.classList.add(CLASS_ACTIVE); + backdrop.setAttribute('style', ''); + document.body.appendChild(backdrop); + fixedPopoverScroll(true); + calPosition(popover, anchor, isActionSheet); //position + backdrop.classList.add(CLASS_ACTIVE); + popover.addEventListener('webkitTransitionEnd', onPopoverShown); + }; + var calPosition = function(popover, anchor, isActionSheet) { + if (!popover || !anchor) { + return; + } + var wWidth = window.innerWidth; + var wHeight = window.innerHeight; + + var pWidth = popover.offsetWidth; + var pHeight = popover.offsetHeight; + if (isActionSheet) { //actionsheet + popover.setAttribute('style', 'display:block;top:' + (wHeight - pHeight + window.pageYOffset) + 'px;left:' + (wWidth - pWidth) / 2 + 'px;'); + return; + } + var aWidth = anchor.offsetWidth; + var aHeight = anchor.offsetHeight; + var offset = $.offset(anchor); + + var arrow = popover.querySelector('.' + CLASS_POPOVER_ARROW); + if (!arrow) { + arrow = document.createElement('div'); + arrow.className = CLASS_POPOVER_ARROW; + popover.appendChild(arrow); + } + var arrowSize = arrow && arrow.offsetWidth / 2 || 0; + + + + var pTop = 0; + var pLeft = 0; + var diff = 0; + var arrowLeft = 0; + var defaultPadding = popover.classList.contains(CLASS_ACTION_POPOVER) ? 0 : 5; + + var position = 'top'; + if ((pHeight + arrowSize) < (offset.top - window.pageYOffset)) { //top + pTop = offset.top - pHeight - arrowSize; + } else if ((pHeight + arrowSize) < (wHeight - (offset.top - window.pageYOffset) - aHeight)) { //bottom + position = 'bottom'; + pTop = offset.top + aHeight + arrowSize; + } else { //middle + position = 'middle'; + pTop = Math.max((wHeight - pHeight) / 2 + window.pageYOffset, 0); + pLeft = Math.max((wWidth - pWidth) / 2 + window.pageXOffset, 0); + } + if (position === 'top' || position === 'bottom') { + pLeft = aWidth / 2 + offset.left - pWidth / 2; + diff = pLeft; + if (pLeft < defaultPadding) pLeft = defaultPadding; + if (pLeft + pWidth > wWidth) pLeft = wWidth - pWidth - defaultPadding; + + if (arrow) { + if (position === 'top') { + arrow.classList.add(CLASS_BOTTOM); + } else { + arrow.classList.remove(CLASS_BOTTOM); + } + diff = diff - pLeft; + arrowLeft = (pWidth / 2 - arrowSize / 2 + diff); + arrowLeft = Math.max(Math.min(arrowLeft, pWidth - arrowSize * 2 - 6), 6); + arrow.setAttribute('style', 'left:' + arrowLeft + 'px'); + } + } else if (position === 'middle') { + arrow.setAttribute('style', 'display:none'); + } + popover.setAttribute('style', 'display:block;top:' + pTop + 'px;left:' + pLeft + 'px;'); + }; + + $.createMask = function(callback) { + var element = document.createElement('div'); + element.classList.add(CLASS_BACKDROP); + element.addEventListener('touchmove', $.preventDefault); + element.addEventListener('tap', function() { + mask.close(); + }); + var mask = [element]; + mask._show = false; + mask.show = function() { + mask._show = true; + element.setAttribute('style', 'opacity:1'); + document.body.appendChild(element); + return mask; + }; + mask._remove = function() { + if (mask._show) { + mask._show = false; + element.setAttribute('style', 'opacity:0'); + setTimeout(function() { + document.body.removeChild(element); + }, 350); + } + return mask; + }; + mask.close = function() { + if (callback) { + if (callback() !== false) { + mask._remove(); + } + } else { + mask._remove(); + } + }; + return mask; + }; + $.fn.popover = function() { + var args = arguments; + this.each(function() { + $.targets._popover = this; + if (args[0] === 'show' || args[0] === 'hide' || args[0] === 'toggle') { + togglePopover(this, args[1]); + } + }); + }; + +})(mui, window, document, 'popover'); +/** + * segmented-controllers + * @param {type} $ + * @param {type} window + * @param {type} document + * @param {type} undefined + * @returns {undefined} + */ +(function($, window, document, name, undefined) { + + var CLASS_CONTROL_ITEM = 'mui-control-item'; + var CLASS_SEGMENTED_CONTROL = 'mui-segmented-control'; + var CLASS_CONTROL_CONTENT = 'mui-control-content'; + var CLASS_TAB_BAR = 'mui-bar-tab'; + var CLASS_TAB_ITEM = 'mui-tab-item'; + var CLASS_SLIDER_ITEM = 'mui-slider-item'; + + var handle = function(event, target) { + if (target.classList && (target.classList.contains(CLASS_CONTROL_ITEM) || target.classList.contains(CLASS_TAB_ITEM))) { + event.preventDefault(); //stop hash change + // if (target.hash) { + return target; + // } + } + return false; + }; + + $.registerTarget({ + name: name, + index: 80, + handle: handle, + target: false + }); + + window.addEventListener('tap', function(e) { + + var targetTab = $.targets.tab; + if (!targetTab) { + return; + } + var activeTab; + var activeBodies; + var targetBody; + var className = 'mui-active'; + var classSelector = '.' + className; + var segmentedControl = targetTab.parentNode; + + for (; segmentedControl && segmentedControl !== document; segmentedControl = segmentedControl.parentNode) { + if (segmentedControl.classList.contains(CLASS_SEGMENTED_CONTROL)) { + activeTab = segmentedControl.querySelector(classSelector + '.' + CLASS_CONTROL_ITEM); + break; + } else if (segmentedControl.classList.contains(CLASS_TAB_BAR)) { + activeTab = segmentedControl.querySelector(classSelector + '.' + CLASS_TAB_ITEM); + } + } + + + if (activeTab) { + activeTab.classList.remove(className); + } + + var isLastActive = targetTab === activeTab; + if (targetTab) { + targetTab.classList.add(className); + } + + if (!targetTab.hash) { + return; + } + + targetBody = document.getElementById(targetTab.hash.replace('#', '')); + + if (!targetBody) { + return; + } + if (!targetBody.classList.contains(CLASS_CONTROL_CONTENT)) { //tab bar popover + targetTab.classList[isLastActive ? 'remove' : 'add'](className); + return; + } + if (isLastActive) { //same + return; + } + var parentNode = targetBody.parentNode; + activeBodies = parentNode.querySelectorAll('.' + CLASS_CONTROL_CONTENT + classSelector); + for (var i = 0; i < activeBodies.length; i++) { + var activeBody = activeBodies[i]; + activeBody.parentNode === parentNode && activeBody.classList.remove(className); + } + + targetBody.classList.add(className); + + var contents = targetBody.parentNode.querySelectorAll('.' + CLASS_CONTROL_CONTENT); + $.trigger(targetBody, $.eventName('shown', name), { + tabNumber: Array.prototype.indexOf.call(contents, targetBody) + }); + e.detail && e.detail.gesture.preventDefault(); //fixed hashchange + }); + +})(mui, window, document, 'tab'); +/** + * Toggles switch + * @param {type} $ + * @param {type} window + * @param {type} name + * @returns {undefined} + */ +(function($, window, name) { + + var CLASS_SWITCH = 'mui-switch'; + var CLASS_SWITCH_HANDLE = 'mui-switch-handle'; + var CLASS_ACTIVE = 'mui-active'; + var CLASS_DRAGGING = 'mui-dragging'; + + var CLASS_DISABLED = 'mui-disabled'; + + var SELECTOR_SWITCH_HANDLE = '.' + CLASS_SWITCH_HANDLE; + + var handle = function(event, target) { + if (target.classList && target.classList.contains(CLASS_SWITCH)) { + return target; + } + return false; + }; + + $.registerTarget({ + name: name, + index: 100, + handle: handle, + target: false + }); + + + var Toggle = function(element) { + this.element = element; + this.classList = this.element.classList; + this.handle = this.element.querySelector(SELECTOR_SWITCH_HANDLE); + this.init(); + this.initEvent(); + }; + Toggle.prototype.init = function() { + this.toggleWidth = this.element.offsetWidth; + this.handleWidth = this.handle.offsetWidth; + this.handleX = this.toggleWidth - this.handleWidth - 3; + }; + Toggle.prototype.initEvent = function() { + this.element.addEventListener('touchstart', this); + this.element.addEventListener('drag', this); + this.element.addEventListener('swiperight', this); + this.element.addEventListener('touchend', this); + this.element.addEventListener('touchcancel', this); + + }; + Toggle.prototype.handleEvent = function(e) { + if (this.classList.contains(CLASS_DISABLED)) { + return; + } + switch (e.type) { + case 'touchstart': + this.start(e); + break; + case 'drag': + this.drag(e); + break; + case 'swiperight': + this.swiperight(); + break; + case 'touchend': + case 'touchcancel': + this.end(e); + break; + } + }; + Toggle.prototype.start = function(e) { + this.classList.add(CLASS_DRAGGING); + if (this.toggleWidth === 0 || this.handleWidth === 0) { //当switch处于隐藏状态时,width为0,需要重新初始化 + this.init(); + } + }; + Toggle.prototype.drag = function(e) { + var detail = e.detail; + if (!this.isDragging) { + if (detail.direction === 'left' || detail.direction === 'right') { + this.isDragging = true; + this.lastChanged = undefined; + this.initialState = this.classList.contains(CLASS_ACTIVE); + } + } + if (this.isDragging) { + this.setTranslateX(detail.deltaX); + e.stopPropagation(); + detail.gesture.preventDefault(); + } + }; + Toggle.prototype.swiperight = function(e) { + if (this.isDragging) { + e.stopPropagation(); + } + }; + Toggle.prototype.end = function(e) { + this.classList.remove(CLASS_DRAGGING); + if (this.isDragging) { + this.isDragging = false; + e.stopPropagation(); + $.trigger(this.element, 'toggle', { + isActive: this.classList.contains(CLASS_ACTIVE) + }); + } else { + this.toggle(); + } + }; + Toggle.prototype.toggle = function() { + var classList = this.classList; + if (classList.contains(CLASS_ACTIVE)) { + classList.remove(CLASS_ACTIVE); + this.handle.style.webkitTransform = 'translate3d(0,0,0)'; + } else { + classList.add(CLASS_ACTIVE); + this.handle.style.webkitTransform = 'translate3d(' + this.handleX + 'px,0,0)'; + } + $.trigger(this.element, 'toggle', { + isActive: this.classList.contains(CLASS_ACTIVE) + }); + }; + Toggle.prototype.setTranslateX = $.animationFrame(function(x) { + if (!this.isDragging) { + return; + } + var isChanged = false; + if ((this.initialState && -x > (this.handleX / 2)) || (!this.initialState && x > (this.handleX / 2))) { + isChanged = true; + } + if (this.lastChanged !== isChanged) { + if (isChanged) { + this.handle.style.webkitTransform = 'translate3d(' + (this.initialState ? 0 : this.handleX) + 'px,0,0)'; + this.classList[this.initialState ? 'remove' : 'add'](CLASS_ACTIVE); + } else { + this.handle.style.webkitTransform = 'translate3d(' + (this.initialState ? this.handleX : 0) + 'px,0,0)'; + this.classList[this.initialState ? 'add' : 'remove'](CLASS_ACTIVE); + } + this.lastChanged = isChanged; + } + + }); + + $.fn.switch = function(options) { + var switchApis = []; + this.each(function() { + var switchApi = null; + var id = this.getAttribute('data-switch'); + if (!id) { + id = ++$.uuid; + $.data[id] = new Toggle(this); + this.setAttribute('data-switch', id); + } else { + switchApi = $.data[id]; + } + switchApis.push(switchApi); + }); + return switchApis.length > 1 ? switchApis : switchApis[0]; + }; + $.ready(function() { + $('.' + CLASS_SWITCH).switch(); + }); +})(mui, window, 'toggle'); +/** + * Tableviews + * @param {type} $ + * @param {type} window + * @param {type} document + * @returns {undefined} + */ +(function($, window, document) { + + var CLASS_ACTIVE = 'mui-active'; + var CLASS_SELECTED = 'mui-selected'; + var CLASS_GRID_VIEW = 'mui-grid-view'; + var CLASS_TABLE_VIEW_CELL = 'mui-table-view-cell'; + var CLASS_COLLAPSE_CONTENT = 'mui-collapse-content'; + var CLASS_DISABLED = 'mui-disabled'; + var CLASS_TOGGLE = 'mui-switch'; + var CLASS_BTN = 'mui-btn'; + + var CLASS_SLIDER_HANDLE = 'mui-slider-handle'; + var CLASS_SLIDER_LEFT = 'mui-slider-left'; + var CLASS_SLIDER_RIGHT = 'mui-slider-right'; + var CLASS_TRANSITIONING = 'mui-transitioning'; + + + var SELECTOR_SLIDER_HANDLE = '.' + CLASS_SLIDER_HANDLE; + var SELECTOR_SLIDER_LEFT = '.' + CLASS_SLIDER_LEFT; + var SELECTOR_SLIDER_RIGHT = '.' + CLASS_SLIDER_RIGHT; + var SELECTOR_SELECTED = '.' + CLASS_SELECTED; + var SELECTOR_BUTTON = '.' + CLASS_BTN; + var overFactor = 0.8; + var cell, a; + + var isMoved = isOpened = openedActions = progress = false; + var sliderHandle = sliderActionLeft = sliderActionRight = buttonsLeft = buttonsRight = sliderDirection = sliderRequestAnimationFrame = false; + var translateX = lastTranslateX = sliderActionLeftWidth = sliderActionRightWidth = 0; + + + + var toggleActive = function(isActive) { + if (isActive) { + if (a) { + a.classList.add(CLASS_ACTIVE); + } else if (cell) { + cell.classList.add(CLASS_ACTIVE); + } + } else { + if (a) { + a.classList.remove(CLASS_ACTIVE); + } else if (cell) { + cell.classList.remove(CLASS_ACTIVE); + } + } + }; + + var updateTranslate = function() { + if (translateX !== lastTranslateX) { + if (buttonsRight && buttonsRight.length > 0) { + progress = translateX / sliderActionRightWidth; + if (translateX < -sliderActionRightWidth) { + translateX = -sliderActionRightWidth - Math.pow(-translateX - sliderActionRightWidth, overFactor); + } + for (var i = 0, len = buttonsRight.length; i < len; i++) { + var buttonRight = buttonsRight[i]; + if (typeof buttonRight._buttonOffset === 'undefined') { + buttonRight._buttonOffset = buttonRight.offsetLeft; + } + buttonOffset = buttonRight._buttonOffset; + setTranslate(buttonRight, (translateX - buttonOffset * (1 + Math.max(progress, -1)))); + } + } + if (buttonsLeft && buttonsLeft.length > 0) { + progress = translateX / sliderActionLeftWidth; + if (translateX > sliderActionLeftWidth) { + translateX = sliderActionLeftWidth + Math.pow(translateX - sliderActionLeftWidth, overFactor); + } + for (var i = 0, len = buttonsLeft.length; i < len; i++) { + var buttonLeft = buttonsLeft[i]; + if (typeof buttonLeft._buttonOffset === 'undefined') { + buttonLeft._buttonOffset = sliderActionLeftWidth - buttonLeft.offsetLeft - buttonLeft.offsetWidth; + } + buttonOffset = buttonLeft._buttonOffset; + if (buttonsLeft.length > 1) { + buttonLeft.style.zIndex = buttonsLeft.length - i; + } + setTranslate(buttonLeft, (translateX + buttonOffset * (1 - Math.min(progress, 1)))); + } + } + setTranslate(sliderHandle, translateX); + lastTranslateX = translateX; + } + sliderRequestAnimationFrame = requestAnimationFrame(function() { + updateTranslate(); + }); + }; + var setTranslate = function(element, x) { + if (element) { + element.style.webkitTransform = 'translate3d(' + x + 'px,0,0)'; + } + }; + + window.addEventListener('touchstart', function(event) { + if (cell) { + toggleActive(false); + } + cell = a = false; + isMoved = isOpened = openedActions = false; + var target = event.target; + var isDisabled = false; + for (; target && target !== document; target = target.parentNode) { + if (target.classList) { + var classList = target.classList; + if ((target.tagName === 'INPUT' && target.type !== 'radio' && target.type !== 'checkbox') || target.tagName === 'BUTTON' || classList.contains(CLASS_TOGGLE) || classList.contains(CLASS_BTN) || classList.contains(CLASS_DISABLED)) { + isDisabled = true; + } + if (classList.contains(CLASS_COLLAPSE_CONTENT)) { //collapse content + break; + } + if (classList.contains(CLASS_TABLE_VIEW_CELL)) { + cell = target; + //TODO swipe to delete close + var selected = cell.parentNode.querySelector(SELECTOR_SELECTED); + if (selected && selected !== cell) { + $.swipeoutClose(selected); + cell = isDisabled = false; + return; + } + if (!cell.parentNode.classList.contains(CLASS_GRID_VIEW)) { + var link = cell.querySelector('a'); + if (link && link.parentNode === cell) { //li>a + a = link; + } + } + if (cell.querySelector(SELECTOR_SLIDER_HANDLE)) { + toggleEvents(cell); + event.stopPropagation(); + } + if (!isDisabled) { + if (!(cell.querySelector('input') || cell.querySelector(SELECTOR_BUTTON) || cell.querySelector('.' + CLASS_TOGGLE))) { + toggleActive(true); + } + } + break; + } + } + } + }); + window.addEventListener('touchmove', function(event) { + toggleActive(false); + }); + + var handleEvent = { + handleEvent: function(event) { + switch (event.type) { + case 'drag': + this.drag(event); + break; + case 'dragend': + this.dragend(event); + break; + case 'flick': + this.flick(event); + break; + case 'swiperight': + this.swiperight(event); + break; + case 'swipeleft': + this.swipeleft(event); + break; + } + }, + drag: function(event) { + if (!cell) { + return; + } + if (!isMoved) { //init + sliderHandle = sliderActionLeft = sliderActionRight = buttonsLeft = buttonsRight = sliderDirection = sliderRequestAnimationFrame = false; + sliderHandle = cell.querySelector(SELECTOR_SLIDER_HANDLE); + if (sliderHandle) { + sliderActionLeft = cell.querySelector(SELECTOR_SLIDER_LEFT); + sliderActionRight = cell.querySelector(SELECTOR_SLIDER_RIGHT); + if (sliderActionLeft) { + sliderActionLeftWidth = sliderActionLeft.offsetWidth; + buttonsLeft = sliderActionLeft.querySelectorAll(SELECTOR_BUTTON); + } + if (sliderActionRight) { + sliderActionRightWidth = sliderActionRight.offsetWidth; + buttonsRight = sliderActionRight.querySelectorAll(SELECTOR_BUTTON); + } + cell.classList.remove(CLASS_TRANSITIONING); + isOpened = cell.classList.contains(CLASS_SELECTED); + if (isOpened) { + openedActions = cell.querySelector(SELECTOR_SLIDER_LEFT + SELECTOR_SELECTED) ? 'left' : 'right'; + } + } + } + var detail = event.detail; + var direction = detail.direction; + var angle = detail.angle; + if (direction === 'left' && (angle > 150 || angle < -150)) { + if (buttonsRight || (buttonsLeft && isOpened)) { //存在右侧按钮或存在左侧按钮且是已打开状态 + isMoved = true; + } + } else if (direction === 'right' && (angle > -30 && angle < 30)) { + if (buttonsLeft || (buttonsRight && isOpened)) { //存在左侧按钮或存在右侧按钮且是已打开状态 + isMoved = true; + } + } + if (isMoved) { + event.stopPropagation(); + event.detail.gesture.preventDefault(); + var translate = event.detail.deltaX; + if (isOpened) { + if (openedActions === 'right') { + translate = translate - sliderActionRightWidth; + } else { + translate = translate + sliderActionLeftWidth; + } + } + if ((translate > 0 && !buttonsLeft) || (translate < 0 && !buttonsRight)) { + if (!isOpened) { + return; + } + translate = 0; + } + if (translate < 0) { + sliderDirection = 'toLeft'; + } else if (translate > 0) { + sliderDirection = 'toRight'; + } else { + if (!sliderDirection) { + sliderDirection = 'toLeft'; + } + } + if (!sliderRequestAnimationFrame) { + updateTranslate(); + } + translateX = translate; + } + }, + flick: function(event) { + if (isMoved) { + event.stopPropagation(); + } + }, + swipeleft: function(event) { + if (isMoved) { + event.stopPropagation(); + } + }, + swiperight: function(event) { + if (isMoved) { + event.stopPropagation(); + } + }, + dragend: function(event) { + if (!isMoved) { + return; + } + event.stopPropagation(); + if (sliderRequestAnimationFrame) { + cancelAnimationFrame(sliderRequestAnimationFrame); + sliderRequestAnimationFrame = null; + } + var detail = event.detail; + isMoved = false; + var action = 'close'; + var actionsWidth = sliderDirection === 'toLeft' ? sliderActionRightWidth : sliderActionLeftWidth; + var isToggle = detail.swipe || (Math.abs(translateX) > actionsWidth / 2); + if (isToggle) { + if (!isOpened) { + action = 'open'; + } else if (detail.direction === 'left' && openedActions === 'right') { + action = 'open'; + } else if (detail.direction === 'right' && openedActions === 'left') { + action = 'open'; + } + + } + cell.classList.add(CLASS_TRANSITIONING); + var buttons; + if (action === 'open') { + var newTranslate = sliderDirection === 'toLeft' ? -actionsWidth : actionsWidth; + setTranslate(sliderHandle, newTranslate); + buttons = sliderDirection === 'toLeft' ? buttonsRight : buttonsLeft; + if (typeof buttons !== 'undefined') { + var button = null; + for (var i = 0; i < buttons.length; i++) { + button = buttons[i]; + setTranslate(button, newTranslate); + } + button.parentNode.classList.add(CLASS_SELECTED); + cell.classList.add(CLASS_SELECTED); + if (!isOpened) { + $.trigger(cell, sliderDirection === 'toLeft' ? 'slideleft' : 'slideright'); + } + } + } else { + setTranslate(sliderHandle, 0); + sliderActionLeft && sliderActionLeft.classList.remove(CLASS_SELECTED); + sliderActionRight && sliderActionRight.classList.remove(CLASS_SELECTED); + cell.classList.remove(CLASS_SELECTED); + } + var buttonOffset; + if (buttonsLeft && buttonsLeft.length > 0 && buttonsLeft !== buttons) { + for (var i = 0, len = buttonsLeft.length; i < len; i++) { + var buttonLeft = buttonsLeft[i]; + buttonOffset = buttonLeft._buttonOffset; + if (typeof buttonOffset === 'undefined') { + buttonLeft._buttonOffset = sliderActionLeftWidth - buttonLeft.offsetLeft - buttonLeft.offsetWidth; + } + setTranslate(buttonLeft, buttonOffset); + } + } + if (buttonsRight && buttonsRight.length > 0 && buttonsRight !== buttons) { + for (var i = 0, len = buttonsRight.length; i < len; i++) { + var buttonRight = buttonsRight[i]; + buttonOffset = buttonRight._buttonOffset; + if (typeof buttonOffset === 'undefined') { + buttonRight._buttonOffset = buttonRight.offsetLeft; + } + setTranslate(buttonRight, -buttonOffset); + } + } + } + }; + + function toggleEvents(element, isRemove) { + var method = !!isRemove ? 'removeEventListener' : 'addEventListener'; + element[method]('drag', handleEvent); + element[method]('dragend', handleEvent); + element[method]('swiperight', handleEvent); + element[method]('swipeleft', handleEvent); + element[method]('flick', handleEvent); + }; + /** + * 打开滑动菜单 + * @param {Object} el + * @param {Object} direction + */ + $.swipeoutOpen = function(el, direction) { + if (!el) return; + var classList = el.classList; + if (classList.contains(CLASS_SELECTED)) return; + if (!direction) { + if (el.querySelector(SELECTOR_SLIDER_RIGHT)) { + direction = 'right'; + } else { + direction = 'left'; + } + } + var swipeoutAction = el.querySelector($.classSelector(".slider-" + direction)); + if (!swipeoutAction) return; + swipeoutAction.classList.add(CLASS_SELECTED); + classList.add(CLASS_SELECTED); + classList.remove(CLASS_TRANSITIONING); + var buttons = swipeoutAction.querySelectorAll(SELECTOR_BUTTON); + var swipeoutWidth = swipeoutAction.offsetWidth; + var translate = (direction === 'right') ? -swipeoutWidth : swipeoutWidth; + var length = buttons.length; + var button; + for (var i = 0; i < length; i++) { + button = buttons[i]; + if (direction === 'right') { + setTranslate(button, -button.offsetLeft); + } else { + setTranslate(button, (swipeoutWidth - button.offsetWidth - button.offsetLeft)); + } + } + classList.add(CLASS_TRANSITIONING); + for (var i = 0; i < length; i++) { + setTranslate(buttons[i], translate); + } + setTranslate(el.querySelector(SELECTOR_SLIDER_HANDLE), translate); + }; + /** + * 关闭滑动菜单 + * @param {Object} el + */ + $.swipeoutClose = function(el) { + if (!el) return; + var classList = el.classList; + if (!classList.contains(CLASS_SELECTED)) return; + var direction = el.querySelector(SELECTOR_SLIDER_RIGHT + SELECTOR_SELECTED) ? 'right' : 'left'; + var swipeoutAction = el.querySelector($.classSelector(".slider-" + direction)); + if (!swipeoutAction) return; + swipeoutAction.classList.remove(CLASS_SELECTED); + classList.remove(CLASS_SELECTED); + classList.add(CLASS_TRANSITIONING); + var buttons = swipeoutAction.querySelectorAll(SELECTOR_BUTTON); + var swipeoutWidth = swipeoutAction.offsetWidth; + var length = buttons.length; + var button; + setTranslate(el.querySelector(SELECTOR_SLIDER_HANDLE), 0); + for (var i = 0; i < length; i++) { + button = buttons[i]; + if (direction === 'right') { + setTranslate(button, (-button.offsetLeft)); + } else { + setTranslate(button, (swipeoutWidth - button.offsetWidth - button.offsetLeft)); + } + } + }; + + window.addEventListener('touchend', function(event) { //使用touchend来取消高亮,避免一次点击既不触发tap,doubletap,longtap的事件 + if (!cell) { + return; + } + toggleActive(false); + sliderHandle && toggleEvents(cell, true); + }); + window.addEventListener('touchcancel', function(event) { //使用touchcancel来取消高亮,避免一次点击既不触发tap,doubletap,longtap的事件 + if (!cell) { + return; + } + toggleActive(false); + sliderHandle && toggleEvents(cell, true); + }); + var radioOrCheckboxClick = function() { + var classList = cell.classList; + if (classList.contains('mui-radio')) { + var input = cell.querySelector('input[type=radio]'); + if (input) { + input.click(); + } + } else if (classList.contains('mui-checkbox')) { + var input = cell.querySelector('input[type=checkbox]'); + if (input) { + input.click(); + } + } + }; + //fixed hashchange(android) + window.addEventListener($.EVENT_CLICK, function(e) { + if (cell && cell.classList.contains('mui-collapse')) { + e.preventDefault(); + } + }); + window.addEventListener('doubletap', function(event) { + if (cell) { + radioOrCheckboxClick(); + } + }); + window.addEventListener('tap', function(event) { + if (!cell) { + return; + } + var isExpand = false; + var classList = cell.classList; + if (classList.contains('mui-collapse') && !cell.parentNode.classList.contains('mui-unfold')) { + event.detail.gesture.preventDefault(); + if (!classList.contains(CLASS_ACTIVE)) { //展开时,需要收缩其他同类 + var collapse = cell.parentNode.querySelector('.mui-collapse.mui-active'); + if (collapse) { + collapse.classList.remove(CLASS_ACTIVE); + } + isExpand = true; + } + classList.toggle(CLASS_ACTIVE); + if (isExpand) { + //触发展开事件 + $.trigger(cell, 'expand'); + + //scroll + //暂不滚动 + // var offsetTop = $.offset(cell).top; + // var scrollTop = document.body.scrollTop; + // var height = window.innerHeight; + // var offsetHeight = cell.offsetHeight; + // var cellHeight = (offsetTop - scrollTop + offsetHeight); + // if (offsetHeight > height) { + // $.scrollTo(offsetTop, 300); + // } else if (cellHeight > height) { + // $.scrollTo(cellHeight - height + scrollTop, 300); + // } + } + } + radioOrCheckboxClick(); + }); +})(mui, window, document); +(function($, window) { + /** + * 警告消息框 + */ + $.alert = function(message,title,btnValue,callback) { + if ($.os.plus) { + if(typeof message === undefined){ + return; + }else{ + if(typeof title ==='function'){ + callback = title; + title = null; + btnValue = '确定'; + }else if(typeof btnValue ==='function'){ + callback = btnValue; + btnValue = null; + } + plus.nativeUI.alert(message,callback,title,btnValue); + } + + }else{ + //TODO H5版本 + window.alert(message); + } + }; + +})(mui, window); +(function($, window) { + /** + * 确认消息框 + */ + $.confirm = function(message,title,btnArray,callback) { + if ($.os.plus) { + if(typeof message === undefined){ + return; + }else{ + if(typeof title ==='function'){ + callback = title; + title = null; + btnArray = null; + }else if(typeof btnArray ==='function'){ + callback = btnArray; + btnArray = null; + } + plus.nativeUI.confirm(message,callback,title,btnArray); + } + + }else{ + //TODO H5版本 + window.confirm(message); + } + }; + +})(mui, window); +(function($, window) { + /** + * 输入对话框 + */ + $.prompt = function(text,defaultText,title,btnArray,callback) { + if ($.os.plus) { + if(typeof message === undefined){ + return; + }else{ + + if(typeof defaultText ==='function'){ + callback = defaultText; + defaultText = null; + title = null; + btnArray = null; + }else if(typeof title === 'function'){ + callback = title; + title = null; + btnArray = null; + }else if(typeof btnArray ==='function'){ + callback = btnArray; + btnArray = null; + } + plus.nativeUI.prompt(text,callback,title,defaultText,btnArray); + } + + }else{ + //TODO H5版本 + window.prompt(text); + } + }; + +})(mui, window); +(function($, window) { + /** + * 自动消失提示框 + */ + $.toast = function(message) { + if($.os.plus){ + //默认显示在底部; + plus.nativeUI.toast(message,{verticalAlign:'bottom'}); + }else{ + var toast = document.createElement('div'); + toast.classList.add('mui-toast-container'); + toast.innerHTML = '
'+message+'
'; + document.body.appendChild(toast); + setTimeout(function(){ + document.body.removeChild(toast); + },2000); + } + }; + +})(mui, window); +/** + * Input(TODO resize) + * @param {type} $ + * @param {type} window + * @param {type} document + * @returns {undefined} + */ +(function($, window, document) { + var CLASS_ICON = 'mui-icon'; + var CLASS_ICON_CLEAR = 'mui-icon-clear'; + var CLASS_ICON_SPEECH = 'mui-icon-speech'; + var CLASS_ICON_SEARCH = 'mui-icon-search'; + var CLASS_INPUT_ROW = 'mui-input-row'; + var CLASS_PLACEHOLDER = 'mui-placeholder'; + var CLASS_TOOLTIP = 'mui-tooltip'; + var CLASS_HIDDEN = 'mui-hidden'; + var CLASS_FOCUSIN = 'mui-focusin'; + var SELECTOR_ICON_CLOSE = '.' + CLASS_ICON_CLEAR; + var SELECTOR_ICON_SPEECH = '.' + CLASS_ICON_SPEECH; + var SELECTOR_PLACEHOLDER = '.' + CLASS_PLACEHOLDER; + var SELECTOR_TOOLTIP = '.' + CLASS_TOOLTIP; + + var findRow = function(target) { + for (; target && target !== document; target = target.parentNode) { + if (target.classList && target.classList.contains(CLASS_INPUT_ROW)) { + return target; + } + } + return null; + }; + var Input = function(element, options) { + this.element = element; + this.options = options || { + actions: 'clear' + }; + if (~this.options.actions.indexOf('slider')) { //slider + this.sliderActionClass = CLASS_TOOLTIP + ' ' + CLASS_HIDDEN; + this.sliderActionSelector = SELECTOR_TOOLTIP; + } else { //clear,speech,search + if (~this.options.actions.indexOf('clear')) { + this.clearActionClass = CLASS_ICON + ' ' + CLASS_ICON_CLEAR + (element.value ? '' : (' ' + CLASS_HIDDEN)); + this.clearActionSelector = SELECTOR_ICON_CLOSE; + } + if (~this.options.actions.indexOf('speech')) { //only for 5+ + this.speechActionClass = CLASS_ICON + ' ' + CLASS_ICON_SPEECH; + this.speechActionSelector = SELECTOR_ICON_SPEECH; + } + if (~this.options.actions.indexOf('search')) { + this.searchActionClass = CLASS_PLACEHOLDER; + this.searchActionSelector = SELECTOR_PLACEHOLDER; + } + } + this.init(); + }; + Input.prototype.init = function() { + this.initAction(); + this.initElementEvent(); + }; + Input.prototype.initAction = function() { + var self = this; + + var row = self.element.parentNode; + if (row) { + if (self.sliderActionClass) { + self.sliderAction = self.createAction(row, self.sliderActionClass, self.sliderActionSelector); + } else { + if (self.searchActionClass) { + self.searchAction = self.createAction(row, self.searchActionClass, self.searchActionSelector); + self.searchAction.addEventListener('tap', function(e) { + $.focus(self.element); + e.stopPropagation(); + }); + } + if (self.speechActionClass) { + self.speechAction = self.createAction(row, self.speechActionClass, self.speechActionSelector); + self.speechAction.addEventListener('click', $.stopPropagation); + self.speechAction.addEventListener('tap', function(event) { + self.speechActionClick(event); + }); + } + if (self.clearActionClass) { + self.clearAction = self.createAction(row, self.clearActionClass, self.clearActionSelector); + self.clearAction.addEventListener('tap', function(event) { + self.clearActionClick(event); + }); + + } + } + } + }; + Input.prototype.createAction = function(row, actionClass, actionSelector) { + var action = row.querySelector(actionSelector); + if (!action) { + var action = document.createElement('span'); + action.className = actionClass; + if (actionClass === this.searchActionClass) { + action.innerHTML = '' + this.element.getAttribute('placeholder'); + this.element.setAttribute('placeholder', ''); + } + row.insertBefore(action, this.element.nextSibling); + } + return action; + }; + Input.prototype.initElementEvent = function() { + var element = this.element; + + if (this.sliderActionClass) { + var tooltip = this.sliderAction; + //TODO resize + var offsetLeft = element.offsetLeft; + var width = element.offsetWidth - 28; + var tooltipWidth = tooltip.offsetWidth; + var distince = Math.abs(element.max - element.min); + + var timer = null; + var showTip = function() { + tooltip.classList.remove(CLASS_HIDDEN); + tooltipWidth = tooltipWidth || tooltip.offsetWidth; + var scaleWidth = Math.abs(element.value) / distince * width; + tooltip.style.left = (14 + offsetLeft + scaleWidth - tooltipWidth / 2) + 'px'; + tooltip.innerText = element.value; + if (timer) { + clearTimeout(timer); + } + timer = setTimeout(function() { + tooltip.classList.add(CLASS_HIDDEN); + }, 1000); + }; + element.addEventListener('input', showTip); + element.addEventListener('tap', showTip); + element.addEventListener('touchmove', function(e) { + e.stopPropagation(); + }); + } else { + if (this.clearActionClass) { + var action = this.clearAction; + if (!action) { + return; + } + $.each(['keyup', 'change', 'input', 'focus', 'blur', 'cut', 'paste'], function(index, type) { + (function(type) { + element.addEventListener(type, function() { + action.classList[element.value.trim() ? 'remove' : 'add'](CLASS_HIDDEN); + }); + })(type); + }); + } + if (this.searchActionClass) { + element.addEventListener('focus', function() { + element.parentNode.classList.add('mui-active'); + }); + element.addEventListener('blur', function() { + if (!element.value.trim()) { + element.parentNode.classList.remove('mui-active'); + } + }); + } + } + }; + Input.prototype.clearActionClick = function(event) { + var self = this; + self.element.value = ''; + $.focus(self.element); + self.clearAction.classList.add(CLASS_HIDDEN); + event.preventDefault(); + }; + Input.prototype.speechActionClick = function(event) { + if (window.plus) { + var self = this; + self.element.value = ''; + document.body.classList.add(CLASS_FOCUSIN); + plus.speech.startRecognize({ + engine: 'iFly' + }, function(s) { + self.element.value += s; + $.focus(self.element); + plus.speech.stopRecognize(); + $.trigger(self.element, 'recognized', { + value: self.element.value + }); + // document.body.classList.remove(CLASS_FOCUSIN); + }, function(e) { + document.body.classList.remove(CLASS_FOCUSIN); + }); + } else { + alert('only for 5+'); + } + event.preventDefault(); + }; + $.fn.input = function(options) { + this.each(function() { + var actions = []; + var row = findRow(this.parentNode); + if (this.type === 'range' && row.classList.contains('mui-input-range')) { + actions.push('slider'); + } else { + var classList = this.classList; + if (classList.contains('mui-input-clear')) { + actions.push('clear'); + } + if (classList.contains('mui-input-speech')) { + actions.push('speech'); + } + if (this.type === 'search' && row.classList.contains('mui-search')) { + actions.push('search'); + } + } + var id = this.getAttribute('data-input-' + actions[0]); + if (!id) { + id = ++$.uuid; + $.data[id] = new Input(this, { + actions: actions.join(',') + }); + for (var i = 0, len = actions.length; i < len; i++) { + this.setAttribute('data-input-' + actions[i], id); + } + } + + }); + }; + $.ready(function() { + $('.mui-input-row input').input(); + }); +})(mui, window, document); \ No newline at end of file diff --git a/examples/login/js/mui.locker.js b/examples/login/js/mui.locker.js new file mode 100644 index 00000000..dac9ea4a --- /dev/null +++ b/examples/login/js/mui.locker.js @@ -0,0 +1,262 @@ +/** + * 手势锁屏插件 + * varstion 1.0.4 + * by Houfeng + * Houfeng@DCloud.io + */ + +(function($, doc) { + + var touchSupport = ('ontouchstart' in document); + var startEventName = touchSupport ? 'touchstart' : 'mousedown'; + var moveEventName = touchSupport ? 'touchmove' : 'mousemove'; + var endEventName = touchSupport ? 'touchend' : 'mouseup'; + var lockerHolderClassName = $.className('locker-holder'); + var lockerClassName = $.className('locker'); + + var styleHolder = doc.querySelector('head') || doc.querySelector('body'); + styleHolder.innerHTML += ""; + + //定义 Locker 类 + var Locker = $.Locker = $.Class.extend({ + R: 26, + CW: 400, + CH: 320, + OffsetX: 30, + OffsetY: 30, + + /** + * 构造函数 + * */ + init: function(holder, options) { + var self = this; + if (!holder) { + throw "构造 Locker 时缺少容器元素"; + } + self.holder = holder; + self.options = options || {}; + self.options.callback = self.options.callback || self.options.done || $.noop; + self.holder.innerHTML = ''; + // + self.holder.classList.add(lockerHolderClassName); + //初始化 + var canvas = self.canvas = $.qsa('canvas', self.holder)[0]; + canvas.on = canvas.addEventListener || function(name, handler, capture) { + canvas.attachEvent('on' + name, handler, capture); + }; + canvas.off = canvas.removeEventListener || function(name, handler, capture) { + canvas.detachEvent('on' + name, handler, capture); + }; + if (self.options.width) self.holder.style.width = self.options.width + 'px'; + if (self.options.height) self.holder.style.height = self.options.height + 'px'; + canvas.width = self.CW = (options.width || canvas.offsetWidth); + canvas.height = self.CH = (options.height || canvas.offsetHeight); + var cxt = self.cxt = canvas.getContext("2d"); + //两个圆之间的外距离 就是说两个圆心的距离去除两个半径 + var X = (self.CW - 2 * self.OffsetX - self.R * 2 * 3) / 2; + var Y = (self.CH - 2 * self.OffsetY - self.R * 2 * 3) / 2; + self.pointLocationArr = self.caculateNinePointLotion(X, Y); + self.initEvent(canvas, cxt, self.holder); + self.draw(cxt, self.pointLocationArr, [], null); + }, + + /** + * 计算 + */ + caculateNinePointLotion: function(diffX, diffY) { + var self = this; + var Re = []; + for (var row = 0; row < 3; row++) { + for (var col = 0; col < 3; col++) { + var Point = { + X: (self.OffsetX + col * diffX + (col * 2 + 1) * self.R), + Y: (self.OffsetY + row * diffY + (row * 2 + 1) * self.R) + }; + Re.push(Point); + } + } + return Re; + }, + + /** + * 绘制 + */ + draw: function(cxt, _PointLocationArr, _LinePointArr, touchPoint) { + var self = this; + var R = self.R; + if (_LinePointArr.length > 0) { + cxt.beginPath(); + for (var i = 0; i < _LinePointArr.length; i++) { + var pointIndex = _LinePointArr[i]; + cxt.lineTo(_PointLocationArr[pointIndex].X, _PointLocationArr[pointIndex].Y); + } + cxt.lineWidth = 10; + cxt.strokeStyle = self.options.lineColor || "#999"; //连结线颜色 + cxt.stroke(); + cxt.closePath(); + if (touchPoint != null) { + var lastPointIndex = _LinePointArr[_LinePointArr.length - 1]; + var lastPoint = _PointLocationArr[lastPointIndex]; + cxt.beginPath(); + cxt.moveTo(lastPoint.X, lastPoint.Y); + cxt.lineTo(touchPoint.X, touchPoint.Y); + cxt.stroke(); + cxt.closePath(); + } + } + for (var i = 0; i < _PointLocationArr.length; i++) { + var Point = _PointLocationArr[i]; + cxt.fillStyle = self.options.ringColor || "#888"; //圆圈边框颜色 + cxt.beginPath(); + cxt.arc(Point.X, Point.Y, R, 0, Math.PI * 2, true); + cxt.closePath(); + cxt.fill(); + cxt.fillStyle = self.options.fillColor || "#f3f3f3"; //圆圈填充颜色 + cxt.beginPath(); + cxt.arc(Point.X, Point.Y, R - 3, 0, Math.PI * 2, true); + cxt.closePath(); + cxt.fill(); + if (_LinePointArr.indexOf(i) >= 0) { + cxt.fillStyle = self.options.pointColor || "#777"; //圆圈中心点颜色 + cxt.beginPath(); + cxt.arc(Point.X, Point.Y, R - 16, 0, Math.PI * 2, true); + cxt.closePath(); + cxt.fill(); + } + } + }, + + isPointSelect: function(touches, linePoint) { + var self = this; + for (var i = 0; i < self.pointLocationArr.length; i++) { + var currentPoint = self.pointLocationArr[i]; + var xdiff = Math.abs(currentPoint.X - touches.elementX); + var ydiff = Math.abs(currentPoint.Y - touches.elementY); + var dir = Math.pow((xdiff * xdiff + ydiff * ydiff), 0.5); + if (dir < self.R) { + if (linePoint.indexOf(i) < 0) { + linePoint.push(i); + } + break; + } + } + }, + + initEvent: function(canvas, cxt, holder) { + var self = this; + var linePoint = []; + var isDown = false; //针对鼠标事件 + //start + self._startHandler = function(e) { + e.point = event.changedTouches ? event.changedTouches[0] : event; + e.point.elementX = (e.point.pageX - holder.offsetLeft); + e.point.elementY = (e.point.pageY - holder.offsetTop); + self.isPointSelect(e.point, linePoint); + isDown = true; + }; + canvas.on(startEventName, self._startHandler, false); + //move + self._moveHanlder = function(e) { + if (!isDown) return; + e.preventDefault(); + e.point = event.changedTouches ? event.changedTouches[0] : event; + e.point.elementX = (e.point.pageX - holder.offsetLeft); + e.point.elementY = (e.point.pageY - holder.offsetTop); + var touches = e.point; + self.isPointSelect(touches, linePoint); + cxt.clearRect(0, 0, self.CW, self.CH); + self.draw(cxt, self.pointLocationArr, linePoint, { + X: touches.elementX, + Y: touches.elementY + }); + }; + canvas.on(moveEventName, self._moveHanlder, false); + //end + self._endHandler = function(e) { + e.point = event.changedTouches ? event.changedTouches[0] : event; + e.point.elementX = (e.point.pageX - holder.offsetLeft); + e.point.elementY = (e.point.pageY - holder.offsetTop); + cxt.clearRect(0, 0, self.CW, self.CH); + self.draw(cxt, self.pointLocationArr, linePoint, null); + //事件数据 + var eventData = { + sender: self, + points: linePoint + }; + /* + * 回调完成事件 + * + * 备注: + * 比较理想的做法是为 Locker 的实例启用事件机制,比如 locker.on('done',handler); + * 在 mui 没有完整的公共事件模块前,此版本中 locker 实例暂通过 options.callback 处理 + */ + self.options.callback(eventData); + //触发声明的DOM的自定义事件(暂定 done 为事件名,可以考虑更有针对的事件名 ) + $.trigger(self.holder, 'done', eventData); + //- + linePoint = []; + isDown = false; + }; + canvas.on(endEventName, self._endHandler, false); + }, + + pointLocationArr: [], + + /** + * 清除图形 + * */ + clear: function() { + var self = this; + //self.pointLocationArr = []; + if (self.cxt) { + self.cxt.clearRect(0, 0, self.CW, self.CH); + self.draw(self.cxt, self.pointLocationArr, [], { + X: 0, + Y: 0 + }); + } + }, + + /** + * 释放资源 + * */ + dispose: function() { + var self = this; + self.cxt = null; + self.canvas.off(startEventName, self._startHandler); + self.canvas.off(moveEventName, self._moveHandler); + self.canvas.off(endEventName, self._endHandler); + self.holder.innerHTML = ''; + self.canvas = null; + } + }); + + //添加 locker 插件 + $.fn.locker = function(options) { + //遍历选择的元素 + this.each(function(i, element) { + if (options) { + new Locker(element, options); + } else { + var optionsText = element.getAttribute('data-locker-options'); + var options = optionsText ? JSON.parse(optionsText) : {}; + options.lineColor = element.getAttribute('data-locker-line-color') || options.lineColor; + options.ringColor = element.getAttribute('data-locker-ring-color') || options.ringColor; + options.fillColor = element.getAttribute('data-locker-fill-color') || options.fillColor; + options.pointColor = element.getAttribute('data-locker-point-color') || options.pointColor; + options.width = element.getAttribute('data-locker-width') || options.width; + options.height = element.getAttribute('data-locker-height') || options.height; + new Locker(element, options); + } + }); + return this; + }; + + //自动处理 class='mui-locker' 的 dom + $.ready(function() { + setTimeout(function() { + $('.' + lockerClassName).locker(); + }, 200); + }); + +}(mui, document)); \ No newline at end of file diff --git a/examples/login/js/mui.min.js b/examples/login/js/mui.min.js new file mode 100644 index 00000000..ac9197fe --- /dev/null +++ b/examples/login/js/mui.min.js @@ -0,0 +1,8 @@ +/*! + * ===================================================== + * Mui v1.2.0 (https://github.com/dcloudio/mui) + * ===================================================== + */ +var mui=function(a,b){var c=/complete|loaded|interactive/,d=/^#([\w-]+)$/,e=/^\.([\w-]+)$/,f=/^[\w-]+$/,g=/translate(?:3d)?\((.+?)\)/,h=/matrix(3d)?\((.+?)\)/,i=function(b,c){if(c=c||a,!b)return j();if("object"==typeof b)return j([b],null);if("function"==typeof b)return i.ready(b);if("string"==typeof b)try{if(b=b.trim(),d.test(b)){var e=a.getElementById(RegExp.$1);return j(e?[e]:[])}return j(i.qsa(b,c),b)}catch(f){}return j()},j=function(a,b){return a=a||[],Object.setPrototypeOf(a,i.fn),a.selector=b||"",a};i.uuid=0,i.data={},i.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},j=1,k=arguments.length,l=!1;for("boolean"==typeof h&&(l=h,h=arguments[j]||{},j++),"object"==typeof h||i.isFunction(h)||(h={}),j===k&&(h=this,j--);k>j;j++)if(null!=(a=arguments[j]))for(c in a)d=h[c],e=a[c],h!==e&&(l&&e&&(i.isPlainObject(e)||(f=i.isArray(e)))?(f?(f=!1,g=d&&i.isArray(d)?d:[]):g=d&&i.isPlainObject(d)?d:{},h[c]=i.extend(l,g,e)):e!==b&&(h[c]=e));return h},i.noop=function(){},i.slice=[].slice,i.type=function(a){return null==a?String(a):k[{}.toString.call(a)]||"object"},i.isArray=Array.isArray||function(a){return a instanceof Array},i.isWindow=function(a){return null!=a&&a===a.window},i.isObject=function(a){return"object"===i.type(a)},i.isPlainObject=function(a){return i.isObject(a)&&!i.isWindow(a)&&Object.getPrototypeOf(a)===Object.prototype},i.isFunction=function(a){return"function"===i.type(a)},i.qsa=function(b,c){return c=c||a,i.slice.call(e.test(b)?c.getElementsByClassName(RegExp.$1):f.test(b)?c.getElementsByTagName(b):c.querySelectorAll(b))},i.ready=function(b){return c.test(a.readyState)?b(i):a.addEventListener("DOMContentLoaded",function(){b(i)},!1),this},i.map=function(a,b){var c,d,e,f=[];if("number"==typeof a.length)for(d=0,len=a.length;d0?[].concat.apply([],f):f},i.each=function(a,b){if(!a)return this;if("number"==typeof a.length)[].every.call(a,function(a,c){return b.call(a,c,a)!==!1});else for(var c in a)if(b.call(a[c],c,a[c])===!1)return a;return this},i.focus=function(a){i.os.ios?setTimeout(function(){a.focus()},10):a.focus()},i.trigger=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,cancelable:!0})),this},i.getStyles=function(a,b){var c=a.ownerDocument.defaultView.getComputedStyle(a,null);return b?c.getPropertyValue(b)||c[b]:c},i.parseTranslate=function(a,b){var c=a.match(g||"");return c&&c[1]||(c=["","0,0,0"]),c=c[1].split(","),c={x:parseFloat(c[0]),y:parseFloat(c[1]),z:parseFloat(c[2])},b&&c.hasOwnProperty(b)?c[b]:c},i.parseTranslateMatrix=function(a,b){var c=a.match(h),d=c&&c[1];c?(c=c[2].split(","),"3d"===d?c=c.slice(12,15):(c.push(0),c=c.slice(4,7))):c=[0,0,0];var e={x:parseFloat(c[0]),y:parseFloat(c[1]),z:parseFloat(c[2])};return b&&e.hasOwnProperty(b)?e[b]:e},i.registerHandler=function(a,b){var c=i[a];return c||(c=[]),b.index=b.index||1e3,c.push(b),c.sort(function(a,b){return a.index-b.index}),i[a]=c,i[a]};var k={};return i.each(["Boolean","Number","String","Function","Array","Date","RegExp","Object","Error"],function(a,b){k["[object "+b+"]"]=b.toLowerCase()}),window.JSON&&(i.parseJSON=JSON.parse),i.fn={each:function(a){return[].every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this}},i}(document);!function(a,b){function c(c){this.os={};var d=[function(){var a=c.match(/(Android);?[\s\/]+([\d.]+)?/);return a&&(this.os.android=!0,this.os.version=a[2],this.os.isBadAndroid=!/Chrome\/\d/.test(b.navigator.appVersion)),this.os.android===!0},function(){var a=c.match(/(iPhone\sOS)\s([\d_]+)/);if(a)this.os.ios=this.os.iphone=!0,this.os.version=a[2].replace(/_/g,".");else{var b=c.match(/(iPad).*OS\s([\d_]+)/);b&&(this.os.ios=this.os.ipad=!0,this.os.version=b[2].replace(/_/g,"."))}return this.os.ios===!0}];[].every.call(d,function(b){return!b.call(a)})}c.call(a,navigator.userAgent)}(mui,window),function(a){function b(a){this.os=this.os||{};var b=a.match(/Html5Plus/i);b&&(this.os.plus=!0)}b.call(a,navigator.userAgent)}(mui),function(a,b,c){a.targets={},a.targetHandles=[],a.registerTarget=function(b){return b.index=b.index||1e3,a.targetHandles.push(b),a.targetHandles.sort(function(a,b){return a.index-b.index}),a.targetHandles},b.addEventListener("touchstart",function(b){for(var d=b.target,e={};d&&d!==c;d=d.parentNode){var f=!1;if(a.each(a.targetHandles,function(c,g){var h=g.name;f||e[h]||!g.hasOwnProperty("handle")?e[h]||g.isReset!==!1&&(a.targets[h]=!1):(a.targets[h]=g.handle(b,d),a.targets[h]&&(e[h]=!0,g.isContinue!==!0&&(f=!0)))}),f)break}})}(mui,window,document),function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Object.setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a}}(),function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("Events"),d=!0;for(var e in b)"bubbles"===e?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),c}"undefined"==typeof window.CustomEvent&&(a.prototype=window.Event.prototype,window.CustomEvent=a)}(),function(a){"classList"in a.documentElement||!Object.defineProperty||"undefined"==typeof HTMLElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function a(a){return function(c){var d=b.className.split(/\s+/),e=d.indexOf(c);a(d,e,c),b.className=d.join(" ")}}var b=this,c={add:a(function(a,b,c){~b||a.push(c)}),remove:a(function(a,b){~b&&a.splice(b,1)}),toggle:a(function(a,b,c){~b?a.splice(b,1):a.push(c)}),contains:function(a){return!!~b.className.split(/\s+/).indexOf(a)},item:function(a){return b.className.split(/\s+/)[a]||null}};return Object.defineProperty(c,"length",{get:function(){return b.className.split(/\s+/).length}}),c}})}(document),function(a){if(!a.requestAnimationFrame){var b=0;a.requestAnimationFrame=a.webkitRequestAnimationFrame||function(c){var d=(new Date).getTime(),e=Math.max(0,16.7-(d-b)),f=a.setTimeout(function(){c(d+e)},e);return b=d+e,f},a.cancelAnimationFrame=a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame||function(a){clearTimeout(a)}}}(window),function(a,b,c){if(!b.FastClick){var d=function(a,b){return"LABEL"===b.tagName&&b.parentNode&&(b=b.parentNode.querySelector("input")),"radio"!==b.type&&"checkbox"!==b.type||b.disabled?!1:b};a.registerTarget({name:c,index:40,handle:d,target:!1});var e=function(c){var d=a.targets.click;if(d){var e,f;document.activeElement&&document.activeElement!==d&&document.activeElement.blur(),f=c.detail.gesture.changedTouches[0],e=document.createEvent("MouseEvents"),e.initMouseEvent("click",!0,!0,b,1,f.screenX,f.screenY,f.clientX,f.clientY,!1,!1,!1,!1,0,null),e.forwardedTouchEvent=!0,d.dispatchEvent(e)}};b.addEventListener("tap",e),b.addEventListener("doubletap",e),b.addEventListener("click",function(b){return a.targets.click&&!b.forwardedTouchEvent?(b.stopImmediatePropagation?b.stopImmediatePropagation():b.propagationStopped=!0,b.stopPropagation(),b.preventDefault(),!1):void 0},!0)}}(mui,window,"click"),function(a,b){a(function(){if(a.os.ios){var c="mui-focusin",d="mui-bar-tab",e="mui-bar-footer",f="mui-bar-footer-secondary",g="mui-bar-footer-secondary-tab";b.addEventListener("focusin",function(h){if(!(a.os.plus&&window.plus&&plus.webview.currentWebview().children().length>0)){var i=h.target;if(i.tagName&&"INPUT"===i.tagName&&"text"===i.type){b.body.classList.add(c);for(var j=!1;i&&i!==b;i=i.parentNode){var k=i.classList;if(k&&k.contains(d)||k.contains(e)||k.contains(f)||k.contains(g)){j=!0;break}}if(j){var l=b.body.scrollHeight,m=b.body.scrollLeft;setTimeout(function(){window.scrollTo(m,l)},20)}}}}),b.addEventListener("focusout",function(){var a=b.body.classList;a.contains(c)&&(a.remove(c),setTimeout(function(){window.scrollTo(b.body.scrollLeft,b.body.scrollTop)},20))})}})}(mui,document),function(a){a.namespace="mui",a.classNamePrefix=a.namespace+"-",a.classSelectorPrefix="."+a.classNamePrefix,a.className=function(b){return a.classNamePrefix+b},a.classSelector=function(b){return b.replace(/\./g,a.classSelectorPrefix)},a.eventName=function(b,c){return b+(a.namespace?"."+a.namespace:"")+(c?"."+c:"")}}(mui),function(a,b){a.EVENT_START="touchstart",a.EVENT_MOVE="touchmove",a.EVENT_END="touchend",a.EVENT_CANCEL="touchcancel",a.EVENT_CLICK="click",a.preventDefault=function(a){a.preventDefault()},a.stopPropagation=function(a){a.stopPropagation()},a.registerGesture=function(b){return a.registerHandler("gestures",b)};var c=function(a,b){var c=b.x-a.x,d=b.y-a.y;return Math.sqrt(c*c+d*d)},d=function(a,b){return 180*Math.atan2(b.y-a.y,b.x-a.x)/Math.PI},e=function(a){return-45>a&&a>-135?"up":a>=45&&135>a?"down":a>=135||-135>=a?"left":a>=-45&&45>=a?"right":null},f=function(b,c){a.gestures.stoped||a.each(a.gestures,function(d,e){a.gestures.stoped||a.options.gestureConfig[e.name]!==!1&&e.handle(b,c)})},g=function(b){a.gestures.stoped=!1;var c=Date.now(),d=b.touches?b.touches[0]:b;a.gestures.touch={target:b.target,lastTarget:a.gestures.touch&&a.gestures.touch.lastTarget?a.gestures.touch.lastTarget:null,startTime:c,touchTime:0,flickStartTime:c,lastTapTime:a.gestures.touch&&a.gestures.touch.lastTapTime?a.gestures.touch.lastTapTime:0,start:{x:d.pageX,y:d.pageY},flickStart:{x:d.pageX,y:d.pageY},flickDistanceX:0,flickDistanceY:0,move:{x:0,y:0},deltaX:0,deltaY:0,lastDeltaX:0,lastDeltaY:0,angle:"",direction:"",lockDirection:!1,startDirection:"",distance:0,drag:!1,swipe:!1,hold:!1,gesture:b},f(b,a.gestures.touch)},h=function(b){if(!a.gestures.stoped){var g=a.gestures.touch;if(b.target==g.target){var h=Date.now(),i=b.touches?b.touches[0]:b;g.touchTime=h-g.startTime,g.move={x:i.pageX,y:i.pageY},h-g.flickStartTime>300&&(g.flickStartTime=h,g.flickStart=g.move),g.distance=c(g.start,g.move),g.angle=d(g.start,g.move),g.direction=e(g.angle),g.lastDeltaX=g.deltaX,g.lastDeltaY=g.deltaY,g.deltaX=g.move.x-g.start.x,g.deltaY=g.move.y-g.start.y,g.gesture=b,f(b,g)}}},i=function(b){if(!a.gestures.stoped){var c=a.gestures.touch;if(b.target==c.target){var d=Date.now();c.touchTime=d-c.startTime,c.flickTime=d-c.flickStartTime,c.flickDistanceX=c.move.x-c.flickStart.x,c.flickDistanceY=c.move.y-c.flickStart.y,c.gesture=b,f(b,c)}}};b.addEventListener(a.EVENT_START,g),b.addEventListener(a.EVENT_MOVE,h),b.addEventListener(a.EVENT_END,i),b.addEventListener(a.EVENT_CANCEL,i),b.addEventListener(a.EVENT_CLICK,function(b){(a.targets.popover&&b.target===a.targets.popover||a.targets.tab||a.targets.offcanvas||a.targets.modal)&&b.preventDefault()},!0),a.fn.on=function(b,c,d){this.each(function(){var e=this;e.addEventListener(b,function(b){var f=a.qsa(c,e),g=b.target;if(f&&f.length>0)for(;g&&g!==document&&g!==e;g=g.parentNode)g&&~f.indexOf(g)&&(b.detail?b.detail.currentTarget=g:b.detail={currentTarget:g},d.call(g,b))}),e.removeEventListener(a.EVENT_CLICK,j),e.addEventListener(a.EVENT_CLICK,j)})};var j=function(a){var b=a.target&&a.target.tagName;"INPUT"!==b&&"TEXTAREA"!==b&&"SELECT"!==b&&a.preventDefault()};a.isScrolling=!1;var k=null;b.addEventListener("scroll",function(){a.isScrolling=!0,k&&clearTimeout(k),k=setTimeout(function(){a.isScrolling=!1},250)})}(mui,window),function(a,b){var c=function(c,d){if(c.type===a.EVENT_END||c.type===a.EVENT_CANCEL){var e=this.options;d.direction&&e.flickMaxTime>d.flickTime&&d.distance>e.flickMinDistince&&(d.flick=!0,a.trigger(c.target,b,d),a.trigger(c.target,b+d.direction,d))}};a.registerGesture({name:b,index:5,handle:c,options:{flickMaxTime:200,flickMinDistince:10}})}(mui,"flick"),function(a,b){var c=function(c,d){if(c.type===a.EVENT_END||c.type===a.EVENT_CANCEL){var e=this.options;d.direction&&e.swipeMaxTime>d.touchTime&&d.distance>e.swipeMinDistince&&(d.swipe=!0,a.trigger(c.target,b+d.direction,d))}};a.registerGesture({name:b,index:10,handle:c,options:{swipeMaxTime:300,swipeMinDistince:18}})}(mui,"swipe"),function(a,b){var c=function(c,d){switch(c.type){case a.EVENT_MOVE:d.direction&&(d.lockDirection&&d.startDirection&&d.startDirection&&d.startDirection!==d.direction&&(d.direction="up"===d.startDirection||"down"===d.startDirection?d.deltaY<0?"up":"down":d.deltaX<0?"left":"right"),d.drag||(d.drag=!0,a.trigger(c.target,b+"start",d)),a.trigger(c.target,b,d),a.trigger(c.target,b+d.direction,d));break;case a.EVENT_END:case a.EVENT_CANCEL:d.drag&&a.trigger(c.target,b+"end",d)}};a.registerGesture({name:b,index:20,handle:c,options:{}})}(mui,"drag"),function(a,b){var c=function(c,d){if(c.type===a.EVENT_END){var e=this.options;if(d.distancef.holdThreshold&&clearTimeout(c);break;case a.EVENT_END:case a.EVENT_CANCEL:clearTimeout(c)}};a.registerGesture({name:b,index:10,handle:d,options:{holdTimeout:500,holdThreshold:2}})}(mui,"longtap"),function(a,b){var c,d=function(d,e){var f=this.options;switch(d.type){case a.EVENT_START:clearTimeout(c),c=setTimeout(function(){e.hold=!0,a.trigger(d.target,b,e)},f.holdTimeout);break;case a.EVENT_MOVE:break;case a.EVENT_END:case a.EVENT_CANCEL:clearTimeout(c),a.options.gestureConfig.hold&&e.hold&&a.trigger(d.target,"release",e)}};a.registerGesture({name:b,index:10,handle:d,options:{holdTimeout:0}})}(mui,"hold"),function(a){a.global=a.options={gestureConfig:{tap:!0,doubletap:!1,longtap:!1,hold:!1,flick:!0,swipe:!0,drag:!0}},a.initGlobal=function(b){return a.options=a.extend(!0,a.global,b),this};var b={},c=!1;a.init=function(d){return c=!0,a.options=a.extend(!0,a.global,d||{}),a.ready(function(){a.each(a.inits,function(c,d){var e=!(b[d.name]&&!d.repeat);e&&(d.handle.call(a),b[d.name]=!0)})}),this},a.registerInit=function(b){return a.registerHandler("inits",b)},a(function(){var b=document.body.classList,c="";if(a.os.ios?(c="ios",b.add("mui-ios")):a.os.android&&(c="android",b.add("mui-android")),c&&a.os.version){var d="";a.each(a.os.version.split("."),function(e,f){d=d+(d?"-":"")+f,b.add(a.className(c+"-"+d))})}})}(mui),function(a){var b={swipeBack:!1,preloadPages:[],preloadLimit:10,keyEventBind:{backbutton:!0,menubutton:!0}},c={autoShow:!0,duration:a.os.ios?200:100,aniShow:"slide-in-right"};a.options.show&&(c=a.extend(!0,c,a.options.show)),a.currentWebview=null,a.isHomePage=!1,a.extend(!0,a.global,b),a.extend(!0,a.options,b),a.waitingOptions=function(b){return a.extend({autoShow:!0,title:""},b)},a.showOptions=function(b){return a.extend(c,b)},a.windowOptions=function(b){return a.extend({scalable:!1,bounce:""},b)},a.plusReady=function(a){return window.plus?a():document.addEventListener("plusready",function(){a()},!1),this},a.fire=function(a,b,c){a&&a.evalJS("typeof mui!=='undefined'&&mui.receive('"+b+"','"+JSON.stringify(c||{})+"')")},a.receive=function(b,c){b&&(c=JSON.parse(c),a.trigger(document,b,c))};var d=function(b){if(!b.preloaded){a.fire(b,"preload");for(var c=b.children(),d=0;da.options.preloadLimit){var h=a.data.preloads.shift(),i=a.webviews[h];i&&i.webview&&a.closeAll(i.webview),delete a.webviews[h]}}else c!==!1&&(d=plus.webview.create(b.url,e,a.windowOptions(b.styles),b.extras),b.subpages&&a.each(b.subpages,function(b,c){var e=plus.webview.create(c.url,c.id||c.url,a.windowOptions(c.styles),c.extras);d.append(e)}));return d}},a.preload=function(b){return b.preload||(b.preload=!0),a.createWindow(b)},a.closeOpened=function(b){var c=b.opened();if(c)for(var d=0,e=c.length;e>d;d++){var f=c[d],g=f.opened();g&&g.length>0?a.closeOpened(f):f.parent()!==b&&f.close("none")}},a.closeAll=function(b,c){a.closeOpened(b),c?b.close(c):b.close()},a.createWindows=function(b){a.each(b,function(b,c){a.createWindow(c,!1)})},a.appendWebview=function(b){if(window.plus){var c,d=b.id||b.url;return a.webviews[d]||(c=plus.webview.create(b.url,d,b.styles,b.extras),c.addEventListener("loaded",function(){plus.webview.currentWebview().append(c)}),a.webviews[d]=b),c}},a.webviews={},a.data.preloads=[],a.plusReady(function(){a.currentWebview=plus.webview.currentWebview()}),a.registerInit({name:"5+",index:100,handle:function(){var b=a.options,c=b.subpages||[];if(a.os.plus)a.plusReady(function(){a.each(c,function(b,c){a.appendWebview(c)}),plus.webview.currentWebview()===plus.webview.getWebviewById(plus.runtime.appid)&&(a.isHomePage=!0,setTimeout(function(){d(plus.webview.currentWebview())},300)),a.os.ios&&a.options.statusBarBackground&&plus.navigator.setStatusBarBackground(a.options.statusBarBackground),a.os.android&&parseFloat(a.os.version)<4.4&&null==plus.webview.currentWebview().parent()&&document.addEventListener("resume",function(){var a=document.body;a.style.display="none",setTimeout(function(){a.style.display=""},10)})});else if(c.length>0){var e=document.createElement("div");e.className="mui-error";var f=document.createElement("span");f.innerHTML="在该浏览器下,不支持创建子页面,具体参考",e.appendChild(f);var g=document.createElement("a");g.innerHTML='"mui框架适用场景"',g.href="http://ask.dcloud.net.cn/article/113",e.appendChild(g),document.body.appendChild(e),console.log("在该浏览器下,不支持创建子页面")}}}),window.addEventListener("preload",function(){var b=a.options.preloadPages||[];a.plusReady(function(){a.each(b,function(b,c){a.createWindow(a.extend(c,{preload:!0}))})})})}(mui),function(a,b){a.registerBack=function(b){return a.registerHandler("backs",b)},a.registerBack({name:"browser",index:100,handle:function(){return b.history.length>1?(b.history.back(),!0):!1}}),a.back=function(){("function"!=typeof a.options.beforeback||a.options.beforeback()!==!1)&&a.each(a.backs,function(a,b){return!b.handle()})},b.addEventListener("tap",function(){var b=a.targets.action;b&&b.classList.contains("mui-action-back")&&a.back()}),b.addEventListener("swiperight",function(b){var c=b.detail;a.options.swipeBack===!0&&Math.abs(c.angle)<3&&a.back()})}(mui,window),function(a,b){a.os.plus&&a.os.android&&a.registerBack({name:"mui",index:5,handle:function(){if(a.targets._popover)return a(a.targets._popover).popover("hide"),!0;var b=document.querySelector(".mui-off-canvas-wrap.mui-active");return b?(a(b).offCanvas("close"),!0):void 0}}),a.registerBack({name:"5+",index:10,handle:function(){if(!b.plus)return!1;var c=plus.webview.currentWebview(),d=c.parent();return d?d.evalJS("mui&&mui.back();"):c.canBack(function(d){if(d.canBack)b.history.back();else{var e=c.opener();e&&(c.preload?c.hide("auto"):a.closeAll(c))}}),!0}}),a.menu=function(){var c=document.querySelector(".mui-action-menu");if(c)a.trigger(c,"touchstart"),a.trigger(c,"tap");else if(b.plus){var d=a.currentWebview,e=d.parent();e&&e.evalJS("mui&&mui.menu();")}},a.registerInit({name:"keyEventBind",index:1e3,handle:function(){a.plusReady(function(){a.options.keyEventBind.backbutton&&plus.key.addEventListener("backbutton",a.back,!1),a.options.keyEventBind.menubutton&&plus.key.addEventListener("menubutton",a.menu,!1)})}})}(mui,window),function(a){a.registerInit({name:"pullrefresh",index:1e3,handle:function(){var b=a.options,c=b.pullRefresh||{},d=c.down&&c.down.hasOwnProperty("callback"),e=c.up&&c.up.hasOwnProperty("callback");if(d||e){var f=c.container;if(f){var g=a(f);1===g.length&&(a.os.plus&&a.os.android?a.plusReady(function(){var b=plus.webview.currentWebview();if(e){var f={};f.up=c.up,f.webviewId=b.id||b.getURL(),g.pullRefresh(f)}if(d){var h=b.parent(),i=b.id||b.getURL();if(h){e||g.pullRefresh({webviewId:i});var j={webviewId:i};j.down=a.extend({},c.down),j.down.callback="_CALLBACK",h.evalJS("mui&&mui(document.querySelector('.mui-content')).pullRefresh('"+JSON.stringify(j)+"')")}}}):g.pullRefresh(c))}}}})}(mui),function(a,b,c){var d="application/json",e="text/html",f=/)<[^<]*)*<\/script>/gi,g=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,i=/^\s*$/;a.ajaxSettings={type:"GET",beforeSend:a.noop,success:a.noop,error:a.noop,complete:a.noop,context:null,xhr:function(){return new b.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:d,xml:"application/xml, text/xml",html:e,text:"text/plain"},timeout:0,processData:!0,cache:!0};var j=function(a,b){var c=b.context;return b.beforeSend.call(c,a,b)===!1?!1:void 0},k=function(a,b,c){c.success.call(c.context,a,"success",b),m("success",b,c)},l=function(a,b,c,d){d.error.call(d.context,c,b,a),m(b,c,d)},m=function(a,b,c){c.complete.call(c.context,b,a)},n=function(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,i){f=a.type(i),e&&(c=d?e:e+"["+(h||"object"===f||"array"===f?c:"")+"]"),!e&&g?b.add(i.name,i.value):"array"===f||!d&&"object"===f?n(b,i,d,c):b.add(c,i)})},o=function(b){b.processData&&b.data&&"string"!=typeof b.data&&(b.data=a.param(b.data,b.traditional)),!b.data||b.type&&"GET"!==b.type.toUpperCase()||(b.url=p(b.url,b.data),b.data=c)},p=function(a,b){return""===b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")},q=function(a){return a&&(a=a.split(";",2)[0]),a&&(a===e?"html":a===d?"json":g.test(a)?"script":h.test(a)&&"xml")||"text"},r=function(b,d,e,f){return a.isFunction(d)&&(f=e,e=d,d=c),a.isFunction(e)||(f=e,e=c),{url:b,data:d,success:e,dataType:f}};a.ajax=function(d,e){"object"==typeof d&&(e=d,d=c);var f=e||{};f.url=d||f.url;for(var g in a.ajaxSettings)f[g]===c&&(f[g]=a.ajaxSettings[g]);o(f);var h=f.dataType;f.cache!==!1&&(e&&e.cache===!0||"script"!==h)||(f.url=p(f.url,"_="+Date.now()));var m,n=f.accepts[h],r={},s=function(a,b){r[a.toLowerCase()]=[a,b]},t=/^([\w-]+:)\/\//.test(f.url)?RegExp.$1:b.location.protocol,u=f.xhr(t),v=u.setRequestHeader;if(s("X-Requested-With","XMLHttpRequest"),s("Accept",n||"*/*"),(n=f.mimeType||n)&&(n.indexOf(",")>-1&&(n=n.split(",",2)[0]),u.overrideMimeType&&u.overrideMimeType(n)),(f.contentType||f.contentType!==!1&&f.data&&"GET"!==f.type.toUpperCase())&&s("Content-Type",f.contentType||"application/x-www-form-urlencoded"),f.headers)for(var w in f.headers)s(w,f.headers[w]);if(u.setRequestHeader=s,u.onreadystatechange=function(){if(4===u.readyState){u.onreadystatechange=a.noop,clearTimeout(m);var b,c=!1;if(u.status>=200&&u.status<300||304===u.status||0===u.status&&"file:"===t){h=h||q(f.mimeType||u.getResponseHeader("content-type")),b=u.responseText;try{"script"===h?(1,eval)(b):"xml"===h?b=u.responseXML:"json"===h&&(b=i.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?l(c,"parsererror",u,f):k(b,u,f)}else l(u.statusText||null,u.status?"error":"abort",u,f)}},j(u,f)===!1)return u.abort(),l(null,"abort",u,f),u;if(f.xhrFields)for(var w in f.xhrFields)u[w]=f.xhrFields[w];var x="async"in f?f.async:!0;u.open(f.type.toUpperCase(),f.url,x,f.username,f.password);for(var w in r)v.apply(u,r[w]);return f.timeout>0&&(m=setTimeout(function(){u.onreadystatechange=a.noop,u.abort(),l(null,"timeout",u,f)},f.timeout)),u.send(f.data?f.data:null),u},a.param=function(a,b){var c=[];return c.add=function(a,b){this.push(encodeURIComponent(a)+"="+encodeURIComponent(b))},n(c,a,b),c.join("&").replace(/%20/g,"+")},a.get=function(){return a.ajax(r.apply(null,arguments))},a.post=function(){var b=r.apply(null,arguments);return b.type="POST",a.ajax(b)},a.getJSON=function(){var b=r.apply(null,arguments);return b.dataType="json",a.ajax(b)},a.fn.load=function(b,c,d){if(!this.length)return this;var e,g=this,h=b.split(/\s/),i=r(b,c,d),j=i.success;return h.length>1&&(i.url=h[0],e=h[1]),i.success=function(a){if(e){var b=document.createElement("div");b.innerHTML=a.replace(f,"");var c=document.createElement("div"),d=b.querySelectorAll(e);if(d&&d.length>0)for(var h=0,i=d.length;i>h;h++)c.appendChild(d[h]);g[0].innerHTML=c.innerHTML}else g[0].innerHTML=a;j&&j.apply(g,arguments)},a.ajax(i),this}}(mui,window),function(a){a.plusReady(function(){a.ajaxSettings=a.extend(a.ajaxSettings,{xhr:function(a){return"file:"===a?new window.XMLHttpRequest:new plus.net.XMLHttpRequest}})})}(mui),function(a,b,c){a.offset=function(a){var d={top:0,left:0};return typeof a.getBoundingClientRect!==c&&(d=a.getBoundingClientRect()),{top:d.top+b.pageYOffset-a.clientTop,left:d.left+b.pageXOffset-a.clientLeft}}}(mui,window),function(a,b){a.scrollTo=function(a,c,d){c=c||1e3;var e=function(c){if(0>=c)return void(d&&d());var f=a-b.scrollY;setTimeout(function(){b.scrollTo(0,b.scrollY+f/c*10),e(c-10)},16.7)};e(c)},a.animationFrame=function(a){var b,c,d;return function(){b=arguments,d=this,c||(c=!0,requestAnimationFrame(function(){a.apply(d,b),c=!1}))}}}(mui,window),function(a){var b=!1,c=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,d=function(){};d.extend=function(a){function d(){!b&&this.init&&this.init.apply(this,arguments)}var e=this.prototype;b=!0;var f=new this;b=!1;for(var g in a)f[g]="function"==typeof a[g]&&"function"==typeof e[g]&&c.test(a[g])?function(a,b){return function(){var c=this._super;this._super=e[a];var d=b.apply(this,arguments);return this._super=c,d}}(g,a[g]):a[g];return d.prototype=f,d.prototype.constructor=d,d.extend=arguments.callee,d},a.Class=d}(mui),function(a,b){var c="mui-pull-top-pocket",d="mui-pull-bottom-pocket",e="mui-pull",f="mui-pull-loading",g="mui-pull-caption",h="mui-icon",i="mui-spinner",j="mui-icon-pulldown",k="mui-block",l="mui-hidden",m="mui-visibility",n=f+" "+h+" "+j,o=f+" "+h+" "+j,p=f+" "+h+" "+i,q=['
','
','
{contentrefresh}
',"
"].join(""),r={init:function(b,c){this._super(b,a.extend(!0,{scrollY:!0,scrollX:!1,indicators:!0,down:{height:50,contentdown:"下拉可以刷新",contentover:"释放立即刷新",contentrefresh:"正在刷新..."},up:{height:50,contentdown:"上拉显示更多",contentrefresh:"正在加载...",contentnomore:"没有更多数据了",duration:300}},c))},_init:function(){this._super(),this._initPocket()},_initPulldownRefresh:function(){this.pulldown=!0,this.pullPocket=this.topPocket,this.pullPocket.classList.add(k),this.pullPocket.classList.add(m),this.pullCaption=this.topCaption,this.pullLoading=this.topLoading},_initPullupRefresh:function(){this.pulldown=!1,this.pullPocket=this.bottomPocket,this.pullPocket.classList.add(k),this.pullPocket.classList.add(m),this.pullCaption=this.bottomCaption,this.pullLoading=this.bottomLoading},_initPocket:function(){var a=this.options;a.down&&a.down.hasOwnProperty("callback")&&(this.topPocket=this.scroller.querySelector("."+c),this.topPocket||(this.topPocket=this._createPocket(c,a.down,o),this.wrapper.insertBefore(this.topPocket,this.wrapper.firstChild)),this.topLoading=this.topPocket.querySelector("."+f),this.topCaption=this.topPocket.querySelector("."+g)),a.up&&a.up.hasOwnProperty("callback")&&(this.bottomPocket=this.scroller.querySelector("."+d),this.bottomPocket||(this.bottomPocket=this._createPocket(d,a.up,p),this.scroller.appendChild(this.bottomPocket)),this.bottomLoading=this.bottomPocket.querySelector("."+f),this.bottomCaption=this.bottomPocket.querySelector("."+g),this.wrapper.addEventListener("scrollbottom",this))},_createPocket:function(a,c,d){var e=b.createElement("div");return e.className=a,e.innerHTML=q.replace("{contentrefresh}",c.contentrefresh).replace("{icon}",d),e},_resetPullDownLoading:function(){var a=this.pullLoading;a&&(this.pullCaption.innerHTML=this.options.down.contentdown,a.style.webkitTransition="",a.style.webkitTransform="",a.style.webkitAnimation="",a.className=o)},_setCaption:function(a,b){if(!this.loading){var c=this.options,d=this.pullPocket,e=this.pullCaption,f=this.pullLoading,g=this.pulldown;d&&(b?setTimeout(function(){e.innerHTML=a,f.className=g?o:p,f.style.webkitAnimation="",f.style.webkitTransition="",f.style.webkitTransform=""},100):a!==this.lastTitle&&(e.innerHTML=a,g?a===c.down.contentrefresh?(f.className=p,f.style.webkitAnimation="spinner-spin 1s step-end infinite"):a===c.down.contentover?(f.className=n,f.style.webkitTransition="-webkit-transform 0.3s ease-in",f.style.webkitTransform="rotate(180deg)"):a===c.down.contentdown&&(f.className=o,f.style.webkitTransition="-webkit-transform 0.3s ease-in",f.style.webkitTransform="rotate(0deg)"):f.className=a===c.up.contentrefresh?p+" "+m:p+" "+l,this.lastTitle=a))}}};a.PullRefresh=r}(mui,document),function(a,b,c,d){var e="mui-scrollbar",f="mui-scrollbar-indicator",g=e+"-vertical",h=e+"-horizontal",i="mui-active",j={quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(a){return a*(2-a)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(a){return Math.sqrt(1- --a*a)}}},k=a.Class.extend({init:function(b,c){this.wrapper=this.element=b,this.scroller=this.wrapper.children[0],this.scrollerStyle=this.scroller&&this.scroller.style,this.stopped=!1,this.options=a.extend(!0,{scrollY:!0,scrollX:!1,startX:0,startY:0,indicators:!0,stopPropagation:!1,hardwareAccelerated:!0,fixedBadAndorid:!1,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},momentum:!0,snap:!1,bounce:!0,bounceTime:300,bounceEasing:j.circular.style,directionLockThreshold:5,parallaxElement:!1,parallaxRatio:.5},c),this.x=0,this.y=0,this.translateZ=this.options.hardwareAccelerated?" translateZ(0)":"",this._init(),this.scroller&&(this.refresh(),this.scrollTo(this.options.startX,this.options.startY))},_init:function(){this._initParallax(),this._initIndicators(),this._initEvent()},_initParallax:function(){this.options.parallaxElement&&(this.parallaxElement=c.querySelector(this.options.parallaxElement),this.parallaxStyle=this.parallaxElement.style,this.parallaxHeight=this.parallaxElement.offsetHeight,this.parallaxImgStyle=this.parallaxElement.querySelector("img").style)},_initIndicators:function(){var a=this;if(a.indicators=[],this.options.indicators){var b,c=[];a.options.scrollY&&(b={el:this._createScrollBar(g),listenX:!1},this.wrapper.appendChild(b.el),c.push(b)),this.options.scrollX&&(b={el:this._createScrollBar(h),listenY:!1},this.wrapper.appendChild(b.el),c.push(b));for(var d=c.length;d--;)this.indicators.push(new l(this,c[d]));this.wrapper.addEventListener("scrollend",function(){a.indicators.map(function(a){a.fade()})}),this.wrapper.addEventListener("scrollstart",function(){a.indicators.map(function(a){a.fade(1)})}),this.wrapper.addEventListener("refresh",function(){a.indicators.map(function(a){a.refresh() +})})}},_initSnap:function(){this.currentPage={},this.pages=[];for(var a=this.snaps,b=a.length,c=0,d=-1,e=0,f=0,g=0;b>g;g++){var h=a[g],j=h.offsetLeft,k=h.offsetWidth;(0===g||j<=a[g-1].offsetLeft)&&(c=0,d++),this.pages[c]||(this.pages[c]=[]),e=this._getSnapX(j),f=e-Math.round(k/2),this.pages[c][d]={x:e,cx:f,pageX:c,element:h},h.classList.contains(i)&&(this.currentPage=this.pages[c][0]),e>=this.maxScrollX&&c++}this.options.startX=this.currentPage.x||0},_getSnapX:function(a){return Math.max(Math.min(0,-a+this.wrapperWidth/2),this.maxScrollX)},_gotoPage:function(a){this.currentPage=this.pages[Math.min(a,this.pages.length-1)][0];for(var b=0,c=this.snaps.length;c>b;b++)b===a?this.snaps[b].classList.add(i):this.snaps[b].classList.remove(i);this.scrollTo(this.currentPage.x,0,this.options.bounceTime)},_nearestSnap:function(a){if(!this.pages.length)return{x:0,pageX:0};var b=0,c=this.pages.length;for(a>0?a=0:ab;b++)if(a>=this.pages[b][0].cx)return this.pages[b][0];return{x:0,pageX:0}},_initEvent:function(){b.addEventListener("orientationchange",this),b.addEventListener("resize",this),this.scroller.addEventListener("webkitTransitionEnd",this),this.wrapper.addEventListener("touchstart",this),this.wrapper.addEventListener("touchcancel",this),this.wrapper.addEventListener("touchend",this),this.wrapper.addEventListener("drag",this),this.wrapper.addEventListener("dragend",this),this.wrapper.addEventListener("flick",this),this.wrapper.addEventListener("scrollend",this),this.options.scrollX&&this.wrapper.addEventListener("swiperight",this);var c=this.wrapper.querySelector(".mui-segmented-control");c&&mui(c).on("click","a",a.preventDefault)},handleEvent:function(a){if(this.stopped)return void this.resetPosition();switch(a.type){case"touchstart":this._start(a);break;case"drag":this.options.stopPropagation&&a.stopPropagation(),this._drag(a);break;case"dragend":case"flick":this.options.stopPropagation&&a.stopPropagation(),this._flick(a);break;case"touchcancel":case"touchend":this._end(a);break;case"webkitTransitionEnd":this._transitionEnd(a);break;case"scrollend":this._scrollend(a);break;case"orientationchange":case"resize":this._resize();break;case"swiperight":a.stopPropagation()}},_start:function(b){if(this.moved=this.needReset=!1,this._transitionTime(),this.isInTransition){this.needReset=!0,this.isInTransition=!1;var c=a.parseTranslateMatrix(a.getStyles(this.scroller,"webkitTransform"));this.setTranslate(Math.round(c.x),Math.round(c.y)),this.resetPosition(),a.trigger(this.wrapper,"scrollend",this),b.preventDefault()}this.reLayout(),a.trigger(this.wrapper,"beforescrollstart",this)},_getDirectionByAngle:function(a){return-80>a&&a>-100?"up":a>=80&&100>a?"down":a>=170||-170>=a?"left":a>=-35&&10>=a?"right":null},_drag:function(c){var d=c.detail;if((this.options.scrollY||"up"===d.direction||"down"===d.direction)&&a.os.ios&&parseFloat(a.os.version)>=8){var e=d.gesture.touches[0].clientY;if(e+10>b.innerHeight||10>e)return void this.resetPosition(this.options.bounceTime)}var f=isReturn=!1,g=this._getDirectionByAngle(d.angle);if("left"===d.direction||"right"===d.direction?this.options.scrollX?(f=!0,this.moved||("left"!==g&&"right"!==g?isReturn=!0:(a.gestures.touch.lockDirection=!0,a.gestures.touch.startDirection=d.direction))):this.options.scrollY&&!this.moved&&(isReturn=!0):"up"===d.direction||"down"===d.direction?this.options.scrollY?(f=!0,this.moved||(a.gestures.touch.lockDirection=!0,a.gestures.touch.startDirection=d.direction)):this.options.scrollX&&!this.moved&&(isReturn=!0):isReturn=!0,f&&(c.stopPropagation(),d.gesture&&d.gesture.preventDefault()),!isReturn){this.moved?c.stopPropagation():a.trigger(this.wrapper,"scrollstart",this);var h=0,i=0;this.moved?(h=d.deltaX-d.lastDeltaX,i=d.deltaY-d.lastDeltaY):(h=d.deltaX,i=d.deltaY);var j=Math.abs(d.deltaX),k=Math.abs(d.deltaY);j>k+this.options.directionLockThreshold?i=0:k>=j+this.options.directionLockThreshold&&(h=0),h=this.hasHorizontalScroll?h:0,i=this.hasVerticalScroll?i:0;var l=this.x+h,m=this.y+i;(l>0||l0?0:this.maxScrollX),(m>0||m0?0:this.maxScrollY),this.requestAnimationFrame||this._updateTranslate(),this.moved=!0,this.x=l,this.y=m,a.trigger(this.wrapper,"scroll",this)}},_flick:function(b){if(this.moved){b.stopPropagation();var c=b.detail;if(this._clearRequestAnimationFrame(),"dragend"!==b.type||!c.flick){var d=Math.round(this.x),e=Math.round(this.y);if(this.isInTransition=!1,!this.resetPosition(this.options.bounceTime)){if(this.scrollTo(d,e),"dragend"===b.type)return void a.trigger(this.wrapper,"scrollend",this);var f=0,g="";return this.options.momentum&&c.flickTime<300&&(momentumX=this.hasHorizontalScroll?this._momentum(this.x,c.flickDistanceX,c.flickTime,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:d,duration:0},momentumY=this.hasVerticalScroll?this._momentum(this.y,c.flickDistanceY,c.flickTime,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:e,duration:0},d=momentumX.destination,e=momentumY.destination,f=Math.max(momentumX.duration,momentumY.duration),this.isInTransition=!0),d!=this.x||e!=this.y?((d>0||d0||e0&&this.y<=this.maxScrollY&&a.trigger(this.wrapper,"scrollbottom",this)},_resize:function(){var a=this;clearTimeout(a.resizeTimeout),a.resizeTimeout=setTimeout(function(){a.refresh()},a.options.resizePolling)},_transitionTime:function(b){if(b=b||0,this.scrollerStyle.webkitTransitionDuration=b+"ms",this.parallaxElement&&this.options.scrollY&&(this.parallaxStyle.webkitTransitionDuration=b+"ms"),this.options.fixedBadAndorid&&!b&&a.os.isBadAndroid&&(this.scrollerStyle.webkitTransitionDuration="0.001s",this.parallaxElement&&this.options.scrollY&&(this.parallaxStyle.webkitTransitionDuration="0.001s")),this.indicators)for(var c=this.indicators.length;c--;)this.indicators[c].transitionTime(b)},_transitionTimingFunction:function(a){if(this.scrollerStyle.webkitTransitionTimingFunction=a,this.parallaxElement&&this.options.scrollY&&(this.parallaxStyle.webkitTransitionDuration=a),this.indicators)for(var b=this.indicators.length;b--;)this.indicators[b].transitionTimingFunction(a)},_translate:function(a,b){this.x=a,this.y=b},_clearRequestAnimationFrame:function(){this.requestAnimationFrame&&(cancelAnimationFrame(this.requestAnimationFrame),this.requestAnimationFrame=null)},_updateTranslate:function(){var a=this;(a.x!==a.lastX||a.y!==a.lastY)&&a.setTranslate(a.x,a.y),a.requestAnimationFrame=requestAnimationFrame(function(){a._updateTranslate()})},_createScrollBar:function(a){var b=c.createElement("div"),d=c.createElement("div");return b.className=e+" "+a,d.className=f,b.appendChild(d),a===g?(this.scrollbarY=b,this.scrollbarIndicatorY=d):a===h&&(this.scrollbarX=b,this.scrollbarIndicatorX=d),this.wrapper.appendChild(b),b},_preventDefaultException:function(a,b){for(var c in b)if(b[c].test(a[c]))return!0;return!1},_reLayout:function(){if(this.hasHorizontalScroll||(this.maxScrollX=0,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=0,this.scrollerHeight=this.wrapperHeight),this.indicators.map(function(a){a.refresh()}),this.options.snap&&"string"==typeof this.options.snap){var a=this.scroller.querySelectorAll(this.options.snap);this.itemLength=0,this.snaps=[];for(var b=0,c=a.length;c>b;b++){var d=a[b];d.parentNode===this.scroller&&(this.itemLength++,this.snaps.push(d))}this._initSnap()}},_momentum:function(a,b,c,e,f,g){var h,i,j=parseFloat(Math.abs(b)/c);return g=g===d?6e-4:g,h=a+j*j/(2*g)*(0>b?-1:1),i=j/g,e>h?(h=f?e-f/2.5*(j/8):e,b=Math.abs(h-a),i=b/j):h>0&&(h=f?f/2.5*(j/8):0,b=Math.abs(a)+h,i=b/j),{destination:Math.round(h),duration:i}},_getTranslateStr:function(a,b){return this.options.hardwareAccelerated?"translate3d("+a+"px,"+b+"px,0px) "+this.translateZ:"translate("+a+"px,"+b+"px) "},setStopped:function(a){this.stopped=!!a},setTranslate:function(a,b){if(this.x=a,this.y=b,this.scrollerStyle.webkitTransform=this._getTranslateStr(a,b),this.parallaxElement&&this.options.scrollY){var c=b*this.options.parallaxRatio,d=1+c/((this.parallaxHeight-c)/2);d>1?(this.parallaxImgStyle.opacity=1-c/100*this.options.parallaxRatio,this.parallaxStyle.webkitTransform=this._getTranslateStr(0,-c)+" scale("+d+","+d+")"):(this.parallaxImgStyle.opacity=1,this.parallaxStyle.webkitTransform=this._getTranslateStr(0,-10)+" scale(1,1)")}if(this.indicators)for(var e=this.indicators.length;e--;)this.indicators[e].updatePosition();this.lastX=this.x,this.lastY=this.y},reLayout:function(){this.wrapper.offsetHeight;var b=parseFloat(a.getStyles(this.wrapper,"padding-left"))||0,c=parseFloat(a.getStyles(this.wrapper,"padding-right"))||0,d=parseFloat(a.getStyles(this.wrapper,"padding-top"))||0,e=parseFloat(a.getStyles(this.wrapper,"padding-bottom"))||0,f=this.wrapper.clientWidth,g=this.wrapper.clientHeight;this.scrollerWidth=this.scroller.offsetWidth,this.scrollerHeight=this.scroller.offsetHeight,this.wrapperWidth=f-b-c,this.wrapperHeight=g-d-e,this.maxScrollX=Math.min(this.wrapperWidth-this.scrollerWidth,0),this.maxScrollY=Math.min(this.wrapperHeight-this.scrollerHeight,0),this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0,this._reLayout()},resetPosition:function(a){var b=this.x,c=this.y;return a=a||0,!this.hasHorizontalScroll||this.x>0?b=0:this.x0?c=0:this.y0&&(this.lastX!=a||this.lastY!=b),this.isInTransition?(this._clearRequestAnimationFrame(),this._transitionTimingFunction(d.style),this._transitionTime(c),this.setTranslate(a,b)):this.setTranslate(a,b)},scrollToBottom:function(a,b){a=a||this.options.bounceTime,this.scrollTo(0,this.maxScrollY,a,b)},gotoPage:function(a){this._gotoPage(a)}}),l=function(b,d){this.wrapper="string"==typeof d.el?c.querySelector(d.el):d.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=b,this.options=a.extend({listenX:!0,listenY:!0,fade:!1,speedRatioX:0,speedRatioY:0},d),this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.options.fade&&(this.wrapperStyle.webkitTransform=this.scroller.translateZ,this.wrapperStyle.webkitTransitionDuration=this.options.fixedBadAndorid&&a.os.isBadAndroid?"0.001s":"0ms",this.wrapperStyle.opacity="0")};l.prototype={handleEvent:function(){},transitionTime:function(b){b=b||0,this.indicatorStyle.webkitTransitionDuration=b+"ms",this.scroller.options.fixedBadAndorid&&!b&&a.os.isBadAndroid&&(this.indicatorStyle.webkitTransitionDuration="0.001s")},transitionTimingFunction:function(a){this.indicatorStyle.webkitTransitionTimingFunction=a},refresh:function(){this.transitionTime(),this.indicatorStyle.display=this.options.listenX&&!this.options.listenY?this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.scroller.hasVerticalScroll?"block":"none":this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none",this.wrapper.offsetHeight,this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.indicatorWidth=Math.max(Math.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px",this.maxPosX=this.wrapperWidth-this.indicatorWidth,this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX,this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX),this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.indicatorHeight=Math.max(Math.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px",this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY),this.updatePosition()},updatePosition:function(){var a=this.options.listenX&&Math.round(this.sizeRatioX*this.scroller.x)||0,b=this.options.listenY&&Math.round(this.sizeRatioY*this.scroller.y)||0;athis.maxBoundaryX?(this.width=Math.max(this.indicatorWidth-(a-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",a=this.maxPosX+this.indicatorWidth-this.width):this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),bthis.maxBoundaryY?(this.height=Math.max(this.indicatorHeight-3*(b-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",b=this.maxPosY+this.indicatorHeight-this.height):this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px"),this.x=a,this.y=b,this.indicatorStyle.webkitTransform=this.scroller._getTranslateStr(a,b)},fade:function(a,b){if(!b||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var c=a?250:500,d=a?0:300;a=a?"1":"0",this.wrapperStyle.webkitTransitionDuration=c+"ms",this.fadeTimeout=setTimeout(function(a){this.wrapperStyle.opacity=a,this.visible=+a}.bind(this,a),d)}}},a.Scroll=k,a.fn.scroll=function(b){var c=[];return this.each(function(){var d=null,e=this,f=e.getAttribute("data-scroll");if(f)d=a.data[f];else{f=++a.uuid;var g=a.extend({},b);e.classList.contains("mui-segmented-control")&&(g=a.extend(g,{scrollY:!1,scrollX:!0,indicators:!1,snap:".mui-control-item"})),a.data[f]=d=new k(e,g),e.setAttribute("data-scroll",f)}c.push(d)}),1===c.length?c[0]:c}}(mui,window,document),function(a){var b="mui-visibility",c=a.Scroll.extend(a.extend({handleEvent:function(a){this._super(a),"scrollbottom"===a.type&&this._scrollbottom()},_scrollbottom:function(){this.pulldown||this.loading||(this.pulldown=!1,this._initPullupRefresh(),this.pullupLoading())},_start:function(a){this.loading||(this.pulldown=this.pullPocket=this.pullCaption=this.pullLoading=!1),this._super(a)},_drag:function(a){this._super(a),!this.pulldown&&!this.loading&&this.topPocket&&"down"===a.detail.direction&&this.y>=0&&this._initPulldownRefresh(),this.pulldown&&this._setCaption(this.y>this.options.down.height?this.options.down.contentover:this.options.down.contentdown)},_reLayout:function(){this.hasVerticalScroll=!0,this._super()},resetPosition:function(a){return this.pulldown&&this.y>=this.options.down.height?(this.pulldownLoading(0,a||0),!0):this._super(a)},pulldownLoading:function(a,b){if(a=a||0,this.scrollTo(a,this.options.down.height,b,this.options.bounceEasing),!this.loading){this.pulldown||this._initPulldownRefresh(),this._setCaption(this.options.down.contentrefresh),this.loading=!0,this.indicators.map(function(a){a.fade(0)});var c=this.options.down.callback;c&&c.call(this)}},endPulldownToRefresh:function(){var a=this;a.topPocket&&a.loading&&this.pulldown&&(a.scrollTo(0,0,a.options.bounceTime,a.options.bounceEasing),a.loading=!1,a._setCaption(a.options.down.contentdown,!0),setTimeout(function(){a.loading||a.topPocket.classList.remove(b)},350))},pullupLoading:function(a,b,c){b=b||0,this.scrollTo(b,this.maxScrollY,c,this.options.bounceEasing),this.loading||(this._initPullupRefresh(),this._setCaption(this.options.up.contentrefresh),this.indicators.map(function(a){a.fade(0)}),this.loading=!0,a=a||this.options.up.callback,a&&a.call(this))},endPullupToRefresh:function(a){var c=this;c.bottomPocket&&c.loading&&!this.pulldown&&(c.loading=!1,a?(c._setCaption(c.options.up.contentnomore),c.wrapper.removeEventListener("scrollbottom",c)):(c._setCaption(c.options.up.contentdown),setTimeout(function(){c.loading||c.bottomPocket.classList.remove(b)},350)))},refresh:function(a){a&&this.wrapper.addEventListener("scrollbottom",this),this._super()}},a.PullRefresh));a.fn.pullRefresh=function(b){if(1===this.length){var d=this[0],e=null,f=d.getAttribute("data-pullrefresh");return f?e=a.data[f]:(f=++a.uuid,a.data[f]=e=new c(d,b),d.setAttribute("data-pullrefresh",f)),e}}}(mui,window,document),function(a,b){var c="mui-slider",d="mui-slider-group",e="mui-slider-loop",f="mui-slider-indicator",g="mui-action-previous",h="mui-action-next",i="mui-slider-item",j="mui-active",k="."+i,l="."+f,m=".mui-slider-progress-bar",n=a.Scroll.extend({init:function(b,c){this._super(b,a.extend(!0,{interval:0,scrollY:!1,scrollX:!0,indicators:!1,bounceTime:200,startX:!1,snap:k},c)),this.options.startX},_init:function(){for(var a=this.wrapper.querySelectorAll("."+d),b=0,c=a.length;c>b;b++)if(a[b].parentNode===this.wrapper){this.scroller=a[b];break}this.scroller&&(this.scrollerStyle=this.scroller.style,this.progressBar=this.wrapper.querySelector(m),this.progressBar&&(this.progressBarWidth=this.progressBar.offsetWidth,this.progressBarStyle=this.progressBar.style),this._super(),this._initTimer())},_initEvent:function(){var b=this;b._super(),b.wrapper.addEventListener("swiperight",a.stopPropagation),b.wrapper.addEventListener("scrollend",function(){b.isInTransition=!1;var c=(b.currentPage,b.slideNumber);b.slideNumber=b._fixedSlideNumber(),b.loop&&(0===b.slideNumber?b.setTranslate(b.pages[1][0].x,0):b.slideNumber===b.itemLength-3&&b.setTranslate(b.pages[b.itemLength-2][0].x,0)),c!=b.slideNumber&&a.trigger(b.wrapper,"slide",{slideNumber:b.slideNumber})}),b.wrapper.addEventListener("slide",function(c){if(c.target===b.wrapper){var d=c.detail;d.slideNumber=d.slideNumber||0;var e=b.scroller.querySelectorAll(k),f=d.slideNumber;if(b.loop&&(f+=1),!b.wrapper.classList.contains("mui-segmented-control"))for(var g=0,h=e.length;h>g;g++){var i=e[g];i.parentNode===b.scroller&&(g===f?i.classList.add(j):i.classList.remove(j))}var l=b.wrapper.querySelector(".mui-slider-indicator");if(l){l.getAttribute("data-scroll")&&a(l).scroll().gotoPage(d.slideNumber);var m=l.querySelectorAll(".mui-indicator");if(m.length>0)for(var g=0,h=m.length;h>g;g++)m[g].classList[g===d.slideNumber?"add":"remove"](j);else{var n=l.querySelector(".mui-number span");if(n)n.innerText=d.slideNumber+1;else for(var o=b.wrapper.querySelectorAll(".mui-control-item"),g=0,h=o.length;h>g;g++)o[g].classList[g===d.slideNumber?"add":"remove"](j)}}c.stopPropagation()}}),b.wrapper.addEventListener(a.eventName("shown","tab"),function(a){b.gotoItem(a.detail.tabNumber||0,b.options.bounceTime)});var c=b.wrapper.querySelector(l);c&&c.addEventListener("tap",function(a){var c=a.target;(c.classList.contains(g)||c.classList.contains(h))&&(b[c.classList.contains(g)?"prevItem":"nextItem"](),a.stopPropagation())})},_drag:function(a){this._super(a);var b=a.detail.direction;("left"===b||"right"===b)&&a.stopPropagation()},_initTimer:function(){var a=this,c=a.wrapper,d=a.options.interval,e=c.getAttribute("data-slidershowTimer");e&&b.clearTimeout(e),d&&(e=b.setTimeout(function(){c&&((c.offsetWidth||c.offsetHeight)&&a.nextItem(!0),a._initTimer())},d),c.setAttribute("data-slidershowTimer",e))},_fixedSlideNumber:function(a){a=a||this.currentPage;var b=a.pageX;return this.loop&&(b=0===a.pageX?this.itemLength-3:a.pageX===this.itemLength-1?0:a.pageX-1),b},_reLayout:function(){this.hasHorizontalScroll=!0,this.loop=this.scroller.classList.contains(e),this._super()},_getScroll:function(){var b=a.parseTranslateMatrix(a.getStyles(this.scroller,"webkitTransform"));return b?b.x:0},_transitionEnd:function(b){b.target===this.scroller&&this.isInTransition&&(this._transitionTime(),this.isInTransition=!1,a.trigger(this.wrapper,"scrollend",this))},_flick:function(a){if(this.moved){var b=a.detail,c=b.direction;this._clearRequestAnimationFrame(),this.isInTransition=!0,"flick"===a.type?(b.touchTime<200&&(this.x=this._getPage(this.slideNumber+("right"===c?-1:1),!0).x),this.resetPosition(this.options.bounceTime)):"dragend"!==a.type||b.flick||this.resetPosition(this.options.bounceTime),a.stopPropagation()}},_initSnap:function(){if(this.scrollerWidth=this.itemLength*this.scrollerWidth,this.maxScrollX=Math.min(this.wrapperWidth-this.scrollerWidth,0),this._super(),this.currentPage.x)this.slideNumber=this._fixedSlideNumber();else{var a=this.pages[this.loop?1:0];if(a=a||this.pages[0],!a)return;this.currentPage=a[0],this.slideNumber=0}this.options.startX=this.currentPage.x||0},_getSnapX:function(a){return Math.max(-a,this.maxScrollX)},_getPage:function(a,b){return this.loop?a>this.itemLength-(b?2:3)?(a=1,time=0):(b?-1:0)>a?(a=this.itemLength-2,time=0):a+=1:(b||(a>this.itemLength-1?(a=0,time=0):0>a&&(a=this.itemLength-1,time=0)),a=Math.min(Math.max(0,a),this.itemLength-1)),this.pages[a][0]},_gotoItem:function(b,c){this.currentPage=this._getPage(b),this.scrollTo(this.currentPage.x,0,c,this.options.bounceEasing),0===c&&a.trigger(this.wrapper,"scrollend",this),this._initTimer()},setTranslate:function(a,b){this._super(a,b);var c=this.progressBar;c&&(this.progressBarStyle.webkitTransform=this._getTranslateStr(-a*(this.progressBarWidth/this.wrapperWidth),0))},resetPosition:function(a){return a=a||0,this.x>0?this.x=0:this.x=b.documentElement.scrollHeight&&(a.isScroll=!1,a.bottomPocket&&a.pullupLoading())},100)},_initPulldownRefreshEvent:function(){var b=this;b.topPocket&&b.options.webviewId&&a.plusReady(function(){var a=plus.webview.getWebviewById(b.options.webviewId);if(a){b.options.webview=a;var c=b.options.down,d=c.height;a.addEventListener("dragBounce",function(d){switch(b.pulldown?b.pullPocket.classList.add(f):b._initPulldownRefresh(),d.status){case"beforeChangeOffset":b._setCaption(c.contentdown);break;case"afterChangeOffset":b._setCaption(c.contentover);break;case"dragEndAfterChangeOffset":a.evalJS("mui&&mui.options.pullRefresh.down.callback()"),b._setCaption(c.contentrefresh)}},!1),a.setBounce({position:{top:2*d+"px"},changeoffset:{top:d+"px"}})}})},handleEvent:function(a){var b=this;b.stopped||(b.isScroll=!1,"dragup"===a.type&&(b.isScroll=!0,setTimeout(function(){b.isScroll=!1},1e3)))}}).extend(a.extend({setStopped:function(a){this.stopped=!!a;var b=plus.webview.currentWebview();if(this.stopped)b.setStyle({bounce:"none"}),b.setBounce({position:{top:"none"}});else{var c=this.options.down.height;b.setStyle({bounce:"vertical"}),b.setBounce({position:{top:2*c+"px"},changeoffset:{top:c+"px"}})}},pulldownLoading:function(){throw new Error("暂不支持")},endPulldownToRefresh:function(){var a=plus.webview.currentWebview();a.parent().evalJS("mui&&mui(document.querySelector('.mui-content')).pullRefresh('"+JSON.stringify({webviewId:a.id})+"')._endPulldownToRefresh()")},_endPulldownToRefresh:function(){var a=this;a.topPocket&&a.options.webview&&(a.options.webview.endPullToRefresh(),a.loading=!1,a._setCaption(a.options.down.contentdown,!0),setTimeout(function(){a.loading||a.topPocket.classList.remove(f)},350))},pullupLoading:function(a){var b=this;b.isLoading||(b.isLoading=!0,b.pulldown!==!1?b._initPullupRefresh():this.pullPocket.classList.add(f),setTimeout(function(){b.pullLoading.classList.add(d),b.pullLoading.classList.remove(e),b.pullCaption.innerHTML="",b.pullCaption.innerHTML=b.options.up.contentrefresh,a=a||b.options.up.callback,a&&a.call(b)},300))},endPullupToRefresh:function(a){var b=this;b.pullLoading&&(b.pullLoading.classList.remove(d),b.pullLoading.classList.add(e),b.isLoading=!1,a?(b.pullCaption.innerHTML=b.options.up.contentnomore,window.removeEventListener("dragup",b)):b.pullCaption.innerHTML=b.options.up.contentdown)},scrollTo:function(b,c,d){a.scrollTo(b,c,d)},refresh:function(a){a&&window.addEventListener("dragup",this)}},a.PullRefresh));a.fn.pullRefresh=function(d){var e;0===this.length?(e=b.createElement("div"),e.className="mui-content",b.body.appendChild(e)):e=this[0],d=d||{webviewId:plus.webview.currentWebview().id||plus.webview.currentWebview().getURL()},"string"==typeof d&&(d=a.parseJSON(d));var f=null,h=d.webviewId&&d.webviewId.replace(/\//g,"_"),i=e.getAttribute("data-pullrefresh-plus-"+h);return i?f=a.data[i]:(i=++a.uuid,e.setAttribute("data-pullrefresh-plus-"+h,i),b.body.classList.add(c),a.data[i]=f=new g(e,d)),f}}}(mui,document),function(a,b,c,d){var e="mui-off-canvas-left",f="mui-off-canvas-right",g="mui-off-canvas-backdrop",h="mui-off-canvas-wrap",i="mui-slide-in",j="mui-active",k="mui-transitioning",l=".mui-inner-wrap",m=a.Class.extend({init:function(b,d){this.wrapper=this.element=b,this.scroller=this.wrapper.querySelector(l),this.classList=this.wrapper.classList,this.scroller&&(this.options=a.extend(!0,{dragThresholdX:10},d),c.body.classList.add("mui-fullscreen"),this.refresh(),this.initEvent())},refresh:function(){this.classList.remove(j),this.slideIn=this.classList.contains(i),this.scroller=this.wrapper.querySelector(l),this.scroller.classList.remove(k),this.scroller.setAttribute("style",""),this.offCanvasRight=this.wrapper.querySelector("."+f),this.offCanvasLeft=this.wrapper.querySelector("."+e),this.offCanvasRightWidth=this.offCanvasLeftWidth=0,this.offCanvasLeftSlideIn=this.offCanvasRightSlideIn=!1,this.offCanvasRight&&(this.offCanvasRightWidth=this.offCanvasRight.offsetWidth,this.offCanvasRightSlideIn=this.slideIn&&this.offCanvasRight.parentNode===this.wrapper,this.offCanvasRight.classList.remove(k),this.offCanvasRight.classList.remove(j),this.offCanvasRight.setAttribute("style","")),this.offCanvasLeft&&(this.offCanvasLeftWidth=this.offCanvasLeft.offsetWidth,this.offCanvasLeftSlideIn=this.slideIn&&this.offCanvasLeft.parentNode===this.wrapper,this.offCanvasLeft.classList.remove(k),this.offCanvasLeft.classList.remove(j),this.offCanvasLeft.setAttribute("style","")),this.backdrop=this.scroller.querySelector("."+g),this.options.dragThresholdX=this.options.dragThresholdX||10,this.visible=!1,this.startX=null,this.lastX=null,this.offsetX=null,this.lastTranslateX=null},handleEvent:function(b){switch(b.type){case"touchstart":var c=b.target&&b.target.tagName;"INPUT"!==c&&"TEXTAREA"!==c&&"SELECT"!==c&&b.preventDefault();break;case"webkitTransitionEnd":b.target===this.scroller&&this._dispatchEvent();break;case"drag":var d=b.detail;this.startX?this.lastX=d.move.x:(this.startX=d.move.x,this.lastX=this.startX),!this.isDragging&&Math.abs(this.lastX-this.startX)>this.options.dragThresholdX&&("left"===d.direction||"right"===d.direction)&&(this.slideIn&&(this.scroller=this.classList.contains(j)?this.offCanvasRight&&this.offCanvasRight.classList.contains(j)?this.offCanvasRight:this.offCanvasLeft:"left"===d.direction&&this.offCanvasRight?this.offCanvasRight:"right"===d.direction&&this.offCanvasLeft?this.offCanvasLeft:null),this.scroller&&(this.startX=this.lastX,this.isDragging=!0,a.gestures.touch.lockDirection=!0,a.gestures.touch.startDirection=d.direction,this.scroller.classList.remove(k),this.offsetX=this.getTranslateX(),this._initOffCanvasVisible())),this.isDragging&&(this.updateTranslate(this.offsetX+(this.lastX-this.startX)),d.gesture.preventDefault(),b.stopPropagation());break;case"dragend":if(this.isDragging){var d=b.detail,e=d.direction;this.isDragging=!1,this.scroller.classList.add(k);var f=0,g=this.getTranslateX();if(this.slideIn){if(f=g>=0?this.offCanvasRightWidth&&g/this.offCanvasRightWidth||0:this.offCanvasLeftWidth&&g/this.offCanvasLeftWidth||0,this.openPercentage(f>=.5&&"left"===e?0:f>0&&.5>=f&&"left"===e?-100:f>=.5&&"right"===e?0:f>=-.5&&0>f&&"left"===e?100:f>0&&.5>=f&&"right"===e?-100:-.5>=f&&"right"===e?0:f>=-.5&&"right"===e?100:-.5>=f&&"left"===e?0:f>=-.5&&"left"===e?-100:0),1===f||-1===f||0===f)return void this._dispatchEvent()}else{if(f=g>=0?this.offCanvasLeftWidth&&g/this.offCanvasLeftWidth||0:this.offCanvasRightWidth&&g/this.offCanvasRightWidth||0,0===f)return this.openPercentage(0),void this._dispatchEvent();this.openPercentage(f>0&&.5>f&&"right"===e?0:f>.5&&"left"===e?100:0>f&&f>-.5&&"left"===e?0:"right"===e&&0>f&&f>-.5?0:.5>f&&"right"===e?-100:"right"===e&&f>=0&&(f>=.5||d.flick)?100:"left"===e&&0>=f&&(-.5>=f||d.flick)?-100:0),(1===f||-1===f)&&this._dispatchEvent()}}}},_dispatchEvent:function(){this.classList.contains(j)?a.trigger(this.wrapper,"shown",this):a.trigger(this.wrapper,"hidden",this)},_initOffCanvasVisible:function(){this.visible||(this.visible=!0,this.offCanvasLeft&&(this.offCanvasLeft.style.visibility="visible"),this.offCanvasRight&&(this.offCanvasRight.style.visibility="visible"))},initEvent:function(){var a=this;a.backdrop&&a.backdrop.addEventListener("tap",function(b){a.close(),b.detail.gesture.preventDefault()}),this.classList.contains("mui-draggable")&&(this.wrapper.addEventListener("touchstart",this),this.wrapper.addEventListener("drag",this),this.wrapper.addEventListener("dragend",this)),this.wrapper.addEventListener("webkitTransitionEnd",this)},openPercentage:function(a){var b=a/100;this.slideIn?(this.offCanvasLeft&&a>=0?(b=0===b?-1:0,this.updateTranslate(this.offCanvasLeftWidth*b),this.offCanvasLeft.classList[0!==a?"add":"remove"](j)):this.offCanvasRight&&0>=a&&(b=0===b?1:0,this.updateTranslate(this.offCanvasRightWidth*b),this.offCanvasRight.classList[0!==a?"add":"remove"](j)),this.classList[0!==a?"add":"remove"](j)):(this.offCanvasLeft&&a>=0?(this.updateTranslate(this.offCanvasLeftWidth*b),this.offCanvasLeft.classList[0!==b?"add":"remove"](j)):this.offCanvasRight&&0>=a&&(this.updateTranslate(this.offCanvasRightWidth*b),this.offCanvasRight.classList[0!==b?"add":"remove"](j)),this.classList[0!==b?"add":"remove"](j))},updateTranslate:function(a){if(a!==this.lastTranslateX){if(this.slideIn){if(this.scroller.classList.contains(f)){if(0>a)return void this.setTranslateX(0);if(a>this.offCanvasRightWidth)return void this.setTranslateX(this.offCanvasRightWidth)}else{if(a>0)return void this.setTranslateX(0);if(a<-this.offCanvasLeftWidth)return void this.setTranslateX(-this.offCanvasLeftWidth)}this.setTranslateX(a)}else{if(!this.offCanvasLeft&&a>0||!this.offCanvasRight&&0>a)return void this.setTranslateX(0); +if(this.leftShowing&&a>this.offCanvasLeftWidth)return void this.setTranslateX(this.offCanvasLeftWidth);if(this.rightShowing&&a<-this.offCanvasRightWidth)return void this.setTranslateX(-this.offCanvasRightWidth);this.setTranslateX(a),a>=0?(this.leftShowing=!0,this.rightShowing=!1,a>0&&(this.offCanvasLeft&&(this.offCanvasLeft.style.zIndex=0),this.offCanvasRight&&(this.offCanvasRight.style.zIndex=-1))):(this.rightShowing=!0,this.leftShowing=!1,this.offCanvasRight&&(this.offCanvasRight.style.zIndex=0),this.offCanvasLeft&&(this.offCanvasLeft.style.zIndex=-1))}this.lastTranslateX=a}},setTranslateX:a.animationFrame(function(a){this.scroller&&(this.scroller.style.webkitTransform="translate3d("+a+"px,0,0)")}),getTranslateX:function(){if(this.scroller){var b=a.parseTranslateMatrix(a.getStyles(this.scroller,"webkitTransform"));return b&&b.x||0}return 0},isShown:function(a){var b=!1;if(this.slideIn)b="left"===a?this.offCanvasLeft&&this.offCanvasLeft.classList.contains(j):"right"===a?this.offCanvasRight&&this.offCanvasRight.classList.contains(j):this.offCanvasLeft&&this.offCanvasLeft.classList.contains(j)||this.offCanvasRight&&this.offCanvasRight.classList.contains(j);else{var c=this.getTranslateX();b="right"===a?this.classList.contains(j)&&0>c:"left"===a?this.classList.contains(j)&&c>0:this.classList.contains(j)&&0!==c}return b},close:function(){this._initOffCanvasVisible(),this.slideIn&&(this.scroller=this.offCanvasRight&&this.offCanvasRight.classList.contains(j)?this.offCanvasRight:this.offCanvasLeft),this.scroller&&(this.scroller.classList.add(k),this.openPercentage(0))},show:function(a){this._initOffCanvasVisible(),this.isShown(a)||(a||(a=this.wrapper.querySelector("."+f)?"right":"left"),this.slideIn&&(this.scroller="right"===a?this.offCanvasRight:this.offCanvasLeft),this.scroller&&(this.scroller.classList.add(k),this.openPercentage("left"===a?100:-100)))},toggle:function(a){this.isShown(a)?this.close():this.show(a)}}),n=function(a){if(parentNode=a.parentNode,parentNode){if(parentNode.classList.contains(h))return parentNode;if(parentNode=parentNode.parentNode,parentNode.classList.contains(h))return parentNode}},o=function(b,d){if("A"===d.tagName&&d.hash){var e=c.getElementById(d.hash.replace("#",""));if(e){var f=n(e);if(f)return a.targets._container=f,b.preventDefault(),e}}return!1};a.registerTarget({name:d,index:60,handle:o,target:!1,isReset:!1,isContinue:!0}),b.addEventListener("tap",function(b){if(a.targets.offcanvas)for(var d=b.target;d&&d!==c;d=d.parentNode)if("A"===d.tagName&&d.hash&&d.hash==="#"+a.targets.offcanvas.id){a(a.targets._container).offCanvas().toggle(a.targets.offcanvas.classList.contains(e)?"left":"right"),a.targets.offcanvas=a.targets._container=null;break}}),a.fn.offCanvas=function(b){var c=[];return this.each(function(){var d=null,e=this;e.classList.contains(h)||(e=n(e));var f=e.getAttribute("data-offCanvas");f?d=a.data[f]:(f=++a.uuid,a.data[f]=d=new m(e,b),e.setAttribute("data-offCanvas",f)),("show"===b||"close"===b||"toggle"===b)&&d.toggle(),c.push(d)}),1===c.length?c[0]:c},a.ready(function(){a(".mui-off-canvas-wrap").offCanvas()})}(mui,window,document,"offcanvas"),function(a,b){var c="mui-action",d=function(a,b){return b.className&&~b.className.indexOf(c)?(a.preventDefault(),b):!1};a.registerTarget({name:b,index:50,handle:d,target:!1,isContinue:!0})}(mui,"action"),function(a,b,c,d){var e="mui-modal",f=function(a,b){if("A"===b.tagName&&b.hash){var d=c.getElementById(b.hash.replace("#",""));if(d&&d.classList.contains(e))return a.preventDefault(),d}return!1};a.registerTarget({name:d,index:50,handle:f,target:!1,isReset:!1,isContinue:!0}),b.addEventListener("tap",function(){a.targets.modal&&a.targets.modal.classList.toggle("mui-active")})}(mui,window,document,"modal"),function(a,b,c,d){var e="mui-popover",f="mui-popover-arrow",g="mui-popover-action",h="mui-backdrop",i="mui-bar-popover",j="mui-bar-backdrop",k="mui-backdrop-action",l="mui-active",m="mui-bottom",n=function(b,d){if("A"===d.tagName&&d.hash){if(a.targets._popover=c.getElementById(d.hash.replace("#","")),a.targets._popover&&a.targets._popover.classList.contains(e))return b.preventDefault(),d;a.targets._popover=null}return!1};a.registerTarget({name:d,index:60,handle:n,target:!1,isReset:!1,isContinue:!0});var o=function(){},p=function(){this.removeEventListener("webkitTransitionEnd",p),this.addEventListener("touchmove",a.preventDefault),a.trigger(this,"shown",this)},q=function(){this.setAttribute("style",""),this.removeEventListener("webkitTransitionEnd",q),this.removeEventListener("touchmove",a.preventDefault),o(!1),a.trigger(this,"hidden",this)},r=function(){var b=c.createElement("div");return b.classList.add(h),b.addEventListener("touchmove",a.preventDefault),b.addEventListener("tap",function(){var b=a.targets._popover;b&&(b.addEventListener("webkitTransitionEnd",q),b.classList.remove(l),s(b),c.body.setAttribute("style",""))}),b}(),s=function(b){r.setAttribute("style","opacity:0"),a.targets.popover=a.targets._popover=null,setTimeout(function(){!b.classList.contains(l)&&r.parentNode&&r.parentNode===c.body&&c.body.removeChild(r)},350)};b.addEventListener("tap",function(b){if(a.targets.popover){for(var d=!1,e=b.target;e&&e!==c;e=e.parentNode)e===a.targets.popover&&(d=!0);d&&t(a.targets._popover,a.targets.popover)}});var t=function(a,b){a.removeEventListener("webkitTransitionEnd",p),a.removeEventListener("webkitTransitionEnd",q),r.classList.remove(j),r.classList.remove(k);var d=c.querySelector(".mui-popover.mui-active");if(d&&(d.addEventListener("webkitTransitionEnd",q),d.classList.remove(l),a===d))return void s(d);var e=!1;(a.classList.contains(i)||a.classList.contains(g))&&(a.classList.contains(g)?(e=!0,r.classList.add(k)):r.classList.add(j)),a.setAttribute("style","display:block"),a.offsetHeight,a.classList.add(l),r.setAttribute("style",""),c.body.appendChild(r),o(!0),u(a,b,e),r.classList.add(l),a.addEventListener("webkitTransitionEnd",p)},u=function(d,e,h){if(d&&e){var i=b.innerWidth,j=b.innerHeight,k=d.offsetWidth,l=d.offsetHeight;if(h)return void d.setAttribute("style","display:block;top:"+(j-l+b.pageYOffset)+"px;left:"+(i-k)/2+"px;");var n=e.offsetWidth,o=e.offsetHeight,p=a.offset(e),q=d.querySelector("."+f);q||(q=c.createElement("div"),q.className=f,d.appendChild(q));var r=q&&q.offsetWidth/2||0,s=0,t=0,u=0,v=0,w=d.classList.contains(g)?0:5,x="top";l+rt&&(t=w),t+k>i&&(t=i-k-w),q&&("top"===x?q.classList.add(m):q.classList.remove(m),u-=t,v=k/2-r/2+u,v=Math.max(Math.min(v,k-2*r-6),6),q.setAttribute("style","left:"+v+"px"))):"middle"===x&&q.setAttribute("style","display:none"),d.setAttribute("style","display:block;top:"+s+"px;left:"+t+"px;")}};a.createMask=function(b){var d=c.createElement("div");d.classList.add(h),d.addEventListener("touchmove",a.preventDefault),d.addEventListener("tap",function(){e.close()});var e=[d];return e._show=!1,e.show=function(){return e._show=!0,d.setAttribute("style","opacity:1"),c.body.appendChild(d),e},e._remove=function(){return e._show&&(e._show=!1,d.setAttribute("style","opacity:0"),setTimeout(function(){c.body.removeChild(d)},350)),e},e.close=function(){b?b()!==!1&&e._remove():e._remove()},e},a.fn.popover=function(){var b=arguments;this.each(function(){a.targets._popover=this,("show"===b[0]||"hide"===b[0]||"toggle"===b[0])&&t(this,b[1])})}}(mui,window,document,"popover"),function(a,b,c,d){var e="mui-control-item",f="mui-segmented-control",g="mui-control-content",h="mui-bar-tab",i="mui-tab-item",j=function(a,b){return b.classList&&(b.classList.contains(e)||b.classList.contains(i))?(a.preventDefault(),b):!1};a.registerTarget({name:d,index:80,handle:j,target:!1}),b.addEventListener("tap",function(b){var j=a.targets.tab;if(j){for(var k,l,m,n="mui-active",o="."+n,p=j.parentNode;p&&p!==c;p=p.parentNode){if(p.classList.contains(f)){k=p.querySelector(o+"."+e);break}p.classList.contains(h)&&(k=p.querySelector(o+"."+i))}k&&k.classList.remove(n);var q=j===k;if(j&&j.classList.add(n),j.hash&&(m=c.getElementById(j.hash.replace("#","")))){if(!m.classList.contains(g))return void j.classList[q?"remove":"add"](n);if(!q){var r=m.parentNode;l=r.querySelectorAll("."+g+o);for(var s=0;sthis.handleX/2||!this.initialState&&a>this.handleX/2)&&(b=!0),this.lastChanged!==b&&(b?(this.handle.style.webkitTransform="translate3d("+(this.initialState?0:this.handleX)+"px,0,0)",this.classList[this.initialState?"remove":"add"](f)):(this.handle.style.webkitTransform="translate3d("+(this.initialState?this.handleX:0)+"px,0,0)",this.classList[this.initialState?"add":"remove"](f)),this.lastChanged=b)}}),a.fn["switch"]=function(){var b=[];return this.each(function(){var c=null,d=this.getAttribute("data-switch");d?c=a.data[d]:(d=++a.uuid,a.data[d]=new k(this),this.setAttribute("data-switch",d)),b.push(c)}),b.length>1?b:b[0]},a.ready(function(){a("."+d)["switch"]()})}(mui,window,"toggle"),function(a,b,c){function d(a,b){var c=b?"removeEventListener":"addEventListener";a[c]("drag",E),a[c]("dragend",E),a[c]("swiperight",E),a[c]("swipeleft",E),a[c]("flick",E)}var e,f,g="mui-active",h="mui-selected",i="mui-grid-view",j="mui-table-view-cell",k="mui-collapse-content",l="mui-disabled",m="mui-switch",n="mui-btn",o="mui-slider-handle",p="mui-slider-left",q="mui-slider-right",r="mui-transitioning",s="."+o,t="."+p,u="."+q,v="."+h,w="."+n,x=.8,y=isOpened=openedActions=progress=!1,z=sliderActionLeft=sliderActionRight=buttonsLeft=buttonsRight=sliderDirection=sliderRequestAnimationFrame=!1,A=lastTranslateX=sliderActionLeftWidth=sliderActionRightWidth=0,B=function(a){a?f?f.classList.add(g):e&&e.classList.add(g):f?f.classList.remove(g):e&&e.classList.remove(g)},C=function(){if(A!==lastTranslateX){if(buttonsRight&&buttonsRight.length>0){progress=A/sliderActionRightWidth,A<-sliderActionRightWidth&&(A=-sliderActionRightWidth-Math.pow(-A-sliderActionRightWidth,x));for(var a=0,b=buttonsRight.length;b>a;a++){var c=buttonsRight[a];"undefined"==typeof c._buttonOffset&&(c._buttonOffset=c.offsetLeft),buttonOffset=c._buttonOffset,D(c,A-buttonOffset*(1+Math.max(progress,-1)))}}if(buttonsLeft&&buttonsLeft.length>0){progress=A/sliderActionLeftWidth,A>sliderActionLeftWidth&&(A=sliderActionLeftWidth+Math.pow(A-sliderActionLeftWidth,x));for(var a=0,b=buttonsLeft.length;b>a;a++){var d=buttonsLeft[a];"undefined"==typeof d._buttonOffset&&(d._buttonOffset=sliderActionLeftWidth-d.offsetLeft-d.offsetWidth),buttonOffset=d._buttonOffset,buttonsLeft.length>1&&(d.style.zIndex=buttonsLeft.length-a),D(d,A+buttonOffset*(1-Math.min(progress,1)))}}D(z,A),lastTranslateX=A}sliderRequestAnimationFrame=requestAnimationFrame(function(){C()})},D=function(a,b){a&&(a.style.webkitTransform="translate3d("+b+"px,0,0)")};b.addEventListener("touchstart",function(b){e&&B(!1),e=f=!1,y=isOpened=openedActions=!1;for(var g=b.target,h=!1;g&&g!==c;g=g.parentNode)if(g.classList){var o=g.classList;if(("INPUT"===g.tagName&&"radio"!==g.type&&"checkbox"!==g.type||"BUTTON"===g.tagName||o.contains(m)||o.contains(n)||o.contains(l))&&(h=!0),o.contains(k))break;if(o.contains(j)){e=g;var p=e.parentNode.querySelector(v);if(p&&p!==e)return a.swipeoutClose(p),void(e=h=!1);if(!e.parentNode.classList.contains(i)){var q=e.querySelector("a");q&&q.parentNode===e&&(f=q)}e.querySelector(s)&&(d(e),b.stopPropagation()),h||e.querySelector("input")||e.querySelector(w)||e.querySelector("."+m)||B(!0);break}}}),b.addEventListener("touchmove",function(){B(!1)});var E={handleEvent:function(a){switch(a.type){case"drag":this.drag(a);break;case"dragend":this.dragend(a);break;case"flick":this.flick(a);break;case"swiperight":this.swiperight(a);break;case"swipeleft":this.swipeleft(a)}},drag:function(a){if(e){y||(z=sliderActionLeft=sliderActionRight=buttonsLeft=buttonsRight=sliderDirection=sliderRequestAnimationFrame=!1,z=e.querySelector(s),z&&(sliderActionLeft=e.querySelector(t),sliderActionRight=e.querySelector(u),sliderActionLeft&&(sliderActionLeftWidth=sliderActionLeft.offsetWidth,buttonsLeft=sliderActionLeft.querySelectorAll(w)),sliderActionRight&&(sliderActionRightWidth=sliderActionRight.offsetWidth,buttonsRight=sliderActionRight.querySelectorAll(w)),e.classList.remove(r),isOpened=e.classList.contains(h),isOpened&&(openedActions=e.querySelector(t+v)?"left":"right")));var b=a.detail,c=b.direction,d=b.angle;if("left"===c&&(d>150||-150>d)?(buttonsRight||buttonsLeft&&isOpened)&&(y=!0):"right"===c&&d>-30&&30>d&&(buttonsLeft||buttonsRight&&isOpened)&&(y=!0),y){a.stopPropagation(),a.detail.gesture.preventDefault();var f=a.detail.deltaX;if(isOpened&&("right"===openedActions?f-=sliderActionRightWidth:f+=sliderActionLeftWidth),f>0&&!buttonsLeft||0>f&&!buttonsRight){if(!isOpened)return;f=0}0>f?sliderDirection="toLeft":f>0?sliderDirection="toRight":sliderDirection||(sliderDirection="toLeft"),sliderRequestAnimationFrame||C(),A=f}}},flick:function(a){y&&a.stopPropagation()},swipeleft:function(a){y&&a.stopPropagation()},swiperight:function(a){y&&a.stopPropagation()},dragend:function(b){if(y){b.stopPropagation(),sliderRequestAnimationFrame&&(cancelAnimationFrame(sliderRequestAnimationFrame),sliderRequestAnimationFrame=null);var c=b.detail;y=!1;var d="close",f="toLeft"===sliderDirection?sliderActionRightWidth:sliderActionLeftWidth,g=c.swipe||Math.abs(A)>f/2;g&&(isOpened?"left"===c.direction&&"right"===openedActions?d="open":"right"===c.direction&&"left"===openedActions&&(d="open"):d="open"),e.classList.add(r);var i;if("open"===d){var j="toLeft"===sliderDirection?-f:f;if(D(z,j),i="toLeft"===sliderDirection?buttonsRight:buttonsLeft,"undefined"!=typeof i){for(var k=null,l=0;l0&&buttonsLeft!==i)for(var l=0,n=buttonsLeft.length;n>l;l++){var o=buttonsLeft[l];m=o._buttonOffset,"undefined"==typeof m&&(o._buttonOffset=sliderActionLeftWidth-o.offsetLeft-o.offsetWidth),D(o,m)}if(buttonsRight&&buttonsRight.length>0&&buttonsRight!==i)for(var l=0,n=buttonsRight.length;n>l;l++){var p=buttonsRight[l];m=p._buttonOffset,"undefined"==typeof m&&(p._buttonOffset=p.offsetLeft),D(p,-m)}}}};a.swipeoutOpen=function(b,c){if(b){var d=b.classList;if(!d.contains(h)){c||(c=b.querySelector(u)?"right":"left");var e=b.querySelector(a.classSelector(".slider-"+c));if(e){e.classList.add(h),d.add(h),d.remove(r);for(var f,g=e.querySelectorAll(w),i=e.offsetWidth,j="right"===c?-i:i,k=g.length,l=0;k>l;l++)f=g[l],"right"===c?D(f,-f.offsetLeft):D(f,i-f.offsetWidth-f.offsetLeft);d.add(r);for(var l=0;k>l;l++)D(g[l],j);D(b.querySelector(s),j)}}}},a.swipeoutClose=function(b){if(b){var c=b.classList;if(c.contains(h)){var d=b.querySelector(u+v)?"right":"left",e=b.querySelector(a.classSelector(".slider-"+d));if(e){e.classList.remove(h),c.remove(h),c.add(r);var f,g=e.querySelectorAll(w),i=e.offsetWidth,j=g.length;D(b.querySelector(s),0);for(var k=0;j>k;k++)f=g[k],"right"===d?D(f,-f.offsetLeft):D(f,i-f.offsetWidth-f.offsetLeft)}}}},b.addEventListener("touchend",function(){e&&(B(!1),z&&d(e,!0))}),b.addEventListener("touchcancel",function(){e&&(B(!1),z&&d(e,!0))});var F=function(){var a=e.classList;if(a.contains("mui-radio")){var b=e.querySelector("input[type=radio]");b&&b.click()}else if(a.contains("mui-checkbox")){var b=e.querySelector("input[type=checkbox]");b&&b.click()}};b.addEventListener(a.EVENT_CLICK,function(a){e&&e.classList.contains("mui-collapse")&&a.preventDefault()}),b.addEventListener("doubletap",function(){e&&F()}),b.addEventListener("tap",function(b){if(e){var c=!1,d=e.classList;if(d.contains("mui-collapse")&&!e.parentNode.classList.contains("mui-unfold")){if(b.detail.gesture.preventDefault(),!d.contains(g)){var f=e.parentNode.querySelector(".mui-collapse.mui-active");f&&f.classList.remove(g),c=!0}d.toggle(g),c&&a.trigger(e,"expand")}F()}})}(mui,window,document),function(a,b){a.alert=function(c,d,e,f){if(a.os.plus){if(void 0===typeof c)return;"function"==typeof d?(f=d,d=null,e="确定"):"function"==typeof e&&(f=e,e=null),plus.nativeUI.alert(c,f,d,e)}else b.alert(c)}}(mui,window),function(a,b){a.confirm=function(c,d,e,f){if(a.os.plus){if(void 0===typeof c)return;"function"==typeof d?(f=d,d=null,e=null):"function"==typeof e&&(f=e,e=null),plus.nativeUI.confirm(c,f,d,e)}else b.confirm(c)}}(mui,window),function(a,b){a.prompt=function(c,d,e,f,g){if(a.os.plus){if(void 0===typeof message)return;"function"==typeof d?(g=d,d=null,e=null,f=null):"function"==typeof e?(g=e,e=null,f=null):"function"==typeof f&&(g=f,f=null),plus.nativeUI.prompt(c,g,e,d,f)}else b.prompt(c)}}(mui,window),function(a){a.toast=function(b){if(a.os.plus)plus.nativeUI.toast(b,{verticalAlign:"bottom"});else{var c=document.createElement("div");c.classList.add("mui-toast-container"),c.innerHTML='
'+b+"
",document.body.appendChild(c),setTimeout(function(){document.body.removeChild(c)},2e3)}}}(mui,window),function(a,b,c){var d="mui-icon",e="mui-icon-clear",f="mui-icon-speech",g="mui-icon-search",h="mui-input-row",i="mui-placeholder",j="mui-tooltip",k="mui-hidden",l="mui-focusin",m="."+e,n="."+f,o="."+i,p="."+j,q=function(a){for(;a&&a!==c;a=a.parentNode)if(a.classList&&a.classList.contains(h))return a;return null},r=function(a,b){this.element=a,this.options=b||{actions:"clear"},~this.options.actions.indexOf("slider")?(this.sliderActionClass=j+" "+k,this.sliderActionSelector=p):(~this.options.actions.indexOf("clear")&&(this.clearActionClass=d+" "+e+(a.value?"":" "+k),this.clearActionSelector=m),~this.options.actions.indexOf("speech")&&(this.speechActionClass=d+" "+f,this.speechActionSelector=n),~this.options.actions.indexOf("search")&&(this.searchActionClass=i,this.searchActionSelector=o)),this.init()};r.prototype.init=function(){this.initAction(),this.initElementEvent()},r.prototype.initAction=function(){var b=this,c=b.element.parentNode;c&&(b.sliderActionClass?b.sliderAction=b.createAction(c,b.sliderActionClass,b.sliderActionSelector):(b.searchActionClass&&(b.searchAction=b.createAction(c,b.searchActionClass,b.searchActionSelector),b.searchAction.addEventListener("tap",function(c){a.focus(b.element),c.stopPropagation()})),b.speechActionClass&&(b.speechAction=b.createAction(c,b.speechActionClass,b.speechActionSelector),b.speechAction.addEventListener("click",a.stopPropagation),b.speechAction.addEventListener("tap",function(a){b.speechActionClick(a)})),b.clearActionClass&&(b.clearAction=b.createAction(c,b.clearActionClass,b.clearActionSelector),b.clearAction.addEventListener("tap",function(a){b.clearActionClick(a)}))))},r.prototype.createAction=function(a,b,e){var f=a.querySelector(e);if(!f){var f=c.createElement("span");f.className=b,b===this.searchActionClass&&(f.innerHTML=''+this.element.getAttribute("placeholder"),this.element.setAttribute("placeholder","")),a.insertBefore(f,this.element.nextSibling)}return f},r.prototype.initElementEvent=function(){var b=this.element;if(this.sliderActionClass){var c=this.sliderAction,d=b.offsetLeft,e=b.offsetWidth-28,f=c.offsetWidth,g=Math.abs(b.max-b.min),h=null,i=function(){c.classList.remove(k),f=f||c.offsetWidth;var a=Math.abs(b.value)/g*e;c.style.left=14+d+a-f/2+"px",c.innerText=b.value,h&&clearTimeout(h),h=setTimeout(function(){c.classList.add(k)},1e3)};b.addEventListener("input",i),b.addEventListener("tap",i),b.addEventListener("touchmove",function(a){a.stopPropagation()})}else{if(this.clearActionClass){var j=this.clearAction;if(!j)return;a.each(["keyup","change","input","focus","blur","cut","paste"],function(a,c){!function(a){b.addEventListener(a,function(){j.classList[b.value.trim()?"remove":"add"](k)})}(c)})}this.searchActionClass&&(b.addEventListener("focus",function(){b.parentNode.classList.add("mui-active")}),b.addEventListener("blur",function(){b.value.trim()||b.parentNode.classList.remove("mui-active")}))}},r.prototype.clearActionClick=function(b){var c=this;c.element.value="",a.focus(c.element),c.clearAction.classList.add(k),b.preventDefault()},r.prototype.speechActionClick=function(d){if(b.plus){var e=this;e.element.value="",c.body.classList.add(l),plus.speech.startRecognize({engine:"iFly"},function(b){e.element.value+=b,a.focus(e.element),plus.speech.stopRecognize(),a.trigger(e.element,"recognized",{value:e.element.value})},function(){c.body.classList.remove(l)})}else alert("only for 5+");d.preventDefault()},a.fn.input=function(){this.each(function(){var b=[],c=q(this.parentNode);if("range"===this.type&&c.classList.contains("mui-input-range"))b.push("slider");else{var d=this.classList;d.contains("mui-input-clear")&&b.push("clear"),d.contains("mui-input-speech")&&b.push("speech"),"search"===this.type&&c.classList.contains("mui-search")&&b.push("search")}var e=this.getAttribute("data-input-"+b[0]);if(!e){e=++a.uuid,a.data[e]=new r(this,{actions:b.join(",")});for(var f=0,g=b.length;g>f;f++)this.setAttribute("data-input-"+b[f],e)}})},a.ready(function(){a(".mui-input-row input").input()})}(mui,window,document); \ No newline at end of file diff --git a/examples/login/js/service.js b/examples/login/js/service.js new file mode 100644 index 00000000..e69de29b diff --git a/examples/login/login.html b/examples/login/login.html new file mode 100644 index 00000000..c69f3c41 --- /dev/null +++ b/examples/login/login.html @@ -0,0 +1,156 @@ + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + 注册新用户 +
+
+ + + + + + \ No newline at end of file diff --git a/examples/login/main.html b/examples/login/main.html new file mode 100644 index 00000000..733351fd --- /dev/null +++ b/examples/login/main.html @@ -0,0 +1,96 @@ + + + + + + + + + + + + + +
+

主页

+
+
+
+

+ 您好,您已成功登录。 +

    +
  • 关闭应用并不会注销当前用户的登录状态。
  • +
  • 注销登录会清除当前用户的登录状态。
  • +
  • 如果登录时您选择了 "记住我的状态",可以在这里设置 "解锁手势图案"。
  • +
+

+ + + +
+
+ + + + + + \ No newline at end of file diff --git a/examples/login/manifest.json b/examples/login/manifest.json new file mode 100644 index 00000000..eb8b8db9 --- /dev/null +++ b/examples/login/manifest.json @@ -0,0 +1,202 @@ +{ + "@platforms": ["android", "iPhone", "iPad"], + "id": "H583F81D0",/*应用的标识,创建应用时自动生成,勿手动修改*/ + "name": "login-demo",/*应用名称,程序桌面图标名称*/ + "version": { + "name": "1.0.0",/*应用版本名称*/ + "code": "83" + }, + "description": "",/*应用描述信息*/ + "icons": { + "72": "icon.png" + }, + "launch_path": "index.html",/*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/ + "developer": { + "name": "",/*开发者名称*/ + "email": "",/*开发者邮箱地址*/ + "url": "http://www.dcloud.io"/*开发者个人主页地址*/ + }, + "permissions": { + "Accelerometer": { + "description": "访问加速度感应器" + }, + "Audio": { + "description": "访问麦克风" + }, + "Cache": { + "description": "管理应用缓存" + }, + "Camera": { + "description": "访问摄像头" + }, + "Console": { + "description": "跟踪调试输出日志" + }, + "Contacts": { + "description": "访问系统联系人信息" + }, + "Device": { + "description": "访问设备信息" + }, + "Downloader": { + "description": "文件下载管理" + }, + "Events": { + "description": "应用扩展事件" + }, + "File": { + "description": "访问本地文件系统" + }, + "Gallery": { + "description": "访问系统相册" + }, + "Geolocation": { + "description": "访问位置信息" + }, + "Invocation": { + "description": "使用Native.js能力" + }, + "Messaging": { + "description": "访问通讯能力" + }, + "Orientation": { + "description": "访问方向感应器" + }, + "Proximity": { + "description": "访问距离感应器" + }, + "Storage": { + "description": "管理应用本地数据" + }, + "UI": { + "description": "管理系统原生控件" + }, + "Uploader": { + "description": "管理文件上传任务" + }, + "Runtime": { + "description": "访问运行期环境" + }, + "XMLHttpRequest": { + "description": "跨域网络访问" + }, + "Zip": { + "description": "文件压缩与解压缩" + }, + "Barcode": { + "description": "管理二维码扫描插件" + }, + "Maps": { + "description": "管理地图插件" + }, + "Payment": { + "description": "管理支付插件" + }, + "Push": { + "description": "管理推送消息插件" + }, + "Share": { + "description": "管理社交分享插件" + }, + "Speech": { + "description": "管理语音识别插件" + }, + "Statistic": { + "description": "管理统计插件" + } + }, + "plus": { + "splashscreen": { + "autoclose": false,/*是否自动关闭程序启动界面,true表示应用加载应用入口页面后自动关闭;false则需调plus.navigator.closeSplashscreen()关闭*/ + "waiting": true/*是否在程序启动界面显示等待雪花,true表示显示,false表示不显示。*/ + }, + "runmode": "liberate",/*应用的首次启动运行模式,可取liberate或normal,liberate模式在第一次启动时将解压应用资源(Android平台File API才可正常访问_www目录)*/ + "signature": "Sk9JTiBVUyBtYWlsdG86aHIyMDEzQGRjbG91ZC5pbw==",/*可选,保留给应用签名,暂不使用*/ + "distribute": { + "apple": { + "appid": "",/*iOS应用标识,苹果开发网站申请的appid,如io.dcloud.HelloH5*/ + "mobileprovision": "",/*iOS应用打包配置文件*/ + "password": "",/*iOS应用打包个人证书导入密码*/ + "p12": "",/*iOS应用打包个人证书,打包配置文件关联的个人证书*/ + "devices": "universal",/*iOS应用支持的设备类型,可取值iphone/ipad/universal*/ + "frameworks":[ + ]/*调用Native.js调用原生Objective-c API需要引用的FrameWork,如需调用GameCenter,则添加"GameKit.framework"*/ + }, + "google": { + "packagename": "",/*Android应用包名,如io.dcloud.HelloH5*/ + "keystore": "",/*Android应用打包使用的密钥库文件*/ + "password": "",/*Android应用打包使用密钥库中证书的密码*/ + "aliasname": "",/*Android应用打包使用密钥库中证书的别名*/ + "permissions": [ + "", + "" + ]/*使用Native.js调用原生安卓API需要使用到的系统权限*/ + }, + "orientation": [ + "portrait-primary", + "portrait-secondary" + ],/*应用支持的方向,portrait-primary:竖屏正方向;portrait-secondary:竖屏反方向;landscape-primary:横屏正方向;landscape-secondary:横屏反方向*/ + "icons": { + "ios": { + "prerendered": true, /*应用图标是否已经高亮处理,在iOS6及以下设备上有效*/ + "auto": "", /*应用图标,分辨率:512x512,用于自动生成各种尺寸程序图标*/ + "iphone": { + "normal": "",/*iPhone普通屏幕程序图标,分辨率:57x57*/ + "retina": "",/*iPhone高分屏程序图标,分辨率:114x114*/ + "retina7": "",/*iPhone iOS7高分屏程序图标,分辨率:120x120*/ + "spotlight-normal": "", /*iPhone Spotlight搜索程序图标,分辨率:29x29*/ + "spotlight-retina": "", /*iPhone高分屏Spotlight搜索程序图标,分辨率:58x58*/ + "spotlight-retina7": "",/*iPhone iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/ + "settings-normal": "", /*iPhone设置页面程序图标,分辨率:29x29*/ + "settings-retina": ""/*iPhone 高分屏设置页面程序图标,分辨率:58x58*/ + }, + "ipad": { + "normal": "", /*iPad普通屏幕程序图标,分辨率:72x72*/ + "retina": "", /*iPad高分屏程序图标,分辨率:144x144*/ + "normal7": "", /*iPad iOS7程序图标,分辨率:76x76*/ + "retina7": "", /*iPad iOS7高分屏程序图标,分辨率:152x152*/ + "spotlight-normal": "", /*iPad Spotlight搜索程序图标,分辨率:50x50*/ + "spotlight-retina": "", /*iPad高分屏Spotlight搜索程序图标,分辨率:100x100*/ + "spotlight-normal7": "",/*iPad iOS7 Spotlight搜索程序图标,分辨率:40x40*/ + "spotlight-retina7": "",/*iPad iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/ + "settings-normal": "",/*iPad设置页面程序图标,分辨率:29x29*/ + "settings-retina": "" /*iPad高分屏设置页面程序图标,分辨率:58x58*/ + } + }, + "android": { + "mdpi": "", /*普通屏程序图标,分辨率:48x48*/ + "ldpi": "", /*大屏程序图标,分辨率:48x48*/ + "hdpi": "", /*高分屏程序图标,分辨率:72x72*/ + "xhdpi": "",/*720P高分屏程序图标,分辨率:96x96*/ + "xxhdpi": ""/*1080P 高分屏程序图标,分辨率:144x144*/ + } + }, + "splashscreen": { + "ios": { + "iphone": { + "default": "", /*iPhone3启动图片选,分辨率:320x480*/ + "retina35": "",/*3.5英寸设备(iPhone4)启动图片,分辨率:640x960*/ + "retina40": ""/*4.0 英寸设备(iPhone5)启动图片,分辨率:640x1136*/ + }, + "ipad": { + "portrait": "", /*iPad竖屏启动图片,分辨率:768x1004*/ + "portrait-retina": "",/*iPad高分屏竖屏图片,分辨率:1536x2008*/ + "landscape": "", /*iPad横屏启动图片,分辨率:1024x748*/ + "landscape-retina": "", /*iPad高分屏横屏启动图片,分辨率:2048x1496*/ + "portrait7": "", /*iPad iOS7竖屏启动图片,分辨率:768x1024*/ + "portrait-retina7": "",/*iPad iOS7高分屏竖屏图片,分辨率:1536x2048*/ + "landscape7": "", /*iPad iOS7横屏启动图片,分辨率:1024x768*/ + "landscape-retina7": ""/*iPad iOS7高分屏横屏启动图片,分辨率:2048x1536*/ + } + }, + "android": { + "mdpi": "", /*普通屏启动图片,分辨率:240x282*/ + "ldpi": "", /*大屏启动图片,分辨率:320x442*/ + "hdpi": "", /*高分屏启动图片,分辨率:480x762*/ + "xhdpi": "", /*720P高分屏启动图片,分辨率:720x1242*/ + "xxhdpi": ""/*1080P高分屏启动图片,分辨率:1080x1882*/ + } + } + } + } +} \ No newline at end of file diff --git a/examples/login/reg.html b/examples/login/reg.html new file mode 100644 index 00000000..cdb49592 --- /dev/null +++ b/examples/login/reg.html @@ -0,0 +1,102 @@ + + + + + + + + + + + + + +
+ +

注册

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/examples/login/setting.html b/examples/login/setting.html new file mode 100644 index 00000000..8ab702d2 --- /dev/null +++ b/examples/login/setting.html @@ -0,0 +1,98 @@ + + + + + + + + + + + + +
+ +

设定解锁手势

+
+
+
+
    +
  • + 启用状态 +
    +
    +
    +
  • +
+
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/examples/login/unlock.html b/examples/login/unlock.html new file mode 100644 index 00000000..b923d01c --- /dev/null +++ b/examples/login/unlock.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + +
+

解锁

+
+ + + + + + + + + \ No newline at end of file