diff --git a/core/core_version.php b/core/core_version.php
index f8cf9da..9ce7697 100644
--- a/core/core_version.php
+++ b/core/core_version.php
@@ -14,7 +14,7 @@ if(!defined('CORE_VERSION')) {
define('CORE_VERSION', '2.02');
define('CORE_RELEASE', '20180909');
define('CORE_FIXBUG' , '20000000');
- define('CORE_XHVERSION', '1.88.82');
- define('CORE_XHRELEASE', '20240729');
+ define('CORE_XHVERSION', '1.88.83');
+ define('CORE_XHRELEASE', '20240730');
define('CORE_XHFIXBUG' , '20240706');
}
\ No newline at end of file
diff --git a/core/template/default/common/adminlogin.htm b/core/template/default/common/adminlogin.htm
index c784ddd..a23501c 100644
--- a/core/template/default/common/adminlogin.htm
+++ b/core/template/default/common/adminlogin.htm
@@ -147,7 +147,7 @@
首页
-
diff --git a/dzz/system/css/mobile/mobile_member.css b/dzz/system/css/mobile/mobile_member.css
new file mode 100644
index 0000000..0184456
--- /dev/null
+++ b/dzz/system/css/mobile/mobile_member.css
@@ -0,0 +1,406 @@
+/*搜索*/
+html, body {
+ background-color: #F2F2F2;
+ -webkit-tap-highlight-color: transparent;
+ min-height: 100%;
+ height: auto;
+}
+ul,li,ul li{
+ list-style: none;
+}
+.hide{
+ display: none;
+}
+.weui-search-bar {
+ background-color: #F2F2F2;
+ padding: 0.5rem 0.5rem 0rem 0.5rem;
+ margin-bottom: 0.5rem;
+ position: fixed;
+ width: 100%;
+ top: 0;
+ z-index: 3;
+}
+.weui-search-bar__form {
+ background-color: transparent;
+ height: 1.5rem;
+}
+.weui-search-return__cancel-btn {
+ margin-left: 0.5rem;
+ line-height: 1.4rem;
+ color: #3779ff;
+ white-space: nowrap;
+}
+.weui-search-bar__box {
+ padding-left: 0.5rem;
+}
+.weui-search-bar__box .weui-search-bar__input {
+ padding: 0;
+ line-height: 1.5rem;
+ height: auto;
+}
+.weui-search-bar__box .weui-icon-clear {
+ line-height: 1.5rem;
+}
+.weui-search-index__label, .weui-search-bar__label {
+ position: absolute;
+ text-align: left;
+ padding-left: 0.5rem;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+ border-radius: 30px;
+ z-index: 2;
+ color: #9b9b9b;
+ background: #fff;
+}
+.weui-search-index__label .weui-icon-search, .weui-search-bar__label .weui-icon-search {
+ float: right;
+ clear: both;
+ line-height: 1.5rem;
+ margin-right: 0.5rem;
+}
+.weui-search-bar:after {
+ border: none;
+}
+.weui-search-bar__form:after {
+ border-radius: 30px;
+}
+.weui-cell__hd {
+ display: block;
+ float: left;
+}
+.weui-cell__hd .special_avatar_class {
+ display: block;
+ width: 2rem;
+ height: 2rem;
+ line-height: 2rem;
+ border-radius: 50%;
+ margin-right: 0.5rem;
+}
+.weui-cell__bd {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ word-break: break-all;
+}
+.weui-cells_margin_top{
+ margin-top: 60px;
+}
+.weui-cell-member{
+ background-color: #FFFFFF;
+}
+.Topcarousel,.iconFirstWord {
+ display: block;
+ color: #fff;
+ font-size: 1rem;
+ width: 2rem;
+ height: 2rem;
+ line-height: 2rem;
+ text-align: center;
+ border-radius: 50%;
+ margin-right: 0.5rem;
+ font-weight: bold;
+}
+.weui-cell__bd h4{
+ color: #555555;
+/* font-weight: normal;*/
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ word-break: break-all;
+}
+.weui-cell__bd .weui-member-team{
+ font-weight:600;
+}
+.weui-member-select{
+ position: fixed;
+ bottom: 0;
+ background-color: #FFFFFF;
+ width: 100%;
+ height: 2.5rem;
+ box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);
+ z-index: 3;
+}
+.weui-member-success{
+ position: absolute;
+ right: 0;
+ top: 0rem;
+ width: 5rem;
+ line-height: 2.5rem;
+ text-align: center;
+ height: 100%;
+ box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);
+}
+.weui-member-select-scroller .special_avatar_class{
+ width: 1.5rem;
+ height: 1.5rem;
+ line-height: 1.5rem;
+ text-align: center;
+ border-radius: 50%;
+ margin-right: 0.5rem;
+}
+.weui-member-success .weui-member-success-word{
+ line-height: 2.5rem;
+ width: 100%;
+ color:#3779ff;
+ display: block;
+ background-color: #fff;
+ outline: 0;
+ border: none;
+}
+.weui-member-select-user{
+ margin-right: 5rem;
+ line-height: 2.5rem;
+ height: 100%;
+ overflow: hidden;
+}
+.weui-member-select-scroller{
+ overflow: hidden;
+ height: 2.5rem;
+ margin-left: 0.5rem;
+ min-width: 100%;
+}
+.weui-member-select-scroller li{
+ float: left;
+ line-height: 2.5rem;
+ height: 100%;
+ padding-top: 0.5rem;
+ position: relative;
+}
+
+.weui-member-select-scroller .Topcarousel{
+ width: 1.5rem;
+ height: 1.5rem;
+ line-height: 1.5rem;
+}
+/*文件另存为*/
+.weui_cells-margin-top{
+ margin-top: 2.8rem;
+}
+.weui-cell__explorer {
+ background-color: #ff9800;
+}
+.weui-cell__group {
+ background-color: #009688;
+}
+.weui-cell__img {
+ font-size: 24px;
+ margin-right: 0.5rem;
+ display: block;
+ color: #FFFFFF;
+ padding: 0.4rem;
+ border-radius: 0.14rem;
+}
+.weui-cells__recent{
+ margin-bottom:0.5rem;
+}
+.weui-file-keep{
+ background-color: #FFFFFF;
+ line-height: 2.75rem;
+ text-align: center;
+ font-size: 0.8rem;
+ position: fixed;
+ width: 100%;
+ top: 0;
+ z-index: 3;
+}
+.weui-file-keep .weui-file-keep-cancel {
+ padding-left: 1rem;
+}
+.weui-file-keep .placeholder {
+ color: #2196f3;
+}
+.weui-file-div-keep-cancel{
+ display: block;
+ color: #2196f3;
+}
+.weui-file-sumite-keep{
+ padding-right: 1rem;
+}
+.weui-address {
+ position: relative;
+}
+.weui-cell-address{
+ margin-top:2.75rem;
+}
+.weui-index {
+ position: absolute;
+ top: 0.4rem;
+ left: 0.5rem;
+ width: 3rem;
+ line-height: 1rem;
+}
+.weui-index .dzz-index {
+ font-size: 1.2rem;
+ color: #3779FF;
+}
+.weui-index .dzz-index-vline {
+ font-size: 1.2rem;
+ color: #DDDDDD;
+}
+.weui-address-container {
+ margin-left: 3rem;
+ overflow: hidden;
+ line-height: 1.7rem;
+ position: relative;
+ height: 2rem;
+}
+.weui-address-field {
+ position: absolute;
+ top: 0;
+ right: 0;
+ left: 0;
+ white-space: nowrap;
+ padding: 0.15rem;
+ min-width: 100%;
+}
+.weui-address-field li {
+ float: left;
+ color: #666666;
+}
+.weui-address-field li a {
+ font-size: 0.7rem;
+ color: #666666;
+}
+.weui-address-field li span {
+ vertical-align: middle;
+}
+.weui-cells{
+ margin-top: 0rem;
+}
+.weui-cell__hd {
+ display: block;
+ float: left;
+}
+.weui-cell__hd .weui-cell__recentimg {
+ width: 2rem;
+ height: 2rem;
+ margin-right: 0.5rem;
+ border-radius: 2px;
+}
+.weui-cell__bd p {
+ color: #999999;
+ font-size: 0.7rem;
+}
+.weui-cell__bd p i {
+ font-style: normal;
+ padding: 0px 0.25rem;
+}
+.weui-file-footer .weui-file-dzzicon{
+ color: #3779ff;
+ font-size: 1rem;
+}
+.weui-file-footer.weui-tabbar {
+ background-color: #FFFFFF;
+ position: fixed;
+ box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);
+}
+.weui-tabbar__item{
+ padding: 0.25rem 0;
+}
+.weui-file-footer.weui-tabbar:before {
+ border-top: none;
+}
+.weui-cells__margin_footer{
+ margin-bottom: 3rem;
+}
+.weui-dialog__hd {
+ padding: 1rem 1rem 0.5rem;
+ text-align: left;
+ color: #666666;
+ font-size: 0.8rem;
+}
+.weui-dialog .weui-dialog__btn.primary {
+ color: #3779ff;
+}
+.weui-tabbar__item a {
+ display: block;
+ position: relative;
+}
+.weui-footer-item i {
+ color: #3779ff;
+ font-size: 1rem;
+}
+.weui-footer-item p {
+ font-size: 0.6rem;
+ color: #666666;
+}
+.weui-dropup{
+ box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);
+ background-color: #fff;
+ border-radius: 2px;
+ position: absolute;
+ bottom: 100%;
+ left: 10%;
+ float: left;
+ min-width: 180px;
+ margin-bottom: 5px;
+ z-index: 3;
+}
+.weui-dropup-right {
+ left: auto;
+ right: 10%;
+}
+.weui-dropup-type{
+ left: 0.5rem;
+ right: 0.5rem;
+ bottom:2.5rem;
+ position: fixed;
+ max-height: 450px;
+ overflow: auto;
+}
+.weui-dropup-type .weui-type-word{
+ text-align: left;
+ font-size: 0.7rem;
+}
+.weui-cells_radio .weui-check:checked+.weui-icon-checked:before{
+ color:#3779ff;
+}
+.background-none{
+ z-index: 2;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: none;
+}
+.weui-dropup>li {
+ margin: 0 1rem;
+ overflow: hidden;
+}
+.weui-dropup>li>a {
+ display: block;
+ padding: 0.5rem 0rem;
+ border-bottom: 1px solid #f2f2f2;
+ color: #666666;
+ text-align: left;
+ position: relative;
+ font-size: 0.7rem;
+}
+.org-sel-box-iframe{
+ border: none;
+}
+.ti-opacity{
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ opacity: 0;
+}
+/*搜索*/
+.weui-type-place{
+ color: #999999;
+ font-size: 0.7rem;
+ padding: 0.5rem;
+ margin-top: 1.8rem;
+}
+.weui-cell__search {
+ background-color: #ffc107;
+}
+.weui-type-resulting{
+ color: #666666;
+ text-align: center;
+}
diff --git a/dzz/system/mobile_selectuser.php b/dzz/system/mobile_selectuser.php
new file mode 100644
index 0000000..8fd5627
--- /dev/null
+++ b/dzz/system/mobile_selectuser.php
@@ -0,0 +1,114 @@
+ $zero,
+ 'nouser' => nouser,
+ 'stype' => $stype,
+ 'moderator' => $moderator,
+ 'range' => $range,
+ 'multiple' => $multiple,
+ 'nosearch' => 1,
+ 'ctrlid' => 'seluser'
+);
+//获取选中项
+$ids = explode(',', $ids);
+$selectorgids = $selectuids = array();
+foreach ($ids as $value) {
+ if (strpos($value, 'g_') !== false) {
+ if ($stype == 2) continue;//仅选择用户时,忽略部门和群组
+ $orgid = intval(str_replace($value, 'g_', ''));
+ $selectorgids[$orgid] = $orgid;
+
+ } elseif ($uid = intval($value)) {
+ if ($stype == 1) continue; //仅选择部门和群组时,忽略用户;
+ $selectuids[$uid] = $uid;
+ }
+}
+$keyword = isset($_GET['keyword']) ? trim($_GET['keyword']) : '';
+//获取所有机构和部门
+$orgdatas = $orgids = $orgnames = $selectorginfo = array();
+foreach (DB::fetch_all("select pathkey from %t where `type` = %d", array('organization', 0)) as $v) {
+ $param = array('organization', 0);
+ $pathkey = $pathkey . '.*';
+ foreach (DB::fetch_all("select * from %t where pathkey regexp %s and `type` = 0", array('organization', $pathkey)) as $val) {
+ if (intval($val['aid']) == 0) {
+ $val['img'] = avatar_group($val['orgid'], array($val['orgid'] => array('aid' => $val['aid'], 'orgname' => $val['orgname'])));
+ } else {
+ $val['icon'] = 'index.php?mod=io&op=thumbnail&width=24&height=24&path=' . dzzencode('attach::' . $val['aid']);
+ }
+ $orgdatas[$val['pathkey']] = $val;
+ $orgdatas[$val['pathkey']]['user_count'] = 0;
+ $orgdatas[$val['pathkey']]['user_select'] = 0;
+ if(in_array($val['orgid'],$selectorgids)) $orgdatas[$val['pathkey']]['selected'] = true;
+ $orgids[] = $val['orgid'];
+ $orgnames[$val['orgid']] = $val['orgname'];
+ }
+}
+$wheresql = 'ou.orgid in(%n) ';
+$param = array('organization_user', 'organization', 'user', 'user_setting', 'headerColor', $orgids);
+if ($keyword) {
+ $wheresql .= ' and (u.username LIKE %s or u.email LIKE %s or u.phone LIKE %s)';
+ $param[] = '%' . $keyword . '%';
+ $param[] = '%' . $keyword . '%';
+ $param[] = '%' . $keyword . '%';
+}
+$selectuserinfo = array();
+$selectnum = ($stype == 1) ? count($selectorgids): count($selectuids);
+if(!$nouser) {
+ $data = DB::fetch_all("select ou.orgid,o.pathkey,u.uid,u.username,u.avatarstatus,s.svalue from %t ou left join %t o on o.orgid=ou.orgid
+ left join %t u on ou.uid=u.uid left join %t s on u.uid=s.uid and s.skey=%s where $wheresql", $param);
+ //获取机构和部门下的用户
+ foreach ($data as $v) {
+ //获取用户头像相关信息
+ if (!$v['avatarstatus']) {
+ $v['avatarstatus'] = 0;
+ $v['headerColor'] = $v['svalue'];
+ $v['firstword'] = strtoupper(new_strsubstr($v['username'], 1, ''));
+ }
+ if ($orgdatas[$v['pathkey']]) {
+ if(in_array($v['uid'],$selectuids) || in_array($v['orgid'],$selectorgids)){
+ $v['selected'] = true;
+ $selectuserinfo[] = $v;
+ $orgdatas[$v['pathkey']]['user_select'] += 1;
+ }
+ $orgdatas[$v['pathkey']]['users'][$v['uid']] = $v;
+ $orgdatas[$v['pathkey']]['user_count'] += 1;
+ }
+ }
+}
+
+ksort($orgdatas);
+foreach ($orgdatas as $k => $v) {
+ $pathkeyarr = explode('-', str_replace('_', '', $k));
+ $orgdatas[$v['pathkey']]['title'] = '';
+ foreach ($pathkeyarr as $val) {
+ $orgdatas[$v['pathkey']]['title'] .= $orgnames[$val] . '-';
+ }
+ $orgdatas[$v['pathkey']]['title'] = substr($orgdatas[$v['pathkey']]['title'], 0, -1);
+}
+include template('mobile_selectuser');
+dexit();
+
diff --git a/dzz/system/mobilefileselection.php b/dzz/system/mobilefileselection.php
new file mode 100644
index 0000000..067e278
--- /dev/null
+++ b/dzz/system/mobilefileselection.php
@@ -0,0 +1,55 @@
+ $allowcreate,
+ 'type' => $type,
+ 'range' => $range,
+ 'defaultselect' => $defaultselect,
+ 'mulitype' => $mulitype,
+ 'exttype' => $exttype,
+ 'callback_url'=>$callback_url,
+ 'token'=>$token,
+ 'formhash'=>$formhash,
+ 'filename'=>$filename
+);
+$json = json_encode($gets);
+$allowvisit = array('file','searchfile', 'json', 'ajax', 'search', 'save','home','group');
+if ($do) {
+ if (!in_array($do, $allowvisit)) {
+ showmessage(lang('access_denied'), dreferer());
+ } else {
+ require MOD_PATH . '/mobilefileselection/' . $do . '.php';
+ }
+} else {
+ include template('mobilefileselection/index');
+ exit();
+}
+
diff --git a/dzz/system/mobilefileselection/ajax.php b/dzz/system/mobilefileselection/ajax.php
new file mode 100644
index 0000000..4714626
--- /dev/null
+++ b/dzz/system/mobilefileselection/ajax.php
@@ -0,0 +1,30 @@
+fetch($fid);
+ $perm = 0;
+ $name = !empty($_GET['foldername']) ? trim($_GET['foldername']) : lang('newfolder');
+ $fid = intval($_GET['fid']);
+ $fname = io_dzz::name_filter(getstr($name, 80));
+ if ($arr = IO::CreateFolder($fid, $fname, $perm)) {
+ if ($arr['error']) {
+ } else {
+ $arr = array_merge($arr['icoarr'], $arr['folderarr']);
+ $arr['msg'] = 'success';
+
+ }
+ } else {
+ $arr = array();
+ $arr['error'] = lang('failure_newfolder');
+ }
+ exit(json_encode($arr));
+}
\ No newline at end of file
diff --git a/dzz/system/mobilefileselection/file.php b/dzz/system/mobilefileselection/file.php
new file mode 100644
index 0000000..63657e7
--- /dev/null
+++ b/dzz/system/mobilefileselection/file.php
@@ -0,0 +1,195 @@
+fetch($gid)) {
+ showmessage(lang('no_group'), dreferer());
+ }
+ //获取成员权限
+ $perm = C::t('organization_admin')->chk_memberperm($gid, $uid);
+ //判断群组是否开启,如果未开启(共享目录)并且不是管理员不能访问
+ if (!$group['diron'] && !$perm) {
+ showmessage(lang('no_privilege'), dreferer());
+ }
+ //判断是否有权限访问群组,如果不是管理员权限(主要针对系统管理员和上级管理员),并且非成员,不能访问
+ if (!$perm && !C::t('organization')->ismember($gid, $uid, false)) {
+ showmessage(lang('no_privilege'), dreferer());
+ }
+
+ if (!$group['syatemon']) {
+ showmessage(lang('no_group_by_system'), dreferer());
+ }
+ if (!$group['manageon'] && $perm < 1) {
+ showmessage(lang('no_privilege'), dreferer());
+ }
+ if (!$fid) $fid = $group['fid'];
+}
+$perpage = isset($_GET['perpage']) ? intval($_GET['perpage']) : 10;//默认每页条数
+$page = empty($_GET['page']) ? 1 : intval($_GET['page']);//页码数
+$start = ($page - 1) * $perpage;//开始条数
+$datastart = isset($_GET['datatotal']) ? intval($_GET['datatotal']) : 0;
+$total = 0;//总条数
+//是否有更多群组
+$gropunext = isset($_GET['gropunext']) ? intval($_GET['gropunext']) : true;
+//默认按时间顺序查询
+$disp = isset($_GET['disp']) ? intval($_GET['disp']) : 3;
+$bz = empty($_GET['bz']) ? '' : urldecode($_GET['bz']);
+$marker = empty($_GET['marker']) ? '' : trim($_GET['marker']);
+$data = array();
+$keyword = isset($_GET['keyword']) ? urldecode($_GET['keyword']) : '';
+$exts = isset($_GET['exts']) ? trim($_GET['exts']) : '';
+$conditions = array();
+if ($keyword) {
+ $conditions['name'] = array($keyword, 'like', 'and');
+}
+
+//类型筛选
+if ($exts) {
+ if ($exts == 'folder') {
+ $conditions['type'] = array('folder', '=', 'and');
+ } else {
+ $extarr = explode(',', $exts);
+ $conditions['ext'] = array($extarr, 'in', 'and');
+ }
+}
+$asc = isset($_GET['asc']) ? intval($_GET['asc']) : 0;
+
+$order = $asc > 0 ? 'ASC' : "DESC";
+
+switch ($disp) {
+ case 0:
+ $orderby = 'name';
+ $groupby = 'o.orgname';
+ break;
+ case 1:
+ $orderby = 'size';
+ $groupby = 'o.dateline';
+ break;
+ case 2:
+ $orderby = array('type', 'ext');
+ $groupby = 'o.dateline';
+ break;
+ case 3:
+ $orderby = 'dateline';
+ $groupby = 'o.dateline';
+ break;
+
+}
+$folder = C::t('folder')->fetch_folderinfo_by_fid($fid);
+$folder['gid'] = ($gid) ? $gid : 0;
+$folder['ismoderator'] = $perm;
+$folderjson = json_encode(array($fid => $folder));
+$folderpath = array_filter(explode('/', preg_replace('/dzz:(.+?):/', '', $folder['path'])));
+$navtitle = $folderpath[0];
+$pathkeyarr = explode('-', str_replace('_', '', $folder['pathkey']));
+$folderpatharr = array();
+foreach (DB::fetch_all("select fid,gid,fname from %t where fid in(%n)", array('folder', $pathkeyarr)) as $v) {
+ $folderpatharr[] = array('fid' => $v['fid'], 'gid' => $v['gid'], 'name' => $v['fname']);
+}
+$groups = array();
+$newperpage = 10;
+//如果是机构获或部门取下级
+if ($gid > 0 && $group['type'] == 0 && $gropunext) {
+ if (C::t('organization_admin')->chk_memberperm($gid, $uid) || C::t('organization')->ismember($gid, $uid, true)) {
+ foreach (DB::fetch_all("select o.*,f.fid from %t o left join %t f on o.fid=f.fid where o.forgid = %d order by $groupby $order limit $start,$perpage", array('organization', 'folder', $gid)) as $v) {
+ if (((C::t('organization_admin')->chk_memberperm($v['orgid'], $uid) > 0) || ($v['manageon'] && $v['diron'])) && $v['syatemon']) {
+ $resultarr[] = $v;
+ if (intval($v['aid'])) {
+ //群组图
+ $v['img'] = 'index.php?mod=io&op=thumbnail&width=45&height=45&path=' . dzzencode('attach::' . $v['aid']);
+ }
+ $contaions = C::t('resources')->get_contains_by_fid($v['fid']);
+ $v['filenum'] = $contaions['contain'][0];
+ $v['foldernum'] = $contaions['contain'][1];
+ $v['orgname'] = addslashes($v['orgname']);
+ $groups[] = $v;
+ } else {
+ continue;
+ }
+ }
+ }
+ $groupnum = count($groups);
+ if ($groupnum >= $perpage) {
+ $gropunext = $page + 1;
+ } else {
+ $gropunext = false;
+ }
+ //如果有机构部门结果,则减去机构部门结果数量
+ $newperpage = $perpage - $groupnum;
+} else {
+ $gropunext = false;
+}
+
+//获取文件数据
+if ($newperpage) {
+ //查询结果处理
+ foreach (C::t('resources')->fetch_all_by_pfid($fid, $conditions, $newperpage, $orderby, $order, $datastart) as $val) {
+ if ($val['type'] == 'folder') {
+ $val['filenum'] = $val['contaions']['contain'][0];
+ $val['foldernum'] = $val['contaions']['contain'][1];
+ } else {
+ $val['monthdate'] = dgmdate($val['dateline'], 'm-d');
+ $val['hourdate'] = dgmdate($val['dateline'], 'H:i');
+ }
+ if ($val['type'] == 'image') {
+ $val['img'] = DZZSCRIPT . '?mod=io&op=thumbnail&width=45&height=45&path=' . dzzencode('attach::' . $val['aid']);
+ $val['imgpath'] = DZZSCRIPT . '?mod=io&op=thumbnail&path=' . dzzencode('attach::' . $val['aid']);
+ }
+ $val['name'] = addslashes($val['name']);
+ $data[$val['rid']] = $val;
+ }
+}
+$next = false;
+if (count($data) + count($groups) >= $perpage) {
+ $next = $page + 1;
+}
+$createFolderPerm = false;
+if($gid){
+ if ($folder['ismoderator']) {
+ $createFolderPerm = true;
+ } else {
+ $$createFolderPerm = perm_binPerm::havePower('folder', $folder['perm_inherit']) ? true:false;
+ }
+}else{
+ $createFolderPerm = true;
+}
+
+//返回数据
+$return = array('fid' => $fid, 'data' => $data ? $data : array(), 'param' => array(
+ 'perpage' => $perpage,
+ 'bz' => $bz,
+ 'asc' => $asc,
+ 'disp' => $disp,
+ 'page' => $next,
+ 'ext' => $exts,
+ 'fid' => $fid,
+ 'gid' => $gid,
+ 'datatotal' => (count($data) + count($groups) + $datastart),
+ 'groupnext' => $gropunext,
+ 'localsearch' => $bz ? 1 : 0,
+ 'createFolderPerm'=>$createFolderPerm
+)
+);
+$params = json_encode($return['param']);
+require template('mobilefileselection/filelist');
+exit();
+
+
+
diff --git a/dzz/system/mobilefileselection/group.php b/dzz/system/mobilefileselection/group.php
new file mode 100644
index 0000000..fd6f327
--- /dev/null
+++ b/dzz/system/mobilefileselection/group.php
@@ -0,0 +1,64 @@
+ 0 ? 'ASC' : "DESC";
+
+switch ($disp) {
+ case 0:
+ $orderby = 'orgname';
+ break;
+ case 1:
+ $orderby = 'dateline';
+ break;
+
+}
+$ordersql = '';
+if (is_array($orderby)) {
+ foreach ($orderby as $key => $value) {
+ $orderby[$key] = $value . ' ' . $order;
+ }
+ $ordersql = ' ORDER BY ' . implode(',', $orderby);
+} elseif ($orderby) {
+ $ordersql = ' ORDER BY ' . $orderby . ' ' . $order;
+}
+$next = false;
+$nextstart = $start + $limit;
+$explorer_setting = get_resources_some_setting();
+$groups = array();
+//获取用户坐在群组id
+$orgids = C::t('organization_user')->fetch_org_by_uid($uid, 1);
+if (DB::result_first("select count(*) from %t where orgid in(%n) $ordersql ", array('organization', $orgids)) > $nextstart) {
+ $next = $nextstart;
+}
+if ($explorer_setting['grouponperm']) {
+ foreach (DB::fetch_all("select * from %t where orgid in(%n) $ordersql $limitsql", array('organization', $orgids)) as $orginfo) {
+ if ($orginfo['syatemon'] == 0) {//系统管理员关闭群组
+ continue;
+ } elseif ($orginfo['syatemon'] == 1 && $orginfo['manageon'] == 0 && C::t('organization_admin')->chk_memberperm($orginfo['orgid'], $uid) == 0) {//管理员关闭群组,当前用户不具备管理员权限
+ continue;
+ }
+ if (intval($orginfo['aid']) > 0) {
+ //群组图
+ $orginfo['imgs'] = 'index.php?mod=io&op=thumbnail&width=45&height=45&path=' . dzzencode('attach::' . $orginfo['aid']);
+ } /*else {
+ $orginfo['imgs'] = avatar_group($v['orgid'], array($orginfo['orgid'] => array('aid' => $orginfo['aid'], 'orgname' => $orginfo['orgname'])));
+ }*/
+ $contaions = C::t('resources')->get_contains_by_fid($orginfo['fid']);
+ $orginfo['filenum'] = $contaions['contain'][0];
+ $orginfo['foldernum'] = $contaions['contain'][1];
+ $groups[] = $orginfo;
+ }
+}
+require template('mobilefileselection/group');
\ No newline at end of file
diff --git a/dzz/system/mobilefileselection/home.php b/dzz/system/mobilefileselection/home.php
new file mode 100644
index 0000000..6eccac4
--- /dev/null
+++ b/dzz/system/mobilefileselection/home.php
@@ -0,0 +1,29 @@
+fetch_home_by_uid();
+ $myexplorer['name'] = lang('explorer_user_root_dirname');
+ $contains = C::t('resources')->get_contains_by_fid($myexplorer['fid']);
+ $myexplorer['filenum'] = $contains['contain'][0];
+ $myexplorer['foldernum'] = $contains['contain'][1];
+}
+if ($explorer_setting['orgonperm']) {
+ $orgs = C::t('organization')->fetch_all_orggroup($uid);
+ foreach ($orgs['org'] as $v) {
+ if(intval($v['aid'])){
+ $v['icon']='index.php?mod=io&op=thumbnail&width=24&height=24&path=' . dzzencode('attach::' . $v['aid']);
+ }
+ $contains = C::t('resources')->get_contains_by_fid($v['fid']);
+ $v['filenum'] = $contains['contain'][0];
+ $v['foldernum'] = $contains['contain'][1];
+ $myorgs[] = $v;
+ }
+}
+if ($explorer_setting['grouponperm']) {
+ $mygroup = true;
+}
+include template('mobilefileselection/index_content');
\ No newline at end of file
diff --git a/dzz/system/mobilefileselection/json.php b/dzz/system/mobilefileselection/json.php
new file mode 100644
index 0000000..9c8edfe
--- /dev/null
+++ b/dzz/system/mobilefileselection/json.php
@@ -0,0 +1,137 @@
+fetch_all();
+}
+
+$data['iconview'] = $iconview;
+
+$config = array();
+$config=C::t('user_field')->fetch($_G['uid']);
+$applist=$config['applist']?explode(',',$config['applist']):array();
+if($applist_n =array_keys(C::t('app_market')->fetch_all_by_notdelete($_G['uid']))) {
+ $newappids = array();
+ foreach ($applist_n as $appid) {
+ if (!in_array($appid, $applist)) {
+ $applist[] = $appid;
+ $newappids[] = $appid;
+ }
+ }
+ if ($newappids){
+ C::t('app_user')->insert_by_uid($_G['uid'], $newappids);
+ C::t('user_field')->update($_G['uid'], array('applist' => implode(',', $applist)));
+ }
+}
+//应用数据
+$appdata=array();
+$appdata=C::t('app_market')->fetch_all_by_appid($applist);
+//$arr['appdata']=microtime(true);
+$applist_1=array();
+foreach($appdata as $value){
+ if($value['isshow']<1) continue;
+ if($value['available']<1) continue;
+ if($value['system'] == 2) continue;
+ $applist_1[]=$value['appid'];
+}
+
+
+$data['applist']=array_values($applist_1);
+//获取系统桌面设置信息
+$icosdata = array();
+$data['noticebanlist'] = $config['noticebanlist'] ? explode(',', $config['noticebanlist']) : array();
+//获取打开方式
+/*$data['extopen']['all'] = C::t('app_open')->fetch_all_ext();
+$data['extopen']['ext'] = C::t('app_open')->fetch_all_orderby_ext($_G['uid'], $data['extopen']['all']);
+$data['extopen']['user'] = C::t('app_open_default')->fetch_all_by_uid($_G['uid']);
+//获取用户的默认打开方式
+$data['extopen']['userdefault'] = C::t('app_open_default')->fetch_all_by_uid($_G['uid']);
+//目录数据
+$folderdata = array();
+$data['cut']=array();
+//用户粘贴板数据
+$clipboardinfo = C::t('resources_clipboard')->fetch_by_uid($uid);
+if($clipboardinfo){
+ //复制类型1为复制,2为剪切
+ $copttype = $clipboardinfo['copytype'];
+ $data['cut']['iscut'] = ($copttype == 1) ? 0:1;
+
+ $files = explode(',',$clipboardinfo['files']);
+ foreach($files as $v){
+ $resourcesdata = C::t('resources')->fetch_by_rid($v);
+ if($resourcesdata['type'] == 'folder'){
+ $folderdata[$resourcesdata['fid']] = C::t('folder')->fetch_by_fid($resourcedata['oid']);
+ $icosdata[$v] = $resourcesdata;
+ }else{
+ $icosdata[$v] = $resourcesdata;
+ }
+ }
+ $data['cut']['icos'] = $files;
+}else{
+ $data['cut']['icos']=array();
+}*/
+
+$data['formhash'] = $_G['formhash'];
+
+
+$data['sourcedata'] = array(
+ 'icos' => $icosdata ? $icosdata : array(),
+ 'folder' => $folderdata ? $folderdata : array(),
+ 'app' => $appdata?$appdata:array()
+);
+$space['attachextensions'] = $space['attachextensions'] ? explode(',', $space['attachextensions']) : array();
+
+$data['myspace'] = $data['space'] = $space;
+$thame = getThames();
+$data['thame'] = $thame['data'];
+/*$infoPanelOpened = C::t('user_setting')->fetch_by_skey('infoPanelOpened');
+if (isset($infoPanelOpened)) {
+ $data['infoPanelOpened'] = ($infoPanelOpened) ? 1 : 0;
+} else {
+ C::t('user_setting')->update_by_skey('infoPanelOpened',1);
+ $data['infoPanelOpened'] = 1;
+}*/
+$data['mulitype'] = $mulitype;
+$data['fileselectiontype'] = $type;
+$data['callback_url'] = $callback;
+if($exttype){
+ $exttype = str_replace(array('"','|','$'),array('"','(',')'),$exttype);
+}
+$data['allowselecttype'] = json_decode($exttype);
+$data['defaultfilename'] = isset($filename) ? $filename:'';
+echo json_encode($data);
+exit();
diff --git a/dzz/system/mobilefileselection/listtree.php b/dzz/system/mobilefileselection/listtree.php
new file mode 100644
index 0000000..caea60f
--- /dev/null
+++ b/dzz/system/mobilefileselection/listtree.php
@@ -0,0 +1,9 @@
+fetch($fid);
+}
+include template('mobilefileselection/search');
\ No newline at end of file
diff --git a/dzz/system/mobilefileselection/searchfile.php b/dzz/system/mobilefileselection/searchfile.php
new file mode 100644
index 0000000..9f72fec
--- /dev/null
+++ b/dzz/system/mobilefileselection/searchfile.php
@@ -0,0 +1,171 @@
+ 0 ? 'ASC' : "DESC";
+
+$powerarr = perm_binPerm::getPowerArr();
+
+switch ($disp) {
+ case 0:
+ $orderby = 'r.name';
+ break;
+ case 1:
+ $orderby = 'r.size';
+ break;
+ case 2:
+ $orderby = array('r.type', 'ext');
+ break;
+ case 3:
+ $orderby = 'r.dateline';
+ break;
+
+}
+$ordersql = '';
+if (is_array($orderby)) {
+ foreach ($orderby as $key => $value) {
+ $orderby[$key] = $value . ' ' . $order;
+ }
+ $ordersql = ' ORDER BY ' . implode(',', $orderby);
+} elseif ($orderby) {
+ $ordersql = ' ORDER BY ' . $orderby . ' ' . $order;
+}
+$wheresql = ' where 1';
+$param = array('resources', 'folder');
+if ($keyword && !preg_match('/^\s*$/', $keyword)) {
+ $kewordsarr = explode(',', $keyword);
+ $tids = C::t('tag')->fetch_tid_by_tagname($kewordsarr, 'explorer');
+ $tagsql = '';
+ if ($tids) {
+ $rids = C::t('resources_tag')->fetch_rid_by_tid($tids);
+ if (count($rids)) {
+ $tagsql = " r.rid in(%n)";
+ $param[] = $rids;
+ }
+
+ }
+ $keywordsqlarr = array();
+ foreach ($kewordsarr as $v) {
+ $keywordsqlarr[] = " r.name like(%s) ";
+ $param[] = '%' . trim($v) . '%';
+ }
+ if ($tagsql) {
+ $wheresql .= " and ($tagsql or (" . implode(' or ', $keywordsqlarr) . "))";
+ } else {
+ $wheresql .= " and (" . implode(' or ', $keywordsqlarr) . ")";
+ }
+}
+//类型筛选
+if ($exts) {
+ if($exts == 'folder'){
+ $wheresql .= ' and r.type = %s';
+ $param[] = 'folder';
+ }else{
+ $extarr = explode(',', $exts);
+ $wheresql .= ' and r.ext in(%n)';
+ $param[] = $extarr;
+ }
+}
+$orgids = C::t('organization')->fetch_all_orgid();//获取所有有管理权限的部门
+$or = array();
+if (!$fid) {
+ //我的
+ $or[] = "(r.gid=0 and r.uid=%d)";
+ $param[] = $uid;
+ //我管理的群组或部门的文件
+ if ($orgids['orgids_admin']) {
+ $or[] = "r.gid IN (%n)";
+ $param[] = $orgids['orgids_admin'];
+ }
+
+ if ($orgids['orgids_member']) {
+ $or[] = "(r.gid IN(%n) and ((f.perm_inherit & %d) OR (r.uid=%d and f.perm_inherit & %d)))";
+ $param[] = $orgids['orgids_member'];
+ $param[] = $powerarr['read2'];
+ $param[] = $_G['uid'];
+ $param[] = $powerarr['read1'];
+ }
+
+
+} else {
+ $folderinfo = C::t('folder')->fetch($fid);
+ if (($folderinfo['gid'] > 0 && C::t('organization_admin')->chk_memberperm($gid)) || !$folderinfo['gid']) {//如果具有管理员权限
+ $wheresql .= ' and r.pfid = %d ';
+ $param[] = $fid;
+
+ } else {
+ $wheresql .= ' and r.pfid = %d and ((f.perm_inherit & %d) OR (r.uid=%d and f.perm_inherit & %d))';
+ $param[] = $fid;
+ $param[] = $powerarr['read2'];
+ $param[] = $_G['uid'];
+ $param[] = $powerarr['read1'];
+ }
+}
+if ($or && !$fid) $wheresql .= " and (" . implode(' OR ', $or) . ")";
+$data = array();
+$foldersids = $folderdata = array();
+if ($total = DB::result_first("SELECT COUNT(*) FROM %t r LEFT JOIN %t f ON r.pfid=f.fid $wheresql", $param) > $start) {
+ foreach (DB::fetch_all("SELECT r.rid FROM %t r LEFT JOIN %t f ON r.pfid=f.fid $wheresql $limitsql", $param) as $value) {
+ if ($arr = C::t('resources')->fetch_by_rid($value['rid'])) {
+ $folderids[$value['pfid']] = $arr['pfid'];
+ if ($arr['type'] == 'folder') {
+ $folderids[$arr['oid']] = $arr['oid'];
+ $arr['filenum'] = $arr['contaions']['contain'][0];
+ $arr['foldernum'] = $arr['contaions']['contain'][1];
+ } else {
+ $arr['monthdate'] = dgmdate($arr['dateline'], 'm-d');
+ $arr['hourdate'] = dgmdate($arr['dateline'], 'H:i');
+ }
+ if ($arr['type'] == 'image') {
+ $arr['img'] = DZZSCRIPT . '?mod=io&op=thumbnail&width=45&height=45&path=' . dzzencode('attach::' . $arr['aid']);
+ $arr['imgpath'] = DZZSCRIPT . '?mod=io&op=thumbnail&path=' . dzzencode('attach::' . $arr['aid']);
+ }
+ $data[$arr['rid']] = $arr;
+ }
+ }
+}
+
+$disp = isset($_GET['disp']) ? intval($_GET['disp']) : intval($usersettings['disp']);//文件排序
+if (!isset($usersettings['iconview'])) $usersettings['iconview'] = 4;
+$iconview = (isset($_GET['iconview']) ? intval($_GET['iconview']) : intval($usersettings['iconview']));//排列方式
+$next = false;
+if (count($data) >= $perpage) {
+ $next = $page + 1;
+}
+$return = array(
+ 'total' => count($data) + $start,
+ 'param' => array(
+ 'disp' => $disp,
+ 'view' => $iconview,
+ 'page' => $next,
+ 'perpage' => $perpage,
+ 'bz' => $bz,
+ 'datatotal' => count($data) + $start,
+ 'asc' => $asc,
+ 'keyword' => $keyword,
+ 'fid' => $fid,
+ 'localsearch' => $bz ? 1 : 0,
+ 'exts'=>$exts
+ ),
+);
+$params = json_encode($return['param']);
+require template('mobilefileselection/searchfile');
+exit();
\ No newline at end of file
diff --git a/dzz/system/scripts/mobile/appevent.js b/dzz/system/scripts/mobile/appevent.js
new file mode 100644
index 0000000..365e9b4
--- /dev/null
+++ b/dzz/system/scripts/mobile/appevent.js
@@ -0,0 +1,214 @@
+/**
+ * Created by a on 2018/5/3.
+ */
+(function($){
+ var touch = {},
+ touchTimeout, tapTimeout, swipeTimeout, longTapTimeout,
+ longTapDelay = 500,
+ gesture,
+ down, up, move,
+ eventMap,
+ initialized = false
+
+ function swipeDirection(x1, x2, y1, y2) {
+ return Math.abs(x1 - x2) >=
+ Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
+ }
+
+ function longTap() {
+ longTapTimeout = null
+ if (touch.last) {
+ touch.el.trigger('longTap')
+ touch = {}
+ }
+ }
+
+ function cancelLongTap() {
+ if (longTapTimeout) clearTimeout(longTapTimeout)
+ longTapTimeout = null
+ }
+
+ function cancelAll() {
+ if (touchTimeout) clearTimeout(touchTimeout)
+ if (tapTimeout) clearTimeout(tapTimeout)
+ if (swipeTimeout) clearTimeout(swipeTimeout)
+ if (longTapTimeout) clearTimeout(longTapTimeout)
+ touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null
+ touch = {}
+ }
+
+ function isPrimaryTouch(event){
+ return (event.pointerType == 'touch' ||
+ event.pointerType == event.MSPOINTER_TYPE_TOUCH)
+ && event.isPrimary
+ }
+
+ function isPointerEventType(e, type){
+ return (e.type == 'pointer'+type ||
+ e.type.toLowerCase() == 'mspointer'+type)
+ }
+
+ // helper function for tests, so they check for different APIs
+ function unregisterTouchEvents(){
+ if (!initialized) return
+ $(document).off(eventMap.down, down)
+ .off(eventMap.up, up)
+ .off(eventMap.move, move)
+ .off(eventMap.cancel, cancelAll)
+ $(window).off('scroll', cancelAll)
+ cancelAll()
+ initialized = false
+ }
+
+ function setup(__eventMap){
+ var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType
+
+ unregisterTouchEvents()
+
+ eventMap = (__eventMap && ('down' in __eventMap)) ? __eventMap :
+ ('ontouchstart' in document ?
+ { 'down': 'touchstart', 'up': 'touchend',
+ 'move': 'touchmove', 'cancel': 'touchcancel' } :
+ 'onpointerdown' in document ?
+ { 'down': 'pointerdown', 'up': 'pointerup',
+ 'move': 'pointermove', 'cancel': 'pointercancel' } :
+ 'onmspointerdown' in document ?
+ { 'down': 'MSPointerDown', 'up': 'MSPointerUp',
+ 'move': 'MSPointerMove', 'cancel': 'MSPointerCancel' } : false)
+
+ // No API availables for touch events
+ if (!eventMap) return
+
+ if ('MSGesture' in window) {
+ gesture = new MSGesture()
+ gesture.target = document.body
+
+ $(document)
+ .bind('MSGestureEnd', function(e){
+ var swipeDirectionFromVelocity =
+ e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null
+ if (swipeDirectionFromVelocity) {
+ touch.el.trigger('swipe')
+ touch.el.trigger('swipe'+ swipeDirectionFromVelocity)
+ }
+ })
+ }
+
+ down = function(e){
+ if((_isPointerType = isPointerEventType(e, 'down')) &&
+ !isPrimaryTouch(e)) return
+ firstTouch = _isPointerType ? e :((e.touches) ? e.touches[0]:e.originalEvent.changedTouches[0])
+ if (e.touches && e.touches.length === 1 && touch.x2) {
+ // Clear out touch movement data if we have it sticking around
+ // This can occur if touchcancel doesn't fire due to preventDefault, etc.
+ touch.x2 = undefined
+ touch.y2 = undefined
+ }
+ now = Date.now()
+ delta = now - (touch.last || now)
+ touch.el = jQuery('tagName' in firstTouch.target ?
+ firstTouch.target : firstTouch.target.parentNode)
+ touchTimeout && clearTimeout(touchTimeout)
+ touch.x1 = firstTouch.pageX
+ touch.y1 = firstTouch.pageY
+ if (delta > 0 && delta <= 250) touch.isDoubleTap = true
+ touch.last = now
+ longTapTimeout = setTimeout(longTap, longTapDelay)
+ // adds the current touch contact for IE gesture recognition
+ if (gesture && _isPointerType) gesture.addPointer(e.pointerId)
+ }
+
+ move = function(e){
+ if((_isPointerType = isPointerEventType(e, 'move')) &&
+ !isPrimaryTouch(e)) return
+ firstTouch = _isPointerType ? e :((e.touches) ? e.touches[0]:e.originalEvent.changedTouches[0])
+ cancelLongTap()
+ touch.x2 = firstTouch.pageX
+ touch.y2 = firstTouch.pageY
+
+ deltaX += Math.abs(touch.x1 - touch.x2)
+ deltaY += Math.abs(touch.y1 - touch.y2)
+ }
+
+ up = function(e){
+ if((_isPointerType = isPointerEventType(e, 'up')) &&
+ !isPrimaryTouch(e)) return
+ cancelLongTap()
+
+ // swipe
+ if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) ||
+ (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30))
+
+ swipeTimeout = setTimeout(function() {
+ if (touch.el){
+ touch.el.trigger('swipe')
+ touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
+ }
+ touch = {}
+ }, 0)
+
+ // normal tap
+ else if ('last' in touch)
+ // don't fire tap when delta position changed by more than 30 pixels,
+ // for instance when moving to a point and back to origin
+ if (deltaX < 30 && deltaY < 30) {
+ // delay by one tick so we can cancel the 'tap' event if 'scroll' fires
+ // ('tap' fires before 'scroll')
+ tapTimeout = setTimeout(function() {
+
+ // trigger universal 'tap' with the option to cancelTouch()
+ // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
+ var event = jQuery.Event('tap')
+ event.cancelTouch = cancelAll
+ // [by paper] fix -> "TypeError: 'undefined' is not an object (evaluating 'touch.el.trigger'), when double tap
+ if (touch.el) touch.el.trigger(event)
+
+ // trigger double tap immediately
+ if (touch.isDoubleTap) {
+ if (touch.el) touch.el.trigger('doubleTap')
+ touch = {}
+ }
+
+ // trigger single tap after 250ms of inactivity
+ else {
+ touchTimeout = setTimeout(function(){
+ touchTimeout = null
+ if (touch.el) touch.el.trigger('singleTap')
+ touch = {}
+ }, 250)
+ }
+ }, 0)
+ } else {
+ touch = {}
+ }
+ deltaX = deltaY = 0
+ }
+
+ jQuery(document).on(eventMap.up, up)
+ .on(eventMap.down, down)
+ .on(eventMap.move, move)
+
+ // when the browser window loses focus,
+ // for example when a modal dialog is shown,
+ // cancel all ongoing events
+ jQuery(document).on(eventMap.cancel, cancelAll)
+
+ // scrolling the window indicates intention of the user
+ // to scroll, not tap or swipe, so cancel all ongoing events
+ jQuery(window).on('scroll', cancelAll)
+
+ initialized = true
+ }
+
+ ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown',
+ 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){
+ jQuery.fn[eventName] = function(callback){return this.on(eventName, callback) }
+ /*jQuery.fn[eventName] = function(callback){
+ return jQuery(document).off(eventName).on(eventName,this,callback)
+ }*/
+ })
+
+ jQuery.touch = { setup: setup }
+
+ jQuery(document).ready(setup)
+})(jQuery)
diff --git a/dzz/system/scripts/mobile/explorer.js b/dzz/system/scripts/mobile/explorer.js
new file mode 100644
index 0000000..739cb9b
--- /dev/null
+++ b/dzz/system/scripts/mobile/explorer.js
@@ -0,0 +1,3 @@
+/**
+ * Created by a on 2018/5/23.
+ */
diff --git a/dzz/system/scripts/mobile/file_keep.js b/dzz/system/scripts/mobile/file_keep.js
new file mode 100644
index 0000000..7405e24
--- /dev/null
+++ b/dzz/system/scripts/mobile/file_keep.js
@@ -0,0 +1,319 @@
+var _filemanage = {};
+_filemanage = function (json) {
+ _filemanage.formhash = json.formhash || ''; //FORMHASH
+ _filemanage.type = json.type || 0;//文件选择类型,0为选择文件,1为保存文件,2为选择位置
+ _filemanage.mulitype = json.mulitype || 0;//是否允许多选,默认不允许
+ _filemanage.callback_url = json.callback_url;
+ _filemanage.token = json.token;
+ _filemanage.defaultfilename = json.filename;
+ if (_filemanage.type == 2) {
+ _filemanage.allowselecttype = {'folder': ['文件夹', ['folder'], 'selected']}
+ } else {
+ _filemanage.allowselecttype = json.exttype || '';//允许筛选文件类型
+ }
+ //默认筛选文件类型
+ if (_filemanage.allowselecttype) {
+ for (var o in _filemanage.allowselecttype) {
+ if (_filemanage.allowselecttype[o][2] == 'selected') {
+ _filemanage.defaultexttype = _filemanage.allowselecttype[o][1].join(',').toLowerCase();
+ }
+ }
+ } else {
+ _filemanage.defaultexttype = '';
+ }
+ _filemanage.defaultfilename = json.defaultfilename || '';
+};
+_filemanage.hash = '';
+_filemanage.getConfig = function (json, callback) {
+ new _filemanage(json);
+ _filemanage.hashHandler();
+ _filemanage.initEvents();
+ if (typeof callback === "function") {
+ callback(json);
+ }
+ //});
+};
+_filemanage.selector = [];//选择文件rid
+_filemanage.dataparam = {};//请求文件条件参数
+_filemanage.initEvents = function () { //初始化页面事件
+ _filemanage.height();
+ //hashchange事件
+ $(window).on('hashchange', function () {
+ _filemanage.hashHandler();
+ });
+ $(document).off('click.document-data').on('click.document-data', '.document-data', function () {
+ location.hash = jQuery(this).data('hash');
+ });
+ //右侧加载完成事件
+ $(document).off('ajaxLoad.middleContent').on('ajaxLoad.middleContent', function () {
+ var hash = location.hash.replace(/^#/i, '');
+ var op = hash.replace(/&(.+?)$/ig, '');
+ if (hash.indexOf('search') == 0) {
+ $('#footermenu').html('');
+ } else if (_filemanage.fid) {
+ if(_filemanage.dataparam.createFolderPerm){
+ $('#footer_menu').find('.filelistmenu .new-folder').removeClass('hide');
+ }else{
+ $('#footer_menu').find('.filelistmenu .new-folder').addClass('hide');
+ }
+ $('#footermenu').html($('#footer_menu').find('.filelistmenu').html());
+ } else {
+ $('#footermenu').html($('#footer_menu').find('.formatmenu').html());
+ }
+ //设置类型
+ if (_filemanage.allowselecttype) {
+ var typejson = _filemanage.allowselecttype, typehtml = '', selecttype = '', selectval = '';
+ for (var o in typejson) {
+ var exts = typejson[o][1].join(',').toLowerCase();
+ if (typejson[o][2] == 'selected') {
+ selecttype = typejson[o][0];
+ selectval = exts;
+ typehtml += '
' +
+ ' ' +
+ '
';
+ } else {
+ typehtml += '
' +
+ ' ' +
+ '
';
+ }
+
+
+ }
+ $('#footermenu .typeext').html(typehtml);
+ }
+ //加载更多
+ if (_filemanage.dataparam.page) {
+
+ //单页滚动加载
+ var loading = false; //状态标记
+ $(document.body).infinite().on("infinite", function () {
+ if (loading) return;
+ loading = true;
+ if (_filemanage.dataparam.page) {
+ $.post(_filemanage.appUrl + '&do=' + _filemanage.hash, _filemanage.dataparam, function (data) {
+ $('#containsdata').html(data);
+ $('#middleconMenu .filelist').append($('#containsdata').find('.weui-cells__margin_footer').html());
+ $('#containsdata').empty();
+ if (!_filemanage.dataparam.page) {
+ loading = false;
+ } else {
+ loading = true;
+ }
+ })
+
+ } else {
+ jQuery(document.body).destroyInfinite();
+ }
+ });
+ }
+ });
+
+};
+_filemanage.height = function () {
+ var h = $(document).outerHeight(true);
+ var h1 = $('.weui-file-keep').outerHeight(true);
+ var h2 = $('.weui-file-footer').outerHeight(true);
+ $('#middleconMenu').css('height', h - h1 - h2);
+}
+_filemanage.hashHandler = function () { //处理页面hash变化
+ var hash = location.hash;
+ hash = hash.replace(/^#/i, '');
+ if (!hash) {
+ hash = 'home';
+ }
+ if (hash === _filemanage.hash) {
+ return false;
+ }
+ if (hash !== _filemanage.hash) {
+ _filemanage.getContent(hash, $('#middleconMenu'));
+ _filemanage.hash = hash;
+ } else {
+ _filemanage.hash = hash;
+ }
+ return false;
+};
+_filemanage.getContent = function (hash, container) { //处理页面加载
+ var url = _filemanage.appUrl + '&do=' + hash;
+ if(url.indexOf('?') == -1){
+ url = url.replace('&','?');
+ }
+ _filemanage.dataparam = {};
+ if (_filemanage.defaultexttype) {
+ _filemanage.dataparam.exts = _filemanage.defaultexttype;
+ }
+ $.post(url, _filemanage.dataparam, function (data) {
+ $('#containsdata').html(data);
+ $('#middleconMenu').html($('#containsdata').find('.datacontent').html());
+ if ($('#containsdata').find('.addresscontent').length) {
+ $('#addressdata').html($('#containsdata').find('.addresscontent').html());
+ $('#addressdata').removeClass('hide');
+ }else if( _filemanage.hash.indexOf('home') == 0){
+ $('#addressdata').html('');
+ $('#addressdata').removeClass('hide');
+ }
+ if(_filemanage.hash.indexOf('search') == 0){
+ $('.weui-file-keep').addClass('hide');
+ $('#addressdata').addClass('hide');
+ }else{
+ $('.weui-file-keep').removeClass('hide');
+ }
+ $('#containsdata').empty();
+ $(document).trigger('ajaxLoad.middleContent', [hash]);
+ })
+
+};
+//打开文件夹
+$(document).off('tap.openhref').on('tap.openhref', '.document-data', function () {
+ var hash = $(this).data('hash');
+ location.hash = hash;
+})
+//排序
+$(document).off('tap.sort').on('tap.sort', '.sort_menu .sort', function () {
+ var sort = $(this).data('sort');
+ if (_filemanage.dataparam.disp == sort) _filemanage.dataparam.asc = (_filemanage.dataparam.asc > 0) ? 0 : 1;
+ else _filemanage.dataparam.disp = sort;
+ _filemanage.dataparam.page = 1;
+ _filemanage.dataparam.datatotal = 0;
+ if (_filemanage.defaultexttype) {
+ _filemanage.dataparam.exts = _filemanage.defaultexttype;
+ }
+ $.post(_filemanage.appUrl + '&do=' + _filemanage.hash, _filemanage.dataparam, function (data) {
+ $('#containsdata').html(data);
+ $('#middleconMenu').html($('#containsdata').find('.datacontent').html());
+ if ($('#containsdata').find('.addresscontent').length) {
+ $('#addressdata').html($('#containsdata').find('.addresscontent').html());
+ $('#addressdata').removeClass('hide');
+ }
+ $('#containsdata').empty();
+ $('.sort_menu').addClass('hide');
+ })
+})
+//类型筛选
+$(document).off('tap.exts').on('tap.exts', '.weui-check__label', function () {
+ var obj = $(this);
+ var exts = obj.find('.weui-cell__ft input').val();
+ _filemanage.dataparam.exts = exts;
+ _filemanage.dataparam.page = 1;
+ _filemanage.dataparam.datatotal = 0;
+ $.post(_filemanage.appUrl + '&do=' + _filemanage.hash, _filemanage.dataparam, function (data) {
+ $('#containsdata').html(data);
+ $('#middleconMenu').html($('#containsdata').find('.datacontent').html());
+ if ($('#containsdata').find('.addresscontent').length) {
+ $('#addressdata').html($('#containsdata').find('.addresscontent').html());
+ $('#addressdata').removeClass('hide');
+ }
+ $('#containsdata').empty();
+ obj.closest('.typeext').addClass('hide');
+ })
+
+})
+//搜索文件
+$(document).off('tap.search').on('tap.search', '.search', function () {
+ var hash = 'search', oldhash = _filemanage.hash;
+ oldhash = oldhash.replace(/&/g, '-');
+ if (_filemanage.fid) {
+ hash += '&fid=' + _filemanage.fid + '&oldhash=' + oldhash;
+ }
+ location.hash = hash;
+})
+
+//文件选择
+$(document).off('tap.selectFile').on('tap.selectFile', '.document-filelist', function () {
+ var obj = $(this), rid = obj.data('rid'), index = $.inArray(rid, _filemanage.selector);
+ if (_filemanage.mulitype) {
+ if (obj.find('.weui-cells_checkbox .weui-check').prop('checked')) {
+ obj.find('.weui-cells_checkbox').addClass('hide');
+ obj.find('.weui-cells_checkbox .weui-check').prop('checked', false);
+ if (index != -1) {
+ _filemanage.selector.splice(index, 1);
+ }
+ } else {
+ obj.find('.weui-cells_checkbox').removeClass('hide');
+ obj.find('.weui-cells_checkbox .weui-check').prop('checked', true);
+ if (index == -1) {
+ _filemanage.selector.push(rid);
+ }
+ }
+ } else {
+ if (obj.find('.weui-cells_checkbox .weui-check').prop('checked')) {
+ $('.weui-cells_checkbox').each(function () {
+ $(this).find('.weui-check').prop('checked', false);
+ $(this).addClass('hide');
+ })
+ if (index != -1) {
+ _filemanage.selector.splice(index, 1);
+ }
+ } else {
+ $('.weui-cells_checkbox').each(function () {
+ $(this).find('.weui-check').prop('checked', false);
+ $(this).addClass('hide');
+ })
+ obj.find('.weui-cells_checkbox').removeClass('hide');
+ obj.find('.weui-cells_checkbox .weui-check').prop('checked', true);
+ if (index == -1) {
+ _filemanage.selector.push(rid);
+ }
+ }
+
+ }
+
+
+})
+//新建文件夹
+jQuery(document).off('tap.docreate').on('tap.docreate', '.new-folder', function (placeholder) {
+ var obj = $(this);
+ $.prompt({
+ title: '新建文件夹',
+ placeholder: '新建文件夹',
+ empty: false, // 是否允许为空
+ onOK: function (input) {
+ var foldername = $('#weui-prompt-input').val(),
+ fid = _filemanage.fid, emojpatt = /[\ud800-\udbff][\udc00-\udfff]/gi;
+ if (emojpatt.test(foldername)) {
+ $.toast('文件名不合法!', "cancel");
+ $('#weui-prompt-input').val('');
+ return false;
+ }
+ $.post(_filemanage.appUrl + '&do=ajax&operation=createFolder', {
+ 'foldername': foldername,
+ 'fid': fid,
+ }, function (data) {
+ if (data['error']) {
+ $.toast(data['error'], 1000);
+ } else {
+ var html = '
' +
+ '
' +
+ '
' +
+ '
' + data.name + ' ' +
+ '文件: 0, ' +
+ '文件夹: 0
' +
+ '
';
+ $('.filelist').prepend(html);
+ $.toast("操作成功");
+ }
+ }, 'json');
+
+ },
+ onCancel: function () {
+ $('#weui-prompt-input').val('');
+ obj.closest('div.weui-dropup').addClass('hide');
+ obj.closest('div.weui-dropup').siblings('.background-none').hide();
+ obj.closest('div.weui-dropup').siblings('.weui-footer-new-folder').find('p').css('color', '#666');
+ }
+ });
+});
+//弹出框点击其他地方消失
+jQuery(document).off('tap.confirm').on('tap.confirm', '.background-none', function () {
+ $(this).prev('.weui-dropup').addClass('hide');
+ $(this).prevAll('.weui-footer-none').find('p').css({'color': '#666666'});
+ $(this).hide();
+})
+//排序菜单
+jQuery(document).off('tap.array').on('tap.array', '.weui-footer-sort', function () {
+ var dropup = $(this).next('.weui-dropup');
+ if (dropup.hasClass('hide')) {
+ dropup.removeClass('hide');
+ dropup.next('.background-none').show();
+ $(this).find('p').css({'color': '#3779ff'});
+ }
+})
\ No newline at end of file
diff --git a/dzz/system/template/header_left.htm b/dzz/system/template/header_left.htm
index fbc1a46..2f293c4 100644
--- a/dzz/system/template/header_left.htm
+++ b/dzz/system/template/header_left.htm
@@ -2,4 +2,10 @@
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/dzz/system/template/header_search.htm b/dzz/system/template/header_search.htm
index f663f3b..01eb355 100644
--- a/dzz/system/template/header_search.htm
+++ b/dzz/system/template/header_search.htm
@@ -1,3 +1,4 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dzz/system/template/mobilefileselection/index_content.htm b/dzz/system/template/mobilefileselection/index_content.htm
new file mode 100644
index 0000000..bcefc92
--- /dev/null
+++ b/dzz/system/template/mobilefileselection/index_content.htm
@@ -0,0 +1,53 @@
+
\ No newline at end of file
diff --git a/dzz/system/template/mobilefileselection/search.htm b/dzz/system/template/mobilefileselection/search.htm
new file mode 100644
index 0000000..5a0f803
--- /dev/null
+++ b/dzz/system/template/mobilefileselection/search.htm
@@ -0,0 +1,155 @@
+
+
+
+
+
+ $folderdata[fname]
+
+
+
+ 取消
+
+
+
类型限制: 无
+
+
+
‘$folderdata[fname]’中搜索结果
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dzz/system/template/mobilefileselection/searchfile.htm b/dzz/system/template/mobilefileselection/searchfile.htm
new file mode 100644
index 0000000..41694d7
--- /dev/null
+++ b/dzz/system/template/mobilefileselection/searchfile.htm
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
{eval echo str_replace('\\','',$v['name']);}
+
+ 文件: $v[filenum],
+ 文件夹: $v[foldernum]
+
+
+
+
+
+
+
+
+
{eval echo str_replace('\\','',$v['name']);}
+
+ $v[monthdate] $v[hourdate],
+ $v[fsize]
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/static/jquery_weui/.project b/static/jquery_weui/.project
new file mode 100644
index 0000000..d12a692
--- /dev/null
+++ b/static/jquery_weui/.project
@@ -0,0 +1,17 @@
+
+
+ jquery-weui
+
+
+
+
+
+ com.aptana.ide.core.unifiedBuilder
+
+
+
+
+
+ com.aptana.projects.webnature
+
+
diff --git a/static/jquery_weui/css/jquery-weui.min.css b/static/jquery_weui/css/jquery-weui.min.css
new file mode 100644
index 0000000..7231a63
--- /dev/null
+++ b/static/jquery_weui/css/jquery-weui.min.css
@@ -0,0 +1,6 @@
+/**
+* jQuery WeUI V1.2.0
+* By 言川
+* http://lihongxun945.github.io/jquery-weui/
+ */
+.preloader{width:20px;height:20px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:preloader-spin 1s steps(12,end) infinite;animation:preloader-spin 1s steps(12,end) infinite}.preloader:after{display:block;width:100%;height:100%;content:"";background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:50%;background-size:100%}@-webkit-keyframes preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}label>*{pointer-events:none}html{font-size:20px}body{font-size:16px}@media only screen and (min-width:400px){html{font-size:21.33px!important}}@media only screen and (min-width:414px){html{font-size:22.08px!important}}@media only screen and (min-width:480px){html{font-size:25.6px!important}}.weui_navbar{z-index:10}.weui-mask,.weui-popup-container,.weui-popup-overlay{z-index:1000}.weui-row{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-lines:multiple;-moz-box-lines:multiple;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-row>[class*=col-]{box-sizing:border-box}.weui-row .col-auto{width:100%}.weui-row .weui-col-100{width:100%;width:calc((100% - 15px*0)/ 1)}.weui-row.weui-no-gutter .weui-col-100{width:100%}.weui-row .weui-col-95{width:95%;width:calc((100% - 15px*.05263157894736836)/ 1.0526315789473684)}.weui-row.weui-no-gutter .weui-col-95{width:95%}.weui-row .weui-col-90{width:90%;width:calc((100% - 15px*.11111111111111116)/ 1.1111111111111112)}.weui-row.weui-no-gutter .weui-col-90{width:90%}.weui-row .weui-col-85{width:85%;width:calc((100% - 15px*.17647058823529416)/ 1.1764705882352942)}.weui-row.weui-no-gutter .weui-col-85{width:85%}.weui-row .weui-col-80{width:80%;width:calc((100% - 15px*.25)/ 1.25)}.weui-row.weui-no-gutter .weui-col-80{width:80%}.weui-row .weui-col-75{width:75%;width:calc((100% - 15px*.33333333333333326)/ 1.3333333333333333)}.weui-row.weui-no-gutter .weui-col-75{width:75%}.weui-row .weui-col-66{width:66.66666666666666%;width:calc((100% - 15px*.5000000000000002)/ 1.5000000000000002)}.weui-row.weui-no-gutter .weui-col-66{width:66.66666666666666%}.weui-row .weui-col-60{width:60%;width:calc((100% - 15px*.6666666666666667)/ 1.6666666666666667)}.weui-row.weui-no-gutter .weui-col-60{width:60%}.weui-row .weui-col-50{width:50%;width:calc((100% - 15px*1)/ 2)}.weui-row.weui-no-gutter .weui-col-50{width:50%}.weui-row .weui-col-40{width:40%;width:calc((100% - 15px*1.5)/ 2.5)}.weui-row.weui-no-gutter .weui-col-40{width:40%}.weui-row .weui-col-33{width:33.333333333333336%;width:calc((100% - 15px*2)/ 3)}.weui-row.weui-no-gutter .weui-col-33{width:33.333333333333336%}.weui-row .weui-col-25{width:25%;width:calc((100% - 15px*3)/ 4)}.weui-row.weui-no-gutter .weui-col-25{width:25%}.weui-row .weui-col-20{width:20%;width:calc((100% - 15px*4)/ 5)}.weui-row.weui-no-gutter .weui-col-20{width:20%}.weui-row .weui-col-15{width:15%;width:calc((100% - 15px*5.666666666666667)/ 6.666666666666667)}.weui-row.weui-no-gutter .weui-col-15{width:15%}.weui-row .weui-col-10{width:10%;width:calc((100% - 15px*9)/ 10)}.weui-row.weui-no-gutter .weui-col-10{width:10%}.weui-row .weui-col-5{width:5%;width:calc((100% - 15px*19)/ 20)}.weui-row.weui-no-gutter .weui-col-5{width:5%}.weui-row .weui-col-auto:nth-last-child(1),.weui-row .weui-col-auto:nth-last-child(1)~.weui-col-auto{width:100%;width:calc((100% - 15px*0)/ 1)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(1),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(1)~.weui-col-auto{width:100%}.weui-row .weui-col-auto:nth-last-child(2),.weui-row .weui-col-auto:nth-last-child(2)~.weui-col-auto{width:50%;width:calc((100% - 15px*1)/ 2)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(2),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(2)~.weui-col-auto{width:50%}.weui-row .weui-col-auto:nth-last-child(3),.weui-row .weui-col-auto:nth-last-child(3)~.weui-col-auto{width:33.33333333%;width:calc((100% - 15px*2)/ 3)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(3),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(3)~.weui-col-auto{width:33.33333333%}.weui-row .weui-col-auto:nth-last-child(4),.weui-row .weui-col-auto:nth-last-child(4)~.weui-col-auto{width:25%;width:calc((100% - 15px*3)/ 4)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(4),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(4)~.weui-col-auto{width:25%}.weui-row .weui-col-auto:nth-last-child(5),.weui-row .weui-col-auto:nth-last-child(5)~.weui-col-auto{width:20%;width:calc((100% - 15px*4)/ 5)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(5),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(5)~.weui-col-auto{width:20%}.weui-row .weui-col-auto:nth-last-child(6),.weui-row .weui-col-auto:nth-last-child(6)~.weui-col-auto{width:16.66666667%;width:calc((100% - 15px*5)/ 6)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(6),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(6)~.weui-col-auto{width:16.66666667%}.weui-row .weui-col-auto:nth-last-child(7),.weui-row .weui-col-auto:nth-last-child(7)~.weui-col-auto{width:14.28571429%;width:calc((100% - 15px*6)/ 7)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(7),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(7)~.weui-col-auto{width:14.28571429%}.weui-row .weui-col-auto:nth-last-child(8),.weui-row .weui-col-auto:nth-last-child(8)~.weui-col-auto{width:12.5%;width:calc((100% - 15px*7)/ 8)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(8),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(8)~.weui-col-auto{width:12.5%}.weui-row .weui-col-auto:nth-last-child(9),.weui-row .weui-col-auto:nth-last-child(9)~.weui-col-auto{width:11.11111111%;width:calc((100% - 15px*8)/ 9)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(9),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(9)~.weui-col-auto{width:11.11111111%}.weui-row .weui-col-auto:nth-last-child(10),.weui-row .weui-col-auto:nth-last-child(10)~.weui-col-auto{width:10%;width:calc((100% - 15px*9)/ 10)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(10),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(10)~.weui-col-auto{width:10%}.weui-row .weui-col-auto:nth-last-child(11),.weui-row .weui-col-auto:nth-last-child(11)~.weui-col-auto{width:9.09090909%;width:calc((100% - 15px*10)/ 11)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(11),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(11)~.weui-col-auto{width:9.09090909%}.weui-row .weui-col-auto:nth-last-child(12),.weui-row .weui-col-auto:nth-last-child(12)~.weui-col-auto{width:8.33333333%;width:calc((100% - 15px*11)/ 12)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(12),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(12)~.weui-col-auto{width:8.33333333%}.weui-row .weui-col-auto:nth-last-child(13),.weui-row .weui-col-auto:nth-last-child(13)~.weui-col-auto{width:7.69230769%;width:calc((100% - 15px*12)/ 13)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(13),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(13)~.weui-col-auto{width:7.69230769%}.weui-row .weui-col-auto:nth-last-child(14),.weui-row .weui-col-auto:nth-last-child(14)~.weui-col-auto{width:7.14285714%;width:calc((100% - 15px*13)/ 14)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(14),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(14)~.weui-col-auto{width:7.14285714%}.weui-row .weui-col-auto:nth-last-child(15),.weui-row .weui-col-auto:nth-last-child(15)~.weui-col-auto{width:6.66666667%;width:calc((100% - 15px*14)/ 15)}.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(15),.weui-row.weui-no-gutter .weui-col-auto:nth-last-child(15)~.weui-col-auto{width:6.66666667%}@media all and (min-width:768px){.row .tablet-100{width:100%;width:calc((100% - 15px*0)/ 1)}.row.no-gutter .tablet-100{width:100%}.row .tablet-95{width:95%;width:calc((100% - 15px*.05263157894736836)/ 1.0526315789473684)}.row.no-gutter .tablet-95{width:95%}.row .tablet-90{width:90%;width:calc((100% - 15px*.11111111111111116)/ 1.1111111111111112)}.row.no-gutter .tablet-90{width:90%}.row .tablet-85{width:85%;width:calc((100% - 15px*.17647058823529416)/ 1.1764705882352942)}.row.no-gutter .tablet-85{width:85%}.row .tablet-80{width:80%;width:calc((100% - 15px*.25)/ 1.25)}.row.no-gutter .tablet-80{width:80%}.row .tablet-75{width:75%;width:calc((100% - 15px*.33333333333333326)/ 1.3333333333333333)}.row.no-gutter .tablet-75{width:75%}.row .tablet-66{width:66.66666666666666%;width:calc((100% - 15px*.5000000000000002)/ 1.5000000000000002)}.row.no-gutter .tablet-66{width:66.66666666666666%}.row .tablet-60{width:60%;width:calc((100% - 15px*.6666666666666667)/ 1.6666666666666667)}.row.no-gutter .tablet-60{width:60%}.row .tablet-50{width:50%;width:calc((100% - 15px*1)/ 2)}.row.no-gutter .tablet-50{width:50%}.row .tablet-40{width:40%;width:calc((100% - 15px*1.5)/ 2.5)}.row.no-gutter .tablet-40{width:40%}.row .tablet-33{width:33.333333333333336%;width:calc((100% - 15px*2)/ 3)}.row.no-gutter .tablet-33{width:33.333333333333336%}.row .tablet-25{width:25%;width:calc((100% - 15px*3)/ 4)}.row.no-gutter .tablet-25{width:25%}.row .tablet-20{width:20%;width:calc((100% - 15px*4)/ 5)}.row.no-gutter .tablet-20{width:20%}.row .tablet-15{width:15%;width:calc((100% - 15px*5.666666666666667)/ 6.666666666666667)}.row.no-gutter .tablet-15{width:15%}.row .tablet-10{width:10%;width:calc((100% - 15px*9)/ 10)}.row.no-gutter .tablet-10{width:10%}.row .tablet-5{width:5%;width:calc((100% - 15px*19)/ 20)}.row.no-gutter .tablet-5{width:5%}.row .tablet-auto:nth-last-child(1),.row .tablet-auto:nth-last-child(1)~.col-auto{width:100%;width:calc((100% - 15px*0)/ 1)}.row.no-gutter .tablet-auto:nth-last-child(1),.row.no-gutter .tablet-auto:nth-last-child(1)~.tablet-auto{width:100%}.row .tablet-auto:nth-last-child(2),.row .tablet-auto:nth-last-child(2)~.col-auto{width:50%;width:calc((100% - 15px*1)/ 2)}.row.no-gutter .tablet-auto:nth-last-child(2),.row.no-gutter .tablet-auto:nth-last-child(2)~.tablet-auto{width:50%}.row .tablet-auto:nth-last-child(3),.row .tablet-auto:nth-last-child(3)~.col-auto{width:33.33333333%;width:calc((100% - 15px*2)/ 3)}.row.no-gutter .tablet-auto:nth-last-child(3),.row.no-gutter .tablet-auto:nth-last-child(3)~.tablet-auto{width:33.33333333%}.row .tablet-auto:nth-last-child(4),.row .tablet-auto:nth-last-child(4)~.col-auto{width:25%;width:calc((100% - 15px*3)/ 4)}.row.no-gutter .tablet-auto:nth-last-child(4),.row.no-gutter .tablet-auto:nth-last-child(4)~.tablet-auto{width:25%}.row .tablet-auto:nth-last-child(5),.row .tablet-auto:nth-last-child(5)~.col-auto{width:20%;width:calc((100% - 15px*4)/ 5)}.row.no-gutter .tablet-auto:nth-last-child(5),.row.no-gutter .tablet-auto:nth-last-child(5)~.tablet-auto{width:20%}.row .tablet-auto:nth-last-child(6),.row .tablet-auto:nth-last-child(6)~.col-auto{width:16.66666667%;width:calc((100% - 15px*5)/ 6)}.row.no-gutter .tablet-auto:nth-last-child(6),.row.no-gutter .tablet-auto:nth-last-child(6)~.tablet-auto{width:16.66666667%}.row .tablet-auto:nth-last-child(7),.row .tablet-auto:nth-last-child(7)~.col-auto{width:14.28571429%;width:calc((100% - 15px*6)/ 7)}.row.no-gutter .tablet-auto:nth-last-child(7),.row.no-gutter .tablet-auto:nth-last-child(7)~.tablet-auto{width:14.28571429%}.row .tablet-auto:nth-last-child(8),.row .tablet-auto:nth-last-child(8)~.col-auto{width:12.5%;width:calc((100% - 15px*7)/ 8)}.row.no-gutter .tablet-auto:nth-last-child(8),.row.no-gutter .tablet-auto:nth-last-child(8)~.tablet-auto{width:12.5%}.row .tablet-auto:nth-last-child(9),.row .tablet-auto:nth-last-child(9)~.col-auto{width:11.11111111%;width:calc((100% - 15px*8)/ 9)}.row.no-gutter .tablet-auto:nth-last-child(9),.row.no-gutter .tablet-auto:nth-last-child(9)~.tablet-auto{width:11.11111111%}.row .tablet-auto:nth-last-child(10),.row .tablet-auto:nth-last-child(10)~.col-auto{width:10%;width:calc((100% - 15px*9)/ 10)}.row.no-gutter .tablet-auto:nth-last-child(10),.row.no-gutter .tablet-auto:nth-last-child(10)~.tablet-auto{width:10%}.row .tablet-auto:nth-last-child(11),.row .tablet-auto:nth-last-child(11)~.col-auto{width:9.09090909%;width:calc((100% - 15px*10)/ 11)}.row.no-gutter .tablet-auto:nth-last-child(11),.row.no-gutter .tablet-auto:nth-last-child(11)~.tablet-auto{width:9.09090909%}.row .tablet-auto:nth-last-child(12),.row .tablet-auto:nth-last-child(12)~.col-auto{width:8.33333333%;width:calc((100% - 15px*11)/ 12)}.row.no-gutter .tablet-auto:nth-last-child(12),.row.no-gutter .tablet-auto:nth-last-child(12)~.tablet-auto{width:8.33333333%}.row .tablet-auto:nth-last-child(13),.row .tablet-auto:nth-last-child(13)~.col-auto{width:7.69230769%;width:calc((100% - 15px*12)/ 13)}.row.no-gutter .tablet-auto:nth-last-child(13),.row.no-gutter .tablet-auto:nth-last-child(13)~.tablet-auto{width:7.69230769%}.row .tablet-auto:nth-last-child(14),.row .tablet-auto:nth-last-child(14)~.col-auto{width:7.14285714%;width:calc((100% - 15px*13)/ 14)}.row.no-gutter .tablet-auto:nth-last-child(14),.row.no-gutter .tablet-auto:nth-last-child(14)~.tablet-auto{width:7.14285714%}.row .tablet-auto:nth-last-child(15),.row .tablet-auto:nth-last-child(15)~.col-auto{width:6.66666667%;width:calc((100% - 15px*14)/ 15)}.row.no-gutter .tablet-auto:nth-last-child(15),.row.no-gutter .tablet-auto:nth-last-child(15)~.tablet-auto{width:6.66666667%}}.weui-cell__hd img{display:block;margin-right:5px}.weui-cell_swiped .weui-cell__bd{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.swipeout-touching .weui-cell__bd{-webkit-transition:none;transition:none}.weui-dialog,.weui-toast{-webkit-transition-duration:.2s;transition-duration:.2s;opacity:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:0 0;transform-origin:0 0;visibility:hidden;margin:0;top:45%;z-index:2000}.weui-dialog .weui-dialog__btn.default,.weui-toast .weui-dialog__btn.default{color:#5f646e}.weui-dialog .weui-dialog__btn+.weui-dialog__btn,.weui-toast .weui-dialog__btn+.weui-dialog__btn{position:relative}.weui-dialog .weui-dialog__btn+.weui-dialog__btn:after,.weui-toast .weui-dialog__btn+.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;height:100%;border-left:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog.weui-dialog--visible,.weui-dialog.weui-toast--visible,.weui-toast.weui-dialog--visible,.weui-toast.weui-toast--visible{opacity:1;visibility:visible}.weui-toast_forbidden{color:#F76260}.weui-toast_cancel .weui-icon-toast:before{content:"\EA0D"}.weui-toast_forbidden .weui-icon-toast:before{content:"\EA0B";color:#F76260}.weui-toast_text{min-height:1em;width:auto;height:45px;border-radius:25px;margin-left:0;-webkit-transform:scale(.9) translate3d(-50%,0,0);transform:scale(.9) translate3d(-50%,0,0);-webkit-transform-origin:left;transform-origin:left}.weui-toast_text.weui-toast--visible{-webkit-transform:scale(1) translate3d(-50%,0,0);transform:scale(1) translate3d(-50%,0,0)}.weui-toast_text .weui-icon-toast{display:none}.weui-toast_text .weui-toast_content{margin:10px 15px}.weui-mask{opacity:0;-webkit-transition-duration:.3s;transition-duration:.3s;visibility:hidden}.weui-mask.weui-mask--visible{opacity:1;visibility:visible}.weui-prompt-input{padding:4px 6px;border:1px solid #ccc;box-sizing:border-box;height:2em;width:80%;margin-top:10px}.weui-pull-to-refresh{margin-top:-50px;-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.weui-pull-to-refresh.refreshing{-webkit-transform:translate3d(0,50px,0);transform:translate3d(0,50px,0)}.weui-pull-to-refresh.touching{-webkit-transition-duration:0s;transition-duration:0s}.weui-pull-to-refresh__layer{height:30px;line-height:30px;padding:10px;text-align:center}.weui-pull-to-refresh__layer .down{display:inline-block}.weui-pull-to-refresh__layer .refresh,.weui-pull-to-refresh__layer .up{display:none}.weui-pull-to-refresh__layer .weui-pull-to-refresh__arrow{display:inline-block;z-index:10;width:20px;height:20px;margin-right:4px;vertical-align:-4px;background:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2026%2040'%3E%3Cpolygon%20points%3D'9%2C22%209%2C0%2017%2C0%2017%2C22%2026%2C22%2013.5%2C40%200%2C22'%20fill%3D'%238c8c8c'%2F%3E%3C%2Fsvg%3E") center no-repeat;background-size:13px 20px;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transform:rotate(0) translate3d(0,0,0);transform:rotate(0) translate3d(0,0,0)}.weui-pull-to-refresh__layer .weui-pull-to-refresh__preloader{display:none;vertical-align:-4px;margin-right:4px;width:20px;height:20px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:preloader-spin 1s steps(12,end) infinite;animation:preloader-spin 1s steps(12,end) infinite}.weui-pull-to-refresh__layer .weui-pull-to-refresh__preloader:after{display:block;width:100%;height:100%;content:"";background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:50%;background-size:100%}.pull-up .weui-pull-to-refresh__layer .down,.refreshing .weui-pull-to-refresh__layer .down{display:none}.pull-up .weui-pull-to-refresh__layer .weui-pull-to-refresh__arrow{display:inline-block;-webkit-transform:rotate(180deg) translate3d(0,0,0);transform:rotate(180deg) translate3d(0,0,0)}.pull-down .weui-pull-to-refresh__layer .down,.pull-down .weui-pull-to-refresh__layer .weui-pull-to-refresh__arrow,.pull-up .weui-pull-to-refresh__layer .up{display:inline-block}.refreshing .weui-pull-to-refresh__layer .weui-pull-to-refresh__arrow{display:none}.refreshing .weui-pull-to-refresh__layer .refresh,.refreshing .weui-pull-to-refresh__layer .weui-pull-to-refresh__preloader{display:inline-block}@keyframes preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.weui-tab__bd-item.weui-pull-to-refresh{position:absolute;top:50px}.toolbar,.weui-tabbar__item{position:relative}.weui-tabbar__item.weui-bar__item--on .weui-tabbar__label{color:#04BE02}.weui-navbar__item{color:#888}.weui-navbar__item.weui-bar__item--on{color:#666;background-color:#f1f1f1}.toolbar,.toolbar .title{font-size:.85rem;color:#3d4145;width:100%}.weui-tab__bd{box-sizing:border-box;height:100%}.weui-tab__bd .weui-tab__bd-item{display:none;height:100%;overflow:auto}.weui-tab__bd .weui-tab__bd-item.weui-tab__bd-item--active{display:block}.weui-navbar+.weui-tab__bd{padding-top:50px}.toolbar{line-height:1.5;background:#f7f7f8}.toolbar:before{content:'';position:absolute;left:0;top:0;bottom:auto;right:auto;height:1px;width:100%;background-color:#d9d9d9;display:block;z-index:15;-webkit-transform-origin:50% 0;transform-origin:50% 0}.toolbar .toolbar-inner,.weui-picker-modal .picker-items{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex}@media only screen and (-webkit-min-device-pixel-ratio:2){.toolbar:before{-webkit-transform:scaleY(.5);transform:scaleY(.5)}}@media only screen and (-webkit-min-device-pixel-ratio:3){.toolbar:before{-webkit-transform:scaleY(.33);transform:scaleY(.33)}}.toolbar .toolbar-inner{height:2.2rem;display:flex;text-align:center}.toolbar .title{position:absolute;display:block;padding:0;font-weight:400;line-height:2.2rem;text-align:center;white-space:nowrap}.toolbar .picker-button{position:absolute;right:0;box-sizing:border-box;height:2.2rem;line-height:2.2rem;color:#04BE02;z-index:1;padding:0 .5rem}.weui-picker-modal{width:100%;position:absolute;bottom:0;text-align:center;border-radius:0;opacity:.6;color:#3d4145;-webkit-transition-duration:.3s;transition-duration:.3s;height:13rem;background:#EFEFF4;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform}.weui-picker-modal.picker-modal-inline{height:10.8rem;opacity:1;position:static;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.weui-picker-modal.picker-modal-inline .toolbar{display:none}.weui-picker-modal.picker-columns-single .picker-items-col{width:100%}.weui-picker-modal.weui-picker-modal-visible{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.weui-picker-modal .picker-modal-inner{position:relative;height:10.8rem}.weui-picker-modal .picker-columns{width:100%;height:13rem;z-index:11500}.popover .weui-picker-modal .picker-columns,.weui-picker-modal .picker-columns.picker-modal-inline{height:10rem}@media (orientation:landscape) and (max-height:415px){.weui-picker-modal .picker-columns:not(.picker-modal-inline){height:10rem}}.weui-picker-modal .popover.popover-picker-columns{width:14rem}.weui-picker-modal .picker-items{display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;width:100%;padding:0;text-align:right;font-size:1rem;font-weight:400;-webkit-mask-box-image:-webkit-linear-gradient(bottom,transparent,transparent 5%,#fff 20%,#fff 80%,transparent 95%,transparent);-webkit-mask-box-image:linear-gradient(to top,transparent,transparent 5%,#fff 20%,#fff 80%,transparent 95%,transparent)}.weui-picker-modal .bar+.picker-items{height:10.8rem}.weui-picker-modal .picker-items-col{overflow:hidden;position:relative;max-height:100%}.weui-picker-modal .picker-items-col.picker-items-col-left{text-align:left}.weui-picker-modal .picker-items-col.picker-items-col-center{text-align:center}.weui-picker-modal .picker-items-col.picker-items-col-right{text-align:right}.weui-picker-modal .picker-items-col.picker-items-col-divider{color:#3d4145;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center}.weui-picker-modal .picker-items-col-wrapper{-webkit-transition:.3s;transition:.3s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.weui-picker-modal .picker-item{height:32px;line-height:32px;padding:0 10px;white-space:nowrap;position:relative;overflow:hidden;text-overflow:ellipsis;color:#9b9b9b;left:0;top:0;width:100%;box-sizing:border-box;-webkit-transition:.3s;transition:.3s}.picker-items-col-absolute .weui-picker-modal .picker-item{position:absolute}.weui-picker-modal .picker-item.picker-item-far{pointer-events:none}.weui-picker-modal .picker-item.picker-selected{color:#3d4145;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform:rotateX(0);transform:rotateX(0)}.weui-picker-modal .picker-center-highlight{height:32px;box-sizing:border-box;position:absolute;left:0;width:100%;top:50%;margin-top:-16px;pointer-events:none}.weui-picker-modal .picker-center-highlight:after,.weui-picker-modal .picker-center-highlight:before{content:'';position:absolute;right:auto;height:1px;background-color:#D9D9D9;display:block;z-index:15;left:0;width:100%}.weui-picker-modal .picker-center-highlight:before{top:0;bottom:auto;-webkit-transform-origin:50% 0;transform-origin:50% 0}@media only screen and (-webkit-min-device-pixel-ratio:2){.weui-picker-modal .picker-center-highlight:before{-webkit-transform:scaleY(.5);transform:scaleY(.5)}}@media only screen and (-webkit-min-device-pixel-ratio:3){.weui-picker-modal .picker-center-highlight:before{-webkit-transform:scaleY(.33);transform:scaleY(.33)}}.weui-picker-modal .picker-center-highlight:after{bottom:0;top:auto;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}@media only screen and (-webkit-min-device-pixel-ratio:2){.weui-picker-modal .picker-center-highlight:after{-webkit-transform:scaleY(.5);transform:scaleY(.5)}}@media only screen and (-webkit-min-device-pixel-ratio:3){.weui-picker-modal .picker-center-highlight:after{-webkit-transform:scaleY(.33);transform:scaleY(.33)}}.weui-picker-modal .picker-3d .picker-items{overflow:hidden;-webkit-perspective:1200px;perspective:1200px}.weui-picker-modal .picker-3d .picker-item,.weui-picker-modal .picker-3d .picker-items-col,.weui-picker-modal .picker-3d .picker-items-col-wrapper{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.weui-picker-modal .picker-3d .picker-items-col{overflow:visible}.weui-picker-modal .picker-3d .picker-item{-webkit-transform-origin:center center -110px;transform-origin:center center -110px;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.weui-picker-container,.weui-picker-overlay{position:fixed;bottom:0;left:0;right:0;height:0;width:100%;z-index:1000}.picker-calendar-row:after,.picker-calendar-week-days:after{content:'';z-index:15;left:0;right:auto}.city-picker .picker-items-col{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;max-width:7rem}.weui-picker-container .weui-cells{margin:0;text-align:left}.datetime-picker .picker-item{text-overflow:initial}.weui-select-modal{height:auto}.weui-select-modal .weui-cells{margin:0;text-align:left;overflow-y:auto;overflow-x:hidden;max-height:16rem}.weui-select-modal .weui-cells:after{display:none}.picker-calendar-month,.picker-calendar-week-days{display:-webkit-box;display:-ms-flexbox;display:-webkit-flex}.weui-picker-calendar{background:#fff;height:15rem;width:100%;overflow:hidden}.weui-picker-calendar .picker-modal-inner{overflow:hidden;height:12.8rem}.picker-calendar-week-days{height:.9rem;background:#f7f7f8;display:flex;font-size:11px;box-sizing:border-box;position:relative}.picker-calendar-week-days:after{position:absolute;bottom:0;top:auto;height:1px;width:100%;background-color:#c4c4c4;display:block;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}@media only screen and (-webkit-min-device-pixel-ratio:2){.picker-calendar-week-days:after{-webkit-transform:scaleY(.5);transform:scaleY(.5)}}@media only screen and (-webkit-min-device-pixel-ratio:3){.picker-calendar-week-days:after{-webkit-transform:scaleY(.33);transform:scaleY(.33)}}.picker-calendar-week-days .picker-calendar-week-day{-ms-flex:0 1 auto;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;width:14.28571429%;width:calc(100% / 7);line-height:17px;text-align:center}.picker-calendar-week-days+.picker-calendar-months{height:11.9rem}.picker-calendar-months{width:100%;height:100%;overflow:hidden;position:relative}.picker-calendar-months-wrapper{position:relative;width:100%;height:100%;-webkit-transition:.3s;transition:.3s}.picker-calendar-month{display:flex;-webkit-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;width:100%;height:100%;position:absolute;left:0;top:0}.picker-calendar-row{height:16.66666667%;height:calc(100% / 6);display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex:0 1 auto;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;width:100%;position:relative}.picker-calendar-row:after{position:absolute;bottom:0;top:auto;height:1px;width:100%;background-color:#ccc;display:block;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}@media only screen and (-webkit-min-device-pixel-ratio:2){.picker-calendar-row:after{-webkit-transform:scaleY(.5);transform:scaleY(.5)}}@media only screen and (-webkit-min-device-pixel-ratio:3){.picker-calendar-row:after{-webkit-transform:scaleY(.33);transform:scaleY(.33)}}.weui-picker-modal .picker-calendar-row:last-child:after{display:none}.picker-calendar-day{-ms-flex:0 1 auto;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;width:14.28571429%;width:calc(100% / 7);text-align:center;color:#3d4145;font-size:15px;cursor:pointer}.picker-calendar-day.picker-calendar-day-next,.picker-calendar-day.picker-calendar-day-prev{color:#ccc}.picker-calendar-day.picker-calendar-day-disabled{color:#d4d4d4;cursor:auto}.picker-calendar-day.picker-calendar-day-today span{background:#e3e3e3}.picker-calendar-day.picker-calendar-day-selected span{background:#04BE02;color:#fff}.picker-calendar-day span{display:inline-block;border-radius:100%;width:30px;height:30px;line-height:30px}.picker-calendar-month-picker,.picker-calendar-year-picker{-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;width:50%;max-width:200px;-webkit-flex-shrink:10;-ms-flex-negative:10;flex-shrink:10}.picker-calendar-month-picker span,.picker-calendar-year-picker span{-ms-flex:0 1 auto;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;position:relative;overflow:hidden;text-overflow:ellipsis}.picker-calendar.picker-modal-inline .picker-calendar-week-days,.popover .picker-calendar .picker-calendar-week-days{background:0 0}.swiper-button-next,.swiper-button-prev,i.icon{background-position:center;background-repeat:no-repeat}.picker-calendar.picker-modal-inline .picker-calendar-week-days:after,.picker-calendar.picker-modal-inline .picker-calendar-week-days:before,.picker-calendar.picker-modal-inline .toolbar:after,.picker-calendar.picker-modal-inline .toolbar:before,.popover .picker-calendar .picker-calendar-week-days:after,.popover .picker-calendar .picker-calendar-week-days:before,.popover .picker-calendar .toolbar:after,.popover .picker-calendar .toolbar:before{display:none}.picker-calendar.picker-modal-inline .picker-calendar-week-days~.picker-calendar-months:before,.picker-calendar.picker-modal-inline .toolbar~.picker-modal-inner .picker-calendar-months:before,.popover .picker-calendar .picker-calendar-week-days~.picker-calendar-months:before,.popover .picker-calendar .toolbar~.picker-modal-inner .picker-calendar-months:before{content:'';position:absolute;left:0;top:0;bottom:auto;right:auto;height:1px;width:100%;background-color:#c4c4c4;display:block;z-index:15;-webkit-transform-origin:50% 0;transform-origin:50% 0}@media only screen and (-webkit-min-device-pixel-ratio:2){.picker-calendar.picker-modal-inline .picker-calendar-week-days~.picker-calendar-months:before,.picker-calendar.picker-modal-inline .toolbar~.picker-modal-inner .picker-calendar-months:before,.popover .picker-calendar .picker-calendar-week-days~.picker-calendar-months:before,.popover .picker-calendar .toolbar~.picker-modal-inner .picker-calendar-months:before{-webkit-transform:scaleY(.5);transform:scaleY(.5)}}@media only screen and (-webkit-min-device-pixel-ratio:3){.picker-calendar.picker-modal-inline .picker-calendar-week-days~.picker-calendar-months:before,.picker-calendar.picker-modal-inline .toolbar~.picker-modal-inner .picker-calendar-months:before,.popover .picker-calendar .picker-calendar-week-days~.picker-calendar-months:before,.popover .picker-calendar .toolbar~.picker-modal-inner .picker-calendar-months:before{-webkit-transform:scaleY(.33);transform:scaleY(.33)}}.picker-calendar-month-picker,.picker-calendar-year-picker{display:block;line-height:2.2rem;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.picker-calendar-month-picker a.icon-only,.picker-calendar-year-picker a.icon-only{min-width:36px;float:left;width:25%;height:2.2rem;line-height:2rem}.picker-calendar-month-picker .current-month-value,.picker-calendar-month-picker .current-year-value,.picker-calendar-year-picker .current-month-value,.picker-calendar-year-picker .current-year-value{float:left;width:50%;height:2.2rem}i.icon{display:inline-block;vertical-align:middle;background-size:100% auto;font-style:normal;position:relative}i.icon.icon-next,i.icon.icon-prev{width:.75rem;height:.75rem}.swiper-slide,.swiper-wrapper{width:100%;height:100%;position:relative}i.icon.icon-next{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2015%2015'%3E%3Cg%3E%3Cpath%20fill%3D'%2304BE02'%20d%3D'M1%2C1.6l11.8%2C5.8L1%2C13.4V1.6%20M0%2C0v15l15-7.6L0%2C0L0%2C0z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}i.icon.icon-prev{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2015%2015'%3E%3Cg%3E%3Cpath%20fill%3D'%2304BE02'%20d%3D'M14%2C1.6v11.8L2.2%2C7.6L14%2C1.6%20M15%2C0L0%2C7.6L15%2C15V0L15%2C0z'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.swiper-container{margin:0 auto;position:relative;overflow:hidden;z-index:1}.swiper-container-no-flexbox .swiper-slide{float:left}.swiper-container-vertical>.swiper-wrapper{-webkit-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.swiper-wrapper{z-index:1;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.swiper-container-multirow>.swiper-wrapper{-webkit-box-lines:multiple;-moz-box-lines:multiple;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-slide{-ms-flex:0 0 auto;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start;-webkit-transition-property:-webkit-transform,height;-webkit-transition-property:height,-webkit-transform;transition-property:height,-webkit-transform;transition-property:transform,height;transition-property:transform,height,-webkit-transform}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-wp8-horizontal{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-wp8-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:27px;height:44px;margin-top:-22px;z-index:10;cursor:pointer;background-size:27px 44px}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");left:10px;right:auto}.swiper-button-prev.swiper-button-black,.swiper-container-rtl .swiper-button-next.swiper-button-black{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E")}.swiper-button-prev.swiper-button-white,.swiper-container-rtl .swiper-button-next.swiper-button-white{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E")}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");right:10px;left:auto}.swiper-button-next.swiper-button-black,.swiper-container-rtl .swiper-button-prev.swiper-button-black{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E")}.swiper-button-next.swiper-button-white,.swiper-container-rtl .swiper-button-prev.swiper-button-white{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E")}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:.3s;transition:.3s;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-container-horizontal>.swiper-pagination-bullets,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;box-shadow:none;-moz-appearance:none;-ms-appearance:none;-webkit-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-white .swiper-pagination-bullet{background:#fff}.swiper-pagination-bullet-active{opacity:1;background:#04BE02}.swiper-pagination-white .swiper-pagination-bullet-active{background:#fff}.swiper-pagination-black .swiper-pagination-bullet-active{background:#000}.swiper-container-vertical>.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.swiper-container-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:5px 0;display:block}.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 5px}.swiper-pagination-progress{background:rgba(0,0,0,.25);position:absolute}.swiper-pagination-progress .swiper-pagination-progressbar{background:#007aff;position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;transform-origin:left top}.swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar{-webkit-transform-origin:right top;transform-origin:right top}.swiper-container-horizontal>.swiper-pagination-progress{width:100%;height:4px;left:0;top:0}.swiper-container-vertical>.swiper-pagination-progress{width:4px;height:100%;left:0;top:0}.swiper-pagination-progress.swiper-pagination-white{background:rgba(255,255,255,.5)}.swiper-pagination-progress.swiper-pagination-white .swiper-pagination-progressbar{background:#fff}.swiper-pagination-progress.swiper-pagination-black .swiper-pagination-progressbar{background:#000}.swiper-container-3d{-webkit-perspective:1200px;-o-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-cube-shadow,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-wrapper{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear,right top,left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear,left bottom,left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:-webkit-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-coverflow .swiper-wrapper,.swiper-container-flip .swiper-wrapper{-ms-perspective:1200px}.swiper-container-cube,.swiper-container-flip{overflow:visible}.swiper-container-cube .swiper-slide,.swiper-container-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-container-cube .swiper-slide .swiper-slide,.swiper-container-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active,.swiper-container-flip .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right,.swiper-container-cube .swiper-slide-shadow-top,.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-right,.swiper-container-flip .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-slide{visibility:hidden;-webkit-transform-origin:0 0;transform-origin:0 0;width:100%;height:100%}.swiper-container-cube.swiper-container-rtl .swiper-slide{-webkit-transform-origin:100% 0;transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-next+.swiper-slide,.swiper-container-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0;width:100%;height:100%;background:#000;opacity:.6;-webkit-filter:blur(50px);filter:blur(50px);z-index:0}.swiper-container-fade.swiper-container-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;transition-property:opacity}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0,0,0,.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0,0,0,.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12,end) infinite;animation:swiper-preloader-spin 1s steps(12,end) infinite}.swiper-lazy-preloader:after{display:block;content:"";width:100%;height:100%;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");background-position:50%;background-size:100%;background-repeat:no-repeat}.swiper-lazy-preloader-white:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.weui-actionsheet{z-index:10000}.weui-popup__container,.weui-popup__overlay{position:fixed;bottom:0;left:0;right:0;width:100%;height:100%;z-index:10}.weui-popup__overlay{background-color:rgba(0,0,0,.6);opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-popup__container{display:none}.weui-popup__container.weui-popup__container--visible{display:block}.weui-popup__container .weui-cells{margin:0;text-align:left}.weui-popup__modal{width:100%;position:absolute;z-index:100;bottom:0;border-radius:0;opacity:.6;color:#3d4145;-webkit-transition-duration:.3s;transition-duration:.3s;height:100%;background:#EFEFF4;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;overflow-x:hidden;overflow-y:auto}.popup-bottom .weui-popup__modal{height:auto}.weui-popup__modal .toolbar{position:absolute;left:0;top:0;right:0;z-index:1}.weui-popup__modal .modal-content{height:100%;padding-top:2.2rem;overflow:auto;box-sizing:border-box}.weui-popup__container--visible .weui-popup__overlay{opacity:1}.weui-popup__container--visible .weui-popup__modal{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.weui-notification{position:fixed;width:100%;min-height:3.4rem;top:-2rem;padding-top:2rem;left:0;right:0;z-index:9999;background-color:rgba(0,0,0,.85);color:#fff;font-size:.65rem;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);-webkit-transition:.4s;transition:.4s}.weui-notification.weui-notification--in{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.weui-notification.weui-notification--touching{-webkit-transition-duration:0s;transition-duration:0s}.weui-notification .weui-notification__inner{padding:.4rem .6rem 1rem;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-align:start;-ms-flex-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-notification .weui-notification__content{width:100%;margin:0 .4rem}.weui-notification .weui-notification__title{font-weight:700}.weui-notification .weui-notification__text{line-height:1}.weui-notification .weui-notification__media{height:1rem;width:1rem}.weui-notification .weui-notification__media img{width:100%}.weui-notification .weui-notification__handle-bar{position:absolute;bottom:.2rem;left:50%;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0);width:2rem;height:.3rem;border-radius:.15rem;background:#fff;opacity:.5}.weui-photo-browser-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;display:none;opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-photo-browser-modal.weui-photo-browser-modal-visible{opacity:1}.weui-photo-browser-modal .swiper-container{height:100%;-webkit-transform:scale(.2);transform:scale(.2);-webkit-transition:-webkit-transform .5s;transition:-webkit-transform .5s;transition:transform .5s;transition:transform .5s,-webkit-transform .5s}.weui-photo-browser-modal .swiper-container .swiper-pagination-bullet{background:#fff;visibility:hidden}.weui-photo-browser-modal .swiper-container.swiper-container-visible{-webkit-transform:scale(1);transform:scale(1)}.weui-photo-browser-modal .swiper-container.swiper-container-visible .swiper-pagination-bullet{visibility:visible;-webkit-transition-property:visibility;transition-property:visibility;-webkit-transition-delay:.5s;transition-delay:.5s}.weui-photo-browser-modal .swiper-container .swiper-pagination{bottom:10px;left:0;width:100%}.weui-photo-browser-modal .photo-container{height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;justify-content: center;align-items:center;overflow:hidden}.weui-photo-browser-modal .photo-container img{max-width:100%;margin-top:-30px}.weui-photo-browser-modal .caption{position:absolute;bottom:40px;left:0;right:0;color:#fff;text-align:center;padding:0 12px;min-height:3rem;font-size:14px;z-index:10;-webkit-transition:opacity .3s;transition:opacity .3s;-webkit-transition-delay:.5s;transition-delay:.5s;opacity:0}.weui-photo-browser-modal .caption .caption-item{display:none;opacity:0;-webkit-transition:opacity .15s;transition:opacity .15s}.weui-photo-browser-modal .caption .caption-item.active{display:block;opacity:1}.weui-photo-browser-modal .swiper-container-visible .caption{opacity:1}.color-primary{color:#04BE02}.color-danger,.color-error{color:#f6383a}.color-warning{color:#f60}.color-success{color:#4cd964}.bg-danger,.bg-error,.bg-primary,.bg-success,.bg-warning{color:#fff}.bg-primary{background-color:#04BE02}.bg-danger,.bg-error{background-color:#f6383a}.bg-warning{background-color:#f60}.bg-success{background-color:#4cd964}.weui-toptips{z-index:100;opacity:0;-webkit-transition:opacity .3s;transition:opacity .3s}.weui-toptips.weui-toptips_visible{opacity:1}.weui-icon_toast{font-size:55px;color:#fff;margin-bottom:6px}.weui-toast--forbidden .weui-icon_toast{color:#f6383a}.weui-toast--text{min-height:initial;font-size:18px;padding:8px 16px;width:auto;top:40%}.weui-toast--text .weui-icon_toast{display:none}.weui-count{display:inline-block;height:25px;line-height:25px}.weui-count .weui-count__btn{height:21px;width:21px;line-height:21px;display:inline-block;position:relative;border:1px solid #04BE02;border-radius:50%;vertical-align:-6px}.weui-count .weui-count__btn:after,.weui-count .weui-count__btn:before{content:" ";position:absolute;height:1px;width:11px;background-color:#04BE02;left:50%;top:50%;margin-left:-5.5px}.weui-count .weui-count__btn:after{height:11px;width:1px;margin-top:-5.5px;margin-left:-1px}.weui-count .weui-count__decrease:after{display:none}.weui-count .weui-count__increase{background-color:#04BE02}.weui-count .weui-count__increase:after,.weui-count .weui-count__increase:before{background-color:#fff}.weui-count .weui-count__number{background-color:transparent;font-size:.8rem;border:0;width:1.3rem;text-align:center;color:#5f646e}.weui-panel .weui-media-box__title-after{color:#9b9b9b;font-size:.65rem;float:right}
\ No newline at end of file
diff --git a/static/jquery_weui/css/weui.min.css b/static/jquery_weui/css/weui.min.css
new file mode 100644
index 0000000..9d3c44b
--- /dev/null
+++ b/static/jquery_weui/css/weui.min.css
@@ -0,0 +1,5 @@
+/*!
+ * WeUI v1.1.2 (https://github.com/weui/weui)
+ * Copyright 2017 Tencent, Inc.
+ * Licensed under the MIT license
+ */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{line-height:1.6;font-family:-apple-system-font,Helvetica Neue,sans-serif}*{margin:0;padding:0}a img{border:0}a{text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}@font-face{font-weight:400;font-style:normal;font-family:weui;src:url('data:application/octet-stream;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJAKEx+AAABfAAAAFZjbWFw65cFHQAAAhwAAAJQZ2x5ZvCRR/EAAASUAAAKtGhlYWQMPROtAAAA4AAAADZoaGVhCCwD+gAAALwAAAAkaG10eEJo//8AAAHUAAAASGxvY2EYqhW4AAAEbAAAACZtYXhwASEAVQAAARgAAAAgbmFtZeNcHtgAAA9IAAAB5nBvc3T6bLhLAAARMAAAAOYAAQAAA+gAAABaA+j/////A+kAAQAAAAAAAAAAAAAAAAAAABIAAQAAAAEAACbZbxtfDzz1AAsD6AAAAADUm2dvAAAAANSbZ2///wAAA+kD6gAAAAgAAgAAAAAAAAABAAAAEgBJAAUAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQOwAZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6gHqEQPoAAAAWgPqAAAAAAABAAAAAAAAAAAAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+j//wPoAAAD6AAAAAAABQAAAAMAAAAsAAAABAAAAXQAAQAAAAAAbgADAAEAAAAsAAMACgAAAXQABABCAAAABAAEAAEAAOoR//8AAOoB//8AAAABAAQAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAAAEGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAANwAAAAAAAAAEQAA6gEAAOoBAAAAAQAA6gIAAOoCAAAAAgAA6gMAAOoDAAAAAwAA6gQAAOoEAAAABAAA6gUAAOoFAAAABQAA6gYAAOoGAAAABgAA6gcAAOoHAAAABwAA6ggAAOoIAAAACAAA6gkAAOoJAAAACQAA6goAAOoKAAAACgAA6gsAAOoLAAAACwAA6gwAAOoMAAAADAAA6g0AAOoNAAAADQAA6g4AAOoOAAAADgAA6g8AAOoPAAAADwAA6hAAAOoQAAAAEAAA6hEAAOoRAAAAEQAAAAAARgCMANIBJAF4AcQCMgJgAqgC/ANIA6YD/gROBKAE9AVaAAAAAgAAAAADrwOtABQAKQAAASIHBgcGFBcWFxYyNzY3NjQnJicmAyInJicmNDc2NzYyFxYXFhQHBgcGAfV4Z2Q7PDw7ZGfwZmQ7PDw7ZGZ4bl5bNjc3Nlte215bNjc3NlteA608O2Rn8GdjOzw8O2Nn8GdkOzz8rzc1W17bXlw1Nzc1XF7bXls1NwAAAAACAAAAAAOzA7MAFwAtAAABIgcGBwYVFBcWFxYzMjc2NzY1NCcmJyYTBwYiLwEmNjsBETQ2OwEyFhURMzIWAe52Z2Q7PT07ZGd2fGpmOz4+O2ZpIXYOKA52Dg0XXQsHJgcLXRcNA7M+O2ZqfHZnZDs9PTtkZ3Z9aWY7Pv3wmhISmhIaARcICwsI/ukaAAMAAAAAA+UD5QAXACMALAAAASIHBgcGFRQXFhcWMzI3Njc2NTQnJicmAxQrASI1AzQ7ATIHJyImNDYyFhQGAe6Ecm9BRERBb3KEiXZxQkREQnF1aQIxAwgCQgMBIxIZGSQZGQPkREJxdomEcm9BRERBb3KEinVxQkT9HQICAWICAjEZIxkZIxkAAAAAAgAAAAADsQPkABkALgAAAQYHBgc2BREUFxYXFhc2NzY3NjURJBcmJyYTAQYvASY/ATYyHwEWNjclNjIfARYB9VVVQk+v/tFHPmxebGxdbT1I/tGvT0JVo/7VBASKAwMSAQUBcQEFAgESAgUBEQQD4xMYEhk3YP6sjnVlSD8cHD9IZXWOAVRgNxkSGP62/tkDA48EBBkCAVYCAQHlAQIQBAAAAAADAAAAAAOxA+QAGwAqADMAAAEGBwYHBgcGNxEUFxYXFhc2NzY3NjURJBcmJyYHMzIWFQMUBisBIicDNDYTIiY0NjIWFAYB9UFBODssO38gRz5sXmxsXW09SP7YqFBBVW80BAYMAwImBQELBh4PFhYeFRUD5A8SDhIOEikK/q2PdWRJPh0dPklkdY8BU141GRIY/AYE/sYCAwUBOgQG/kAVHxUVHxUAAAACAAAAAAPkA+QAFwAtAAABIgcGBwYVFBcWFxYzMjc2NzY1NCcmJyYTAQYiLwEmPwE2Mh8BFjI3ATYyHwEWAe6Ecm9BQ0NCbnODiXVxQkREQnF1kf6gAQUBowMDFgEFAYUCBQEBQwIFARUEA+NEQnF1iYNzbkJDQ0FvcoSJdXFCRP6j/qUBAagEBR4CAWYBAQENAgIVBAAAAAQAAAAAA68DrQAUACkAPwBDAAABIgcGBwYUFxYXFjI3Njc2NCcmJyYDIicmJyY0NzY3NjIXFhcWFAcGBwYTBQ4BLwEmBg8BBhYfARYyNwE+ASYiFzAfAQH1eGdkOzw8O2Rn8GZkOzw8O2RmeG5eWzY3NzZbXtteWzY3NzZbXmn+9gYSBmAGDwUDBQEGfQUQBgElBQELEBUBAQOtPDtkZ/BnYzs8PDtjZ/BnZDs8/K83NVte215cNTc3NVxe215bNTcCJt0FAQVJBQIGBAcRBoAGBQEhBQ8LBAEBAAABAAAAAAO7AzoAFwAAEy4BPwE+AR8BFjY3ATYWFycWFAcBBiInPQoGBwUHGgzLDCELAh0LHwsNCgr9uQoeCgGzCyEOCw0HCZMJAQoBvgkCCg0LHQv9sQsKAAAAAAIAAAAAA+UD5gAXACwAAAEiBwYHBhUUFxYXFjMyNzY3NjU0JyYnJhMHBi8BJicmNRM0NjsBMhYVExceAQHvhHJvQUNDQm5zg4l1cUJEREJxdVcQAwT6AwIEEAMCKwIDDsUCAQPlREJxdYmDc25CQ0NBb3KEiXVxQkT9VhwEAncCAgMGAXoCAwMC/q2FAgQAAAQAAAAAA68DrQADABgALQAzAAABMB8BAyIHBgcGFBcWFxYyNzY3NjQnJicmAyInJicmNDc2NzYyFxYXFhQHBgcGAyMVMzUjAuUBAfJ4Z2Q7PDw7ZGfwZmQ7PDw7ZGZ4bl5bNjc3Nlte215bNjc3NltemyT92QKDAQEBLDw7ZGfwZ2M7PDw7Y2fwZ2Q7PPyvNzVbXtteXDU3NzVcXtteWzU3AjH9JAAAAAMAAAAAA+QD5AAXACcAMAAAASIHBgcGFRQXFhcWMzI3Njc2NTQnJicmAzMyFhUDFAYrASImNQM0NhMiJjQ2MhYUBgHuhHJvQUNDQm5zg4l1cUJEREJxdZ42BAYMAwInAwMMBh8PFhYeFhYD40RCcXWJg3NuQkNDQW9yhIl1cUJE/vYGBf7AAgMDAgFABQb+NhYfFhYfFgAABAAAAAADwAPAAAgAEgAoAD0AAAEyNjQmIgYUFhcjFTMRIxUzNSMDIgcGBwYVFBYXFjMyNzY3NjU0Jy4BAyInJicmNDc2NzYyFxYXFhQHBgcGAfQYISEwISFRjzk5yTorhG5rPT99am+DdmhlPD4+PMyFbV5bNTc3NVte2l5bNTc3NVteAqAiLyIiLyI5Hf7EHBwCsT89a26Ed8w8Pj48ZWh2g29qffyjNzVbXtpeWzU3NzVbXtpeWzU3AAADAAAAAAOoA6gACwAgADUAAAEHJwcXBxc3FzcnNwMiBwYHBhQXFhcWMjc2NzY0JyYnJgMiJyYnJjQ3Njc2MhcWFxYUBwYHBgKOmpocmpocmpocmpq2dmZiOjs7OmJm7GZiOjs7OmJmdmtdWTQ2NjRZXdZdWTQ2NjRZXQKqmpocmpocmpocmpoBGTs6YmbsZmI6Ozs6YmbsZmI6O/zCNjRZXdZdWTQ2NjRZXdZdWTQ2AAMAAAAAA+kD6gAaAC8AMAAAAQYHBiMiJyYnJjQ3Njc2MhcWFxYVFAcGBwEHATI3Njc2NCcmJyYiBwYHBhQXFhcWMwKONUBCR21dWjU3NzVaXdpdWzU2GBcrASM5/eBXS0grKysrSEuuSkkqLCwqSUpXASMrFxg2NVtd2l1aNTc3NVpdbUdCQDX+3jkBGSsrSEuuSkkqLCwqSUquS0grKwAC//8AAAPoA+gAFAAwAAABIgcGBwYQFxYXFiA3Njc2ECcmJyYTFg4BIi8BBwYuATQ/AScmPgEWHwE3Nh4BBg8BAfSIdHFDRERDcXQBEHRxQ0REQ3F0SQoBFBsKoqgKGxMKqKIKARQbCqKoChsUAQqoA+hEQ3F0/vB0cUNERENxdAEQdHFDRP1jChsTCqiiCgEUGwqiqAobFAEKqKIKARQbCqIAAAIAAAAAA+QD5AAXADQAAAEiBwYHBhUUFxYXFjMyNzY3NjU0JyYnJhMUBiMFFxYUDwEGLwEuAT8BNh8BFhQPAQUyFh0BAe6Ecm9BQ0NCbnODiXVxQkREQnF1fwQC/pGDAQEVAwTsAgEC7AQEFAIBhAFwAgMD40RCcXWJg3NuQkNDQW9yhIl1cUJE/fYCAwuVAgQCFAQE0AIFAtEEBBQCBQGVCwMDJwAAAAUAAAAAA9QD0wAjACcANwBHAEgAAAERFAYjISImNREjIiY9ATQ2MyE1NDYzITIWHQEhMhYdARQGIyERIREHIgYVERQWOwEyNjURNCYjISIGFREUFjsBMjY1ETQmKwEDeyYb/XYbJkMJDQ0JAQYZEgEvExkBBgkNDQn9CQJc0QkNDQktCQ0NCf7sCQ0NCS0JDQ0JLQMi/TQbJiYbAswMCiwJDS4SGRkSLg0JLAoM/UwCtGsNCf5NCQ0NCQGzCQ0NCf5NCQ0NCQGzCQ0AAAAAEADGAAEAAAAAAAEABAAAAAEAAAAAAAIABwAEAAEAAAAAAAMABAALAAEAAAAAAAQABAAPAAEAAAAAAAUACwATAAEAAAAAAAYABAAeAAEAAAAAAAoAKwAiAAEAAAAAAAsAEwBNAAMAAQQJAAEACABgAAMAAQQJAAIADgBoAAMAAQQJAAMACAB2AAMAAQQJAAQACAB+AAMAAQQJAAUAFgCGAAMAAQQJAAYACACcAAMAAQQJAAoAVgCkAAMAAQQJAAsAJgD6d2V1aVJlZ3VsYXJ3ZXVpd2V1aVZlcnNpb24gMS4wd2V1aUdlbmVyYXRlZCBieSBzdmcydHRmIGZyb20gRm9udGVsbG8gcHJvamVjdC5odHRwOi8vZm9udGVsbG8uY29tAHcAZQB1AGkAUgBlAGcAdQBsAGEAcgB3AGUAdQBpAHcAZQB1AGkAVgBlAHIAcwBpAG8AbgAgADEALgAwAHcAZQB1AGkARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAQIBAwEEAQUBBgEHAQgBCQEKAQsBDAENAQ4BDwEQAREBEgETAAZjaXJjbGUIZG93bmxvYWQEaW5mbwxzYWZlX3N1Y2Nlc3MJc2FmZV93YXJuB3N1Y2Nlc3MOc3VjY2Vzcy1jaXJjbGURc3VjY2Vzcy1uby1jaXJjbGUHd2FpdGluZw53YWl0aW5nLWNpcmNsZQR3YXJuC2luZm8tY2lyY2xlBmNhbmNlbAZzZWFyY2gFY2xlYXIEYmFjawZkZWxldGUAAAAA') format('truetype')}[class*=" weui-icon-"],[class^=weui-icon-]{display:inline-block;vertical-align:middle;font:normal normal normal 14px/1 weui;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}[class*=" weui-icon-"]:before,[class^=weui-icon-]:before{display:inline-block;margin-left:.2em;margin-right:.2em}.weui-icon-circle:before{content:"\EA01"}.weui-icon-download:before{content:"\EA02"}.weui-icon-info:before{content:"\EA03"}.weui-icon-safe-success:before{content:"\EA04"}.weui-icon-safe-warn:before{content:"\EA05"}.weui-icon-success:before{content:"\EA06"}.weui-icon-success-circle:before{content:"\EA07"}.weui-icon-success-no-circle:before{content:"\EA08"}.weui-icon-waiting:before{content:"\EA09"}.weui-icon-waiting-circle:before{content:"\EA0A"}.weui-icon-warn:before{content:"\EA0B"}.weui-icon-info-circle:before{content:"\EA0C"}.weui-icon-cancel:before{content:"\EA0D"}.weui-icon-search:before{content:"\EA0E"}.weui-icon-clear:before{content:"\EA0F"}.weui-icon-back:before{content:"\EA10"}.weui-icon-delete:before{content:"\EA11"}[class*=" weui-icon_"]:before,[class^=weui-icon_]:before{margin:0}.weui-icon-success{font-size:23px;color:#09bb07}.weui-icon-waiting{font-size:23px;color:#10aeff}.weui-icon-warn{font-size:23px;color:#f43530}.weui-icon-info{font-size:23px;color:#10aeff}.weui-icon-success-circle,.weui-icon-success-no-circle{font-size:23px;color:#09bb07}.weui-icon-waiting-circle{font-size:23px;color:#10aeff}.weui-icon-circle{font-size:23px;color:#c9c9c9}.weui-icon-download,.weui-icon-info-circle{font-size:23px;color:#09bb07}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}.weui-btn{position:relative;display:block;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;box-sizing:border-box;font-size:18px;text-align:center;text-decoration:none;color:#fff;line-height:2.55555556;border-radius:5px;-webkit-tap-highlight-color:rgba(0,0,0,0);overflow:hidden}.weui-btn:after{content:" ";width:200%;height:200%;position:absolute;top:0;left:0;border:1px solid rgba(0,0,0,.2);-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;box-sizing:border-box;border-radius:10px}.weui-btn_inline{display:inline-block}.weui-btn_default{color:#000;background-color:#f8f8f8}.weui-btn_default:not(.weui-btn_disabled):visited{color:#000}.weui-btn_default:not(.weui-btn_disabled):active{color:rgba(0,0,0,.6);background-color:#dedede}.weui-btn_primary{background-color:#1aad19}.weui-btn_primary:not(.weui-btn_disabled):visited{color:#fff}.weui-btn_primary:not(.weui-btn_disabled):active{color:hsla(0,0%,100%,.6);background-color:#179b16}.weui-btn_warn{background-color:#e64340}.weui-btn_warn:not(.weui-btn_disabled):visited{color:#fff}.weui-btn_warn:not(.weui-btn_disabled):active{color:hsla(0,0%,100%,.6);background-color:#ce3c39}.weui-btn_disabled{color:hsla(0,0%,100%,.6)}.weui-btn_disabled.weui-btn_default{color:rgba(0,0,0,.3);background-color:#f7f7f7}.weui-btn_disabled.weui-btn_primary{background-color:#9ed99d}.weui-btn_disabled.weui-btn_warn{background-color:#ec8b89}.weui-btn_loading .weui-loading{margin:-.2em .34em 0 0}.weui-btn_loading.weui-btn_primary,.weui-btn_loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.weui-btn_loading.weui-btn_primary{background-color:#179b16}.weui-btn_loading.weui-btn_warn{background-color:#ce3c39}.weui-btn_plain-primary{color:#1aad19;border:1px solid #1aad19}.weui-btn_plain-primary:not(.weui-btn_plain-disabled):active{color:rgba(26,173,25,.6);border-color:rgba(26,173,25,.6)}.weui-btn_plain-primary:after{border-width:0}.weui-btn_plain-default{color:#353535;border:1px solid #353535}.weui-btn_plain-default:not(.weui-btn_plain-disabled):active{color:rgba(53,53,53,.6);border-color:rgba(53,53,53,.6)}.weui-btn_plain-default:after{border-width:0}.weui-btn_plain-disabled{color:rgba(0,0,0,.2);border-color:rgba(0,0,0,.2)}button.weui-btn,input.weui-btn{width:100%;border-width:0;outline:0;-webkit-appearance:none}button.weui-btn:focus,input.weui-btn:focus{outline:0}button.weui-btn_inline,button.weui-btn_mini,input.weui-btn_inline,input.weui-btn_mini{width:auto}button.weui-btn_plain-default,button.weui-btn_plain-primary,input.weui-btn_plain-default,input.weui-btn_plain-primary{border-width:1px;background-color:transparent}.weui-btn_mini{display:inline-block;padding:0 1.32em;line-height:2.3;font-size:13px}.weui-btn+.weui-btn{margin-top:15px}.weui-btn.weui-btn_inline+.weui-btn.weui-btn_inline{margin-top:auto;margin-left:15px}.weui-btn-area{margin:1.17647059em 15px .3em}.weui-btn-area_inline{display:-webkit-box;display:-webkit-flex;display:flex}.weui-btn-area_inline .weui-btn{margin-top:auto;margin-right:15px;width:100%;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-btn-area_inline .weui-btn:last-child{margin-right:0}.weui-cells{margin-top:1.17647059em;background-color:#fff;line-height:1.47058824;font-size:17px;overflow:hidden;position:relative}.weui-cells:before{top:0;border-top:1px solid #e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-cells:after,.weui-cells:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5;z-index:2}.weui-cells:after{bottom:0;border-bottom:1px solid #e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-cells__title{margin-top:.77em;margin-bottom:.3em;padding-left:15px;padding-right:15px;color:#999;font-size:14px}.weui-cells__title+.weui-cells{margin-top:0}.weui-cells__tips{margin-top:.3em;color:#999;padding-left:15px;padding-right:15px;font-size:14px}.weui-cell{padding:10px 15px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:15px;z-index:2}.weui-cell:first-child:before{display:none}.weui-cell_primary{-webkit-box-align:start;-webkit-align-items:flex-start;align-items:flex-start}.weui-cell__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-cell__ft{text-align:right;color:#999}.weui-cell_swiped{display:block;padding:0}.weui-cell_swiped>.weui-cell__bd{position:relative;z-index:1;background-color:#fff}.weui-cell_swiped>.weui-cell__ft{position:absolute;right:0;top:0;bottom:0;display:-webkit-box;display:-webkit-flex;display:flex;color:#fff}.weui-swiped-btn{display:block;padding:10px 1em;line-height:1.47058824;color:inherit}.weui-swiped-btn_default{background-color:#c7c7cc}.weui-swiped-btn_warn{background-color:#ff3b30}.weui-cell_access{-webkit-tap-highlight-color:rgba(0,0,0,0);color:inherit}.weui-cell_access:active{background-color:#ececec}.weui-cell_access .weui-cell__ft{padding-right:13px;position:relative}.weui-cell_access .weui-cell__ft:after{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;margin-top:-4px;right:2px}.weui-cell_link{color:#586c94;font-size:14px}.weui-cell_link:first-child:before{display:block}.weui-check__label{-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-check__label:active{background-color:#ececec}.weui-check{position:absolute;left:-9999em}.weui-cells_radio .weui-cell__ft{padding-left:.35em}.weui-cells_radio .weui-check:checked+.weui-icon-checked:before{display:block;content:'\EA08';color:#09bb07;font-size:16px}.weui-cells_checkbox .weui-cell__hd{padding-right:.35em}.weui-cells_checkbox .weui-icon-checked:before{content:'\EA01';color:#c9c9c9;font-size:23px;display:block}.weui-cells_checkbox .weui-check:checked+.weui-icon-checked:before{content:'\EA06';color:#09bb07}.weui-label{display:block;width:105px;word-wrap:break-word;word-break:break-all}.weui-input{width:100%;border:0;outline:0;-webkit-appearance:none;background-color:transparent;font-size:inherit;color:inherit;height:1.47058824em;line-height:1.47058824}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.weui-textarea{display:block;border:0;resize:none;width:100%;color:inherit;font-size:1em;line-height:inherit;outline:0}.weui-textarea-counter{color:#b2b2b2;text-align:right}.weui-cell_warn .weui-textarea-counter{color:#e64340}.weui-toptips{display:none;position:fixed;-webkit-transform:translateZ(0);transform:translateZ(0);top:0;left:0;right:0;padding:5px;font-size:14px;text-align:center;color:#fff;z-index:5000;word-wrap:break-word;word-break:break-all}.weui-toptips_warn{background-color:#e64340}.weui-cells_form .weui-cell__ft{font-size:0}.weui-cells_form .weui-icon-warn{display:none}.weui-cells_form input,.weui-cells_form label[for],.weui-cells_form textarea{-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-cell_warn{color:#e64340}.weui-cell_warn .weui-icon-warn{display:inline-block}.weui-form-preview{position:relative;background-color:#fff}.weui-form-preview:before{top:0;border-top:1px solid #e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-form-preview:after,.weui-form-preview:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-form-preview:after{bottom:0;border-bottom:1px solid #e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-form-preview__hd{position:relative;padding:10px 15px;text-align:right;line-height:2.5em}.weui-form-preview__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:15px}.weui-form-preview__hd .weui-form-preview__value{font-style:normal;font-size:1.6em}.weui-form-preview__bd{padding:10px 15px;font-size:.9em;text-align:right;color:#999;line-height:2}.weui-form-preview__ft{position:relative;line-height:50px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-form-preview__ft:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #d5d5d6;color:#d5d5d6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-form-preview__item{overflow:hidden}.weui-form-preview__label{float:left;margin-right:1em;min-width:4em;color:#999;text-align:justify;text-align-last:justify}.weui-form-preview__value{display:block;overflow:hidden;word-break:normal;word-wrap:break-word}.weui-form-preview__btn{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}button.weui-form-preview__btn{background-color:transparent;border:0;outline:0;line-height:inherit;font-size:inherit}.weui-form-preview__btn:active{background-color:#eee}.weui-form-preview__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #d5d5d6;color:#d5d5d6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-form-preview__btn:first-child:after{display:none}.weui-form-preview__btn_default{color:#999}.weui-form-preview__btn_primary{color:#0bb20c}.weui-cell_select{padding:0}.weui-cell_select .weui-select{padding-right:30px}.weui-cell_select .weui-cell__bd:after{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-select{-webkit-appearance:none;border:0;outline:0;background-color:transparent;width:100%;font-size:inherit;height:45px;line-height:45px;position:relative;z-index:1;padding-left:15px}.weui-cell_select-before{padding-right:15px}.weui-cell_select-before .weui-select{width:105px;box-sizing:border-box}.weui-cell_select-before .weui-cell__hd{position:relative}.weui-cell_select-before .weui-cell__hd:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-cell_select-before .weui-cell__hd:before{content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8cd;border-style:solid;-webkit-transform:matrix(.71,.71,-.71,.71,0,0);transform:matrix(.71,.71,-.71,.71,0,0);position:relative;top:-2px;position:absolute;top:50%;right:15px;margin-top:-4px}.weui-cell_select-before .weui-cell__bd{padding-left:15px}.weui-cell_select-before .weui-cell__bd:after{display:none}.weui-cell_select-after{padding-left:15px}.weui-cell_select-after .weui-select{padding-left:0}.weui-cell_vcode{padding-top:0;padding-right:0;padding-bottom:0}.weui-vcode-btn,.weui-vcode-img{margin-left:5px;height:45px;vertical-align:middle}.weui-vcode-btn{display:inline-block;padding:0 .6em 0 .7em;border-left:1px solid #e5e5e5;line-height:45px;font-size:17px;color:#3cc51f}button.weui-vcode-btn{background-color:transparent;border-top:0;border-right:0;border-bottom:0;outline:0}.weui-vcode-btn:active{color:#52a341}.weui-gallery{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;z-index:1000}.weui-gallery__img{position:absolute;top:0;right:0;bottom:60px;left:0;background:50% no-repeat;background-size:contain}.weui-gallery__opr{position:absolute;right:0;bottom:0;left:0;background-color:#0d0d0d;color:#fff;line-height:60px;text-align:center}.weui-gallery__del{display:block}.weui-cell_switch{padding-top:6.5px;padding-bottom:6.5px}.weui-switch{-webkit-appearance:none;appearance:none}.weui-switch,.weui-switch-cp__box{position:relative;width:52px;height:32px;border:1px solid #dfdfdf;outline:0;border-radius:16px;box-sizing:border-box;background-color:#dfdfdf;-webkit-transition:background-color .1s,border .1s;transition:background-color .1s,border .1s}.weui-switch-cp__box:before,.weui-switch:before{content:" ";position:absolute;top:0;left:0;width:50px;height:30px;border-radius:15px;background-color:#fdfdfd;-webkit-transition:-webkit-transform .35s cubic-bezier(.45,1,.4,1);transition:-webkit-transform .35s cubic-bezier(.45,1,.4,1);transition:transform .35s cubic-bezier(.45,1,.4,1);transition:transform .35s cubic-bezier(.45,1,.4,1),-webkit-transform .35s cubic-bezier(.45,1,.4,1)}.weui-switch-cp__box:after,.weui-switch:after{content:" ";position:absolute;top:0;left:0;width:30px;height:30px;border-radius:15px;background-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.4);-webkit-transition:-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);transition:-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);transition:transform .35s cubic-bezier(.4,.4,.25,1.35);transition:transform .35s cubic-bezier(.4,.4,.25,1.35),-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35)}.weui-switch-cp__input:checked~.weui-switch-cp__box,.weui-switch:checked{border-color:#04be02;background-color:#04be02}.weui-switch-cp__input:checked~.weui-switch-cp__box:before,.weui-switch:checked:before{-webkit-transform:scale(0);transform:scale(0)}.weui-switch-cp__input:checked~.weui-switch-cp__box:after,.weui-switch:checked:after{-webkit-transform:translateX(20px);transform:translateX(20px)}.weui-switch-cp__input{position:absolute;left:-9999px}.weui-switch-cp__box{display:block}.weui-uploader__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding-bottom:10px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-uploader__title{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-uploader__info{color:#b2b2b2}.weui-uploader__bd{margin-bottom:-4px;margin-right:-9px;overflow:hidden}.weui-uploader__files{list-style:none}.weui-uploader__file{float:left;margin-right:9px;margin-bottom:9px;width:79px;height:79px;background:no-repeat 50%;background-size:cover}.weui-uploader__file_status{position:relative}.weui-uploader__file_status:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.5)}.weui-uploader__file_status .weui-uploader__file-content{display:block}.weui-uploader__file-content{display:none;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#fff}.weui-uploader__file-content .weui-icon-warn{display:inline-block}.weui-uploader__input-box{float:left;position:relative;margin-right:9px;margin-bottom:9px;width:77px;height:77px;border:1px solid #d9d9d9}.weui-uploader__input-box:after,.weui-uploader__input-box:before{content:" ";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#d9d9d9}.weui-uploader__input-box:before{width:2px;height:39.5px}.weui-uploader__input-box:after{width:39.5px;height:2px}.weui-uploader__input-box:active{border-color:#999}.weui-uploader__input-box:active:after,.weui-uploader__input-box:active:before{background-color:#999}.weui-uploader__input{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-msg{padding-top:36px;text-align:center}.weui-msg__icon-area{margin-bottom:30px}.weui-msg__text-area{margin-bottom:25px;padding:0 20px}.weui-msg__text-area a{color:#586c94}.weui-msg__title{margin-bottom:5px;font-weight:400;font-size:20px}.weui-msg__desc{font-size:14px;color:#999}.weui-msg__opr-area{margin-bottom:25px}.weui-msg__extra-area{margin-bottom:15px;font-size:14px;color:#999}.weui-msg__extra-area a{color:#586c94}@media screen and (min-height:438px){.weui-msg__extra-area{position:fixed;left:0;bottom:0;width:100%;text-align:center}}.weui-article{padding:20px 15px;font-size:15px}.weui-article section{margin-bottom:1.5em}.weui-article h1{font-size:18px;font-weight:400;margin-bottom:.9em}.weui-article h2{font-size:16px}.weui-article h2,.weui-article h3{font-weight:400;margin-bottom:.34em}.weui-article h3{font-size:15px}.weui-article *{max-width:100%;box-sizing:border-box;word-wrap:break-word}.weui-article p{margin:0 0 .8em}.weui-tabbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;bottom:0;width:100%;background-color:#f7f7fa}.weui-tabbar:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #c0bfc4;color:#c0bfc4;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-tabbar__item{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:5px 0 0;font-size:0;color:#999;text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__icon>i,.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{color:#09bb07}.weui-tabbar__icon{display:inline-block;width:27px;height:27px}.weui-tabbar__icon>i,i.weui-tabbar__icon{font-size:24px;color:#999}.weui-tabbar__icon img{width:100%;height:100%}.weui-tabbar__label{text-align:center;color:#999;font-size:10px;line-height:1.8}.weui-navbar{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;z-index:500;top:0;width:100%;background-color:#fafafa}.weui-navbar:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid #ccc;color:#ccc;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-navbar+.weui-tab__panel{padding-top:50px;padding-bottom:0}.weui-navbar__item{position:relative;display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:13px 0;text-align:center;font-size:15px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.weui-navbar__item:active{background-color:#ededed}.weui-navbar__item.weui-bar__item_on{background-color:#eaeaea}.weui-navbar__item:after{content:" ";position:absolute;right:0;top:0;width:1px;bottom:0;border-right:1px solid #ccc;color:#ccc;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-navbar__item:last-child:after{display:none}.weui-tab{position:relative;height:100%}.weui-tab__panel{box-sizing:border-box;height:100%;padding-bottom:50px;overflow:auto;-webkit-overflow-scrolling:touch}.weui-tab__content{display:none}.weui-progress{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-progress__bar{background-color:#ebebeb;height:3px;-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-progress__inner-bar{width:0;height:100%;background-color:#09bb07}.weui-progress__opr{display:block;margin-left:15px;font-size:0}.weui-panel{background-color:#fff;margin-top:10px;position:relative;overflow:hidden}.weui-panel:first-child{margin-top:0}.weui-panel:before{top:0;border-top:1px solid #e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-panel:after,.weui-panel:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-panel:after{bottom:0;border-bottom:1px solid #e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-panel__hd{padding:14px 15px 10px;color:#999;font-size:13px;position:relative}.weui-panel__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:15px}.weui-media-box{padding:15px;position:relative}.weui-media-box:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5);left:15px}.weui-media-box:first-child:before{display:none}a.weui-media-box{color:#000;-webkit-tap-highlight-color:rgba(0,0,0,0)}a.weui-media-box:active{background-color:#ececec}.weui-media-box__title{font-weight:400;font-size:17px;width:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;word-wrap:break-word;word-break:break-all}.weui-media-box__desc{color:#999;font-size:13px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-media-box__info{margin-top:15px;padding-bottom:5px;font-size:13px;color:#cecece;line-height:1em;list-style:none;overflow:hidden}.weui-media-box__info__meta{float:left;padding-right:1em}.weui-media-box__info__meta_extra{padding-left:1em;border-left:1px solid #cecece}.weui-media-box_text .weui-media-box__title{margin-bottom:8px}.weui-media-box_appmsg{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-media-box_appmsg .weui-media-box__hd{margin-right:.8em;width:60px;height:60px;line-height:60px;text-align:center}.weui-media-box_appmsg .weui-media-box__thumb{width:100%;max-height:100%;vertical-align:top}.weui-media-box_appmsg .weui-media-box__bd{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:0}.weui-media-box_small-appmsg{padding:0}.weui-media-box_small-appmsg .weui-cells{margin-top:0}.weui-media-box_small-appmsg .weui-cells:before{display:none}.weui-grids{position:relative;overflow:hidden}.weui-grids:before{right:0;height:1px;border-top:1px solid #d9d9d9;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-grids:after,.weui-grids:before{content:" ";position:absolute;left:0;top:0;color:#d9d9d9}.weui-grids:after{width:1px;bottom:0;border-left:1px solid #d9d9d9;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-grid{position:relative;float:left;padding:20px 10px;width:33.33333333%;box-sizing:border-box}.weui-grid:before{top:0;width:1px;border-right:1px solid #d9d9d9;-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-grid:after,.weui-grid:before{content:" ";position:absolute;right:0;bottom:0;color:#d9d9d9}.weui-grid:after{left:0;height:1px;border-bottom:1px solid #d9d9d9;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-grid:active{background-color:#ececec}.weui-grid__icon{width:28px;height:28px;margin:0 auto}.weui-grid__icon img{display:block;width:100%;height:100%}.weui-grid__icon+.weui-grid__label{margin-top:5px}.weui-grid__label{display:block;color:#000;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.weui-footer,.weui-grid__label{text-align:center;font-size:14px}.weui-footer{color:#999}.weui-footer a{color:#586c94}.weui-footer_fixed-bottom{position:fixed;bottom:.52em;left:0;right:0}.weui-footer__links{font-size:0}.weui-footer__link{display:inline-block;vertical-align:top;margin:0 .62em;position:relative;font-size:14px}.weui-footer__link:before{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #c7c7c7;color:#c7c7c7;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5);left:-.65em;top:.36em;bottom:.36em}.weui-footer__link:first-child:before{display:none}.weui-footer__text{padding:0 .34em;font-size:12px}.weui-flex{display:-webkit-box;display:-webkit-flex;display:flex}.weui-flex__item{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-dialog{position:fixed;z-index:5000;width:80%;max-width:300px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#fff;text-align:center;border-radius:3px;overflow:hidden}.weui-dialog__hd{padding:1.3em 1.6em .5em}.weui-dialog__title{font-weight:400;font-size:18px}.weui-dialog__bd{padding:0 1.6em .8em;min-height:40px;font-size:15px;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.weui-dialog__bd:first-child{padding:2.7em 20px 1.7em;color:#353535}.weui-dialog__ft{position:relative;line-height:48px;font-size:18px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #d5d5d6;color:#d5d5d6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3cc51f;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.weui-dialog__btn:active{background-color:#eee}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #d5d5d6;color:#d5d5d6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:#353535}.weui-dialog__btn_primary{color:#0bb20c}.weui-skin_android .weui-dialog{text-align:left;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-dialog__title{font-size:21px}.weui-skin_android .weui-dialog__hd{text-align:left}.weui-skin_android .weui-dialog__bd{color:#999;padding:.25em 1.6em 2em;font-size:17px;text-align:left}.weui-skin_android .weui-dialog__bd:first-child{padding:1.6em 1.6em 2em;color:#353535}.weui-skin_android .weui-dialog__ft{display:block;text-align:right;line-height:42px;font-size:16px;padding:0 1.6em .7em}.weui-skin_android .weui-dialog__ft:after{display:none}.weui-skin_android .weui-dialog__btn{display:inline-block;vertical-align:top;padding:0 .8em}.weui-skin_android .weui-dialog__btn:after{display:none}.weui-skin_android .weui-dialog__btn:active,.weui-skin_android .weui-dialog__btn:visited{background-color:rgba(0,0,0,.06)}.weui-skin_android .weui-dialog__btn:last-child{margin-right:-.8em}.weui-skin_android .weui-dialog__btn_default{color:gray}@media screen and (min-width:1024px){.weui-dialog{width:35%}}.weui-toast{position:fixed;z-index:5000;width:7.6em;min-height:7.6em;top:180px;left:50%;margin-left:-3.8em;background:hsla(0,0%,7%,.7);text-align:center;border-radius:5px;color:#fff}.weui-icon_toast{margin:22px 0 0;display:block}.weui-icon_toast.weui-icon-success-no-circle:before{color:#fff;font-size:55px}.weui-icon_toast.weui-loading{margin:30px 0 0;width:38px;height:38px;vertical-align:baseline}.weui-toast__content{margin:0 0 15px}.weui-mask{background:rgba(0,0,0,.6)}.weui-mask,.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-actionsheet{position:fixed;left:0;bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:5000;width:100%;background-color:#efeff4;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-actionsheet__title{position:relative;height:65px;padding:0 20px;line-height:1.4;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:center;font-size:14px;color:#888;background:#fcfcfd}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{background-color:#fcfcfd}.weui-actionsheet__action{margin-top:6px;background-color:#fcfcfd}.weui-actionsheet__cell{position:relative;padding:10px 0;text-align:center;font-size:18px}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-actionsheet__cell:active{background-color:#ececec}.weui-actionsheet__cell:first-child:before{display:none}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:274px;box-sizing:border-box;-webkit-backface-visibility:hidden;backface-visibility:hidden;background:transparent;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,.1)}.weui-skin_android .weui-actionsheet__cell{padding:13px 24px;font-size:16px;line-height:1.4;text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{-webkit-transform:translate(0);transform:translate(0)}.weui-loadmore{width:65%;margin:1.5em auto;line-height:1.6em;font-size:14px;text-align:center}.weui-loadmore__tips{display:inline-block;vertical-align:middle}.weui-loadmore_line{border-top:1px solid #e5e5e5;margin-top:2.4em}.weui-loadmore_line .weui-loadmore__tips{position:relative;top:-.9em;padding:0 .55em;background-color:#fff;color:#999}.weui-loadmore_dot .weui-loadmore__tips{padding:0 .16em}.weui-loadmore_dot .weui-loadmore__tips:before{content:" ";width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;position:relative;vertical-align:0;top:-.16em}.weui-badge{display:inline-block;padding:.15em .4em;min-width:8px;border-radius:18px;background-color:#f43530;color:#fff;line-height:1.2;text-align:center;font-size:12px;vertical-align:middle}.weui-badge_dot{padding:.4em;min-width:0}.weui-search-bar{position:relative;padding:8px 10px;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;background-color:#efeff4}.weui-search-bar:before{top:0;border-top:1px solid #d7d6dc;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-search-bar:after,.weui-search-bar:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#d7d6dc}.weui-search-bar:after{bottom:0;border-bottom:1px solid #d7d6dc;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-search-bar.weui-search-bar_focusing .weui-search-bar__cancel-btn{display:block}.weui-search-bar.weui-search-bar_focusing .weui-search-bar__label{display:none}.weui-search-bar__form{position:relative;-webkit-box-flex:1;-webkit-flex:auto;flex:auto;background-color:#efeff4}.weui-search-bar__form:after{content:'';position:absolute;left:0;top:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;border-radius:10px;border:1px solid #e6e6ea;box-sizing:border-box;background:#fff}.weui-search-bar__box{position:relative;padding-left:30px;padding-right:30px;height:100%;width:100%;box-sizing:border-box;z-index:1}.weui-search-bar__box .weui-search-bar__input{padding:4px 0;width:100%;height:1.42857143em;border:0;font-size:14px;line-height:1.42857143em;box-sizing:content-box;background:transparent}.weui-search-bar__box .weui-search-bar__input:focus{outline:none}.weui-search-bar__box .weui-icon-search{position:absolute;left:10px;top:0;line-height:28px}.weui-search-bar__box .weui-icon-clear{position:absolute;top:0;right:0;padding:0 10px;line-height:28px}.weui-search-bar__label{position:absolute;top:1px;right:1px;bottom:1px;left:1px;z-index:2;border-radius:3px;text-align:center;color:#9b9b9b;background:#fff}.weui-search-bar__label span{display:inline-block;font-size:14px;vertical-align:middle}.weui-search-bar__label .weui-icon-search{margin-right:5px}.weui-search-bar__cancel-btn{display:none;margin-left:10px;line-height:28px;color:#09bb07;white-space:nowrap}.weui-search-bar__input:not(:valid)~.weui-icon-clear{display:none}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.weui-picker{position:fixed;width:100%;left:0;bottom:0;z-index:5000;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateY(100%);transform:translateY(100%);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.weui-picker__hd{display:-webkit-box;display:-webkit-flex;display:flex;padding:9px 15px;background-color:#fff;position:relative;text-align:center;font-size:17px}.weui-picker__hd:after{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1px solid #e5e5e5;color:#e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-picker__action{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#1aad19}.weui-picker__action:first-child{text-align:left;color:#888}.weui-picker__action:last-child{text-align:right}.weui-picker__bd{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;background-color:#fff;height:238px;overflow:hidden}.weui-picker__group{-webkit-box-flex:1;-webkit-flex:1;flex:1;position:relative;height:100%}.weui-picker__mask{top:0;height:100%;margin:0 auto;background:-webkit-linear-gradient(top,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),-webkit-linear-gradient(bottom,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),linear-gradient(0deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-position:top,bottom;background-size:100% 102px;background-repeat:no-repeat;-webkit-transform:translateZ(0);transform:translateZ(0)}.weui-picker__indicator,.weui-picker__mask{position:absolute;left:0;width:100%;z-index:3}.weui-picker__indicator{height:34px;top:102px}.weui-picker__indicator:before{top:0;border-top:1px solid #e5e5e5;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-picker__indicator:after,.weui-picker__indicator:before{content:" ";position:absolute;left:0;right:0;height:1px;color:#e5e5e5}.weui-picker__indicator:after{bottom:0;border-bottom:1px solid #e5e5e5;-webkit-transform-origin:0 100%;transform-origin:0 100%;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-picker__content{position:absolute;top:0;left:0;width:100%}.weui-picker__item{padding:0;height:34px;line-height:34px;text-align:center;color:#000;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.weui-picker__item_disabled{color:#999}@-webkit-keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes a{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.weui-animate-slide-up{-webkit-animation:a ease .3s forwards;animation:a ease .3s forwards}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.weui-animate-slide-down{-webkit-animation:b ease .3s forwards;animation:b ease .3s forwards}@-webkit-keyframes c{0%{opacity:0}to{opacity:1}}@keyframes c{0%{opacity:0}to{opacity:1}}.weui-animate-fade-in{-webkit-animation:c ease .3s forwards;animation:c ease .3s forwards}@-webkit-keyframes d{0%{opacity:1}to{opacity:0}}@keyframes d{0%{opacity:1}to{opacity:0}}.weui-animate-fade-out{-webkit-animation:d ease .3s forwards;animation:d ease .3s forwards}.weui-agree{display:block;padding:.5em 15px;font-size:13px}.weui-agree a{color:#586c94}.weui-agree__text{color:#999}.weui-agree__checkbox{-webkit-appearance:none;appearance:none;outline:0;font-size:0;border:1px solid #d1d1d1;background-color:#fff;border-radius:3px;width:13px;height:13px;position:relative;vertical-align:0;top:2px}.weui-agree__checkbox:checked:before{font-family:weui;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;text-align:center;speak:none;display:inline-block;vertical-align:middle;text-decoration:inherit;content:"\EA08";color:#09bb07;font-size:13px;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-48%) scale(.73);transform:translate(-50%,-48%) scale(.73)}.weui-agree__checkbox:disabled{background-color:#e1e1e1}.weui-agree__checkbox:disabled:before{color:#adadad}.weui-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:e 1s steps(12) infinite;animation:e 1s steps(12) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;background-size:100%}.weui-btn_loading.weui-btn_primary .weui-loading,.weui-btn_loading.weui-btn_warn .weui-loading,.weui-loading.weui-loading_transparent{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E")}@-webkit-keyframes e{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes e{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.weui-slider{padding:15px 18px;-webkit-user-select:none;user-select:none}.weui-slider__inner{position:relative;height:2px;background-color:#e9e9e9}.weui-slider__track{height:2px;background-color:#1aad19;width:0}.weui-slider__handler{position:absolute;left:0;top:50%;width:28px;height:28px;margin-left:-14px;margin-top:-14px;border-radius:50%;background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.2)}.weui-slider-box{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.weui-slider-box .weui-slider{-webkit-box-flex:1;-webkit-flex:1;flex:1}.weui-slider-box__value{margin-left:.5em;min-width:24px;color:#888;text-align:center;font-size:14px}
\ No newline at end of file
diff --git a/static/jquery_weui/js/appevent.js b/static/jquery_weui/js/appevent.js
new file mode 100644
index 0000000..4ac1a94
--- /dev/null
+++ b/static/jquery_weui/js/appevent.js
@@ -0,0 +1,214 @@
+/**
+ * Created by a on 2018/5/3.
+ */
+(function($){
+ var touch = {},
+ touchTimeout, tapTimeout, swipeTimeout, longTapTimeout,
+ longTapDelay = 300,
+ gesture,
+ down, up, move,
+ eventMap,
+ initialized = false
+
+ function swipeDirection(x1, x2, y1, y2) {
+ return Math.abs(x1 - x2) >=
+ Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down')
+ }
+
+ function longTap() {
+ longTapTimeout = null
+ if (touch.last) {
+ touch.el.trigger('longTap')
+ touch = {}
+ }
+ }
+
+ function cancelLongTap() {
+ if (longTapTimeout) clearTimeout(longTapTimeout)
+ longTapTimeout = null
+ }
+
+ function cancelAll() {
+ if (touchTimeout) clearTimeout(touchTimeout)
+ if (tapTimeout) clearTimeout(tapTimeout)
+ if (swipeTimeout) clearTimeout(swipeTimeout)
+ if (longTapTimeout) clearTimeout(longTapTimeout)
+ touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null
+ touch = {}
+ }
+
+ function isPrimaryTouch(event){
+ return (event.pointerType == 'touch' ||
+ event.pointerType == event.MSPOINTER_TYPE_TOUCH)
+ && event.isPrimary
+ }
+
+ function isPointerEventType(e, type){
+ return (e.type == 'pointer'+type ||
+ e.type.toLowerCase() == 'mspointer'+type)
+ }
+
+ // helper function for tests, so they check for different APIs
+ function unregisterTouchEvents(){
+ if (!initialized) return
+ $(document).off(eventMap.down, down)
+ .off(eventMap.up, up)
+ .off(eventMap.move, move)
+ .off(eventMap.cancel, cancelAll)
+ $(window).off('scroll', cancelAll)
+ cancelAll()
+ initialized = false
+ }
+
+ function setup(__eventMap){
+ var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType
+
+ unregisterTouchEvents()
+
+ eventMap = (__eventMap && ('down' in __eventMap)) ? __eventMap :
+ ('ontouchstart' in document ?
+ { 'down': 'touchstart', 'up': 'touchend',
+ 'move': 'touchmove', 'cancel': 'touchcancel' } :
+ 'onpointerdown' in document ?
+ { 'down': 'pointerdown', 'up': 'pointerup',
+ 'move': 'pointermove', 'cancel': 'pointercancel' } :
+ 'onmspointerdown' in document ?
+ { 'down': 'MSPointerDown', 'up': 'MSPointerUp',
+ 'move': 'MSPointerMove', 'cancel': 'MSPointerCancel' } : false)
+
+ // No API availables for touch events
+ if (!eventMap) return
+
+ if ('MSGesture' in window) {
+ gesture = new MSGesture()
+ gesture.target = document.body
+
+ $(document)
+ .bind('MSGestureEnd', function(e){
+ var swipeDirectionFromVelocity =
+ e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null
+ if (swipeDirectionFromVelocity) {
+ touch.el.trigger('swipe')
+ touch.el.trigger('swipe'+ swipeDirectionFromVelocity)
+ }
+ })
+ }
+
+ down = function(e){
+ if((_isPointerType = isPointerEventType(e, 'down')) &&
+ !isPrimaryTouch(e)) return
+ firstTouch = _isPointerType ? e :((e.touches) ? e.touches[0]:e.originalEvent.changedTouches[0])
+ if (e.touches && e.touches.length === 1 && touch.x2) {
+ // Clear out touch movement data if we have it sticking around
+ // This can occur if touchcancel doesn't fire due to preventDefault, etc.
+ touch.x2 = undefined
+ touch.y2 = undefined
+ }
+ now = Date.now()
+ delta = now - (touch.last || now)
+ touch.el = jQuery('tagName' in firstTouch.target ?
+ firstTouch.target : firstTouch.target.parentNode)
+ touchTimeout && clearTimeout(touchTimeout)
+ touch.x1 = firstTouch.pageX
+ touch.y1 = firstTouch.pageY
+ if (delta > 0 && delta <= 250) touch.isDoubleTap = true
+ touch.last = now
+ longTapTimeout = setTimeout(longTap, longTapDelay)
+ // adds the current touch contact for IE gesture recognition
+ if (gesture && _isPointerType) gesture.addPointer(e.pointerId)
+ }
+
+ move = function(e){
+ if((_isPointerType = isPointerEventType(e, 'move')) &&
+ !isPrimaryTouch(e)) return
+ firstTouch = _isPointerType ? e :((e.touches) ? e.touches[0]:e.originalEvent.changedTouches[0])
+ cancelLongTap()
+ touch.x2 = firstTouch.pageX
+ touch.y2 = firstTouch.pageY
+
+ deltaX += Math.abs(touch.x1 - touch.x2)
+ deltaY += Math.abs(touch.y1 - touch.y2)
+ }
+
+ up = function(e){
+ if((_isPointerType = isPointerEventType(e, 'up')) &&
+ !isPrimaryTouch(e)) return
+ cancelLongTap()
+
+ // swipe
+ if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) ||
+ (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30))
+
+ swipeTimeout = setTimeout(function() {
+ if (touch.el){
+ touch.el.trigger('swipe')
+ touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)))
+ }
+ touch = {}
+ }, 0)
+
+ // normal tap
+ else if ('last' in touch)
+ // don't fire tap when delta position changed by more than 30 pixels,
+ // for instance when moving to a point and back to origin
+ if (deltaX < 30 && deltaY < 30) {
+ // delay by one tick so we can cancel the 'tap' event if 'scroll' fires
+ // ('tap' fires before 'scroll')
+ tapTimeout = setTimeout(function() {
+
+ // trigger universal 'tap' with the option to cancelTouch()
+ // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
+ var event = jQuery.Event('tap')
+ event.cancelTouch = cancelAll
+ // [by paper] fix -> "TypeError: 'undefined' is not an object (evaluating 'touch.el.trigger'), when double tap
+ if (touch.el) touch.el.trigger(event)
+
+ // trigger double tap immediately
+ if (touch.isDoubleTap) {
+ if (touch.el) touch.el.trigger('doubleTap')
+ touch = {}
+ }
+
+ // trigger single tap after 250ms of inactivity
+ else {
+ touchTimeout = setTimeout(function(){
+ touchTimeout = null
+ if (touch.el) touch.el.trigger('singleTap')
+ touch = {}
+ }, 250)
+ }
+ }, 0)
+ } else {
+ touch = {}
+ }
+ deltaX = deltaY = 0
+ }
+
+ jQuery(document).on(eventMap.up, up)
+ .on(eventMap.down, down)
+ .on(eventMap.move, move)
+
+ // when the browser window loses focus,
+ // for example when a modal dialog is shown,
+ // cancel all ongoing events
+ jQuery(document).on(eventMap.cancel, cancelAll)
+
+ // scrolling the window indicates intention of the user
+ // to scroll, not tap or swipe, so cancel all ongoing events
+ jQuery(window).on('scroll', cancelAll)
+
+ initialized = true
+ }
+
+ ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown',
+ 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){
+ jQuery.fn[eventName] = function(callback){return this.on(eventName, callback) }
+ /*jQuery.fn[eventName] = function(callback){
+ return jQuery(document).off(eventName).on(eventName,this,callback)
+ }*/
+ })
+
+ jQuery.touch = { setup: setup }
+
+ jQuery(document).ready(setup)
+})(jQuery)
diff --git a/static/jquery_weui/js/clipboard.min.js b/static/jquery_weui/js/clipboard.min.js
new file mode 100644
index 0000000..b00ee51
--- /dev/null
+++ b/static/jquery_weui/js/clipboard.min.js
@@ -0,0 +1,7 @@
+/*!
+ * clipboard.js v2.0.0
+ * https://zenorocha.github.io/clipboard.js
+ *
+ * Licensed MIT © Zeno Rocha
+ */
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n
0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])});
\ No newline at end of file
diff --git a/static/jquery_weui/js/iscroll.js b/static/jquery_weui/js/iscroll.js
new file mode 100644
index 0000000..1635b3a
--- /dev/null
+++ b/static/jquery_weui/js/iscroll.js
@@ -0,0 +1,2122 @@
+/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
+(function (window, document, Math) {
+var rAF = window.requestAnimationFrame ||
+ window.webkitRequestAnimationFrame ||
+ window.mozRequestAnimationFrame ||
+ window.oRequestAnimationFrame ||
+ window.msRequestAnimationFrame ||
+ function (callback) { window.setTimeout(callback, 1000 / 60); };
+
+var utils = (function () {
+ var me = {};
+
+ var _elementStyle = document.createElement('div').style;
+ var _vendor = (function () {
+ var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],
+ transform,
+ i = 0,
+ l = vendors.length;
+
+ for ( ; i < l; i++ ) {
+ transform = vendors[i] + 'ransform';
+ if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);
+ }
+
+ return false;
+ })();
+
+ function _prefixStyle (style) {
+ if ( _vendor === false ) return false;
+ if ( _vendor === '' ) return style;
+ return _vendor + style.charAt(0).toUpperCase() + style.substr(1);
+ }
+
+ me.getTime = Date.now || function getTime () { return new Date().getTime(); };
+
+ me.extend = function (target, obj) {
+ for ( var i in obj ) {
+ target[i] = obj[i];
+ }
+ };
+
+ me.addEvent = function (el, type, fn, capture) {
+ el.addEventListener(type, fn, !!capture);
+ };
+
+ me.removeEvent = function (el, type, fn, capture) {
+ el.removeEventListener(type, fn, !!capture);
+ };
+
+ me.prefixPointerEvent = function (pointerEvent) {
+ return window.MSPointerEvent ?
+ 'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):
+ pointerEvent;
+ };
+
+ me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {
+ var distance = current - start,
+ speed = 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
+ };
+ };
+
+ var _transform = _prefixStyle('transform');
+
+ me.extend(me, {
+ hasTransform: _transform !== false,
+ hasPerspective: _prefixStyle('perspective') in _elementStyle,
+ hasTouch: 'ontouchstart' in window,
+ hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed
+ hasTransition: _prefixStyle('transition') in _elementStyle
+ });
+
+ /*
+ This should find all Android browsers lower than build 535.19 (both stock browser and webview)
+ - galaxy S2 is ok
+ - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`
+ - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
+ - galaxy S3 is badAndroid (stock brower, webview)
+ `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
+ - galaxy S4 is badAndroid (stock brower, webview)
+ `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`
+ - galaxy S5 is OK
+ `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
+ - galaxy S6 is OK
+ `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`
+ */
+ me.isBadAndroid = (function() {
+ var appVersion = window.navigator.appVersion;
+ // Android browser is not a chrome browser.
+ if (/Android/.test(appVersion) && !(/Chrome\/\d/.test(appVersion))) {
+ var safariVersion = appVersion.match(/Safari\/(\d+.\d)/);
+ if(safariVersion && typeof safariVersion === "object" && safariVersion.length >= 2) {
+ return parseFloat(safariVersion[1]) < 535.19;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ })();
+
+ me.extend(me.style = {}, {
+ transform: _transform,
+ transitionTimingFunction: _prefixStyle('transitionTimingFunction'),
+ transitionDuration: _prefixStyle('transitionDuration'),
+ transitionDelay: _prefixStyle('transitionDelay'),
+ transformOrigin: _prefixStyle('transformOrigin')
+ });
+
+ me.hasClass = function (e, c) {
+ var re = new RegExp("(^|\\s)" + c + "(\\s|$)");
+ return re.test(e.className);
+ };
+
+ me.addClass = function (e, c) {
+ if ( me.hasClass(e, c) ) {
+ return;
+ }
+
+ var newclass = e.className.split(' ');
+ newclass.push(c);
+ e.className = newclass.join(' ');
+ };
+
+ me.removeClass = function (e, c) {
+ if ( !me.hasClass(e, c) ) {
+ return;
+ }
+
+ var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g');
+ e.className = e.className.replace(re, ' ');
+ };
+
+ me.offset = function (el) {
+ var left = -el.offsetLeft,
+ top = -el.offsetTop;
+
+ // jshint -W084
+ while (el = el.offsetParent) {
+ left -= el.offsetLeft;
+ top -= el.offsetTop;
+ }
+ // jshint +W084
+
+ return {
+ left: left,
+ top: top
+ };
+ };
+
+ me.preventDefaultException = function (el, exceptions) {
+ for ( var i in exceptions ) {
+ if ( exceptions[i].test(el[i]) ) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ me.extend(me.eventType = {}, {
+ touchstart: 1,
+ touchmove: 1,
+ touchend: 1,
+
+ mousedown: 2,
+ mousemove: 2,
+ mouseup: 2,
+
+ pointerdown: 3,
+ pointermove: 3,
+ pointerup: 3,
+
+ MSPointerDown: 3,
+ MSPointerMove: 3,
+ MSPointerUp: 3
+ });
+
+ me.extend(me.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)', // Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1)
+ fn: function (k) {
+ return Math.sqrt( 1 - ( --k * k ) );
+ }
+ },
+ back: {
+ style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',
+ fn: function (k) {
+ var b = 4;
+ return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;
+ }
+ },
+ bounce: {
+ style: '',
+ fn: function (k) {
+ if ( ( k /= 1 ) < ( 1 / 2.75 ) ) {
+ return 7.5625 * k * k;
+ } else if ( k < ( 2 / 2.75 ) ) {
+ return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;
+ } else if ( k < ( 2.5 / 2.75 ) ) {
+ return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;
+ } else {
+ return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;
+ }
+ }
+ },
+ elastic: {
+ style: '',
+ fn: function (k) {
+ var f = 0.22,
+ e = 0.4;
+
+ if ( k === 0 ) { return 0; }
+ if ( k == 1 ) { return 1; }
+
+ return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );
+ }
+ }
+ });
+
+ me.tap = function (e, eventName) {
+ var ev = document.createEvent('Event');
+ ev.initEvent(eventName, true, true);
+ ev.pageX = e.pageX;
+ ev.pageY = e.pageY;
+ e.target.dispatchEvent(ev);
+ };
+
+ me.click = function (e) {
+ var target = e.target,
+ ev;
+
+ if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {
+ // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
+ // initMouseEvent is deprecated.
+ ev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');
+ ev.initEvent('click', true, true);
+ ev.view = e.view || window;
+ ev.detail = 1;
+ ev.screenX = target.screenX || 0;
+ ev.screenY = target.screenY || 0;
+ ev.clientX = target.clientX || 0;
+ ev.clientY = target.clientY || 0;
+ ev.ctrlKey = !!e.ctrlKey;
+ ev.altKey = !!e.altKey;
+ ev.shiftKey = !!e.shiftKey;
+ ev.metaKey = !!e.metaKey;
+ ev.button = 0;
+ ev.relatedTarget = null;
+ ev._constructed = true;
+ target.dispatchEvent(ev);
+ }
+ };
+
+ return me;
+})();
+function IScroll (el, options) {
+ this.wrapper = typeof el == 'string' ? document.querySelector(el) : el;
+ this.scroller = this.wrapper.children[0];
+ this.scrollerStyle = this.scroller.style; // cache style for better performance
+
+ this.options = {
+
+ resizeScrollbars: true,
+
+ mouseWheelSpeed: 20,
+
+ snapThreshold: 0.334,
+
+// INSERT POINT: OPTIONS
+ disablePointer : !utils.hasPointer,
+ disableTouch : utils.hasPointer || !utils.hasTouch,
+ disableMouse : utils.hasPointer || utils.hasTouch,
+ startX: 0,
+ startY: 0,
+ scrollY: true,
+ directionLockThreshold: 5,
+ momentum: true,
+
+ bounce: true,
+ bounceTime: 600,
+ bounceEasing: '',
+
+ preventDefault: true,
+ preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },
+
+ HWCompositing: true,
+ useTransition: true,
+ useTransform: true,
+ bindToWrapper: typeof window.onmousedown === "undefined"
+ };
+
+ for ( var i in options ) {
+ this.options[i] = options[i];
+ }
+
+ // Normalize options
+ this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';
+
+ this.options.useTransition = utils.hasTransition && this.options.useTransition;
+ this.options.useTransform = utils.hasTransform && this.options.useTransform;
+
+ this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;
+ this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;
+
+ // If you want eventPassthrough I have to lock one of the axes
+ this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;
+ this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;
+
+ // With eventPassthrough we also need lockDirection mechanism
+ this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;
+ this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;
+
+ this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;
+
+ this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;
+
+ if ( this.options.tap === true ) {
+ this.options.tap = 'tap';
+ }
+
+ // https://github.com/cubiq/iscroll/issues/1029
+ if (!this.options.useTransition && !this.options.useTransform) {
+ if(!(/relative|absolute/i).test(this.scrollerStyle.position)) {
+ this.scrollerStyle.position = "relative";
+ }
+ }
+
+ if ( this.options.shrinkScrollbars == 'scale' ) {
+ this.options.useTransition = false;
+ }
+
+ this.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;
+
+// INSERT POINT: NORMALIZATION
+
+ // Some defaults
+ this.x = 0;
+ this.y = 0;
+ this.directionX = 0;
+ this.directionY = 0;
+ this._events = {};
+
+// INSERT POINT: DEFAULTS
+
+ this._init();
+ this.refresh();
+
+ this.scrollTo(this.options.startX, this.options.startY);
+ this.enable();
+}
+
+IScroll.prototype = {
+ version: '5.2.0',
+
+ _init: function () {
+ this._initEvents();
+
+ if ( this.options.scrollbars || this.options.indicators ) {
+ this._initIndicators();
+ }
+
+ if ( this.options.mouseWheel ) {
+ this._initWheel();
+ }
+
+ if ( this.options.snap ) {
+ this._initSnap();
+ }
+
+ if ( this.options.keyBindings ) {
+ this._initKeys();
+ }
+
+// INSERT POINT: _init
+
+ },
+
+ destroy: function () {
+ this._initEvents(true);
+ clearTimeout(this.resizeTimeout);
+ this.resizeTimeout = null;
+ this._execEvent('destroy');
+ },
+
+ _transitionEnd: function (e) {
+ if ( e.target != this.scroller || !this.isInTransition ) {
+ return;
+ }
+
+ this._transitionTime();
+ if ( !this.resetPosition(this.options.bounceTime) ) {
+ this.isInTransition = false;
+ this._execEvent('scrollEnd');
+ }
+ },
+
+ _start: function (e) {
+ // React to left mouse button only
+ if ( utils.eventType[e.type] != 1 ) {
+ // for button property
+ // http://unixpapa.com/js/mouse.html
+ var button;
+ if (!e.which) {
+ /* IE case */
+ button = (e.button < 2) ? 0 :
+ ((e.button == 4) ? 1 : 2);
+ } else {
+ /* All others */
+ button = e.button;
+ }
+ if ( button !== 0 ) {
+ return;
+ }
+ }
+
+ if ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {
+ return;
+ }
+
+ if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
+ e.preventDefault();
+ }
+
+ var point = e.touches ? e.touches[0] : e,
+ pos;
+
+ this.initiated = utils.eventType[e.type];
+ this.moved = false;
+ this.distX = 0;
+ this.distY = 0;
+ this.directionX = 0;
+ this.directionY = 0;
+ this.directionLocked = 0;
+
+ this.startTime = utils.getTime();
+
+ if ( this.options.useTransition && this.isInTransition ) {
+ this._transitionTime();
+ this.isInTransition = false;
+ pos = this.getComputedPosition();
+ this._translate(Math.round(pos.x), Math.round(pos.y));
+ this._execEvent('scrollEnd');
+ } else if ( !this.options.useTransition && this.isAnimating ) {
+ this.isAnimating = false;
+ this._execEvent('scrollEnd');
+ }
+
+ this.startX = this.x;
+ this.startY = this.y;
+ this.absStartX = this.x;
+ this.absStartY = this.y;
+ this.pointX = point.pageX;
+ this.pointY = point.pageY;
+
+ this._execEvent('beforeScrollStart');
+ },
+
+ _move: function (e) {
+ if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
+ return;
+ }
+
+ if ( this.options.preventDefault ) { // increases performance on Android? TODO: check!
+ e.preventDefault();
+ }
+
+ var point = e.touches ? e.touches[0] : e,
+ deltaX = point.pageX - this.pointX,
+ deltaY = point.pageY - this.pointY,
+ timestamp = utils.getTime(),
+ newX, newY,
+ absDistX, absDistY;
+
+ this.pointX = point.pageX;
+ this.pointY = point.pageY;
+
+ this.distX += deltaX;
+ this.distY += deltaY;
+ absDistX = Math.abs(this.distX);
+ absDistY = Math.abs(this.distY);
+
+ // We need to move at least 10 pixels for the scrolling to initiate
+ if ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {
+ return;
+ }
+
+ // If you are scrolling in one direction lock the other
+ if ( !this.directionLocked && !this.options.freeScroll ) {
+ if ( absDistX > absDistY + this.options.directionLockThreshold ) {
+ this.directionLocked = 'h'; // lock horizontally
+ } else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {
+ this.directionLocked = 'v'; // lock vertically
+ } else {
+ this.directionLocked = 'n'; // no lock
+ }
+ }
+
+ if ( this.directionLocked == 'h' ) {
+ if ( this.options.eventPassthrough == 'vertical' ) {
+ e.preventDefault();
+ } else if ( this.options.eventPassthrough == 'horizontal' ) {
+ this.initiated = false;
+ return;
+ }
+
+ deltaY = 0;
+ } else if ( this.directionLocked == 'v' ) {
+ if ( this.options.eventPassthrough == 'horizontal' ) {
+ e.preventDefault();
+ } else if ( this.options.eventPassthrough == 'vertical' ) {
+ this.initiated = false;
+ return;
+ }
+
+ deltaX = 0;
+ }
+
+ deltaX = this.hasHorizontalScroll ? deltaX : 0;
+ deltaY = this.hasVerticalScroll ? deltaY : 0;
+
+ newX = this.x + deltaX;
+ 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;
+ }
+
+ this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;
+ this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;
+
+ if ( !this.moved ) {
+ this._execEvent('scrollStart');
+ }
+
+ this.moved = true;
+
+ this._translate(newX, newY);
+
+/* REPLACE START: _move */
+
+ if ( timestamp - this.startTime > 300 ) {
+ this.startTime = timestamp;
+ this.startX = this.x;
+ this.startY = this.y;
+ }
+
+/* REPLACE END: _move */
+
+ },
+
+ _end: function (e) {
+ if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
+ return;
+ }
+
+ if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
+ e.preventDefault();
+ }
+
+ var point = e.changedTouches ? e.changedTouches[0] : e,
+ momentumX,
+ momentumY,
+ duration = utils.getTime() - this.startTime,
+ newX = Math.round(this.x),
+ newY = Math.round(this.y),
+ distanceX = Math.abs(newX - this.startX),
+ distanceY = Math.abs(newY - this.startY),
+ time = 0,
+ easing = '';
+
+ this.isInTransition = 0;
+ this.initiated = 0;
+ this.endTime = utils.getTime();
+
+ // 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
+
+ // we scrolled less than 10 pixels
+ if ( !this.moved ) {
+ if ( this.options.tap ) {
+ utils.tap(e, this.options.tap);
+ }
+
+ if ( this.options.click ) {
+ utils.click(e);
+ }
+
+ this._execEvent('scrollCancel');
+ return;
+ }
+
+ if ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {
+ this._execEvent('flick');
+ return;
+ }
+
+ // start momentum animation if needed
+ if ( this.options.momentum && duration < 300 ) {
+ momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };
+ momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, 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 = 1;
+ }
+
+
+ if ( this.options.snap ) {
+ var snap = this._nearestSnap(newX, newY);
+ this.currentPage = snap;
+ time = this.options.snapSpeed || Math.max(
+ Math.max(
+ Math.min(Math.abs(newX - snap.x), 1000),
+ Math.min(Math.abs(newY - snap.y), 1000)
+ ), 300);
+ newX = snap.x;
+ newY = snap.y;
+
+ this.directionX = 0;
+ this.directionY = 0;
+ easing = this.options.bounceEasing;
+ }
+
+// INSERT POINT: _end
+
+ if ( newX != this.x || newY != this.y ) {
+ // change easing function when scroller goes out of the boundaries
+ if ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {
+ easing = utils.ease.quadratic;
+ }
+
+ this.scrollTo(newX, newY, time, easing);
+ return;
+ }
+
+ this._execEvent('scrollEnd');
+ },
+
+ _resize: function () {
+ var that = this;
+
+ clearTimeout(this.resizeTimeout);
+
+ this.resizeTimeout = setTimeout(function () {
+ that.refresh();
+ }, this.options.resizePolling);
+ },
+
+ 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;
+ },
+
+ disable: function () {
+ this.enabled = false;
+ },
+
+ enable: function () {
+ this.enabled = true;
+ },
+
+ refresh: function () {
+ var rf = this.wrapper.offsetHeight; // Force reflow
+
+ this.wrapperWidth = this.wrapper.clientWidth;
+ this.wrapperHeight = this.wrapper.clientHeight;
+
+/* REPLACE START: refresh */
+
+ this.scrollerWidth = this.scroller.offsetWidth;
+ this.scrollerHeight = this.scroller.offsetHeight;
+
+ this.maxScrollX = this.wrapperWidth - this.scrollerWidth;
+ this.maxScrollY = this.wrapperHeight - this.scrollerHeight;
+
+/* REPLACE END: refresh */
+
+ this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0;
+ this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0;
+
+ if ( !this.hasHorizontalScroll ) {
+ this.maxScrollX = 0;
+ this.scrollerWidth = this.wrapperWidth;
+ }
+
+ if ( !this.hasVerticalScroll ) {
+ this.maxScrollY = 0;
+ this.scrollerHeight = this.wrapperHeight;
+ }
+
+ this.endTime = 0;
+ this.directionX = 0;
+ this.directionY = 0;
+
+ this.wrapperOffset = utils.offset(this.wrapper);
+
+ this._execEvent('refresh');
+
+ this.resetPosition();
+
+// INSERT POINT: _refresh
+
+ },
+
+ on: function (type, fn) {
+ if ( !this._events[type] ) {
+ this._events[type] = [];
+ }
+
+ this._events[type].push(fn);
+ },
+
+ off: function (type, fn) {
+ if ( !this._events[type] ) {
+ return;
+ }
+
+ var index = this._events[type].indexOf(fn);
+
+ if ( index > -1 ) {
+ this._events[type].splice(index, 1);
+ }
+ },
+
+ _execEvent: function (type) {
+ if ( !this._events[type] ) {
+ return;
+ }
+
+ var i = 0,
+ l = this._events[type].length;
+
+ if ( !l ) {
+ return;
+ }
+
+ for ( ; i < l; i++ ) {
+ this._events[type][i].apply(this, [].slice.call(arguments, 1));
+ }
+ },
+
+ scrollBy: function (x, y, time, easing) {
+ x = this.x + x;
+ y = this.y + y;
+ time = time || 0;
+
+ this.scrollTo(x, y, time, easing);
+ },
+
+ scrollTo: function (x, y, time, easing) {
+ easing = easing || utils.ease.circular;
+
+ this.isInTransition = this.options.useTransition && time > 0;
+ var transitionType = this.options.useTransition && easing.style;
+ if ( !time || transitionType ) {
+ if(transitionType) {
+ this._transitionTimingFunction(easing.style);
+ this._transitionTime(time);
+ }
+ this._translate(x, y);
+ } else {
+ this._animate(x, y, time, easing.fn);
+ }
+ },
+
+ scrollToElement: function (el, time, offsetX, offsetY, easing) {
+ el = el.nodeType ? el : this.scroller.querySelector(el);
+
+ if ( !el ) {
+ return;
+ }
+
+ var pos = utils.offset(el);
+
+ pos.left -= this.wrapperOffset.left;
+ pos.top -= this.wrapperOffset.top;
+
+ // if offsetX/Y are true we center the element to the screen
+ if ( offsetX === true ) {
+ offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2);
+ }
+ if ( offsetY === true ) {
+ offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2);
+ }
+
+ pos.left -= offsetX || 0;
+ pos.top -= offsetY || 0;
+
+ pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;
+ pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top;
+
+ time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;
+
+ this.scrollTo(pos.left, pos.top, time, easing);
+ },
+
+ _transitionTime: function (time) {
+ if (!this.options.useTransition) {
+ return;
+ }
+ time = time || 0;
+ var durationProp = utils.style.transitionDuration;
+ if(!durationProp) {
+ return;
+ }
+
+ this.scrollerStyle[durationProp] = time + 'ms';
+
+ if ( !time && utils.isBadAndroid ) {
+ this.scrollerStyle[durationProp] = '0.0001ms';
+ // remove 0.0001ms
+ var self = this;
+ rAF(function() {
+ if(self.scrollerStyle[durationProp] === '0.0001ms') {
+ self.scrollerStyle[durationProp] = '0s';
+ }
+ });
+ }
+
+
+ if ( this.indicators ) {
+ for ( var i = this.indicators.length; i--; ) {
+ this.indicators[i].transitionTime(time);
+ }
+ }
+
+
+// INSERT POINT: _transitionTime
+
+ },
+
+ _transitionTimingFunction: function (easing) {
+ this.scrollerStyle[utils.style.transitionTimingFunction] = easing;
+
+
+ if ( this.indicators ) {
+ for ( var i = this.indicators.length; i--; ) {
+ this.indicators[i].transitionTimingFunction(easing);
+ }
+ }
+
+
+// INSERT POINT: _transitionTimingFunction
+
+ },
+
+ _translate: function (x, y) {
+ if ( this.options.useTransform ) {
+
+/* REPLACE START: _translate */
+
+ this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;
+// console.log(x);
+
+/* REPLACE END: _translate */
+
+ } else {
+ x = Math.round(x);
+ y = Math.round(y);
+ this.scrollerStyle.left = x + 'px';
+ this.scrollerStyle.top = y + 'px';
+ }
+
+ this.x = x;
+ this.y = y;
+
+
+ if ( this.indicators ) {
+ for ( var i = this.indicators.length; i--; ) {
+ this.indicators[i].updatePosition();
+ }
+ }
+
+
+// INSERT POINT: _translate
+
+ },
+
+ _initEvents: function (remove) {
+ var eventType = remove ? utils.removeEvent : utils.addEvent,
+ target = this.options.bindToWrapper ? this.wrapper : window;
+
+ eventType(window, 'orientationchange', this);
+ eventType(window, 'resize', this);
+
+ if ( this.options.click ) {
+ eventType(this.wrapper, 'click', this, true);
+ }
+
+ if ( !this.options.disableMouse ) {
+ eventType(this.wrapper, 'mousedown', this);
+ eventType(target, 'mousemove', this);
+ eventType(target, 'mousecancel', this);
+ eventType(target, 'mouseup', this);
+ }
+
+ if ( utils.hasPointer && !this.options.disablePointer ) {
+ eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);
+ eventType(target, utils.prefixPointerEvent('pointermove'), this);
+ eventType(target, utils.prefixPointerEvent('pointercancel'), this);
+ eventType(target, utils.prefixPointerEvent('pointerup'), this);
+ }
+
+ if ( utils.hasTouch && !this.options.disableTouch ) {
+ eventType(this.wrapper, 'touchstart', this);
+ eventType(target, 'touchmove', this);
+ eventType(target, 'touchcancel', this);
+ eventType(target, 'touchend', this);
+ }
+
+ eventType(this.scroller, 'transitionend', this);
+ eventType(this.scroller, 'webkitTransitionEnd', this);
+ eventType(this.scroller, 'oTransitionEnd', this);
+ eventType(this.scroller, 'MSTransitionEnd', this);
+ },
+
+ getComputedPosition: function () {
+ var matrix = window.getComputedStyle(this.scroller, null),
+ x, y;
+
+ if ( this.options.useTransform ) {
+ matrix = matrix[utils.style.transform].split(')')[0].split(', ');
+ x = +(matrix[12] || matrix[4]);
+ y = +(matrix[13] || matrix[5]);
+ } else {
+ x = +matrix.left.replace(/[^-\d.]/g, '');
+ y = +matrix.top.replace(/[^-\d.]/g, '');
+ }
+
+ return { x: x, y: y };
+ },
+ _initIndicators: function () {
+ var interactive = this.options.interactiveScrollbars,
+ customStyle = typeof this.options.scrollbars != 'string',
+ indicators = [],
+ indicator;
+
+ var that = this;
+
+ this.indicators = [];
+
+ if ( this.options.scrollbars ) {
+ // Vertical scrollbar
+ if ( this.options.scrollY ) {
+ indicator = {
+ el: createDefaultScrollbar('v', interactive, this.options.scrollbars),
+ interactive: interactive,
+ defaultScrollbars: true,
+ customStyle: customStyle,
+ resize: this.options.resizeScrollbars,
+ shrink: this.options.shrinkScrollbars,
+ fade: this.options.fadeScrollbars,
+ listenX: false
+ };
+
+ this.wrapper.appendChild(indicator.el);
+ indicators.push(indicator);
+ }
+
+ // Horizontal scrollbar
+ if ( this.options.scrollX ) {
+ indicator = {
+ el: createDefaultScrollbar('h', interactive, this.options.scrollbars),
+ interactive: interactive,
+ defaultScrollbars: true,
+ customStyle: customStyle,
+ resize: this.options.resizeScrollbars,
+ shrink: this.options.shrinkScrollbars,
+ fade: this.options.fadeScrollbars,
+ listenY: false
+ };
+
+ this.wrapper.appendChild(indicator.el);
+ indicators.push(indicator);
+ }
+ }
+
+ if ( this.options.indicators ) {
+ // TODO: check concat compatibility
+ indicators = indicators.concat(this.options.indicators);
+ }
+
+ for ( var i = indicators.length; i--; ) {
+ this.indicators.push( new Indicator(this, indicators[i]) );
+ }
+
+ // TODO: check if we can use array.map (wide compatibility and performance issues)
+ function _indicatorsMap (fn) {
+ if (that.indicators) {
+ for ( var i = that.indicators.length; i--; ) {
+ fn.call(that.indicators[i]);
+ }
+ }
+ }
+
+ if ( this.options.fadeScrollbars ) {
+ this.on('scrollEnd', function () {
+ _indicatorsMap(function () {
+ this.fade();
+ });
+ });
+
+ this.on('scrollCancel', function () {
+ _indicatorsMap(function () {
+ this.fade();
+ });
+ });
+
+ this.on('scrollStart', function () {
+ _indicatorsMap(function () {
+ this.fade(1);
+ });
+ });
+
+ this.on('beforeScrollStart', function () {
+ _indicatorsMap(function () {
+ this.fade(1, true);
+ });
+ });
+ }
+
+
+ this.on('refresh', function () {
+ _indicatorsMap(function () {
+ this.refresh();
+ });
+ });
+
+ this.on('destroy', function () {
+ _indicatorsMap(function () {
+ this.destroy();
+ });
+
+ delete this.indicators;
+ });
+ },
+
+ _initWheel: function () {
+ utils.addEvent(this.wrapper, 'wheel', this);
+ utils.addEvent(this.wrapper, 'mousewheel', this);
+ utils.addEvent(this.wrapper, 'DOMMouseScroll', this);
+
+ this.on('destroy', function () {
+ clearTimeout(this.wheelTimeout);
+ this.wheelTimeout = null;
+ utils.removeEvent(this.wrapper, 'wheel', this);
+ utils.removeEvent(this.wrapper, 'mousewheel', this);
+ utils.removeEvent(this.wrapper, 'DOMMouseScroll', this);
+ });
+ },
+
+ _wheel: function (e) {
+ if ( !this.enabled ) {
+ return;
+ }
+
+ e.preventDefault();
+
+ var wheelDeltaX, wheelDeltaY,
+ newX, newY,
+ that = this;
+
+ if ( this.wheelTimeout === undefined ) {
+ that._execEvent('scrollStart');
+ }
+
+ // Execute the scrollEnd event after 400ms the wheel stopped scrolling
+ clearTimeout(this.wheelTimeout);
+ this.wheelTimeout = setTimeout(function () {
+ if(!that.options.snap) {
+ that._execEvent('scrollEnd');
+ }
+ that.wheelTimeout = undefined;
+ }, 400);
+
+ if ( 'deltaX' in e ) {
+ if (e.deltaMode === 1) {
+ wheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;
+ wheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;
+ } else {
+ wheelDeltaX = -e.deltaX;
+ wheelDeltaY = -e.deltaY;
+ }
+ } else if ( 'wheelDeltaX' in e ) {
+ wheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;
+ wheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;
+ } else if ( 'wheelDelta' in e ) {
+ wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;
+ } else if ( 'detail' in e ) {
+ wheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;
+ } else {
+ return;
+ }
+
+ wheelDeltaX *= this.options.invertWheelDirection;
+ wheelDeltaY *= this.options.invertWheelDirection;
+
+ if ( !this.hasVerticalScroll ) {
+ wheelDeltaX = wheelDeltaY;
+ wheelDeltaY = 0;
+ }
+
+ if ( this.options.snap ) {
+ newX = this.currentPage.pageX;
+ newY = this.currentPage.pageY;
+
+ if ( wheelDeltaX > 0 ) {
+ newX--;
+ } else if ( wheelDeltaX < 0 ) {
+ newX++;
+ }
+
+ if ( wheelDeltaY > 0 ) {
+ newY--;
+ } else if ( wheelDeltaY < 0 ) {
+ newY++;
+ }
+
+ this.goToPage(newX, newY);
+
+ return;
+ }
+
+ newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);
+ newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);
+
+ this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;
+ this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;
+
+ if ( newX > 0 ) {
+ newX = 0;
+ } else if ( newX < this.maxScrollX ) {
+ newX = this.maxScrollX;
+ }
+
+ if ( newY > 0 ) {
+ newY = 0;
+ } else if ( newY < this.maxScrollY ) {
+ newY = this.maxScrollY;
+ }
+
+ this.scrollTo(newX, newY, 0);
+
+// INSERT POINT: _wheel
+ },
+
+ _initSnap: function () {
+ this.currentPage = {};
+
+ if ( typeof this.options.snap == 'string' ) {
+ this.options.snap = this.scroller.querySelectorAll(this.options.snap);
+ }
+
+ this.on('refresh', function () {
+ var i = 0, l,
+ m = 0, n,
+ cx, cy,
+ x = 0, y,
+ stepX = this.options.snapStepX || this.wrapperWidth,
+ stepY = this.options.snapStepY || this.wrapperHeight,
+ el;
+
+ this.pages = [];
+
+ if ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {
+ return;
+ }
+
+ if ( this.options.snap === true ) {
+ cx = Math.round( stepX / 2 );
+ cy = Math.round( stepY / 2 );
+
+ while ( x > -this.scrollerWidth ) {
+ this.pages[i] = [];
+ l = 0;
+ y = 0;
+
+ while ( y > -this.scrollerHeight ) {
+ this.pages[i][l] = {
+ x: Math.max(x, this.maxScrollX),
+ y: Math.max(y, this.maxScrollY),
+ width: stepX,
+ height: stepY,
+ cx: x - cx,
+ cy: y - cy
+ };
+
+ y -= stepY;
+ l++;
+ }
+
+ x -= stepX;
+ i++;
+ }
+ } else {
+ el = this.options.snap;
+ l = el.length;
+ n = -1;
+
+ for ( ; i < l; i++ ) {
+ if ( i === 0 || el[i].offsetLeft <= el[i-1].offsetLeft ) {
+ m = 0;
+ n++;
+ }
+
+ if ( !this.pages[m] ) {
+ this.pages[m] = [];
+ }
+
+ x = Math.max(-el[i].offsetLeft, this.maxScrollX);
+ y = Math.max(-el[i].offsetTop, this.maxScrollY);
+ cx = x - Math.round(el[i].offsetWidth / 2);
+ cy = y - Math.round(el[i].offsetHeight / 2);
+
+ this.pages[m][n] = {
+ x: x,
+ y: y,
+ width: el[i].offsetWidth,
+ height: el[i].offsetHeight,
+ cx: cx,
+ cy: cy
+ };
+
+ if ( x > this.maxScrollX ) {
+ m++;
+ }
+ }
+ }
+
+ this.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);
+
+ // Update snap threshold if needed
+ if ( this.options.snapThreshold % 1 === 0 ) {
+ this.snapThresholdX = this.options.snapThreshold;
+ this.snapThresholdY = this.options.snapThreshold;
+ } else {
+ this.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);
+ this.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);
+ }
+ });
+
+ this.on('flick', function () {
+ var time = this.options.snapSpeed || Math.max(
+ Math.max(
+ Math.min(Math.abs(this.x - this.startX), 1000),
+ Math.min(Math.abs(this.y - this.startY), 1000)
+ ), 300);
+
+ this.goToPage(
+ this.currentPage.pageX + this.directionX,
+ this.currentPage.pageY + this.directionY,
+ time
+ );
+ });
+ },
+
+ _nearestSnap: function (x, y) {
+ if ( !this.pages.length ) {
+ return { x: 0, y: 0, pageX: 0, pageY: 0 };
+ }
+
+ var i = 0,
+ l = this.pages.length,
+ m = 0;
+
+ // Check if we exceeded the snap threshold
+ if ( Math.abs(x - this.absStartX) < this.snapThresholdX &&
+ Math.abs(y - this.absStartY) < this.snapThresholdY ) {
+ return this.currentPage;
+ }
+
+ if ( x > 0 ) {
+ x = 0;
+ } else if ( x < this.maxScrollX ) {
+ x = this.maxScrollX;
+ }
+
+ if ( y > 0 ) {
+ y = 0;
+ } else if ( y < this.maxScrollY ) {
+ y = this.maxScrollY;
+ }
+
+ for ( ; i < l; i++ ) {
+ if ( x >= this.pages[i][0].cx ) {
+ x = this.pages[i][0].x;
+ break;
+ }
+ }
+
+ l = this.pages[i].length;
+
+ for ( ; m < l; m++ ) {
+ if ( y >= this.pages[0][m].cy ) {
+ y = this.pages[0][m].y;
+ break;
+ }
+ }
+
+ if ( i == this.currentPage.pageX ) {
+ i += this.directionX;
+
+ if ( i < 0 ) {
+ i = 0;
+ } else if ( i >= this.pages.length ) {
+ i = this.pages.length - 1;
+ }
+
+ x = this.pages[i][0].x;
+ }
+
+ if ( m == this.currentPage.pageY ) {
+ m += this.directionY;
+
+ if ( m < 0 ) {
+ m = 0;
+ } else if ( m >= this.pages[0].length ) {
+ m = this.pages[0].length - 1;
+ }
+
+ y = this.pages[0][m].y;
+ }
+
+ return {
+ x: x,
+ y: y,
+ pageX: i,
+ pageY: m
+ };
+ },
+
+ goToPage: function (x, y, time, easing) {
+ easing = easing || this.options.bounceEasing;
+
+ if ( x >= this.pages.length ) {
+ x = this.pages.length - 1;
+ } else if ( x < 0 ) {
+ x = 0;
+ }
+
+ if ( y >= this.pages[x].length ) {
+ y = this.pages[x].length - 1;
+ } else if ( y < 0 ) {
+ y = 0;
+ }
+
+ var posX = this.pages[x][y].x,
+ posY = this.pages[x][y].y;
+
+ time = time === undefined ? this.options.snapSpeed || Math.max(
+ Math.max(
+ Math.min(Math.abs(posX - this.x), 1000),
+ Math.min(Math.abs(posY - this.y), 1000)
+ ), 300) : time;
+
+ this.currentPage = {
+ x: posX,
+ y: posY,
+ pageX: x,
+ pageY: y
+ };
+
+ this.scrollTo(posX, posY, time, easing);
+ },
+
+ next: function (time, easing) {
+ var x = this.currentPage.pageX,
+ y = this.currentPage.pageY;
+
+ x++;
+
+ if ( x >= this.pages.length && this.hasVerticalScroll ) {
+ x = 0;
+ y++;
+ }
+
+ this.goToPage(x, y, time, easing);
+ },
+
+ prev: function (time, easing) {
+ var x = this.currentPage.pageX,
+ y = this.currentPage.pageY;
+
+ x--;
+
+ if ( x < 0 && this.hasVerticalScroll ) {
+ x = 0;
+ y--;
+ }
+
+ this.goToPage(x, y, time, easing);
+ },
+
+ _initKeys: function (e) {
+ // default key bindings
+ var keys = {
+ pageUp: 33,
+ pageDown: 34,
+ end: 35,
+ home: 36,
+ left: 37,
+ up: 38,
+ right: 39,
+ down: 40
+ };
+ var i;
+
+ // if you give me characters I give you keycode
+ if ( typeof this.options.keyBindings == 'object' ) {
+ for ( i in this.options.keyBindings ) {
+ if ( typeof this.options.keyBindings[i] == 'string' ) {
+ this.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);
+ }
+ }
+ } else {
+ this.options.keyBindings = {};
+ }
+
+ for ( i in keys ) {
+ this.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];
+ }
+
+ utils.addEvent(window, 'keydown', this);
+
+ this.on('destroy', function () {
+ utils.removeEvent(window, 'keydown', this);
+ });
+ },
+
+ _key: function (e) {
+ if ( !this.enabled ) {
+ return;
+ }
+
+ var snap = this.options.snap, // we are using this alot, better to cache it
+ newX = snap ? this.currentPage.pageX : this.x,
+ newY = snap ? this.currentPage.pageY : this.y,
+ now = utils.getTime(),
+ prevTime = this.keyTime || 0,
+ acceleration = 0.250,
+ pos;
+
+ if ( this.options.useTransition && this.isInTransition ) {
+ pos = this.getComputedPosition();
+
+ this._translate(Math.round(pos.x), Math.round(pos.y));
+ this.isInTransition = false;
+ }
+
+ this.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;
+
+ switch ( e.keyCode ) {
+ case this.options.keyBindings.pageUp:
+ if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
+ newX += snap ? 1 : this.wrapperWidth;
+ } else {
+ newY += snap ? 1 : this.wrapperHeight;
+ }
+ break;
+ case this.options.keyBindings.pageDown:
+ if ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {
+ newX -= snap ? 1 : this.wrapperWidth;
+ } else {
+ newY -= snap ? 1 : this.wrapperHeight;
+ }
+ break;
+ case this.options.keyBindings.end:
+ newX = snap ? this.pages.length-1 : this.maxScrollX;
+ newY = snap ? this.pages[0].length-1 : this.maxScrollY;
+ break;
+ case this.options.keyBindings.home:
+ newX = 0;
+ newY = 0;
+ break;
+ case this.options.keyBindings.left:
+ newX += snap ? -1 : 5 + this.keyAcceleration>>0;
+ break;
+ case this.options.keyBindings.up:
+ newY += snap ? 1 : 5 + this.keyAcceleration>>0;
+ break;
+ case this.options.keyBindings.right:
+ newX -= snap ? -1 : 5 + this.keyAcceleration>>0;
+ break;
+ case this.options.keyBindings.down:
+ newY -= snap ? 1 : 5 + this.keyAcceleration>>0;
+ break;
+ default:
+ return;
+ }
+
+ if ( snap ) {
+ this.goToPage(newX, newY);
+ return;
+ }
+
+ if ( newX > 0 ) {
+ newX = 0;
+ this.keyAcceleration = 0;
+ } else if ( newX < this.maxScrollX ) {
+ newX = this.maxScrollX;
+ this.keyAcceleration = 0;
+ }
+
+ if ( newY > 0 ) {
+ newY = 0;
+ this.keyAcceleration = 0;
+ } else if ( newY < this.maxScrollY ) {
+ newY = this.maxScrollY;
+ this.keyAcceleration = 0;
+ }
+
+ this.scrollTo(newX, newY, 0);
+
+ this.keyTime = now;
+ },
+
+ _animate: function (destX, destY, duration, easingFn) {
+ var that = this,
+ startX = this.x,
+ startY = this.y,
+ startTime = utils.getTime(),
+ destTime = startTime + duration;
+
+ function step () {
+ var now = utils.getTime(),
+ newX, newY,
+ easing;
+
+ if ( now >= destTime ) {
+ that.isAnimating = false;
+ that._translate(destX, destY);
+
+ if ( !that.resetPosition(that.options.bounceTime) ) {
+ that._execEvent('scrollEnd');
+ }
+
+ return;
+ }
+
+ now = ( now - startTime ) / duration;
+ easing = easingFn(now);
+ newX = ( destX - startX ) * easing + startX;
+ newY = ( destY - startY ) * easing + startY;
+ that._translate(newX, newY);
+
+ if ( that.isAnimating ) {
+ rAF(step);
+ }
+ }
+
+ this.isAnimating = true;
+ step();
+ },
+ handleEvent: function (e) {
+ switch ( e.type ) {
+ case 'touchstart':
+ case 'pointerdown':
+ case 'MSPointerDown':
+ case 'mousedown':
+ this._start(e);
+ break;
+ case 'touchmove':
+ case 'pointermove':
+ case 'MSPointerMove':
+ case 'mousemove':
+ this._move(e);
+ break;
+ case 'touchend':
+ case 'pointerup':
+ case 'MSPointerUp':
+ case 'mouseup':
+ case 'touchcancel':
+ case 'pointercancel':
+ case 'MSPointerCancel':
+ case 'mousecancel':
+ this._end(e);
+ break;
+ case 'orientationchange':
+ case 'resize':
+ this._resize();
+ break;
+ case 'transitionend':
+ case 'webkitTransitionEnd':
+ case 'oTransitionEnd':
+ case 'MSTransitionEnd':
+ this._transitionEnd(e);
+ break;
+ case 'wheel':
+ case 'DOMMouseScroll':
+ case 'mousewheel':
+ this._wheel(e);
+ break;
+ case 'keydown':
+ this._key(e);
+ break;
+ case 'click':
+ if ( this.enabled && !e._constructed ) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ break;
+ }
+ }
+};
+function createDefaultScrollbar (direction, interactive, type) {
+ var scrollbar = document.createElement('div'),
+ indicator = document.createElement('div');
+
+ if ( type === true ) {
+ scrollbar.style.cssText = 'position:absolute;z-index:9999';
+ indicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';
+ }
+
+ indicator.className = 'iScrollIndicator';
+
+ if ( direction == 'h' ) {
+ if ( type === true ) {
+ scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';
+ indicator.style.height = '100%';
+ }
+ scrollbar.className = 'iScrollHorizontalScrollbar';
+ } else {
+ if ( type === true ) {
+ scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';
+ indicator.style.width = '100%';
+ }
+ scrollbar.className = 'iScrollVerticalScrollbar';
+ }
+
+ scrollbar.style.cssText += ';overflow:hidden';
+
+ if ( !interactive ) {
+ scrollbar.style.pointerEvents = 'none';
+ }
+
+ scrollbar.appendChild(indicator);
+
+ return scrollbar;
+}
+
+function Indicator (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 = {
+ listenX: true,
+ listenY: true,
+ interactive: false,
+ resize: true,
+ defaultScrollbars: false,
+ shrink: false,
+ fade: false,
+ speedRatioX: 0,
+ speedRatioY: 0
+ };
+
+ for ( var i in options ) {
+ this.options[i] = options[i];
+ }
+
+ this.sizeRatioX = 1;
+ this.sizeRatioY = 1;
+ this.maxPosX = 0;
+ this.maxPosY = 0;
+
+ if ( this.options.interactive ) {
+ if ( !this.options.disableTouch ) {
+ utils.addEvent(this.indicator, 'touchstart', this);
+ utils.addEvent(window, 'touchend', this);
+ }
+ if ( !this.options.disablePointer ) {
+ utils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);
+ utils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);
+ }
+ if ( !this.options.disableMouse ) {
+ utils.addEvent(this.indicator, 'mousedown', this);
+ utils.addEvent(window, 'mouseup', this);
+ }
+ }
+
+ if ( this.options.fade ) {
+ this.wrapperStyle[utils.style.transform] = this.scroller.translateZ;
+ var durationProp = utils.style.transitionDuration;
+ if(!durationProp) {
+ return;
+ }
+ this.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';
+ // remove 0.0001ms
+ var self = this;
+ if(utils.isBadAndroid) {
+ rAF(function() {
+ if(self.wrapperStyle[durationProp] === '0.0001ms') {
+ self.wrapperStyle[durationProp] = '0s';
+ }
+ });
+ }
+ this.wrapperStyle.opacity = '0';
+ }
+}
+
+Indicator.prototype = {
+ handleEvent: function (e) {
+ switch ( e.type ) {
+ case 'touchstart':
+ case 'pointerdown':
+ case 'MSPointerDown':
+ case 'mousedown':
+ this._start(e);
+ break;
+ case 'touchmove':
+ case 'pointermove':
+ case 'MSPointerMove':
+ case 'mousemove':
+ this._move(e);
+ break;
+ case 'touchend':
+ case 'pointerup':
+ case 'MSPointerUp':
+ case 'mouseup':
+ case 'touchcancel':
+ case 'pointercancel':
+ case 'MSPointerCancel':
+ case 'mousecancel':
+ this._end(e);
+ break;
+ }
+ },
+
+ destroy: function () {
+ if ( this.options.fadeScrollbars ) {
+ clearTimeout(this.fadeTimeout);
+ this.fadeTimeout = null;
+ }
+ if ( this.options.interactive ) {
+ utils.removeEvent(this.indicator, 'touchstart', this);
+ utils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);
+ utils.removeEvent(this.indicator, 'mousedown', this);
+
+ utils.removeEvent(window, 'touchmove', this);
+ utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);
+ utils.removeEvent(window, 'mousemove', this);
+
+ utils.removeEvent(window, 'touchend', this);
+ utils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);
+ utils.removeEvent(window, 'mouseup', this);
+ }
+
+ if ( this.options.defaultScrollbars ) {
+ this.wrapper.parentNode.removeChild(this.wrapper);
+ }
+ },
+
+ _start: function (e) {
+ var point = e.touches ? e.touches[0] : e;
+
+ e.preventDefault();
+ e.stopPropagation();
+
+ this.transitionTime();
+
+ this.initiated = true;
+ this.moved = false;
+ this.lastPointX = point.pageX;
+ this.lastPointY = point.pageY;
+
+ this.startTime = utils.getTime();
+
+ if ( !this.options.disableTouch ) {
+ utils.addEvent(window, 'touchmove', this);
+ }
+ if ( !this.options.disablePointer ) {
+ utils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);
+ }
+ if ( !this.options.disableMouse ) {
+ utils.addEvent(window, 'mousemove', this);
+ }
+
+ this.scroller._execEvent('beforeScrollStart');
+ },
+
+ _move: function (e) {
+ var point = e.touches ? e.touches[0] : e,
+ deltaX, deltaY,
+ newX, newY,
+ timestamp = utils.getTime();
+
+ if ( !this.moved ) {
+ this.scroller._execEvent('scrollStart');
+ }
+
+ this.moved = true;
+
+ deltaX = point.pageX - this.lastPointX;
+ this.lastPointX = point.pageX;
+
+ deltaY = point.pageY - this.lastPointY;
+ this.lastPointY = point.pageY;
+
+ newX = this.x + deltaX;
+ newY = this.y + deltaY;
+
+ this._pos(newX, newY);
+
+// INSERT POINT: indicator._move
+
+ e.preventDefault();
+ e.stopPropagation();
+ },
+
+ _end: function (e) {
+ if ( !this.initiated ) {
+ return;
+ }
+
+ this.initiated = false;
+
+ e.preventDefault();
+ e.stopPropagation();
+
+ utils.removeEvent(window, 'touchmove', this);
+ utils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);
+ utils.removeEvent(window, 'mousemove', this);
+
+ if ( this.scroller.options.snap ) {
+ var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);
+
+ var time = this.options.snapSpeed || Math.max(
+ Math.max(
+ Math.min(Math.abs(this.scroller.x - snap.x), 1000),
+ Math.min(Math.abs(this.scroller.y - snap.y), 1000)
+ ), 300);
+
+ if ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {
+ this.scroller.directionX = 0;
+ this.scroller.directionY = 0;
+ this.scroller.currentPage = snap;
+ this.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);
+ }
+ }
+
+ if ( this.moved ) {
+ this.scroller._execEvent('scrollEnd');
+ }
+ },
+
+ transitionTime: function (time) {
+ time = time || 0;
+ var durationProp = utils.style.transitionDuration;
+ if(!durationProp) {
+ return;
+ }
+
+ this.indicatorStyle[durationProp] = time + 'ms';
+
+ if ( !time && utils.isBadAndroid ) {
+ this.indicatorStyle[durationProp] = '0.0001ms';
+ // remove 0.0001ms
+ var self = this;
+ rAF(function() {
+ if(self.indicatorStyle[durationProp] === '0.0001ms') {
+ self.indicatorStyle[durationProp] = '0s';
+ }
+ });
+ }
+ },
+
+ transitionTimingFunction: function (easing) {
+ this.indicatorStyle[utils.style.transitionTimingFunction] = 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';
+ }
+
+ if ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {
+ utils.addClass(this.wrapper, 'iScrollBothScrollbars');
+ utils.removeClass(this.wrapper, 'iScrollLoneScrollbar');
+
+ if ( this.options.defaultScrollbars && this.options.customStyle ) {
+ if ( this.options.listenX ) {
+ this.wrapper.style.right = '8px';
+ } else {
+ this.wrapper.style.bottom = '8px';
+ }
+ }
+ } else {
+ utils.removeClass(this.wrapper, 'iScrollBothScrollbars');
+ utils.addClass(this.wrapper, 'iScrollLoneScrollbar');
+
+ if ( this.options.defaultScrollbars && this.options.customStyle ) {
+ if ( this.options.listenX ) {
+ this.wrapper.style.right = '2px';
+ } else {
+ this.wrapper.style.bottom = '2px';
+ }
+ }
+ }
+
+ var r = this.wrapper.offsetHeight; // force refresh
+
+ if ( this.options.listenX ) {
+ this.wrapperWidth = this.wrapper.clientWidth;
+ if ( this.options.resize ) {
+ this.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);
+ this.indicatorStyle.width = this.indicatorWidth + 'px';
+ } else {
+ this.indicatorWidth = this.indicator.clientWidth;
+ }
+
+ this.maxPosX = this.wrapperWidth - this.indicatorWidth;
+
+ if ( this.options.shrink == 'clip' ) {
+ this.minBoundaryX = -this.indicatorWidth + 8;
+ this.maxBoundaryX = this.wrapperWidth - 8;
+ } else {
+ 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;
+ if ( this.options.resize ) {
+ this.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);
+ this.indicatorStyle.height = this.indicatorHeight + 'px';
+ } else {
+ this.indicatorHeight = this.indicator.clientHeight;
+ }
+
+ this.maxPosY = this.wrapperHeight - this.indicatorHeight;
+
+ if ( this.options.shrink == 'clip' ) {
+ this.minBoundaryY = -this.indicatorHeight + 8;
+ this.maxBoundaryY = this.wrapperHeight - 8;
+ } else {
+ this.minBoundaryY = 0;
+ this.maxBoundaryY = this.maxPosY;
+ }
+
+ this.maxPosY = this.wrapperHeight - this.indicatorHeight;
+ 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 ( !this.options.ignoreBoundaries ) {
+ if ( x < this.minBoundaryX ) {
+ if ( this.options.shrink == 'scale' ) {
+ this.width = Math.max(this.indicatorWidth + x, 8);
+ this.indicatorStyle.width = this.width + 'px';
+ }
+ x = this.minBoundaryX;
+ } else if ( x > this.maxBoundaryX ) {
+ if ( this.options.shrink == 'scale' ) {
+ this.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);
+ this.indicatorStyle.width = this.width + 'px';
+ x = this.maxPosX + this.indicatorWidth - this.width;
+ } else {
+ x = this.maxBoundaryX;
+ }
+ } else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {
+ this.width = this.indicatorWidth;
+ this.indicatorStyle.width = this.width + 'px';
+ }
+
+ if ( y < this.minBoundaryY ) {
+ if ( this.options.shrink == 'scale' ) {
+ this.height = Math.max(this.indicatorHeight + y * 3, 8);
+ this.indicatorStyle.height = this.height + 'px';
+ }
+ y = this.minBoundaryY;
+ } else if ( y > this.maxBoundaryY ) {
+ if ( this.options.shrink == 'scale' ) {
+ 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 {
+ y = this.maxBoundaryY;
+ }
+ } else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {
+ this.height = this.indicatorHeight;
+ this.indicatorStyle.height = this.height + 'px';
+ }
+ }
+
+ this.x = x;
+ this.y = y;
+
+ if ( this.scroller.options.useTransform ) {
+ this.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;
+ } else {
+ this.indicatorStyle.left = x + 'px';
+ this.indicatorStyle.top = y + 'px';
+ }
+ },
+
+ _pos: function (x, y) {
+ if ( x < 0 ) {
+ x = 0;
+ } else if ( x > this.maxPosX ) {
+ x = this.maxPosX;
+ }
+
+ if ( y < 0 ) {
+ y = 0;
+ } else if ( y > this.maxPosY ) {
+ y = this.maxPosY;
+ }
+
+ x = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;
+ y = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;
+
+ this.scroller.scrollTo(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[utils.style.transitionDuration] = time + 'ms';
+
+ this.fadeTimeout = setTimeout((function (val) {
+ this.wrapperStyle.opacity = val;
+ this.visible = +val;
+ }).bind(this, val), delay);
+ }
+};
+
+IScroll.utils = utils;
+
+if ( typeof module != 'undefined' && module.exports ) {
+ module.exports = IScroll;
+} else if ( typeof define == 'function' && define.amd ) {
+ define( function () { return IScroll; } );
+} else {
+ window.IScroll = IScroll;
+}
+
+})(window, document, Math);
diff --git a/static/jquery_weui/js/jquery-weui.js b/static/jquery_weui/js/jquery-weui.js
new file mode 100644
index 0000000..3ba54c3
--- /dev/null
+++ b/static/jquery_weui/js/jquery-weui.js
@@ -0,0 +1,6441 @@
+/**
+* jQuery WeUI V1.2.0
+* By 言川
+* http://lihongxun945.github.io/jquery-weui/
+ */
+/* global $:true */
+/* global WebKitCSSMatrix:true */
+
+(function($) {
+ "use strict";
+
+ $.fn.transitionEnd = function(callback) {
+ var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
+ i, dom = this;
+
+ function fireCallBack(e) {
+ /*jshint validthis:true */
+ if (e.target !== this) return;
+ callback.call(this, e);
+ for (i = 0; i < events.length; i++) {
+ dom.off(events[i], fireCallBack);
+ }
+ }
+ if (callback) {
+ for (i = 0; i < events.length; i++) {
+ dom.on(events[i], fireCallBack);
+ }
+ }
+ return this;
+ };
+
+ $.support = (function() {
+ var support = {
+ touch: !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch)
+ };
+ return support;
+ })();
+
+ $.touchEvents = {
+ start: $.support.touch ? 'touchstart' : 'mousedown',
+ move: $.support.touch ? 'touchmove' : 'mousemove',
+ end: $.support.touch ? 'touchend' : 'mouseup'
+ };
+
+ $.getTouchPosition = function(e) {
+ e = e.originalEvent || e; //jquery wrap the originevent
+ if(e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend') {
+ return {
+ x: e.targetTouches[0].pageX,
+ y: e.targetTouches[0].pageY
+ };
+ } else {
+ return {
+ x: e.pageX,
+ y: e.pageY
+ };
+ }
+ };
+
+ $.fn.scrollHeight = function() {
+ return this[0].scrollHeight;
+ };
+
+ $.fn.transform = function(transform) {
+ for (var i = 0; i < this.length; i++) {
+ var elStyle = this[i].style;
+ elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;
+ }
+ return this;
+ };
+ $.fn.transition = function(duration) {
+ if (typeof duration !== 'string') {
+ duration = duration + 'ms';
+ }
+ for (var i = 0; i < this.length; i++) {
+ var elStyle = this[i].style;
+ elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;
+ }
+ return this;
+ };
+
+ $.getTranslate = function (el, axis) {
+ var matrix, curTransform, curStyle, transformMatrix;
+
+ // automatic axis detection
+ if (typeof axis === 'undefined') {
+ axis = 'x';
+ }
+
+ curStyle = window.getComputedStyle(el, null);
+ if (window.WebKitCSSMatrix) {
+ // Some old versions of Webkit choke when 'none' is passed; pass
+ // empty string instead in this case
+ transformMatrix = new WebKitCSSMatrix(curStyle.webkitTransform === 'none' ? '' : curStyle.webkitTransform);
+ }
+ else {
+ transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
+ matrix = transformMatrix.toString().split(',');
+ }
+
+ if (axis === 'x') {
+ //Latest Chrome and webkits Fix
+ if (window.WebKitCSSMatrix)
+ curTransform = transformMatrix.m41;
+ //Crazy IE10 Matrix
+ else if (matrix.length === 16)
+ curTransform = parseFloat(matrix[12]);
+ //Normal Browsers
+ else
+ curTransform = parseFloat(matrix[4]);
+ }
+ if (axis === 'y') {
+ //Latest Chrome and webkits Fix
+ if (window.WebKitCSSMatrix)
+ curTransform = transformMatrix.m42;
+ //Crazy IE10 Matrix
+ else if (matrix.length === 16)
+ curTransform = parseFloat(matrix[13]);
+ //Normal Browsers
+ else
+ curTransform = parseFloat(matrix[5]);
+ }
+
+ return curTransform || 0;
+ };
+ $.requestAnimationFrame = function (callback) {
+ if (window.requestAnimationFrame) return window.requestAnimationFrame(callback);
+ else if (window.webkitRequestAnimationFrame) return window.webkitRequestAnimationFrame(callback);
+ else if (window.mozRequestAnimationFrame) return window.mozRequestAnimationFrame(callback);
+ else {
+ return window.setTimeout(callback, 1000 / 60);
+ }
+ };
+
+ $.cancelAnimationFrame = function (id) {
+ if (window.cancelAnimationFrame) return window.cancelAnimationFrame(id);
+ else if (window.webkitCancelAnimationFrame) return window.webkitCancelAnimationFrame(id);
+ else if (window.mozCancelAnimationFrame) return window.mozCancelAnimationFrame(id);
+ else {
+ return window.clearTimeout(id);
+ }
+ };
+
+ $.fn.join = function(arg) {
+ return this.toArray().join(arg);
+ }
+})($);
+
+/*===========================
+ Template7 Template engine
+ ===========================*/
+/* global $:true */
+/* jshint unused:false */
+/* jshint forin:false */
++function ($) {
+ "use strict";
+ $.Template7 = $.t7 = (function () {
+ function isArray(arr) {
+ return Object.prototype.toString.apply(arr) === '[object Array]';
+ }
+ function isObject(obj) {
+ return obj instanceof Object;
+ }
+ function isFunction(func) {
+ return typeof func === 'function';
+ }
+ var cache = {};
+ function helperToSlices(string) {
+ var helperParts = string.replace(/[{}#}]/g, '').split(' ');
+ var slices = [];
+ var shiftIndex, i, j;
+ for (i = 0; i < helperParts.length; i++) {
+ var part = helperParts[i];
+ if (i === 0) slices.push(part);
+ else {
+ if (part.indexOf('"') === 0) {
+ // Plain String
+ if (part.match(/"/g).length === 2) {
+ // One word string
+ slices.push(part);
+ }
+ else {
+ // Find closed Index
+ shiftIndex = 0;
+ for (j = i + 1; j < helperParts.length; j++) {
+ part += ' ' + helperParts[j];
+ if (helperParts[j].indexOf('"') >= 0) {
+ shiftIndex = j;
+ slices.push(part);
+ break;
+ }
+ }
+ if (shiftIndex) i = shiftIndex;
+ }
+ }
+ else {
+ if (part.indexOf('=') > 0) {
+ // Hash
+ var hashParts = part.split('=');
+ var hashName = hashParts[0];
+ var hashContent = hashParts[1];
+ if (hashContent.match(/"/g).length !== 2) {
+ shiftIndex = 0;
+ for (j = i + 1; j < helperParts.length; j++) {
+ hashContent += ' ' + helperParts[j];
+ if (helperParts[j].indexOf('"') >= 0) {
+ shiftIndex = j;
+ break;
+ }
+ }
+ if (shiftIndex) i = shiftIndex;
+ }
+ var hash = [hashName, hashContent.replace(/"/g,'')];
+ slices.push(hash);
+ }
+ else {
+ // Plain variable
+ slices.push(part);
+ }
+ }
+ }
+ }
+ return slices;
+ }
+ function stringToBlocks(string) {
+ var blocks = [], i, j, k;
+ if (!string) return [];
+ var _blocks = string.split(/({{[^{^}]*}})/);
+ for (i = 0; i < _blocks.length; i++) {
+ var block = _blocks[i];
+ if (block === '') continue;
+ if (block.indexOf('{{') < 0) {
+ blocks.push({
+ type: 'plain',
+ content: block
+ });
+ }
+ else {
+ if (block.indexOf('{/') >= 0) {
+ continue;
+ }
+ if (block.indexOf('{#') < 0 && block.indexOf(' ') < 0 && block.indexOf('else') < 0) {
+ // Simple variable
+ blocks.push({
+ type: 'variable',
+ contextName: block.replace(/[{}]/g, '')
+ });
+ continue;
+ }
+ // Helpers
+ var helperSlices = helperToSlices(block);
+ var helperName = helperSlices[0];
+ var helperContext = [];
+ var helperHash = {};
+ for (j = 1; j < helperSlices.length; j++) {
+ var slice = helperSlices[j];
+ if (isArray(slice)) {
+ // Hash
+ helperHash[slice[0]] = slice[1] === 'false' ? false : slice[1];
+ }
+ else {
+ helperContext.push(slice);
+ }
+ }
+
+ if (block.indexOf('{#') >= 0) {
+ // Condition/Helper
+ var helperStartIndex = i;
+ var helperContent = '';
+ var elseContent = '';
+ var toSkip = 0;
+ var shiftIndex;
+ var foundClosed = false, foundElse = false, foundClosedElse = false, depth = 0;
+ for (j = i + 1; j < _blocks.length; j++) {
+ if (_blocks[j].indexOf('{{#') >= 0) {
+ depth ++;
+ }
+ if (_blocks[j].indexOf('{{/') >= 0) {
+ depth --;
+ }
+ if (_blocks[j].indexOf('{{#' + helperName) >= 0) {
+ helperContent += _blocks[j];
+ if (foundElse) elseContent += _blocks[j];
+ toSkip ++;
+ }
+ else if (_blocks[j].indexOf('{{/' + helperName) >= 0) {
+ if (toSkip > 0) {
+ toSkip--;
+ helperContent += _blocks[j];
+ if (foundElse) elseContent += _blocks[j];
+ }
+ else {
+ shiftIndex = j;
+ foundClosed = true;
+ break;
+ }
+ }
+ else if (_blocks[j].indexOf('else') >= 0 && depth === 0) {
+ foundElse = true;
+ }
+ else {
+ if (!foundElse) helperContent += _blocks[j];
+ if (foundElse) elseContent += _blocks[j];
+ }
+
+ }
+ if (foundClosed) {
+ if (shiftIndex) i = shiftIndex;
+ blocks.push({
+ type: 'helper',
+ helperName: helperName,
+ contextName: helperContext,
+ content: helperContent,
+ inverseContent: elseContent,
+ hash: helperHash
+ });
+ }
+ }
+ else if (block.indexOf(' ') > 0) {
+ blocks.push({
+ type: 'helper',
+ helperName: helperName,
+ contextName: helperContext,
+ hash: helperHash
+ });
+ }
+ }
+ }
+ return blocks;
+ }
+ var Template7 = function (template) {
+ var t = this;
+ t.template = template;
+
+ function getCompileFn(block, depth) {
+ if (block.content) return compile(block.content, depth);
+ else return function () {return ''; };
+ }
+ function getCompileInverse(block, depth) {
+ if (block.inverseContent) return compile(block.inverseContent, depth);
+ else return function () {return ''; };
+ }
+ function getCompileVar(name, ctx) {
+ var variable, parts, levelsUp = 0, initialCtx = ctx;
+ if (name.indexOf('../') === 0) {
+ levelsUp = name.split('../').length - 1;
+ var newDepth = ctx.split('_')[1] - levelsUp;
+ ctx = 'ctx_' + (newDepth >= 1 ? newDepth : 1);
+ parts = name.split('../')[levelsUp].split('.');
+ }
+ else if (name.indexOf('@global') === 0) {
+ ctx = '$.Template7.global';
+ parts = name.split('@global.')[1].split('.');
+ }
+ else if (name.indexOf('@root') === 0) {
+ ctx = 'ctx_1';
+ parts = name.split('@root.')[1].split('.');
+ }
+ else {
+ parts = name.split('.');
+ }
+ variable = ctx;
+ for (var i = 0; i < parts.length; i++) {
+ var part = parts[i];
+ if (part.indexOf('@') === 0) {
+ if (i > 0) {
+ variable += '[(data && data.' + part.replace('@', '') + ')]';
+ }
+ else {
+ variable = '(data && data.' + name.replace('@', '') + ')';
+ }
+ }
+ else {
+ if (isFinite(part)) {
+ variable += '[' + part + ']';
+ }
+ else {
+ if (part.indexOf('this') === 0) {
+ variable = part.replace('this', ctx);
+ }
+ else {
+ variable += '.' + part;
+ }
+ }
+ }
+ }
+
+ return variable;
+ }
+ function getCompiledArguments(contextArray, ctx) {
+ var arr = [];
+ for (var i = 0; i < contextArray.length; i++) {
+ if (contextArray[i].indexOf('"') === 0) arr.push(contextArray[i]);
+ else {
+ arr.push(getCompileVar(contextArray[i], ctx));
+ }
+ }
+ return arr.join(', ');
+ }
+ function compile(template, depth) {
+ depth = depth || 1;
+ template = template || t.template;
+ if (typeof template !== 'string') {
+ throw new Error('Template7: Template must be a string');
+ }
+ var blocks = stringToBlocks(template);
+ if (blocks.length === 0) {
+ return function () { return ''; };
+ }
+ var ctx = 'ctx_' + depth;
+ var resultString = '(function (' + ctx + ', data) {\n';
+ if (depth === 1) {
+ resultString += 'function isArray(arr){return Object.prototype.toString.apply(arr) === \'[object Array]\';}\n';
+ resultString += 'function isFunction(func){return (typeof func === \'function\');}\n';
+ resultString += 'function c(val, ctx) {if (typeof val !== "undefined") {if (isFunction(val)) {return val.call(ctx);} else return val;} else return "";}\n';
+ }
+ resultString += 'var r = \'\';\n';
+ var i, j, context;
+ for (i = 0; i < blocks.length; i++) {
+ var block = blocks[i];
+ // Plain block
+ if (block.type === 'plain') {
+ resultString += 'r +=\'' + (block.content).replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/'/g, '\\' + '\'') + '\';';
+ continue;
+ }
+ var variable, compiledArguments;
+ // Variable block
+ if (block.type === 'variable') {
+ variable = getCompileVar(block.contextName, ctx);
+ resultString += 'r += c(' + variable + ', ' + ctx + ');';
+ }
+ // Helpers block
+ if (block.type === 'helper') {
+ if (block.helperName in t.helpers) {
+ compiledArguments = getCompiledArguments(block.contextName, ctx);
+ resultString += 'r += ($.Template7.helpers.' + block.helperName + ').call(' + ctx + ', ' + (compiledArguments && (compiledArguments + ', ')) +'{hash:' + JSON.stringify(block.hash) + ', data: data || {}, fn: ' + getCompileFn(block, depth+1) + ', inverse: ' + getCompileInverse(block, depth+1) + ', root: ctx_1});';
+ }
+ else {
+ if (block.contextName.length > 0) {
+ throw new Error('Template7: Missing helper: "' + block.helperName + '"');
+ }
+ else {
+ variable = getCompileVar(block.helperName, ctx);
+ resultString += 'if (' + variable + ') {';
+ resultString += 'if (isArray(' + variable + ')) {';
+ resultString += 'r += ($.Template7.helpers.each).call(' + ctx + ', ' + variable + ', {hash:' + JSON.stringify(block.hash) + ', data: data || {}, fn: ' + getCompileFn(block, depth+1) + ', inverse: ' + getCompileInverse(block, depth+1) + ', root: ctx_1});';
+ resultString += '}else {';
+ resultString += 'r += ($.Template7.helpers.with).call(' + ctx + ', ' + variable + ', {hash:' + JSON.stringify(block.hash) + ', data: data || {}, fn: ' + getCompileFn(block, depth+1) + ', inverse: ' + getCompileInverse(block, depth+1) + ', root: ctx_1});';
+ resultString += '}}';
+ }
+ }
+ }
+ }
+ resultString += '\nreturn r;})';
+ return eval.call(window, resultString);
+ }
+ t.compile = function (template) {
+ if (!t.compiled) {
+ t.compiled = compile(template);
+ }
+ return t.compiled;
+ };
+ };
+ Template7.prototype = {
+ options: {},
+ helpers: {
+ 'if': function (context, options) {
+ if (isFunction(context)) { context = context.call(this); }
+ if (context) {
+ return options.fn(this, options.data);
+ }
+ else {
+ return options.inverse(this, options.data);
+ }
+ },
+ 'unless': function (context, options) {
+ if (isFunction(context)) { context = context.call(this); }
+ if (!context) {
+ return options.fn(this, options.data);
+ }
+ else {
+ return options.inverse(this, options.data);
+ }
+ },
+ 'each': function (context, options) {
+ var ret = '', i = 0;
+ if (isFunction(context)) { context = context.call(this); }
+ if (isArray(context)) {
+ if (options.hash.reverse) {
+ context = context.reverse();
+ }
+ for (i = 0; i < context.length; i++) {
+ ret += options.fn(context[i], {first: i === 0, last: i === context.length - 1, index: i});
+ }
+ if (options.hash.reverse) {
+ context = context.reverse();
+ }
+ }
+ else {
+ for (var key in context) {
+ i++;
+ ret += options.fn(context[key], {key: key});
+ }
+ }
+ if (i > 0) return ret;
+ else return options.inverse(this);
+ },
+ 'with': function (context, options) {
+ if (isFunction(context)) { context = context.call(this); }
+ return options.fn(context);
+ },
+ 'join': function (context, options) {
+ if (isFunction(context)) { context = context.call(this); }
+ return context.join(options.hash.delimiter || options.hash.delimeter);
+ },
+ 'js': function (expression, options) {
+ var func;
+ if (expression.indexOf('return')>=0) {
+ func = '(function(){'+expression+'})';
+ }
+ else {
+ func = '(function(){return ('+expression+')})';
+ }
+ return eval.call(this, func).call(this);
+ },
+ 'js_compare': function (expression, options) {
+ var func;
+ if (expression.indexOf('return')>=0) {
+ func = '(function(){'+expression+'})';
+ }
+ else {
+ func = '(function(){return ('+expression+')})';
+ }
+ var condition = eval.call(this, func).call(this);
+ if (condition) {
+ return options.fn(this, options.data);
+ }
+ else {
+ return options.inverse(this, options.data);
+ }
+ }
+ }
+ };
+ var t7 = function (template, data) {
+ if (arguments.length === 2) {
+ var instance = new Template7(template);
+ var rendered = instance.compile()(data);
+ instance = null;
+ return (rendered);
+ }
+ else return new Template7(template);
+ };
+ t7.registerHelper = function (name, fn) {
+ Template7.prototype.helpers[name] = fn;
+ };
+ t7.unregisterHelper = function (name) {
+ Template7.prototype.helpers[name] = undefined;
+ delete Template7.prototype.helpers[name];
+ };
+
+ t7.compile = function (template, options) {
+ var instance = new Template7(template, options);
+ return instance.compile();
+ };
+
+ t7.options = Template7.prototype.options;
+ t7.helpers = Template7.prototype.helpers;
+ return t7;
+ })();
+}($);
+
+/*! Hammer.JS - v2.0.8 - 2016-04-23
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2016 Jorik Tangelder;
+ * Licensed under the MIT license */
+(function(window, document, exportName, undefined) {
+ 'use strict';
+
+var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
+var TEST_ELEMENT = document.createElement('div');
+
+var TYPE_FUNCTION = 'function';
+
+var round = Math.round;
+var abs = Math.abs;
+var now = Date.now;
+
+/**
+ * set a timeout with a given scope
+ * @param {Function} fn
+ * @param {Number} timeout
+ * @param {Object} context
+ * @returns {number}
+ */
+function setTimeoutContext(fn, timeout, context) {
+ return setTimeout(bindFn(fn, context), timeout);
+}
+
+/**
+ * if the argument is an array, we want to execute the fn on each entry
+ * if it aint an array we don't want to do a thing.
+ * this is used by all the methods that accept a single and array argument.
+ * @param {*|Array} arg
+ * @param {String} fn
+ * @param {Object} [context]
+ * @returns {Boolean}
+ */
+function invokeArrayArg(arg, fn, context) {
+ if (Array.isArray(arg)) {
+ each(arg, context[fn], context);
+ return true;
+ }
+ return false;
+}
+
+/**
+ * walk objects and arrays
+ * @param {Object} obj
+ * @param {Function} iterator
+ * @param {Object} context
+ */
+function each(obj, iterator, context) {
+ var i;
+
+ if (!obj) {
+ return;
+ }
+
+ if (obj.forEach) {
+ obj.forEach(iterator, context);
+ } else if (obj.length !== undefined) {
+ i = 0;
+ while (i < obj.length) {
+ iterator.call(context, obj[i], i, obj);
+ i++;
+ }
+ } else {
+ for (i in obj) {
+ obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
+ }
+ }
+}
+
+/**
+ * wrap a method with a deprecation warning and stack trace
+ * @param {Function} method
+ * @param {String} name
+ * @param {String} message
+ * @returns {Function} A new function wrapping the supplied method.
+ */
+function deprecate(method, name, message) {
+ var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
+ return function() {
+ var e = new Error('get-stack-trace');
+ var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
+ .replace(/^\s+at\s+/gm, '')
+ .replace(/^Object.\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
+
+ var log = window.console && (window.console.warn || window.console.log);
+ if (log) {
+ log.call(window.console, deprecationMessage, stack);
+ }
+ return method.apply(this, arguments);
+ };
+}
+
+/**
+ * extend object.
+ * means that properties in dest will be overwritten by the ones in src.
+ * @param {Object} target
+ * @param {...Object} objects_to_assign
+ * @returns {Object} target
+ */
+var assign;
+if (typeof Object.assign !== 'function') {
+ assign = function assign(target) {
+ if (target === undefined || target === null) {
+ throw new TypeError('Cannot convert undefined or null to object');
+ }
+
+ var output = Object(target);
+ for (var index = 1; index < arguments.length; index++) {
+ var source = arguments[index];
+ if (source !== undefined && source !== null) {
+ for (var nextKey in source) {
+ if (source.hasOwnProperty(nextKey)) {
+ output[nextKey] = source[nextKey];
+ }
+ }
+ }
+ }
+ return output;
+ };
+} else {
+ assign = Object.assign;
+}
+
+/**
+ * extend object.
+ * means that properties in dest will be overwritten by the ones in src.
+ * @param {Object} dest
+ * @param {Object} src
+ * @param {Boolean} [merge=false]
+ * @returns {Object} dest
+ */
+var extend = deprecate(function extend(dest, src, merge) {
+ var keys = Object.keys(src);
+ var i = 0;
+ while (i < keys.length) {
+ if (!merge || (merge && dest[keys[i]] === undefined)) {
+ dest[keys[i]] = src[keys[i]];
+ }
+ i++;
+ }
+ return dest;
+}, 'extend', 'Use `assign`.');
+
+/**
+ * merge the values from src in the dest.
+ * means that properties that exist in dest will not be overwritten by src
+ * @param {Object} dest
+ * @param {Object} src
+ * @returns {Object} dest
+ */
+var merge = deprecate(function merge(dest, src) {
+ return extend(dest, src, true);
+}, 'merge', 'Use `assign`.');
+
+/**
+ * simple class inheritance
+ * @param {Function} child
+ * @param {Function} base
+ * @param {Object} [properties]
+ */
+function inherit(child, base, properties) {
+ var baseP = base.prototype,
+ childP;
+
+ childP = child.prototype = Object.create(baseP);
+ childP.constructor = child;
+ childP._super = baseP;
+
+ if (properties) {
+ assign(childP, properties);
+ }
+}
+
+/**
+ * simple function bind
+ * @param {Function} fn
+ * @param {Object} context
+ * @returns {Function}
+ */
+function bindFn(fn, context) {
+ return function boundFn() {
+ return fn.apply(context, arguments);
+ };
+}
+
+/**
+ * let a boolean value also be a function that must return a boolean
+ * this first item in args will be used as the context
+ * @param {Boolean|Function} val
+ * @param {Array} [args]
+ * @returns {Boolean}
+ */
+function boolOrFn(val, args) {
+ if (typeof val == TYPE_FUNCTION) {
+ return val.apply(args ? args[0] || undefined : undefined, args);
+ }
+ return val;
+}
+
+/**
+ * use the val2 when val1 is undefined
+ * @param {*} val1
+ * @param {*} val2
+ * @returns {*}
+ */
+function ifUndefined(val1, val2) {
+ return (val1 === undefined) ? val2 : val1;
+}
+
+/**
+ * addEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+function addEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.addEventListener(type, handler, false);
+ });
+}
+
+/**
+ * removeEventListener with multiple events at once
+ * @param {EventTarget} target
+ * @param {String} types
+ * @param {Function} handler
+ */
+function removeEventListeners(target, types, handler) {
+ each(splitStr(types), function(type) {
+ target.removeEventListener(type, handler, false);
+ });
+}
+
+/**
+ * find if a node is in the given parent
+ * @method hasParent
+ * @param {HTMLElement} node
+ * @param {HTMLElement} parent
+ * @return {Boolean} found
+ */
+function hasParent(node, parent) {
+ while (node) {
+ if (node == parent) {
+ return true;
+ }
+ node = node.parentNode;
+ }
+ return false;
+}
+
+/**
+ * small indexOf wrapper
+ * @param {String} str
+ * @param {String} find
+ * @returns {Boolean} found
+ */
+function inStr(str, find) {
+ return str.indexOf(find) > -1;
+}
+
+/**
+ * split string on whitespace
+ * @param {String} str
+ * @returns {Array} words
+ */
+function splitStr(str) {
+ return str.trim().split(/\s+/g);
+}
+
+/**
+ * find if a array contains the object using indexOf or a simple polyFill
+ * @param {Array} src
+ * @param {String} find
+ * @param {String} [findByKey]
+ * @return {Boolean|Number} false when not found, or the index
+ */
+function inArray(src, find, findByKey) {
+ if (src.indexOf && !findByKey) {
+ return src.indexOf(find);
+ } else {
+ var i = 0;
+ while (i < src.length) {
+ if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
+ return i;
+ }
+ i++;
+ }
+ return -1;
+ }
+}
+
+/**
+ * convert array-like objects to real arrays
+ * @param {Object} obj
+ * @returns {Array}
+ */
+function toArray(obj) {
+ return Array.prototype.slice.call(obj, 0);
+}
+
+/**
+ * unique array with objects based on a key (like 'id') or just by the array's value
+ * @param {Array} src [{id:1},{id:2},{id:1}]
+ * @param {String} [key]
+ * @param {Boolean} [sort=False]
+ * @returns {Array} [{id:1},{id:2}]
+ */
+function uniqueArray(src, key, sort) {
+ var results = [];
+ var values = [];
+ var i = 0;
+
+ while (i < src.length) {
+ var val = key ? src[i][key] : src[i];
+ if (inArray(values, val) < 0) {
+ results.push(src[i]);
+ }
+ values[i] = val;
+ i++;
+ }
+
+ if (sort) {
+ if (!key) {
+ results = results.sort();
+ } else {
+ results = results.sort(function sortUniqueArray(a, b) {
+ return a[key] > b[key];
+ });
+ }
+ }
+
+ return results;
+}
+
+/**
+ * get the prefixed property
+ * @param {Object} obj
+ * @param {String} property
+ * @returns {String|Undefined} prefixed
+ */
+function prefixed(obj, property) {
+ var prefix, prop;
+ var camelProp = property[0].toUpperCase() + property.slice(1);
+
+ var i = 0;
+ while (i < VENDOR_PREFIXES.length) {
+ prefix = VENDOR_PREFIXES[i];
+ prop = (prefix) ? prefix + camelProp : property;
+
+ if (prop in obj) {
+ return prop;
+ }
+ i++;
+ }
+ return undefined;
+}
+
+/**
+ * get a unique id
+ * @returns {number} uniqueId
+ */
+var _uniqueId = 1;
+function uniqueId() {
+ return _uniqueId++;
+}
+
+/**
+ * get the window object of an element
+ * @param {HTMLElement} element
+ * @returns {DocumentView|Window}
+ */
+function getWindowForElement(element) {
+ var doc = element.ownerDocument || element;
+ return (doc.defaultView || doc.parentWindow || window);
+}
+
+var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
+
+var SUPPORT_TOUCH = ('ontouchstart' in window);
+var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
+var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
+
+var INPUT_TYPE_TOUCH = 'touch';
+var INPUT_TYPE_PEN = 'pen';
+var INPUT_TYPE_MOUSE = 'mouse';
+var INPUT_TYPE_KINECT = 'kinect';
+
+var COMPUTE_INTERVAL = 25;
+
+var INPUT_START = 1;
+var INPUT_MOVE = 2;
+var INPUT_END = 4;
+var INPUT_CANCEL = 8;
+
+var DIRECTION_NONE = 1;
+var DIRECTION_LEFT = 2;
+var DIRECTION_RIGHT = 4;
+var DIRECTION_UP = 8;
+var DIRECTION_DOWN = 16;
+
+var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
+var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
+var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
+
+var PROPS_XY = ['x', 'y'];
+var PROPS_CLIENT_XY = ['clientX', 'clientY'];
+
+/**
+ * create new input type manager
+ * @param {Manager} manager
+ * @param {Function} callback
+ * @returns {Input}
+ * @constructor
+ */
+function Input(manager, callback) {
+ var self = this;
+ this.manager = manager;
+ this.callback = callback;
+ this.element = manager.element;
+ this.target = manager.options.inputTarget;
+
+ // smaller wrapper around the handler, for the scope and the enabled state of the manager,
+ // so when disabled the input events are completely bypassed.
+ this.domHandler = function(ev) {
+ if (boolOrFn(manager.options.enable, [manager])) {
+ self.handler(ev);
+ }
+ };
+
+ this.init();
+
+}
+
+Input.prototype = {
+ /**
+ * should handle the inputEvent data and trigger the callback
+ * @virtual
+ */
+ handler: function() { },
+
+ /**
+ * bind the events
+ */
+ init: function() {
+ this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ },
+
+ /**
+ * unbind the events
+ */
+ destroy: function() {
+ this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
+ this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
+ this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
+ }
+};
+
+/**
+ * create new input type manager
+ * called by the Manager constructor
+ * @param {Hammer} manager
+ * @returns {Input}
+ */
+function createInputInstance(manager) {
+ var Type;
+ var inputClass = manager.options.inputClass;
+
+ if (inputClass) {
+ Type = inputClass;
+ } else if (SUPPORT_POINTER_EVENTS) {
+ Type = PointerEventInput;
+ } else if (SUPPORT_ONLY_TOUCH) {
+ Type = TouchInput;
+ } else if (!SUPPORT_TOUCH) {
+ Type = MouseInput;
+ } else {
+ Type = TouchMouseInput;
+ }
+ return new (Type)(manager, inputHandler);
+}
+
+/**
+ * handle input events
+ * @param {Manager} manager
+ * @param {String} eventType
+ * @param {Object} input
+ */
+function inputHandler(manager, eventType, input) {
+ var pointersLen = input.pointers.length;
+ var changedPointersLen = input.changedPointers.length;
+ var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
+ var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
+
+ input.isFirst = !!isFirst;
+ input.isFinal = !!isFinal;
+
+ if (isFirst) {
+ manager.session = {};
+ }
+
+ // source event is the normalized value of the domEvents
+ // like 'touchstart, mouseup, pointerdown'
+ input.eventType = eventType;
+
+ // compute scale, rotation etc
+ computeInputData(manager, input);
+
+ // emit secret event
+ manager.emit('hammer.input', input);
+
+ manager.recognize(input);
+ manager.session.prevInput = input;
+}
+
+/**
+ * extend the data with some usable properties like scale, rotate, velocity etc
+ * @param {Object} manager
+ * @param {Object} input
+ */
+function computeInputData(manager, input) {
+ var session = manager.session;
+ var pointers = input.pointers;
+ var pointersLength = pointers.length;
+
+ // store the first input to calculate the distance and direction
+ if (!session.firstInput) {
+ session.firstInput = simpleCloneInputData(input);
+ }
+
+ // to compute scale and rotation we need to store the multiple touches
+ if (pointersLength > 1 && !session.firstMultiple) {
+ session.firstMultiple = simpleCloneInputData(input);
+ } else if (pointersLength === 1) {
+ session.firstMultiple = false;
+ }
+
+ var firstInput = session.firstInput;
+ var firstMultiple = session.firstMultiple;
+ var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
+
+ var center = input.center = getCenter(pointers);
+ input.timeStamp = now();
+ input.deltaTime = input.timeStamp - firstInput.timeStamp;
+
+ input.angle = getAngle(offsetCenter, center);
+ input.distance = getDistance(offsetCenter, center);
+
+ computeDeltaXY(session, input);
+ input.offsetDirection = getDirection(input.deltaX, input.deltaY);
+
+ var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
+ input.overallVelocityX = overallVelocity.x;
+ input.overallVelocityY = overallVelocity.y;
+ input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
+
+ input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
+ input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
+
+ input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
+ session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
+
+ computeIntervalInputData(session, input);
+
+ // find the correct target
+ var target = manager.element;
+ if (hasParent(input.srcEvent.target, target)) {
+ target = input.srcEvent.target;
+ }
+ input.target = target;
+}
+
+function computeDeltaXY(session, input) {
+ var center = input.center;
+ var offset = session.offsetDelta || {};
+ var prevDelta = session.prevDelta || {};
+ var prevInput = session.prevInput || {};
+
+ if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
+ prevDelta = session.prevDelta = {
+ x: prevInput.deltaX || 0,
+ y: prevInput.deltaY || 0
+ };
+
+ offset = session.offsetDelta = {
+ x: center.x,
+ y: center.y
+ };
+ }
+
+ input.deltaX = prevDelta.x + (center.x - offset.x);
+ input.deltaY = prevDelta.y + (center.y - offset.y);
+}
+
+/**
+ * velocity is calculated every x ms
+ * @param {Object} session
+ * @param {Object} input
+ */
+function computeIntervalInputData(session, input) {
+ var last = session.lastInterval || input,
+ deltaTime = input.timeStamp - last.timeStamp,
+ velocity, velocityX, velocityY, direction;
+
+ if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
+ var deltaX = input.deltaX - last.deltaX;
+ var deltaY = input.deltaY - last.deltaY;
+
+ var v = getVelocity(deltaTime, deltaX, deltaY);
+ velocityX = v.x;
+ velocityY = v.y;
+ velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
+ direction = getDirection(deltaX, deltaY);
+
+ session.lastInterval = input;
+ } else {
+ // use latest velocity info if it doesn't overtake a minimum period
+ velocity = last.velocity;
+ velocityX = last.velocityX;
+ velocityY = last.velocityY;
+ direction = last.direction;
+ }
+
+ input.velocity = velocity;
+ input.velocityX = velocityX;
+ input.velocityY = velocityY;
+ input.direction = direction;
+}
+
+/**
+ * create a simple clone from the input used for storage of firstInput and firstMultiple
+ * @param {Object} input
+ * @returns {Object} clonedInputData
+ */
+function simpleCloneInputData(input) {
+ // make a simple copy of the pointers because we will get a reference if we don't
+ // we only need clientXY for the calculations
+ var pointers = [];
+ var i = 0;
+ while (i < input.pointers.length) {
+ pointers[i] = {
+ clientX: round(input.pointers[i].clientX),
+ clientY: round(input.pointers[i].clientY)
+ };
+ i++;
+ }
+
+ return {
+ timeStamp: now(),
+ pointers: pointers,
+ center: getCenter(pointers),
+ deltaX: input.deltaX,
+ deltaY: input.deltaY
+ };
+}
+
+/**
+ * get the center of all the pointers
+ * @param {Array} pointers
+ * @return {Object} center contains `x` and `y` properties
+ */
+function getCenter(pointers) {
+ var pointersLength = pointers.length;
+
+ // no need to loop when only one touch
+ if (pointersLength === 1) {
+ return {
+ x: round(pointers[0].clientX),
+ y: round(pointers[0].clientY)
+ };
+ }
+
+ var x = 0, y = 0, i = 0;
+ while (i < pointersLength) {
+ x += pointers[i].clientX;
+ y += pointers[i].clientY;
+ i++;
+ }
+
+ return {
+ x: round(x / pointersLength),
+ y: round(y / pointersLength)
+ };
+}
+
+/**
+ * calculate the velocity between two points. unit is in px per ms.
+ * @param {Number} deltaTime
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object} velocity `x` and `y`
+ */
+function getVelocity(deltaTime, x, y) {
+ return {
+ x: x / deltaTime || 0,
+ y: y / deltaTime || 0
+ };
+}
+
+/**
+ * get the direction between two points
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Number} direction
+ */
+function getDirection(x, y) {
+ if (x === y) {
+ return DIRECTION_NONE;
+ }
+
+ if (abs(x) >= abs(y)) {
+ return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ }
+ return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
+}
+
+/**
+ * calculate the absolute distance between two points
+ * @param {Object} p1 {x, y}
+ * @param {Object} p2 {x, y}
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} distance
+ */
+function getDistance(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+
+ return Math.sqrt((x * x) + (y * y));
+}
+
+/**
+ * calculate the angle between two coordinates
+ * @param {Object} p1
+ * @param {Object} p2
+ * @param {Array} [props] containing x and y keys
+ * @return {Number} angle
+ */
+function getAngle(p1, p2, props) {
+ if (!props) {
+ props = PROPS_XY;
+ }
+ var x = p2[props[0]] - p1[props[0]],
+ y = p2[props[1]] - p1[props[1]];
+ return Math.atan2(y, x) * 180 / Math.PI;
+}
+
+/**
+ * calculate the rotation degrees between two pointersets
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} rotation
+ */
+function getRotation(start, end) {
+ return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
+}
+
+/**
+ * calculate the scale factor between two pointersets
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
+ * @param {Array} start array of pointers
+ * @param {Array} end array of pointers
+ * @return {Number} scale
+ */
+function getScale(start, end) {
+ return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
+}
+
+var MOUSE_INPUT_MAP = {
+ mousedown: INPUT_START,
+ mousemove: INPUT_MOVE,
+ mouseup: INPUT_END
+};
+
+var MOUSE_ELEMENT_EVENTS = 'mousedown';
+var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
+
+/**
+ * Mouse events input
+ * @constructor
+ * @extends Input
+ */
+function MouseInput() {
+ this.evEl = MOUSE_ELEMENT_EVENTS;
+ this.evWin = MOUSE_WINDOW_EVENTS;
+
+ this.pressed = false; // mousedown state
+
+ Input.apply(this, arguments);
+}
+
+inherit(MouseInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function MEhandler(ev) {
+ var eventType = MOUSE_INPUT_MAP[ev.type];
+
+ // on start we want to have the left mouse button down
+ if (eventType & INPUT_START && ev.button === 0) {
+ this.pressed = true;
+ }
+
+ if (eventType & INPUT_MOVE && ev.which !== 1) {
+ eventType = INPUT_END;
+ }
+
+ // mouse must be down
+ if (!this.pressed) {
+ return;
+ }
+
+ if (eventType & INPUT_END) {
+ this.pressed = false;
+ }
+
+ this.callback(this.manager, eventType, {
+ pointers: [ev],
+ changedPointers: [ev],
+ pointerType: INPUT_TYPE_MOUSE,
+ srcEvent: ev
+ });
+ }
+});
+
+var POINTER_INPUT_MAP = {
+ pointerdown: INPUT_START,
+ pointermove: INPUT_MOVE,
+ pointerup: INPUT_END,
+ pointercancel: INPUT_CANCEL,
+ pointerout: INPUT_CANCEL
+};
+
+// in IE10 the pointer types is defined as an enum
+var IE10_POINTER_TYPE_ENUM = {
+ 2: INPUT_TYPE_TOUCH,
+ 3: INPUT_TYPE_PEN,
+ 4: INPUT_TYPE_MOUSE,
+ 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
+};
+
+var POINTER_ELEMENT_EVENTS = 'pointerdown';
+var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
+
+// IE10 has prefixed support, and case-sensitive
+if (window.MSPointerEvent && !window.PointerEvent) {
+ POINTER_ELEMENT_EVENTS = 'MSPointerDown';
+ POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
+}
+
+/**
+ * Pointer events input
+ * @constructor
+ * @extends Input
+ */
+function PointerEventInput() {
+ this.evEl = POINTER_ELEMENT_EVENTS;
+ this.evWin = POINTER_WINDOW_EVENTS;
+
+ Input.apply(this, arguments);
+
+ this.store = (this.manager.session.pointerEvents = []);
+}
+
+inherit(PointerEventInput, Input, {
+ /**
+ * handle mouse events
+ * @param {Object} ev
+ */
+ handler: function PEhandler(ev) {
+ var store = this.store;
+ var removePointer = false;
+
+ var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
+ var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
+ var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
+
+ var isTouch = (pointerType == INPUT_TYPE_TOUCH);
+
+ // get index of the event in the store
+ var storeIndex = inArray(store, ev.pointerId, 'pointerId');
+
+ // start and mouse must be down
+ if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
+ if (storeIndex < 0) {
+ store.push(ev);
+ storeIndex = store.length - 1;
+ }
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
+ removePointer = true;
+ }
+
+ // it not found, so the pointer hasn't been down (so it's probably a hover)
+ if (storeIndex < 0) {
+ return;
+ }
+
+ // update the event in the store
+ store[storeIndex] = ev;
+
+ this.callback(this.manager, eventType, {
+ pointers: store,
+ changedPointers: [ev],
+ pointerType: pointerType,
+ srcEvent: ev
+ });
+
+ if (removePointer) {
+ // remove from the store
+ store.splice(storeIndex, 1);
+ }
+ }
+});
+
+var SINGLE_TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+};
+
+var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
+var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+/**
+ * Touch events input
+ * @constructor
+ * @extends Input
+ */
+function SingleTouchInput() {
+ this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
+ this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
+ this.started = false;
+
+ Input.apply(this, arguments);
+}
+
+inherit(SingleTouchInput, Input, {
+ handler: function TEhandler(ev) {
+ var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
+
+ // should we handle the touch events?
+ if (type === INPUT_START) {
+ this.started = true;
+ }
+
+ if (!this.started) {
+ return;
+ }
+
+ var touches = normalizeSingleTouches.call(this, ev, type);
+
+ // when done, reset the started state
+ if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
+ this.started = false;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+});
+
+/**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+function normalizeSingleTouches(ev, type) {
+ var all = toArray(ev.touches);
+ var changed = toArray(ev.changedTouches);
+
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ all = uniqueArray(all.concat(changed), 'identifier', true);
+ }
+
+ return [all, changed];
+}
+
+var TOUCH_INPUT_MAP = {
+ touchstart: INPUT_START,
+ touchmove: INPUT_MOVE,
+ touchend: INPUT_END,
+ touchcancel: INPUT_CANCEL
+};
+
+var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
+
+/**
+ * Multi-user touch events input
+ * @constructor
+ * @extends Input
+ */
+function TouchInput() {
+ this.evTarget = TOUCH_TARGET_EVENTS;
+ this.targetIds = {};
+
+ Input.apply(this, arguments);
+}
+
+inherit(TouchInput, Input, {
+ handler: function MTEhandler(ev) {
+ var type = TOUCH_INPUT_MAP[ev.type];
+ var touches = getTouches.call(this, ev, type);
+ if (!touches) {
+ return;
+ }
+
+ this.callback(this.manager, type, {
+ pointers: touches[0],
+ changedPointers: touches[1],
+ pointerType: INPUT_TYPE_TOUCH,
+ srcEvent: ev
+ });
+ }
+});
+
+/**
+ * @this {TouchInput}
+ * @param {Object} ev
+ * @param {Number} type flag
+ * @returns {undefined|Array} [all, changed]
+ */
+function getTouches(ev, type) {
+ var allTouches = toArray(ev.touches);
+ var targetIds = this.targetIds;
+
+ // when there is only one touch, the process can be simplified
+ if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
+ targetIds[allTouches[0].identifier] = true;
+ return [allTouches, allTouches];
+ }
+
+ var i,
+ targetTouches,
+ changedTouches = toArray(ev.changedTouches),
+ changedTargetTouches = [],
+ target = this.target;
+
+ // get target touches from touches
+ targetTouches = allTouches.filter(function(touch) {
+ return hasParent(touch.target, target);
+ });
+
+ // collect touches
+ if (type === INPUT_START) {
+ i = 0;
+ while (i < targetTouches.length) {
+ targetIds[targetTouches[i].identifier] = true;
+ i++;
+ }
+ }
+
+ // filter changed touches to only contain touches that exist in the collected target ids
+ i = 0;
+ while (i < changedTouches.length) {
+ if (targetIds[changedTouches[i].identifier]) {
+ changedTargetTouches.push(changedTouches[i]);
+ }
+
+ // cleanup removed touches
+ if (type & (INPUT_END | INPUT_CANCEL)) {
+ delete targetIds[changedTouches[i].identifier];
+ }
+ i++;
+ }
+
+ if (!changedTargetTouches.length) {
+ return;
+ }
+
+ return [
+ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
+ uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
+ changedTargetTouches
+ ];
+}
+
+/**
+ * Combined touch and mouse input
+ *
+ * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
+ * This because touch devices also emit mouse events while doing a touch.
+ *
+ * @constructor
+ * @extends Input
+ */
+
+var DEDUP_TIMEOUT = 2500;
+var DEDUP_DISTANCE = 25;
+
+function TouchMouseInput() {
+ Input.apply(this, arguments);
+
+ var handler = bindFn(this.handler, this);
+ this.touch = new TouchInput(this.manager, handler);
+ this.mouse = new MouseInput(this.manager, handler);
+
+ this.primaryTouch = null;
+ this.lastTouches = [];
+}
+
+inherit(TouchMouseInput, Input, {
+ /**
+ * handle mouse and touch events
+ * @param {Hammer} manager
+ * @param {String} inputEvent
+ * @param {Object} inputData
+ */
+ handler: function TMEhandler(manager, inputEvent, inputData) {
+ var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
+ isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
+
+ if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
+ return;
+ }
+
+ // when we're in a touch event, record touches to de-dupe synthetic mouse event
+ if (isTouch) {
+ recordTouches.call(this, inputEvent, inputData);
+ } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
+ return;
+ }
+
+ this.callback(manager, inputEvent, inputData);
+ },
+
+ /**
+ * remove the event listeners
+ */
+ destroy: function destroy() {
+ this.touch.destroy();
+ this.mouse.destroy();
+ }
+});
+
+function recordTouches(eventType, eventData) {
+ if (eventType & INPUT_START) {
+ this.primaryTouch = eventData.changedPointers[0].identifier;
+ setLastTouch.call(this, eventData);
+ } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
+ setLastTouch.call(this, eventData);
+ }
+}
+
+function setLastTouch(eventData) {
+ var touch = eventData.changedPointers[0];
+
+ if (touch.identifier === this.primaryTouch) {
+ var lastTouch = {x: touch.clientX, y: touch.clientY};
+ this.lastTouches.push(lastTouch);
+ var lts = this.lastTouches;
+ var removeLastTouch = function() {
+ var i = lts.indexOf(lastTouch);
+ if (i > -1) {
+ lts.splice(i, 1);
+ }
+ };
+ setTimeout(removeLastTouch, DEDUP_TIMEOUT);
+ }
+}
+
+function isSyntheticEvent(eventData) {
+ var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
+ for (var i = 0; i < this.lastTouches.length; i++) {
+ var t = this.lastTouches[i];
+ var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
+ if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
+ return true;
+ }
+ }
+ return false;
+}
+
+var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
+var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
+
+// magical touchAction value
+var TOUCH_ACTION_COMPUTE = 'compute';
+var TOUCH_ACTION_AUTO = 'auto';
+var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
+var TOUCH_ACTION_NONE = 'none';
+var TOUCH_ACTION_PAN_X = 'pan-x';
+var TOUCH_ACTION_PAN_Y = 'pan-y';
+var TOUCH_ACTION_MAP = getTouchActionProps();
+
+/**
+ * Touch Action
+ * sets the touchAction property or uses the js alternative
+ * @param {Manager} manager
+ * @param {String} value
+ * @constructor
+ */
+function TouchAction(manager, value) {
+ this.manager = manager;
+ this.set(value);
+}
+
+TouchAction.prototype = {
+ /**
+ * set the touchAction value on the element or enable the polyfill
+ * @param {String} value
+ */
+ set: function(value) {
+ // find out the touch-action by the event handlers
+ if (value == TOUCH_ACTION_COMPUTE) {
+ value = this.compute();
+ }
+
+ if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
+ this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
+ }
+ this.actions = value.toLowerCase().trim();
+ },
+
+ /**
+ * just re-set the touchAction value
+ */
+ update: function() {
+ this.set(this.manager.options.touchAction);
+ },
+
+ /**
+ * compute the value for the touchAction property based on the recognizer's settings
+ * @returns {String} value
+ */
+ compute: function() {
+ var actions = [];
+ each(this.manager.recognizers, function(recognizer) {
+ if (boolOrFn(recognizer.options.enable, [recognizer])) {
+ actions = actions.concat(recognizer.getTouchAction());
+ }
+ });
+ return cleanTouchActions(actions.join(' '));
+ },
+
+ /**
+ * this method is called on each input cycle and provides the preventing of the browser behavior
+ * @param {Object} input
+ */
+ preventDefaults: function(input) {
+ var srcEvent = input.srcEvent;
+ var direction = input.offsetDirection;
+
+ // if the touch action did prevented once this session
+ if (this.manager.session.prevented) {
+ srcEvent.preventDefault();
+ return;
+ }
+
+ var actions = this.actions;
+ var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
+
+ if (hasNone) {
+ //do not prevent defaults if this is a tap gesture
+
+ var isTapPointer = input.pointers.length === 1;
+ var isTapMovement = input.distance < 2;
+ var isTapTouchTime = input.deltaTime < 250;
+
+ if (isTapPointer && isTapMovement && isTapTouchTime) {
+ return;
+ }
+ }
+
+ if (hasPanX && hasPanY) {
+ // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
+ return;
+ }
+
+ if (hasNone ||
+ (hasPanY && direction & DIRECTION_HORIZONTAL) ||
+ (hasPanX && direction & DIRECTION_VERTICAL)) {
+ return this.preventSrc(srcEvent);
+ }
+ },
+
+ /**
+ * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
+ * @param {Object} srcEvent
+ */
+ preventSrc: function(srcEvent) {
+ this.manager.session.prevented = true;
+ srcEvent.preventDefault();
+ }
+};
+
+/**
+ * when the touchActions are collected they are not a valid value, so we need to clean things up. *
+ * @param {String} actions
+ * @returns {*}
+ */
+function cleanTouchActions(actions) {
+ // none
+ if (inStr(actions, TOUCH_ACTION_NONE)) {
+ return TOUCH_ACTION_NONE;
+ }
+
+ var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
+ var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
+
+ // if both pan-x and pan-y are set (different recognizers
+ // for different directions, e.g. horizontal pan but vertical swipe?)
+ // we need none (as otherwise with pan-x pan-y combined none of these
+ // recognizers will work, since the browser would handle all panning
+ if (hasPanX && hasPanY) {
+ return TOUCH_ACTION_NONE;
+ }
+
+ // pan-x OR pan-y
+ if (hasPanX || hasPanY) {
+ return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
+ }
+
+ // manipulation
+ if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
+ return TOUCH_ACTION_MANIPULATION;
+ }
+
+ return TOUCH_ACTION_AUTO;
+}
+
+function getTouchActionProps() {
+ if (!NATIVE_TOUCH_ACTION) {
+ return false;
+ }
+ var touchMap = {};
+ var cssSupports = window.CSS && window.CSS.supports;
+ ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
+
+ // If css.supports is not supported but there is native touch-action assume it supports
+ // all values. This is the case for IE 10 and 11.
+ touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
+ });
+ return touchMap;
+}
+
+/**
+ * Recognizer flow explained; *
+ * All recognizers have the initial state of POSSIBLE when a input session starts.
+ * The definition of a input session is from the first input until the last input, with all it's movement in it. *
+ * Example session for mouse-input: mousedown -> mousemove -> mouseup
+ *
+ * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
+ * which determines with state it should be.
+ *
+ * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
+ * POSSIBLE to give it another change on the next cycle.
+ *
+ * Possible
+ * |
+ * +-----+---------------+
+ * | |
+ * +-----+-----+ |
+ * | | |
+ * Failed Cancelled |
+ * +-------+------+
+ * | |
+ * Recognized Began
+ * |
+ * Changed
+ * |
+ * Ended/Recognized
+ */
+var STATE_POSSIBLE = 1;
+var STATE_BEGAN = 2;
+var STATE_CHANGED = 4;
+var STATE_ENDED = 8;
+var STATE_RECOGNIZED = STATE_ENDED;
+var STATE_CANCELLED = 16;
+var STATE_FAILED = 32;
+
+/**
+ * Recognizer
+ * Every recognizer needs to extend from this class.
+ * @constructor
+ * @param {Object} options
+ */
+function Recognizer(options) {
+ this.options = assign({}, this.defaults, options || {});
+
+ this.id = uniqueId();
+
+ this.manager = null;
+
+ // default is enable true
+ this.options.enable = ifUndefined(this.options.enable, true);
+
+ this.state = STATE_POSSIBLE;
+
+ this.simultaneous = {};
+ this.requireFail = [];
+}
+
+Recognizer.prototype = {
+ /**
+ * @virtual
+ * @type {Object}
+ */
+ defaults: {},
+
+ /**
+ * set options
+ * @param {Object} options
+ * @return {Recognizer}
+ */
+ set: function(options) {
+ assign(this.options, options);
+
+ // also update the touchAction, in case something changed about the directions/enabled state
+ this.manager && this.manager.touchAction.update();
+ return this;
+ },
+
+ /**
+ * recognize simultaneous with an other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ recognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
+ return this;
+ }
+
+ var simultaneous = this.simultaneous;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (!simultaneous[otherRecognizer.id]) {
+ simultaneous[otherRecognizer.id] = otherRecognizer;
+ otherRecognizer.recognizeWith(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the simultaneous link. it doesnt remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRecognizeWith: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ delete this.simultaneous[otherRecognizer.id];
+ return this;
+ },
+
+ /**
+ * recognizer can only run when an other is failing
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ requireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
+ return this;
+ }
+
+ var requireFail = this.requireFail;
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ if (inArray(requireFail, otherRecognizer) === -1) {
+ requireFail.push(otherRecognizer);
+ otherRecognizer.requireFailure(this);
+ }
+ return this;
+ },
+
+ /**
+ * drop the requireFailure link. it does not remove the link on the other recognizer.
+ * @param {Recognizer} otherRecognizer
+ * @returns {Recognizer} this
+ */
+ dropRequireFailure: function(otherRecognizer) {
+ if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
+ return this;
+ }
+
+ otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
+ var index = inArray(this.requireFail, otherRecognizer);
+ if (index > -1) {
+ this.requireFail.splice(index, 1);
+ }
+ return this;
+ },
+
+ /**
+ * has require failures boolean
+ * @returns {boolean}
+ */
+ hasRequireFailures: function() {
+ return this.requireFail.length > 0;
+ },
+
+ /**
+ * if the recognizer can recognize simultaneous with an other recognizer
+ * @param {Recognizer} otherRecognizer
+ * @returns {Boolean}
+ */
+ canRecognizeWith: function(otherRecognizer) {
+ return !!this.simultaneous[otherRecognizer.id];
+ },
+
+ /**
+ * You should use `tryEmit` instead of `emit` directly to check
+ * that all the needed recognizers has failed before emitting.
+ * @param {Object} input
+ */
+ emit: function(input) {
+ var self = this;
+ var state = this.state;
+
+ function emit(event) {
+ self.manager.emit(event, input);
+ }
+
+ // 'panstart' and 'panmove'
+ if (state < STATE_ENDED) {
+ emit(self.options.event + stateStr(state));
+ }
+
+ emit(self.options.event); // simple 'eventName' events
+
+ if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
+ emit(input.additionalEvent);
+ }
+
+ // panend and pancancel
+ if (state >= STATE_ENDED) {
+ emit(self.options.event + stateStr(state));
+ }
+ },
+
+ /**
+ * Check that all the require failure recognizers has failed,
+ * if true, it emits a gesture event,
+ * otherwise, setup the state to FAILED.
+ * @param {Object} input
+ */
+ tryEmit: function(input) {
+ if (this.canEmit()) {
+ return this.emit(input);
+ }
+ // it's failing anyway
+ this.state = STATE_FAILED;
+ },
+
+ /**
+ * can we emit?
+ * @returns {boolean}
+ */
+ canEmit: function() {
+ var i = 0;
+ while (i < this.requireFail.length) {
+ if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
+ return false;
+ }
+ i++;
+ }
+ return true;
+ },
+
+ /**
+ * update the recognizer
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ // make a new copy of the inputData
+ // so we can change the inputData without messing up the other recognizers
+ var inputDataClone = assign({}, inputData);
+
+ // is is enabled and allow recognizing?
+ if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
+ this.reset();
+ this.state = STATE_FAILED;
+ return;
+ }
+
+ // reset when we've reached the end
+ if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
+ this.state = STATE_POSSIBLE;
+ }
+
+ this.state = this.process(inputDataClone);
+
+ // the recognizer has recognized a gesture
+ // so trigger an event
+ if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
+ this.tryEmit(inputDataClone);
+ }
+ },
+
+ /**
+ * return the state of the recognizer
+ * the actual recognizing happens in this method
+ * @virtual
+ * @param {Object} inputData
+ * @returns {Const} STATE
+ */
+ process: function(inputData) { }, // jshint ignore:line
+
+ /**
+ * return the preferred touch-action
+ * @virtual
+ * @returns {Array}
+ */
+ getTouchAction: function() { },
+
+ /**
+ * called when the gesture isn't allowed to recognize
+ * like when another is being recognized or it is disabled
+ * @virtual
+ */
+ reset: function() { }
+};
+
+/**
+ * get a usable string, used as event postfix
+ * @param {Const} state
+ * @returns {String} state
+ */
+function stateStr(state) {
+ if (state & STATE_CANCELLED) {
+ return 'cancel';
+ } else if (state & STATE_ENDED) {
+ return 'end';
+ } else if (state & STATE_CHANGED) {
+ return 'move';
+ } else if (state & STATE_BEGAN) {
+ return 'start';
+ }
+ return '';
+}
+
+/**
+ * direction cons to string
+ * @param {Const} direction
+ * @returns {String}
+ */
+function directionStr(direction) {
+ if (direction == DIRECTION_DOWN) {
+ return 'down';
+ } else if (direction == DIRECTION_UP) {
+ return 'up';
+ } else if (direction == DIRECTION_LEFT) {
+ return 'left';
+ } else if (direction == DIRECTION_RIGHT) {
+ return 'right';
+ }
+ return '';
+}
+
+/**
+ * get a recognizer by name if it is bound to a manager
+ * @param {Recognizer|String} otherRecognizer
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer}
+ */
+function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
+ var manager = recognizer.manager;
+ if (manager) {
+ return manager.get(otherRecognizer);
+ }
+ return otherRecognizer;
+}
+
+/**
+ * This recognizer is just used as a base for the simple attribute recognizers.
+ * @constructor
+ * @extends Recognizer
+ */
+function AttrRecognizer() {
+ Recognizer.apply(this, arguments);
+}
+
+inherit(AttrRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof AttrRecognizer
+ */
+ defaults: {
+ /**
+ * @type {Number}
+ * @default 1
+ */
+ pointers: 1
+ },
+
+ /**
+ * Used to check if it the recognizer receives valid input, like input.distance > 10.
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {Boolean} recognized
+ */
+ attrTest: function(input) {
+ var optionPointers = this.options.pointers;
+ return optionPointers === 0 || input.pointers.length === optionPointers;
+ },
+
+ /**
+ * Process the input and return the state for the recognizer
+ * @memberof AttrRecognizer
+ * @param {Object} input
+ * @returns {*} State
+ */
+ process: function(input) {
+ var state = this.state;
+ var eventType = input.eventType;
+
+ var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
+ var isValid = this.attrTest(input);
+
+ // on cancel input and we've recognized before, return STATE_CANCELLED
+ if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
+ return state | STATE_CANCELLED;
+ } else if (isRecognized || isValid) {
+ if (eventType & INPUT_END) {
+ return state | STATE_ENDED;
+ } else if (!(state & STATE_BEGAN)) {
+ return STATE_BEGAN;
+ }
+ return state | STATE_CHANGED;
+ }
+ return STATE_FAILED;
+ }
+});
+
+/**
+ * Pan
+ * Recognized when the pointer is down and moved in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function PanRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+
+ this.pX = null;
+ this.pY = null;
+}
+
+inherit(PanRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PanRecognizer
+ */
+ defaults: {
+ event: 'pan',
+ threshold: 10,
+ pointers: 1,
+ direction: DIRECTION_ALL
+ },
+
+ getTouchAction: function() {
+ var direction = this.options.direction;
+ var actions = [];
+ if (direction & DIRECTION_HORIZONTAL) {
+ actions.push(TOUCH_ACTION_PAN_Y);
+ }
+ if (direction & DIRECTION_VERTICAL) {
+ actions.push(TOUCH_ACTION_PAN_X);
+ }
+ return actions;
+ },
+
+ directionTest: function(input) {
+ var options = this.options;
+ var hasMoved = true;
+ var distance = input.distance;
+ var direction = input.direction;
+ var x = input.deltaX;
+ var y = input.deltaY;
+
+ // lock to axis?
+ if (!(direction & options.direction)) {
+ if (options.direction & DIRECTION_HORIZONTAL) {
+ direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
+ hasMoved = x != this.pX;
+ distance = Math.abs(input.deltaX);
+ } else {
+ direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
+ hasMoved = y != this.pY;
+ distance = Math.abs(input.deltaY);
+ }
+ }
+ input.direction = direction;
+ return hasMoved && distance > options.threshold && direction & options.direction;
+ },
+
+ attrTest: function(input) {
+ return AttrRecognizer.prototype.attrTest.call(this, input) &&
+ (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
+ },
+
+ emit: function(input) {
+
+ this.pX = input.deltaX;
+ this.pY = input.deltaY;
+
+ var direction = directionStr(input.direction);
+
+ if (direction) {
+ input.additionalEvent = this.options.event + direction;
+ }
+ this._super.emit.call(this, input);
+ }
+});
+
+/**
+ * Pinch
+ * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function PinchRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+}
+
+inherit(PinchRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'pinch',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
+ },
+
+ emit: function(input) {
+ if (input.scale !== 1) {
+ var inOut = input.scale < 1 ? 'in' : 'out';
+ input.additionalEvent = this.options.event + inOut;
+ }
+ this._super.emit.call(this, input);
+ }
+});
+
+/**
+ * Press
+ * Recognized when the pointer is down for x ms without any movement.
+ * @constructor
+ * @extends Recognizer
+ */
+function PressRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ this._timer = null;
+ this._input = null;
+}
+
+inherit(PressRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PressRecognizer
+ */
+ defaults: {
+ event: 'press',
+ pointers: 1,
+ time: 251, // minimal time of the pointer to be pressed
+ threshold: 9 // a minimal movement is ok, but keep it low
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_AUTO];
+ },
+
+ process: function(input) {
+ var options = this.options;
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTime = input.deltaTime > options.time;
+
+ this._input = input;
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
+ this.reset();
+ } else if (input.eventType & INPUT_START) {
+ this.reset();
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.time, this);
+ } else if (input.eventType & INPUT_END) {
+ return STATE_RECOGNIZED;
+ }
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function(input) {
+ if (this.state !== STATE_RECOGNIZED) {
+ return;
+ }
+
+ if (input && (input.eventType & INPUT_END)) {
+ this.manager.emit(this.options.event + 'up', input);
+ } else {
+ this._input.timeStamp = now();
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+});
+
+/**
+ * Rotate
+ * Recognized when two or more pointer are moving in a circular motion.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function RotateRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+}
+
+inherit(RotateRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof RotateRecognizer
+ */
+ defaults: {
+ event: 'rotate',
+ threshold: 0,
+ pointers: 2
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_NONE];
+ },
+
+ attrTest: function(input) {
+ return this._super.attrTest.call(this, input) &&
+ (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
+ }
+});
+
+/**
+ * Swipe
+ * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
+ * @constructor
+ * @extends AttrRecognizer
+ */
+function SwipeRecognizer() {
+ AttrRecognizer.apply(this, arguments);
+}
+
+inherit(SwipeRecognizer, AttrRecognizer, {
+ /**
+ * @namespace
+ * @memberof SwipeRecognizer
+ */
+ defaults: {
+ event: 'swipe',
+ threshold: 10,
+ velocity: 0.3,
+ direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
+ pointers: 1
+ },
+
+ getTouchAction: function() {
+ return PanRecognizer.prototype.getTouchAction.call(this);
+ },
+
+ attrTest: function(input) {
+ var direction = this.options.direction;
+ var velocity;
+
+ if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
+ velocity = input.overallVelocity;
+ } else if (direction & DIRECTION_HORIZONTAL) {
+ velocity = input.overallVelocityX;
+ } else if (direction & DIRECTION_VERTICAL) {
+ velocity = input.overallVelocityY;
+ }
+
+ return this._super.attrTest.call(this, input) &&
+ direction & input.offsetDirection &&
+ input.distance > this.options.threshold &&
+ input.maxPointers == this.options.pointers &&
+ abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
+ },
+
+ emit: function(input) {
+ var direction = directionStr(input.offsetDirection);
+ if (direction) {
+ this.manager.emit(this.options.event + direction, input);
+ }
+
+ this.manager.emit(this.options.event, input);
+ }
+});
+
+/**
+ * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
+ * between the given interval and position. The delay option can be used to recognize multi-taps without firing
+ * a single tap.
+ *
+ * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
+ * multi-taps being recognized.
+ * @constructor
+ * @extends Recognizer
+ */
+function TapRecognizer() {
+ Recognizer.apply(this, arguments);
+
+ // previous time and center,
+ // used for tap counting
+ this.pTime = false;
+ this.pCenter = false;
+
+ this._timer = null;
+ this._input = null;
+ this.count = 0;
+}
+
+inherit(TapRecognizer, Recognizer, {
+ /**
+ * @namespace
+ * @memberof PinchRecognizer
+ */
+ defaults: {
+ event: 'tap',
+ pointers: 1,
+ taps: 1,
+ interval: 300, // max time between the multi-tap taps
+ time: 250, // max time of the pointer to be down (like finger on the screen)
+ threshold: 9, // a minimal movement is ok, but keep it low
+ posThreshold: 10 // a multi-tap can be a bit off the initial position
+ },
+
+ getTouchAction: function() {
+ return [TOUCH_ACTION_MANIPULATION];
+ },
+
+ process: function(input) {
+ var options = this.options;
+
+ var validPointers = input.pointers.length === options.pointers;
+ var validMovement = input.distance < options.threshold;
+ var validTouchTime = input.deltaTime < options.time;
+
+ this.reset();
+
+ if ((input.eventType & INPUT_START) && (this.count === 0)) {
+ return this.failTimeout();
+ }
+
+ // we only allow little movement
+ // and we've reached an end event, so a tap is possible
+ if (validMovement && validTouchTime && validPointers) {
+ if (input.eventType != INPUT_END) {
+ return this.failTimeout();
+ }
+
+ var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
+ var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
+
+ this.pTime = input.timeStamp;
+ this.pCenter = input.center;
+
+ if (!validMultiTap || !validInterval) {
+ this.count = 1;
+ } else {
+ this.count += 1;
+ }
+
+ this._input = input;
+
+ // if tap count matches we have recognized it,
+ // else it has began recognizing...
+ var tapCount = this.count % options.taps;
+ if (tapCount === 0) {
+ // no failing requirements, immediately trigger the tap event
+ // or wait as long as the multitap interval to trigger
+ if (!this.hasRequireFailures()) {
+ return STATE_RECOGNIZED;
+ } else {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_RECOGNIZED;
+ this.tryEmit();
+ }, options.interval, this);
+ return STATE_BEGAN;
+ }
+ }
+ }
+ return STATE_FAILED;
+ },
+
+ failTimeout: function() {
+ this._timer = setTimeoutContext(function() {
+ this.state = STATE_FAILED;
+ }, this.options.interval, this);
+ return STATE_FAILED;
+ },
+
+ reset: function() {
+ clearTimeout(this._timer);
+ },
+
+ emit: function() {
+ if (this.state == STATE_RECOGNIZED) {
+ this._input.tapCount = this.count;
+ this.manager.emit(this.options.event, this._input);
+ }
+ }
+});
+
+/**
+ * Simple way to create a manager with a default set of recognizers.
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+function Hammer(element, options) {
+ options = options || {};
+ options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
+ return new Manager(element, options);
+}
+
+/**
+ * @const {string}
+ */
+Hammer.VERSION = '2.0.8';
+
+/**
+ * default settings
+ * @namespace
+ */
+Hammer.defaults = {
+ /**
+ * set if DOM events are being triggered.
+ * But this is slower and unused by simple implementations, so disabled by default.
+ * @type {Boolean}
+ * @default false
+ */
+ domEvents: false,
+
+ /**
+ * The value for the touchAction property/fallback.
+ * When set to `compute` it will magically set the correct value based on the added recognizers.
+ * @type {String}
+ * @default compute
+ */
+ touchAction: TOUCH_ACTION_COMPUTE,
+
+ /**
+ * @type {Boolean}
+ * @default true
+ */
+ enable: true,
+
+ /**
+ * EXPERIMENTAL FEATURE -- can be removed/changed
+ * Change the parent input target element.
+ * If Null, then it is being set the to main element.
+ * @type {Null|EventTarget}
+ * @default null
+ */
+ inputTarget: null,
+
+ /**
+ * force an input class
+ * @type {Null|Function}
+ * @default null
+ */
+ inputClass: null,
+
+ /**
+ * Default recognizer setup when calling `Hammer()`
+ * When creating a new Manager these will be skipped.
+ * @type {Array}
+ */
+ preset: [
+ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
+ [RotateRecognizer, {enable: false}],
+ [PinchRecognizer, {enable: false}, ['rotate']],
+ [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
+ [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
+ [TapRecognizer],
+ [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
+ [PressRecognizer]
+ ],
+
+ /**
+ * Some CSS properties can be used to improve the working of Hammer.
+ * Add them to this method and they will be set when creating a new Manager.
+ * @namespace
+ */
+ cssProps: {
+ /**
+ * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userSelect: 'none',
+
+ /**
+ * Disable the Windows Phone grippers when pressing an element.
+ * @type {String}
+ * @default 'none'
+ */
+ touchSelect: 'none',
+
+ /**
+ * Disables the default callout shown when you touch and hold a touch target.
+ * On iOS, when you touch and hold a touch target such as a link, Safari displays
+ * a callout containing information about the link. This property allows you to disable that callout.
+ * @type {String}
+ * @default 'none'
+ */
+ touchCallout: 'none',
+
+ /**
+ * Specifies whether zooming is enabled. Used by IE10>
+ * @type {String}
+ * @default 'none'
+ */
+ contentZooming: 'none',
+
+ /**
+ * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
+ * @type {String}
+ * @default 'none'
+ */
+ userDrag: 'none',
+
+ /**
+ * Overrides the highlight color shown when the user taps a link or a JavaScript
+ * clickable element in iOS. This property obeys the alpha value, if specified.
+ * @type {String}
+ * @default 'rgba(0,0,0,0)'
+ */
+ tapHighlightColor: 'rgba(0,0,0,0)'
+ }
+};
+
+var STOP = 1;
+var FORCED_STOP = 2;
+
+/**
+ * Manager
+ * @param {HTMLElement} element
+ * @param {Object} [options]
+ * @constructor
+ */
+function Manager(element, options) {
+ this.options = assign({}, Hammer.defaults, options || {});
+
+ this.options.inputTarget = this.options.inputTarget || element;
+
+ this.handlers = {};
+ this.session = {};
+ this.recognizers = [];
+ this.oldCssProps = {};
+
+ this.element = element;
+ this.input = createInputInstance(this);
+ this.touchAction = new TouchAction(this, this.options.touchAction);
+
+ toggleCssProps(this, true);
+
+ each(this.options.recognizers, function(item) {
+ var recognizer = this.add(new (item[0])(item[1]));
+ item[2] && recognizer.recognizeWith(item[2]);
+ item[3] && recognizer.requireFailure(item[3]);
+ }, this);
+}
+
+Manager.prototype = {
+ /**
+ * set options
+ * @param {Object} options
+ * @returns {Manager}
+ */
+ set: function(options) {
+ assign(this.options, options);
+
+ // Options that need a little more setup
+ if (options.touchAction) {
+ this.touchAction.update();
+ }
+ if (options.inputTarget) {
+ // Clean up existing event listeners and reinitialize
+ this.input.destroy();
+ this.input.target = options.inputTarget;
+ this.input.init();
+ }
+ return this;
+ },
+
+ /**
+ * stop recognizing for this session.
+ * This session will be discarded, when a new [input]start event is fired.
+ * When forced, the recognizer cycle is stopped immediately.
+ * @param {Boolean} [force]
+ */
+ stop: function(force) {
+ this.session.stopped = force ? FORCED_STOP : STOP;
+ },
+
+ /**
+ * run the recognizers!
+ * called by the inputHandler function on every movement of the pointers (touches)
+ * it walks through all the recognizers and tries to detect the gesture that is being made
+ * @param {Object} inputData
+ */
+ recognize: function(inputData) {
+ var session = this.session;
+ if (session.stopped) {
+ return;
+ }
+
+ // run the touch-action polyfill
+ this.touchAction.preventDefaults(inputData);
+
+ var recognizer;
+ var recognizers = this.recognizers;
+
+ // this holds the recognizer that is being recognized.
+ // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
+ // if no recognizer is detecting a thing, it is set to `null`
+ var curRecognizer = session.curRecognizer;
+
+ // reset when the last recognizer is recognized
+ // or when we're in a new session
+ if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
+ curRecognizer = session.curRecognizer = null;
+ }
+
+ var i = 0;
+ while (i < recognizers.length) {
+ recognizer = recognizers[i];
+
+ // find out if we are allowed try to recognize the input for this one.
+ // 1. allow if the session is NOT forced stopped (see the .stop() method)
+ // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
+ // that is being recognized.
+ // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
+ // this can be setup with the `recognizeWith()` method on the recognizer.
+ if (session.stopped !== FORCED_STOP && ( // 1
+ !curRecognizer || recognizer == curRecognizer || // 2
+ recognizer.canRecognizeWith(curRecognizer))) { // 3
+ recognizer.recognize(inputData);
+ } else {
+ recognizer.reset();
+ }
+
+ // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
+ // current active recognizer. but only if we don't already have an active recognizer
+ if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
+ curRecognizer = session.curRecognizer = recognizer;
+ }
+ i++;
+ }
+ },
+
+ /**
+ * get a recognizer by its event name.
+ * @param {Recognizer|String} recognizer
+ * @returns {Recognizer|Null}
+ */
+ get: function(recognizer) {
+ if (recognizer instanceof Recognizer) {
+ return recognizer;
+ }
+
+ var recognizers = this.recognizers;
+ for (var i = 0; i < recognizers.length; i++) {
+ if (recognizers[i].options.event == recognizer) {
+ return recognizers[i];
+ }
+ }
+ return null;
+ },
+
+ /**
+ * add a recognizer to the manager
+ * existing recognizers with the same event name will be removed
+ * @param {Recognizer} recognizer
+ * @returns {Recognizer|Manager}
+ */
+ add: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'add', this)) {
+ return this;
+ }
+
+ // remove existing
+ var existing = this.get(recognizer.options.event);
+ if (existing) {
+ this.remove(existing);
+ }
+
+ this.recognizers.push(recognizer);
+ recognizer.manager = this;
+
+ this.touchAction.update();
+ return recognizer;
+ },
+
+ /**
+ * remove a recognizer by name or instance
+ * @param {Recognizer|String} recognizer
+ * @returns {Manager}
+ */
+ remove: function(recognizer) {
+ if (invokeArrayArg(recognizer, 'remove', this)) {
+ return this;
+ }
+
+ recognizer = this.get(recognizer);
+
+ // let's make sure this recognizer exists
+ if (recognizer) {
+ var recognizers = this.recognizers;
+ var index = inArray(recognizers, recognizer);
+
+ if (index !== -1) {
+ recognizers.splice(index, 1);
+ this.touchAction.update();
+ }
+ }
+
+ return this;
+ },
+
+ /**
+ * bind event
+ * @param {String} events
+ * @param {Function} handler
+ * @returns {EventEmitter} this
+ */
+ on: function(events, handler) {
+ if (events === undefined) {
+ return;
+ }
+ if (handler === undefined) {
+ return;
+ }
+
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ handlers[event] = handlers[event] || [];
+ handlers[event].push(handler);
+ });
+ return this;
+ },
+
+ /**
+ * unbind event, leave emit blank to remove all handlers
+ * @param {String} events
+ * @param {Function} [handler]
+ * @returns {EventEmitter} this
+ */
+ off: function(events, handler) {
+ if (events === undefined) {
+ return;
+ }
+
+ var handlers = this.handlers;
+ each(splitStr(events), function(event) {
+ if (!handler) {
+ delete handlers[event];
+ } else {
+ handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
+ }
+ });
+ return this;
+ },
+
+ /**
+ * emit event to the listeners
+ * @param {String} event
+ * @param {Object} data
+ */
+ emit: function(event, data) {
+ // we also want to trigger dom events
+ if (this.options.domEvents) {
+ triggerDomEvent(event, data);
+ }
+
+ // no handlers, so skip it all
+ var handlers = this.handlers[event] && this.handlers[event].slice();
+ if (!handlers || !handlers.length) {
+ return;
+ }
+
+ data.type = event;
+ data.preventDefault = function() {
+ data.srcEvent.preventDefault();
+ };
+
+ var i = 0;
+ while (i < handlers.length) {
+ handlers[i](data);
+ i++;
+ }
+ },
+
+ /**
+ * destroy the manager and unbinds all events
+ * it doesn't unbind dom events, that is the user own responsibility
+ */
+ destroy: function() {
+ this.element && toggleCssProps(this, false);
+
+ this.handlers = {};
+ this.session = {};
+ this.input.destroy();
+ this.element = null;
+ }
+};
+
+/**
+ * add/remove the css properties as defined in manager.options.cssProps
+ * @param {Manager} manager
+ * @param {Boolean} add
+ */
+function toggleCssProps(manager, add) {
+ var element = manager.element;
+ if (!element.style) {
+ return;
+ }
+ var prop;
+ each(manager.options.cssProps, function(value, name) {
+ prop = prefixed(element.style, name);
+ if (add) {
+ manager.oldCssProps[prop] = element.style[prop];
+ element.style[prop] = value;
+ } else {
+ element.style[prop] = manager.oldCssProps[prop] || '';
+ }
+ });
+ if (!add) {
+ manager.oldCssProps = {};
+ }
+}
+
+/**
+ * trigger dom event
+ * @param {String} event
+ * @param {Object} data
+ */
+function triggerDomEvent(event, data) {
+ var gestureEvent = document.createEvent('Event');
+ gestureEvent.initEvent(event, true, true);
+ gestureEvent.gesture = data;
+ data.target.dispatchEvent(gestureEvent);
+}
+
+assign(Hammer, {
+ INPUT_START: INPUT_START,
+ INPUT_MOVE: INPUT_MOVE,
+ INPUT_END: INPUT_END,
+ INPUT_CANCEL: INPUT_CANCEL,
+
+ STATE_POSSIBLE: STATE_POSSIBLE,
+ STATE_BEGAN: STATE_BEGAN,
+ STATE_CHANGED: STATE_CHANGED,
+ STATE_ENDED: STATE_ENDED,
+ STATE_RECOGNIZED: STATE_RECOGNIZED,
+ STATE_CANCELLED: STATE_CANCELLED,
+ STATE_FAILED: STATE_FAILED,
+
+ DIRECTION_NONE: DIRECTION_NONE,
+ DIRECTION_LEFT: DIRECTION_LEFT,
+ DIRECTION_RIGHT: DIRECTION_RIGHT,
+ DIRECTION_UP: DIRECTION_UP,
+ DIRECTION_DOWN: DIRECTION_DOWN,
+ DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
+ DIRECTION_VERTICAL: DIRECTION_VERTICAL,
+ DIRECTION_ALL: DIRECTION_ALL,
+
+ Manager: Manager,
+ Input: Input,
+ TouchAction: TouchAction,
+
+ TouchInput: TouchInput,
+ MouseInput: MouseInput,
+ PointerEventInput: PointerEventInput,
+ TouchMouseInput: TouchMouseInput,
+ SingleTouchInput: SingleTouchInput,
+
+ Recognizer: Recognizer,
+ AttrRecognizer: AttrRecognizer,
+ Tap: TapRecognizer,
+ Pan: PanRecognizer,
+ Swipe: SwipeRecognizer,
+ Pinch: PinchRecognizer,
+ Rotate: RotateRecognizer,
+ Press: PressRecognizer,
+
+ on: addEventListeners,
+ off: removeEventListeners,
+ each: each,
+ merge: merge,
+ extend: extend,
+ assign: assign,
+ inherit: inherit,
+ bindFn: bindFn,
+ prefixed: prefixed
+});
+
+// this prevents errors when Hammer is loaded in the presence of an AMD
+// style loader but by script tag, not by the loader.
+var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
+freeGlobal.Hammer = Hammer;
+
+if (typeof define === 'function' && define.amd) {
+ define(function() {
+ return Hammer;
+ });
+} else if (typeof module != 'undefined' && module.exports) {
+ module.exports = Hammer;
+} else {
+ window[exportName] = Hammer;
+}
+
+})(window, document, 'Hammer');
+
++ function($) {
+ "use strict";
+
+ var defaults;
+
+ $.modal = function(params, onOpen) {
+ params = $.extend({}, defaults, params);
+
+
+ var buttons = params.buttons;
+
+ var buttonsHtml = buttons.map(function(d, i) {
+ return '' + d.text + ' ';
+ }).join("");
+
+ var tpl = '' +
+ '
' + params.title + '
' +
+ ( params.text ? '
'+params.text+'
' : '')+
+ '
' + buttonsHtml + '
' +
+ '
';
+
+ var dialog = $.openModal(tpl, onOpen);
+
+ dialog.find(".weui-dialog__btn").each(function(i, e) {
+ var el = $(e);
+ el.click(function() {
+ //先关闭对话框,再调用回调函数
+ if(params.autoClose) $.closeModal();
+
+ if(buttons[i].onClick) {
+ buttons[i].onClick.call(dialog);
+ }
+ });
+ });
+
+ return dialog;
+ };
+
+ $.openModal = function(tpl, onOpen) {
+ var mask = $("
").appendTo(document.body);
+ mask.show();
+
+ var dialog = $(tpl).appendTo(document.body);
+
+ if (onOpen) {
+ dialog.transitionEnd(function () {
+ onOpen.call(dialog);
+ });
+ }
+
+ dialog.show();
+ mask.addClass("weui-mask--visible");
+ dialog.addClass("weui-dialog--visible");
+
+
+ return dialog;
+ }
+
+ $.closeModal = function() {
+ $(".weui-mask--visible").removeClass("weui-mask--visible").transitionEnd(function() {
+ $(this).remove();
+ });
+ $(".weui-dialog--visible").removeClass("weui-dialog--visible").transitionEnd(function() {
+ $(this).remove();
+ });
+ };
+
+ $.alert = function(text, title, onOK) {
+ var config;
+ if (typeof text === 'object') {
+ config = text;
+ } else {
+ if (typeof title === 'function') {
+ onOK = arguments[1];
+ title = undefined;
+ }
+
+ config = {
+ text: text,
+ title: title,
+ onOK: onOK
+ }
+ }
+ return $.modal({
+ text: config.text,
+ title: config.title,
+ buttons: [{
+ text: defaults.buttonOK,
+ className: "primary",
+ onClick: config.onOK
+ }]
+ });
+ }
+
+ $.confirm = function(text, title, onOK, onCancel) {
+ var config;
+ if (typeof text === 'object') {
+ config = text
+ } else {
+ if (typeof title === 'function') {
+ onCancel = arguments[2];
+ onOK = arguments[1];
+ title = undefined;
+ }
+
+ config = {
+ text: text,
+ title: title,
+ onOK: onOK,
+ onCancel: onCancel
+ }
+ }
+ return $.modal({
+ text: config.text,
+ title: config.title,
+ buttons: [
+ {
+ text: defaults.buttonCancel,
+ className: "default",
+ onClick: config.onCancel
+ },
+ {
+ text: defaults.buttonOK,
+ className: "primary",
+ onClick: config.onOK
+ }]
+ });
+ };
+
+ //如果参数过多,建议通过 config 对象进行配置,而不是传入多个参数。
+ $.prompt = function(text, title, onOK, onCancel, input) {
+ var config;
+ if (typeof text === 'object') {
+ config = text;
+ } else {
+ if (typeof title === 'function') {
+ input = arguments[3];
+ onCancel = arguments[2];
+ onOK = arguments[1];
+ title = undefined;
+ }
+ config = {
+ text: text,
+ title: title,
+ input: input,
+ onOK: onOK,
+ onCancel: onCancel,
+ empty: false //allow empty
+ }
+ }
+
+ var modal = $.modal({
+ text: ''+(config.text || '')+'
',
+ title: config.title,
+ autoClose: false,
+ buttons: [
+ {
+ text: defaults.buttonCancel,
+ className: "default",
+ onClick: function () {
+ $.closeModal();
+ config.onCancel && config.onCancel.call(modal);
+ }
+ },
+ {
+ text: defaults.buttonOK,
+ className: "primary",
+ onClick: function() {
+ var input = $("#weui-prompt-input").val();
+ if (!config.empty && (input === "" || input === null)) {
+ modal.find('.weui-prompt-input').focus()[0].select();
+ return false;
+ }
+ $.closeModal();
+ config.onOK && config.onOK.call(modal, input);
+ }
+ }]
+ }, function () {
+ this.find('.weui-prompt-input').focus()[0].select();
+ });
+
+ return modal;
+ };
+
+ //如果参数过多,建议通过 config 对象进行配置,而不是传入多个参数。
+ $.login = function(text, title, onOK, onCancel, username, password) {
+ var config;
+ if (typeof text === 'object') {
+ config = text;
+ } else {
+ if (typeof title === 'function') {
+ password = arguments[4];
+ username = arguments[3];
+ onCancel = arguments[2];
+ onOK = arguments[1];
+ title = undefined;
+ }
+ config = {
+ text: text,
+ title: title,
+ username: username,
+ password: password,
+ onOK: onOK,
+ onCancel: onCancel
+ }
+ }
+
+ var modal = $.modal({
+ text: ''+(config.text || '')+'
' +
+ ' ' +
+ ' ',
+ title: config.title,
+ autoClose: false,
+ buttons: [
+ {
+ text: defaults.buttonCancel,
+ className: "default",
+ onClick: function () {
+ $.closeModal();
+ config.onCancel && config.onCancel.call(modal);
+ }
+ }, {
+ text: defaults.buttonOK,
+ className: "primary",
+ onClick: function() {
+ var username = $("#weui-prompt-username").val();
+ var password = $("#weui-prompt-password").val();
+ if (!config.empty && (username === "" || username === null)) {
+ modal.find('#weui-prompt-username').focus()[0].select();
+ return false;
+ }
+ if (!config.empty && (password === "" || password === null)) {
+ modal.find('#weui-prompt-password').focus()[0].select();
+ return false;
+ }
+ $.closeModal();
+ config.onOK && config.onOK.call(modal, username, password);
+ }
+ }]
+ }, function () {
+ this.find('#weui-prompt-username').focus()[0].select();
+ });
+
+ return modal;
+ };
+
+ defaults = $.modal.prototype.defaults = {
+ title: "提示",
+ text: undefined,
+ buttonOK: "确定",
+ buttonCancel: "取消",
+ buttons: [{
+ text: "确定",
+ className: "primary"
+ }],
+ autoClose: true //点击按钮自动关闭对话框,如果你不希望点击按钮就关闭对话框,可以把这个设置为false
+ };
+
+}($);
+
++ function($) {
+ "use strict";
+
+ var defaults;
+
+ var show = function(html, className) {
+ className = className || "";
+ var mask = $("
").appendTo(document.body);
+
+ var tpl = '' + html + '
';
+ var dialog = $(tpl).appendTo(document.body);
+
+ dialog.addClass("weui-toast--visible");
+ dialog.show();
+ };
+
+ var hide = function(callback) {
+ $(".weui-mask_transparent").remove();
+ $(".weui-toast--visible").removeClass("weui-toast--visible").transitionEnd(function() {
+ var $this = $(this);
+ $this.remove();
+ callback && callback($this);
+ });
+ }
+
+ $.toast = function(text, style, callback) {
+ if(typeof style === "function") {
+ callback = style;
+ }
+ var className, iconClassName = 'weui-icon-success-no-circle';
+ var duration = toastDefaults.duration;
+ if(style == "cancel") {
+ className = "weui-toast_cancel";
+ iconClassName = 'weui-icon-cancel'
+ } else if(style == "forbidden") {
+ className = "weui-toast--forbidden";
+ iconClassName = 'weui-icon-warn'
+ } else if(style == "text") {
+ className = "weui-toast--text";
+ } else if(typeof style === typeof 1) {
+ duration = style
+ }
+ show('' + (text || "已经完成") + '
', className);
+
+ setTimeout(function() {
+ hide(callback);
+ }, duration);
+ }
+
+ $.showLoading = function(text) {
+ var html = '';
+ html += ' ';
+ html += '
';
+ html += '' + (text || "数据加载中") + '
';
+ show(html, 'weui_loading_toast');
+ }
+
+ $.hideLoading = function() {
+ hide();
+ }
+
+ var toastDefaults = $.toast.prototype.defaults = {
+ duration: 2500
+ }
+
+}($);
+
++ function($) {
+ "use strict";
+
+ var defaults;
+
+ var show = function(params) {
+
+ var mask = $("
").appendTo(document.body);
+
+ var actions = params.actions || [];
+
+ var actionsHtml = actions.map(function(d, i) {
+ return '' + d.text + '
';
+ }).join("");
+
+ var titleHtml = "";
+
+ if (params.title) {
+ titleHtml = '';
+ }
+
+ var tpl = ''+
+ titleHtml +
+ ''+
+ '
'+
+ '
';
+ var dialog = $(tpl).appendTo(document.body);
+
+ dialog.find(".weui-actionsheet__menu .weui-actionsheet__cell, .weui-actionsheet__action .weui-actionsheet__cell").each(function(i, e) {
+ $(e).click(function() {
+ $.closeActions();
+ params.onClose && params.onClose();
+ if(actions[i] && actions[i].onClick) {
+ actions[i].onClick();
+ }
+ })
+ });
+
+ mask.show();
+ dialog.show();
+ mask.addClass("weui-mask--visible");
+ dialog.addClass("weui-actionsheet_toggle");
+ };
+
+ var hide = function() {
+ $(".weui-mask").removeClass("weui-mask--visible").transitionEnd(function() {
+ $(this).remove();
+ });
+ $(".weui-actionsheet").removeClass("weui-actionsheet_toggle").transitionEnd(function() {
+ $(this).remove();
+ });
+ }
+
+ $.actions = function(params) {
+ params = $.extend({}, defaults, params);
+ show(params);
+ }
+
+ $.closeActions = function() {
+ hide();
+ }
+
+ $(document).on("click", ".weui-actions_mask", function() {
+ $.closeActions();
+ });
+
+ var defaults = $.actions.prototype.defaults = {
+ title: undefined,
+ onClose: undefined,
+ /*actions: [{
+ text: "菜单",
+ className: "color-danger",
+ onClick: function() {
+ console.log(1);
+ }
+ },{
+ text: "菜单2",
+ className: "color-success",
+ onClick: function() {
+ console.log(2);
+ }
+ }]*/
+ }
+
+}($);
+
+/* ===============================================================================
+************ Pull to refreh ************
+=============================================================================== */
+/* global $:true */
+
++function ($) {
+ "use strict";
+
+ var PTR = function(el, opt) {
+ if (typeof opt === typeof function () {}) {
+ opt = {
+ onRefresh: opt
+ }
+ }
+ if (typeof opt === typeof 'a') {
+ opt = undefined
+ }
+ this.opt = $.extend(PTR.defaults, opt || {});
+ this.container = $(el);
+ this.attachEvents();
+ }
+
+ PTR.defaults = {
+ distance: 50,
+ onRefresh: undefined,
+ onPull: undefined
+ }
+
+ PTR.prototype.touchStart = function(e) {
+ if(this.container.hasClass("refreshing")) return;
+ var p = $.getTouchPosition(e);
+ this.start = p;
+ this.diffX = this.diffY = 0;
+ };
+
+ PTR.prototype.touchMove= function(e) {
+ if(this.container.hasClass("refreshing")) return;
+ if(!this.start) return false;
+ if(this.container.scrollTop() > 0) return;
+ var p = $.getTouchPosition(e);
+ this.diffX = p.x - this.start.x;
+ this.diffY = p.y - this.start.y;
+ if (Math.abs(this.diffX) > Math.abs(this.diffY)) return true; // 说明是左右方向的拖动
+ if(this.diffY < 0) return;
+ this.container.addClass("touching");
+ e.preventDefault();
+ e.stopPropagation();
+ this.diffY = Math.pow(this.diffY, 0.75);
+ this.container.css("transform", "translate3d(0, "+this.diffY+"px, 0)");
+ this.triggerPull(this.diffY)
+ };
+ PTR.prototype.touchEnd = function() {
+ this.start = false;
+ if(this.diffY <= 0 || this.container.hasClass("refreshing")) return;
+ this.container.removeClass("touching");
+ this.container.removeClass("pull-down pull-up");
+ this.container.css("transform", "");
+ if(Math.abs(this.diffY) <= this.opt.distance) {
+ } else {
+ this.triggerPullToRefresh();
+ }
+ };
+
+ PTR.prototype.triggerPullToRefresh = function() {
+ this.triggerPull(this.opt.distance)
+ this.container.removeClass('pull-up').addClass("refreshing");
+ if (this.opt.onRefresh) {
+ this.opt.onRefresh.call(this)
+ }
+ this.container.trigger("pull-to-refresh");
+ }
+
+ PTR.prototype.triggerPull = function(diffY) {
+
+ if(diffY < this.opt.distance) {
+ this.container.removeClass("pull-up").addClass("pull-down");
+ } else {
+ this.container.removeClass("pull-down").addClass("pull-up");
+ }
+
+ if (this.opt.onPull) {
+ this.opt.onPull.call(this, Math.floor(diffY / this.opt.distance * 100))
+ }
+ this.container.trigger("pull");
+ }
+
+ PTR.prototype.pullToRefreshDone = function() {
+ this.container.removeClass("refreshing");
+ }
+
+ PTR.prototype.attachEvents = function() {
+ var el = this.container;
+ el.addClass("weui-pull-to-refresh");
+ el.on($.touchEvents.start, $.proxy(this.touchStart, this));
+ el.on($.touchEvents.move, $.proxy(this.touchMove, this));
+ el.on($.touchEvents.end, $.proxy(this.touchEnd, this));
+ };
+
+ var pullToRefreshDone = function(el) {
+ $(el).removeClass("refreshing");
+ }
+
+ $.fn.pullToRefresh = function(opt) {
+ return this.each(function() {
+ var $this = $(this)
+ var ptr = $this.data('ptr')
+ if (!ptr) $this.data('ptr', ptr = new PTR(this, opt))
+ if (typeof opt === typeof 'a') {
+ ptr[opt].call(ptr)
+ }
+ });
+ }
+
+ $.fn.pullToRefreshDone = function() {
+ return this.each(function() {
+ pullToRefreshDone(this);
+ });
+ }
+
+}($);
+
+/* ===============================================================================
+************ Infinite ************
+=============================================================================== */
+/* global $:true */
++function ($) {
+ "use strict";
+
+ // fix https://github.com/lihongxun945/jquery-weui/issues/442
+ // chrome will always return 0, when use document.body.scrollTop
+ // https://stackoverflow.com/questions/43717316/google-chrome-document-body-scrolltop-always-returns-0
+ var getOffset = function (container) {
+ var tagName = container[0].tagName.toUpperCase()
+ var scrollTop
+ if (tagName === 'BODY' || tagName === 'HTML') {
+ scrollTop = container.scrollTop() || $(window).scrollTop()
+ } else {
+ scrollTop = container.scrollTop()
+ }
+ var offset = container.scrollHeight() - ($(window).height() + scrollTop)
+ console.log(offset)
+ return offset
+ }
+
+ var Infinite = function(el, distance) {
+ this.container = $(el);
+ this.container.data("infinite", this);
+ this.distance = distance || 50;
+ this.attachEvents();
+ }
+
+ Infinite.prototype.scroll = function() {
+ var container = this.container;
+ this._check();
+ }
+
+ Infinite.prototype.attachEvents = function(off) {
+ var el = this.container;
+ var scrollContainer = (el[0].tagName.toUpperCase() === "BODY" ? $(document) : el);
+ scrollContainer[off ? "off" : "on"]("scroll", $.proxy(this.scroll, this));
+ };
+ Infinite.prototype.detachEvents = function(off) {
+ this.attachEvents(true);
+ }
+ Infinite.prototype._check = function() {
+ var offset = getOffset(this.container);
+ if(Math.abs(offset) <= this.distance) {
+ this.container.trigger("infinite");
+ }
+ }
+
+ var infinite = function(el) {
+ attachEvents(el);
+ }
+
+ $.fn.infinite = function(distance) {
+ return this.each(function() {
+ new Infinite(this, distance);
+ });
+ }
+ $.fn.destroyInfinite = function() {
+ return this.each(function() {
+ var infinite = $(this).data("infinite");
+ if(infinite && infinite.detachEvents) infinite.detachEvents();
+ });
+ }
+
+}($);
+
+/* global $:true */
++function ($) {
+ "use strict";
+
+ var ITEM_ON = "weui-bar__item--on";
+
+ var showTab = function(a) {
+ var $a = $(a);
+ if($a.hasClass(ITEM_ON)) return;
+ var href = $a.attr("href");
+
+ if(!/^#/.test(href)) return ;
+
+ $a.parent().find("."+ITEM_ON).removeClass(ITEM_ON);
+ $a.addClass(ITEM_ON);
+
+ var bd = $a.parents(".weui-tab").find(".weui-tab__bd");
+
+ bd.find(".weui-tab__bd-item--active").removeClass("weui-tab__bd-item--active");
+
+ $(href).addClass("weui-tab__bd-item--active");
+ }
+
+ $.showTab = showTab;
+
+ $(document).on("click", ".weui-navbar__item, .weui-tabbar__item", function(e) {
+ var $a = $(e.currentTarget);
+ var href = $a.attr("href");
+ if($a.hasClass(ITEM_ON)) return;
+ if(!/^#/.test(href)) return;
+
+ e.preventDefault();
+
+ showTab($a);
+ });
+
+}($);
+
+/* global $:true */
++ function($) {
+ "use strict";
+
+ $(document).on("click touchstart", ".weui-search-bar__label", function(e) {
+ $(e.target).parents(".weui-search-bar").addClass("weui-search-bar_focusing").find('input').focus();
+ })
+ /*
+ .on("blur", ".weui-search-bar__input", function(e) {
+ var $input = $(e.target);
+ if(!$input.val()) $input.parents(".weui-search-bar").removeClass("weui-search-bar_focusing");
+ })
+ */
+ .on("click", ".weui-search-bar__cancel-btn", function(e) {
+ var $input = $(e.target).parents(".weui-search-bar").removeClass("weui-search-bar_focusing").find(".weui-search-bar__input").val("").blur();
+ })
+ .on("click", ".weui-icon-clear", function(e) {
+ var $input = $(e.target).parents(".weui-search-bar").find(".weui-search-bar__input").val("").focus();
+ });
+
+}($);
+
+/*===========================
+Device/OS Detection
+===========================*/
+/* global $:true */
+;(function ($) {
+ "use strict";
+ var device = {};
+ var ua = navigator.userAgent;
+
+ var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
+ var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
+ var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
+ var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
+
+ device.ios = device.android = device.iphone = device.ipad = device.androidChrome = false;
+
+ // Android
+ if (android) {
+ device.os = 'android';
+ device.osVersion = android[2];
+ device.android = true;
+ device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0;
+ }
+ if (ipad || iphone || ipod) {
+ device.os = 'ios';
+ device.ios = true;
+ }
+ // iOS
+ if (iphone && !ipod) {
+ device.osVersion = iphone[2].replace(/_/g, '.');
+ device.iphone = true;
+ }
+ if (ipad) {
+ device.osVersion = ipad[2].replace(/_/g, '.');
+ device.ipad = true;
+ }
+ if (ipod) {
+ device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
+ device.iphone = true;
+ }
+ // iOS 8+ changed UA
+ if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) {
+ if (device.osVersion.split('.')[0] === '10') {
+ device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0];
+ }
+ }
+
+ // Webview
+ device.webView = (iphone || ipad || ipod) && ua.match(/.*AppleWebKit(?!.*Safari)/i);
+
+ // Minimal UI
+ if (device.os && device.os === 'ios') {
+ var osVersionArr = device.osVersion.split('.');
+ device.minimalUi = !device.webView &&
+ (ipod || iphone) &&
+ (osVersionArr[0] * 1 === 7 ? osVersionArr[1] * 1 >= 1 : osVersionArr[0] * 1 > 7) &&
+ $('meta[name="viewport"]').length > 0 && $('meta[name="viewport"]').attr('content').indexOf('minimal-ui') >= 0;
+ }
+
+ // Check for status bar and fullscreen app mode
+ var windowWidth = $(window).width();
+ var windowHeight = $(window).height();
+ device.statusBar = false;
+ if (device.webView && (windowWidth * windowHeight === screen.width * screen.height)) {
+ device.statusBar = true;
+ }
+ else {
+ device.statusBar = false;
+ }
+
+ // Classes
+ var classNames = [];
+
+ // Pixel Ratio
+ device.pixelRatio = window.devicePixelRatio || 1;
+ classNames.push('pixel-ratio-' + Math.floor(device.pixelRatio));
+ if (device.pixelRatio >= 2) {
+ classNames.push('retina');
+ }
+
+ // OS classes
+ if (device.os) {
+ classNames.push(device.os, device.os + '-' + device.osVersion.split('.')[0], device.os + '-' + device.osVersion.replace(/\./g, '-'));
+ if (device.os === 'ios') {
+ var major = parseInt(device.osVersion.split('.')[0], 10);
+ for (var i = major - 1; i >= 6; i--) {
+ classNames.push('ios-gt-' + i);
+ }
+ }
+
+ }
+ // Status bar classes
+ if (device.statusBar) {
+ classNames.push('with-statusbar-overlay');
+ }
+ else {
+ $('html').removeClass('with-statusbar-overlay');
+ }
+
+ // Add html classes
+ if (classNames.length > 0) $('html').addClass(classNames.join(' '));
+
+ $.device = device;
+})($);
+
+/*======================================================
+************ Picker ************
+======================================================*/
+/* global $:true */
+/* jshint unused:false */
+/* jshint multistr:true */
++ function($) {
+ "use strict";
+ var Picker = function (params) {
+ var p = this;
+ var defaults = {
+ updateValuesOnMomentum: false,
+ updateValuesOnTouchmove: true,
+ rotateEffect: false,
+ momentumRatio: 7,
+ freeMode: false,
+ // Common settings
+ scrollToInput: true,
+ inputReadOnly: true,
+ toolbar: true,
+ toolbarCloseText: '完成',
+ title: '请选择',
+ toolbarTemplate: '',
+ };
+ params = params || {};
+ for (var def in defaults) {
+ if (typeof params[def] === 'undefined') {
+ params[def] = defaults[def];
+ }
+ }
+ p.params = params;
+ p.cols = [];
+ p.initialized = false;
+
+ // Inline flag
+ p.inline = p.params.container ? true : false;
+
+ // 3D Transforms origin bug, only on safari
+ var originBug = $.device.ios || (navigator.userAgent.toLowerCase().indexOf('safari') >= 0 && navigator.userAgent.toLowerCase().indexOf('chrome') < 0) && !$.device.android;
+
+ // Should be converted to popover
+ function isPopover() {
+ var toPopover = false;
+ if (!p.params.convertToPopover && !p.params.onlyInPopover) return toPopover;
+ if (!p.inline && p.params.input) {
+ if (p.params.onlyInPopover) toPopover = true;
+ else {
+ if ($.device.ios) {
+ toPopover = $.device.ipad ? true : false;
+ }
+ else {
+ if ($(window).width() >= 768) toPopover = true;
+ }
+ }
+ }
+ return toPopover;
+ }
+ function inPopover() {
+ if (p.opened && p.container && p.container.length > 0 && p.container.parents('.popover').length > 0) return true;
+ else return false;
+ }
+
+ // Value
+ p.setValue = function (arrValues, transition) {
+ var valueIndex = 0;
+ for (var i = 0; i < p.cols.length; i++) {
+ if (p.cols[i] && !p.cols[i].divider) {
+ p.cols[i].setValue(arrValues[valueIndex], transition);
+ valueIndex++;
+ }
+ }
+ };
+ p.updateValue = function () {
+ var newValue = [];
+ var newDisplayValue = [];
+ for (var i = 0; i < p.cols.length; i++) {
+ if (!p.cols[i].divider) {
+ newValue.push(p.cols[i].value);
+ newDisplayValue.push(p.cols[i].displayValue);
+ }
+ }
+ if (newValue.indexOf(undefined) >= 0) {
+ return;
+ }
+ p.value = newValue;
+ p.displayValue = newDisplayValue;
+ if (p.params.onChange) {
+ p.params.onChange(p, p.value, p.displayValue);
+ }
+ if (p.input && p.input.length > 0) {
+ $(p.input).val(p.params.formatValue ? p.params.formatValue(p, p.value, p.displayValue) : p.value.join(' '));
+ $(p.input).trigger('change');
+ }
+ };
+
+ // Columns Handlers
+ p.initPickerCol = function (colElement, updateItems) {
+ var colContainer = $(colElement);
+ var colIndex = colContainer.index();
+ var col = p.cols[colIndex];
+ if (col.divider) return;
+ col.container = colContainer;
+ col.wrapper = col.container.find('.picker-items-col-wrapper');
+ col.items = col.wrapper.find('.picker-item');
+
+ var i, j;
+ var wrapperHeight, itemHeight, itemsHeight, minTranslate, maxTranslate;
+ col.replaceValues = function (values, displayValues) {
+ col.destroyEvents();
+ col.values = values;
+ col.displayValues = displayValues;
+ var newItemsHTML = p.columnHTML(col, true);
+ col.wrapper.html(newItemsHTML);
+ col.items = col.wrapper.find('.picker-item');
+ col.calcSize();
+ col.setValue(col.values[0] || '', 0, true);
+ col.initEvents();
+ };
+ col.calcSize = function () {
+ if (!col.values.length) return;
+ if (p.params.rotateEffect) {
+ col.container.removeClass('picker-items-col-absolute');
+ if (!col.width) col.container.css({width:''});
+ }
+ var colWidth, colHeight;
+ colWidth = 0;
+ colHeight = col.container[0].offsetHeight;
+ wrapperHeight = col.wrapper[0].offsetHeight;
+ itemHeight = col.items[0].offsetHeight;
+ itemsHeight = itemHeight * col.items.length;
+ minTranslate = colHeight / 2 - itemsHeight + itemHeight / 2;
+ maxTranslate = colHeight / 2 - itemHeight / 2;
+ if (col.width) {
+ colWidth = col.width;
+ if (parseInt(colWidth, 10) === colWidth) colWidth = colWidth + 'px';
+ col.container.css({width: colWidth});
+ }
+ if (p.params.rotateEffect) {
+ if (!col.width) {
+ col.items.each(function () {
+ var item = $(this);
+ item.css({width:'auto'});
+ colWidth = Math.max(colWidth, item[0].offsetWidth);
+ item.css({width:''});
+ });
+ col.container.css({width: (colWidth + 2) + 'px'});
+ }
+ col.container.addClass('picker-items-col-absolute');
+ }
+ };
+ col.calcSize();
+
+ col.wrapper.transform('translate3d(0,' + maxTranslate + 'px,0)').transition(0);
+
+
+ var activeIndex = 0;
+ var animationFrameId;
+
+ // Set Value Function
+ col.setValue = function (newValue, transition, valueCallbacks) {
+ if (typeof transition === 'undefined') transition = '';
+ var newActiveIndex = col.wrapper.find('.picker-item[data-picker-value="' + newValue + '"]').index();
+ if(typeof newActiveIndex === 'undefined' || newActiveIndex === -1) {
+ col.value = col.displayValue = newValue;
+ return;
+ }
+ var newTranslate = -newActiveIndex * itemHeight + maxTranslate;
+ // Update wrapper
+ col.wrapper.transition(transition);
+ col.wrapper.transform('translate3d(0,' + (newTranslate) + 'px,0)');
+
+ // Watch items
+ if (p.params.updateValuesOnMomentum && col.activeIndex && col.activeIndex !== newActiveIndex ) {
+ $.cancelAnimationFrame(animationFrameId);
+ col.wrapper.transitionEnd(function(){
+ $.cancelAnimationFrame(animationFrameId);
+ });
+ updateDuringScroll();
+ }
+
+ // Update items
+ col.updateItems(newActiveIndex, newTranslate, transition, valueCallbacks);
+ };
+
+ col.updateItems = function (activeIndex, translate, transition, valueCallbacks) {
+ if (typeof translate === 'undefined') {
+ translate = $.getTranslate(col.wrapper[0], 'y');
+ }
+ if(typeof activeIndex === 'undefined') activeIndex = -Math.round((translate - maxTranslate)/itemHeight);
+ if (activeIndex < 0) activeIndex = 0;
+ if (activeIndex >= col.items.length) activeIndex = col.items.length - 1;
+ var previousActiveIndex = col.activeIndex;
+ col.activeIndex = activeIndex;
+ /*
+ col.wrapper.find('.picker-selected, .picker-after-selected, .picker-before-selected').removeClass('picker-selected picker-after-selected picker-before-selected');
+
+ col.items.transition(transition);
+ var selectedItem = col.items.eq(activeIndex).addClass('picker-selected').transform('');
+ var prevItems = selectedItem.prevAll().addClass('picker-before-selected');
+ var nextItems = selectedItem.nextAll().addClass('picker-after-selected');
+ */
+ //去掉 .picker-after-selected, .picker-before-selected 以提高性能
+ col.wrapper.find('.picker-selected').removeClass('picker-selected');
+ if (p.params.rotateEffect) {
+ col.items.transition(transition);
+ }
+ var selectedItem = col.items.eq(activeIndex).addClass('picker-selected').transform('');
+
+ if (valueCallbacks || typeof valueCallbacks === 'undefined') {
+ // Update values
+ col.value = selectedItem.attr('data-picker-value');
+ col.displayValue = col.displayValues ? col.displayValues[activeIndex] : col.value;
+ // On change callback
+ if (previousActiveIndex !== activeIndex) {
+ if (col.onChange) {
+ col.onChange(p, col.value, col.displayValue);
+ }
+ p.updateValue();
+ }
+ }
+
+ // Set 3D rotate effect
+ if (!p.params.rotateEffect) {
+ return;
+ }
+ var percentage = (translate - (Math.floor((translate - maxTranslate)/itemHeight) * itemHeight + maxTranslate)) / itemHeight;
+
+ col.items.each(function () {
+ var item = $(this);
+ var itemOffsetTop = item.index() * itemHeight;
+ var translateOffset = maxTranslate - translate;
+ var itemOffset = itemOffsetTop - translateOffset;
+ var percentage = itemOffset / itemHeight;
+
+ var itemsFit = Math.ceil(col.height / itemHeight / 2) + 1;
+
+ var angle = (-18*percentage);
+ if (angle > 180) angle = 180;
+ if (angle < -180) angle = -180;
+ // Far class
+ if (Math.abs(percentage) > itemsFit) item.addClass('picker-item-far');
+ else item.removeClass('picker-item-far');
+ // Set transform
+ item.transform('translate3d(0, ' + (-translate + maxTranslate) + 'px, ' + (originBug ? -110 : 0) + 'px) rotateX(' + angle + 'deg)');
+ });
+ };
+
+ function updateDuringScroll() {
+ animationFrameId = $.requestAnimationFrame(function () {
+ col.updateItems(undefined, undefined, 0);
+ updateDuringScroll();
+ });
+ }
+
+ // Update items on init
+ if (updateItems) col.updateItems(0, maxTranslate, 0);
+
+ var allowItemClick = true;
+ var isTouched, isMoved, touchStartY, touchCurrentY, touchStartTime, touchEndTime, startTranslate, returnTo, currentTranslate, prevTranslate, velocityTranslate, velocityTime;
+ function handleTouchStart (e) {
+ if (isMoved || isTouched) return;
+ e.preventDefault();
+ isTouched = true;
+ var position = $.getTouchPosition(e);
+ touchStartY = touchCurrentY = position.y;
+ touchStartTime = (new Date()).getTime();
+
+ allowItemClick = true;
+ startTranslate = currentTranslate = $.getTranslate(col.wrapper[0], 'y');
+ }
+ function handleTouchMove (e) {
+ if (!isTouched) return;
+ e.preventDefault();
+ allowItemClick = false;
+ var position = $.getTouchPosition(e);
+ touchCurrentY = position.y;
+ if (!isMoved) {
+ // First move
+ $.cancelAnimationFrame(animationFrameId);
+ isMoved = true;
+ startTranslate = currentTranslate = $.getTranslate(col.wrapper[0], 'y');
+ col.wrapper.transition(0);
+ }
+ e.preventDefault();
+
+ var diff = touchCurrentY - touchStartY;
+ currentTranslate = startTranslate + diff;
+ returnTo = undefined;
+
+ // Normalize translate
+ if (currentTranslate < minTranslate) {
+ currentTranslate = minTranslate - Math.pow(minTranslate - currentTranslate, 0.8);
+ returnTo = 'min';
+ }
+ if (currentTranslate > maxTranslate) {
+ currentTranslate = maxTranslate + Math.pow(currentTranslate - maxTranslate, 0.8);
+ returnTo = 'max';
+ }
+ // Transform wrapper
+ col.wrapper.transform('translate3d(0,' + currentTranslate + 'px,0)');
+
+ // Update items
+ col.updateItems(undefined, currentTranslate, 0, p.params.updateValuesOnTouchmove);
+
+ // Calc velocity
+ velocityTranslate = currentTranslate - prevTranslate || currentTranslate;
+ velocityTime = (new Date()).getTime();
+ prevTranslate = currentTranslate;
+ }
+ function handleTouchEnd (e) {
+ if (!isTouched || !isMoved) {
+ isTouched = isMoved = false;
+ return;
+ }
+ isTouched = isMoved = false;
+ col.wrapper.transition('');
+ if (returnTo) {
+ if (returnTo === 'min') {
+ col.wrapper.transform('translate3d(0,' + minTranslate + 'px,0)');
+ }
+ else col.wrapper.transform('translate3d(0,' + maxTranslate + 'px,0)');
+ }
+ touchEndTime = new Date().getTime();
+ var velocity, newTranslate;
+ if (touchEndTime - touchStartTime > 300) {
+ newTranslate = currentTranslate;
+ }
+ else {
+ velocity = Math.abs(velocityTranslate / (touchEndTime - velocityTime));
+ newTranslate = currentTranslate + velocityTranslate * p.params.momentumRatio;
+ }
+
+ newTranslate = Math.max(Math.min(newTranslate, maxTranslate), minTranslate);
+
+ // Active Index
+ var activeIndex = -Math.floor((newTranslate - maxTranslate)/itemHeight);
+
+ // Normalize translate
+ if (!p.params.freeMode) newTranslate = -activeIndex * itemHeight + maxTranslate;
+
+ // Transform wrapper
+ col.wrapper.transform('translate3d(0,' + (parseInt(newTranslate,10)) + 'px,0)');
+
+ // Update items
+ col.updateItems(activeIndex, newTranslate, '', true);
+
+ // Watch items
+ if (p.params.updateValuesOnMomentum) {
+ updateDuringScroll();
+ col.wrapper.transitionEnd(function(){
+ $.cancelAnimationFrame(animationFrameId);
+ });
+ }
+
+ // Allow click
+ setTimeout(function () {
+ allowItemClick = true;
+ }, 100);
+ }
+
+ function handleClick(e) {
+ if (!allowItemClick) return;
+ $.cancelAnimationFrame(animationFrameId);
+ /*jshint validthis:true */
+ var value = $(this).attr('data-picker-value');
+ col.setValue(value);
+ }
+
+ col.initEvents = function (detach) {
+ var method = detach ? 'off' : 'on';
+ col.container[method]($.touchEvents.start, handleTouchStart);
+ col.container[method]($.touchEvents.move, handleTouchMove);
+ col.container[method]($.touchEvents.end, handleTouchEnd);
+ col.items[method]('click', handleClick);
+ };
+ col.destroyEvents = function () {
+ col.initEvents(true);
+ };
+
+ col.container[0].f7DestroyPickerCol = function () {
+ col.destroyEvents();
+ };
+
+ col.initEvents();
+
+ };
+ p.destroyPickerCol = function (colContainer) {
+ colContainer = $(colContainer);
+ if ('f7DestroyPickerCol' in colContainer[0]) colContainer[0].f7DestroyPickerCol();
+ };
+ // Resize cols
+ function resizeCols() {
+ if (!p.opened) return;
+ for (var i = 0; i < p.cols.length; i++) {
+ if (!p.cols[i].divider) {
+ p.cols[i].calcSize();
+ p.cols[i].setValue(p.cols[i].value, 0, false);
+ }
+ }
+ }
+ $(window).on('resize', resizeCols);
+
+ // HTML Layout
+ p.columnHTML = function (col, onlyItems) {
+ var columnItemsHTML = '';
+ var columnHTML = '';
+ if (col.divider) {
+ columnHTML += '' + col.content + '
';
+ }
+ else {
+ for (var j = 0; j < col.values.length; j++) {
+ columnItemsHTML += '' + (col.displayValues ? col.displayValues[j] : col.values[j]) + '
';
+ }
+ columnHTML += '';
+ }
+ return onlyItems ? columnItemsHTML : columnHTML;
+ };
+ p.layout = function () {
+ var pickerHTML = '';
+ var pickerClass = '';
+ var i;
+ p.cols = [];
+ var colsHTML = '';
+ for (i = 0; i < p.params.cols.length; i++) {
+ var col = p.params.cols[i];
+ colsHTML += p.columnHTML(p.params.cols[i]);
+ p.cols.push(col);
+ }
+ pickerClass = 'weui-picker-modal picker-columns ' + (p.params.cssClass || '') + (p.params.rotateEffect ? ' picker-3d' : '') + (p.params.cols.length === 1 ? ' picker-columns-single' : '');
+ pickerHTML =
+ '' +
+ (p.params.toolbar ? p.params.toolbarTemplate.replace(/{{closeText}}/g, p.params.toolbarCloseText).replace(/{{title}}/g, p.params.title) : '') +
+ '
' +
+ colsHTML +
+ '
' +
+ '
' +
+ '
';
+
+ p.pickerHTML = pickerHTML;
+ };
+
+ // Input Events
+ function openOnInput(e) {
+ e.preventDefault();
+ if (p.opened) return;
+ p.open();
+ if (p.params.scrollToInput && !isPopover()) {
+ var pageContent = p.input.parents('.content');
+ if (pageContent.length === 0) return;
+
+ var paddingTop = parseInt(pageContent.css('padding-top'), 10),
+ paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),
+ pageHeight = pageContent[0].offsetHeight - paddingTop - p.container.height(),
+ pageScrollHeight = pageContent[0].scrollHeight - paddingTop - p.container.height(),
+ newPaddingBottom;
+ var inputTop = p.input.offset().top - paddingTop + p.input[0].offsetHeight;
+ if (inputTop > pageHeight) {
+ var scrollTop = pageContent.scrollTop() + inputTop - pageHeight;
+ if (scrollTop + pageHeight > pageScrollHeight) {
+ newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom;
+ if (pageHeight === pageScrollHeight) {
+ newPaddingBottom = p.container.height();
+ }
+ pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'});
+ }
+ pageContent.scrollTop(scrollTop, 300);
+ }
+ }
+ }
+ function closeOnHTMLClick(e) {
+ if (inPopover()) return;
+ if (p.input && p.input.length > 0) {
+ if (e.target !== p.input[0] && $(e.target).parents('.weui-picker-modal').length === 0) p.close();
+ }
+ else {
+ if ($(e.target).parents('.weui-picker-modal').length === 0) p.close();
+ }
+ }
+
+ if (p.params.input) {
+ p.input = $(p.params.input);
+ if (p.input.length > 0) {
+ if (p.params.inputReadOnly) p.input.prop('readOnly', true);
+ if (!p.inline) {
+ p.input.on('click', openOnInput);
+ }
+ if (p.params.inputReadOnly) {
+ p.input.on('focus mousedown', function (e) {
+ e.preventDefault();
+ });
+ }
+ }
+
+ }
+
+ if (!p.inline) $('html').on('click', closeOnHTMLClick);
+
+ // Open
+ function onPickerClose() {
+ p.opened = false;
+ if (p.input && p.input.length > 0) p.input.parents('.page-content').css({'padding-bottom': ''});
+ if (p.params.onClose) p.params.onClose(p);
+
+ // Destroy events
+ p.container.find('.picker-items-col').each(function () {
+ p.destroyPickerCol(this);
+ });
+ }
+
+ p.opened = false;
+ p.open = function () {
+ var toPopover = isPopover();
+
+ if (!p.opened) {
+
+ // Layout
+ p.layout();
+
+ // Append
+ if (toPopover) {
+ p.pickerHTML = '';
+ p.popover = $.popover(p.pickerHTML, p.params.input, true);
+ p.container = $(p.popover).find('.weui-picker-modal');
+ $(p.popover).on('close', function () {
+ onPickerClose();
+ });
+ }
+ else if (p.inline) {
+ p.container = $(p.pickerHTML);
+ p.container.addClass('picker-modal-inline');
+ $(p.params.container).append(p.container);
+ }
+ else {
+ p.container = $($.openPicker(p.pickerHTML));
+ $(p.container)
+ .on('close', function () {
+ onPickerClose();
+ });
+ }
+
+ // Store picker instance
+ p.container[0].f7Picker = p;
+
+ // Init Events
+ p.container.find('.picker-items-col').each(function () {
+ var updateItems = true;
+ if ((!p.initialized && p.params.value) || (p.initialized && p.value)) updateItems = false;
+ p.initPickerCol(this, updateItems);
+ });
+
+ // Set value
+ if (!p.initialized) {
+ if (p.params.value) {
+ p.setValue(p.params.value, 0);
+ }
+ }
+ else {
+ if (p.value) p.setValue(p.value, 0);
+ }
+ }
+
+ // Set flag
+ p.opened = true;
+ p.initialized = true;
+
+ if (p.params.onOpen) p.params.onOpen(p);
+ };
+
+ // Close
+ p.close = function (force) {
+ if (!p.opened || p.inline) return;
+ if (inPopover()) {
+ $.closePicker(p.popover);
+ return;
+ }
+ else {
+ $.closePicker(p.container);
+ return;
+ }
+ };
+
+ // Destroy
+ p.destroy = function () {
+ p.close();
+ if (p.params.input && p.input.length > 0) {
+ p.input.off('click focus', openOnInput);
+ $(p.input).data('picker', null);
+ }
+ $('html').off('click', closeOnHTMLClick);
+ $(window).off('resize', resizeCols);
+ };
+
+ if (p.inline) {
+ p.open();
+ }
+
+ return p;
+ };
+
+ $(document).on("click", ".close-picker", function() {
+ var pickerToClose = $('.weui-picker-modal.weui-picker-modal-visible');
+ if (pickerToClose.length > 0) {
+ $.closePicker(pickerToClose);
+ }
+ });
+
+ //修复picker会滚动页面的bug
+ $(document).on($.touchEvents.move, ".picker-modal-inner", function(e) {
+ e.preventDefault();
+ });
+
+
+ $.openPicker = function(tpl, className, callback) {
+
+ if(typeof className === "function") {
+ callback = className;
+ className = undefined;
+ }
+
+ $.closePicker();
+
+ var container = $("
").appendTo(document.body);
+ container.show();
+
+ container.addClass("weui-picker-container-visible");
+
+ //关于布局的问题,如果直接放在body上,则做动画的时候会撑开body高度而导致滚动条变化。
+ var dialog = $(tpl).appendTo(container);
+
+ dialog.width(); //通过取一次CSS值,强制浏览器不能把上下两行代码合并执行,因为合并之后会导致无法出现动画。
+
+ dialog.addClass("weui-picker-modal-visible");
+
+ callback && container.on("close", callback);
+
+ return dialog;
+ }
+
+ $.updatePicker = function(tpl) {
+ var container = $(".weui-picker-container-visible");
+ if(!container[0]) return false;
+
+ container.html("");
+
+ var dialog = $(tpl).appendTo(container);
+
+ dialog.addClass("weui-picker-modal-visible");
+
+ return dialog;
+ }
+
+ $.closePicker = function(container, callback) {
+ if(typeof container === "function") callback = container;
+ $(".weui-picker-modal-visible").removeClass("weui-picker-modal-visible").transitionEnd(function() {
+ $(this).parent().remove();
+ callback && callback();
+ }).trigger("close");
+ };
+
+ $.fn.picker = function(params) {
+ var args = arguments;
+ return this.each(function() {
+ if(!this) return;
+ var $this = $(this);
+
+ var picker = $this.data("picker");
+ if(!picker) {
+ params = $.extend({ input: this }, params || {}) // https://github.com/lihongxun945/jquery-weui/issues/432
+ var inputValue = $this.val();
+ if(params.value === undefined && inputValue !== "") {
+ params.value = (params.cols && params.cols.length > 1) ? inputValue.split(" ") : [inputValue];
+ }
+ var p = $.extend({input: this}, params);
+ picker = new Picker(p);
+ $this.data("picker", picker);
+ }
+ if(typeof params === typeof "a") {
+ picker[params].apply(picker, Array.prototype.slice.call(args, 1));
+ }
+ });
+ };
+}($);
+
+/* global $:true */
++ function($) {
+ "use strict";
+
+ var defaults;
+
+ var selects = [];
+
+ var Select = function(input, config) {
+
+ var self = this;
+ this.config = config;
+
+ //init empty data
+ this.data = {
+ values: '',
+ titles: '',
+ origins: [],
+ length: 0
+ };
+
+ this.$input = $(input);
+ this.$input.prop("readOnly", true);
+
+ this.initConfig();
+
+ config = this.config;
+
+ this.$input.click($.proxy(this.open, this));
+ selects.push(this)
+ }
+
+ Select.prototype.initConfig = function() {
+ this.config = $.extend({}, defaults, this.config);
+
+ var config = this.config;
+
+ if(!config.items || !config.items.length) return;
+
+ config.items = config.items.map(function(d, i) {
+ if(typeof d == typeof "a") {
+ return {
+ title: d,
+ value: d
+ };
+ }
+
+ return d;
+ });
+
+
+ this.tpl = $.t7.compile("" + config.toolbarTemplate + (config.multi ? config.checkboxTemplate : config.radioTemplate) + "
");
+
+ if(config.input !== undefined) this.$input.val(config.input);
+
+ this.parseInitValue();
+
+ this._init = true;
+ }
+
+ Select.prototype.updateInputValue = function(values, titles) {
+ var v, t;
+ if(this.config.multi) {
+ v = values.join(this.config.split);
+ t = titles.join(this.config.split);
+ } else {
+ v = values[0];
+ t = titles[0];
+ }
+
+ //caculate origin data
+ var origins = [];
+
+ this.config.items.forEach(function(d) {
+ values.each(function(i, dd) {
+ if(d.value == dd) origins.push(d);
+ });
+ });
+
+ this.$input.val(t).data("values", v);
+ this.$input.attr("value", t).attr("data-values", v);
+
+ var data = {
+ values: v,
+ titles: t,
+ valuesArray: values,
+ titlesArray: titles,
+ origins: origins,
+ length: origins.length
+ };
+ this.data = data;
+ this.$input.trigger("change", data);
+ this.config.onChange && this.config.onChange.call(this, data);
+ }
+
+ Select.prototype.parseInitValue = function() {
+ var value = this.$input.val();
+ var items = this.config.items;
+
+ //如果input为空,只有在第一次初始化的时候才保留默认选择。因为后来就是用户自己取消了全部选择,不能再为他选中默认值。
+ if( !this._init && (value === undefined || value == null || value === "")) return;
+
+ var titles = this.config.multi ? value.split(this.config.split) : [value];
+ for(var i=0;i this.config.max) {
+ $.toast("最多只能选择"+this.config.max+"个", "text");
+ return false
+ }
+ }
+ }
+ $.closePicker(function() {
+ self.onClose();
+ callback && callback();
+ });
+
+ return true
+ }
+
+ Select.prototype.onClose = function() {
+ this._open = false;
+ if(this.config.onClose) this.config.onClose(this);
+ }
+
+ Select.prototype.getHTML = function(callback) {
+ var config = this.config;
+ return this.tpl({
+ items: config.items,
+ title: config.title,
+ closeText: config.closeText
+ })
+ }
+
+
+ $.fn.select = function(params, args) {
+
+ return this.each(function() {
+ var $this = $(this);
+ if(!$this.data("weui-select")) $this.data("weui-select", new Select(this, params));
+
+ var select = $this.data("weui-select");
+
+ if(typeof params === typeof "a") select[params].call(select, args);
+
+ return select;
+ });
+ }
+
+ defaults = $.fn.select.prototype.defaults = {
+ items: [],
+ input: undefined, //输入框的初始值
+ title: "请选择",
+ multi: false,
+ closeText: "确定",
+ autoClose: true, //是否选择完成后自动关闭,只有单选模式下才有效
+ onChange: undefined, //function
+ beforeClose: undefined, // function 关闭之前,如果返回false则阻止关闭
+ onClose: undefined, //function
+ onOpen: undefined, //function
+ split: ",", //多选模式下的分隔符
+ min: undefined, //多选模式下可用,最少选择数
+ max: undefined, //单选模式下可用,最多选择数
+ toolbarTemplate: '',
+ radioTemplate:
+ '\
+ {{#items}}\
+
\
+ \
+ \
+ \
+ \
+
\
+ \
+ {{/items}}\
+
',
+ checkboxTemplate:
+ '\
+ {{#items}}\
+
\
+ \
+ \
+ \
+ \
+
\
+ \
+ {{/items}}\
+
',
+ }
+
+}($);
+
+/*======================================================
+************ Calendar ************
+======================================================*/
+/* global $:true */
+/*jshint unused: false*/
++function ($) {
+ "use strict";
+ var rtl = false;
+ var defaults;
+ var isSameDate = function (a, b) {
+ var a = new Date(a),
+ b = new Date(b);
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()
+ }
+ var Calendar = function (params) {
+ var p = this;
+ params = params || {};
+ for (var def in defaults) {
+ if (typeof params[def] === 'undefined') {
+ params[def] = defaults[def];
+ }
+ }
+ p.params = params;
+ p.initialized = false;
+
+ // Inline flag
+ p.inline = p.params.container ? true : false;
+
+ // Is horizontal
+ p.isH = p.params.direction === 'horizontal';
+
+ // RTL inverter
+ var inverter = p.isH ? (rtl ? -1 : 1) : 1;
+
+ // Animating flag
+ p.animating = false;
+
+ // Should be converted to popover
+ function isPopover() {
+ var toPopover = false;
+ if (!p.params.convertToPopover && !p.params.onlyInPopover) return toPopover;
+ if (!p.inline && p.params.input) {
+ if (p.params.onlyInPopover) toPopover = true;
+ else {
+ if ($.device.ios) {
+ toPopover = $.device.ipad ? true : false;
+ }
+ else {
+ if ($(window).width() >= 768) toPopover = true;
+ }
+ }
+ }
+ return toPopover;
+ }
+ function inPopover() {
+ if (p.opened && p.container && p.container.length > 0 && p.container.parents('.popover').length > 0) return true;
+ else return false;
+ }
+
+ // Format date
+ function formatDate(date) {
+ date = new Date(date);
+ var year = date.getFullYear();
+ var month = date.getMonth();
+ var month1 = month + 1;
+ var day = date.getDate();
+ var weekDay = date.getDay();
+ return p.params.dateFormat
+ .replace(/yyyy/g, year)
+ .replace(/yy/g, (year + '').substring(2))
+ .replace(/mm/g, month1 < 10 ? '0' + month1 : month1)
+ .replace(/m/g, month1)
+ .replace(/MM/g, p.params.monthNames[month])
+ .replace(/M/g, p.params.monthNamesShort[month])
+ .replace(/dd/g, day < 10 ? '0' + day : day)
+ .replace(/d/g, day)
+ .replace(/DD/g, p.params.dayNames[weekDay])
+ .replace(/D/g, p.params.dayNamesShort[weekDay]);
+ }
+
+
+ // Value
+ p.addValue = function (value) {
+ if (p.params.multiple) {
+ if (!p.value) p.value = [];
+ var inValuesIndex;
+ for (var i = 0; i < p.value.length; i++) {
+ if (isSameDate(value, p.value[i])) {
+ inValuesIndex = i;
+ }
+ }
+ if (typeof inValuesIndex === 'undefined') {
+ p.value.push(value);
+ }
+ else {
+ p.value.splice(inValuesIndex, 1);
+ }
+ p.updateValue();
+ }
+ else {
+ p.value = [value];
+ p.updateValue();
+ }
+ };
+ p.setValue = function (arrValues) {
+ var date = new Date(arrValues[0]);
+ p.setYearMonth(date.getFullYear(), date.getMonth());
+ p.addValue(+ date);
+ };
+ p.updateValue = function () {
+ p.wrapper.find('.picker-calendar-day-selected').removeClass('picker-calendar-day-selected');
+ var i, inputValue;
+ for (i = 0; i < p.value.length; i++) {
+ var valueDate = new Date(p.value[i]);
+ p.wrapper.find('.picker-calendar-day[data-date="' + valueDate.getFullYear() + '-' + valueDate.getMonth() + '-' + valueDate.getDate() + '"]').addClass('picker-calendar-day-selected');
+ }
+ if (p.params.onChange) {
+ p.params.onChange(p, p.value.map(formatDate), p.value.map(function (d) {
+ return + new Date(typeof d === typeof 'a' ? d.split(/\D/).filter(function (a) { return !!a; }).join("-") : d);
+ }));
+ }
+ if (p.input && p.input.length > 0) {
+ if (p.params.formatValue) inputValue = p.params.formatValue(p, p.value);
+ else {
+ inputValue = [];
+ for (i = 0; i < p.value.length; i++) {
+ inputValue.push(formatDate(p.value[i]));
+ }
+ inputValue = inputValue.join(', ');
+ }
+ $(p.input).val(inputValue);
+ $(p.input).trigger('change');
+ }
+ };
+
+ // Columns Handlers
+ p.initCalendarEvents = function () {
+ var col;
+ var allowItemClick = true;
+ var isTouched, isMoved, touchStartX, touchStartY, touchCurrentX, touchCurrentY, touchStartTime, touchEndTime, startTranslate, currentTranslate, wrapperWidth, wrapperHeight, percentage, touchesDiff, isScrolling;
+ function handleTouchStart (e) {
+ if (isMoved || isTouched) return;
+ // e.preventDefault();
+ isTouched = true;
+ var position = $.getTouchPosition(e);
+ touchStartX = touchCurrentY = position.x;
+ touchStartY = touchCurrentY = position.y;
+ touchStartTime = (new Date()).getTime();
+ percentage = 0;
+ allowItemClick = true;
+ isScrolling = undefined;
+ startTranslate = currentTranslate = p.monthsTranslate;
+ }
+ function handleTouchMove (e) {
+ if (!isTouched) return;
+ var position = $.getTouchPosition(e);
+ touchCurrentX = position.x;
+ touchCurrentY = position.y;
+ if (typeof isScrolling === 'undefined') {
+ isScrolling = !!(isScrolling || Math.abs(touchCurrentY - touchStartY) > Math.abs(touchCurrentX - touchStartX));
+ }
+ if (p.isH && isScrolling) {
+ isTouched = false;
+ return;
+ }
+ e.preventDefault();
+ if (p.animating) {
+ isTouched = false;
+ return;
+ }
+ allowItemClick = false;
+ if (!isMoved) {
+ // First move
+ isMoved = true;
+ wrapperWidth = p.wrapper[0].offsetWidth;
+ wrapperHeight = p.wrapper[0].offsetHeight;
+ p.wrapper.transition(0);
+ }
+ e.preventDefault();
+
+ touchesDiff = p.isH ? touchCurrentX - touchStartX : touchCurrentY - touchStartY;
+ percentage = touchesDiff/(p.isH ? wrapperWidth : wrapperHeight);
+ currentTranslate = (p.monthsTranslate * inverter + percentage) * 100;
+
+ // Transform wrapper
+ p.wrapper.transform('translate3d(' + (p.isH ? currentTranslate : 0) + '%, ' + (p.isH ? 0 : currentTranslate) + '%, 0)');
+
+ }
+ function handleTouchEnd (e) {
+ if (!isTouched || !isMoved) {
+ isTouched = isMoved = false;
+ return;
+ }
+ isTouched = isMoved = false;
+
+ touchEndTime = new Date().getTime();
+ if (touchEndTime - touchStartTime < 300) {
+ if (Math.abs(touchesDiff) < 10) {
+ p.resetMonth();
+ }
+ else if (touchesDiff >= 10) {
+ if (rtl) p.nextMonth();
+ else p.prevMonth();
+ }
+ else {
+ if (rtl) p.prevMonth();
+ else p.nextMonth();
+ }
+ }
+ else {
+ if (percentage <= -0.5) {
+ if (rtl) p.prevMonth();
+ else p.nextMonth();
+ }
+ else if (percentage >= 0.5) {
+ if (rtl) p.nextMonth();
+ else p.prevMonth();
+ }
+ else {
+ p.resetMonth();
+ }
+ }
+
+ // Allow click
+ setTimeout(function () {
+ allowItemClick = true;
+ }, 100);
+ }
+
+ function handleDayClick(e) {
+ if (!allowItemClick) return;
+ var day = $(e.target).parents('.picker-calendar-day');
+ if (day.length === 0 && $(e.target).hasClass('picker-calendar-day')) {
+ day = $(e.target);
+ }
+ if (day.length === 0) return;
+ // if (day.hasClass('picker-calendar-day-selected') && !p.params.multiple) return;
+ if (day.hasClass('picker-calendar-day-disabled')) return;
+ if (day.hasClass('picker-calendar-day-next')) p.nextMonth();
+ if (day.hasClass('picker-calendar-day-prev')) p.prevMonth();
+ var dateYear = day.attr('data-year');
+ var dateMonth = day.attr('data-month');
+ var dateDay = day.attr('data-day');
+ if (p.params.onDayClick) {
+ p.params.onDayClick(p, day[0], dateYear, dateMonth, dateDay);
+ }
+ p.addValue(new Date(dateYear, dateMonth, dateDay).getTime());
+ if (p.params.closeOnSelect && !p.params.multiple) p.close();
+ }
+
+ p.container.find('.picker-calendar-prev-month').on('click', p.prevMonth);
+ p.container.find('.picker-calendar-next-month').on('click', p.nextMonth);
+ p.container.find('.picker-calendar-prev-year').on('click', p.prevYear);
+ p.container.find('.picker-calendar-next-year').on('click', p.nextYear);
+ p.wrapper.on('click', handleDayClick);
+ if (p.params.touchMove) {
+ p.wrapper.on($.touchEvents.start, handleTouchStart);
+ p.wrapper.on($.touchEvents.move, handleTouchMove);
+ p.wrapper.on($.touchEvents.end, handleTouchEnd);
+ }
+
+ p.container[0].f7DestroyCalendarEvents = function () {
+ p.container.find('.picker-calendar-prev-month').off('click', p.prevMonth);
+ p.container.find('.picker-calendar-next-month').off('click', p.nextMonth);
+ p.container.find('.picker-calendar-prev-year').off('click', p.prevYear);
+ p.container.find('.picker-calendar-next-year').off('click', p.nextYear);
+ p.wrapper.off('click', handleDayClick);
+ if (p.params.touchMove) {
+ p.wrapper.off($.touchEvents.start, handleTouchStart);
+ p.wrapper.off($.touchEvents.move, handleTouchMove);
+ p.wrapper.off($.touchEvents.end, handleTouchEnd);
+ }
+ };
+
+
+ };
+ p.destroyCalendarEvents = function (colContainer) {
+ if ('f7DestroyCalendarEvents' in p.container[0]) p.container[0].f7DestroyCalendarEvents();
+ };
+
+ // Calendar Methods
+ p.daysInMonth = function (date) {
+ var d = new Date(date);
+ return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate();
+ };
+ p.monthHTML = function (date, offset) {
+ date = new Date(date);
+ var year = date.getFullYear(),
+ month = date.getMonth(),
+ day = date.getDate();
+ if (offset === 'next') {
+ if (month === 11) date = new Date(year + 1, 0);
+ else date = new Date(year, month + 1, 1);
+ }
+ if (offset === 'prev') {
+ if (month === 0) date = new Date(year - 1, 11);
+ else date = new Date(year, month - 1, 1);
+ }
+ if (offset === 'next' || offset === 'prev') {
+ month = date.getMonth();
+ year = date.getFullYear();
+ }
+ var daysInPrevMonth = p.daysInMonth(new Date(date.getFullYear(), date.getMonth()).getTime() - 10 * 24 * 60 * 60 * 1000),
+ daysInMonth = p.daysInMonth(date),
+ firstDayOfMonthIndex = new Date(date.getFullYear(), date.getMonth()).getDay();
+ if (firstDayOfMonthIndex === 0) firstDayOfMonthIndex = 7;
+
+ var dayDate, currentValues = [], i, j,
+ rows = 6, cols = 7,
+ monthHTML = '',
+ dayIndex = 0 + (p.params.firstDay - 1),
+ today = new Date().setHours(0,0,0,0),
+ minDate = p.params.minDate ? new Date(p.params.minDate).getTime() : null,
+ maxDate = p.params.maxDate ? new Date(p.params.maxDate).getTime() : null;
+
+ if (p.value && p.value.length) {
+ for (i = 0; i < p.value.length; i++) {
+ currentValues.push(new Date(p.value[i]).setHours(0,0,0,0));
+ }
+ }
+
+ for (i = 1; i <= rows; i++) {
+ var rowHTML = '';
+ var row = i;
+ for (j = 1; j <= cols; j++) {
+ var col = j;
+ dayIndex ++;
+ var dayNumber = dayIndex - firstDayOfMonthIndex;
+ var addClass = '';
+ if (dayNumber < 0) {
+ dayNumber = daysInPrevMonth + dayNumber + 1;
+ addClass += ' picker-calendar-day-prev';
+ dayDate = new Date(month - 1 < 0 ? year - 1 : year, month - 1 < 0 ? 11 : month - 1, dayNumber).getTime();
+ }
+ else {
+ dayNumber = dayNumber + 1;
+ if (dayNumber > daysInMonth) {
+ dayNumber = dayNumber - daysInMonth;
+ addClass += ' picker-calendar-day-next';
+ dayDate = new Date(month + 1 > 11 ? year + 1 : year, month + 1 > 11 ? 0 : month + 1, dayNumber).getTime();
+ }
+ else {
+ dayDate = new Date(year, month, dayNumber).getTime();
+ }
+ }
+ // Today
+ if (dayDate === today) addClass += ' picker-calendar-day-today';
+ // Selected
+ if (currentValues.indexOf(dayDate) >= 0) addClass += ' picker-calendar-day-selected';
+ // Weekend
+ if (p.params.weekendDays.indexOf(col - 1) >= 0) {
+ addClass += ' picker-calendar-day-weekend';
+ }
+ // Disabled
+ if ((minDate && dayDate < minDate) || (maxDate && dayDate > maxDate)) {
+ addClass += ' picker-calendar-day-disabled';
+ }
+
+ dayDate = new Date(dayDate);
+ var dayYear = dayDate.getFullYear();
+ var dayMonth = dayDate.getMonth();
+ rowHTML += ''+dayNumber+'
';
+ }
+ monthHTML += '' + rowHTML + '
';
+ }
+ monthHTML = '' + monthHTML + '
';
+ return monthHTML;
+ };
+ p.animating = false;
+ p.updateCurrentMonthYear = function (dir) {
+ if (typeof dir === 'undefined') {
+ p.currentMonth = parseInt(p.months.eq(1).attr('data-month'), 10);
+ p.currentYear = parseInt(p.months.eq(1).attr('data-year'), 10);
+ }
+ else {
+ p.currentMonth = parseInt(p.months.eq(dir === 'next' ? (p.months.length - 1) : 0).attr('data-month'), 10);
+ p.currentYear = parseInt(p.months.eq(dir === 'next' ? (p.months.length - 1) : 0).attr('data-year'), 10);
+ }
+ p.container.find('.current-month-value').text(p.params.monthNames[p.currentMonth]);
+ p.container.find('.current-year-value').text(p.currentYear);
+
+ };
+ p.onMonthChangeStart = function (dir) {
+ p.updateCurrentMonthYear(dir);
+ p.months.removeClass('picker-calendar-month-current picker-calendar-month-prev picker-calendar-month-next');
+ var currentIndex = dir === 'next' ? p.months.length - 1 : 0;
+
+ p.months.eq(currentIndex).addClass('picker-calendar-month-current');
+ p.months.eq(dir === 'next' ? currentIndex - 1 : currentIndex + 1).addClass(dir === 'next' ? 'picker-calendar-month-prev' : 'picker-calendar-month-next');
+
+ if (p.params.onMonthYearChangeStart) {
+ p.params.onMonthYearChangeStart(p, p.currentYear, p.currentMonth);
+ }
+ };
+ p.onMonthChangeEnd = function (dir, rebuildBoth) {
+ p.animating = false;
+ var nextMonthHTML, prevMonthHTML, newMonthHTML;
+ p.wrapper.find('.picker-calendar-month:not(.picker-calendar-month-prev):not(.picker-calendar-month-current):not(.picker-calendar-month-next)').remove();
+
+ if (typeof dir === 'undefined') {
+ dir = 'next';
+ rebuildBoth = true;
+ }
+ if (!rebuildBoth) {
+ newMonthHTML = p.monthHTML(new Date(p.currentYear, p.currentMonth), dir);
+ }
+ else {
+ p.wrapper.find('.picker-calendar-month-next, .picker-calendar-month-prev').remove();
+ prevMonthHTML = p.monthHTML(new Date(p.currentYear, p.currentMonth), 'prev');
+ nextMonthHTML = p.monthHTML(new Date(p.currentYear, p.currentMonth), 'next');
+ }
+ if (dir === 'next' || rebuildBoth) {
+ p.wrapper.append(newMonthHTML || nextMonthHTML);
+ }
+ if (dir === 'prev' || rebuildBoth) {
+ p.wrapper.prepend(newMonthHTML || prevMonthHTML);
+ }
+ p.months = p.wrapper.find('.picker-calendar-month');
+ p.setMonthsTranslate(p.monthsTranslate);
+ if (p.params.onMonthAdd) {
+ p.params.onMonthAdd(p, dir === 'next' ? p.months.eq(p.months.length - 1)[0] : p.months.eq(0)[0]);
+ }
+ if (p.params.onMonthYearChangeEnd) {
+ p.params.onMonthYearChangeEnd(p, p.currentYear, p.currentMonth);
+ }
+ };
+ p.setMonthsTranslate = function (translate) {
+ translate = translate || p.monthsTranslate || 0;
+ if (typeof p.monthsTranslate === 'undefined') p.monthsTranslate = translate;
+ p.months.removeClass('picker-calendar-month-current picker-calendar-month-prev picker-calendar-month-next');
+ var prevMonthTranslate = -(translate + 1) * 100 * inverter;
+ var currentMonthTranslate = -translate * 100 * inverter;
+ var nextMonthTranslate = -(translate - 1) * 100 * inverter;
+ p.months.eq(0).transform('translate3d(' + (p.isH ? prevMonthTranslate : 0) + '%, ' + (p.isH ? 0 : prevMonthTranslate) + '%, 0)').addClass('picker-calendar-month-prev');
+ p.months.eq(1).transform('translate3d(' + (p.isH ? currentMonthTranslate : 0) + '%, ' + (p.isH ? 0 : currentMonthTranslate) + '%, 0)').addClass('picker-calendar-month-current');
+ p.months.eq(2).transform('translate3d(' + (p.isH ? nextMonthTranslate : 0) + '%, ' + (p.isH ? 0 : nextMonthTranslate) + '%, 0)').addClass('picker-calendar-month-next');
+ };
+ p.nextMonth = function (transition) {
+ if (typeof transition === 'undefined' || typeof transition === 'object') {
+ transition = '';
+ if (!p.params.animate) transition = 0;
+ }
+ var nextMonth = parseInt(p.months.eq(p.months.length - 1).attr('data-month'), 10);
+ var nextYear = parseInt(p.months.eq(p.months.length - 1).attr('data-year'), 10);
+ var nextDate = new Date(nextYear, nextMonth);
+ var nextDateTime = nextDate.getTime();
+ var transitionEndCallback = p.animating ? false : true;
+ if (p.params.maxDate) {
+ if (nextDateTime > new Date(p.params.maxDate).getTime()) {
+ return p.resetMonth();
+ }
+ }
+ p.monthsTranslate --;
+ if (nextMonth === p.currentMonth) {
+ var nextMonthTranslate = -(p.monthsTranslate) * 100 * inverter;
+ var nextMonthHTML = $(p.monthHTML(nextDateTime, 'next')).transform('translate3d(' + (p.isH ? nextMonthTranslate : 0) + '%, ' + (p.isH ? 0 : nextMonthTranslate) + '%, 0)').addClass('picker-calendar-month-next');
+ p.wrapper.append(nextMonthHTML[0]);
+ p.months = p.wrapper.find('.picker-calendar-month');
+ if (p.params.onMonthAdd) {
+ p.params.onMonthAdd(p, p.months.eq(p.months.length - 1)[0]);
+ }
+ }
+ p.animating = true;
+ p.onMonthChangeStart('next');
+ var translate = (p.monthsTranslate * 100) * inverter;
+
+ p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? translate : 0) + '%, ' + (p.isH ? 0 : translate) + '%, 0)');
+ if (transitionEndCallback) {
+ p.wrapper.transitionEnd(function () {
+ p.onMonthChangeEnd('next');
+ });
+ }
+ if (!p.params.animate) {
+ p.onMonthChangeEnd('next');
+ }
+ };
+ p.prevMonth = function (transition) {
+ if (typeof transition === 'undefined' || typeof transition === 'object') {
+ transition = '';
+ if (!p.params.animate) transition = 0;
+ }
+ var prevMonth = parseInt(p.months.eq(0).attr('data-month'), 10);
+ var prevYear = parseInt(p.months.eq(0).attr('data-year'), 10);
+ var prevDate = new Date(prevYear, prevMonth + 1, -1);
+ var prevDateTime = prevDate.getTime();
+ var transitionEndCallback = p.animating ? false : true;
+ if (p.params.minDate) {
+ if (prevDateTime < new Date(p.params.minDate).getTime()) {
+ return p.resetMonth();
+ }
+ }
+ p.monthsTranslate ++;
+ if (prevMonth === p.currentMonth) {
+ var prevMonthTranslate = -(p.monthsTranslate) * 100 * inverter;
+ var prevMonthHTML = $(p.monthHTML(prevDateTime, 'prev')).transform('translate3d(' + (p.isH ? prevMonthTranslate : 0) + '%, ' + (p.isH ? 0 : prevMonthTranslate) + '%, 0)').addClass('picker-calendar-month-prev');
+ p.wrapper.prepend(prevMonthHTML[0]);
+ p.months = p.wrapper.find('.picker-calendar-month');
+ if (p.params.onMonthAdd) {
+ p.params.onMonthAdd(p, p.months.eq(0)[0]);
+ }
+ }
+ p.animating = true;
+ p.onMonthChangeStart('prev');
+ var translate = (p.monthsTranslate * 100) * inverter;
+ p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? translate : 0) + '%, ' + (p.isH ? 0 : translate) + '%, 0)');
+ if (transitionEndCallback) {
+ p.wrapper.transitionEnd(function () {
+ p.onMonthChangeEnd('prev');
+ });
+ }
+ if (!p.params.animate) {
+ p.onMonthChangeEnd('prev');
+ }
+ };
+ p.resetMonth = function (transition) {
+ if (typeof transition === 'undefined') transition = '';
+ var translate = (p.monthsTranslate * 100) * inverter;
+ p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? translate : 0) + '%, ' + (p.isH ? 0 : translate) + '%, 0)');
+ };
+ p.setYearMonth = function (year, month, transition) {
+ if (typeof year === 'undefined') year = p.currentYear;
+ if (typeof month === 'undefined') month = p.currentMonth;
+ if (typeof transition === 'undefined' || typeof transition === 'object') {
+ transition = '';
+ if (!p.params.animate) transition = 0;
+ }
+ var targetDate;
+ if (year < p.currentYear) {
+ targetDate = new Date(year, month + 1, -1).getTime();
+ }
+ else {
+ targetDate = new Date(year, month).getTime();
+ }
+ if (p.params.maxDate && targetDate > new Date(p.params.maxDate).getTime()) {
+ return false;
+ }
+ if (p.params.minDate && targetDate < new Date(p.params.minDate).getTime()) {
+ return false;
+ }
+ var currentDate = new Date(p.currentYear, p.currentMonth).getTime();
+ var dir = targetDate > currentDate ? 'next' : 'prev';
+ var newMonthHTML = p.monthHTML(new Date(year, month));
+ p.monthsTranslate = p.monthsTranslate || 0;
+ var prevTranslate = p.monthsTranslate;
+ var monthTranslate, wrapperTranslate;
+ var transitionEndCallback = p.animating ? false : true;
+ if (targetDate > currentDate) {
+ // To next
+ p.monthsTranslate --;
+ if (!p.animating) p.months.eq(p.months.length - 1).remove();
+ p.wrapper.append(newMonthHTML);
+ p.months = p.wrapper.find('.picker-calendar-month');
+ monthTranslate = -(prevTranslate - 1) * 100 * inverter;
+ p.months.eq(p.months.length - 1).transform('translate3d(' + (p.isH ? monthTranslate : 0) + '%, ' + (p.isH ? 0 : monthTranslate) + '%, 0)').addClass('picker-calendar-month-next');
+ }
+ else {
+ // To prev
+ p.monthsTranslate ++;
+ if (!p.animating) p.months.eq(0).remove();
+ p.wrapper.prepend(newMonthHTML);
+ p.months = p.wrapper.find('.picker-calendar-month');
+ monthTranslate = -(prevTranslate + 1) * 100 * inverter;
+ p.months.eq(0).transform('translate3d(' + (p.isH ? monthTranslate : 0) + '%, ' + (p.isH ? 0 : monthTranslate) + '%, 0)').addClass('picker-calendar-month-prev');
+ }
+ if (p.params.onMonthAdd) {
+ p.params.onMonthAdd(p, dir === 'next' ? p.months.eq(p.months.length - 1)[0] : p.months.eq(0)[0]);
+ }
+ p.animating = true;
+ p.onMonthChangeStart(dir);
+ wrapperTranslate = (p.monthsTranslate * 100) * inverter;
+ p.wrapper.transition(transition).transform('translate3d(' + (p.isH ? wrapperTranslate : 0) + '%, ' + (p.isH ? 0 : wrapperTranslate) + '%, 0)');
+ if (transitionEndCallback) {
+ p.wrapper.transitionEnd(function () {
+ p.onMonthChangeEnd(dir, true);
+ });
+ }
+ if (!p.params.animate) {
+ p.onMonthChangeEnd(dir);
+ }
+ };
+ p.nextYear = function () {
+ p.setYearMonth(p.currentYear + 1);
+ };
+ p.prevYear = function () {
+ p.setYearMonth(p.currentYear - 1);
+ };
+
+
+ // HTML Layout
+ p.layout = function () {
+ var pickerHTML = '';
+ var pickerClass = '';
+ var i;
+
+ var layoutDate = p.value && p.value.length ? p.value[0] : new Date().setHours(0,0,0,0);
+ var prevMonthHTML = p.monthHTML(layoutDate, 'prev');
+ var currentMonthHTML = p.monthHTML(layoutDate);
+ var nextMonthHTML = p.monthHTML(layoutDate, 'next');
+ var monthsHTML = '' + (prevMonthHTML + currentMonthHTML + nextMonthHTML) + '
';
+ // Week days header
+ var weekHeaderHTML = '';
+ if (p.params.weekHeader) {
+ for (i = 0; i < 7; i++) {
+ var weekDayIndex = (i + p.params.firstDay > 6) ? (i - 7 + p.params.firstDay) : (i + p.params.firstDay);
+ var dayName = p.params.dayNamesShort[weekDayIndex];
+ weekHeaderHTML += ' ' + dayName + '
';
+
+ }
+ weekHeaderHTML = '' + weekHeaderHTML + '
';
+ }
+ pickerClass = 'weui-picker-calendar ' + (p.params.cssClass || '');
+ if(!p.inline) pickerClass = 'weui-picker-modal ' + pickerClass;
+ var toolbarHTML = p.params.toolbar ? p.params.toolbarTemplate.replace(/{{closeText}}/g, p.params.toolbarCloseText) : '';
+ if (p.params.toolbar) {
+ toolbarHTML = p.params.toolbarTemplate
+ .replace(/{{closeText}}/g, p.params.toolbarCloseText)
+ .replace(/{{monthPicker}}/g, (p.params.monthPicker ? p.params.monthPickerTemplate : ''))
+ .replace(/{{yearPicker}}/g, (p.params.yearPicker ? p.params.yearPickerTemplate : ''));
+ }
+
+ pickerHTML =
+ '' +
+ toolbarHTML +
+ '
' +
+ weekHeaderHTML +
+ monthsHTML +
+ '
' +
+ '
';
+
+
+ p.pickerHTML = pickerHTML;
+ };
+
+ // Input Events
+ function openOnInput(e) {
+ e.preventDefault();
+ if (p.opened) return;
+ p.open();
+ if (p.params.scrollToInput && !isPopover()) {
+ var pageContent = p.input.parents('.page-content');
+ if (pageContent.length === 0) return;
+
+ var paddingTop = parseInt(pageContent.css('padding-top'), 10),
+ paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),
+ pageHeight = pageContent[0].offsetHeight - paddingTop - p.container.height(),
+ pageScrollHeight = pageContent[0].scrollHeight - paddingTop - p.container.height(),
+ newPaddingBottom;
+
+ var inputTop = p.input.offset().top - paddingTop + p.input[0].offsetHeight;
+ if (inputTop > pageHeight) {
+ var scrollTop = pageContent.scrollTop() + inputTop - pageHeight;
+ if (scrollTop + pageHeight > pageScrollHeight) {
+ newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom;
+ if (pageHeight === pageScrollHeight) {
+ newPaddingBottom = p.container.height();
+ }
+ pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'});
+ }
+ pageContent.scrollTop(scrollTop, 300);
+ }
+ }
+ }
+ function closeOnHTMLClick(e) {
+ if (inPopover()) return;
+ if (p.input && p.input.length > 0) {
+ if (e.target !== p.input[0] && $(e.target).parents('.weui-picker-modal').length === 0) p.close();
+ }
+ else {
+ if ($(e.target).parents('.weui-picker-modal').length === 0) p.close();
+ }
+ }
+
+ if (p.params.input) {
+ p.input = $(p.params.input);
+ if (p.input.length > 0) {
+ if (p.params.inputReadOnly) p.input.prop('readOnly', true);
+ if (!p.inline) {
+ p.input.on('click', openOnInput);
+ }
+ if (p.params.inputReadOnly) {
+ p.input.on('focus mousedown', function (e) {
+ e.preventDefault();
+ });
+ }
+ }
+
+ }
+
+ //iphone 上无法正确触发 click,会导致点击外面无法关闭
+ if (!p.inline) $(document).on('click touchend', closeOnHTMLClick);
+
+ // Open
+ function onPickerClose() {
+ p.opened = false;
+ if (p.input && p.input.length > 0) p.input.parents('.page-content').css({'padding-bottom': ''});
+ if (p.params.onClose) p.params.onClose(p);
+
+ // Destroy events
+ p.destroyCalendarEvents();
+ }
+
+ p.opened = false;
+ p.open = function () {
+ var toPopover = isPopover() && false;
+ var updateValue = false;
+ if (!p.opened) {
+ // Set date value
+ if (!p.value) {
+ if (p.params.value) {
+ p.value = p.params.value;
+ updateValue = true;
+ }
+ }
+
+ // Layout
+ p.layout();
+
+ // Append
+ if (toPopover) {
+ p.pickerHTML = '';
+ p.popover = $.popover(p.pickerHTML, p.params.input, true);
+ p.container = $(p.popover).find('.weui-picker-modal');
+ $(p.popover).on('close', function () {
+ onPickerClose();
+ });
+ }
+ else if (p.inline) {
+ p.container = $(p.pickerHTML);
+ p.container.addClass('picker-modal-inline');
+ $(p.params.container).append(p.container);
+ }
+ else {
+ p.container = $($.openPicker(p.pickerHTML));
+ $(p.container)
+ .on('close', function () {
+ onPickerClose();
+ });
+ }
+
+ // Store calendar instance
+ p.container[0].f7Calendar = p;
+ p.wrapper = p.container.find('.picker-calendar-months-wrapper');
+
+ // Months
+ p.months = p.wrapper.find('.picker-calendar-month');
+
+ // Update current month and year
+ p.updateCurrentMonthYear();
+
+ // Set initial translate
+ p.monthsTranslate = 0;
+ p.setMonthsTranslate();
+
+ // Init events
+ p.initCalendarEvents();
+
+ // Update input value
+ if (updateValue) p.updateValue();
+
+ }
+
+ // Set flag
+ p.opened = true;
+ p.initialized = true;
+ if (p.params.onMonthAdd) {
+ p.months.each(function () {
+ p.params.onMonthAdd(p, this);
+ });
+ }
+ if (p.params.onOpen) p.params.onOpen(p);
+ };
+
+ // Close
+ p.close = function () {
+ if (!p.opened || p.inline) return;
+ p.animating = false; //有可能还有动画没做完,因此animating设置还没改。
+ if (inPopover()) {
+ $.closePicker(p.popover);
+ return;
+ }
+ else {
+ $.closePicker(p.container);
+ return;
+ }
+ };
+
+ // Destroy
+ p.destroy = function () {
+ p.close();
+ if (p.params.input && p.input.length > 0) {
+ p.input.off('click focus', openOnInput);
+ p.input.data("calendar", null);
+ }
+ $('html').off('click', closeOnHTMLClick);
+ };
+
+ if (p.inline) {
+ p.open();
+ }
+
+ return p;
+ };
+
+ var format = function(d) {
+ return d < 10 ? "0"+d : d;
+ }
+
+
+ $.fn.calendar = function (params, args) {
+ params = params || {};
+ return this.each(function() {
+ var $this = $(this);
+ if(!$this[0]) return;
+ var p = {};
+ if($this[0].tagName.toUpperCase() === "INPUT") {
+ p.input = $this;
+ } else {
+ p.container = $this;
+ }
+
+ var calendar = $this.data("calendar");
+
+ if(!calendar) {
+ if(typeof params === typeof "a") {
+ } else {
+ if(!params.value && $this.val()) params.value = [$this.val()];
+ //默认显示今天
+ if(!params.value) {
+ var today = new Date();
+ params.value = [today.getFullYear() + "/" + format(today.getMonth() + 1) + "/" + format(today.getDate())];
+ }
+ calendar = $this.data("calendar", new Calendar($.extend(p, params)));
+ }
+ }
+
+ if(typeof params === typeof "a") {
+ calendar[params].call(calendar, args);
+ }
+ });
+ };
+
+ defaults = $.fn.calendar.prototype.defaults = {
+ value: undefined, // 通过JS赋值,注意是数组
+ monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+ monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+ dayNames: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+ dayNamesShort: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+ firstDay: 1, // First day of the week, Monday
+ weekendDays: [0, 6], // Sunday and Saturday
+ multiple: false,
+ dateFormat: 'yyyy/mm/dd',
+ direction: 'horizontal', // or 'vertical'
+ minDate: null,
+ maxDate: null,
+ touchMove: true,
+ animate: true,
+ closeOnSelect: true,
+ monthPicker: true,
+ monthPickerTemplate:
+ '' +
+ '
' +
+ '
' +
+ '
' +
+ '
',
+ yearPicker: true,
+ yearPickerTemplate:
+ '' +
+ '
' +
+ '
' +
+ '
' +
+ '
',
+ weekHeader: true,
+ // Common settings
+ scrollToInput: true,
+ inputReadOnly: true,
+ convertToPopover: true,
+ onlyInPopover: false,
+ toolbar: true,
+ toolbarCloseText: 'Done',
+ toolbarTemplate:
+ '',
+ /* Callbacks
+ onMonthAdd
+ onChange
+ onOpen
+ onClose
+ onDayClick
+ onMonthYearChangeStart
+ onMonthYearChangeEnd
+ */
+ };
+
+}($);
+
+/* global $:true */
+/* jshint unused:false*/
+
++ function($) {
+ "use strict";
+
+
+ var defaults;
+
+ var formatNumber = function (n) {
+ return n < 10 ? "0" + n : n;
+ }
+
+ var Datetime = function(input, params) {
+ this.input = $(input);
+ this.params = params || {};
+
+ this.initMonthes = params.monthes
+
+ this.initYears = params.years
+
+ var p = $.extend({}, params, this.getConfig());
+ $(this.input).picker(p);
+ }
+
+ Datetime.prototype = {
+ getDays : function(max) {
+ var days = [];
+ for(var i=1; i<= (max||31);i++) {
+ days.push(i < 10 ? "0"+i : i);
+ }
+ return days;
+ },
+
+ getDaysByMonthAndYear : function(month, year) {
+ var int_d = new Date(year, parseInt(month)+1-1, 1);
+ var d = new Date(int_d - 1);
+ return this.getDays(d.getDate());
+ },
+ getConfig: function() {
+ var today = new Date(),
+ params = this.params,
+ self = this,
+ lastValidValues;
+
+ var config = {
+ rotateEffect: false, //为了性能
+ cssClass: 'datetime-picker',
+
+ value: [today.getFullYear(), formatNumber(today.getMonth()+1), formatNumber(today.getDate()), formatNumber(today.getHours()), (formatNumber(today.getMinutes()))],
+
+ onChange: function (picker, values, displayValues) {
+ var cols = picker.cols;
+ var days = self.getDaysByMonthAndYear(values[1], values[0]);
+ var currentValue = values[2];
+ if(currentValue > days.length) currentValue = days.length;
+ picker.cols[4].setValue(currentValue);
+
+ //check min and max
+ var current = new Date(values[0]+'-'+values[1]+'-'+values[2]);
+ var valid = true;
+ if(params.min) {
+ var min = new Date(typeof params.min === "function" ? params.min() : params.min);
+
+ if(current < +min) {
+ picker.setValue(lastValidValues);
+ valid = false;
+ }
+ }
+ if(params.max) {
+ var max = new Date(typeof params.max === "function" ? params.max() : params.max);
+ if(current > +max) {
+ picker.setValue(lastValidValues);
+ valid = false;
+ }
+ }
+
+ valid && (lastValidValues = values);
+
+ if (self.params.onChange) {
+ self.params.onChange.apply(this, arguments);
+ }
+ },
+
+ formatValue: function (p, values, displayValues) {
+ return self.params.format(p, values, displayValues);
+ },
+
+ cols: [
+ {
+ values: this.initYears
+ },
+ {
+ divider: true, // 这是一个分隔符
+ content: params.yearSplit
+ },
+ {
+ values: this.initMonthes
+ },
+ {
+ divider: true, // 这是一个分隔符
+ content: params.monthSplit
+ },
+ {
+ values: (function () {
+ var dates = [];
+ for (var i=1; i<=31; i++) dates.push(formatNumber(i));
+ return dates;
+ })()
+ },
+
+ ]
+ }
+
+ if (params.dateSplit) {
+ config.cols.push({
+ divider: true,
+ content: params.dateSplit
+ })
+ }
+
+ config.cols.push({
+ divider: true,
+ content: params.datetimeSplit
+ })
+
+ var times = self.params.times();
+ if (times && times.length) {
+ config.cols = config.cols.concat(times);
+ }
+
+ var inputValue = this.input.val();
+ if(inputValue) config.value = params.parse(inputValue);
+ if(this.params.value) {
+ this.input.val(this.params.value);
+ config.value = params.parse(this.params.value);
+ }
+
+ return config;
+ }
+ }
+
+ $.fn.datetimePicker = function(params) {
+ params = $.extend({}, defaults, params);
+ return this.each(function() {
+ if(!this) return;
+ var $this = $(this);
+ var datetime = $this.data("datetime");
+ if(!datetime) $this.data("datetime", new Datetime(this, params));
+ return datetime;
+ });
+ };
+
+ defaults = $.fn.datetimePicker.prototype.defaults = {
+ input: undefined, // 默认值
+ min: undefined, // YYYY-MM-DD 最大最小值只比较年月日,不比较时分秒
+ max: undefined, // YYYY-MM-DD
+ yearSplit: '-',
+ monthSplit: '-',
+ dateSplit: '', // 默认为空
+ datetimeSplit: ' ', // 日期和时间之间的分隔符,不可为空
+ monthes: ('01 02 03 04 05 06 07 08 09 10 11 12').split(' '),
+ years: (function () {
+ var arr = [];
+ for (var i = 1950; i <= 2030; i++) { arr.push(i); }
+ return arr;
+ })(),
+ times: function () {
+ return [ // 自定义的时间
+ {
+ values: (function () {
+ var hours = [];
+ for (var i=0; i<24; i++) hours.push(formatNumber(i));
+ return hours;
+ })()
+ },
+ {
+ divider: true, // 这是一个分隔符
+ content: ':'
+ },
+ {
+ values: (function () {
+ var minutes = [];
+ for (var i=0; i<60; i++) minutes.push(formatNumber(i));
+ return minutes;
+ })()
+ }
+ ];
+ },
+ format: function (p, values) { // 数组转换成字符串
+ return p.cols.map(function (col) {
+ return col.value || col.content;
+ }).join('');
+ },
+ parse: function (str) {
+ // 把字符串转换成数组,用来解析初始值
+ // 如果你的定制的初始值格式无法被这个默认函数解析,请自定义这个函数。比如你的时间是 '子时' 那么默认情况这个'时'会被当做分隔符而导致错误,所以你需要自己定义parse函数
+ // 默认兼容的分隔符
+ var t = str.split(this.datetimeSplit);
+ return t[0].split(/\D/).concat(t[1].split(/:|时|分|秒/)).filter(function (d) {
+ return !!d;
+ })
+ }
+ }
+
+}($);
+
+/*======================================================
+************ Picker ************
+======================================================*/
+/* global $:true */
+
++ function($) {
+ "use strict";
+
+
+ //Popup 和 picker 之类的不要共用一个弹出方法,因为这样会导致 在 popup 中再弹出 picker 的时候会有问题。
+
+ $.openPopup = function(popup, className) {
+
+ $.closePopup();
+
+ popup = $(popup);
+ popup.show();
+ popup.width();
+ popup.addClass("weui-popup__container--visible");
+ var modal = popup.find(".weui-popup__modal");
+ modal.width();
+ modal.transitionEnd(function() {
+ modal.trigger("open");
+ });
+ }
+
+
+ $.closePopup = function(container, remove) {
+ container = $(container || ".weui-popup__container--visible");
+ container.find('.weui-popup__modal').transitionEnd(function() {
+ var $this = $(this);
+ $this.trigger("close");
+ container.hide();
+ remove && container.remove();
+ })
+ container.removeClass("weui-popup__container--visible")
+ };
+
+
+ $(document).on("click", ".close-popup, .weui-popup__overlay", function() {
+ $.closePopup();
+ })
+ .on("click", ".open-popup", function() {
+ $($(this).data("target")).popup();
+ })
+ .on("click", ".weui-popup__container", function(e) {
+ if($(e.target).hasClass("weui-popup__container")) $.closePopup();
+ })
+
+ $.fn.popup = function() {
+ return this.each(function() {
+ $.openPopup(this);
+ });
+ };
+
+}($);
+
+/* ===============================================================================
+************ Notification ************
+=============================================================================== */
+/* global $:true */
++function ($) {
+ "use strict";
+
+ var noti, defaults, timeout, start, diffX, diffY;
+
+ var touchStart = function(e) {
+ var p = $.getTouchPosition(e);
+ start = p;
+ diffX = diffY = 0;
+ noti.addClass("touching");
+ };
+ var touchMove = function(e) {
+ if(!start) return false;
+ e.preventDefault();
+ e.stopPropagation();
+ var p = $.getTouchPosition(e);
+ diffX = p.x - start.x;
+ diffY = p.y - start.y;
+ if(diffY > 0) {
+ diffY = Math.sqrt(diffY);
+ }
+
+ noti.css("transform", "translate3d(0, "+diffY+"px, 0)");
+ };
+ var touchEnd = function() {
+ noti.removeClass("touching");
+ noti.attr("style", "");
+ if(diffY < 0 && (Math.abs(diffY) > noti.height()*0.38)) {
+ $.closeNotification();
+ }
+
+ if(Math.abs(diffX) <= 1 && Math.abs(diffY) <= 1) {
+ noti.trigger("noti-click");
+ }
+
+ start = false;
+ };
+
+ var attachEvents = function(el) {
+ el.on($.touchEvents.start, touchStart);
+ el.on($.touchEvents.move, touchMove);
+ el.on($.touchEvents.end, touchEnd);
+ };
+
+ $.notification = $.noti = function(params) {
+ params = $.extend({}, defaults, params);
+ noti = $(".weui-notification");
+ if(!noti[0]) { // create a new notification
+ noti = $('
').appendTo(document.body);
+ attachEvents(noti);
+ }
+
+ noti.off("noti-click"); //the click event is not correct sometime: it will trigger when user is draging.
+ if(params.onClick) noti.on("noti-click", function() {
+ params.onClick(params.data);
+ });
+
+ noti.html($.t7.compile(params.tpl)(params));
+
+ noti.show();
+
+ noti.addClass("weui-notification--in");
+ noti.data("params", params);
+
+ var startTimeout = function() {
+ if(timeout) {
+ clearTimeout(timeout);
+ timeout = null;
+ }
+
+ timeout = setTimeout(function() {
+ if(noti.hasClass("weui-notification--touching")) {
+ startTimeout();
+ } else {
+ $.closeNotification();
+ }
+ }, params.time);
+ };
+
+ startTimeout();
+
+ };
+
+ $.closeNotification = function() {
+ timeout && clearTimeout(timeout);
+ timeout = null;
+ var noti = $(".weui-notification").removeClass("weui-notification--in").transitionEnd(function() {
+ $(this).remove();
+ });
+
+ if(noti[0]) {
+ var params = $(".weui-notification").data("params");
+ if(params && params.onClose) {
+ params.onClose(params.data);
+ }
+ }
+ };
+
+ defaults = $.noti.prototype.defaults = {
+ title: undefined,
+ text: undefined,
+ media: undefined,
+ time: 4000,
+ onClick: undefined,
+ onClose: undefined,
+ data: undefined,
+ tpl: '' +
+ '{{#if media}}
{{media}}
{{/if}}' +
+ '
' +
+ '{{#if title}}
{{title}}
{{/if}}' +
+ '{{#if text}}
{{text}}
{{/if}}' +
+ '
' +
+ '
' +
+ '
'
+ };
+
+}($);
+
++ function($) {
+ "use strict";
+
+ var timeout;
+
+ $.toptip = function(text, duration, type) {
+ if(!text) return;
+ if(typeof duration === typeof "a") {
+ type = duration;
+ duration = undefined;
+ }
+ duration = duration || 3000;
+ var className = type ? 'bg-' + type : 'bg-danger';
+ var $t = $('.weui-toptips').remove();
+ $t = $('
').appendTo(document.body);
+ $t.html(text);
+ $t[0].className = 'weui-toptips ' + className
+
+ clearTimeout(timeout);
+
+ if(!$t.hasClass('weui-toptips_visible')) {
+ $t.show().width();
+ $t.addClass('weui-toptips_visible');
+ }
+
+ timeout = setTimeout(function() {
+ $t.removeClass('weui-toptips_visible').transitionEnd(function() {
+ $t.remove();
+ });
+ }, duration);
+ }
+}($);
+
+/* global $:true */
++ function($) {
+ "use strict";
+ var Slider = function (container, arg) {
+ this.container = $(container);
+ this.handler = this.container.find('.weui-slider__handler')
+ this.track = this.container.find('.weui-slider__track')
+ this.value = this.container.find('.weui-slider-box__value')
+ this.bind()
+ if (typeof arg === 'function') {
+ this.callback = arg
+ }
+ }
+
+ Slider.prototype.bind = function () {
+ this.container
+ .on($.touchEvents.start, $.proxy(this.touchStart, this))
+ .on($.touchEvents.end, $.proxy(this.touchEnd, this));
+ $(document.body).on($.touchEvents.move, $.proxy(this.touchMove, this)) // move even outside container
+ }
+
+ Slider.prototype.touchStart = function (e) {
+ e.preventDefault()
+ this.start = $.getTouchPosition(e)
+ this.width = this.container.find('.weui-slider__inner').width()
+ this.left = parseInt(this.container.find('.weui-slider__handler').css('left'))
+ this.touching = true
+ }
+
+ Slider.prototype.touchMove = function (e) {
+ if (!this.touching) return true
+ var p = $.getTouchPosition(e)
+ var distance = p.x - this.start.x
+ var left = distance + this.left
+ var per = parseInt(left / this.width * 100)
+ if (per < 0) per = 0
+ if (per > 100) per = 100
+ this.handler.css('left', per + '%')
+ this.track.css('width', per + '%')
+ this.value.text(per)
+ this.callback && this.callback.call(this, per)
+ this.container.trigger('change', per)
+ }
+
+ Slider.prototype.touchEnd = function (e) {
+ this.touching = false
+ }
+
+ $.fn.slider = function (arg) {
+ this.each(function () {
+ var $this = $(this)
+ var slider = $this.data('slider')
+ if (slider) return slider;
+ else $this.data('slider', new Slider(this, arg))
+ })
+ }
+}($);
+
+/* ===============================================================================
+************ Swipeout ************
+=============================================================================== */
+/* global $:true */
+
++function ($) {
+ "use strict";
+
+ var cache = [];
+ var TOUCHING = 'swipeout-touching'
+
+ var Swipeout = function(el) {
+ this.container = $(el);
+ this.mover = this.container.find('>.weui-cell__bd')
+ this.attachEvents();
+ cache.push(this)
+ }
+
+ Swipeout.prototype.touchStart = function(e) {
+ var p = $.getTouchPosition(e);
+ this.container.addClass(TOUCHING);
+ this.start = p;
+ this.startX = 0;
+ this.startTime = + new Date;
+ var transform = this.mover.css('transform').match(/-?[\d\.]+/g)
+ if (transform && transform.length) this.startX = parseInt(transform[4])
+ this.diffX = this.diffY = 0;
+ this._closeOthers()
+ this.limit = this.container.find('>.weui-cell__ft').width() || 68; // 因为有的时候初始化的时候元素是隐藏的(比如在对话框内),所以在touchstart的时候计算宽度而不是初始化的时候
+ };
+
+ Swipeout.prototype.touchMove= function(e) {
+ if(!this.start) return true;
+ var p = $.getTouchPosition(e);
+ this.diffX = p.x - this.start.x;
+ this.diffY = p.y - this.start.y;
+ if (Math.abs(this.diffX) < Math.abs(this.diffY)) { // 说明是上下方向在拖动
+ this.close()
+ this.start = false
+ return true;
+ }
+ e.preventDefault();
+ e.stopPropagation();
+ var x = this.diffX + this.startX
+ if (x > 0) x = 0;
+ if (Math.abs(x) > this.limit) x = - (Math.pow(-(x+this.limit), .7) + this.limit)
+ this.mover.css("transform", "translate3d("+x+"px, 0, 0)");
+ };
+ Swipeout.prototype.touchEnd = function() {
+ if (!this.start) return true;
+ this.start = false;
+ var x = this.diffX + this.startX
+ var t = new Date - this.startTime;
+ if (this.diffX < -5 && t < 200) { // 向左快速滑动,则打开
+ this.open()
+ } else if (this.diffX >= 0 && t < 200) { // 向右快速滑动,或者单击,则关闭
+ this.close()
+ } else if (x > 0 || -x <= this.limit / 2) {
+ this.close()
+ } else {
+ this.open()
+ }
+ };
+
+
+ Swipeout.prototype.close = function() {
+ this.container.removeClass(TOUCHING);
+ this.mover.css("transform", "translate3d(0, 0, 0)");
+ this.container.trigger('swipeout-close');
+ }
+
+ Swipeout.prototype.open = function() {
+ this.container.removeClass(TOUCHING);
+ this._closeOthers()
+ this.mover.css("transform", "translate3d(" + (-this.limit) + "px, 0, 0)");
+ this.container.trigger('swipeout-open');
+ }
+
+ Swipeout.prototype.attachEvents = function() {
+ var el = this.mover;
+ el.on($.touchEvents.start, $.proxy(this.touchStart, this));
+ el.on($.touchEvents.move, $.proxy(this.touchMove, this));
+ el.on($.touchEvents.end, $.proxy(this.touchEnd, this));
+ }
+ Swipeout.prototype._closeOthers = function() {
+ //close others
+ var self = this
+ cache.forEach(function (s) {
+ if (s !== self) s.close()
+ })
+ }
+
+ var swipeout = function(el) {
+ return new Swipeout(el);
+ };
+
+ $.fn.swipeout = function (arg) {
+ return this.each(function() {
+ var $this = $(this)
+ var s = $this.data('swipeout') || swipeout(this);
+ $this.data('swipeout', s);
+
+ if (typeof arg === typeof 'a') {
+ s[arg]()
+ }
+ });
+ }
+
+ $('.weui-cell_swiped').swipeout() // auto init
+}($);
diff --git a/static/jquery_weui/js/jquery-weui.min.js b/static/jquery_weui/js/jquery-weui.min.js
new file mode 100644
index 0000000..a52e512
--- /dev/null
+++ b/static/jquery_weui/js/jquery-weui.min.js
@@ -0,0 +1,13 @@
+/**
+* jQuery WeUI V1.2.0
+* By 言川
+* http://lihongxun945.github.io/jquery-weui/
+ */
+!function(t){"use strict";t.fn.transitionEnd=function(t){function e(r){if(r.target===this)for(t.call(this,r),n=0;n=0){e=i,r.push(o);break}e&&(n=e)}else if(o.indexOf("=")>0){var s=o.split("="),c=s[0],l=s[1];if(2!==l.match(/"/g).length){for(e=0,i=n+1;i=0){e=i;break}e&&(n=e)}var u=[c,l.replace(/"/g,"")];r.push(u)}else r.push(o)}return r}function i(e){var i,a,r=[];if(!e)return[];var o=e.split(/({{[^{^}]*}})/);for(i=0;i=0)continue;if(s.indexOf("{#")<0&&s.indexOf(" ")<0&&s.indexOf("else")<0){r.push({type:"variable",contextName:s.replace(/[{}]/g,"")});continue}var c=n(s),l=c[0],u=[],p={};for(a=1;a=0){var d,f="",m="",v=0,g=!1,w=!1,y=0;for(a=i+1;a=0&&y++,o[a].indexOf("{{/")>=0&&y--,o[a].indexOf("{{#"+l)>=0)f+=o[a],w&&(m+=o[a]),v++;else if(o[a].indexOf("{{/"+l)>=0){if(!(v>0)){d=a,g=!0;break}v--,f+=o[a],w&&(m+=o[a])}else o[a].indexOf("else")>=0&&0===y?w=!0:(w||(f+=o[a]),w&&(m+=o[a]));g&&(d&&(i=d),r.push({type:"helper",helperName:l,contextName:u,content:f,inverseContent:m,hash:p}))}else s.indexOf(" ")>0&&r.push({type:"helper",helperName:l,contextName:u,hash:p})}}return r}var a=function(t){function e(t,e){return t.content?o(t.content,e):function(){return""}}function n(t,e){return t.inverseContent?o(t.inverseContent,e):function(){return""}}function a(t,e){var n,i,a=0;if(0===t.indexOf("../")){a=t.split("../").length-1;var r=e.split("_")[1]-a;e="ctx_"+(r>=1?r:1),i=t.split("../")[a].split(".")}else 0===t.indexOf("@global")?(e="$.Template7.global",i=t.split("@global.")[1].split(".")):0===t.indexOf("@root")?(e="ctx_1",i=t.split("@root.")[1].split(".")):i=t.split(".");n=e;for(var o=0;o0?n+="[(data && data."+s.replace("@","")+")]":n="(data && data."+t.replace("@","")+")":isFinite(s)?n+="["+s+"]":0===s.indexOf("this")?n=s.replace("this",e):n+="."+s}return n}function r(t,e){for(var n=[],i=0;i0)throw new Error('Template7: Missing helper: "'+h.helperName+'"');d=a(h.helperName,l),u+="if ("+d+") {",u+="if (isArray("+d+")) {",u+="r += ($.Template7.helpers.each).call("+l+", "+d+", {hash:"+JSON.stringify(h.hash)+", data: data || {}, fn: "+e(h,o+1)+", inverse: "+n(h,o+1)+", root: ctx_1});",u+="}else {",u+="r += ($.Template7.helpers.with).call("+l+", "+d+", {hash:"+JSON.stringify(h.hash)+", data: data || {}, fn: "+e(h,o+1)+", inverse: "+n(h,o+1)+", root: ctx_1});",u+="}}"}}else u+="r +='"+h.content.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/'/g,"\\'")+"';"}return u+="\nreturn r;})",eval.call(window,u)}var s=this;s.template=t,s.compile=function(t){return s.compiled||(s.compiled=o(t)),s.compiled}};a.prototype={options:{},helpers:{"if":function(t,n){return e(t)&&(t=t.call(this)),t?n.fn(this,n.data):n.inverse(this,n.data)},unless:function(t,n){return e(t)&&(t=t.call(this)),t?n.inverse(this,n.data):n.fn(this,n.data)},each:function(n,i){var a="",r=0;if(e(n)&&(n=n.call(this)),t(n)){for(i.hash.reverse&&(n=n.reverse()),r=0;r0?a:i.inverse(this)},"with":function(t,n){return e(t)&&(t=t.call(this)),n.fn(t)},join:function(t,n){return e(t)&&(t=t.call(this)),t.join(n.hash.delimiter||n.hash.delimeter)},js:function(t,e){var n;return n=t.indexOf("return")>=0?"(function(){"+t+"})":"(function(){return ("+t+")})",eval.call(this,n).call(this)},js_compare:function(t,e){var n;n=t.indexOf("return")>=0?"(function(){"+t+"})":"(function(){return ("+t+")})";var i=eval.call(this,n).call(this);return i?e.fn(this,e.data):e.inverse(this,e.data)}}};var r=function(t,e){if(2===arguments.length){var n=new a(t),i=n.compile()(e);return n=null,i}return new a(t)};return r.registerHelper=function(t,e){a.prototype.helpers[t]=e},r.unregisterHelper=function(t){a.prototype.helpers[t]=void 0,delete a.prototype.helpers[t]},r.compile=function(t,e){var n=new a(t,e);return n.compile()},r.options=a.prototype.options,r.helpers=a.prototype.helpers,r}()}($),/*! Hammer.JS - v2.0.8 - 2016-04-23
+ * http://hammerjs.github.io/
+ *
+ * Copyright (c) 2016 Jorik Tangelder;
+ * Licensed under the MIT license */
+function(t,e,n,i){"use strict";function a(t,e,n){return setTimeout(l(t,n),e)}function r(t,e,n){return Array.isArray(t)?(o(t,n[e],n),!0):!1}function o(t,e,n){var a;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==i)for(a=0;a\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=t.console&&(t.console.warn||t.console.log);return r&&r.call(t.console,a,i),e.apply(this,arguments)}}function c(t,e,n){var i,a=e.prototype;i=t.prototype=Object.create(a),i.constructor=t,i._super=a,n&&pt(i,n)}function l(t,e){return function(){return t.apply(e,arguments)}}function u(t,e){return typeof t==ft?t.apply(e?e[0]||i:i,e):t}function p(t,e){return t===i?e:t}function h(t,e,n){o(v(e),function(e){t.addEventListener(e,n,!1)})}function d(t,e,n){o(v(e),function(e){t.removeEventListener(e,n,!1)})}function f(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function m(t,e){return t.indexOf(e)>-1}function v(t){return t.trim().split(/\s+/g)}function g(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function T(t,e){for(var n,a,r=e[0].toUpperCase()+e.slice(1),o=0;o1&&!n.firstMultiple?n.firstMultiple=P(e):1===a&&(n.firstMultiple=!1);var r=n.firstInput,o=n.firstMultiple,s=o?o.center:r.center,c=e.center=O(i);e.timeStamp=gt(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=S(s,c),e.distance=H(s,c),E(n,e),e.offsetDirection=I(e.deltaX,e.deltaY);var l=A(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=l.x,e.overallVelocityY=l.y,e.overallVelocity=vt(l.x)>vt(l.y)?l.x:l.y,e.scale=o?V(o.pointers,i):1,e.rotation=o?Y(o.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,D(n,e);var u=t.element;f(e.srcEvent.target,u)&&(u=e.srcEvent.target),e.target=u}function E(t,e){var n=e.center,i=t.offsetDelta||{},a=t.prevDelta||{},r=t.prevInput||{};e.eventType!==Ot&&r.eventType!==It||(a=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=a.x+(n.x-i.x),e.deltaY=a.y+(n.y-i.y)}function D(t,e){var n,a,r,o,s=t.lastInterval||e,c=e.timeStamp-s.timeStamp;if(e.eventType!=Ht&&(c>Pt||s.velocity===i)){var l=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,p=A(c,l,u);a=p.x,r=p.y,n=vt(p.x)>vt(p.y)?p.x:p.y,o=I(l,u),t.lastInterval=e}else n=s.velocity,a=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=n,e.velocityX=a,e.velocityY=r,e.direction=o}function P(t){for(var e=[],n=0;na;)n+=t[a].clientX,i+=t[a].clientY,a++;return{x:mt(n/e),y:mt(i/e)}}function A(t,e,n){return{x:e/t||0,y:n/t||0}}function I(t,e){return t===e?St:vt(t)>=vt(e)?0>t?Yt:Vt:0>e?Nt:Ft}function H(t,e,n){n||(n=Lt);var i=e[n[0]]-t[n[0]],a=e[n[1]]-t[n[1]];return Math.sqrt(i*i+a*a)}function S(t,e,n){n||(n=Lt);var i=e[n[0]]-t[n[0]],a=e[n[1]]-t[n[1]];return 180*Math.atan2(a,i)/Math.PI}function Y(t,e){return S(e[1],e[0],jt)+S(t[1],t[0],jt)}function V(t,e){return H(e[0],e[1],jt)/H(t[0],t[1],jt)}function N(){this.evEl=$t,this.evWin=Wt,this.pressed=!1,C.apply(this,arguments)}function F(){this.evEl=Bt,this.evWin=Gt,C.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function R(){this.evTarget=Zt,this.evWin=Qt,this.started=!1,C.apply(this,arguments)}function q(t,e){var n=w(t.touches),i=w(t.changedTouches);return e&(It|Ht)&&(n=y(n.concat(i),"identifier",!0)),[n,i]}function z(){this.evTarget=ee,this.targetIds={},C.apply(this,arguments)}function L(t,e){var n=w(t.touches),i=this.targetIds;if(e&(Ot|At)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var a,r,o=w(t.changedTouches),s=[],c=this.target;if(r=n.filter(function(t){return f(t.target,c)}),e===Ot)for(a=0;a-1&&i.splice(t,1)};setTimeout(a,ne)}}function W(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i=r&&ie>=o)return!0}return!1}function K(t,e){this.manager=t,this.set(e)}function U(t){if(m(t,le))return le;var e=m(t,ue),n=m(t,pe);return e&&n?le:e||n?e?ue:pe:m(t,ce)?ce:se}function B(){if(!re)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){e[i]=n?t.CSS.supports("touch-action",i):!0}),e}function G(t){this.options=pt({},this.defaults,t||{}),this.id=k(),this.manager=null,this.options.enable=p(this.options.enable,!0),this.state=de,this.simultaneous={},this.requireFail=[]}function J(t){return t&we?"cancel":t&ve?"end":t&me?"move":t&fe?"start":""}function Z(t){return t==Ft?"down":t==Nt?"up":t==Yt?"left":t==Vt?"right":""}function Q(t,e){var n=e.manager;return n?n.get(t):t}function tt(){G.apply(this,arguments)}function et(){tt.apply(this,arguments),this.pX=null,this.pY=null}function nt(){tt.apply(this,arguments)}function it(){G.apply(this,arguments),this._timer=null,this._input=null}function at(){tt.apply(this,arguments)}function rt(){tt.apply(this,arguments)}function ot(){G.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function st(t,e){return e=e||{},e.recognizers=p(e.recognizers,st.defaults.preset),new ct(t,e)}function ct(t,e){this.options=pt({},st.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=b(this),this.touchAction=new K(this,this.options.touchAction),lt(this,!0),o(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function lt(t,e){var n=t.element;if(n.style){var i;o(t.options.cssProps,function(a,r){i=T(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=a):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={})}}function ut(t,n){var i=e.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=n,n.target.dispatchEvent(i)}var pt,ht=["","webkit","Moz","MS","ms","o"],dt=e.createElement("div"),ft="function",mt=Math.round,vt=Math.abs,gt=Date.now;pt="function"!=typeof Object.assign?function(t){if(t===i||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;ns&&(e.push(t),s=e.length-1):a&(It|Ht)&&(n=!0),0>s||(e[s]=t,this.callback(this.manager,a,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),n&&e.splice(s,1))}});var Jt={touchstart:Ot,touchmove:At,touchend:It,touchcancel:Ht},Zt="touchstart",Qt="touchstart touchmove touchend touchcancel";c(R,C,{handler:function(t){var e=Jt[t.type];if(e===Ot&&(this.started=!0),this.started){var n=q.call(this,t,e);e&(It|Ht)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Mt,srcEvent:t})}}});var te={touchstart:Ot,touchmove:At,touchend:It,touchcancel:Ht},ee="touchstart touchmove touchend touchcancel";c(z,C,{handler:function(t){var e=te[t.type],n=L.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:Mt,srcEvent:t})}});var ne=2500,ie=25;c(j,C,{handler:function(t,e,n){var i=n.pointerType==Mt,a=n.pointerType==Et;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)X.call(this,e,n);else if(a&&W.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ae=T(dt.style,"touchAction"),re=ae!==i,oe="compute",se="auto",ce="manipulation",le="none",ue="pan-x",pe="pan-y",he=B();K.prototype={set:function(t){t==oe&&(t=this.compute()),re&&this.manager.element.style&&he[t]&&(this.manager.element.style[ae]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return o(this.manager.recognizers,function(e){u(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),U(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var i=this.actions,a=m(i,le)&&!he[le],r=m(i,pe)&&!he[pe],o=m(i,ue)&&!he[ue];if(a){var s=1===t.pointers.length,c=t.distance<2,l=t.deltaTime<250;if(s&&c&&l)return}return o&&r?void 0:a||r&&n&Rt||o&&n&qt?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var de=1,fe=2,me=4,ve=8,ge=ve,we=16,ye=32;G.prototype={defaults:{},set:function(t){return pt(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(r(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=Q(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return r(t,"dropRecognizeWith",this)?this:(t=Q(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(r(t,"requireFailure",this))return this;var e=this.requireFail;return t=Q(t,this),-1===g(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(r(t,"dropRequireFailure",this))return this;t=Q(t,this);var e=g(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;ve>i&&e(n.options.event+J(i)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),i>=ve&&e(n.options.event+J(i))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=ye)},canEmit:function(){for(var t=0;tr?Yt:Vt,n=r!=this.pX,i=Math.abs(t.deltaX)):(a=0===o?St:0>o?Nt:Ft,n=o!=this.pY,i=Math.abs(t.deltaY))),t.direction=a,n&&i>e.threshold&&a&e.direction},attrTest:function(t){return tt.prototype.attrTest.call(this,t)&&(this.state&fe||!(this.state&fe)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Z(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(nt,tt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[le]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&fe)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(it,G,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[se]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||t.eventType&(It|Ht)&&!r)this.reset();else if(t.eventType&Ot)this.reset(),this._timer=a(function(){this.state=ge,this.tryEmit()},e.time,this);else if(t.eventType&It)return ge;return ye},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ge&&(t&&t.eventType&It?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=gt(),this.manager.emit(this.options.event,this._input)))}}),c(at,tt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[le]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&fe)}}),c(rt,tt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|qt,pointers:1},getTouchAction:function(){return et.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Rt|qt)?e=t.overallVelocity:n&Rt?e=t.overallVelocityX:n&qt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&vt(e)>this.options.velocity&&t.eventType&It},emit:function(t){var e=Z(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(ot,G,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance'+t.text+""}).join(""),o=''+n.title+"
"+(n.text?'
'+n.text+"
":"")+'
'+r+"
",s=t.openModal(o,i);return s.find(".weui-dialog__btn").each(function(e,i){var r=t(i);r.click(function(){n.autoClose&&t.closeModal(),a[e].onClick&&a[e].onClick.call(s)})}),s},t.openModal=function(e,n){var i=t("
").appendTo(document.body);i.show();var a=t(e).appendTo(document.body);return n&&a.transitionEnd(function(){n.call(a)}),a.show(),i.addClass("weui-mask--visible"),a.addClass("weui-dialog--visible"),a},t.closeModal=function(){t(".weui-mask--visible").removeClass("weui-mask--visible").transitionEnd(function(){t(this).remove()}),t(".weui-dialog--visible").removeClass("weui-dialog--visible").transitionEnd(function(){t(this).remove()})},t.alert=function(n,i,a){var r;return"object"==typeof n?r=n:("function"==typeof i&&(a=arguments[1],i=void 0),r={text:n,title:i,onOK:a}),t.modal({text:r.text,title:r.title,buttons:[{text:e.buttonOK,className:"primary",onClick:r.onOK}]})},t.confirm=function(n,i,a,r){var o;return"object"==typeof n?o=n:("function"==typeof i&&(r=arguments[2],a=arguments[1],i=void 0),o={text:n,title:i,onOK:a,onCancel:r}),t.modal({text:o.text,title:o.title,buttons:[{text:e.buttonCancel,className:"default",onClick:o.onCancel},{text:e.buttonOK,className:"primary",onClick:o.onOK}]})},t.prompt=function(n,i,a,r,o){var s;"object"==typeof n?s=n:("function"==typeof i&&(o=arguments[3],r=arguments[2],a=arguments[1],i=void 0),s={text:n,title:i,input:o,onOK:a,onCancel:r,empty:!1});var c=t.modal({text:''+(s.text||"")+'
',title:s.title,autoClose:!1,buttons:[{text:e.buttonCancel,className:"default",onClick:function(){t.closeModal(),s.onCancel&&s.onCancel.call(c)}},{text:e.buttonOK,className:"primary",onClick:function(){var e=t("#weui-prompt-input").val();return s.empty||""!==e&&null!==e?(t.closeModal(),void(s.onOK&&s.onOK.call(c,e))):(c.find(".weui-prompt-input").focus()[0].select(),!1)}}]},function(){this.find(".weui-prompt-input").focus()[0].select()});return c},t.login=function(n,i,a,r,o,s){var c;"object"==typeof n?c=n:("function"==typeof i&&(s=arguments[4],o=arguments[3],r=arguments[2],a=arguments[1],i=void 0),c={text:n,title:i,username:o,password:s,onOK:a,onCancel:r});var l=t.modal({text:''+(c.text||"")+'
',title:c.title,autoClose:!1,buttons:[{text:e.buttonCancel,className:"default",onClick:function(){t.closeModal(),c.onCancel&&c.onCancel.call(l)}},{text:e.buttonOK,className:"primary",onClick:function(){var e=t("#weui-prompt-username").val(),n=t("#weui-prompt-password").val();return c.empty||""!==e&&null!==e?c.empty||""!==n&&null!==n?(t.closeModal(),void(c.onOK&&c.onOK.call(l,e,n))):(l.find("#weui-prompt-password").focus()[0].select(),!1):(l.find("#weui-prompt-username").focus()[0].select(),!1)}}]},function(){this.find("#weui-prompt-username").focus()[0].select()});return l},e=t.modal.prototype.defaults={title:"提示",text:void 0,buttonOK:"确定",buttonCancel:"取消",buttons:[{text:"确定",className:"primary"}],autoClose:!0}}($),+function(t){"use strict";var e=function(e,n){n=n||"";var i=(t("
").appendTo(document.body),''+e+"
"),a=t(i).appendTo(document.body);a.addClass("weui-toast--visible"),a.show()},n=function(e){t(".weui-mask_transparent").remove(),t(".weui-toast--visible").removeClass("weui-toast--visible").transitionEnd(function(){var n=t(this);n.remove(),e&&e(n)})};t.toast=function(t,a,r){"function"==typeof a&&(r=a);var o,s="weui-icon-success-no-circle",c=i.duration;"cancel"==a?(o="weui-toast_cancel",s="weui-icon-cancel"):"forbidden"==a?(o="weui-toast--forbidden",s="weui-icon-warn"):"text"==a?o="weui-toast--text":"number"==typeof a&&(c=a),e(''+(t||"已经完成")+"
",o),setTimeout(function(){n(r)},c)},t.showLoading=function(t){var n='';n+=' ',n+="
",n+=''+(t||"数据加载中")+"
",e(n,"weui_loading_toast")},t.hideLoading=function(){n()};var i=t.toast.prototype.defaults={duration:2500}}($),+function(t){"use strict";var e,n=function(e){var n=t("
").appendTo(document.body),i=e.actions||[],a=i.map(function(t,e){return''+t.text+"
"}).join(""),r="";e.title&&(r='");var o='',s=t(o).appendTo(document.body);s.find(".weui-actionsheet__menu .weui-actionsheet__cell, .weui-actionsheet__action .weui-actionsheet__cell").each(function(n,a){t(a).click(function(){t.closeActions(),e.onClose&&e.onClose(),i[n]&&i[n].onClick&&i[n].onClick()})}),n.show(),s.show(),n.addClass("weui-mask--visible"),s.addClass("weui-actionsheet_toggle")},i=function(){t(".weui-mask").removeClass("weui-mask--visible").transitionEnd(function(){t(this).remove()}),t(".weui-actionsheet").removeClass("weui-actionsheet_toggle").transitionEnd(function(){t(this).remove()})};t.actions=function(i){i=t.extend({},e,i),n(i)},t.closeActions=function(){i()},t(document).on("click",".weui-actions_mask",function(){t.closeActions()});var e=t.actions.prototype.defaults={title:void 0,onClose:void 0}}($),+function(t){"use strict";var e=function(n,i){"function"==typeof i&&(i={onRefresh:i}),"string"==typeof i&&(i=void 0),this.opt=t.extend(e.defaults,i||{}),this.container=t(n),this.attachEvents()};e.defaults={distance:50,onRefresh:void 0,onPull:void 0},e.prototype.touchStart=function(e){if(!this.container.hasClass("refreshing")){var n=t.getTouchPosition(e);this.start=n,this.diffX=this.diffY=0}},e.prototype.touchMove=function(e){if(!this.container.hasClass("refreshing")){if(!this.start)return!1;if(!(this.container.scrollTop()>0)){var n=t.getTouchPosition(e);return this.diffX=n.x-this.start.x,this.diffY=n.y-this.start.y,Math.abs(this.diffX)>Math.abs(this.diffY)?!0:void(this.diffY<0||(this.container.addClass("touching"),e.preventDefault(),e.stopPropagation(),this.diffY=Math.pow(this.diffY,.75),this.container.css("transform","translate3d(0, "+this.diffY+"px, 0)"),this.triggerPull(this.diffY)))}}},e.prototype.touchEnd=function(){this.start=!1,this.diffY<=0||this.container.hasClass("refreshing")||(this.container.removeClass("touching"),this.container.removeClass("pull-down pull-up"),this.container.css("transform",""),Math.abs(this.diffY)<=this.opt.distance||this.triggerPullToRefresh())},e.prototype.triggerPullToRefresh=function(){this.triggerPull(this.opt.distance),this.container.removeClass("pull-up").addClass("refreshing"),this.opt.onRefresh&&this.opt.onRefresh.call(this),this.container.trigger("pull-to-refresh")},e.prototype.triggerPull=function(t){t=0),(a||o||r)&&(e.os="ios",e.ios=!0),o&&!r&&(e.osVersion=o[2].replace(/_/g,"."),e.iphone=!0),a&&(e.osVersion=a[2].replace(/_/g,"."),e.ipad=!0),r&&(e.osVersion=r[3]?r[3].replace(/_/g,"."):null,e.iphone=!0),e.ios&&e.osVersion&&n.indexOf("Version/")>=0&&"10"===e.osVersion.split(".")[0]&&(e.osVersion=n.toLowerCase().split("version/")[1].split(" ")[0]),e.webView=(o||a||r)&&n.match(/.*AppleWebKit(?!.*Safari)/i),
+e.os&&"ios"===e.os){var s=e.osVersion.split(".");e.minimalUi=!e.webView&&(r||o)&&(1*s[0]===7?1*s[1]>=1:1*s[0]>7)&&t('meta[name="viewport"]').length>0&&t('meta[name="viewport"]').attr("content").indexOf("minimal-ui")>=0}var c=t(window).width(),l=t(window).height();e.statusBar=!1,e.webView&&c*l===screen.width*screen.height?e.statusBar=!0:e.statusBar=!1;var u=[];if(e.pixelRatio=window.devicePixelRatio||1,u.push("pixel-ratio-"+Math.floor(e.pixelRatio)),e.pixelRatio>=2&&u.push("retina"),e.os&&(u.push(e.os,e.os+"-"+e.osVersion.split(".")[0],e.os+"-"+e.osVersion.replace(/\./g,"-")),"ios"===e.os))for(var p=parseInt(e.osVersion.split(".")[0],10),h=p-1;h>=6;h--)u.push("ios-gt-"+h);e.statusBar?u.push("with-statusbar-overlay"):t("html").removeClass("with-statusbar-overlay"),u.length>0&&t("html").addClass(u.join(" ")),t.device=e}($),+function(t){"use strict";var e=function(e){function n(){var e=!1;return c.params.convertToPopover||c.params.onlyInPopover?(!c.inline&&c.params.input&&(c.params.onlyInPopover?e=!0:t.device.ios?e=!!t.device.ipad:t(window).width()>=768&&(e=!0)),e):e}function i(){return!!(c.opened&&c.container&&c.container.length>0&&c.container.parents(".popover").length>0)}function a(){if(c.opened)for(var t=0;to){var u=e.scrollTop()+l-o;u+o>s&&(i=u+o-s+r,o===s&&(i=c.container.height()),e.css({"padding-bottom":i+"px"})),e.scrollTop(u,300)}}}function o(e){i()||(c.input&&c.input.length>0?e.target!==c.input[0]&&0===t(e.target).parents(".weui-picker-modal").length&&c.close():0===t(e.target).parents(".weui-picker-modal").length&&c.close())}function s(){c.opened=!1,c.input&&c.input.length>0&&c.input.parents(".page-content").css({"padding-bottom":""}),c.params.onClose&&c.params.onClose(c),c.container.find(".picker-items-col").each(function(){c.destroyPickerCol(this)})}var c=this,l={updateValuesOnMomentum:!1,updateValuesOnTouchmove:!0,rotateEffect:!1,momentumRatio:7,freeMode:!1,scrollToInput:!0,inputReadOnly:!0,toolbar:!0,toolbarCloseText:"完成",title:"请选择",toolbarTemplate:''};e=e||{};for(var u in l)"undefined"==typeof e[u]&&(e[u]=l[u]);c.params=e,c.cols=[],c.initialized=!1,c.inline=!!c.params.container;var p=t.device.ios||navigator.userAgent.toLowerCase().indexOf("safari")>=0&&navigator.userAgent.toLowerCase().indexOf("chrome")<0&&!t.device.android;return c.setValue=function(t,e){for(var n=0,i=0;i=0||(c.value=e,c.displayValue=n,c.params.onChange&&c.params.onChange(c,c.value,c.displayValue),c.input&&c.input.length>0&&(t(c.input).val(c.params.formatValue?c.params.formatValue(c,c.value,c.displayValue):c.value.join(" ")),t(c.input).trigger("change")))},c.initPickerCol=function(e,n){function i(){w=t.requestAnimationFrame(function(){h.updateItems(void 0,void 0,0),i()})}function a(e){if(!T&&!y){e.preventDefault(),y=!0;var n=t.getTouchPosition(e);k=x=n.y,C=(new Date).getTime(),A=!0,M=E=t.getTranslate(h.wrapper[0],"y")}}function r(e){if(y){e.preventDefault(),A=!1;var n=t.getTouchPosition(e);x=n.y,T||(t.cancelAnimationFrame(w),T=!0,M=E=t.getTranslate(h.wrapper[0],"y"),h.wrapper.transition(0)),e.preventDefault();var i=x-k;E=M+i,_=void 0,v>E&&(E=v-Math.pow(v-E,.8),_="min"),E>g&&(E=g+Math.pow(E-g,.8),_="max"),h.wrapper.transform("translate3d(0,"+E+"px,0)"),h.updateItems(void 0,E,0,c.params.updateValuesOnTouchmove),P=E-D||E,O=(new Date).getTime(),D=E}}function o(e){if(!y||!T)return void(y=T=!1);y=T=!1,h.wrapper.transition(""),_&&("min"===_?h.wrapper.transform("translate3d(0,"+v+"px,0)"):h.wrapper.transform("translate3d(0,"+g+"px,0)")),b=(new Date).getTime();var n,a;b-C>300?a=E:(n=Math.abs(P/(b-O)),a=E+P*c.params.momentumRatio),a=Math.max(Math.min(a,g),v);var r=-Math.floor((a-g)/f);c.params.freeMode||(a=-r*f+g),h.wrapper.transform("translate3d(0,"+parseInt(a,10)+"px,0)"),h.updateItems(r,a,"",!0),c.params.updateValuesOnMomentum&&(i(),h.wrapper.transitionEnd(function(){t.cancelAnimationFrame(w)})),setTimeout(function(){A=!0},100)}function s(e){if(A){t.cancelAnimationFrame(w);var n=t(this).attr("data-picker-value");h.setValue(n)}}var l=t(e),u=l.index(),h=c.cols[u];if(!h.divider){h.container=l,h.wrapper=h.container.find(".picker-items-col-wrapper"),h.items=h.wrapper.find(".picker-item");var d,f,m,v,g;h.replaceValues=function(t,e){h.destroyEvents(),h.values=t,h.displayValues=e;var n=c.columnHTML(h,!0);h.wrapper.html(n),h.items=h.wrapper.find(".picker-item"),h.calcSize(),h.setValue(h.values[0]||"",0,!0),h.initEvents()},h.calcSize=function(){if(h.values.length){c.params.rotateEffect&&(h.container.removeClass("picker-items-col-absolute"),h.width||h.container.css({width:""}));var e,n;e=0,n=h.container[0].offsetHeight,d=h.wrapper[0].offsetHeight,f=h.items[0].offsetHeight,m=f*h.items.length,v=n/2-m+f/2,g=n/2-f/2,h.width&&(e=h.width,parseInt(e,10)===e&&(e+="px"),h.container.css({width:e})),c.params.rotateEffect&&(h.width||(h.items.each(function(){var n=t(this);n.css({width:"auto"}),e=Math.max(e,n[0].offsetWidth),n.css({width:""})}),h.container.css({width:e+2+"px"})),h.container.addClass("picker-items-col-absolute"))}},h.calcSize(),h.wrapper.transform("translate3d(0,"+g+"px,0)").transition(0);var w;h.setValue=function(e,n,a){"undefined"==typeof n&&(n="");var r=h.wrapper.find('.picker-item[data-picker-value="'+e+'"]').index();if("undefined"==typeof r||-1===r)return void(h.value=h.displayValue=e);var o=-r*f+g;h.wrapper.transition(n),h.wrapper.transform("translate3d(0,"+o+"px,0)"),c.params.updateValuesOnMomentum&&h.activeIndex&&h.activeIndex!==r&&(t.cancelAnimationFrame(w),h.wrapper.transitionEnd(function(){t.cancelAnimationFrame(w)}),i()),h.updateItems(r,o,n,a)},h.updateItems=function(e,n,i,a){"undefined"==typeof n&&(n=t.getTranslate(h.wrapper[0],"y")),"undefined"==typeof e&&(e=-Math.round((n-g)/f)),0>e&&(e=0),e>=h.items.length&&(e=h.items.length-1);var r=h.activeIndex;h.activeIndex=e,h.wrapper.find(".picker-selected").removeClass("picker-selected"),c.params.rotateEffect&&h.items.transition(i);var o=h.items.eq(e).addClass("picker-selected").transform("");if((a||"undefined"==typeof a)&&(h.value=o.attr("data-picker-value"),h.displayValue=h.displayValues?h.displayValues[e]:h.value,r!==e&&(h.onChange&&h.onChange(c,h.value,h.displayValue),c.updateValue())),c.params.rotateEffect){(n-(Math.floor((n-g)/f)*f+g))/f;h.items.each(function(){var e=t(this),i=e.index()*f,a=g-n,r=i-a,o=r/f,s=Math.ceil(h.height/f/2)+1,c=-18*o;c>180&&(c=180),-180>c&&(c=-180),Math.abs(o)>s?e.addClass("picker-item-far"):e.removeClass("picker-item-far"),e.transform("translate3d(0, "+(-n+g)+"px, "+(p?-110:0)+"px) rotateX("+c+"deg)")})}},n&&h.updateItems(0,g,0);var y,T,k,x,C,b,M,_,E,D,P,O,A=!0;h.initEvents=function(e){var n=e?"off":"on";h.container[n](t.touchEvents.start,a),h.container[n](t.touchEvents.move,r),h.container[n](t.touchEvents.end,o),h.items[n]("click",s)},h.destroyEvents=function(){h.initEvents(!0)},h.container[0].f7DestroyPickerCol=function(){h.destroyEvents()},h.initEvents()}},c.destroyPickerCol=function(e){e=t(e),"f7DestroyPickerCol"in e[0]&&e[0].f7DestroyPickerCol()},t(window).on("resize",a),c.columnHTML=function(t,e){var n="",i="";if(t.divider)i+=''+t.content+"
";else{for(var a=0;a'+(t.displayValues?t.displayValues[a]:t.values[a])+" ";i+='