commit c64195c21803cb2cf8ea8ecc4090d02d000a7a18 Author: Jerry Yan <792602257@qq.com> Date: Fri Sep 6 10:45:33 2019 +0800 Init Repo diff --git a/.project b/.project new file mode 100644 index 0000000..8179fbb --- /dev/null +++ b/.project @@ -0,0 +1,34 @@ + + + app1 + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + com.pandora.projects.ui.MKeyBuilder + + + + + + com.pandora.projects.ui.MKeyNature + com.aptana.projects.webnature + + + + 1550295612120 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-node_modules + + + + diff --git a/api b/api new file mode 100644 index 0000000..8afdaff --- /dev/null +++ b/api @@ -0,0 +1 @@ +(function(){ window.BMap_loadScriptTime = (new Date).getTime(); document.write('');})(); \ No newline at end of file diff --git a/css/addessay.css b/css/addessay.css new file mode 100644 index 0000000..0828218 --- /dev/null +++ b/css/addessay.css @@ -0,0 +1,65 @@ +.row { + display: flex; + justify-content: space-between; + align-items: center; + width: 98%; + font-size: 16px; + margin: 0px auto; + background: #fff; + padding: 5px 5px; +} +.row select { + padding: 0px 5px; + margin: 0px 0px; + height: 40px; + color: #363636 ; + font-size: 16px; + direction: rtl; +/* text-align: right; */ +} +.row select::placeholder { + text-align: right; + color: #ccc ; + +} +.row select option { + color: #363636 ; + text-align: right; +} +.row input { + padding: 0px 5px; + margin: 0px 0px; + color: #363636; + font-size: 16px; + text-align: right; + border: 0px; +} +.row_text{ + display: inline-block; + min-width: 100px; + font-size: 16px; + font-weight: 200; + color: #363636; + padding-left: 5px; +} +.down { + margin: 55px auto ; + +} +.down .btn { + margin: 0px auto ; + width: 200px; + height: 40px; + line-height: 40px; + text-align: center; + padding: 10px auto; + background: #DD524D; + font-size: 18px; + font-weight: 200; + color: #FDECEA; +} +/* 添加备忘录图片控制 */ +.row_bottom .btn { + margin: 5px 0px; +} + diff --git a/css/addgoods.css b/css/addgoods.css new file mode 100644 index 0000000..52ac319 --- /dev/null +++ b/css/addgoods.css @@ -0,0 +1,291 @@ +.addcon_con { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + position: relative; + padding: 0px 7px; + width: 98%; + margin: 0 auto; + /* flex: 1; */ + +} +.addcon_con label { + width: 100px; + font-size: 16px; + color: #363636; + +} +.addcon_con input::-webkit-input-placeholder { + font-size: 13px; + text-align: right; +} +.addcon_con input,.addcon_con select { + /* width: 230px; */ + border: 0px; + margin: 0px; + padding: 0px; + height: 21px; + text-align: right; + overflow: hidden; + font-size: 16px; + /* flex: 0; */ +} +/* 申请商都商厦商超*/ +.addcon_con #shopId{ + width: 180px; + border: 0px; + margin: 0px; + padding: 0px; + height: 21px; + + } + + +.addcon .addcon_con .label-t { + font-size: 16px; + font-weight: 300; +} + +.renzhengphoto { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + padding: 7px; + flex: 1; + margin-bottom: 8px; +} + +.renzhengphoto label { + width: 100px; + font-size: 16px; + color: #363636; + align-self: flex-start; +} + +.photos { + display: flex; + flex-direction: column; + flex: 0 0 80%; + justify-content: space-between; + align-items: center; + padding: 0px 7px; + +} +.photos_con { + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + align-content: flex-start; +} +.delete{ + height: 20px; + width: 20px; + position: absolute; + top:5px; + right: 5px; + z-index: 99; + color: #f00; + +/* filter:drop-shadow( -25px 0 red); + border-left: 20px solid transparent; */ +} +.delete img { + filter: opacity(100%); + +} +.photos_con .photo { + width: 100px; + height: 100px; + margin-left: 20px; + margin-bottom: 10px; + position: relative; + + +} + +.photos_con .photo img { + width: 100%; + height: 100%; +} + +.photos span { + display: inline-block; + font-size: 10px; + color: #959595; + +} +.addcon_con .defalut_type{ + /* flex: 1; */ + width: 100px; +} +.grounding { + display: flex; + justify-content: space-around; + align-items: center; +} + +.grounding .checkinp { + /* flex: 0 0 12%; */ + width: auto; + margin-right: 5px; +} + +.addcon_con .grounding label { + width: auto; + height: auto; +} +.addcon_con .radio{ + width: 20px; +} + + .renzhengphoto .photos span { + font-size: 12px; + height: 20px; +} +.ossfile { + display: inline-block; + width: 80px; + height: 80px; + background: #ccc; + border: 1px solid #ccc; + border-radius: 5px; + position: relative; +} + +.selectarea{ + width: 100%; + height: 100%; + display: flex; + justify-content: space-between; + align-items: center; +} + +.selectarea select{ + text-align: center; + height: 40px; + color: #7B7B7B; + width: 170px; + background: url(../img/sanjiaoxia.png) no-repeat right center; + background-size: 16px; + margin: 0px; + padding: 0px; + font-size: 16px; + text-align: right; +} +.pricset { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + position: relative; + padding: 0px 7px; + width: 98%; + margin: 0 auto; + flex: 1; + +} + +.pricset label { + color: #363636; + font-size: 13px; +} +.pricset_con .addcon_con label { + text-align: center; + font-size: 14px; + color: #363636; +} +.label-t{ + margin: 0 5px; + +} +.pricset_con input { + margin: 0 5px; + text-align: center; + flex: 0 0 33.3333%; + border: 1px solid #ccc; + height: 28px; + +} + +.pricset select { + margin: 0 5px; + width: auto; +} +.goodsDesc{ + width: 98%; + margin: 0 auto; + background: #fff; +} +.goodsDesc .w-e-toolbar{ + flex-wrap: wrap; +} +.pre{ + /* height: 100%; */ +} +.btn { + padding: 0 40px; + display: flex; + justify-content: space-around; + align-items: center; +} +.bc_btn { + height: 30px; + line-height: 30px; + text-align: center; + width: 70%; + margin: 20px auto; + color: #fff; + background: #FF1A03; + border-radius: 15px; +} +.prelook{ + margin-bottom: 0px; +} +/* 上传凭证 */ + .info{ + display: flex; + justify-content: space-between; + align-items: flex-start; + background: #fff; + height: 80px; + position: relative; + padding: 5px 7px; + width: 98%; + margin: 0 auto; + flex: 1; + + } + .info label { + width: 100px; + font-size: 16px; + color: #363636; + align-self: flex-start; + } + .info textarea::-webkit-input-placeholder { + font-size: 16px; + text-align: left; + } + .info textarea { + /* width: 230px; */ + border: 1px solid #ccc; + font-size: 16px; + margin: 0px; + padding: 0px; + height: 70px; + text-align: left; + } + /* 上传凭证结束 */ +.info #content{ + border: 1px solid #ccc; + + margin: 0px; + padding: 0px; + height: 70px; + text-align: left; +} + diff --git a/css/addqrrz.css b/css/addqrrz.css new file mode 100644 index 0000000..c80d0ee --- /dev/null +++ b/css/addqrrz.css @@ -0,0 +1,439 @@ +.row { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + position: relative; + padding: 0px 7px; + width: 98%; + margin: 0 auto; + flex: 1; + +} +.row label { + min-width: 100px; + font-size: 17px; + color: #363636; +} + +.row input { + /* width: 230px; */ + font-size: 17px; + color: #363636; + border: 0px; + margin: 0px; + padding: 0px; + height: 21px; + text-align: right; +} +.row .selectarea{ + /* width: 60%; */ + height: 100%; + display: flex; + /* justify-content: space-between; */ + /* align-items: center; */ + flex-wrap: wrap; + align-content: flex-start; + flex: 0 0 78%; + +} + +.row .selectarea select{ + /* margin: 10px; */ + text-align: center; + margin-right: 5px; + width: 30%; + height: 40px; + color: #7B7B7B; + +} +.storepos{ + height: 200px; +} +.areainp .selectarea select{ + background-size: 16px; +} +.row .selectarea select option{ + text-align: center; + +} +.row input::-webkit-input-placeholder { + font-size: 17px; + text-align: right; +} + +.selectfile { + height: 100px; +} + +.row select { + width: 170px; + background: url(../img/sanjiaoxia.png) no-repeat right center; + background-size: 16px; + margin: 0px; + padding: 0px; + font-size: 16px; + text-align: right; + +} +.renzhengphoto { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + padding: 7px; + flex: 1; + margin-bottom: 8px; +} + +.renzhengphoto label { + width: 100px; + font-size: 16px; + color: #363636; + align-self: flex-start; +} + +.photos { + align-self: flex-start; + display: flex; + flex-direction: column; + flex: 0 0 80%; + justify-content: space-between; + align-items: center; + padding: 0px 7px; + +} +.photos_con { + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + align-content: flex-start; +} + +/* +.photos_con .photo { + margin-left: 20px; + position: relative; +display: flex; +flex-direction: column; +justify-content: space-between; +align-items: center; + +} */ +.photos_con .photo { + display: flex; + flex-direction:column ; + justify-content: space-between; + align-items: center; + margin-left: 20px; + margin-bottom: 10px; + position: relative; + text-align: center; + +} +/* .photoimg{ + width: 100px; + height: 100px; +} */ +.photos_con .photo img { + width: 100px; + height: 100px; +} + +.photos span { + display: inline-block; + font-size: 15px; + color: #959595; + +} + .num .renzhengphoto{ + display: flex; + flex-direction: column; + justify-content:flex-start; + align-items: flex-start; + /* flex: 2.6; */ +} +.num .renzhengphoto .photos{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + margin-top: 10px; + width: 100%; + /* flex:0 0 100%; */ +} +.num .renzhengphoto label{ + font-size: 13px; + /* font-weight: 300; */ + width: 100%; + /* flex: 1; */ + } + .num .renzhengphoto .photos label{ + width: 80px; + height: 100%; + display: inline-block; + } + /* .renzhengphoto .photos{ + display: flex; + flex-direction: column; + justify-content: space-between!!important ; + align-items: flex-start; + flex: 2.6; +} */ +/* .renzhengphoto .photos span { + font-size: 12px; + height: 20px; */ + /* padding-left: 5px; */ +/* } +.renzhengphoto .photos .photos_con{ + display: flex; + justify-content: space-around; + align-items: center; */ + /* width:270px; */ + /* text-align: center; */ +/* } +.num .renzhengphoto .photos .photos_con .mui-icon{ + left: 45px; + font-size: 28px; +} +.renzhengphoto { + width: 98%; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + padding: 7px; + + +} + +.renzhengphoto label { + width: 100px; + font-size: 13px; + color: #363636; + align-self: flex-start; +} + .renzhengphoto .photos span { + font-size: 12px; + height: 20px; */ + /* padding-left: 5px; */ +/* } */ + +/* +.files_out { + text-align: center; + padding-top: 24px; +} */ +/* .photos span { + display: inline-block; + font-size: 10px; + color: #959595; + +} */ + +/* .photos .mui-icon { + font-size: 30px; + color: #fff; + position: absolute; + top: 25px; + left: 25px; +} + */ + + +/* .ossfile { + display: inline-block; + width: 80px; + height: 80px; + background: #ccc; + border: 1px solid #ccc; + border-radius: 5px; + position: relative; +} */ + +/* .photoimg { + width: 70%; + text-align: right; + /* overflow: hidden; */ +} */ + +.info { + position: relative; + /* display: inline-block; */ + width: 37%; + font-size: 12px; + bottom: 3px; + color: #aaa; +} + +/* .photoimg .mui-icon { + position: absolute; + top: 28px; + left: 30px; + color: #fff; +} */ + +#bankUserName { + position: absolute; + top: 15px; + right: 30px; + width: 200px; + /* background: #6600FF; */ + +} + +.mui-scroll .con .row .mui-table-view-cell-head { + width: 30%; + display: inline-block; +} + +.selectfile img { + width: 100%; + height: 100%; +} + +.thumbnail-img { + width: 100px; + height: 100px; + text-align: center; + background: #fff; + margin: 0 auto; +} + +.thumbnail-img .mui-icon { + width: 70px; + height: 70px; + font-size: 40px; + padding-top: 20px; +} + +.mui-table-view-cell-hkimg { + width: 50%; + /* background: pink; */ +} + +.hkimg { + width: 100%; + display: none; +} + +.userimg { + height: 100px; + +} + +.mui-btn-block { + width: 70%; + margin: 30px auto; + font-size: 18px; +} + +.YZTEL { + margin: 50px auto; + width: 80%; +} + +.YZTEL .mui-table-view-cell { + padding: 5px; +} + +.YZTEL label { + width: 25%; + font-size: 15px; +} + +.mui-table-view .mui-table-view-cell { + display: flex; + justify-content: space-between; + align-items: center; +} + +.mui-table-view .mui-table-view-cell #indiv-tel { + width: 80%; + text-align: left; + border: 0px; + padding: 0px; + margin: 0px; + font-size: 16px; +} + +.mui-table-view .mui-table-view-cell .YZM { + display: inline-block; + width: 40%; + border: 0px; + padding: 0px; + margin: 0px; + text-align: left; + +} + +.mui-table-view .mui-table-view-cell input::-webkit-input-placeholder { + font-size: 16px; + text-align: left; +} + +.mui-table-view .mui-table-view-cell .HQYZM { + width: 40%; + height: 30px; + font-size: 16px; + line-height: 30px; + padding: 0px; + margin: 0px; + text-align: center; + + +} + +.bc_btn { + height: 30px; + line-height: 30px; + + + text-align: center; + width: 70%; + margin: 30px auto; + + + color: #fff; + background: #FF1A03; + border-radius: 15px; +} + +.lxy_home_zz ul { + width: 83%; + margin: 0 auto; + position: relative; + top: 40%; + padding-top: 10px; + padding-bottom: 10px; + background: #fff; + border: 1px solid #fff; + border-radius: 5px; +} + +.lxy_zz input { + /* position: absolute; */ + width: 88%; + display: block; + /* top:50%; + left: 10%; */ + margin: 10px auto; + height: 35px; +} + +.lxy_zz_btn { + /* display: flex; */ + /* justify-content: space-between; */ + width: 40%; + margin: 15px auto; + text-align: center; + background: #FF0404; + color: #FFFFFF; + border: 1px solid #FF0404; + border-radius: 15px; + height: 30px; + line-height: 30px; +} diff --git a/css/addshopping.css b/css/addshopping.css new file mode 100644 index 0000000..d642a83 --- /dev/null +++ b/css/addshopping.css @@ -0,0 +1,233 @@ +.addshopping-title { + height: 60px; + line-height: 60px; + width: 100%; + background: #000000; + text-align: center; + /* font-size: 18px; */ + display: flex; + justify-content: space-between; + align-items: center; +} + +.addshopping-title a { + display: inline-block; + width: 30px; + height: 30px; + background: #242424; + border-radius: 30px; + line-height: 30px; + color: #fff; + /* padding-top: 15px; */ + /* margin-top: 15px; */ +} + +.mui-action-back { + font-size: 26px; + height: 30px; + position: absolute; + /* top: 0px; */ + left: 15px; + z-index: 100; +} + +.addshopping-title h3 { + display: inline-block; + width: 80%; + text-align: center; + font-size: 20px; + color: #fff; + height: 60px; + line-height: 60px; + /* margin-top: -3px; */ +} + +.addcon-title { + + width: 100%; + height: 60px; + line-height: 60px; + background: #CCCCCC; + margin: 0 auto; + font-size: 14px; + +} + +.addcon_title { + width: 80%; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; +} + + +.num1{ + position: relative; + width: 20px; + height: 20px; + border: 1px solid #666; + border-radius: 20px; + background: #fff; + +} +.active { + background: #0062CC; +} +.num1 span { + position: absolute; + top: -20px; + left: 5px; +} + +.pre { + width: 96%; + margin: 0 auto; +} + +.pre-title h3 { + font-size: 15px; + +} + +.pre-con span { + width: 30%; + height: 15px; + font-size: 12px; + display: inline-block; + text-align: right; + +} + +.pre-con input { + width: 68%; + height: 15px; + font-size: 12px; + +} + +.shangjia { + display: flex; + justify-content: space-between; + align-content: center; + font-size: 12px; +} + +.shangjia span { + display: inline-block; + width: 30%; + text-align: right; + +} + +.shangjia label { + width: 60%; +} + +.thumbnail-title { + margin: 15px auto; +} + +.thumbnail-title span { + font-size: 14px; +} + +.thumbnail-img { + width: 100px; + height: 100px; + text-align: center; + background: #fff; + margin: 0 auto; +} + +.thumbnail-img .mui-icon { + width: 70px; + height: 70px; + font-size: 40px; + padding-top: 20px; +} + +.shopadds-title { + margin: 15px auto; +} + +.shopadds-img { + width: 300px; + height: 200px; + overflow: hidden; + background: #fff; + margin: 0 auto; + margin-bottom: 10px; +} + +.pre-con2 form {} + +.pre-con2 form span { + display: inline-block; + width: 35%; + text-align: right; + font-size: 14px; + height: 25px; + line-height: 25px; +} + +.pre-con2 select { + width: 55%; + border: 0px; + padding: 2px; + font-size: 14px; + height: 25px; + line-height: 25px; + + + +} + +.pre-con2 table th { + width: 30%; + +} + +.pre-con2 table tr { + text-align: center; + +} + +.pre-con2 table .table-tr { + border-bottom: 1px solid #000; + +} + +.pre-con2 table tr td { + height: 45px; + line-height: 45px; + font-size: 13px; + + +} + +.pre-con2 table tr td input { + height: 25px; + margin: 0px; + padding: 1px 2px; + width: 80%; + line-height: 25px; + +} + +.nextbtn { + text-align: center; + margin: 10px auto; +} +.yulanbtn{ + text-align: center; + margin: 10px auto; + +} +.btn{ + display: flex; + justify-content: space-between; + width: 50%; + margin: 10px auto; +} + diff --git a/css/addyhk.css b/css/addyhk.css new file mode 100644 index 0000000..e69de29 diff --git a/css/applicationopen.css b/css/applicationopen.css new file mode 100644 index 0000000..c8265c6 --- /dev/null +++ b/css/applicationopen.css @@ -0,0 +1,162 @@ +.con-nav { + /* width: 100%; */ + height: 40px; +} + +.con-nav ul { + width: 100%; + height: 100%; + list-style: none; + /* padding: 0px; */ + margin: 10px 2px; + /* display: flex; + justify-content: space-between; + align-items: center; */ + padding: 5px 1px; + /* overflow-x: scroll; */ +} + +.con-nav ul li { + padding: 0px 20px; + line-height: 40px; + background: #999999; + display: inline-block; + color: #fff; + float: left; + margin: 0px -16px 0px 0px; + position: relative; + font-size: 14px; + /* text-align: center; */ + width: 28%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + +} + +.con-nav ul li:after { + content: ''; + width: 0px; + height: 0px; + display: block; + border: 20px solid transparent; + /* border-bottom: 20px solid transparent; */ + border-left: 20px solid #999999; + position: absolute; + right: -21px; + top: 0; + z-index: 10; +} + +.con-nav ul li:before { + content: ''; + display: block; + border: 20px solid transparent; + width: 0px; + height: 0px; + /* border-top: 20px solid transparent; + border-bottom: 20px solid transparent; */ + border-left: 20px solid #fff; + position: absolute; + left: 0px; + top: 0; + right: -20px; + +} + +.con-nav ul li:first-child { + border-radius: 4px 0 0 4px; + padding-left: 10px; +} + +.con-nav ul li:last-child, +.cssNavEnd { + border-radius: 0px 4px 4px 0px; + padding-right: 10px; +} + +.con-nav ul li:first-child:before { + display: none; +} + +.con-nav ul li:last-child:after, +.cssNavEnd:after { + display: none; +} + +.con-nav ul li.active { + background-color: #ef72b6; + /* width: 120px; */ +} + +.con-nav ul li.active:after { + border-left-color: #ef72b6; +} + +.con-content { + margin-top: 20px; +} + +.storepos label { + align-items: flex-start; +} + +.num .areainp { + height: 80px; +} + +#allmap { + flex: 0 0 80%; + height: 200px; + /* z-index: 0; */ +} + +.num .renzhengphoto .photos .photo { + width: 100px; +} + +.num .renzhengphoto .photos .photo img { + width: 100%; + +} + +.confirmationtext { + /* height: 200px; */ + width: 98%; + margin: 0 auto; + /* overflow: hidden; */ +} + +.confirmationtext .confirmationtext_con { + height: 200px; + width: 98%; + margin: 0 auto; + padding: 10px 4px; + overflow-y: scroll; +} + +.oper { + display: flex; + width: 100%; + justify-content: center; + align-items: center; +} + +.oper .next { + width: 50%; +} + +.pre { + width: 50%; +} + +.pre_btn { + height: 30px; + line-height: 30px; + text-align: center; + width: 70%; + margin: 30px auto; + color: #fff; + background: #FF1A03; + border-radius: 15px; +} diff --git a/css/appraise.css b/css/appraise.css new file mode 100644 index 0000000..e7a4497 --- /dev/null +++ b/css/appraise.css @@ -0,0 +1,145 @@ +* { + margin: 0; + padding: 0; +} +body{ + /*background: white;*/ +} +.clearfix::before, +.clearfix::after { + display: block; + content: ''; + visibility: hidden; + height: 100%; + clear: both; +} + +body { + padding-top: 2%; +} +.gallety{ + width: 100%; + overflow: hidden; + height: 80px; +} +.my-gallery { + width: 200%; + margin: 0 auto; + overflow: hidden; +} + +.my-gallery .img-dv { + width: 78px; + height: 78px; + margin-bottom: 1%; +} + +.my-gallery .img-dv a { + display: block; + width: 100%; + height: 100%; + text-align: center +} + +.my-gallery .img-dv a img { + width: 100%; + height: 100%; + /*vertical-align: middle;*/ +} + +figure { + float: left; + margin: 0; + margin-right: 5px; +} + +.con{ + /*margin-top: 66px;*/ +} + +.con_{ + background: white ; +} +.nav { + font-size: 12px; + margin-bottom: 8px; +} +.nav div{ + float: left; + width: 30%; + height: 30px; + text-align: center; + line-height: 30px; + margin-left: 2.5%; + background: #fdecea; + border-radius: 15px; + color: #525252; +} +.nav .on{ + background: #E6122B; + color: white; +} + + +.pj_breviary { + padding: 12px; + border-bottom: 1px solid #e6e6e6; +} + +.pjbtitle p { + color: #e61329; + font-size: 18px; + float: left; + margin: 0; + line-height: 25.2px; + padding-left: 6px; +} + +.pjbcon { + color: #525252; + font-size: 18px; + margin: 3px 0; +} + +.pjclass { + color: #909090; + font-size: 18px; +} +.pjbtitle img { + width: 25.2px; + height: 25.2px; + border-radius: 50%; + overflow: hidden; + float: left; + +} +.pj_title { + color: black; + padding: 9px 12px; + margin: 0; +} +.pjzhuijia{ + padding: 9px 6px; + background: #e4e4e4; + border-radius: 4.8px; + font-size: 18px; + margin-top: 4px; +} +.zjpj{ + position: relative; + padding-top: 0.1px; +} +.sanjiao{ + position: absolute; + width: 9px; + height: 9px; + transform: rotate(45deg); + background: #e4e4e4; + left: 32px; +} +.pswp__top-bar{ + margin-top: 20px; +} +.nav_{ + margin-top: 5px; +} diff --git a/css/bill.css b/css/bill.css new file mode 100644 index 0000000..23c5b98 --- /dev/null +++ b/css/bill.css @@ -0,0 +1,42 @@ +.con { + padding-top: 10px; +} +.row{ + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + padding: 10px; + font-size: 12px; + color: #909090; + /* height: 40px; */ + background: #fff; +} +.row .left{ + width: 30px; + height: 30px; + +} +.row .left img { + width: 100%; + height: 100%; +} +.row .num { + width: 100px; + flex: 1; + text-align: center; + font-size: 15px; +} +.row .context{ + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: space-between; + text-align: left; + flex: 2; + margin-left: 20px; +} +.row .context .con_text{ + font-size: 14px +} +. \ No newline at end of file diff --git a/css/cash-out.css b/css/cash-out.css new file mode 100644 index 0000000..33fe140 --- /dev/null +++ b/css/cash-out.css @@ -0,0 +1,191 @@ +.idc-total { + width: 96%; + margin: 0 auto 8px; + height: 60px; + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + padding-left: 5px; + + /* border-bottom: 1px solid #ccc; */ +} + +.idc-total h4 { + width: 80%; +} + +.idc-total input { + font-size: 18px; + margin-right: 10px; + text-align: right; + width: 40%; + border: 0px; +} + +.btns { + display: flex; + justify-content: space-between; + align-items: center; +} +.bg .btns div { + height: 30px; + line-height: 30px; + text-align: center; + width: 40%; + margin: 5px auto; + color: #fff; + background: #FF1A03; + border-radius: 15px; +} +.tx-title { + width: 100%; + height: 49px; + border-bottom: 1px solid #e6e6e6; + position: relative; +} + +.tx-title a { + position: absolute; + z-index: 10; + font-size: 30px; + color: #909090; + line-height: 50px; + left: 5px; + top:0px; +} + +.tx-title p { + line-height: 48px; + text-align: center; + color: black; + font-size: 18px; +} +.btns div { + height: 30px; + line-height: 30px; + text-align: center; + width: 40%; + margin: 30px auto; + color: #fff; + background: #FF1A03; + border-radius: 15px; +} +.footer{ + position: fixed; + left: 0; + /* top: 0; */ + bottom: 0; + right: 0; + z-index: 10; + height: 40px; +} +.bg { + background: rgba(1, 1, 1, 0.1); + position: fixed; + left: 0; + /* top: 0; */ + bottom: 0px; + right: 0; + z-index: 10; +} +.bg .row{ + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + position: relative; + padding: 0px 7px; + width: 98%; + margin: 0 auto; + flex: 1; +} +.bg .row label { + width: 100px; + font-size: 16px; + color: #363636; + +} +.mui-popup-input input{ + border: 0px; + } +.bg .row select{ + /* margin: 10px; */ + /* text-align: right; */ + margin-bottom: 0px; + margin-right: 5px; + /* width: 30%; */ + height: 40px; + color: #7B7B7B; + padding: 0px; +} +.bg .row input { + /* width: 230px; */ + border: 0px; + margin: 0px; + padding: 0px; + height: 21px; + text-align: left; + font-size: 16px; + color:#7B7B7B; +} +.idc-list { + width: 96%; + height: 120px; + background: #FEEAE9; + margin: 0 auto; + /* background: #fff; */ + display: flex; + flex: 1; + align-items: flex-start; + justify-content: space-between; + /* border-bottom: 1px solid #ccc; */ + border: 1px solid #FEEAE9; + border-radius: 5px; + margin-bottom: 8px; + padding-left: 5px; +} + +.idc-list-price { + /* flex: 0 0 30%; */ + +} + +.idc-list-right { + /* flex: 0 0 70%; */ + flex-direction: column; + justify-content: space-around; + align-items: flex-start; + padding-left: 30px; + position: relative; +} + +.idc-list-title { + width: 200px; + font-size: 16px; + font-weight: 200; + margin-bottom: 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.idc-list-price { + font-size: 16px; + color: #F02C43; +} + +.idc-list-user { + + font-size: 16px; + margin-bottom: 15px; + +} + +.idc-list-time { + width: 50%; + font-size: 14px; + /* color: #F02C43; */ + bottom: 10px; +} diff --git a/css/complain.css b/css/complain.css new file mode 100644 index 0000000..4f98e4a --- /dev/null +++ b/css/complain.css @@ -0,0 +1,20 @@ +.con { + background: white; + padding: 10px 5%; +} + +select { + padding-left: 0; +} + +button { + width: 90%; + background: #f02c43; + margin: 10px 5%; + text-align: center; + font-family: "微软雅黑"; + font-size: 15.6px; + color: #fff; + border: none; + height: 40px; +} \ No newline at end of file diff --git a/css/confirmOrder.css b/css/confirmOrder.css new file mode 100644 index 0000000..8366a2e --- /dev/null +++ b/css/confirmOrder.css @@ -0,0 +1,151 @@ +.scroll_out{ + position: fixed; + top: 66px; + bottom: 50px; + left: 0; + right: 0; +} + + +.c1_r input{ + margin: 0; + border: none; + padding: 0; + height: 22px; + width: calc( 100% ); + font-size: 18px; +} +.c1_r{ + width: calc(100% - 100px); + text-align: right; +} + +.c1_l input::-webkit-input-placeholder { /* WebKit browsers */ +font-size:18px; +} +.c1_l input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ +font-size:18px; +} +.c1_l input::-moz-placeholder { /* Mozilla Firefox 19+ */ +font-size:18px; +} +.c1_l input:-ms-input-placeholder { /* Internet Explorer 10+ */ +font-size:18px; +} + + +.js_r{ + float: right; + line-height: 50px; +} +.js_r span{ + font-size: 12px; +} +.js_r span j{ + color: #e94744; +} +.js_r span o{ + color: #909090; +} +.btn_tj{ + display: inline-block; + width: 102px; + height: 51px; + background: -moz-linear-gradient(left, #ff0423, #ff58a3); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0423), to(#ff58a3)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff0423, #ff58a3); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff0423, #ff58a3); + /*Opera11*/ + text-align: center; + color: white; + font-size: 14.4px; +} + +.isHb{ + width: 100%; + height: 42px; + border-bottom: 1px solid #e6e6e6; + background: white; + line-height: 41px; + padding:0 10px; +} +.h_left{ + font-size: 12px; + float: left; +} +.h_left o{ + color: #909090; +} +.he_right{ + float: right; + height: 41px; + width: 80px; + position: relative; +} +.checkout{ + width: 42px; + height: 25px; + border-radius: 15px; + /*background: #2ddd87;*/ + position: absolute; + right: 0; + top: 7px; + border:1px solid #909090; +} +.check_btn{ + position: absolute; + width: 21px; + height: 21px; + background: white; + border-radius: 50%; + top: 1px; + left: 1px; + border:1px solid #909090; +} +.he_right .on{ + top: 8px; + border: none; + height: 23px; + background: #2ddd87; +} + +.he_right .on .check_btn{ + border: none; + left: 20px; +} +select{ + margin: 0; + padding: 0 ; + font-size: 13.2px; +} +.mui-table-view-cell:after{ + height: 0; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content{ + width: 100%; + background: transparent; +} +.row_{ + width: 100%; + font-size: 13.2px; + border-bottom: 1px solid #ebebeb; +} + +.shop_info{ + background: white; + border-bottom: none; + margin-bottom: 5px; +} +.row_block{ + background: white; +} +.row_block img{ + border-radius: 3px; + overflow: hidden; +} +.rcr { + background: white; +} diff --git a/css/cooperative.css b/css/cooperative.css new file mode 100644 index 0000000..e69de29 diff --git a/css/details.css b/css/details.css new file mode 100644 index 0000000..c50b0b8 --- /dev/null +++ b/css/details.css @@ -0,0 +1,916 @@ +body { + background: #f4f2f2; +} + +.header { + width: 100%; + position: fixed; + top: 0; + z-index: 10; + background: transparent; + border: none; + box-shadow: 0 0 0; + height: 66px; +} + +body .header1 { + z-index: 11; + opacity: 0; + width: 100%; + position: fixed; + top: 0; + background: rgba(255, 255, 255, 1); + border: none; + box-shadow: 0 0 0; + height: 66px; + display: none; + border-bottom: 1px solid #efefef; +} + +.mui-bar-nav.mui-bar .mui-icon { + /*margin-left: 0;*/ +} + +.mui-title { + color: black; +} + +.zhe { + opacity: 0; +} +.icon-cart{ + margin-top:.35rem; + margin-right:.5rem; + float: right; +} +.header .mui-action-back { + margin-top: 10px; + margin-left: 10px; + border-radius: 50%; + background: rgba(0, 0, 0, 0.2); + color: white; +} + +.header1 .mui-action-back { + /*margin-top: 20px;*/ + color: black; + float: left; +} + +.mui-bar-nav { + box-shadow: none; + background: rgba(0, 0, 0, 0) +} + +.header1 .on { + border-bottom: 3px solid #ff0000; + color: #e61329; +} + +.p1 { + float: left; + height: 45px; + line-height: 46px; + width: 26.41px; + margin-left: calc(25% - 35px); + font-size: 13.2px; +} + +.back { + position: absolute; + left: 15px; + top: 25px; +} + +.back img, +.like img, +.menu img { + width: 37.2px; + height: 37.2px; +} + +.like { + position: absolute; + left: 279px; + top: 15px; +} + +.menu { + position: absolute; + right: 15px; + top: 25px; +} + +.banner { + width: 100%; + height: 387px; + position: relative; + z-index: 1; +} + +.swiper-container { + width: 100%; + /*height: 387px;*/ + box-shadow: 0 -1px 3px #ddd; +} + +.swiper-slide { + text-align: center; + /* Center slide text vertically */ + 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; +} + +.swiper-pagination-bullet-active { + background: #e94947; +} + +.swiper-slide {} + +.swiper-slide img { + width: 100%; + height: 100%; +} + +.summarize { + background: white; + width: 100%; + margin-bottom: 5px ; +} + +.cname { + font-size: 14.4px; + padding:0 10px 5px; + margin: 0; +} + +.price { + color: #F02A40; + font-size: 21.6px; + margin: 0; + padding:5px 10px; + +} +.summarize .xxl{ + color: white; + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ +} + +.price o{ + font-size: 15px; + color: #909090; +} +.summarize .xxl o{ + font-size: 15px; + color: white; +} +.price_old { + color: #909090; + font-size: 15px; + /*padding-left: 9px;*/ + /*padding-bottom: 9px;*/ + margin: 0; + padding: 5px 10px 0; +} + +.compilations { + position: relative; + width: 100%; + height: 30px; + line-height: 24px; + font-size: 10.8px; + color: #727272; +} + +.myf { + position: absolute; + left: 9px; +} + +.yx { + position: absolute; + margin: 0 auto; + left: 0; + right: 0; + text-align: center; +} + +.dz { + position: absolute; + right: 9px; +} + +.compilations { + /*border-bottom: 1px solid #e6e6e6;*/ + /*padding-bottom: 9px;*/ +} + +.guarantee { + width: 100%; + margin-bottom: 5px ; + background: white; +} + +.guarantee .row { + width: 100%; + height: 42px; + border-bottom: 1px solid #ebebeb; +} + +.mui-table-view-cell:after{ + height: 0; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content{ + width: 100%; + background: transparent; +} +.row_{ + width: 100%; + font-size: 13.2px; + border-bottom: 1px solid #ebebeb; +} +.guarantee .row img { + height: 15px; + margin-left: 12px; + margin-top: 12px; + float: left; +} + +.guarantee .row .text { + color: #525252; + line-height: 42px; + font-size: 13.2px; + float: left; + max-width: calc(100% - 65px); + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + margin-left: 12px; +} + +.guarantee .row .text1 { + color: #e1202a; + background: white; + /*line-height: 42px;*/ + font-size: 10.2px; + float: left; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + margin-left: 12px; + padding: 0 8px; + margin-top: 10px; + height: 20px; + border: 1px solid #e1202a; + border-radius: 3px; +} + +.guarantee .row .lq { + float: right; + margin-top: 6px; + margin-right: 9px; + color: #909090; + border-radius: 15px; + line-height: 19px; + padding: 4px 10px 2px; +} + +.guarantee .row .caidan img { + width: 15px; + margin: 0; + height: 3px; +} + +.guarantee .row .caidan { + border: none; + float: right; + margin-top: 13px; + margin-right: 12px; +} + +.guarantee .row .caidan:active { + background: transparent; +} + +#guarantee .row .text { + color: black; +} + +.cc1 { + width: 100%; + height: 27px; +} + +.cclass_con { + position: absolute; + bottom: 0; + left: 0; + right: 0; +} + +.cc2 { + width: 100%; + height: 81px; + background: white; + position: relative; + border-bottom: 1px solid #e3e6ea; +} + +.cc2 p { + font-size: 17.6px; + color: #e94744; + position: absolute; + left: 120px; + top: 24px; +} + +.cc2 span { + font-size: 15px; + position: absolute; + left: 120px; + top: 48px; +} +.cc2 o{ + font-size: 12px; + color: #e94744; + position: absolute; + left: 200px; + top: 24px; +} +.cc2 l{ + font-size: 10px; + position: absolute; + left: 200px; + top: 48px; +} +.closecclass { + font-size: 15.6px; + color: #9b9b9b; + position: absolute; + padding: 9px 12px; + right: 0; + top: 0; +} + +.closecclass img { + width: 18px; +} + +.cclass_con .img { + background: white; + padding: 6px; + position: absolute; + border: 1px solid #f2f2f2; + border-radius: 6px; + width: 85.8px; + height: 85.8px; + top: 0; + left: 12px; + z-index: 60; +} + +.cclass_con .img img { + width: 100%; + height: 100%; + border-radius: 3px; +} + +.cclass1 { + padding: 9px 0 0 12px; + background: white; + width: 100%; + /*border-bottom: 1px solid #e3e6ea;*/ +} + +.cclass1 p { + color: #626262; + font-size: 17.2px; + padding-bottom: 6px; + margin: 0; +} + +.cclass1 .block { + padding: 2px 6px; + float: left; + /*border: 1px solid #9e9e9e;*/ + margin: 0px 18px 4px 0; + border-radius: 6px; + font-size: 14.4px; + color: #909090; + background: #f5f5f5; + font-size: 17.5px; +} + +.cclass1 .on { + /*border: 1px solid #e94947;*/ + color: #fff; + background: #e61329; +} + +.ensure { + width: 50%; + height: 48px; + color: white; + font-size: 14.4px; + display: block; + line-height: 51px; + text-align: center; + background: #e6122b; + float: left; +} + +.engwc { + width: 50%; + height: 48px; + color: white; + font-size: 14.4px; + display: block; + line-height: 51px; + text-align: center; + background: #ff9402; + float: left; +} + +.num { + background: white; + width: 100%; + height: 51.6px; + border-bottom: 1px solid #e3e6ea; + color: #626262; + font-size: 13.2px; + padding: 0 18px; + line-height: 51.6px; + position: relative; +} +.num span { + font-size: 15px; + } +.change_num { + width: 168px; + height: 30px; + position: absolute; + right: 30px; + top: 10.5px; +} + +.jia { + background: #ebebeb; + position: absolute; + font-size: 21px; + color: #e94947; + line-height: 30px; + width: 30px; + text-align: center; + right: 0; +} + +.jian { + background: #ebebeb; + position: absolute; + font-size: 21px; + color: #e94947; + line-height: 30px; + width: 30px; + text-align: center; + left: 0; +} + +.change_num input { + position: absolute; + width: 78px; + margin: 0 15px; + left: 30px; + height: 30px; + border: none; + text-align: center; + font-size: 18px; +} + +.pjrk { + width: 100%; + background: white; + margin-bottom: 5px ; +} + +.pj_title { + color: black; + padding: 9px 12px; + margin: 0; +} + +.pj_remark { + padding-left: 12px; +} + +.pjr { + padding: 3px 20px; + margin: 0 12px 12px 0; + font-size: 12px; + float: left; + background: #fdecea; + color: #525252; + border-radius: 20px; +} + +.pjbtitle img { + width: 25.2px; + height: 25.2px; + border-radius: 50%; + overflow: hidden; + float: left; +} + +.pj_breviary { + padding: 0 12px; +} + +.pjbtitle p { + color: #e61329; + font-size: 13.2px; + float: left; + margin: 0; + line-height: 25.2px; + padding-left: 6px; +} + +.pjbcon { + color: #525252; + font-size: 13.2px; + margin: 3px 0; +} + +.pjclass { + color: #909090; + font-size: 13.2px; + margin-bottom: 6px; +} + +.pj_all { + margin: 14px auto; + text-align: center; + width: 99px; + height: 36px; + line-height: 36px; + border: 1px solid #e61329; + color: #e61329; + border-radius: 6px; + font-size: 14.4px; +} + +.shop_info { + background: white; + width: 100%; + margin-bottom: 5px; +} + +.shop_title { + padding: 12px; +} + +.shop_title img { + width: 48px; + height: 48px; + float: left; +} + +.shop_title p { + float: left; + font-size: 16.8px; + color: black; + margin: 0; + margin-top: 3px; + margin-left: 6px; +} + +.shopinfocon {} + +.sicl { + width: 24%; + border-right: 1px solid #e6e6e6; + text-align: center; + float: left; + margin: 6px 0; +} + +.sicl_p1 { + color: #525252; + font-size: 13.2px; +} + +.sicl_p2 { + color: #909090; + font-size: 13.2px; + margin-top: 9px; +} + +.sicr { + text-align: center; + float: left; + width: calc(28% - 3px); +} + +.sicr_p { + color: #909090; + font-size: 12px; +} + +.sicr_p o { + color: #e61329; +} + +.footer { + width: 100%; + height: 50px; + background: white; + position: fixed; + bottom: 0; + left: 0; + border-top: 1px solid #ebebeb; + z-index: 13; +} + +.footerl { + position: relative; + float: left; + height: 50px; + width: calc(14% - 2px); + text-align: center; +} + +.footerl img { + width: 22.8px; + margin-top: 6px; +} + +.footerl p { + width: 100%; + margin: 0; + font-size: 13.2px; + position: absolute; + bottom: 0; +} + +.footerl1 { + position: relative; + width: 13%; + float: left; + height: 50px; + text-align: center; + border-left: 1px solid #ebebeb; +} + +.footerl1 img { + height: 16.8px; + margin-top: 8px; +} + +.footerl1 p { + width: 100%; + margin: 0; + position: absolute; + bottom: 0; + font-size: 13.2px +} + +.footerr1 { + width: 30%; + height: 50px; + line-height: 50px; + text-align: center; + color: white; + background: #ff9402; + float: right; +} + +.footerr2 { + width: 30%; + height: 50px; + line-height: 50px; + text-align: center; + color: white; + background: #E6122B; + float: right; +} + +.imgcon { + border-bottom: 50px solid #ebebeb; +} + +.imgcon img { + width: 100%; + padding: 0 1%; + display: block; +} + +.pswp__top-bar { + margin-top: 20px; +} + +.ccclass { + width: 100%; +} + +.youhuiquan_con { + position: relative; +} + +.yhq_con { + position: absolute; + bottom: 0; + right: 0; + left: 0; + background: white; +} + +.thq_close { + width: 100%; + height: 51px; + background: #E6122B; + color: white; + text-align: center; + line-height: 51px; +} + +.yhqcon { + padding: 3%; +} + +.thq_block { + width: 100%; + border-radius: 6px; + position: relative; +} + +.thq_block img { + width: 100%; +} + +.thq_block p { + position: absolute; + font-size: 35px; + color: white; + top: 50%; + left: 10px; + transform: translateY(-50%); +} +.thq_block span { + position: absolute; + font-size: 18px; + color: white; + top: 50%; + right: 30%; + transform: translateY(-50%); +} +.lq_btn{ + position: absolute; + font-size: 18px; + color: white; + top: 50%; + right: 0; + transform: translateY(-50%); + border: none; + background: transparent; + width: 25%; + height: 60px; +} +.thq_block .lq_btn:hover{ + background: transparent; + +} +.ccclass{ + /*max-height: 800px;*/ +} +.ccclass .mui-scroll-wrapper{ + /*max-height: 500px;*/ +} +#shareout{ + position: relative; +} +#shareout o{ + width: calc(100% - 50px); + display: block; +} +#shareout img{ + position: absolute; + width: 34.4px; + padding: 10px; + right: 20px; + top: 50%; + transform: translateY(-50%); +} +/*秒杀*/ +.banner{ + position: relative; +} +.miaosha{ + /*position: absolute;*/ + width: 100%; + /*padding:0 1%;*/ + bottom: 5px; + left: 0; + right: 0; + z-index: 100000; + position: relative; + background: -moz-linear-gradient(left, #ff0048, #ff3b85); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0048), to(#ff3b85)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff0048, #ff3b85); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff0048, #ff3b85); + /*Opera11*/ + +} +.miaosha img{ + width: 100%; + display: block; +} +.con{ + transform: translateY(-10px); +} +.xiangou{ + position: absolute; + color: white; + bottom: 1%; + left: 44%; + font-size: 13px; +} +.miaosha1{ + position: absolute; + font-size: 30px; + color: white; + top: 18%; + left: 5%; +} +.miaosha1 o{ + font-size: 10px; +} +.miaosha2{ + position: absolute; + font-size: 13px; + color: white; + left: 27%; + bottom: 0; + height: 20px; +} +.miaosha3{ + position: absolute; + left: 65%; + right: 2%; + bottom: 5%; + text-align: center; + font-size: 14px; + color: #ff2870; +} +.miaosha3 o{ + background: #ff2870; + color: white; + margin: 0 2%; + display: inline-block; + padding: 2px 4px; + border-radius: 5px ; +} +.miaosha4{ + font-size: 12px; + color: white; + border: 1px solid white; + position: absolute; + left: 5%; + bottom: 5%; + padding: 0 10px; + border-radius:50px; + height: 16px; + line-height: 14px; +} +.miaosha5{ + position: absolute; + left: 65%; + right: 2%; + top: 10%; + font-weight: bold; + text-align: center; + font-size: 14px; + color: #ff2870; +} +.summarize{ + border-top: none; +} diff --git a/css/discount.css b/css/discount.css new file mode 100644 index 0000000..0228a0c --- /dev/null +++ b/css/discount.css @@ -0,0 +1,263 @@ +body:after { + content: ""; + position: fixed; + /*top: -10px;*/ + bottom: -10px; + left: 0; + width: 100%; + height: 10px; + box-shadow: 0 -0.5vw 2.3vw 3px rgba(25, 25, 25, 0.1); + /*-webkit-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -moz-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -o-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -ms-box-shadow: 0 0.5vw 2.3vw 15px #ccc;*/ + z-index: 100; +} + + +.oc_logo { + /*width: 67.5px;*/ + height: 16.5px; + position: absolute; + margin: 0 auto; + left: 0; + right: 0; + top: 13.75px; +} + +.top { + width: 100%; + height: 16px; + background: white; +} + +.con { + width: 100%; + padding: 0 2%; + transform: translateY(-16px); +} + + + +#timer_swiper .swiper-slide { + color: #101010; + font-size: 13px; + float: left; + padding: 9px 0; + height: 40px; +} +.nav .r{ + float: right; +} + +.con .recommend{ + padding: 5px 0; +} +#timer_swiper .lxy0 .on p{ + color: #00d793; + border-bottom: 4px solid #01de92; +} + +#timer_swiper .lxy1 .on p{ + color: #5f26e6; + border-bottom: 4px solid #64ed13; +} + +.t_con p{ + font-size: 13px; + color: #000; +} + + +.t_con { + width: 100%; + background: #fff; +} + +#timer_swiper { + width: 100%; +} +#timer_swiper .swiper-wrapper .swiper-slide img{ + padding: 3px; + border-radius: 7px; +} +.t_con .swiper-container { + width: 800px; +} + +.t_con .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; + /* Center slide text vertically */ + 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; +} +.on p{ + color: #ee344a; + border-bottom: 3px solid #EE344A; +} + + +#timer_swiper .swiper-slide { + position: relative; +} + +#timer_swiper .swiper-slide img {} + +#timer_swiper .swiper-slide p { + /*position: absolute;*/ +} + + +.con_block { + margin-top: 1px; + width: 100%; + height: 170px; + background: white; + position: relative; +} + +.con_block .img { + width: 109px; + height: 109px; + position: absolute; + top: 30px; + left: 2%; +} + +.con_block .p1 { + width: calc(100% - 130px); + right: 2%; + color: #101010; + font-size: 13px; + position: absolute; + top: 20px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + +.con_block .p2 { + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #ff0000, #ff0066); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0000), to(#ff0066)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff0000, #ff0066); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff0000, #ff0066); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 171px); +} + +.pect{ + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #6600ff, #a200ff); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #6600ff, #a200ff); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #6600ff, #a200ff); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 220px); +} + +.con_block .p3 { + color: #ec3449; + font-size: 15px; + position: absolute; + width: calc(100% - 130px); + right: 2%; + top: 105px; +} + +.con_block .p3 o { + font-size: 13px; +} + +.con_block del { + color: #808080; + font-size: 14px; + position: absolute; + width: calc(100% - 130px); + right: 2%; + top: 120px; +} + +.con_block del o { + font-size: 12px; +} + +.con_block button { + color: white; + background: #ED374C; + font-size: 13px; + padding: 5px 15px; + border-radius: 5px; + position: absolute; + right: 2%; + bottom: 35px; + border: none; +} + +.con_block .p4 { + color: #808080; + font-size: 10px; + position: absolute; + bottom: 10px; + right: 80px; +} + +.con_block progress { + width: 70px; + height: 9px; + border-radius: 10px; + position: absolute; + right: 2%; + bottom: 16px; + background: white; +} + +::-ms-fill { + background: #ED374C; +} + +::-moz-progress-bar { + background: #ED374C; +} + +::-webkit-progress-bar { + background: white; + border: 1px solid #ED374C; + border-radius: 10px; +} + +::-webkit-progress-value { + background: #ED374C; + border-radius: 0 5px 5px 0; +} + + diff --git a/css/discounts.css b/css/discounts.css new file mode 100644 index 0000000..80b1574 --- /dev/null +++ b/css/discounts.css @@ -0,0 +1,21 @@ +.nav{ + width: 100%; + height: 37px; + margin-top: 66px; + border-bottom: 1px solid #e6e6e6; +} +.p1{ + color: #909090; + width: 33.33333333%; + text-align: center; + display: block; + float: left; + line-height: 36px; + font-size: 13.2px; + background: white; +} +.nav .on{ + color: #e51329; +} + + diff --git a/css/dynamic.css b/css/dynamic.css new file mode 100644 index 0000000..f0af0dc --- /dev/null +++ b/css/dynamic.css @@ -0,0 +1,231 @@ +/* 6p */ + +@media all and (min-width: 376px) { + .bc_img,.b_con img { + height: 125px; + } + + .mui-slider { + height: 168px; + } + .mui-slider-item { + height: 168px; + } + .mui-slider .mui-slider-item img { + height: 168px; + width: 100%; + } +} + + +/* 6 */ + +@media all and (min-width: 321px) and (max-width: 375px) { + .bc_img,.b_con img { + height: 113px; + } + .mui-slider { + height: 152px; + } + .mui-slider-item { + height: 152px; + } + .mui-slider .mui-slider-item img { + height: 152px; + width: 100%; + } +} + +/* 5 */ + +@media all and (max-width: 320px) { + .bc_img,.b_con img { + height: 94.5px; + } + .mui-slider { + height: 130px; + } + .mui-slider-item { + height: 130px; + } + .mui-slider .mui-slider-item img { + height: 130px; + width: 100%; + } +} +.con{ + width: 100%; + overflow: hidden; +} +.block { + width: 100%; + margin-bottom: 6px ; + background: white; +} + +.b_title { + width: 100%; + position: relative; + height: 60px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.b_title .b_img { + width: 48px; + height: 48px; + position: absolute; + bottom: 0; + left: 15px; +} + +.storename { + position: absolute; + width: calc(100% - 140px); + color: black; + left: 69px; + top: 15px; + font-size: 16.8px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.time { + position: absolute; + width: calc(100% - 140px); + left: 69px; + color: #909090; + font-size: 13.2px; + top: 38px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.btn_menu { + width: 38px; + height: 38px; + padding: 10px; + position: absolute; + right: 0; + top: 5px; +} + +.b_con { + width: 100%; + padding: 7.5px 13.5px; + font-size: 14.4px; + color: #525252; +} + +.b_footer { + width: 100%; + height: 36px; + position: relative; +} + +.num { + position: absolute; + width: 90px; + top: 7.5px; + left: 15px; +} + +.num img { + width: 18px; + float: left; +} + +.nun p { + float: left; +} + +.zan { + padding: 0 9px 0 12px; + height: 20px; + border: 1px solid #909090; + position: absolute; + background: url(../img/zan1.png) no-repeat 7px center; + background-size: 18px; + border-radius: 9px; + min-width: 45px; + line-height: 18px; + font-size: 14.4px; + color: #909090; + text-indent: 15px; + right: 18px; + bottom: 8px; +} + +.zanon { + padding: 0 9px 0 12px; + height: 20px; + border: 1px solid #e51329; + position: absolute; + background: url(../img/zan2.png) no-repeat 7px center; + background-size: 18px; + border-radius: 9px; + min-width: 45px; + line-height: 18px; + font-size: 14.4px; + color: #e51329; + text-indent: 15px; + right: 18px; + bottom: 8px; +} + +.b_con img { + width: calc(33.33333333333% - 3px); + margin: 1.5px; + float: left; +} + +.btn_gz{ + height: 24px; + text-align: center; + border: 1px solid #e91b34; + line-height: 24px; + color: #e91b31; + border-radius: 15px; + padding: 0 9px; + position: absolute; + right: 18px; + font-size: 12px; + top: 25px; +} + +.btn_gz1{ + height: 24px; + text-align: center; + border: 1px solid #909090; + line-height: 24px; + color: #909090; + border-radius: 15px; + padding: 0 9px; + position: absolute; + right: 18px; + font-size: 12px; + top: 25px; +} + + +.bc_img{ + position: relative; + width: calc(33.33333333333% - 3px); + float: left; + margin: 1.5px; +} +.b_con .bc_img img{ + width: 100%; + margin: 0; +} +.bc_img p{ + position: absolute; + text-align: center; + width: 100%; + background: rgba(0,0,0,0.1); + color: white; + bottom: 0; +} diff --git a/css/editAddress.css b/css/editAddress.css new file mode 100644 index 0000000..e20b71b --- /dev/null +++ b/css/editAddress.css @@ -0,0 +1,48 @@ +.row{ + width: 100%; + height: 42px; + border-bottom: 1px solid #E6E6E6; + line-height: 41px; + background: white; + margin-bottom: 5px; +} +.row input{ + border: none; + margin: 0; +} +.row input::-webkit-input-placeholder{ + font-size: 16px +} +.row select{ + float: left; + margin: 0; + width: 33%; + text-align: center; + font-size: 18px; +} +.row select option{ + text-align: center; +} +textarea{ + border-top: none; + font-size: 17px; +} +.row textarea::-webkit-input-placeholder{ + font-size: 16px +} +.bc_btn{ + margin: 0 auto; + left: 5%; + right: 5%; + /*position: absolute;*/ + width: 90%; + height: 42px; + border: none; + background: #F02C43; + color: white; + font-size: 17px; +} +.add_info,.isdef{ + padding: 0 15px; + font-size: 18px; +} diff --git a/css/essay.css b/css/essay.css new file mode 100644 index 0000000..e69de29 diff --git a/css/essaylist.css b/css/essaylist.css new file mode 100644 index 0000000..12641b4 --- /dev/null +++ b/css/essaylist.css @@ -0,0 +1,22 @@ +.add1{ + width: 96%; + margin: 5px auto; + height: 63px; + background:#C9C9C9; + border:1px solid #C9C9C9; + border-radius: 5px; + display:flex; + justify-content: center; + align-items:center ; + /* margin-top: 10px; */ + } + .addimg{ + width: 40px; + height: 40px; + } + .add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; + } + \ No newline at end of file diff --git a/css/friends.css b/css/friends.css new file mode 100644 index 0000000..ca60847 --- /dev/null +++ b/css/friends.css @@ -0,0 +1,247 @@ +.fri-con-tit { + /* margin-top: 45px; */ + display: flex; + justify-content: space-between; + align-items: center; + /* padding: 15px; */ + flex: 1; + background: #fff; + width: 98%; + margin: 0 auto 5px; +} + +.headerimg { + + width: 78px; + height: 78px; + border-radius: 100px; + border: 3px solid #fff; + margin-right: 10px; +} + +.headerimg img { + width: 100%; +} + +.fri-con-tit .shop_info { + flex: 3; +} + +.fri-con-tit .shop_info p { + font-size: 21px; + color: #666; + font-weight: 300; +} + +.fri-con-tit .shop_info span { + font-size: 17px; + color: #ce2121; + margin-right: 10px; +} + +.fri-con-tit .shop_info .orange { + background: rgba(224, 35, 218, 0.68); + font-size: 14px; + border: 1px solid #ff7900; + border-radius: 10px; + margin-left: 10px; + margin-top: -5px; + display: inline-block; + width: 30px; + height: 20px; + text-align: center; + line-height: 20px; +} + +.fri-con .row { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + position: relative; + padding: 0px 7px; + width: 98%; + margin: 0 auto 5px; + flex: 1; +} + +.row label { + font-size: 17px; + color: #363636; + +} +.row label .lock{ + color: #ce2121; +} +.fri-con { + margin-top: 11px; +} + +.fri-share { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + width: 220px; + margin: 30px auto; + text-align: center; +} + +.fri-share-img { + width: 150px; + height: 150px; +} + +.fri-share-img img { + width: 100%; + height: 100%; +} + +.list_row{ + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; + align-content: flex-start; + background: #fff; + padding-top: 10px; + margin-bottom: 7px; +} +.lock_row{ + display: flex; + justify-content: space-around; + align-items: center; + background: #fff; + /* padding-top: 10px; */ + margin-bottom: 7px; +} + +.lock_row label{ + + display: inline-block; + padding: 10px 5px; + font-size: 13px; + color: #363636; + +} +.lock_row span{ + display: inline-block; + font-size: 13px; + color: #363636; +} +.list_row label{ + display: inline-block; + padding: 0px 8px 10px; + + width: 20%; + font-size: 13px; + color: #363636; +} +.list_row span{ + display: inline-block; + width: 30%; + padding: 0px 8px 10px; + font-size: 13px; + color: #363636; +} +/* 烂笔头 */ +.con{ + +} +.essay-con{ + width: 98%; + margin: 0px auto; + margin-bottom: 5px; + } +.essay-con .row{ + display:flex ; + justify-content: space-between; + align-items: center; + padding: 10px; + background: #eee; + /* height: 20px; */ +} +.essay-con .row .del{ + width: 25px; + height: 25px; +} +.essay-con .row .name{ + font-size: 15px; + + +} +.essay-con .row .del img { + width: 100%; + height: 100%; +} +.row_con{ + display:flex ; + justify-content: space-between; + align-items: center; + background: #fff; +} +.row_con_con{ + display:flex ; + flex-direction: column; + justify-content: space-between; + align-items: center; + padding: 10px; + font-size: 15px; +} +.row_con_con .row_con_con_{ + width: 60px; + height:60px; + padding: 10px; +} +.row_con_con .row_con_con_ img{ + width: 100%; + height: 100%; +} +.essay-con .row .pass { + position: relative; +} +.essay-con .row .pass input{ + width:200px; + margin: 0px; + padding-right: 50px; + +} +.essay-con .row .pass .send{ + width:30px ; + height: 30px; + position: absolute; + right: 3px; + top: 5px; +} +.essay-con .row .pass .send img { + + width: 100%; + height: 100%; + +} +.add1{ + width: 96%; + margin: 35px auto; + height: 63px; + background:#C9C9C9; + border:1px solid #C9C9C9; + border-radius: 5px; + display:flex; + justify-content: center; + align-items:center ; + /* margin-top: 10px; */ + } + .addimg{ + width: 40px; + height: 40px; + } + .add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; + } + + + + diff --git a/css/global.1.css b/css/global.1.css new file mode 100644 index 0000000..eee071f --- /dev/null +++ b/css/global.1.css @@ -0,0 +1,144 @@ +.clearfix:after { + height: 0; + content: " "; + display: block; + overflow: hidden; + clear: both; +} + +.clearfix { + zoom: 1; + /*IE低版本浏览器不支持after伪类所以要加这一句*/ +} + +a { + color: black; +} + +a:active { + color: white; +} + +p { + margin: 0; +} + +input { + margin: 0; +} + +img {} + +.scroll_out { + position: fixed; + top: 66px; + bottom: 50px; + left: 0; + right: 0; +} + +.scroll_out1 { + position: fixed; + top: 66px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out2 { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out3 { + position: fixed; + top: 162px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out4 { + position: fixed; + top: 120px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out_tb { + position: fixed; + top: 64px; + bottom: 50px; + left: 0; + right: 0; +} + +.scroll_out_t { + position: fixed; + top: 64px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +body { + font-family: "微软雅黑"; +} + +.shadown_wai { + box-shadow: 2px 2px 5px rgba(25, 25, 25, 0.2); + border-radius: 5px; + overflow: hidden; + border-top: 1px solid #EFEFF4; + margin-bottom: 1px; +} + +.pect { + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #6600ff, #a200ff); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #6600ff, #a200ff); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #6600ff, #a200ff); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 220px); +} + +.hide { + display: none; +} + +.backTop { + background: #DDDDDD; + border-radius: 50%; + position: fixed; + right: 10px; + bottom: 15px; + width: 38px; + height: 38px; + z-index: 9999; + text-align: center; + font-size: 18px; + color: #666666; + padding-top: 8px; + opacity: 0.8; +} diff --git a/css/global.css b/css/global.css new file mode 100644 index 0000000..a2da44d --- /dev/null +++ b/css/global.css @@ -0,0 +1,144 @@ +.clearfix:after { + height: 0; + content: " "; + display: block; + overflow: hidden; + clear: both; +} + +.clearfix { + zoom: 1; + /*IE低版本浏览器不支持after伪类所以要加这一句*/ +} + +a { + color: black; +} + +a:active { + color: white; +} + +p { + margin: 0; +} + +input { + margin: 0; +} + +img {} + +.scroll_out { + position: fixed; + top: 66px; + bottom: 50px; + left: 0; + right: 0; +} + +.scroll_out1 { + position: fixed; + top: 66px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out2 { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out3 { + position: fixed; + top: 162px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out4 { + position: fixed; + top: 120px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out_tb { + position: fixed; + top: 64px; + bottom: 50px; + left: 0; + right: 0; +} + +.scroll_out_t { + position: fixed; + top: 64px; + bottom: 0; + left: 0; + right: 0; +} + +.scroll_out { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +body { + font-family: "微软雅黑"; +} + +.shadown_wai { + box-shadow: 2px 2px 5px rgba(25, 25, 25, 0.2); + border-radius: 5px; + overflow: hidden; + border-top: 1px solid #EFEFF4; + margin-bottom: 1px; +} + +.pect { + color: #fff; + font-size: 10px; + position: absolute; + background: -moz-linear-gradient(left, #6600ff, #a200ff); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#6600ff), to(#a200ff)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #6600ff, #a200ff); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #6600ff, #a200ff); + /*Opera11*/ + border-radius: 3px; + padding: 0px 2px; + top: 65px; + right: calc(100% - 220px); +} + +.hide { + display: none; +} + +.backTop { + background: #DDDDDD; + border-radius: 50%; + position: fixed; + right: 10px; + bottom: 15px; + width: 38px; + height: 38px; + z-index: 9999; + text-align: center; + font-size: 18px; + color: #666666; + padding-top: 8px; + opacity: 0.8; +} \ No newline at end of file diff --git a/css/goodslist.css b/css/goodslist.css new file mode 100644 index 0000000..fb12ae2 --- /dev/null +++ b/css/goodslist.css @@ -0,0 +1,8 @@ + +.kkkk{ + width: 100%; + height: 66px; +} +.search input{ + margin-top: 20px; +} diff --git a/css/header.css b/css/header.css new file mode 100644 index 0000000..3e2cd83 --- /dev/null +++ b/css/header.css @@ -0,0 +1,100 @@ +header { + padding-top: 18px; + line-height: 48px; + text-align: center; + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ + color: white; + font-size: 18px; + z-index: 10; + position: fixed; + width: 100%; + top: 0; + left: 0; +} +header .nav{ + color: white; + /*text-align: center;*/ +} +.mui-bar{ + height: 66px; + color: white; +} + +.mui-title{ + color: white; + bottom: 0; +} + +a{ + /*color: white;*/ +} + +.mui-bar-nav{ + box-shadow: 0 0 0; +} + + +.header { + width: 100%; + height: 64px; + padding-top: 20px; + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 111111111; + background-color: rgba(255, 255, 255, 1); +} + +.header_con { + position: relative; + width: 100%; + height: 44px; +} + +.mui-action-back{ + position: absolute; + top: 10px; + left: 12px; + z-index: 100; +} +.oc_logo { + width: 20%; + position: absolute; + margin: 0 auto; + left: 0; + right: 0; + bottom: 27%; +} +.header_con .title{ + color: #101010; + font-size: 17px; + position: absolute; + left: 0; + right: 0; + text-align: center; + margin: 0 auto; + bottom: 11.5px; + z-index: 10; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.header_con .header_con_bc{ + color: #101010; + font-size: 17px; + position: absolute; + /* left: 0; */ + right: 10px; + text-align: center; + margin: 0 auto; + bottom: 11.5px; + z-index: 10; +} \ No newline at end of file diff --git a/css/home_new.css b/css/home_new.css new file mode 100644 index 0000000..4c54753 --- /dev/null +++ b/css/home_new.css @@ -0,0 +1,197 @@ +body:after { + content: ""; + position: fixed; + /*top: -10px;*/ + bottom: -10px; + left: 0; + width: 100%; + height: 10px; + box-shadow: 0 -0.5vw 2.3vw 3px rgba(25, 25, 25, 0.1); + /*-webkit-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -moz-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -o-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -ms-box-shadow: 0 0.5vw 2.3vw 15px #ccc;*/ + z-index: 100; +} +body{ + height: 100%; +} +.con { + overflow: hidden; +} + +.news marquee { + font-size: 12px; +} + +.sx { + margin-top: -50px; + height: 50px; + width: 100%; + text-align: center; + font-size: 16px; +} + +.header { + width: 100%; + height: 64px; + /* padding-top: 20px; */ + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 111111111; + background-color: rgba(0, 0, 0, 0); +} + +.header_con { + position: relative; + width: 100%; + height: 44px; +} +.header_con select{ + font-size: 18px; +} +#search { + margin: 0; + width: 65%; + height: 31px; + position: absolute; + left: 15.8%; + right: 21%; + top: 7px; + border-radius: 16px; + border: none; + /*text-indent: 20px;*/ + background-color: rgb(255, 255, 255); + font-size: 15px; + line-height: 34px; + text-indent: 30px; +} + +.searchimg { + width: 12.5px; + height: 12.5px; + position: absolute; + top: 17px; + left: 16.4%; +} + +.search input { + margin: 0; + height: 30px; + border: none; + border-radius: 0; + background: transparent; + padding: 0 40px; + /*padding-left: 50px;*/ +} + +.search select { + border: 1px solid red; + position: absolute; + width: 50px; + height: 29px; + padding: 0; + text-align: center; + border-radius: 0; + padding-left: 0px; + padding-top: 2px; + background: transparent; +} + +.search button { + position: absolute; + right: 0; + top: 0; + border: none; + position: absolute; + width: 50px; + height: 32px; + border-radius: 0; + background: #007AFF; + color: white; + border-radius: 50px; + font-size: 16px; +} + +.saoyisao { + position: absolute; + padding: 5px 10px 0; + width: 52.5px; + height: 37.5px; + top: 1.5px; + right: 1.0%; +} + +.search input { + font-size: 17px; +} + + + +.mui-scroll-wrapper, +.scroll_out { + /*position: relative;*/ + z-index: 10; +} +#pullrefresh .mui-scroll{ + position: relative; +} +#top_banner { + width: 100%; + height: 300px; + margin: 20px auto; + margin: 0; + position: relative; +} + +#top_banner .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; + /* Center slide text vertically */ + 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; +} + +#top_banner .swiper-slide img { + width: 100%; + height: 100%; +} + +#top_banner .swiper-pagination-bullet-active { + background: white; +} + +#top_banner .swiper-pagination-bullet { + background: #eee; +} + +.mui-scroll-wrapper {} + +.lxy_home_zz img{ + width: 100%; + position: absolute; + top: 50%; + left: 0; + right: 0; + margin: 0 auto; + transform: translateY(-50%); +} +.lxy_home_zz input{ + width: 80%; + margin: 40% auto; + height: 25px; + +} \ No newline at end of file diff --git a/css/income-details.css b/css/income-details.css new file mode 100644 index 0000000..348a9a2 --- /dev/null +++ b/css/income-details.css @@ -0,0 +1,74 @@ + + +.idc-total{ + width: 96%; + margin: 0 auto 8px; + height: 60px; + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + padding-left: 5px; + + /* border-bottom: 1px solid #ccc; */ +} +.idc-total h5 { + width: 80%; +} +.idc-total span{ + font-size: 18px; + margin-right: 10px; +} +.idc-list{ + width: 96%; + height: 120px; + background: #FEEAE9; + margin: 0 auto; + /* background: #fff; */ + display: flex; + flex: 1; + align-items: flex-start; + justify-content: space-between; + /* border-bottom: 1px solid #ccc; */ + border: 1px solid #FEEAE9; + border-radius: 5px; + margin-bottom: 8px; + padding-left: 5px; +} +.idc-list-price { + /* flex: 0 0 30%; */ + +} +.idc-list-right { + /* flex: 0 0 70%; */ + flex-direction: column; + justify-content: space-around; + align-items: flex-start; + padding-left: 30px; + position: relative; +} +.idc-list-title { + width: 200px; + font-size:15px; + font-weight: 200; + margin-bottom: 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} +.idc-list-price { + font-size:15px; + color: #F02C43; +} +.idc-list-user{ + + font-size: 13px; + margin-bottom: 15px; + +} +.idc-list-time { + width: 50%; + font-size:12px; + /* color: #F02C43; */ + bottom: 10px; +} \ No newline at end of file diff --git a/css/indent.css b/css/indent.css new file mode 100644 index 0000000..d37e6a9 --- /dev/null +++ b/css/indent.css @@ -0,0 +1,48 @@ +body .header1{ + z-index: 11; + width: 100%; + position: fixed; + top: 0; + background: rgba(255,255,255,1); + border: none; + box-shadow: 0 0 0; + height: 66px; + border-bottom: 1px solid #efefef; +} +.mui-bar-nav.mui-bar .mui-icon { + margin-left: 0; +} +.mui-title{ + color: #909090; +} +.header1 .on{ + border-bottom: 3px solid #ff0000; + color: #e61329; +} +.nav{ + padding: 0 100px; + height: 66px; + text-align: center; +} +.p1{ + color: #000; + display: block; + line-height: 46px; + font-size: 18px; + padding-top: 20px; +} +.header1 .mui-action-back { + margin-top: 20px; + margin-left: 0; + color: #848484; + float: left; +} + +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 49px; + border-top: 1px solid #e6e6e6; +} diff --git a/css/indentcon.css b/css/indentcon.css new file mode 100644 index 0000000..f735425 --- /dev/null +++ b/css/indentcon.css @@ -0,0 +1,283 @@ +.search { + padding: 7.2px 12px; + background: #ebebeb; +} + +.mui-search {} + +.mui-search .mui-placeholder { + background: #fff; +} + +.mui-search input { + background: #fff; + margin-bottom: 0; +} + +.mui-active::before { + margin-top: -10px; +} + +.row_title { + width: 100%; + position: relative; + height: 36px; + background: white; + display: flex; + justify-content: space-between ; + align-items: center; +} + +.store_name { + /* position: absolute; */ + /*background: url(../img/youjiantou.png) no-repeat center right;*/ + /*background-size: 6px;*/ + /* padding-right: 12px; + padding-left: 18px; */ + line-height: 36px; + font-size: 16px; +} + +.indent_status { + /* position: absolute; */ + line-height: 36px; + font-size: 13px; + /* right: 0; + padding-right: 12px; + float: right; */ +} +.yellow{ + color: #ffa800; +} +.shopPhone{ + color:tomato; +} +.shopPhone a{ + text-decoration:underline; + color:tomato; + +} +.confirm_wait{ + color: cadetblue; +} +.confirm_ok{ + color: seagreen; +} +.confirm_no{ + color:red; +} +.row{ + margin-bottom: 5px ; + background: white; + padding: 5px 10px; +} +.row_block { + width: 100%; + /*height: 128px;*/ + border-bottom: 2px solid #fff; + /*background: #efefef;*/ +} + +.row_block img { + width: 117px; + height: 126px; + float: left; + padding: 9px 0 9px 9px; +} + +.rcr { + width: calc(100% - 117px); + float: right; + /*height: 126px;*/ + padding: 12px; + background: #efefef; +} + +.rcrc { + float: left; + width: calc(100% - 85px); +} + +.rcrc p { + height: 42px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + font-size: 18px; + color: black; +} + +.rcrc .leibie{ + color: #909090; +} + + +.rcrr { + width: 80px; + float: right; + margin-right:4px; + text-align: right; +} + + + +.rcrr p { + color: black; + font-size: 18px; +} + +.rcrr del { + color: #909090; + font-size: 18px; + display: block; +} + +.rcrr span { + color: #909090; + font-size: 18px; +} +.combination{ + width: 100%; + height: 37px; + border-bottom: 1px solid #e6e6e6; + background: white; + text-align: right; + font-size: 12px; + line-height: 36px; + padding-right: 15px; +} +.combination o{ + font-size: 14.4px; +} +.btns{ + text-align: right; + width: 100%; + height: 48px; + /*background: white;*/ +} +.btns_btn{ + color: black; + font-size: 14px; + padding:4px 6px 0px; + float: right; + /* line-height: 48px; */ + margin: 9.5px 6px; + border-radius: 30px; + background: -moz-linear-gradient(left, #fcff00, #ffde00); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#fcff00), to(#ffde00)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #fcff00, #ffde00); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #fcff00, #ffde00); + /*Opera11*/ + box-shadow: 1px 1px 5px #ffde00; + +} +.btns .kk{ + border: 1px solid #e6e6e6; + border-radius: 1px; +} + +.btns .qrsh{ + border: 1px solid #e5132c; + color: #e5142a; +} + +.bg_{ + position: fixed; + top: 0; + right: 0; + bottom: 0px; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.1); + +} +.bg_ts{ + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.1); + +} +.bg_con{ + width: 90%; + /*height: 160px;*/ + background: white; + margin: 0 auto; + position: absolute; + left: 0; + right: 0; + bottom: 10px; + /* top: 30%; */ + border-radius: 5px; +} +.bg_con p{ + border-bottom: 1px solid #efefef; + padding:10px 20px; + color: black; +} +.bg_con .info1{ + padding:10px 20px; + color: black; + border-bottom: none; +} +.en_true,.ts_true{ + background: #2AC845; + color: white; + /*position: absolute;*/ + margin-left: 30%; + border: none; + margin-top:10px; + margin-bottom: 5%; +} +.en_false,.ts_false{ + background: #efefef; + color: #909090; + /*position: absolute;*/ + margin-right: 30%; + margin-top:10px; + + border: none; + float: right; +} +#content,#content_ts,#Tmoney{ + margin: 0 5% 5%; + width: 90%; +} +.refundInfo{ + float:left; +} +.refundTxt{ + display: block; + margin: 0 5% 5%; + width: 90% !important; +} +select{ + /*margin: 0;*/ +} +.row_block{ + background: #fbfbfb; +} +.row_block img{ + border-radius: 3px; + overflow: hidden; +} +.rcr { + background: #FBFBFB; +} + +/*20181018*/ +#select{ + margin: 5px 5%; + border: 1px solid rgba(0,0,0,.2)!important; + /*background: red;*/ + width: 90%; +} diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..9bac3de --- /dev/null +++ b/css/index.css @@ -0,0 +1,70 @@ +body{ + background: white; +} + +body .mui-bar-tab { + height: 50px; + background: white; + z-index: 999; +} +body .mui-bar-tab{ + height: 50px; +} +.mui-bar .mui-tab-item .mui-icon img { + height:48px; + padding: 1px; +} +.mui-bar .mui-tab-item .mui-icon{ + padding: 0; + width: 50px; + height: 50px; + line-height: 50px; + display: inline-block; +} +.mui-bar .mui-tab-item{ + height: 50px; + + box-sizing: border-box; + +} +.mui-bar{ + width: 100%; + height: 50px; +} +.mui-bar-tab{ +} +.mui-bar-tab .mui-tab-item .mui-icon{ + top:1; +} +.mui-bar-tab,.mui-bar{ + box-shadow: none +} +.mui-icon{ + position: relative; +} +.nav_in{ + position: absolute; + left: 0; + right: 0; + margin: 0 auto; +} + + +.shun{ + animation: shun 1s; + animation-timing-function: ease-in-out; +} + +.ni{ + animation: ni 1s; + animation-timing-function:ease-in-out; +} + +@keyframes shun{ + from{transform: rotate(0deg);} + to{transform: rotate(360deg);} +} +@keyframes ni{ + from{transform: rotate(0deg);} + to{transform: rotate(-720deg);} +} \ No newline at end of file diff --git a/css/individual.css b/css/individual.css new file mode 100644 index 0000000..05b0d7a --- /dev/null +++ b/css/individual.css @@ -0,0 +1,302 @@ +.individual-title { + height: 60px; + width: 100%; + /* background: #000000; */ + text-align: center; + padding-top: 30px; + /* font-size: 18px; */ + display: flex; + justify-content: space-between; + align-items: center; +} + +.individual-title a { + display: inline-block; + width: 23px; + height: 23px; + background: #242424; + border-radius: 23px; + color: #fff; + padding-top: 3px; + margin-top: 25px; +} +.individual-title span { + display: inline-block; + width: 40px; + font-size: 16px; +} +.mui-action-back { + font-size: 20px; + /* height: 20px; */ + position: absolute; + + left: 15px; + z-index: 100; +} + +.individual-title h3 { + display: inline-block; + width: 80%; + text-align: center; + font-size: 16px; + color: ##c0c0c0; + /* height: 60px; */ + /* padding-top: 35px; */ + padding-left: 50px; + /* margin-top: -3px; */ +} + +.mui-table-view-cell { + width: 100%; + /* height: 50px; */ + display: flex; + justify-content: space-between; + align-items: center; + +} +#headerimg img { + width: 100%; + height: 100%; +} +.mui-table-view-cell label { + width: 35%; + text-align: left; + padding: 0px; + font-size: 15px; +} + +/* .mui-input-row input{ */ +.mui-table-view-cell input ,.mui-table-view-cell p,.mui-table-view-cell textarea{ + padding: 0px; + /* width:calc(100%-100px); */ + font-size: 17px; + margin: 0px; + border: 0px; + text-align: right; +} + + +.addresscon { + width: 100%; + height: 50px; + line-height: 50px; +} + +.addresscon textarea { + display: inline-block; + width: 50%; + height: 50px; + margin: 0px; + padding: 0px; + border: 0px; +} + +.addresscon label { + display: inline-block; + /* width:60px; */ +} + +.addresscon textarea::-webkit-input-placeholder { + text-align: right; + height: 50px; + line-height: 50px; + font-size: 15px; +} + +.mui-table-view-cell input::-webkit-input-placeholder { + text-align: right; +} + +.mui-input-row { + width: 100%; +} + +.mui-table-view-cell .mui-table-view-cell-head { + display:block; + /* width:120px; */ + /* height: 100px; */ + /* background: pink; */ + padding-top: 7px; + + +} + +.mui-table-view-cell-img { + display: block; + width: 50px; + height: 50px; + border-radius: 50px; + overflow: hidden; + float: left; +} +.mui-table-view-cell-img img { + width: 100%; +} +.photo{ + align-self: stretch; + display: inline-block; + width:30% ; +} +.longstr{ + align-self: stretch; + display: inline-block; + width:50% ; + font-size: 15px; +} +.photoimg { + width: 70%; + text-align: right; + overflow: hidden; +} +.info{ + position: relative; + /* display: inline-block; */ + width:37% ; + font-size: 12px; + bottom: 3px; + color: #aaa; +} +.ossfile{ + display: inline-block; + width: 80px; + height: 80px; + /* background: #ccc; */ + /* border: 1px solid #ccc; */ + border-radius: 3px; + position: relative; +} +.ossfile .files_out{ + width: 100%; + height: 100%; +} +.ossfile img{ + width: 100%; + height: 100%; + +} + +.photoimg .mui-icon{ + position: absolute; + top:28px; + left: 30px; + color: #fff; +} +.qrbb ,.qrrz { + height: 60px; +} +.qrbb p,.qrrz p{ + display: inline-block; + width: 50%; + color: #6E6E6E; + font-size: 15px; +} +.mui-table-view-cell-img img { + width: 100%; +} + + +.pheight{ + height: 40px; + line-height: 40px; +} +.thumbnail-img { + width: 100px; + height: 100px; + text-align: center; + background: #fff; + position: relative; + float: left; + /* margin: 0 auto; */ +} + +.thumbnail-img .mui-icon { + width: 70px; + height: 70px; + font-size: 40px; + padding-top: 20px; +} +.thumbnail-img p { + text-align: center; +} +.mui-table-view-cell-img-img { + position: relative; + float: left; + padding-left: 200px; +} +.mui-table-view-cell-hkimg { + /* width:300px; + overflow: hidden; + position: relative; */ + float: left; + /* padding-left: 100px; */ + /* height: 100px; */ + /* background: pink; */ +} +.mui-table-view-cell-hkimg .files_out{ + width: 100px; + height: 100px; + float: left; +} +.mui-table-view-cell-hkimg .files_out img{ + width: 100%; + height: 100px; +} +.hkimg { + width: 100%; + display: none; +} + +.YZTEL{ + margin: 50px auto; + width: 80%; +} +.YZTEL .mui-table-view-cell{ + padding: 5px; +} +.YZTEL label{ + width:25%; +} + + +.mui-table-view .mui-table-view-cell .indiv-tel { + width: 80%; + /* text-align: left; */ + +} +.mui-table-view .mui-table-view-cell .YZM { + display: inline-block; + width: 50%; + text-align: center; +} +.mui-table-view .mui-table-view-cell .YZM::-webkit-input-placeholder{ + text-align: center; +} +.mui-table-view .mui-table-view-cell .HQYZM { + width: 40%; + height: 30px; + font-size: 16px; + line-height: 30px; + color: #8E8E8E; + /* background: #ccc; */ + text-align: center; + border-radius: 5px; + border: 1px solid #ccc; +} +.mui-btn-block { + height: 30px; + line-height: 1px; + width: 70%; + margin:30px auto; + } + .bc_btn { + height: 30px; + line-height: 30px; + + + text-align: center; + width: 70%; + margin: 30px auto; + color: #fff; + background: #FF1A03; + border-radius: 15px; + } diff --git a/css/invest.css b/css/invest.css new file mode 100644 index 0000000..272aa47 --- /dev/null +++ b/css/invest.css @@ -0,0 +1,155 @@ +.con_ { + width: 98%; + margin: 5px auto ; + display: flex; + /* justify-content: space-between; */ + align-items: center; + flex-direction: column; + /* padding: 10px; */ +} +.con_ .top{ + width: 100%; + display: flex; + /* justify-content: space-between; */ + align-items: center; + flex-direction: row; + padding: 10px; + font-size: 14px; + background: #fff; +} +.con_ .bottom{ + width: 100%; + display: flex; + justify-content: flex-start; + align-items: center; + flex-direction: row; + padding: 10px; +} +.con_ .bottom .img { + width: 20px; + height: 20px; +} +.con_ .bottom .img img { + width: 100% ; + height: 100%; +} +.con_ .bottom .pos { + font-size: 15px; +} +.con_ .left { + width: 78px; + height: 78px; + margin-right: 10px ; + /* padding-right: 5px; */ + border-radius: 78px; + border: 3px solid #CF2D28; + overflow: hidden; +} +.con_ .left img { + width: 100%; + height: 100%; +} +.con_ .mid { + flex: 1; + display: flex; + justify-content: space-around; + align-items:flex-start ; + flex-direction: column; + height: 78px; + font-size: 18px; + +} +.con_ .mid .partner { + font-size: 15px; +} +.con_ .mid .timer{ + font-size: 15px; + } +.con_ .right .scale { + width: 78px; + height:78px; + border: 3px solid #CF2D28; + border-radius: 78px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + font-size: 18px; +} +.con_ .right .scale p { + font-size: 18px; +} +.shopName { + margin-bottom: 10px; + text-align: center; +} + +/* 分配券值 start*/ +.nav{ + width: 100%; + height: 40px; + display: flex; + justify-content: space-between; + align-items: center; +} + .nav-item { + width: 50%; + text-align: center; + color: #1D1D1D; +} +.active{ + border-bottom: 1px solid #C24F4A; + color:#C24F4A ; +} +.content .content_ .title { + height: 60px ; + width: 98%; + margin: 0px auto; + text-align: center; + font-size: 18px; + background: #fff; + line-height: 60px; +} +.row { + display: flex; + justify-content: space-between; + align-items: center; + width: 98%; + margin: 0px auto; + background: #fff; + padding: 10px 2px; +} +.row label{ + min-width: 100px; +} +.row input { + margin: 0px; + padding: 0px 3px; + text-align: right; + border: 0px; +} +/* 分配券值 end*/ +/* 按钮*/ +.down { + margin: 55px auto ; + +} +.down .btn { + margin: 0px auto ; + width: 200px; + height: 40px; + line-height: 40px; + text-align: center; + padding: 10px auto; + background: #DD524D; + font-size: 18px; + font-weight: 200; + color: #FDECEA; +} + + + + + + + diff --git a/css/investdetail.css b/css/investdetail.css new file mode 100644 index 0000000..e69de29 diff --git a/css/login.css b/css/login.css new file mode 100644 index 0000000..460f3a8 --- /dev/null +++ b/css/login.css @@ -0,0 +1,350 @@ +.con { + margin-top: 78px; + +} + +.top { + margin-top: 5px; +} + +.header .header_con .title { + /* margin-top: 40px; */ + line-height: 22px; +} + +.logincon { + margin-top: 11px; +} + +.loginbg .header { + background-color: rgba(256, 256, 256, 0.4); +} + +.login_con { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; +} + +.login_con .con { + /* 控制登录页面 */ + margin-top: 0px; +} + +.login_con .con .row { + display: flex; + justify-content: flex-start; + align-items: center; + width: 100%; + height: 42px; + background: white; + border-top: 1px solid #e6e6e6; +} + +.commercial .con, +.supermarket .con, +.shangdu .con { + /* 控制申请商厦 申请商超 申请商都 页面 */ + margin-top: 0px; +} + +.logintop { + width: 98%; + margin: 0 auto 11px; + /* background: #ccc; */ + text-align: center; + padding: 10px; + +} + +.logintop h3 { + font-size: 20px; + margin: 23px auto 33px; + color: #E51329; +} + +.logintop p { + margin: 10px auto; + font-size: 18px; + color: #E51329; +} + +.row { + display: flex; + justify-content: flex-start; + align-items: center; + width: 100%; + height: 42px; + background: white; + border-top: 1px solid #e6e6e6; +} + +.row img { + width: 25.2px; + height: 25.2px; + /* float: left; */ + margin: 7px; + display: inline-block; +} + +.row span { + display: inline-block; +} + +.s_reg { + /* float: left; */ + min-width: 100px; + line-height: 42px; + color: #525252; + font-size: 16px; +} + +.s1 { + /* float: left; */ + /* min-width: 60px; */ + line-height: 42px; + color: #525252; + font-size: 17px; + white-space: nowrap; + /* flex: 1.2; */ +} + +.con .row input { + /* float: left; */ + margin: 0; + width:auto ; + border: none; + font-size: 17px; +} + +.con .row input::-webkit-input-placeholder { + font-size: 17px; +} + +.down { + width: 100%; + padding: 12px; + margin: 15px auto; +} + +.down .btn { + width: 100%; + height: 42px; + text-align: center; + line-height: 42px; + color: white; + background: #f02c43; + padding: 0; +} + +.s2 { + color: #525252; + font-size: 17px; + display: block; + margin-top: 10px; +} + +.pNameCode .s99 { + min-width: 60px; +} + +#register { + float: left; +} + +#fogetpsd { + float: right; +} + +.ac1_left { + width: 100%; + height: 66px; + position: relative; + line-height: 66px; +} + +.con .row .yzm{ + width: 100%; +} +.con .row .tpyzm { + width: calc(100% - 210px); +} + +.con .row #mobileCode, +.con .row #mobileCode1 { + /* width: 110px; */ + float: right; + margin-top: 4px; + text-align: center; + height: 33px; + line-height: 33px; + border-left: 1px solid #e6e6e6; + color: #909090; + font-size: 17px; + padding: 0; + +} +#getMobileCode{ + font-size: 17px; + float: right; +} +.row .yzmhh { + width: 100px; + height: 31px; + margin-top: 5px; +} + +.bottom { + position: relative; + bottom: 10px; + /* background: #ccc; */ + width: 98%; + margin: 7px auto; + +} + +.bottom-con { + display: flex; + justify-content: space-between; + width: 77%; + margin: 33px auto; + +} + +.bottom p { + display: inline-block; + width: 10px; + color: #E51329; + font-size: 17px; + padding-top: 5px; +} + +.zcxy { + /* margin-top: 22px; */ +} + +.zcxytitle { + width: 97%; + height: 36px; + line-height: 36px; + margin: 0px auto 10px; + font-size: 14px; + color: #333333; + background: #fff; + /* box-shadow: 2px 2px 5px rgba(25, 25, 25, 0.2); */ + +} + +.zcxytitle label { + padding: 8px 5px; + font-size: 17px; + +} + +.zcxy .zcxycontent, .con .zcxycontent { + + width: 97%; + margin: 0px auto; + background: pink; + overflow-y: scroll; + height: 300px; + background: #fff; + padding: 10px 4PX; + /* overflow: auto; */ +} + +.zcxycontent h3 { + font-size: 15px; + text-align: center; +} + +.zcxycontent::-webkit-scrollbar { + background: hotpink; + /* display: none!important; */ + width: 0px; + height: 0px; +} + +.hkimg { + width: 100%; + display: none; +} + +.mui-table-view-cell-hkimg { + float: left; +} + +.thumbnail-img { + float: left; + width: 100px; + height: 100px; + text-align: center; + /* background:pink; */ + /* margin: 0 auto; */ +} + +.thumbnail-img .mui-icon { + width: 70px; + height: 70px; + font-size: 40px; + padding-top: 20px; +} + +.mui-table-view-cell-hkimg .files_out { + width: 100px; + height: 100px; + margin: 0 auto; + float: left; +} + +.mui-table-view-cell-hkimg .files_out img { + width: 100%; + height: 100%; +} + +.renzhengphoto { + width: 98%; + margin: 10px auto 0px; + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + padding: 7px; + /* flex: 1; */ +} + +.renzhengphoto label { + width: 100px; + font-size: 13px; + color: #363636; + align-self: flex-start; +} + +.renzhengphoto .photos span { + font-size: 12px; + height: 20px; + /* padding-left: 5px; */ +} + +.ossfile { + display: inline-block; + width: 80px; + height: 80px; + background: #ccc; + border: 1px solid #ccc; + border-radius: 5px; + position: relative; +} + +.files_out { + text-align: center; + padding-top: 24px; +} + +.photos span { + display: inline-block; + font-size: 10px; + color: #959595; + +} diff --git a/css/logistics.css b/css/logistics.css new file mode 100644 index 0000000..240a1a6 --- /dev/null +++ b/css/logistics.css @@ -0,0 +1,117 @@ +body .header1 { + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ +} + +.header1 .p1 { + color: white; +} + +.header1 .mui-action-back { + color: white; +} + +.summarize { + border-bottom: 6px solid #efefef; + background: white; +} + +.summarize img { + float: left; + width: 54px; + height: 54px; + margin: 15px 12px; +} + +.summarizeinfo { + float: left; + width: calc( 100% - 78px); + padding: 3px 0; +} + +.pp1 { + color: #525252; + font-size: 14.4px; +} + +.pp1 o { + color: #e51329; +} + +.pp2 { + color: #525252; + font-size: 12px; +} + +.pp2 o { + color: #e51329; +} + +.track-list { + position: relative; + background: white; +} + +.track-list ul { + margin: 0; + padding-left: 20px; + +} + +ul li { + list-style: none; +} + +.track-list li { + position: relative; + padding: 9px 0 0 25px; + line-height: 18px; + border-left: 1px solid #d9d9d9; + color: #999; +} + +.track-list li.first { + color: red; + padding-top: 9px; + border-left-color: #fff; +} +.track-list li.first p{ + color: #72ca87; +} +.track-list li .node-icon { + position: absolute; + left: -6px; + top: 50%; + width: 11px; + height: 11px; + background: url(../img/order-icons.png) -21px -72px no-repeat; +} + +.track-list li.first .node-icon { + background-position: 0 -72px; +} + +.track-list li .time { + margin-right: 20px; + border-bottom: 1px solid #e6e6e6; + padding-bottom: 9px; +} + +.track-list li .txt { + padding-bottom: 3px; + margin-right: 20px; +} + +.track-list li.first .time { + margin-right: 20px; +} + +.track-list li.first .txt { + max-width: 600px; +} \ No newline at end of file diff --git a/css/map.css b/css/map.css new file mode 100644 index 0000000..ea670c6 --- /dev/null +++ b/css/map.css @@ -0,0 +1,331 @@ +body { + background: #ebebeb; +} +.header { + width: 10rem; + height: 1.25rem; + background: #f23249; +} +.header img { + width: 0.171875rem; + height: 0.5rem; + float: left; + margin-top: 0.375rem; + margin-left: 0.4375rem; +} +.header p { + font-family: "微软雅黑"; + font-size: 0.46875rem; + color: #fff; + line-height: 1.25rem; + margin-left: 4.0625rem; +} +/*header end*/ +.rz_input { + width: 10rem; + background: #fff; + margin-top: 0.3125rem; +} +.rz_input img { + width: 0.5625rem; + height: 0.546875rem; + float: left; + margin-left: 0.234375rem; + margin-top: 0.234375rem; +} +.rz_input .mc .phone { + width: 0.421875rem; + height: 0.546875rem; + margin-right: 0.125rem; +} +.rz_input input { + width: 7.8125rem; + height: 1.015625rem; + margin-left: 0.359375rem; + float: left; + border: none; +} +.mc { + border-bottom: 1px solid #e6e6e6; +} +/*用户名... ed*/ +.time { + width: 10rem; + height: 1.09375rem; + background: #fff; + margin-top: 0.15625rem; + margin-bottom: 0.15625rem; + position: relative; +} +.time p { + font-family: "微软雅黑"; + font-size: 0.34375rem; + line-height: 1.09375rem; + margin-left: 0.265625rem; + float: left; +} +.time #stime { + width: 2.03125rem; + height: 0.78125rem; + text-align: center; + position: absolute; + left: 2.390625rem; + top: 0.125rem; +} +.time #etime { + width: 2.03125rem; + height: 0.78125rem; + text-align: center; + position: absolute; + left: 4.96875rem; + top: 0.125rem; +} +/*time ed*/ +.location { + width: 10rem; + height: 3.5625rem; + background: #fff; +} +.location p { + font-family: "微软雅黑"; + font-size: 0.34375rem; + float: left; + margin-left: 0.28125rem; + margin-top: 0.4375rem; +} +.location select { + width: auto; + padding: 0 1.71875rem; + height: 0.921875rem; + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + float: left; + margin-top: 0.25rem; + margin-left: 0.46875rem; +} +/*location ed*/ +.classification { + width: 10rem; + height: 2.421875rem; + background: #fff; + margin-top: 0.1875rem; +} +.classification p { + font-family: "微软雅黑"; + font-size: 0.34375rem; + color: #222222; + float: left; + margin-left: 0.28125rem; + margin-top: 0.46875rem; +} +.business_fenlei { + position: relative; +} +.business_fenlei select { + width: auto; + padding: 0 1.71875rem; + height: 0.921875rem; + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + float: left; + margin-top: 0.25rem; + margin-left: 0.46875rem; +} +#cat_id_2 { + position: absolute; + top: 1.09375rem; + left: 1.65625rem; +} +/*classification ed*/ +.License { + width: 10rem; + height: 3.796875rem; + background: #fff; + margin-top: 0.1875rem; +} +.upload { + width:100%; + height: 0.859375rem; + border-bottom: 1px solid #e6e6e6; +} +.upload p { + font-family: "微软雅黑"; + font-size: 0.34375rem; + line-height: 0.859375rem; + margin-left: 0.296875rem; +} +/*License ed*/ +.position { + width: 100%; + /* height: 19.53125rem; */ + background: #fff; + margin-top: 0.1875rem; + position: relative; +} +#r-result { + display: flex; + justify-content: space-between; + align-content: center; + height: 30px; + width: 100%; + } + +#r-result p { + font-family: "微软雅黑"; + font-size: 0.34375rem; + width: 100px; + margin-left: 0.296875rem; + margin-top: 0.359375rem; +} +#r-result input { + width:-webkit-calc(100%-100px); + height: 0.890625rem; + margin: 0px; + /* margin-left: 0.46875rem; */ + /* margin-top: 0.15625rem; */ + text-align: center; +} +.points,.right{ + display: flex; + justify-content: space-between; + align-items: center; +} +.points p { + font-family: "微软雅黑"; + font-size: 0.34375rem; + /* float: left; */ + margin-left: 0.296875rem; + margin-top: 0.359375rem; +} +#lng, +#lat { + width: 100px; + /* float: left; */ + margin-left: 0.203125rem; + margin-top: 0.390625rem; + margin-bottom: 0.15625rem; +} +#allmap { + width: 100%; + height: 12.03125rem; + + /* position: absolute; */ + left: 0.234375rem; +} +.map_title { + font-family: "微软雅黑"; + font-size: 0.375rem; + color: #222222; +} +.describe { + position: absolute; + width: 9.6875rem; + height: 6.25rem; + bottom: 1.875rem; + left: 0.125rem; +} +#shop_info { + resize: none; + width: 9.6875rem; + height: 5.46875rem; +} +.qdtj_btn { + width: 9.375rem; + height: 1.09375rem; + background: #f02c43; + position: absolute; + bottom: 0.15625rem; + left: 0.296875rem; + text-align: center; + font-size: 0.40625rem; + color: #fff; + line-height: 1.09375rem; +} +/*btn ed*/ +/*上传图片 start*/ +.container { + width: 55%; + margin-right: 25px; + float: left; +} +.weui_cell { + padding: 0; +} +.weui_cell, +.weui_cell_bd, +.weui_cell_primary, +.weui_cells, +.weui_cells_form { + border: none; + margin: 0; +} +.weui_cells_form::before, +.weui_cells_form::after { + border: none; +} +.weui_uploader_file { + position: relative; +} +.wuf { + float: left; + margin-right: 9px; + margin-bottom: 9px; + width: 79px; + height: 79px; + background: no-repeat center center; + background-size: cover; + position: relative; +} +.del_btn { + width: 20px; + height: 20px; + background: red; + border-radius: 50%; + display: inline-block; + text-align: center; + line-height: 20px; + font-size: 14px; + color: white; + position: absolute; + right: 0; + top: 0; +} +/*上传图片 end*/ +*{ + -webkit-tap-highlight-color: transparent; + +} + + + + #allmap table { + border-collapse:collapse; /*让表格边框细线*/ + border-spacing:0; /*清除边框间距*/ +} + #allmap fieldset,img { + border:0 none; /*有些浏览器默认这些标签有边框,所以要清除默认边框*/ + display:block; +} + #allmap address,#allmap caption,#allmap cite, #allmap code,#allmap dfn, #allmap em,#allmap i,#allmap u,#allmap b,#allmap strong, #allmap th,#allmap var { + font-style:normal; + font-weight:normal; + /*清除标签默认文本样式和加粗*/ +} +#allmap input,#allmap textarea{ + outline:0 none;/*去掉文本框的默认轮廓线*/ +} + #allmap ol,#allmap ul { + list-style:none; /*清除列表默认样式*/ +} +#allmap caption,#allmap th { + text-align:left; /*清除标签默认文本居中对齐*/ +} +#allmap h1,#allmap h2,#allmap h3,#allmap h4,#allmap h5,#allmap h6 { + font-size:100%; + font-weight:normal; /*清除标题标签的默认样式*/ +} +#allmap a{ + text-decoration:none;/*大部分页面中的链接没有下划线*/ +} \ No newline at end of file diff --git a/css/memorandumlist.css b/css/memorandumlist.css new file mode 100644 index 0000000..c2caf0e --- /dev/null +++ b/css/memorandumlist.css @@ -0,0 +1,82 @@ +.con .content { + display: flex; + justify-content: space-between; + flex-direction: column; + /* align-items: center; */ + width: 98%; + margin: 0 auto; + margin-bottom: 5px; + background: #fff; +} +.content .top { + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row; + padding: 5px; +} +.content .top .title { + flex: 1; +} +.content .top .img { + width: 40px; + height: 40px; + margin-right: 10px; +} +.content .top .img img { + width: 100%; + height: 100%; +} +.content .top .oper { + width: 100px; + height: 40px; + align-self: flex-end; + margin-right: 10px; + display: flex; + justify-content: space-between; + align-items: center; +} +.content .top .oper .del{ + width: 30px; + height: 30px; +} +.content .top .oper .del img { + width: 100%; + height: 100%; +} +.content .top .oper .bj{ + width: 30px; + height: 30px +} +.content .top .oper .bj img { + width: 100%; + height: 100%; +} +.content .bottom { + display: flex; + justify-content: space-between; + align-items: center; + margin: 5px; + font-size: 15px; +} +.add1{ + width: 96%; + margin: 35px auto; + height: 63px; + background:#C9C9C9; + border:1px solid #C9C9C9; + border-radius: 5px; + display:flex; + justify-content: center; + align-items:center ; + /* margin-top: 10px; */ + } + .addimg{ + width: 40px; + height: 40px; + } + .add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; + } \ No newline at end of file diff --git a/css/mui.css b/css/mui.css new file mode 100644 index 0000000..52654c7 --- /dev/null +++ b/css/mui.css @@ -0,0 +1,5613 @@ +/*! + * ===================================================== + * Mui v3.7.2 (http://dev.dcloud.net.cn/mui) + * ===================================================== + */ + +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ +html +{ + font-family: sans-serif; + + -webkit-text-size-adjust: 100%; +} + +body +{ + margin: 0; +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary +{ + display: block; +} + +audio, +canvas, +progress, +video +{ + display: inline-block; + + vertical-align: baseline; +} + +audio:not([controls]) +{ + display: none; + + height: 0; +} + +[hidden], +template +{ + display: none; +} + +a +{ + background: transparent; +} + +a:active, +a:hover +{ + outline: 0; +} + +abbr[title] +{ + border-bottom: 1px dotted; +} + +b, +strong +{ + font-weight: bold; +} + +dfn +{ + font-style: italic; +} + +h1 +{ + font-size: 2em; + + margin: .67em 0; +} + +mark +{ + color: #000; + background: #ff0; +} + +small +{ + font-size: 80%; +} + +sub, +sup +{ + font-size: 75%; + line-height: 0; + + position: relative; + + vertical-align: baseline; +} + +sup +{ + top: -.5em; +} + +sub +{ + bottom: -.25em; +} + +img +{ + border: 0; +} + +svg:not(:root) +{ + overflow: hidden; +} + +figure +{ + margin: 1em 40px; +} + +hr +{ + box-sizing: content-box; + height: 0; +} + +pre +{ + overflow: auto; +} + +code, +kbd, +pre, +samp +{ + font-family: monospace, monospace; + font-size: 1em; +} + +button, +input, +optgroup, +select, +textarea +{ + font: inherit; + + margin: 0; + + color: inherit; +} + +button +{ + overflow: visible; +} + +button, +select +{ + text-transform: none; +} + +button, +html input[type='button'], +input[type='reset'], +input[type='submit'] +{ + cursor: pointer; + + -webkit-appearance: button; +} + +button[disabled], +html input[disabled] +{ + cursor: default; +} + +input +{ + line-height: normal; +} + +input[type='checkbox'], +input[type='radio'] +{ + box-sizing: border-box; + padding: 0; +} + +input[type='number']::-webkit-inner-spin-button, +input[type='number']::-webkit-outer-spin-button +{ + height: auto; +} + +input[type='search'] +{ + -webkit-box-sizing: content-box; + box-sizing: content-box; + + -webkit-appearance: textfield; +} + +input[type='search']::-webkit-search-cancel-button, +input[type='search']::-webkit-search-decoration +{ + -webkit-appearance: none; +} + +fieldset +{ + margin: 0 2px; + padding: .35em .625em .75em; + + border: 1px solid #c0c0c0; +} + +legend +{ + padding: 0; + + border: 0; +} + +textarea +{ + overflow: auto; +} + +optgroup +{ + font-weight: bold; +} + +table +{ + border-spacing: 0; + border-collapse: collapse; +} + +td, +th +{ + padding: 0; +} + +* +{ + -webkit-box-sizing: border-box; + box-sizing: border-box; + + -webkit-user-select: none; + + outline: none; + + -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; +} + +body +{ + font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-size: 17px; + line-height: 21px; + + color: #000; + background-color: #efeff4; + + -webkit-overflow-scrolling: touch; +} + +a +{ + text-decoration: none; + + color: #007aff; +} +a:active +{ + color: #0062cc; +} + +.mui-content +{ + background-color: #efeff4; + + -webkit-overflow-scrolling: touch; +} + +.mui-bar-nav ~ .mui-content +{ + padding-top: 44px; +} +.mui-bar-nav ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical +{ + top: 44px; +} + +.mui-bar-header-secondary ~ .mui-content +{ + padding-top: 88px; +} +.mui-bar-header-secondary ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical +{ + top: 88px; +} + +.mui-bar-footer ~ .mui-content +{ + padding-bottom: 44px; +} +.mui-bar-footer ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical +{ + bottom: 44px; +} + +.mui-bar-footer-secondary ~ .mui-content +{ + padding-bottom: 88px; +} +.mui-bar-footer-secondary ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical +{ + bottom: 88px; +} + +.mui-bar-tab ~ .mui-content +{ + padding-bottom: 50px; +} +.mui-bar-tab ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical +{ + bottom: 50px; +} + +.mui-bar-footer-secondary-tab ~ .mui-content +{ + padding-bottom: 94px; +} +.mui-bar-footer-secondary-tab ~ .mui-content.mui-scroll-wrapper .mui-scrollbar-vertical +{ + bottom: 94px; +} + +.mui-content-padded +{ + margin: 10px; +} + +.mui-inline +{ + display: inline-block; + + vertical-align: top; +} + +.mui-block +{ + display: block !important; +} + +.mui-visibility +{ + visibility: visible !important; +} + +.mui-hidden +{ + display: none !important; +} + +.mui-ellipsis +{ + overflow: hidden; + + white-space: nowrap; + text-overflow: ellipsis; +} + +.mui-ellipsis-2 +{ + display: -webkit-box; + overflow: hidden; + + white-space: normal !important; + text-overflow: ellipsis; + word-wrap: break-word; + + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.mui-table +{ + display: table; + + width: 100%; + + table-layout: fixed; +} + +.mui-table-cell +{ + position: relative; + + display: table-cell; +} + +.mui-text-left +{ + text-align: left !important; +} + +.mui-text-center +{ + text-align: center !important; +} + +.mui-text-justify +{ + text-align: justify !important; +} + +.mui-text-right +{ + text-align: right !important; +} + +.mui-pull-left +{ + float: left; +} + +.mui-pull-right +{ + float: right; +} + +.mui-list-unstyled +{ + padding-left: 0; + + list-style: none; +} + +.mui-list-inline +{ + margin-left: -5px; + padding-left: 0; + + list-style: none; +} + +.mui-list-inline > li +{ + display: inline-block; + + padding-right: 5px; + padding-left: 5px; +} + +.mui-clearfix:before, .mui-clearfix:after +{ + display: table; + + content: ' '; +} +.mui-clearfix:after +{ + clear: both; +} + +.mui-bg-primary +{ + background-color: #007aff; +} + +.mui-bg-positive +{ + background-color: #4cd964; +} + +.mui-bg-negative +{ + background-color: #dd524d; +} + +.mui-error +{ + margin: 88px 35px; + padding: 10px; + + border-radius: 6px; + background-color: #bbb; +} + +.mui-subtitle +{ + font-size: 15px; +} + +h1, h2, h3, h4, h5, h6 +{ + line-height: 1; + + margin-top: 5px; + margin-bottom: 5px; +} + +h1, .mui-h1 +{ + font-size: 36px; +} + +h2, .mui-h2 +{ + font-size: 30px; +} + +h3, .mui-h3 +{ + font-size: 24px; +} + +h4, .mui-h4 +{ + font-size: 18px; +} + +h5, .mui-h5 +{ + font-size: 14px; + font-weight: normal; + + color: #8f8f94; +} + +h6, .mui-h6 +{ + font-size: 12px; + font-weight: normal; + + color: #8f8f94; +} + +p +{ + font-size: 14px; + + margin-top: 0; + margin-bottom: 10px; + + color: #8f8f94; +} + +.mui-row:before, .mui-row:after +{ + display: table; + + content: ' '; +} +.mui-row:after +{ + clear: both; +} + +.mui-col-xs-1, .mui-col-sm-1, .mui-col-xs-2, .mui-col-sm-2, .mui-col-xs-3, .mui-col-sm-3, .mui-col-xs-4, .mui-col-sm-4, .mui-col-xs-5, .mui-col-sm-5, .mui-col-xs-6, .mui-col-sm-6, .mui-col-xs-7, .mui-col-sm-7, .mui-col-xs-8, .mui-col-sm-8, .mui-col-xs-9, .mui-col-sm-9, .mui-col-xs-10, .mui-col-sm-10, .mui-col-xs-11, .mui-col-sm-11, .mui-col-xs-12, .mui-col-sm-12 +{ + position: relative; + + min-height: 1px; +} + +.mui-row > [class*='mui-col-'] +{ + float: left; +} + +.mui-col-xs-12 +{ + width: 100%; +} + +.mui-col-xs-11 +{ + width: 91.66666667%; +} + +.mui-col-xs-10 +{ + width: 83.33333333%; +} + +.mui-col-xs-9 +{ + width: 75%; +} + +.mui-col-xs-8 +{ + width: 66.66666667%; +} + +.mui-col-xs-7 +{ + width: 58.33333333%; +} + +.mui-col-xs-6 +{ + width: 50%; +} + +.mui-col-xs-5 +{ + width: 41.66666667%; +} + +.mui-col-xs-4 +{ + width: 33.33333333%; +} + +.mui-col-xs-3 +{ + width: 25%; +} + +.mui-col-xs-2 +{ + width: 16.66666667%; +} + +.mui-col-xs-1 +{ + width: 8.33333333%; +} + +@media (min-width: 400px) +{ + .mui-col-sm-12 + { + width: 100%; + } + + .mui-col-sm-11 + { + width: 91.66666667%; + } + + .mui-col-sm-10 + { + width: 83.33333333%; + } + + .mui-col-sm-9 + { + width: 75%; + } + + .mui-col-sm-8 + { + width: 66.66666667%; + } + + .mui-col-sm-7 + { + width: 58.33333333%; + } + + .mui-col-sm-6 + { + width: 50%; + } + + .mui-col-sm-5 + { + width: 41.66666667%; + } + + .mui-col-sm-4 + { + width: 33.33333333%; + } + + .mui-col-sm-3 + { + width: 25%; + } + + .mui-col-sm-2 + { + width: 16.66666667%; + } + + .mui-col-sm-1 + { + width: 8.33333333%; + } +} +.mui-scroll-wrapper +{ + position: absolute; + z-index: 2; + top: 0; + bottom: 0; + left: 0; + + overflow: hidden; + + width: 100%; +} + +.mui-scroll +{ + position: absolute; + z-index: 1; + + width: 100%; +} + +.mui-scrollbar +{ + position: absolute; + z-index: 9998; + + overflow: hidden; + + -webkit-transition: 500ms; + transition: 500ms; + transform: translateZ(0px); + pointer-events: none; + + opacity: 0; +} + +.mui-scrollbar-vertical +{ + top: 0; + right: 1px; + bottom: 2px; + + width: 4px; +} +.mui-scrollbar-vertical .mui-scrollbar-indicator +{ + width: 100%; +} + +.mui-scrollbar-horizontal +{ + right: 2px; + bottom: 0; + left: 2px; + + height: 4px; +} +.mui-scrollbar-horizontal .mui-scrollbar-indicator +{ + height: 100%; +} + +.mui-scrollbar-indicator +{ + position: absolute; + + display: block; + + box-sizing: border-box; + + -webkit-transition: .01s cubic-bezier(.1, .57, .1, 1); + transition: .01s cubic-bezier(.1, .57, .1, 1); + transform: translate(0px, 0px) translateZ(0px); + + border: 1px solid rgba(255, 255, 255, .80196); + border-radius: 2px; + background: rgba(0, 0, 0, .39804); +} + +.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll-wrapper, .mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll-wrapper +{ + position: absolute; + top: 0; + bottom: 0; + left: 0; + + overflow: hidden; + + width: 100%; +} +.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll, .mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll +{ + position: absolute; + + width: 100%; +} +.mui-plus-pullrefresh .mui-scroll-wrapper, .mui-plus-pullrefresh .mui-slider-group +{ + position: static; + top: auto; + bottom: auto; + left: auto; + + overflow: auto; + + width: auto; +} +.mui-plus-pullrefresh .mui-slider-group +{ + overflow: visible; +} +.mui-plus-pullrefresh .mui-scroll +{ + position: static; + + width: auto; +} + +.mui-off-canvas-wrap .mui-bar +{ + position: absolute !important; + + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-off-canvas-wrap +{ + position: relative; + z-index: 1; + + overflow: hidden; + + width: 100%; + height: 100%; +} +.mui-off-canvas-wrap .mui-inner-wrap +{ + position: relative; + z-index: 1; + + width: 100%; + height: 100%; +} +.mui-off-canvas-wrap .mui-inner-wrap.mui-transitioning +{ + -webkit-transition: -webkit-transform 350ms; + transition: transform 350ms cubic-bezier(.165, .84, .44, 1); +} +.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-left +{ + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); +} +.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-right +{ + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); +} +.mui-off-canvas-wrap.mui-active +{ + overflow: hidden; + + height: 100%; +} +.mui-off-canvas-wrap.mui-active .mui-off-canvas-backdrop +{ + position: absolute; + z-index: 998; + top: 0; + right: 0; + bottom: 0; + left: 0; + + display: block; + + transition: background 350ms cubic-bezier(.165, .84, .44, 1); + + background: rgba(0, 0, 0, .4); + box-shadow: -4px 0 4px rgba(0, 0, 0, .5), 4px 0 4px rgba(0, 0, 0, .5); + + -webkit-tap-highlight-color: transparent; +} +.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-right +{ + z-index: 10000 !important; + + -webkit-transform: translate3d(100%, 0px, 0px); +} +.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-left +{ + z-index: 10000 !important; + + -webkit-transform: translate3d(-100%, 0px, 0px); +} + +.mui-off-canvas-left, .mui-off-canvas-right +{ + position: absolute; + z-index: -1; + top: 0; + bottom: 0; + + visibility: hidden; + + box-sizing: content-box; + width: 70%; + min-height: 100%; + + background: #333; + + -webkit-overflow-scrolling: touch; +} +.mui-off-canvas-left.mui-transitioning, .mui-off-canvas-right.mui-transitioning +{ + -webkit-transition: -webkit-transform 350ms cubic-bezier(.165, .84, .44, 1); + transition: transform 350ms cubic-bezier(.165, .84, .44, 1); +} + +.mui-off-canvas-left +{ + left: 0; +} + +.mui-off-canvas-right +{ + right: 0; +} + +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable +{ + background-color: #333; +} +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable > .mui-off-canvas-left, .mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable > .mui-off-canvas-right +{ + width: 80%; + + -webkit-transform: scale(.8); + transform: scale(.8); + + opacity: .1; +} +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable > .mui-off-canvas-left.mui-transitioning, .mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable > .mui-off-canvas-right.mui-transitioning +{ + -webkit-transition: -webkit-transform 350ms cubic-bezier(.165, .84, .44, 1), opacity 350ms cubic-bezier(.165, .84, .44, 1); + transition: transform 350ms cubic-bezier(.165, .84, .44, 1), opacity 350ms cubic-bezier(.165, .84, .44, 1); +} +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable > .mui-off-canvas-left +{ + -webkit-transform-origin: -100%; + transform-origin: -100%; +} +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable > .mui-off-canvas-right +{ + -webkit-transform-origin: 200%; + transform-origin: 200%; +} +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active > .mui-inner-wrap +{ + -webkit-transform: scale(.8); + transform: scale(.8); +} +.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active > .mui-off-canvas-left, .mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active > .mui-off-canvas-right +{ + -webkit-transform: scale(1); + transform: scale(1); + + opacity: 1; +} + +.mui-loading .mui-spinner +{ + display: block; + + margin: 0 auto; +} + +.mui-spinner +{ + display: inline-block; + + width: 24px; + height: 24px; + + -webkit-transform-origin: 50%; + transform-origin: 50%; + -webkit-animation: spinner-spin 1s step-end infinite; + animation: spinner-spin 1s step-end infinite; +} + +.mui-spinner:after +{ + display: block; + + width: 100%; + height: 100%; + + content: ''; + + background-image: url('data:image/svg+xml;charset=utf-8,'); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; +} + +.mui-spinner-white:after +{ + background-image: url('data:image/svg+xml;charset=utf-8,'); +} + +@-webkit-keyframes spinner-spin +{ + 0% + { + -webkit-transform: rotate(0deg); + } + + 8.33333333% + { + -webkit-transform: rotate(30deg); + } + + 16.66666667% + { + -webkit-transform: rotate(60deg); + } + + 25% + { + -webkit-transform: rotate(90deg); + } + + 33.33333333% + { + -webkit-transform: rotate(120deg); + } + + 41.66666667% + { + -webkit-transform: rotate(150deg); + } + + 50% + { + -webkit-transform: rotate(180deg); + } + + 58.33333333% + { + -webkit-transform: rotate(210deg); + } + + 66.66666667% + { + -webkit-transform: rotate(240deg); + } + + 75% + { + -webkit-transform: rotate(270deg); + } + + 83.33333333% + { + -webkit-transform: rotate(300deg); + } + + 91.66666667% + { + -webkit-transform: rotate(330deg); + } + + 100% + { + -webkit-transform: rotate(360deg); + } +} +@keyframes spinner-spin +{ + 0% + { + transform: rotate(0deg); + } + + 8.33333333% + { + transform: rotate(30deg); + } + + 16.66666667% + { + transform: rotate(60deg); + } + + 25% + { + transform: rotate(90deg); + } + + 33.33333333% + { + transform: rotate(120deg); + } + + 41.66666667% + { + transform: rotate(150deg); + } + + 50% + { + transform: rotate(180deg); + } + + 58.33333333% + { + transform: rotate(210deg); + } + + 66.66666667% + { + transform: rotate(240deg); + } + + 75% + { + transform: rotate(270deg); + } + + 83.33333333% + { + transform: rotate(300deg); + } + + 91.66666667% + { + transform: rotate(330deg); + } + + 100% + { + transform: rotate(360deg); + } +} +input[type='button'], +input[type='submit'], +input[type='reset'], +button, +.mui-btn +{ + font-size: 14px; + font-weight: 400; + line-height: 1.42; + + position: relative; + + display: inline-block; + + margin-bottom: 0; + padding: 6px 12px; + + cursor: pointer; + -webkit-transition: all; + transition: all; + -webkit-transition-timing-function: linear; + transition-timing-function: linear; + -webkit-transition-duration: .2s; + transition-duration: .2s; + text-align: center; + vertical-align: top; + white-space: nowrap; + + color: #333; + border: 1px solid #ccc; + border-radius: 3px; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; + background-color: #fff; + background-clip: padding-box; +} +input[type='button']:enabled:active, input[type='button'].mui-active:enabled, +input[type='submit']:enabled:active, +input[type='submit'].mui-active:enabled, +input[type='reset']:enabled:active, +input[type='reset'].mui-active:enabled, +button:enabled:active, +button.mui-active:enabled, +.mui-btn:enabled:active, +.mui-btn.mui-active:enabled +{ + color: #fff; + background-color: #929292; +} +input[type='button']:disabled, input[type='button'].mui-disabled, +input[type='submit']:disabled, +input[type='submit'].mui-disabled, +input[type='reset']:disabled, +input[type='reset'].mui-disabled, +button:disabled, +button.mui-disabled, +.mui-btn:disabled, +.mui-btn.mui-disabled +{ + opacity: .6; +} + +input[type='submit'], +.mui-btn-primary, +.mui-btn-blue +{ + color: #fff; + border: 1px solid #007aff; + background-color: #007aff; +} +input[type='submit']:enabled:active, input[type='submit'].mui-active:enabled, +.mui-btn-primary:enabled:active, +.mui-btn-primary.mui-active:enabled, +.mui-btn-blue:enabled:active, +.mui-btn-blue.mui-active:enabled +{ + color: #fff; + border: 1px solid #0062cc; + background-color: #0062cc; +} + +.mui-btn-positive, +.mui-btn-success, +.mui-btn-green +{ + color: #fff; + border: 1px solid #4cd964; + background-color: #4cd964; +} +.mui-btn-positive:enabled:active, .mui-btn-positive.mui-active:enabled, +.mui-btn-success:enabled:active, +.mui-btn-success.mui-active:enabled, +.mui-btn-green:enabled:active, +.mui-btn-green.mui-active:enabled +{ + color: #fff; + border: 1px solid #2ac845; + background-color: #2ac845; +} + +.mui-btn-warning, +.mui-btn-yellow +{ + color: #fff; + border: 1px solid #f0ad4e; + background-color: #f0ad4e; +} +.mui-btn-warning:enabled:active, .mui-btn-warning.mui-active:enabled, +.mui-btn-yellow:enabled:active, +.mui-btn-yellow.mui-active:enabled +{ + color: #fff; + border: 1px solid #ec971f; + background-color: #ec971f; +} + +.mui-btn-negative, +.mui-btn-danger, +.mui-btn-red +{ + color: #fff; + border: 1px solid #dd524d; + background-color: #dd524d; +} +.mui-btn-negative:enabled:active, .mui-btn-negative.mui-active:enabled, +.mui-btn-danger:enabled:active, +.mui-btn-danger.mui-active:enabled, +.mui-btn-red:enabled:active, +.mui-btn-red.mui-active:enabled +{ + color: #fff; + border: 1px solid #cf2d28; + background-color: #cf2d28; +} + +.mui-btn-royal, +.mui-btn-purple +{ + color: #fff; + border: 1px solid #8a6de9; + background-color: #8a6de9; +} +.mui-btn-royal:enabled:active, .mui-btn-royal.mui-active:enabled, +.mui-btn-purple:enabled:active, +.mui-btn-purple.mui-active:enabled +{ + color: #fff; + border: 1px solid #6641e2; + background-color: #6641e2; +} + +.mui-btn-grey +{ + color: #fff; + border: 1px solid #c7c7cc; + background-color: #c7c7cc; +} +.mui-btn-grey:enabled:active, .mui-btn-grey.mui-active:enabled +{ + color: #fff; + border: 1px solid #acacb4; + background-color: #acacb4; +} + +.mui-btn-outlined +{ + background-color: transparent; +} +.mui-btn-outlined.mui-btn-primary, .mui-btn-outlined.mui-btn-blue +{ + color: #007aff; +} +.mui-btn-outlined.mui-btn-positive, .mui-btn-outlined.mui-btn-success, .mui-btn-outlined.mui-btn-green +{ + color: #4cd964; +} +.mui-btn-outlined.mui-btn-warning, .mui-btn-outlined.mui-btn-yellow +{ + color: #f0ad4e; +} +.mui-btn-outlined.mui-btn-negative, .mui-btn-outlined.mui-btn-danger, .mui-btn-outlined.mui-btn-red +{ + color: #dd524d; +} +.mui-btn-outlined.mui-btn-royal, .mui-btn-outlined.mui-btn-purple +{ + color: #8a6de9; +} +.mui-btn-outlined.mui-btn-primary:enabled:active, .mui-btn-outlined.mui-btn-blue:enabled:active, .mui-btn-outlined.mui-btn-positive:enabled:active, .mui-btn-outlined.mui-btn-success:enabled:active, .mui-btn-outlined.mui-btn-green:enabled:active, .mui-btn-outlined.mui-btn-warning:enabled:active, .mui-btn-outlined.mui-btn-yellow:enabled:active, .mui-btn-outlined.mui-btn-negative:enabled:active, .mui-btn-outlined.mui-btn-danger:enabled:active, .mui-btn-outlined.mui-btn-red:enabled:active, .mui-btn-outlined.mui-btn-royal:enabled:active, .mui-btn-outlined.mui-btn-purple:enabled:active +{ + color: #fff; +} + +.mui-btn-link +{ + padding-top: 6px; + padding-bottom: 6px; + + color: #007aff; + border: 0; + background-color: transparent; +} +.mui-btn-link:enabled:active, .mui-btn-link.mui-active:enabled +{ + color: #0062cc; + background-color: transparent; +} + +.mui-btn-block +{ + font-size: 18px; + + display: block; + + width: 100%; + margin-bottom: 10px; + padding: 15px 0; +} + +.mui-btn .mui-badge +{ + font-size: 14px; + + margin: -2px -4px -2px 4px; + + background-color: rgba(0, 0, 0, .15); +} + +.mui-btn .mui-badge-inverted, +.mui-btn:enabled:active .mui-badge-inverted +{ + background-color: transparent; +} + +.mui-btn-primary:enabled:active .mui-badge-inverted, +.mui-btn-positive:enabled:active .mui-badge-inverted, +.mui-btn-negative:enabled:active .mui-badge-inverted +{ + color: #fff; +} + +.mui-btn-block .mui-badge +{ + position: absolute; + right: 0; + + margin-right: 10px; +} + +.mui-btn .mui-icon +{ + font-size: inherit; +} + +.mui-btn.mui-icon +{ + font-size: 14px; + line-height: 1.42; +} + +.mui-btn.mui-fab +{ + width: 56px; + height: 56px; + padding: 16px; + + border-radius: 50%; + outline: none; +} +.mui-btn.mui-fab.mui-btn-mini +{ + width: 40px; + height: 40px; + padding: 8px; +} +.mui-btn.mui-fab .mui-icon +{ + font-size: 24px; + line-height: 24px; + + width: 24px; + height: 24px; +} + +.mui-btn .mui-spinner +{ + width: 14px; + height: 14px; + + vertical-align: text-bottom; +} + +.mui-btn-block .mui-spinner +{ + width: 22px; + height: 22px; +} + +.mui-bar +{ + position: fixed; + z-index: 10; + right: 0; + left: 0; + + height: 44px; + padding-right: 10px; + padding-left: 10px; + + border-bottom: 0; + background-color: #f7f7f7; + -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, .85); + box-shadow: 0 0 1px rgba(0, 0, 0, .85); + + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} + +.mui-bar .mui-title +{ + right: 40px; + left: 40px; + + display: inline-block; + overflow: hidden; + + width: auto; + margin: 0; + + text-overflow: ellipsis; +} +.mui-bar .mui-backdrop +{ + background: none; +} + +.mui-bar-header-secondary +{ + top: 44px; +} + +.mui-bar-footer +{ + bottom: 0; +} + +.mui-bar-footer-secondary +{ + bottom: 44px; +} + +.mui-bar-footer-secondary-tab +{ + bottom: 50px; +} + +.mui-bar-footer, +.mui-bar-footer-secondary, +.mui-bar-footer-secondary-tab +{ + border-top: 0; +} + +.mui-bar-transparent +{ + top: 0; + + background-color: rgba(247, 247, 247, 0); + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-bar-nav +{ + top: 0; + + -webkit-box-shadow: 0 1px 6px #ccc; + box-shadow: 0 1px 6px #ccc; +} +.mui-bar-nav ~ .mui-content .mui-anchor +{ + display: block; + visibility: hidden; + + height: 45px; + margin-top: -45px; +} +.mui-bar-nav.mui-bar .mui-icon +{ + margin-right: -10px; + margin-left: -10px; + padding-right: 10px; + padding-left: 10px; +} + +.mui-title +{ + font-size: 17px; + font-weight: 500; + line-height: 44px; + + position: absolute; + + display: block; + + width: 100%; + margin: 0 -10px; + padding: 0; + + text-align: center; + white-space: nowrap; + + color: #000; +} + +.mui-title a +{ + color: inherit; +} + +.mui-bar-tab +{ + bottom: 0; + + display: table; + + width: 100%; + height: 50px; + padding: 0; + + table-layout: fixed; + + border-top: 0; + border-bottom: 0; + + -webkit-touch-callout: none; +} +.mui-bar-tab .mui-tab-item +{ + display: table-cell; + overflow: hidden; + + width: 1%; + height: 50px; + + text-align: center; + vertical-align: middle; + white-space: nowrap; + text-overflow: ellipsis; + + color: #929292; +} +.mui-bar-tab .mui-tab-item.mui-active +{ + color: #007aff; +} +.mui-bar-tab .mui-tab-item .mui-icon +{ + top: 3px; + + width: 24px; + height: 24px; + padding-top: 0; + padding-bottom: 0; +} +.mui-bar-tab .mui-tab-item .mui-icon ~ .mui-tab-label +{ + font-size: 11px; + + display: block; + overflow: hidden; + + text-overflow: ellipsis; +} +.mui-bar-tab .mui-tab-item .mui-icon:active +{ + background: none; +} + +.mui-focusin > .mui-bar-nav, +.mui-focusin > .mui-bar-header-secondary +{ + position: absolute; +} + +.mui-focusin > .mui-bar ~ .mui-content +{ + padding-bottom: 0; +} + +.mui-bar .mui-btn +{ + font-weight: 400; + + position: relative; + z-index: 20; + top: 7px; + + margin-top: 0; + padding: 6px 12px 7px; +} +.mui-bar .mui-btn.mui-pull-right +{ + margin-left: 10px; +} +.mui-bar .mui-btn.mui-pull-left +{ + margin-right: 10px; +} + +.mui-bar .mui-btn-link +{ + font-size: 16px; + line-height: 44px; + + top: 0; + + padding: 0; + + color: #007aff; + border: 0; +} +.mui-bar .mui-btn-link:active, .mui-bar .mui-btn-link.mui-active +{ + color: #0062cc; +} + +.mui-bar .mui-btn-block +{ + font-size: 16px; + + top: 6px; + + margin-bottom: 0; + padding: 5px 0; +} + +.mui-bar .mui-btn-nav.mui-pull-left +{ + margin-left: -5px; +} +.mui-bar .mui-btn-nav.mui-pull-left .mui-icon-left-nav +{ + margin-right: -3px; +} +.mui-bar .mui-btn-nav.mui-pull-right +{ + margin-right: -5px; +} +.mui-bar .mui-btn-nav.mui-pull-right .mui-icon-right-nav +{ + margin-left: -3px; +} +.mui-bar .mui-btn-nav:active +{ + opacity: .3; +} + +.mui-bar .mui-icon +{ + font-size: 24px; + + position: relative; + z-index: 20; + + padding-top: 10px; + padding-bottom: 10px; +} +.mui-bar .mui-icon:active +{ + opacity: .3; +} +.mui-bar .mui-btn .mui-icon +{ + top: 1px; + + margin: 0; + padding: 0; +} +.mui-bar .mui-title .mui-icon +{ + margin: 0; + padding: 0; +} +.mui-bar .mui-title .mui-icon.mui-icon-caret +{ + top: 4px; + + margin-left: -5px; +} + +.mui-bar input[type='search'] +{ + height: 29px; + margin: 6px 0; +} + +.mui-bar .mui-input-row .mui-btn +{ + padding: 12px 10px; +} + +.mui-bar .mui-search:before +{ + margin-top: -10px; +} + +.mui-bar .mui-input-row .mui-input-clear ~ .mui-icon-clear, +.mui-bar .mui-input-row .mui-input-speech ~ .mui-icon-speech +{ + top: 0; + right: 12px; +} + +.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-clear ~ .mui-icon-clear, +.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-speech ~ .mui-icon-speech +{ + top: 0; + right: 0; +} + +.mui-bar .mui-segmented-control +{ + top: 7px; + + width: auto; + margin: 0 auto; +} + +.mui-bar.mui-bar-header-secondary .mui-segmented-control +{ + top: 0; +} + +.mui-badge +{ + font-size: 12px; + line-height: 1; + + display: inline-block; + + padding: 3px 6px; + + color: #333; + border-radius: 100px; + background-color: rgba(0, 0, 0, .15); +} +.mui-badge.mui-badge-inverted +{ + padding: 0 5px 0 0; + + color: #929292; + background-color: transparent; +} + +.mui-badge-primary, .mui-badge-blue +{ + color: #fff; + background-color: #007aff; +} +.mui-badge-primary.mui-badge-inverted, .mui-badge-blue.mui-badge-inverted +{ + color: #007aff; + background-color: transparent; +} + +.mui-badge-success, .mui-badge-green +{ + color: #fff; + background-color: #4cd964; +} +.mui-badge-success.mui-badge-inverted, .mui-badge-green.mui-badge-inverted +{ + color: #4cd964; + background-color: transparent; +} + +.mui-badge-warning, .mui-badge-yellow +{ + color: #fff; + background-color: #f0ad4e; +} +.mui-badge-warning.mui-badge-inverted, .mui-badge-yellow.mui-badge-inverted +{ + color: #f0ad4e; + background-color: transparent; +} + +.mui-badge-danger, .mui-badge-red +{ + color: #fff; + background-color: #dd524d; +} +.mui-badge-danger.mui-badge-inverted, .mui-badge-red.mui-badge-inverted +{ + color: #dd524d; + background-color: transparent; +} + +.mui-badge-royal, .mui-badge-purple +{ + color: #fff; + background-color: #8a6de9; +} +.mui-badge-royal.mui-badge-inverted, .mui-badge-purple.mui-badge-inverted +{ + color: #8a6de9; + background-color: transparent; +} + +.mui-icon .mui-badge +{ + font-size: 10px; + line-height: 1.4; + + position: absolute; + top: -2px; + left: 100%; + + margin-left: -10px; + padding: 1px 5px; + + color: white; + background: red; +} + +.mui-card +{ + font-size: 14px; + + position: relative; + + overflow: hidden; + + margin: 10px; + + border-radius: 2px; + background-color: white; + background-clip: padding-box; + box-shadow: 0 1px 2px rgba(0, 0, 0, .3); +} + +.mui-content > .mui-card:first-child +{ + margin-top: 15px; +} + +.mui-card .mui-input-group:before, .mui-card .mui-input-group:after +{ + height: 0; +} +.mui-card .mui-input-group .mui-input-row:last-child:before, .mui-card .mui-input-group .mui-input-row:last-child:after +{ + height: 0; +} + +.mui-card .mui-table-view +{ + margin-bottom: 0; + + border-top: 0; + border-bottom: 0; + border-radius: 6px; +} +.mui-card .mui-table-view .mui-table-view-divider:first-child, .mui-card .mui-table-view .mui-table-view-cell:first-child +{ + top: 0; + + border-top-left-radius: 6px; + border-top-right-radius: 6px; +} +.mui-card .mui-table-view .mui-table-view-divider:last-child, .mui-card .mui-table-view .mui-table-view-cell:last-child +{ + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; +} +.mui-card .mui-table-view:before, .mui-card .mui-table-view:after +{ + height: 0; +} + +.mui-card > .mui-table-view > .mui-table-view-cell:last-child:before, .mui-card > .mui-table-view > .mui-table-view-cell:last-child:after +{ + height: 0; +} + +.mui-card-header, +.mui-card-footer +{ + position: relative; + + display: -webkit-box; + display: -webkit-flex; + display: flex; + + min-height: 44px; + padding: 10px 15px; + + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + justify-content: space-between; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; +} +.mui-card-header .mui-card-link, +.mui-card-footer .mui-card-link +{ + line-height: 44px; + + position: relative; + + display: -webkit-box; + display: -webkit-flex; + display: flex; + + height: 44px; + margin-top: -10px; + margin-bottom: -10px; + + -webkit-transition-duration: .3s; + transition-duration: .3s; + text-decoration: none; + + -webkit-box-pack: start; + -webkit-justify-content: flex-start; + justify-content: flex-start; + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; +} + +.mui-card-header:after, +.mui-card-footer:before +{ + position: absolute; + top: 0; + right: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} + +.mui-card-header +{ + font-size: 17px; + + border-radius: 2px 2px 0 0; +} +.mui-card-header:after +{ + top: auto; + bottom: 0; +} +.mui-card-header > img:first-child +{ + font-size: 0; + line-height: 0; + + float: left; + + width: 34px; + height: 34px; +} + +.mui-card-footer +{ + color: #6d6d72; + border-radius: 0 0 2px 2px; +} + +.mui-card-content +{ + font-size: 14px; + + position: relative; +} + +.mui-card-content-inner +{ + position: relative; + + padding: 15px; +} + +.mui-card-media +{ + vertical-align: bottom; + + color: #fff; + background-position: center; + background-size: cover; +} + +.mui-card-header.mui-card-media +{ + display: block; + + padding: 10px; +} +.mui-card-header.mui-card-media .mui-media-body +{ + font-size: 14px; + font-weight: 500; + line-height: 17px; + + margin-bottom: 0; + margin-left: 44px; + + color: #333; +} +.mui-card-header.mui-card-media .mui-media-body p +{ + font-size: 13px; + + margin-bottom: 0; +} + +.mui-table-view +{ + position: relative; + + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + + list-style: none; + + background-color: #fff; +} +.mui-table-view:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-table-view:before +{ + position: absolute; + top: 0; + right: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-table-view:before +{ + top: -1px; +} + +.mui-table-view-icon .mui-table-view-cell .mui-navigate-right .mui-icon +{ + font-size: 20px; + + margin-top: -1px; + margin-right: 5px; + margin-left: -5px; +} +.mui-table-view-icon .mui-table-view-cell:after +{ + left: 40px; +} + +.mui-table-view-chevron .mui-table-view-cell +{ + padding-right: 65px; +} +.mui-table-view-chevron .mui-table-view-cell > a:not(.mui-btn) +{ + margin-right: -65px; +} + +.mui-table-view-radio .mui-table-view-cell +{ + padding-right: 65px; +} +.mui-table-view-radio .mui-table-view-cell > a:not(.mui-btn) +{ + margin-right: -65px; +} +.mui-table-view-radio .mui-table-view-cell .mui-navigate-right:after +{ + font-size: 30px; + font-weight: 600; + + right: 9px; + + content: ''; + + color: #007aff; +} +.mui-table-view-radio .mui-table-view-cell.mui-selected .mui-navigate-right:after +{ + content: '\e472'; +} + +.mui-table-view-inverted +{ + color: #fff; + background: #333; +} +.mui-table-view-inverted:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #222; +} +.mui-table-view-inverted:before +{ + position: absolute; + top: 0; + right: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #222; +} +.mui-table-view-inverted .mui-table-view-cell:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 15px; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #222; +} +.mui-table-view-inverted .mui-table-view-cell.mui-active +{ + background-color: #242424; +} +.mui-table-view-inverted .mui-table-view-cell > a:not(.mui-btn).mui-active +{ + background-color: #242424; +} + +.mui-table-view-cell +{ + position: relative; + + overflow: hidden; + + padding: 11px 15px; + + -webkit-touch-callout: none; +} +.mui-table-view-cell:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 15px; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-table-view-cell.mui-radio input[type=radio], .mui-table-view-cell.mui-checkbox input[type=checkbox] +{ + top: 8px; +} +.mui-table-view-cell.mui-radio.mui-left, .mui-table-view-cell.mui-checkbox.mui-left +{ + padding-left: 58px; +} +.mui-table-view-cell.mui-active +{ + background-color: #eee; +} +.mui-table-view-cell:last-child:before, .mui-table-view-cell:last-child:after +{ + height: 0; +} +.mui-table-view-cell > a:not(.mui-btn) +{ + position: relative; + + display: block; + overflow: hidden; + + margin: -11px -15px; + padding: inherit; + + white-space: nowrap; + text-overflow: ellipsis; + + color: inherit; + /*&:active { + background-color: #eee; + }*/ +} +.mui-table-view-cell > a:not(.mui-btn).mui-active +{ + background-color: #eee; +} +.mui-table-view-cell p +{ + margin-bottom: 0; +} + +.mui-table-view-cell.mui-transitioning > .mui-slider-handle, .mui-table-view-cell.mui-transitioning > .mui-slider-left .mui-btn, .mui-table-view-cell.mui-transitioning > .mui-slider-right .mui-btn +{ + -webkit-transition: -webkit-transform 300ms ease; + transition: transform 300ms ease; +} +.mui-table-view-cell.mui-active > .mui-slider-handle +{ + background-color: #eee; +} +.mui-table-view-cell > .mui-slider-handle +{ + position: relative; + + background-color: #fff; +} +.mui-table-view-cell > .mui-slider-handle.mui-navigate-right:after, .mui-table-view-cell > .mui-slider-handle .mui-navigate-right:after +{ + right: 0; +} +.mui-table-view-cell > .mui-slider-handle, .mui-table-view-cell > .mui-slider-left .mui-btn, .mui-table-view-cell > .mui-slider-right .mui-btn +{ + -webkit-transition: -webkit-transform 0ms ease; + transition: transform 0ms ease; +} +.mui-table-view-cell > .mui-slider-left, .mui-table-view-cell > .mui-slider-right +{ + position: absolute; + top: 0; + + display: -webkit-box; + display: -webkit-flex; + display: flex; + + height: 100%; +} +.mui-table-view-cell > .mui-slider-left > .mui-btn, .mui-table-view-cell > .mui-slider-right > .mui-btn +{ + position: relative; + left: 0; + + display: -webkit-box; + display: -webkit-flex; + display: flex; + + padding: 0 30px; + + color: #fff; + border: 0; + border-radius: 0; + + -webkit-box-align: center; + -webkit-align-items: center; + align-items: center; +} +.mui-table-view-cell > .mui-slider-left > .mui-btn:after, .mui-table-view-cell > .mui-slider-right > .mui-btn:after +{ + position: absolute; + z-index: -1; + top: 0; + + width: 600%; + height: 100%; + + content: ''; + + background: inherit; +} +.mui-table-view-cell > .mui-slider-left > .mui-btn.mui-icon, .mui-table-view-cell > .mui-slider-right > .mui-btn.mui-icon +{ + font-size: 30px; +} +.mui-table-view-cell > .mui-slider-right +{ + right: 0; + + -webkit-transition: -webkit-transform 0ms ease; + transition: transform 0ms ease; + -webkit-transform: translateX(100%); + transform: translateX(100%); +} +.mui-table-view-cell > .mui-slider-left +{ + left: 0; + + -webkit-transition: -webkit-transform 0ms ease; + transition: transform 0ms ease; + -webkit-transform: translateX(-100%); + transform: translateX(-100%); +} +.mui-table-view-cell > .mui-slider-left > .mui-btn:after +{ + right: 100%; + + margin-right: -1px; +} + +.mui-table-view-divider +{ + font-weight: 500; + + position: relative; + + margin-top: -1px; + margin-left: 0; + padding-top: 6px; + padding-bottom: 6px; + padding-left: 15px; + + color: #999; + background-color: #fafafa; +} +.mui-table-view-divider:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-table-view-divider:before +{ + position: absolute; + top: 0; + right: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} + +.mui-table-view .mui-media, +.mui-table-view .mui-media-body +{ + overflow: hidden; +} + +.mui-table-view .mui-media-large .mui-media-object +{ + line-height: 80px; + + max-width: 80px; + height: 80px; +} +.mui-table-view .mui-media .mui-subtitle +{ + color: #000; +} +.mui-table-view .mui-media-object +{ + line-height: 42px; + + max-width: 42px; + height: 42px; +} +.mui-table-view .mui-media-object.mui-pull-left +{ + margin-right: 10px; +} +.mui-table-view .mui-media-object.mui-pull-right +{ + margin-left: 10px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object +{ + line-height: 29px; + + max-width: 29px; + height: 29px; + margin: -4px 0; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object img +{ + line-height: 29px; + + max-width: 29px; + height: 29px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object.mui-pull-left +{ + margin-right: 10px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object .mui-icon +{ + font-size: 29px; +} +.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-body:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 55px; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-table-view .mui-table-view-cell.mui-media-icon:after +{ + height: 0 !important; +} + +.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view +{ + display: block; +} +.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:before, .mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:after +{ + height: 0 !important; +} +.mui-table-view.mui-unfold .mui-table-view-cell.mui-media-icon.mui-collapse .mui-media-body:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 70px; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} + +.mui-table-view-cell > .mui-btn, +.mui-table-view-cell > .mui-badge, +.mui-table-view-cell > .mui-switch, +.mui-table-view-cell > a > .mui-btn, +.mui-table-view-cell > a > .mui-badge, +.mui-table-view-cell > a > .mui-switch +{ + position: absolute; + top: 50%; + right: 15px; + + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} +.mui-table-view-cell .mui-navigate-right > .mui-btn, +.mui-table-view-cell .mui-navigate-right > .mui-badge, +.mui-table-view-cell .mui-navigate-right > .mui-switch, +.mui-table-view-cell .mui-push-left > .mui-btn, +.mui-table-view-cell .mui-push-left > .mui-badge, +.mui-table-view-cell .mui-push-left > .mui-switch, +.mui-table-view-cell .mui-push-right > .mui-btn, +.mui-table-view-cell .mui-push-right > .mui-badge, +.mui-table-view-cell .mui-push-right > .mui-switch, +.mui-table-view-cell > a .mui-navigate-right > .mui-btn, +.mui-table-view-cell > a .mui-navigate-right > .mui-badge, +.mui-table-view-cell > a .mui-navigate-right > .mui-switch, +.mui-table-view-cell > a .mui-push-left > .mui-btn, +.mui-table-view-cell > a .mui-push-left > .mui-badge, +.mui-table-view-cell > a .mui-push-left > .mui-switch, +.mui-table-view-cell > a .mui-push-right > .mui-btn, +.mui-table-view-cell > a .mui-push-right > .mui-badge, +.mui-table-view-cell > a .mui-push-right > .mui-switch +{ + right: 35px; +} + +.mui-content > .mui-table-view:first-child +{ + margin-top: 15px; +} + +.mui-table-view-cell.mui-collapse .mui-table-view:before, .mui-table-view-cell.mui-collapse .mui-table-view:after +{ + height: 0; +} +.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:last-child:after +{ + height: 0; +} +.mui-table-view-cell.mui-collapse > .mui-navigate-right:after, .mui-table-view-cell.mui-collapse > .mui-push-right:after +{ + content: '\e581'; +} +.mui-table-view-cell.mui-collapse.mui-active +{ + margin-top: -1px; +} +.mui-table-view-cell.mui-collapse.mui-active .mui-table-view, .mui-table-view-cell.mui-collapse.mui-active .mui-collapse-content +{ + display: block; +} +.mui-table-view-cell.mui-collapse.mui-active > .mui-navigate-right:after, .mui-table-view-cell.mui-collapse.mui-active > .mui-push-right:after +{ + content: '\e580'; +} +.mui-table-view-cell.mui-collapse.mui-active .mui-table-view-cell > a:not(.mui-btn).mui-active +{ + margin-left: -31px; + padding-left: 47px; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content +{ + position: relative; + + display: none; + overflow: hidden; + + margin: 11px -15px -11px; + padding: 8px 15px; + + -webkit-transition: height .35s ease; + -o-transition: height .35s ease; + transition: height .35s ease; + + background: white; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content > .mui-input-group, .mui-table-view-cell.mui-collapse .mui-collapse-content > .mui-slider +{ + width: auto; + height: auto; + margin: -8px -15px; +} +.mui-table-view-cell.mui-collapse .mui-collapse-content > .mui-slider +{ + margin: -8px -16px; +} +.mui-table-view-cell.mui-collapse .mui-table-view +{ + display: none; + + margin-top: 11px; + margin-right: -15px; + margin-bottom: -11px; + margin-left: -15px; + + border: 0; +} +.mui-table-view-cell.mui-collapse .mui-table-view.mui-table-view-chevron +{ + margin-right: -65px; +} +.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell +{ + padding-left: 31px; + + background-position: 31px 100%; +} +.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 30px; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} + +.mui-table-view.mui-grid-view +{ + font-size: 0; + + display: block; + + width: 100%; + padding: 0 10px 10px 0; + + white-space: normal; +} +.mui-table-view.mui-grid-view .mui-table-view-cell +{ + font-size: 17px; + + display: inline-block; + + margin-right: -4px; + padding: 10px 0 0 14px; + + text-align: center; + vertical-align: middle; + + background: none; +} +.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-object +{ + width: 100%; + max-width: 100%; + height: auto; +} +.mui-table-view.mui-grid-view .mui-table-view-cell > a:not(.mui-btn) +{ + margin: -10px 0 0 -14px; +} +.mui-table-view.mui-grid-view .mui-table-view-cell > a:not(.mui-btn):active, .mui-table-view.mui-grid-view .mui-table-view-cell > a:not(.mui-btn).mui-active +{ + background: none; +} +.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body +{ + font-size: 15px; + line-height: 15px; + + display: block; + + width: 100%; + height: 15px; + margin-top: 8px; + + text-overflow: ellipsis; + + color: #333; +} +.mui-table-view.mui-grid-view .mui-table-view-cell:before, .mui-table-view.mui-grid-view .mui-table-view-cell:after +{ + height: 0; +} + +.mui-grid-view.mui-grid-9 +{ + margin: 0; + padding: 0; + + border-top: 1px solid #eee; + border-left: 1px solid #eee; + background-color: #f2f2f2; +} +.mui-grid-view.mui-grid-9:before, .mui-grid-view.mui-grid-9:after +{ + display: table; + + content: ' '; +} +.mui-grid-view.mui-grid-9:after +{ + clear: both; +} +.mui-grid-view.mui-grid-9:after +{ + position: static; +} +.mui-grid-view.mui-grid-9 .mui-table-view-cell +{ + margin: 0; + padding: 11px 15px; + + vertical-align: top; + + border-right: 1px solid #eee; + border-bottom: 1px solid #eee; +} +.mui-grid-view.mui-grid-9 .mui-table-view-cell.mui-active +{ + background-color: #eee; +} +.mui-grid-view.mui-grid-9 .mui-table-view-cell > a:not(.mui-btn) +{ + margin: 0; + padding: 10px 0; +} +.mui-grid-view.mui-grid-9:before +{ + height: 0; +} +.mui-grid-view.mui-grid-9 .mui-media +{ + color: #797979; +} +.mui-grid-view.mui-grid-9 .mui-media .mui-icon +{ + font-size: 2.4em; + + position: relative; +} + +.mui-slider-cell +{ + position: relative; +} +.mui-slider-cell > .mui-slider-handle +{ + z-index: 1; +} +.mui-slider-cell > .mui-slider-left, .mui-slider-cell > .mui-slider-right +{ + position: absolute; + z-index: 0; + top: 0; + bottom: 0; +} +.mui-slider-cell > .mui-slider-left +{ + left: 0; +} +.mui-slider-cell > .mui-slider-right +{ + right: 0; +} + +input, +textarea, +select +{ + font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-size: 17px; + + -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; +} +input:focus, +textarea:focus, +select:focus +{ + -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; + -webkit-user-modify: read-write-plaintext-only; +} + +select, +textarea, +input[type='text'], +input[type='search'], +input[type='password'], +input[type='datetime'], +input[type='datetime-local'], +input[type='date'], +input[type='month'], +input[type='time'], +input[type='week'], +input[type='number'], +input[type='email'], +input[type='url'], +input[type='tel'], +input[type='color'] +{ + line-height: 21px; + + width: 100%; + height: 40px; + margin-bottom: 15px; + padding: 10px 15px; + + -webkit-user-select: text; + + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 3px; + outline: none; + background-color: #fff; + + -webkit-appearance: none; +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button +{ + margin: 0; + + -webkit-appearance: none; +} + +input[type='search'] +{ + font-size: 16px; + + -webkit-box-sizing: border-box; + box-sizing: border-box; + height: 34px; + + text-align: center; + + border: 0; + border-radius: 6px; + background-color: rgba(0, 0, 0, .1); +} + +input[type='search']:focus +{ + text-align: left; +} + +textarea +{ + height: auto; + + resize: none; +} + +select +{ + font-size: 14px; + + height: auto; + margin-top: 1px; + + border: 0 !important; + background-color: #fff; +} +select:focus +{ + -webkit-user-modify: read-only; +} + +.mui-input-group +{ + position: relative; + + padding: 0; + + border: 0; + background-color: #fff; +} +.mui-input-group:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-input-group:before +{ + position: absolute; + top: 0; + right: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} + +.mui-input-group input, +.mui-input-group textarea +{ + margin-bottom: 0; + + border: 0; + border-radius: 0; + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-input-group input[type='search'] +{ + background: none; +} + +.mui-input-group input:last-child +{ + background-image: none; +} + +.mui-input-row +{ + clear: left; + overflow: hidden; +} +.mui-input-row select +{ + font-size: 17px; + + height: 37px; + padding: 0; +} + +.mui-input-row:last-child, +.mui-input-row label + input, .mui-input-row .mui-btn + input +{ + background: none; +} + +.mui-input-group .mui-input-row +{ + height: 40px; +} +.mui-input-group .mui-input-row:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 15px; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} + +.mui-input-row label +{ + font-family: 'Helvetica Neue', Helvetica, sans-serif; + line-height: 1.1; + + float: left; + + width: 35%; + padding: 11px 15px; +} + +.mui-input-row label ~ input, .mui-input-row label ~ select, .mui-input-row label ~ textarea +{ + float: right; + + width: 65%; + margin-bottom: 0; + padding-left: 0; + + border: 0; +} + +.mui-input-row .mui-btn +{ + line-height: 1.1; + + float: right; + + width: 15%; + padding: 10px 15px; +} + +.mui-input-row .mui-btn ~ input, .mui-input-row .mui-btn ~ select, .mui-input-row .mui-btn ~ textarea +{ + float: left; + + width: 85%; + margin-bottom: 0; + padding-left: 0; + + border: 0; +} + +.mui-button-row +{ + position: relative; + + padding-top: 5px; + + text-align: center; +} + +.mui-input-group .mui-button-row +{ + height: 45px; +} + +.mui-input-row +{ + position: relative; +} +.mui-input-row.mui-input-range +{ + overflow: visible; + + padding-right: 20px; +} +.mui-input-row .mui-inline +{ + padding: 8px 0; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear, .mui-input-row .mui-input-speech ~ .mui-icon-speech, .mui-input-row .mui-input-password ~ .mui-icon-eye +{ + font-size: 20px; + + position: absolute; + z-index: 1; + top: 10px; + right: 0; + + width: 38px; + height: 38px; + + text-align: center; + + color: #999; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear.mui-active, .mui-input-row .mui-input-speech ~ .mui-icon-speech.mui-active, .mui-input-row .mui-input-password ~ .mui-icon-eye.mui-active +{ + color: #007aff; +} +.mui-input-row .mui-input-speech ~ .mui-icon-speech +{ + font-size: 24px; + + top: 8px; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear ~ .mui-icon-speech +{ + display: none; +} +.mui-input-row .mui-input-clear ~ .mui-icon-clear.mui-hidden ~ .mui-icon-speech +{ + display: inline-block; +} +.mui-input-row .mui-icon-speech ~ .mui-placeholder +{ + right: 38px; +} +.mui-input-row.mui-search .mui-icon-clear +{ + top: 7px; +} +.mui-input-row.mui-search .mui-icon-speech +{ + top: 5px; +} + +.mui-radio, .mui-checkbox +{ + position: relative; +} +.mui-radio label, .mui-checkbox label +{ + display: inline-block; + float: none; + + width: 100%; + padding-right: 58px; +} + +.mui-radio.mui-left input[type='radio'], .mui-checkbox.mui-left input[type='checkbox'] +{ + left: 20px; +} + +.mui-radio.mui-left label, .mui-checkbox.mui-left label +{ + padding-right: 15px; + padding-left: 58px; +} + +.mui-radio input[type='radio'], .mui-checkbox input[type='checkbox'] +{ + position: absolute; + top: 4px; + right: 20px; + + display: inline-block; + + width: 28px; + height: 26px; + + border: 0; + outline: 0 !important; + background-color: transparent; + + -webkit-appearance: none; +} +.mui-radio input[type='radio'][disabled]:before, .mui-checkbox input[type='checkbox'][disabled]:before +{ + opacity: .3; +} +.mui-radio input[type='radio']:before, .mui-checkbox input[type='checkbox']:before +{ + font-family: Muiicons; + font-size: 28px; + font-weight: normal; + line-height: 1; + + text-decoration: none; + + color: #aaa; + border-radius: 0; + background: none; + + -webkit-font-smoothing: antialiased; +} +.mui-radio input[type='radio']:checked:before, .mui-checkbox input[type='checkbox']:checked:before +{ + color: #007aff; +} + +.mui-radio.mui-disabled label, .mui-radio label.mui-disabled, .mui-checkbox.mui-disabled label, .mui-checkbox label.mui-disabled +{ + opacity: .4; +} + +.mui-radio input[type='radio']:before +{ + content: '\e411'; +} + +.mui-radio input[type='radio']:checked:before +{ + content: '\e441'; +} + +.mui-checkbox input[type='checkbox']:before +{ + content: '\e411'; +} + +.mui-checkbox input[type='checkbox']:checked:before +{ + content: '\e442'; +} + +.mui-select +{ + position: relative; +} + +.mui-select:before +{ + font-family: Muiicons; + + position: absolute; + top: 8px; + right: 21px; + + content: '\e581'; + + color: rgba(170, 170, 170, .6); +} + +.mui-input-row .mui-switch +{ + float: right; + + margin-top: 5px; + margin-right: 20px; +} + +.mui-input-range +{ + /*input[type="range"] { + -webkit-appearance: none; + background: #999; + height: 36px; + border-radius: 1px; + overflow: hidden; + margin-top: 2px; + margin-bottom: 2px; + outline:none; + position:relative; + width:100%; + }*/ + /*input[type='range']::-webkit-slider-thumb { + -webkit-appearance: none!important; + opacity: 0.5; + height:28px; + width:28px; + border-radius: 50%; + background:#00b7fb; + position: relative; + pointer-events: none; + -webkit-box-sizing: border-box; + box-sizing: border-box; + &:before{ + position: absolute; + top: 13px; + left: -2000px; + width: 2000px; + height: 2px; + background: #00b7fb; + content:' '; + } + }*/ +} +.mui-input-range input[type='range'] +{ + position: relative; + + width: 100%; + height: 2px; + margin: 17px 0; + padding: 0; + + cursor: pointer; + + border: 0; + border-radius: 3px; + outline: none; + background-color: #999; + + -webkit-appearance: none !important; +} +.mui-input-range input[type='range']::-webkit-slider-thumb +{ + width: 28px; + height: 28px; + + border-color: #0062cc; + border-radius: 50%; + background-color: #007aff; + background-clip: padding-box; + + -webkit-appearance: none !important; +} +.mui-input-range label ~ input[type='range'] +{ + width: 65%; +} +.mui-input-range .mui-tooltip +{ + font-size: 36px; + line-height: 64px; + + position: absolute; + z-index: 1; + top: -70px; + + width: 64px; + height: 64px; + + text-align: center; + + opacity: .8; + color: #333; + border: 1px solid #ddd; + border-radius: 6px; + background-color: #fff; + text-shadow: 0 1px 0 #f3f3f3; +} + +.mui-search +{ + position: relative; +} +.mui-search input[type='search'] +{ + padding-left: 30px; +} +.mui-search .mui-placeholder +{ + font-size: 16px; + line-height: 34px; + + position: absolute; + z-index: 1; + top: 0; + right: 0; + bottom: 0; + left: 0; + + display: inline-block; + + height: 34px; + + text-align: center; + + color: #999; + border: 0; + border-radius: 6px; + background: none; +} +.mui-search .mui-placeholder .mui-icon +{ + font-size: 20px; + + color: #333; +} +.mui-search:before +{ + font-family: Muiicons; + font-size: 20px; + font-weight: normal; + + position: absolute; + top: 50%; + right: 50%; + + display: none; + + margin-top: -18px; + margin-right: 31px; + + content: '\e466'; +} +.mui-search.mui-active:before +{ + font-size: 20px; + + right: auto; + left: 5px; + + display: block; + + margin-right: 0; +} +.mui-search.mui-active input[type='search'] +{ + text-align: left; +} +.mui-search.mui-active .mui-placeholder +{ + display: none; +} + +.mui-segmented-control +{ + font-size: 15px; + font-weight: 400; + + position: relative; + + display: table; + overflow: hidden; + + width: 100%; + + table-layout: fixed; + + border: 1px solid #007aff; + border-radius: 3px; + background-color: transparent; + + -webkit-touch-callout: none; +} +.mui-segmented-control.mui-segmented-control-vertical +{ + border-collapse: collapse; + + border-width: 0; + border-radius: 0; +} +.mui-segmented-control.mui-segmented-control-vertical .mui-control-item +{ + display: block; + + border-bottom: 1px solid #c8c7cc; + border-left-width: 0; +} +.mui-segmented-control.mui-scroll-wrapper +{ + height: 38px; +} +.mui-segmented-control.mui-scroll-wrapper .mui-scroll +{ + width: auto; + height: 40px; + + white-space: nowrap; +} +.mui-segmented-control.mui-scroll-wrapper .mui-control-item +{ + display: inline-block; + + width: auto; + padding: 0 20px; + + border: 0; +} +.mui-segmented-control .mui-control-item +{ + line-height: 38px; + + display: table-cell; + overflow: hidden; + + width: 1%; + + -webkit-transition: background-color .1s linear; + transition: background-color .1s linear; + text-align: center; + white-space: nowrap; + text-overflow: ellipsis; + + color: #007aff; + border-color: #007aff; + border-left: 1px solid #007aff; +} +.mui-segmented-control .mui-control-item:first-child +{ + border-left-width: 0; +} +.mui-segmented-control .mui-control-item.mui-active +{ + color: #fff; + background-color: #007aff; +} +.mui-segmented-control.mui-segmented-control-inverted +{ + width: 100%; + + border: 0; + border-radius: 0; +} +.mui-segmented-control.mui-segmented-control-inverted.mui-segmented-control-vertical .mui-control-item +{ + border-bottom: 1px solid #c8c7cc; +} +.mui-segmented-control.mui-segmented-control-inverted.mui-segmented-control-vertical .mui-control-item.mui-active +{ + border-bottom: 1px solid #c8c7cc; +} +.mui-segmented-control.mui-segmented-control-inverted .mui-control-item +{ + color: inherit; + border: 0; +} +.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active +{ + color: #007aff; + border-bottom: 2px solid #007aff; + background: none; +} +.mui-segmented-control.mui-segmented-control-inverted ~ .mui-slider-progress-bar +{ + background-color: #007aff; +} + +.mui-segmented-control-positive +{ + border: 1px solid #4cd964; +} +.mui-segmented-control-positive .mui-control-item +{ + color: #4cd964; + border-color: inherit; +} +.mui-segmented-control-positive .mui-control-item.mui-active +{ + color: #fff; + background-color: #4cd964; +} +.mui-segmented-control-positive.mui-segmented-control-inverted .mui-control-item.mui-active +{ + color: #4cd964; + border-bottom: 2px solid #4cd964; + background: none; +} +.mui-segmented-control-positive.mui-segmented-control-inverted ~ .mui-slider-progress-bar +{ + background-color: #4cd964; +} + +.mui-segmented-control-negative +{ + border: 1px solid #dd524d; +} +.mui-segmented-control-negative .mui-control-item +{ + color: #dd524d; + border-color: inherit; +} +.mui-segmented-control-negative .mui-control-item.mui-active +{ + color: #fff; + background-color: #dd524d; +} +.mui-segmented-control-negative.mui-segmented-control-inverted .mui-control-item.mui-active +{ + color: #dd524d; + border-bottom: 2px solid #dd524d; + background: none; +} +.mui-segmented-control-negative.mui-segmented-control-inverted ~ .mui-slider-progress-bar +{ + background-color: #dd524d; +} + +.mui-control-content +{ + position: relative; + + display: none; +} +.mui-control-content.mui-active +{ + display: block; +} + +.mui-popover +{ + position: absolute; + z-index: 999; + + display: none; + + width: 280px; + + -webkit-transition: opacity .3s; + transition: opacity .3s; + -webkit-transition-property: opacity; + transition-property: opacity; + -webkit-transform: none; + transform: none; + + opacity: 0; + border-radius: 7px; + background-color: #f7f7f7; + -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, .1); + box-shadow: 0 0 15px rgba(0, 0, 0, .1); +} +.mui-popover .mui-popover-arrow +{ + position: absolute; + z-index: 1000; + top: -25px; + left: 0; + + overflow: hidden; + + width: 26px; + height: 26px; +} +.mui-popover .mui-popover-arrow:after +{ + position: absolute; + top: 19px; + left: 0; + + width: 26px; + height: 26px; + + content: ' '; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + + border-radius: 3px; + background: #f7f7f7; +} +.mui-popover .mui-popover-arrow.mui-bottom +{ + top: 100%; + left: -26px; + + margin-top: -1px; +} +.mui-popover .mui-popover-arrow.mui-bottom:after +{ + top: -19px; + left: 0; +} +.mui-popover.mui-popover-action +{ + bottom: 0; + + width: 100%; + + -webkit-transition: -webkit-transform .3s, opacity .3s; + transition: transform .3s, opacity .3s; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + + border-radius: 0; + background: none; + -webkit-box-shadow: none; + box-shadow: none; +} +.mui-popover.mui-popover-action .mui-popover-arrow +{ + display: none; +} +.mui-popover.mui-popover-action.mui-popover-bottom +{ + position: fixed; +} +.mui-popover.mui-popover-action.mui-active +{ + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.mui-popover.mui-popover-action .mui-table-view +{ + margin: 8px; + + text-align: center; + + color: #007aff; + border-radius: 4px; +} +.mui-popover.mui-popover-action .mui-table-view .mui-table-view-cell:after +{ + position: absolute; + right: 0; + bottom: 0; + left: 0; + + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + + background-color: #c8c7cc; +} +.mui-popover.mui-popover-action .mui-table-view small +{ + font-weight: 400; + line-height: 1.3; + + display: block; +} +.mui-popover.mui-active +{ + display: block; + + opacity: 1; +} +.mui-popover .mui-bar ~ .mui-table-view +{ + padding-top: 44px; +} + +.mui-backdrop +{ + + position: fixed; + z-index: 998; + top: 0; + right: 0; + bottom: 0; + left: 0; + + background-color: rgba(0, 0, 0, .3); +} + +.mui-bar-backdrop.mui-backdrop +{ + bottom: 50px; + + background: none; +} + +.mui-backdrop-action.mui-backdrop +{ + background-color: rgba(0, 0, 0, .3); +} + +.mui-bar-backdrop.mui-backdrop, .mui-backdrop-action.mui-backdrop +{ + opacity: 0; +} +.mui-bar-backdrop.mui-backdrop.mui-active, .mui-backdrop-action.mui-backdrop.mui-active +{ + -webkit-transition: all .4s ease; + transition: all .4s ease; + + opacity: 1; +} + +.mui-popover .mui-btn-block +{ + margin-bottom: 5px; +} +.mui-popover .mui-btn-block:last-child +{ + margin-bottom: 0; +} + +.mui-popover .mui-bar +{ + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-popover .mui-bar-nav +{ + border-bottom: 1px solid rgba(0, 0, 0, .15); + border-top-left-radius: 12px; + border-top-right-radius: 12px; + -webkit-box-shadow: none; + box-shadow: none; +} + +.mui-popover .mui-scroll-wrapper +{ + margin: 7px 0; + + border-radius: 7px; + background-clip: padding-box; +} + +.mui-popover .mui-scroll .mui-table-view +{ + max-height: none; +} + +.mui-popover .mui-table-view +{ + overflow: auto; + + max-height: 300px; + margin-bottom: 0; + + border-radius: 7px; + background-color: #f7f7f7; + background-image: none; + + -webkit-overflow-scrolling: touch; +} +.mui-popover .mui-table-view:before, .mui-popover .mui-table-view:after +{ + height: 0; +} +.mui-popover .mui-table-view .mui-table-view-cell:first-child, +.mui-popover .mui-table-view .mui-table-view-cell:first-child > a:not(.mui-btn) +{ + border-top-left-radius: 12px; + border-top-right-radius: 12px; +} +.mui-popover .mui-table-view .mui-table-view-cell:last-child, +.mui-popover .mui-table-view .mui-table-view-cell:last-child > a:not(.mui-btn) +{ + border-bottom-right-radius: 12px; + border-bottom-left-radius: 12px; +} + +.mui-popover.mui-bar-popover .mui-table-view +{ + width: 106px; +} +.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell +{ + padding: 11px 15px 11px 15px; + + background-position: 0 100%; +} +.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell > a:not(.mui-btn) +{ + margin: -11px -15px -11px -15px; +} + +.mui-popup-backdrop +{ + position: fixed; + z-index: 998; + top: 0; + right: 0; + bottom: 0; + left: 0; + + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + + opacity: 0; + background: rgba(0, 0, 0, .4); +} +.mui-popup-backdrop.mui-active +{ + opacity: 1; +} + +.mui-popup +{ + position: fixed; + z-index: 10000; + top: 50%; + left: 50%; + + display: none; + overflow: hidden; + + width: 270px; + + -webkit-transition-property: -webkit-transform,opacity; + transition-property: transform,opacity; + -webkit-transform: translate3d(-50%, -50%, 0) scale(1.185); + transform: translate3d(-50%, -50%, 0) scale(1.185); + text-align: center; + + opacity: 0; + color: #000; + border-radius: 13px; +} +.mui-popup.mui-popup-in +{ + display: block; + + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(-50%, -50%, 0) scale(1); + transform: translate3d(-50%, -50%, 0) scale(1); + + opacity: 1; +} +.mui-popup.mui-popup-out +{ + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + -webkit-transform: translate3d(-50%, -50%, 0) scale(1); + transform: translate3d(-50%, -50%, 0) scale(1); + + opacity: 0; +} + +.mui-popup-inner +{ + position: relative; + + padding: 15px; + + border-radius: 13px 13px 0 0; + background: rgba(255, 255, 255, .95); +} +.mui-popup-inner:after +{ + position: absolute; + z-index: 15; + top: auto; + right: auto; + bottom: 0; + left: 0; + + display: block; + + width: 100%; + height: 1px; + + content: ''; + -webkit-transform: scaleY(.5); + transform: scaleY(.5); + -webkit-transform-origin: 50% 100%; + transform-origin: 50% 100%; + + background-color: rgba(0, 0, 0, .2); +} + +.mui-popup-title +{ + font-size: 18px; + font-weight: 500; + + text-align: center; +} + +.mui-popup-title + .mui-popup-text +{ + font-family: inherit; + font-size: 14px; + + margin: 5px 0 0; +} + +.mui-popup-buttons +{ + position: relative; + + display: -webkit-box; + display: -webkit-flex; + display: flex; + + height: 44px; + + -webkit-box-pack: center; + -webkit-justify-content: center; + justify-content: center; +} + +.mui-popup-button +{ + font-size: 17px; + line-height: 44px; + + position: relative; + + display: block; + overflow: hidden; + + box-sizing: border-box; + width: 100%; + height: 44px; + padding: 0 5px; + + cursor: pointer; + text-align: center; + white-space: nowrap; + text-overflow: ellipsis; + + color: #007aff; + background: rgba(255, 255, 255, .95); + + -webkit-box-flex: 1; +} +.mui-popup-button:after +{ + position: absolute; + z-index: 15; + top: 0; + right: 0; + bottom: auto; + left: auto; + + display: block; + + width: 1px; + height: 100%; + + content: ''; + -webkit-transform: scaleX(.5); + transform: scaleX(.5); + -webkit-transform-origin: 100% 50%; + transform-origin: 100% 50%; + + background-color: rgba(0, 0, 0, .2); +} +.mui-popup-button:first-child +{ + border-radius: 0 0 0 13px; +} +.mui-popup-button:first-child:last-child +{ + border-radius: 0 0 13px 13px; +} +.mui-popup-button:last-child +{ + border-radius: 0 0 13px 0; +} +.mui-popup-button:last-child:after +{ + display: none; +} +.mui-popup-button.mui-popup-button-bold +{ + font-weight: 600; +} + +.mui-popup-input input +{ + font-size: 14px; + + width: 100%; + height: 26px; + margin: 15px 0 0; + padding: 0 5px; + + border: 1px solid rgba(0, 0, 0, .3); + border-radius: 0; + background: #fff; +} + +.mui-plus.mui-android .mui-popup-backdrop +{ + -webkit-transition-duration: 1ms; + transition-duration: 1ms; +} + +.mui-plus.mui-android .mui-popup +{ + -webkit-transition-duration: 1ms; + transition-duration: 1ms; + -webkit-transform: translate3d(-50%, -50%, 0) scale(1); + transform: translate3d(-50%, -50%, 0) scale(1); +} + +/* === Progress Bar === */ +.mui-progressbar +{ + position: relative; + + display: block; + overflow: hidden; + + width: 100%; + height: 2px; + + -webkit-transform-origin: center top; + transform-origin: center top; + vertical-align: middle; + + border-radius: 2px; + background: #b6b6b6; + + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} +.mui-progressbar span +{ + position: absolute; + top: 0; + left: 0; + + width: 100%; + height: 100%; + + -webkit-transition: 150ms; + transition: 150ms; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + + background: #007aff; +} +.mui-progressbar.mui-progressbar-infinite:before +{ + position: absolute; + top: 0; + left: 0; + + width: 100%; + height: 100%; + + content: ''; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transform-origin: left center; + transform-origin: left center; + -webkit-animation: mui-progressbar-infinite 1s linear infinite; + animation: mui-progressbar-infinite 1s linear infinite; + + background: #007aff; +} + +body > .mui-progressbar +{ + position: absolute; + z-index: 10000; + top: 44px; + left: 0; + + border-radius: 0; +} + +.mui-progressbar-in +{ + -webkit-animation: mui-progressbar-in 300ms forwards; + animation: mui-progressbar-in 300ms forwards; +} + +.mui-progressbar-out +{ + -webkit-animation: mui-progressbar-out 300ms forwards; + animation: mui-progressbar-out 300ms forwards; +} + +@-webkit-keyframes mui-progressbar-in +{ + from + { + -webkit-transform: scaleY(0); + + opacity: 0; + } + + to + { + -webkit-transform: scaleY(1); + + opacity: 1; + } +} +@keyframes mui-progressbar-in +{ + from + { + transform: scaleY(0); + + opacity: 0; + } + + to + { + transform: scaleY(1); + + opacity: 1; + } +} +@-webkit-keyframes mui-progressbar-out +{ + from + { + -webkit-transform: scaleY(1); + + opacity: 1; + } + + to + { + -webkit-transform: scaleY(0); + + opacity: 0; + } +} +@keyframes mui-progressbar-out +{ + from + { + transform: scaleY(1); + + opacity: 1; + } + + to + { + transform: scaleY(0); + + opacity: 0; + } +} +@-webkit-keyframes mui-progressbar-infinite +{ + 0% + { + -webkit-transform: translate3d(-50%, 0, 0) scaleX(.5); + } + + 100% + { + -webkit-transform: translate3d(100%, 0, 0) scaleX(.5); + } +} +@keyframes mui-progressbar-infinite +{ + 0% + { + transform: translate3d(-50%, 0, 0) scaleX(.5); + } + + 100% + { + transform: translate3d(100%, 0, 0) scaleX(.5); + } +} +.mui-pagination +{ + display: inline-block; + + margin: 0 auto; + padding-left: 0; + + border-radius: 6px; +} +.mui-pagination > li +{ + display: inline; +} +.mui-pagination > li > a, +.mui-pagination > li > span +{ + line-height: 1.428571429; + + position: relative; + + float: left; + + margin-left: -1px; + padding: 6px 12px; + + text-decoration: none; + + color: #007aff; + border: 1px solid #ddd; + background-color: #fff; +} +.mui-pagination > li:first-child > a, +.mui-pagination > li:first-child > span +{ + margin-left: 0; + + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; + background-clip: padding-box; +} +.mui-pagination > li:last-child > a, +.mui-pagination > li:last-child > span +{ + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; + background-clip: padding-box; +} +.mui-pagination > li:active > a, .mui-pagination > li:active > a:active, +.mui-pagination > li:active > span, +.mui-pagination > li:active > span:active, +.mui-pagination > li.mui-active > a, +.mui-pagination > li.mui-active > a:active, +.mui-pagination > li.mui-active > span, +.mui-pagination > li.mui-active > span:active +{ + z-index: 2; + + cursor: default; + + color: #fff; + border-color: #007aff; + background-color: #007aff; +} +.mui-pagination > li.mui-disabled > span, +.mui-pagination > li.mui-disabled > span:active, +.mui-pagination > li.mui-disabled > a, +.mui-pagination > li.mui-disabled > a:active +{ + opacity: .6; + color: #777; + border: 1px solid #ddd; + background-color: #fff; +} + +.mui-pagination-lg > li > a, +.mui-pagination-lg > li > span +{ + font-size: 18px; + + padding: 10px 16px; +} + +.mui-pagination-sm > li > a, +.mui-pagination-sm > li > span +{ + font-size: 12px; + + padding: 5px 10px; +} + +.mui-pager +{ + padding-left: 0; + + list-style: none; + + text-align: center; +} +.mui-pager:before, .mui-pager:after +{ + display: table; + + content: ' '; +} +.mui-pager:after +{ + clear: both; +} +.mui-pager li +{ + display: inline; +} +.mui-pager li > a, +.mui-pager li > span +{ + display: inline-block; + + padding: 5px 14px; + + border: 1px solid #ddd; + border-radius: 6px; + background-color: #fff; + background-clip: padding-box; +} +.mui-pager li:active > a, .mui-pager li:active > span, .mui-pager li.mui-active > a, .mui-pager li.mui-active > span +{ + cursor: default; + text-decoration: none; + + color: #fff; + border-color: #007aff; + background-color: #007aff; +} +.mui-pager .mui-next > a, +.mui-pager .mui-next > span +{ + float: right; +} +.mui-pager .mui-previous > a, +.mui-pager .mui-previous > span +{ + float: left; +} +.mui-pager .mui-disabled > a, +.mui-pager .mui-disabled > a:active, +.mui-pager .mui-disabled > span, +.mui-pager .mui-disabled > span:active +{ + opacity: .6; + color: #777; + border: 1px solid #ddd; + background-color: #fff; +} + +.mui-modal +{ + position: fixed; + z-index: 999; + top: 0; + + overflow: hidden; + + width: 100%; + min-height: 100%; + + -webkit-transition: -webkit-transform .25s, opacity 1ms .25s; + transition: transform .25s, opacity 1ms .25s; + -webkit-transition-timing-function: cubic-bezier(.1, .5, .1, 1); + transition-timing-function: cubic-bezier(.1, .5, .1, 1); + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + + opacity: 0; + background-color: #fff; +} +.mui-modal.mui-active +{ + height: 100%; + + -webkit-transition: -webkit-transform .25s; + transition: transform .25s; + -webkit-transition-timing-function: cubic-bezier(.1, .5, .1, 1); + transition-timing-function: cubic-bezier(.1, .5, .1, 1); + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + + opacity: 1; +} + +.mui-android .mui-modal .mui-bar +{ + position: static; +} + +.mui-android .mui-modal .mui-bar-nav ~ .mui-content +{ + padding-top: 0; +} + +.mui-slider +{ + position: relative; + z-index: 1; + + overflow: hidden; + + width: 100%; +} +.mui-slider .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active +{ + border-bottom: 0; +} +.mui-slider .mui-segmented-control.mui-segmented-control-inverted ~ .mui-slider-group .mui-slider-item +{ + border-top: 1px solid #c8c7cc; + border-bottom: 1px solid #c8c7cc; +} +.mui-slider .mui-slider-group +{ + font-size: 0; + + position: relative; + + -webkit-transition: all 0s linear; + transition: all 0s linear; + white-space: nowrap; +} +.mui-slider .mui-slider-group .mui-slider-item +{ + font-size: 14px; + + position: relative; + + display: inline-block; + + width: 100%; + height: 100%; + + vertical-align: top; + white-space: normal; +} +.mui-slider .mui-slider-group .mui-slider-item > a:not(.mui-control-item) +{ + line-height: 0; + + position: relative; + + display: block; +} +.mui-slider .mui-slider-group .mui-slider-item img +{ + width: 100%; +} +.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:before, .mui-slider .mui-slider-group .mui-slider-item .mui-table-view:after +{ + height: 0; +} +.mui-slider .mui-slider-group.mui-slider-loop +{ + -webkit-transform: translate(-100%, 0px); + transform: translate(-100%, 0px); +} + +.mui-slider-title +{ + line-height: 30px; + + position: absolute; + bottom: 0; + left: 0; + + width: 100%; + height: 30px; + margin: 0; + + text-align: left; + text-indent: 12px; + + opacity: .8; + background-color: #000; +} + +.mui-slider-indicator +{ + position: absolute; + bottom: 8px; + + width: 100%; + + text-align: center; + + background: none; +} +.mui-slider-indicator.mui-segmented-control +{ + position: relative; + bottom: auto; +} +.mui-slider-indicator .mui-indicator +{ + display: inline-block; + + width: 6px; + height: 6px; + margin: 1px 6px; + + cursor: pointer; + + border-radius: 50%; + background: #aaa; + -webkit-box-shadow: 0 0 1px 1px rgba(130, 130, 130, .7); + box-shadow: 0 0 1px 1px rgba(130, 130, 130, .7); +} +.mui-slider-indicator .mui-active.mui-indicator +{ + background: #fff; +} +.mui-slider-indicator .mui-icon +{ + font-size: 20px; + line-height: 30px; + + width: 40px; + height: 30px; + margin: 3px; + + text-align: center; + + border: 1px solid #ddd; +} +.mui-slider-indicator .mui-number +{ + line-height: 32px; + + display: inline-block; + + width: 58px; +} +.mui-slider-indicator .mui-number span +{ + color: #ff5053; +} + +.mui-slider-progress-bar +{ + z-index: 1; + + height: 2px; + + -webkit-transform: translateZ(0); + transform: translateZ(0); +} + +.mui-switch +{ + position: relative; + + display: block; + + width: 74px; + height: 30px; + + -webkit-transition-timing-function: ease-in-out; + transition-timing-function: ease-in-out; + -webkit-transition-duration: .2s; + transition-duration: .2s; + -webkit-transition-property: background-color, border; + transition-property: background-color, border; + + border: 2px solid #ddd; + border-radius: 20px; + background-color: #fff; + background-clip: padding-box; +} +.mui-switch.mui-disabled +{ + opacity: .3; +} +.mui-switch .mui-switch-handle +{ + position: absolute; + z-index: 1; + top: -1px; + left: -1px; + + width: 28px; + height: 28px; + + -webkit-transition: .2s ease-in-out; + transition: .2s ease-in-out; + -webkit-transition-property: -webkit-transform, width,left; + transition-property: transform, width,left; + + border-radius: 16px; + background-color: #fff; + background-clip: padding-box; + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, .4); + box-shadow: 0 2px 5px rgba(0, 0, 0, .4); +} +.mui-switch:before +{ + font-size: 13px; + + position: absolute; + top: 3px; + right: 11px; + + content: 'Off'; + text-transform: uppercase; + + color: #999; +} +.mui-switch.mui-dragging +{ + border-color: #f7f7f7; + background-color: #f7f7f7; +} +.mui-switch.mui-dragging .mui-switch-handle +{ + width: 38px; +} +.mui-switch.mui-dragging.mui-active .mui-switch-handle +{ + left: -11px; + + width: 38px; +} +.mui-switch.mui-active +{ + border-color: #4cd964; + background-color: #4cd964; +} +.mui-switch.mui-active .mui-switch-handle +{ + -webkit-transform: translate(43px, 0); + transform: translate(43px, 0); +} +.mui-switch.mui-active:before +{ + right: auto; + left: 15px; + + content: 'On'; + + color: #fff; +} +.mui-switch input[type='checkbox'] +{ + display: none; +} + +.mui-switch-mini +{ + width: 47px; +} +.mui-switch-mini:before +{ + display: none; +} +.mui-switch-mini.mui-active .mui-switch-handle +{ + -webkit-transform: translate(16px, 0); + transform: translate(16px, 0); +} + +.mui-switch-blue.mui-active +{ + border: 2px solid #007aff; + background-color: #007aff; +} + +.mui-content.mui-fade +{ + left: 0; + + opacity: 0; +} +.mui-content.mui-fade.mui-in +{ + opacity: 1; +} +.mui-content.mui-sliding +{ + z-index: 2; + + -webkit-transition: -webkit-transform .4s; + transition: transform .4s; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.mui-content.mui-sliding.mui-left +{ + z-index: 1; + + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); +} +.mui-content.mui-sliding.mui-right +{ + z-index: 3; + + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); +} + +.mui-navigate-right:after, +.mui-push-left:after, +.mui-push-right:after +{ + font-family: Muiicons; + font-size: inherit; + line-height: 1; + + position: absolute; + top: 50%; + + display: inline-block; + + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + text-decoration: none; + + color: #bbb; + + -webkit-font-smoothing: antialiased; +} + +.mui-push-left:after +{ + left: 15px; + + content: '\e582'; +} + +.mui-navigate-right:after, +.mui-push-right:after +{ + right: 15px; + + content: '\e583'; +} + +.mui-pull-top-pocket, .mui-pull-bottom-pocket +{ + position: absolute; + left: 0; + + display: block; + visibility: hidden; + overflow: hidden; + + width: 100%; + height: 50px; +} + +.mui-plus-pullrefresh .mui-pull-top-pocket, .mui-plus-pullrefresh .mui-pull-bottom-pocket +{ + display: none; + visibility: visible; +} + +.mui-pull-top-pocket +{ + top: 0; +} + +.mui-bar-nav ~ .mui-content .mui-pull-top-pocket +{ + top: 44px; +} + +.mui-bar-nav ~ .mui-bar-header-secondary ~ .mui-content .mui-pull-top-pocket +{ + top: 88px; +} + +.mui-pull-bottom-pocket +{ + position: relative; + bottom: 0; + + height: 40px; +} +.mui-pull-bottom-pocket .mui-pull-loading +{ + visibility: hidden; +} +.mui-pull-bottom-pocket .mui-pull-loading.mui-in +{ + display: inline-block; +} + +.mui-pull +{ + font-weight: bold; + + position: absolute; + right: 0; + bottom: 10px; + left: 0; + + text-align: center; + + color: #777; +} + +.mui-pull-loading +{ + margin-right: 10px; + + -webkit-transition: -webkit-transform .4s; + transition: transform .4s; + -webkit-transition-duration: 400ms; + transition-duration: 400ms; + vertical-align: middle; +} + +.mui-pull-loading.mui-reverse +{ + -webkit-transform: rotate(180deg) translateZ(0); + transform: rotate(180deg) translateZ(0); +} + +.mui-pull-caption +{ + font-size: 15px; + line-height: 24px; + + position: relative; + + display: inline-block; + overflow: visible; + + margin-top: 0; + + vertical-align: middle; +} +.mui-pull-caption span +{ + display: none; +} +.mui-pull-caption span.mui-in +{ + display: inline; +} + +.mui-toast-container +{ + line-height: 17px; + + position: fixed; + z-index: 9999; + bottom: 50px; + left: 50%; + + -webkit-transition: opacity .3s; + transition: opacity .3s; + -webkit-transform: translate(-50%, 0); + transform: translate(-50%, 0); + + opacity: 0; +} +.mui-toast-container.mui-active +{ + opacity: .9; +} + +.mui-toast-message +{ + font-size: 14px; + + padding: 10px 25px; + + text-align: center; + + color: #fff; + border-radius: 6px; + background-color: #323232; +} + +.mui-numbox +{ + position: relative; + + display: inline-block; + overflow: hidden; + + width: 120px; + height: 35px; + padding: 0 40px 0 40px; + + vertical-align: top; + vertical-align: middle; + + border: solid 1px #bbb; + border-radius: 3px; + background-color: #efeff4; +} +.mui-numbox [class*=numbox-btn], .mui-numbox [class*=btn-numbox] +{ + font-size: 18px; + font-weight: normal; + line-height: 100%; + + position: absolute; + top: 0; + + overflow: hidden; + + width: 40px; + height: 100%; + padding: 0; + + color: #555; + border: none; + border-radius: 0; + background-color: #f9f9f9; +} +.mui-numbox [class*=numbox-btn]:active, .mui-numbox [class*=btn-numbox]:active +{ + background-color: #ccc; +} +.mui-numbox [class*=numbox-btn][disabled], .mui-numbox [class*=btn-numbox][disabled] +{ + color: #c0c0c0; +} +.mui-numbox .mui-numbox-btn-plus, .mui-numbox .mui-btn-numbox-plus +{ + right: 0; + + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.mui-numbox .mui-numbox-btn-minus, .mui-numbox .mui-btn-numbox-minus +{ + left: 0; + + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.mui-numbox .mui-numbox-input, .mui-numbox .mui-input-numbox +{ + display: inline-block; + overflow: hidden; + + width: 100% !important; + height: 100%; + margin: 0; + padding: 0 3px !important; + + text-align: center; + text-overflow: ellipsis; + word-break: normal; + + border: none !important; + border-right: solid 1px #ccc !important; + border-left: solid 1px #ccc !important; + border-radius: 0 !important; +} + +.mui-input-row .mui-numbox +{ + float: right; + + margin: 2px 8px; +} + +@font-face { + font-family: Muiicons; + font-weight: normal; + font-style: normal; + + src: url('../fonts/mui.ttf') format('truetype'); +} +.mui-icon +{ + font-family: Muiicons; + font-size: 24px; + font-weight: normal; + font-style: normal; + line-height: 1; + + display: inline-block; + + text-decoration: none; + + -webkit-font-smoothing: antialiased; +} +.mui-icon.mui-active +{ + color: #007aff; +} +.mui-icon.mui-right:before +{ + float: right; + + padding-left: .2em; +} + +.mui-icon-contact:before +{ + content: '\e100'; +} + +.mui-icon-person:before +{ + content: '\e101'; +} + +.mui-icon-personadd:before +{ + content: '\e102'; +} + +.mui-icon-contact-filled:before +{ + content: '\e130'; +} + +.mui-icon-person-filled:before +{ + content: '\e131'; +} + +.mui-icon-personadd-filled:before +{ + content: '\e132'; +} + +.mui-icon-phone:before +{ + content: '\e200'; +} + +.mui-icon-email:before +{ + content: '\e201'; +} + +.mui-icon-chatbubble:before +{ + content: '\e202'; +} + +.mui-icon-chatboxes:before +{ + content: '\e203'; +} + +.mui-icon-phone-filled:before +{ + content: '\e230'; +} + +.mui-icon-email-filled:before +{ + content: '\e231'; +} + +.mui-icon-chatbubble-filled:before +{ + content: '\e232'; +} + +.mui-icon-chatboxes-filled:before +{ + content: '\e233'; +} + +.mui-icon-weibo:before +{ + content: '\e260'; +} + +.mui-icon-weixin:before +{ + content: '\e261'; +} + +.mui-icon-pengyouquan:before +{ + content: '\e262'; +} + +.mui-icon-chat:before +{ + content: '\e263'; +} + +.mui-icon-qq:before +{ + content: '\e264'; +} + +.mui-icon-videocam:before +{ + content: '\e300'; +} + +.mui-icon-camera:before +{ + content: '\e301'; +} + +.mui-icon-mic:before +{ + content: '\e302'; +} + +.mui-icon-location:before +{ + content: '\e303'; +} + +.mui-icon-mic-filled:before, .mui-icon-speech:before +{ + content: '\e332'; +} + +.mui-icon-location-filled:before +{ + content: '\e333'; +} + +.mui-icon-micoff:before +{ + content: '\e360'; +} + +.mui-icon-image:before +{ + content: '\e363'; +} + +.mui-icon-map:before +{ + content: '\e364'; +} + +.mui-icon-compose:before +{ + content: '\e400'; +} + +.mui-icon-trash:before +{ + content: '\e401'; +} + +.mui-icon-upload:before +{ + content: '\e402'; +} + +.mui-icon-download:before +{ + content: '\e403'; +} + +.mui-icon-close:before +{ + content: '\e404'; +} + +.mui-icon-redo:before +{ + content: '\e405'; +} + +.mui-icon-undo:before +{ + content: '\e406'; +} + +.mui-icon-refresh:before +{ + content: '\e407'; +} + +.mui-icon-star:before +{ + content: '\e408'; +} + +.mui-icon-plus:before +{ + content: '\e409'; +} + +.mui-icon-minus:before +{ + content: '\e410'; +} + +.mui-icon-circle:before, .mui-icon-checkbox:before +{ + content: '\e411'; +} + +.mui-icon-close-filled:before, .mui-icon-clear:before +{ + content: '\e434'; +} + +.mui-icon-refresh-filled:before +{ + content: '\e437'; +} + +.mui-icon-star-filled:before +{ + content: '\e438'; +} + +.mui-icon-plus-filled:before +{ + content: '\e439'; +} + +.mui-icon-minus-filled:before +{ + content: '\e440'; +} + +.mui-icon-circle-filled:before +{ + content: '\e441'; +} + +.mui-icon-checkbox-filled:before +{ + content: '\e442'; +} + +.mui-icon-closeempty:before +{ + content: '\e460'; +} + +.mui-icon-refreshempty:before +{ + content: '\e461'; +} + +.mui-icon-reload:before +{ + content: '\e462'; +} + +.mui-icon-starhalf:before +{ + content: '\e463'; +} + +.mui-icon-spinner:before +{ + content: '\e464'; +} + +.mui-icon-spinner-cycle:before +{ + content: '\e465'; +} + +.mui-icon-search:before +{ + content: '\e466'; +} + +.mui-icon-plusempty:before +{ + content: '\e468'; +} + +.mui-icon-forward:before +{ + content: '\e470'; +} + +.mui-icon-back:before, .mui-icon-left-nav:before +{ + content: '\e471'; +} + +.mui-icon-checkmarkempty:before +{ + content: '\e472'; +} + +.mui-icon-home:before +{ + content: '\e500'; +} + +.mui-icon-navigate:before +{ + content: '\e501'; +} + +.mui-icon-gear:before +{ + content: '\e502'; +} + +.mui-icon-paperplane:before +{ + content: '\e503'; +} + +.mui-icon-info:before +{ + content: '\e504'; +} + +.mui-icon-help:before +{ + content: '\e505'; +} + +.mui-icon-locked:before +{ + content: '\e506'; +} + +.mui-icon-more:before +{ + content: '\e507'; +} + +.mui-icon-flag:before +{ + content: '\e508'; +} + +.mui-icon-home-filled:before +{ + content: '\e530'; +} + +.mui-icon-gear-filled:before +{ + content: '\e532'; +} + +.mui-icon-info-filled:before +{ + content: '\e534'; +} + +.mui-icon-help-filled:before +{ + content: '\e535'; +} + +.mui-icon-more-filled:before +{ + content: '\e537'; +} + +.mui-icon-settings:before +{ + content: '\e560'; +} + +.mui-icon-list:before +{ + content: '\e562'; +} + +.mui-icon-bars:before +{ + content: '\e563'; +} + +.mui-icon-loop:before +{ + content: '\e565'; +} + +.mui-icon-paperclip:before +{ + content: '\e567'; +} + +.mui-icon-eye:before +{ + content: '\e568'; +} + +.mui-icon-arrowup:before +{ + content: '\e580'; +} + +.mui-icon-arrowdown:before +{ + content: '\e581'; +} + +.mui-icon-arrowleft:before +{ + content: '\e582'; +} + +.mui-icon-arrowright:before +{ + content: '\e583'; +} + +.mui-icon-arrowthinup:before +{ + content: '\e584'; +} + +.mui-icon-arrowthindown:before +{ + content: '\e585'; +} + +.mui-icon-arrowthinleft:before +{ + content: '\e586'; +} + +.mui-icon-arrowthinright:before +{ + content: '\e587'; +} + +.mui-icon-pulldown:before +{ + content: '\e588'; +} + +.mui-fullscreen +{ + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} +.mui-fullscreen.mui-slider .mui-slider-group +{ + height: 100%; +} +.mui-fullscreen .mui-segmented-control ~ .mui-slider-group +{ + position: absolute; + top: 40px; + bottom: 0; + + width: 100%; + height: auto; +} +.mui-fullscreen.mui-slider .mui-slider-item > a +{ + top: 50%; + + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} +.mui-fullscreen .mui-off-canvas-wrap .mui-slider-item > a +{ + top: auto; + + -webkit-transform: none; + transform: none; +} + +.mui-bar-nav ~ .mui-content .mui-slider.mui-fullscreen +{ + top: 44px; +} + +.mui-bar-tab ~ .mui-content .mui-slider.mui-fullscreen .mui-segmented-control ~ .mui-slider-group +{ + bottom: 50px; +} + +.mui-android.mui-android-4-0 input:focus, +.mui-android.mui-android-4-0 textarea:focus +{ + -webkit-user-modify: inherit; +} + +.mui-android.mui-android-4-2 input, +.mui-android.mui-android-4-2 textarea, .mui-android.mui-android-4-3 input, +.mui-android.mui-android-4-3 textarea +{ + -webkit-user-select: text; +} + +.mui-ios .mui-table-view-cell +{ + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} + +.mui-plus-visible, .mui-wechat-visible +{ + display: none !important; +} + +.mui-plus-hidden, .mui-wechat-hidden +{ + display: block !important; +} + +.mui-tab-item.mui-plus-hidden, .mui-tab-item.mui-wechat-hidden +{ + display: table-cell !important; +} + +.mui-plus .mui-plus-visible, .mui-wechat .mui-wechat-visible +{ + display: block !important; +} + +.mui-plus .mui-tab-item.mui-plus-visible, .mui-wechat .mui-tab-item.mui-wechat-visible +{ + display: table-cell !important; +} + +.mui-plus .mui-plus-hidden, .mui-wechat .mui-wechat-hidden +{ + display: none !important; +} + +.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav +{ + height: 64px; + padding-top: 20px; +} +.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav ~ .mui-content +{ + padding-top: 64px; +} +.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav ~ .mui-content .mui-pull-top-pocket +{ + top: 64px; +} +.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-header-secondary +{ + top: 64px; +} +.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-header-secondary ~ .mui-content +{ + padding-top: 94px; +} + +.mui-iframe-wrapper +{ + position: absolute; + right: 0; + left: 0; + + -webkit-overflow-scrolling: touch; +} +.mui-iframe-wrapper iframe +{ + width: 100%; + height: 100%; + + border: 0; +} diff --git a/css/mui.min.css b/css/mui.min.css new file mode 100644 index 0000000..c330ba6 --- /dev/null +++ b/css/mui.min.css @@ -0,0 +1,5 @@ +/*! + * ===================================================== + * Mui v3.7.2 (http://dev.dcloud.net.cn/mui) + * ===================================================== + *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{font:inherit;margin:0;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{margin:0 2px;padding:.35em .625em .75em;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}*{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;outline:0;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent}body{font-family:'Helvetica Neue',Helvetica,sans-serif;font-size:17px;line-height:21px;color:#000;background-color:#efeff4;-webkit-overflow-scrolling:touch}a{text-decoration:none;color:#007aff}a:active{color:#0062cc}.mui-content{background-color:#efeff4;-webkit-overflow-scrolling:touch}.mui-bar-nav~.mui-content{padding-top:44px}.mui-bar-nav~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{top:44px}.mui-bar-header-secondary~.mui-content{padding-top:88px}.mui-bar-header-secondary~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{top:88px}.mui-bar-footer~.mui-content{padding-bottom:44px}.mui-bar-footer~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:44px}.mui-bar-footer-secondary~.mui-content{padding-bottom:88px}.mui-bar-footer-secondary~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:88px}.mui-bar-tab~.mui-content{padding-bottom:50px}.mui-bar-tab~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:50px}.mui-bar-footer-secondary-tab~.mui-content{padding-bottom:94px}.mui-bar-footer-secondary-tab~.mui-content.mui-scroll-wrapper .mui-scrollbar-vertical{bottom:94px}.mui-content-padded{margin:10px}.mui-inline{display:inline-block;vertical-align:top}.mui-block{display:block!important}.mui-visibility{visibility:visible!important}.mui-hidden{display:none!important}.mui-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.mui-ellipsis-2{display:-webkit-box;overflow:hidden;white-space:normal!important;text-overflow:ellipsis;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical}.mui-table{display:table;width:100%;table-layout:fixed}.mui-table-cell{position:relative;display:table-cell}.mui-text-left{text-align:left!important}.mui-text-center{text-align:center!important}.mui-text-justify{text-align:justify!important}.mui-text-right{text-align:right!important}.mui-pull-left{float:left}.mui-pull-right{float:right}.mui-list-unstyled{padding-left:0;list-style:none}.mui-list-inline{margin-left:-5px;padding-left:0;list-style:none}.mui-list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.mui-clearfix:after,.mui-clearfix:before{display:table;content:' '}.mui-clearfix:after{clear:both}.mui-bg-primary{background-color:#007aff}.mui-bg-positive{background-color:#4cd964}.mui-bg-negative{background-color:#dd524d}.mui-error{margin:88px 35px;padding:10px;border-radius:6px;background-color:#bbb}.mui-subtitle{font-size:15px}h1,h2,h3,h4,h5,h6{line-height:1;margin-top:5px;margin-bottom:5px}.mui-h1,h1{font-size:36px}.mui-h2,h2{font-size:30px}.mui-h3,h3{font-size:24px}.mui-h4,h4{font-size:18px}.mui-h5,h5{font-size:14px;font-weight:400;color:#8f8f94}.mui-h6,h6{font-size:12px;font-weight:400;color:#8f8f94}p{font-size:14px;margin-top:0;margin-bottom:10px;color:#8f8f94}.mui-row:after,.mui-row:before{display:table;content:' '}.mui-row:after{clear:both}.mui-col-sm-1,.mui-col-sm-10,.mui-col-sm-11,.mui-col-sm-12,.mui-col-sm-2,.mui-col-sm-3,.mui-col-sm-4,.mui-col-sm-5,.mui-col-sm-6,.mui-col-sm-7,.mui-col-sm-8,.mui-col-sm-9,.mui-col-xs-1,.mui-col-xs-10,.mui-col-xs-11,.mui-col-xs-12,.mui-col-xs-2,.mui-col-xs-3,.mui-col-xs-4,.mui-col-xs-5,.mui-col-xs-6,.mui-col-xs-7,.mui-col-xs-8,.mui-col-xs-9{position:relative;min-height:1px}.mui-row>[class*=mui-col-]{float:left}.mui-col-xs-12{width:100%}.mui-col-xs-11{width:91.66666667%}.mui-col-xs-10{width:83.33333333%}.mui-col-xs-9{width:75%}.mui-col-xs-8{width:66.66666667%}.mui-col-xs-7{width:58.33333333%}.mui-col-xs-6{width:50%}.mui-col-xs-5{width:41.66666667%}.mui-col-xs-4{width:33.33333333%}.mui-col-xs-3{width:25%}.mui-col-xs-2{width:16.66666667%}.mui-col-xs-1{width:8.33333333%}@media (min-width:400px){.mui-col-sm-12{width:100%}.mui-col-sm-11{width:91.66666667%}.mui-col-sm-10{width:83.33333333%}.mui-col-sm-9{width:75%}.mui-col-sm-8{width:66.66666667%}.mui-col-sm-7{width:58.33333333%}.mui-col-sm-6{width:50%}.mui-col-sm-5{width:41.66666667%}.mui-col-sm-4{width:33.33333333%}.mui-col-sm-3{width:25%}.mui-col-sm-2{width:16.66666667%}.mui-col-sm-1{width:8.33333333%}}.mui-scroll-wrapper{position:absolute;z-index:2;top:0;bottom:0;left:0;overflow:hidden;width:100%}.mui-scroll{position:absolute;z-index:1;width:100%}.mui-scrollbar{position:absolute;z-index:9998;overflow:hidden;-webkit-transition:500ms;transition:500ms;transform:translateZ(0px);pointer-events:none;opacity:0}.mui-scrollbar-vertical{top:0;right:1px;bottom:2px;width:4px}.mui-scrollbar-vertical .mui-scrollbar-indicator{width:100%}.mui-scrollbar-horizontal{right:2px;bottom:0;left:2px;height:4px}.mui-scrollbar-horizontal .mui-scrollbar-indicator{height:100%}.mui-scrollbar-indicator{position:absolute;display:block;box-sizing:border-box;-webkit-transition:.01s cubic-bezier(.1,.57,.1,1);transition:.01s cubic-bezier(.1,.57,.1,1);transform:translate(0px,0) translateZ(0px);border:1px solid rgba(255,255,255,.80196);border-radius:2px;background:rgba(0,0,0,.39804)}.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll-wrapper,.mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll-wrapper{position:absolute;top:0;bottom:0;left:0;overflow:hidden;width:100%}.mui-plus-pullrefresh .mui-fullscreen .mui-scroll-wrapper .mui-scroll,.mui-plus-pullrefresh .mui-fullscreen .mui-slider-group .mui-scroll{position:absolute;width:100%}.mui-plus-pullrefresh .mui-scroll-wrapper,.mui-plus-pullrefresh .mui-slider-group{position:static;top:auto;bottom:auto;left:auto;overflow:auto;width:auto}.mui-plus-pullrefresh .mui-slider-group{overflow:visible}.mui-plus-pullrefresh .mui-scroll{position:static;width:auto}.mui-off-canvas-wrap .mui-bar{position:absolute!important;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-box-shadow:none;box-shadow:none}.mui-off-canvas-wrap{position:relative;z-index:1;overflow:hidden;width:100%;height:100%}.mui-off-canvas-wrap .mui-inner-wrap{position:relative;z-index:1;width:100%;height:100%}.mui-off-canvas-wrap .mui-inner-wrap.mui-transitioning{-webkit-transition:-webkit-transform 350ms;transition:transform 350ms cubic-bezier(.165,.84,.44,1)}.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-left{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mui-off-canvas-wrap .mui-inner-wrap .mui-off-canvas-right{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mui-off-canvas-wrap.mui-active{overflow:hidden;height:100%}.mui-off-canvas-wrap.mui-active .mui-off-canvas-backdrop{position:absolute;z-index:998;top:0;right:0;bottom:0;left:0;display:block;transition:background 350ms cubic-bezier(.165,.84,.44,1);background:rgba(0,0,0,.4);box-shadow:-4px 0 4px rgba(0,0,0,.5),4px 0 4px rgba(0,0,0,.5);-webkit-tap-highlight-color:transparent}.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-right{z-index:10000!important;-webkit-transform:translate3d(100%,0,0)}.mui-off-canvas-wrap.mui-slide-in .mui-off-canvas-left{z-index:10000!important;-webkit-transform:translate3d(-100%,0,0)}.mui-off-canvas-left,.mui-off-canvas-right{position:absolute;z-index:-1;top:0;bottom:0;visibility:hidden;box-sizing:content-box;width:70%;min-height:100%;background:#333;-webkit-overflow-scrolling:touch}.mui-off-canvas-left.mui-transitioning,.mui-off-canvas-right.mui-transitioning{-webkit-transition:-webkit-transform 350ms cubic-bezier(.165,.84,.44,1);transition:transform 350ms cubic-bezier(.165,.84,.44,1)}.mui-off-canvas-left{left:0}.mui-off-canvas-right{right:0}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable{background-color:#333}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-left,.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-right{width:80%;-webkit-transform:scale(.8);transform:scale(.8);opacity:.1}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-left.mui-transitioning,.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-right.mui-transitioning{-webkit-transition:-webkit-transform 350ms cubic-bezier(.165,.84,.44,1),opacity 350ms cubic-bezier(.165,.84,.44,1);transition:transform 350ms cubic-bezier(.165,.84,.44,1),opacity 350ms cubic-bezier(.165,.84,.44,1)}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-left{-webkit-transform-origin:-100%;transform-origin:-100%}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable>.mui-off-canvas-right{-webkit-transform-origin:200%;transform-origin:200%}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active>.mui-inner-wrap{-webkit-transform:scale(.8);transform:scale(.8)}.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active>.mui-off-canvas-left,.mui-off-canvas-wrap:not(.mui-slide-in).mui-scalable.mui-active>.mui-off-canvas-right{-webkit-transform:scale(1);transform:scale(1);opacity:1}.mui-loading .mui-spinner{display:block;margin:0 auto}.mui-spinner{display:inline-block;width:24px;height:24px;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:spinner-spin 1s step-end infinite;animation:spinner-spin 1s step-end infinite}.mui-spinner:after{display:block;width:100%;height:100%;content:'';background-image:url('data:image/svg+xml;charset=utf-8,');background-repeat:no-repeat;background-position:50%;background-size:100%}.mui-spinner-white:after{background-image:url('data:image/svg+xml;charset=utf-8,')}@-webkit-keyframes spinner-spin{0%{-webkit-transform:rotate(0deg)}8.33333333%{-webkit-transform:rotate(30deg)}16.66666667%{-webkit-transform:rotate(60deg)}25%{-webkit-transform:rotate(90deg)}33.33333333%{-webkit-transform:rotate(120deg)}41.66666667%{-webkit-transform:rotate(150deg)}50%{-webkit-transform:rotate(180deg)}58.33333333%{-webkit-transform:rotate(210deg)}66.66666667%{-webkit-transform:rotate(240deg)}75%{-webkit-transform:rotate(270deg)}83.33333333%{-webkit-transform:rotate(300deg)}91.66666667%{-webkit-transform:rotate(330deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spinner-spin{0%{transform:rotate(0deg)}8.33333333%{transform:rotate(30deg)}16.66666667%{transform:rotate(60deg)}25%{transform:rotate(90deg)}33.33333333%{transform:rotate(120deg)}41.66666667%{transform:rotate(150deg)}50%{transform:rotate(180deg)}58.33333333%{transform:rotate(210deg)}66.66666667%{transform:rotate(240deg)}75%{transform:rotate(270deg)}83.33333333%{transform:rotate(300deg)}91.66666667%{transform:rotate(330deg)}100%{transform:rotate(360deg)}}.mui-btn,button,input[type=button],input[type=reset],input[type=submit]{font-size:14px;font-weight:400;line-height:1.42;position:relative;display:inline-block;margin-bottom:0;padding:6px 12px;cursor:pointer;-webkit-transition:all;transition:all;-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-duration:.2s;transition-duration:.2s;text-align:center;vertical-align:top;white-space:nowrap;color:#333;border:1px solid #ccc;border-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:#fff;background-clip:padding-box}.mui-btn.mui-active:enabled,.mui-btn:enabled:active,button.mui-active:enabled,button:enabled:active,input[type=button].mui-active:enabled,input[type=button]:enabled:active,input[type=reset].mui-active:enabled,input[type=reset]:enabled:active,input[type=submit].mui-active:enabled,input[type=submit]:enabled:active{color:#fff;background-color:#929292}.mui-btn.mui-disabled,.mui-btn:disabled,button.mui-disabled,button:disabled,input[type=button].mui-disabled,input[type=button]:disabled,input[type=reset].mui-disabled,input[type=reset]:disabled,input[type=submit].mui-disabled,input[type=submit]:disabled{opacity:.6}.mui-btn-blue,.mui-btn-primary,input[type=submit]{color:#fff;border:1px solid #007aff;background-color:#007aff}.mui-btn-blue.mui-active:enabled,.mui-btn-blue:enabled:active,.mui-btn-primary.mui-active:enabled,.mui-btn-primary:enabled:active,input[type=submit].mui-active:enabled,input[type=submit]:enabled:active{color:#fff;border:1px solid #0062cc;background-color:#0062cc}.mui-btn-green,.mui-btn-positive,.mui-btn-success{color:#fff;border:1px solid #4cd964;background-color:#4cd964}.mui-btn-green.mui-active:enabled,.mui-btn-green:enabled:active,.mui-btn-positive.mui-active:enabled,.mui-btn-positive:enabled:active,.mui-btn-success.mui-active:enabled,.mui-btn-success:enabled:active{color:#fff;border:1px solid #2ac845;background-color:#2ac845}.mui-btn-warning,.mui-btn-yellow{color:#fff;border:1px solid #f0ad4e;background-color:#f0ad4e}.mui-btn-warning.mui-active:enabled,.mui-btn-warning:enabled:active,.mui-btn-yellow.mui-active:enabled,.mui-btn-yellow:enabled:active{color:#fff;border:1px solid #ec971f;background-color:#ec971f}.mui-btn-danger,.mui-btn-negative,.mui-btn-red{color:#fff;border:1px solid #dd524d;background-color:#dd524d}.mui-btn-danger.mui-active:enabled,.mui-btn-danger:enabled:active,.mui-btn-negative.mui-active:enabled,.mui-btn-negative:enabled:active,.mui-btn-red.mui-active:enabled,.mui-btn-red:enabled:active{color:#fff;border:1px solid #cf2d28;background-color:#cf2d28}.mui-btn-purple,.mui-btn-royal{color:#fff;border:1px solid #8a6de9;background-color:#8a6de9}.mui-btn-purple.mui-active:enabled,.mui-btn-purple:enabled:active,.mui-btn-royal.mui-active:enabled,.mui-btn-royal:enabled:active{color:#fff;border:1px solid #6641e2;background-color:#6641e2}.mui-btn-grey{color:#fff;border:1px solid #c7c7cc;background-color:#c7c7cc}.mui-btn-grey.mui-active:enabled,.mui-btn-grey:enabled:active{color:#fff;border:1px solid #acacb4;background-color:#acacb4}.mui-btn-outlined{background-color:transparent}.mui-btn-outlined.mui-btn-blue,.mui-btn-outlined.mui-btn-primary{color:#007aff}.mui-btn-outlined.mui-btn-green,.mui-btn-outlined.mui-btn-positive,.mui-btn-outlined.mui-btn-success{color:#4cd964}.mui-btn-outlined.mui-btn-warning,.mui-btn-outlined.mui-btn-yellow{color:#f0ad4e}.mui-btn-outlined.mui-btn-danger,.mui-btn-outlined.mui-btn-negative,.mui-btn-outlined.mui-btn-red{color:#dd524d}.mui-btn-outlined.mui-btn-purple,.mui-btn-outlined.mui-btn-royal{color:#8a6de9}.mui-btn-outlined.mui-btn-blue:enabled:active,.mui-btn-outlined.mui-btn-danger:enabled:active,.mui-btn-outlined.mui-btn-green:enabled:active,.mui-btn-outlined.mui-btn-negative:enabled:active,.mui-btn-outlined.mui-btn-positive:enabled:active,.mui-btn-outlined.mui-btn-primary:enabled:active,.mui-btn-outlined.mui-btn-purple:enabled:active,.mui-btn-outlined.mui-btn-red:enabled:active,.mui-btn-outlined.mui-btn-royal:enabled:active,.mui-btn-outlined.mui-btn-success:enabled:active,.mui-btn-outlined.mui-btn-warning:enabled:active,.mui-btn-outlined.mui-btn-yellow:enabled:active{color:#fff}.mui-btn-link{padding-top:6px;padding-bottom:6px;color:#007aff;border:0;background-color:transparent}.mui-btn-link.mui-active:enabled,.mui-btn-link:enabled:active{color:#0062cc;background-color:transparent}.mui-btn-block{font-size:18px;display:block;width:100%;margin-bottom:10px;padding:15px 0}.mui-btn .mui-badge{font-size:14px;margin:-2px -4px -2px 4px;background-color:rgba(0,0,0,.15)}.mui-btn .mui-badge-inverted,.mui-btn:enabled:active .mui-badge-inverted{background-color:transparent}.mui-btn-negative:enabled:active .mui-badge-inverted,.mui-btn-positive:enabled:active .mui-badge-inverted,.mui-btn-primary:enabled:active .mui-badge-inverted{color:#fff}.mui-btn-block .mui-badge{position:absolute;right:0;margin-right:10px}.mui-btn .mui-icon{font-size:inherit}.mui-btn.mui-icon{font-size:14px;line-height:1.42}.mui-btn.mui-fab{width:56px;height:56px;padding:16px;border-radius:50%;outline:0}.mui-btn.mui-fab.mui-btn-mini{width:40px;height:40px;padding:8px}.mui-btn.mui-fab .mui-icon{font-size:24px;line-height:24px;width:24px;height:24px}.mui-btn .mui-spinner{width:14px;height:14px;vertical-align:text-bottom}.mui-btn-block .mui-spinner{width:22px;height:22px}.mui-bar{position:fixed;z-index:10;right:0;left:0;height:44px;padding-right:10px;padding-left:10px;border-bottom:0;background-color:#f7f7f7;-webkit-box-shadow:0 0 1px rgba(0,0,0,.85);box-shadow:0 0 1px rgba(0,0,0,.85);-webkit-backface-visibility:hidden;backface-visibility:hidden}.mui-bar .mui-title{right:40px;left:40px;display:inline-block;overflow:hidden;width:auto;margin:0;text-overflow:ellipsis}.mui-bar .mui-backdrop{background:0 0}.mui-bar-header-secondary{top:44px}.mui-bar-footer{bottom:0}.mui-bar-footer-secondary{bottom:44px}.mui-bar-footer-secondary-tab{bottom:50px}.mui-bar-footer,.mui-bar-footer-secondary,.mui-bar-footer-secondary-tab{border-top:0}.mui-bar-transparent{top:0;background-color:rgba(247,247,247,0);-webkit-box-shadow:none;box-shadow:none}.mui-bar-nav{top:0;-webkit-box-shadow:0 1px 6px #ccc;box-shadow:0 1px 6px #ccc}.mui-bar-nav~.mui-content .mui-anchor{display:block;visibility:hidden;height:45px;margin-top:-45px}.mui-bar-nav.mui-bar .mui-icon{margin-right:-10px;margin-left:-10px;padding-right:10px;padding-left:10px}.mui-title{font-size:17px;font-weight:500;line-height:44px;position:absolute;display:block;width:100%;margin:0 -10px;padding:0;text-align:center;white-space:nowrap;color:#000}.mui-title a{color:inherit}.mui-bar-tab{bottom:0;display:table;width:100%;height:50px;padding:0;table-layout:fixed;border-top:0;border-bottom:0;-webkit-touch-callout:none}.mui-bar-tab .mui-tab-item{display:table-cell;overflow:hidden;width:1%;height:50px;text-align:center;vertical-align:middle;white-space:nowrap;text-overflow:ellipsis;color:#929292}.mui-bar-tab .mui-tab-item.mui-active{color:#007aff}.mui-bar-tab .mui-tab-item .mui-icon{top:3px;width:24px;height:24px;padding-top:0;padding-bottom:0}.mui-bar-tab .mui-tab-item .mui-icon~.mui-tab-label{font-size:11px;display:block;overflow:hidden;text-overflow:ellipsis}.mui-bar-tab .mui-tab-item .mui-icon:active{background:0 0}.mui-focusin>.mui-bar-header-secondary,.mui-focusin>.mui-bar-nav{position:absolute}.mui-focusin>.mui-bar~.mui-content{padding-bottom:0}.mui-bar .mui-btn{font-weight:400;position:relative;z-index:20;top:7px;margin-top:0;padding:6px 12px 7px}.mui-bar .mui-btn.mui-pull-right{margin-left:10px}.mui-bar .mui-btn.mui-pull-left{margin-right:10px}.mui-bar .mui-btn-link{font-size:16px;line-height:44px;top:0;padding:0;color:#007aff;border:0}.mui-bar .mui-btn-link.mui-active,.mui-bar .mui-btn-link:active{color:#0062cc}.mui-bar .mui-btn-block{font-size:16px;top:6px;margin-bottom:0;padding:5px 0}.mui-bar .mui-btn-nav.mui-pull-left{margin-left:-5px}.mui-bar .mui-btn-nav.mui-pull-left .mui-icon-left-nav{margin-right:-3px}.mui-bar .mui-btn-nav.mui-pull-right{margin-right:-5px}.mui-bar .mui-btn-nav.mui-pull-right .mui-icon-right-nav{margin-left:-3px}.mui-bar .mui-btn-nav:active{opacity:.3}.mui-bar .mui-icon{font-size:24px;position:relative;z-index:20;padding-top:10px;padding-bottom:10px}.mui-bar .mui-icon:active{opacity:.3}.mui-bar .mui-btn .mui-icon{top:1px;margin:0;padding:0}.mui-bar .mui-title .mui-icon{margin:0;padding:0}.mui-bar .mui-title .mui-icon.mui-icon-caret{top:4px;margin-left:-5px}.mui-bar input[type=search]{height:29px;margin:6px 0}.mui-bar .mui-input-row .mui-btn{padding:12px 10px}.mui-bar .mui-search:before{margin-top:-10px}.mui-bar .mui-input-row .mui-input-clear~.mui-icon-clear,.mui-bar .mui-input-row .mui-input-speech~.mui-icon-speech{top:0;right:12px}.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-clear~.mui-icon-clear,.mui-bar.mui-bar-header-secondary .mui-input-row .mui-input-speech~.mui-icon-speech{top:0;right:0}.mui-bar .mui-segmented-control{top:7px;width:auto;margin:0 auto}.mui-bar.mui-bar-header-secondary .mui-segmented-control{top:0}.mui-badge{font-size:12px;line-height:1;display:inline-block;padding:3px 6px;color:#333;border-radius:100px;background-color:rgba(0,0,0,.15)}.mui-badge.mui-badge-inverted{padding:0 5px 0 0;color:#929292;background-color:transparent}.mui-badge-blue,.mui-badge-primary{color:#fff;background-color:#007aff}.mui-badge-blue.mui-badge-inverted,.mui-badge-primary.mui-badge-inverted{color:#007aff;background-color:transparent}.mui-badge-green,.mui-badge-success{color:#fff;background-color:#4cd964}.mui-badge-green.mui-badge-inverted,.mui-badge-success.mui-badge-inverted{color:#4cd964;background-color:transparent}.mui-badge-warning,.mui-badge-yellow{color:#fff;background-color:#f0ad4e}.mui-badge-warning.mui-badge-inverted,.mui-badge-yellow.mui-badge-inverted{color:#f0ad4e;background-color:transparent}.mui-badge-danger,.mui-badge-red{color:#fff;background-color:#dd524d}.mui-badge-danger.mui-badge-inverted,.mui-badge-red.mui-badge-inverted{color:#dd524d;background-color:transparent}.mui-badge-purple,.mui-badge-royal{color:#fff;background-color:#8a6de9}.mui-badge-purple.mui-badge-inverted,.mui-badge-royal.mui-badge-inverted{color:#8a6de9;background-color:transparent}.mui-icon .mui-badge{font-size:10px;line-height:1.4;position:absolute;top:-2px;left:100%;margin-left:-10px;padding:1px 5px;color:#fff;background:red}.mui-card{font-size:14px;position:relative;overflow:hidden;margin:10px;border-radius:2px;background-color:#fff;background-clip:padding-box;box-shadow:0 1px 2px rgba(0,0,0,.3)}.mui-content>.mui-card:first-child{margin-top:15px}.mui-card .mui-input-group .mui-input-row:last-child:after,.mui-card .mui-input-group .mui-input-row:last-child:before,.mui-card .mui-input-group:after,.mui-card .mui-input-group:before{height:0}.mui-card .mui-table-view{margin-bottom:0;border-top:0;border-bottom:0;border-radius:6px}.mui-card .mui-table-view .mui-table-view-cell:first-child,.mui-card .mui-table-view .mui-table-view-divider:first-child{top:0;border-top-left-radius:6px;border-top-right-radius:6px}.mui-card .mui-table-view .mui-table-view-cell:last-child,.mui-card .mui-table-view .mui-table-view-divider:last-child{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.mui-card .mui-table-view:after,.mui-card .mui-table-view:before,.mui-card>.mui-table-view>.mui-table-view-cell:last-child:after,.mui-card>.mui-table-view>.mui-table-view-cell:last-child:before{height:0}.mui-card-footer,.mui-card-header{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;min-height:44px;padding:10px 15px;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-card-footer .mui-card-link,.mui-card-header .mui-card-link{line-height:44px;position:relative;display:-webkit-box;display:-webkit-flex;display:flex;height:44px;margin-top:-10px;margin-bottom:-10px;-webkit-transition-duration:.3s;transition-duration:.3s;text-decoration:none;-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-card-footer:before,.mui-card-header:after{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-card-header{font-size:17px;border-radius:2px 2px 0 0}.mui-card-header:after{top:auto;bottom:0}.mui-card-header>img:first-child{font-size:0;line-height:0;float:left;width:34px;height:34px}.mui-card-footer{color:#6d6d72;border-radius:0 0 2px 2px}.mui-card-content{font-size:14px;position:relative}.mui-card-content-inner{position:relative;padding:15px}.mui-card-media{vertical-align:bottom;color:#fff;background-position:center;background-size:cover}.mui-card-header.mui-card-media{display:block;padding:10px}.mui-card-header.mui-card-media .mui-media-body{font-size:14px;font-weight:500;line-height:17px;margin-bottom:0;margin-left:44px;color:#333}.mui-card-header.mui-card-media .mui-media-body p{font-size:13px;margin-bottom:0}.mui-table-view{position:relative;margin-top:0;margin-bottom:0;padding-left:0;list-style:none;background-color:#fff}.mui-table-view:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view:before{position:absolute;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc;top:-1px}.mui-table-view-icon .mui-table-view-cell .mui-navigate-right .mui-icon{font-size:20px;margin-top:-1px;margin-right:5px;margin-left:-5px}.mui-table-view-icon .mui-table-view-cell:after{left:40px}.mui-table-view-chevron .mui-table-view-cell{padding-right:65px}.mui-table-view-chevron .mui-table-view-cell>a:not(.mui-btn){margin-right:-65px}.mui-table-view-radio .mui-table-view-cell{padding-right:65px}.mui-table-view-radio .mui-table-view-cell>a:not(.mui-btn){margin-right:-65px}.mui-table-view-radio .mui-table-view-cell .mui-navigate-right:after{font-size:30px;font-weight:600;right:9px;content:'';color:#007aff}.mui-table-view-radio .mui-table-view-cell.mui-selected .mui-navigate-right:after{content:'\e472'}.mui-table-view-inverted{color:#fff;background:#333}.mui-table-view-inverted:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#222}.mui-table-view-inverted:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#222}.mui-table-view-inverted .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#222}.mui-table-view-inverted .mui-table-view-cell.mui-active,.mui-table-view-inverted .mui-table-view-cell>a:not(.mui-btn).mui-active{background-color:#242424}.mui-table-view-cell{position:relative;overflow:hidden;padding:11px 15px;-webkit-touch-callout:none}.mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view-cell.mui-checkbox input[type=checkbox],.mui-table-view-cell.mui-radio input[type=radio]{top:8px}.mui-table-view-cell.mui-checkbox.mui-left,.mui-table-view-cell.mui-radio.mui-left{padding-left:58px}.mui-table-view-cell.mui-active{background-color:#eee}.mui-table-view-cell:last-child:after,.mui-table-view-cell:last-child:before{height:0}.mui-table-view-cell>a:not(.mui-btn){position:relative;display:block;overflow:hidden;margin:-11px -15px;padding:inherit;white-space:nowrap;text-overflow:ellipsis;color:inherit}.mui-table-view-cell>a:not(.mui-btn).mui-active{background-color:#eee}.mui-table-view-cell p{margin-bottom:0}.mui-table-view-cell.mui-transitioning>.mui-slider-handle,.mui-table-view-cell.mui-transitioning>.mui-slider-left .mui-btn,.mui-table-view-cell.mui-transitioning>.mui-slider-right .mui-btn{-webkit-transition:-webkit-transform 300ms ease;transition:transform 300ms ease}.mui-table-view-cell.mui-active>.mui-slider-handle{background-color:#eee}.mui-table-view-cell>.mui-slider-handle{position:relative;background-color:#fff}.mui-table-view-cell>.mui-slider-handle .mui-navigate-right:after,.mui-table-view-cell>.mui-slider-handle.mui-navigate-right:after{right:0}.mui-table-view-cell>.mui-slider-handle,.mui-table-view-cell>.mui-slider-left .mui-btn,.mui-table-view-cell>.mui-slider-right .mui-btn{-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease}.mui-table-view-cell>.mui-slider-left,.mui-table-view-cell>.mui-slider-right{position:absolute;top:0;display:-webkit-box;display:-webkit-flex;display:flex;height:100%}.mui-table-view-cell>.mui-slider-left>.mui-btn,.mui-table-view-cell>.mui-slider-right>.mui-btn{position:relative;left:0;display:-webkit-box;display:-webkit-flex;display:flex;padding:0 30px;color:#fff;border:0;border-radius:0;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.mui-table-view-cell>.mui-slider-left>.mui-btn:after,.mui-table-view-cell>.mui-slider-right>.mui-btn:after{position:absolute;z-index:-1;top:0;width:600%;height:100%;content:'';background:inherit}.mui-table-view-cell>.mui-slider-left>.mui-btn.mui-icon,.mui-table-view-cell>.mui-slider-right>.mui-btn.mui-icon{font-size:30px}.mui-table-view-cell>.mui-slider-right{right:0;-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-transform:translateX(100%);transform:translateX(100%)}.mui-table-view-cell>.mui-slider-left{left:0;-webkit-transition:-webkit-transform 0ms ease;transition:transform 0ms ease;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.mui-table-view-cell>.mui-slider-left>.mui-btn:after{right:100%;margin-right:-1px}.mui-table-view-divider{font-weight:500;position:relative;margin-top:-1px;margin-left:0;padding-top:6px;padding-bottom:6px;padding-left:15px;color:#999;background-color:#fafafa}.mui-table-view-divider:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view-divider:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view .mui-media,.mui-table-view .mui-media-body{overflow:hidden}.mui-table-view .mui-media-large .mui-media-object{line-height:80px;max-width:80px;height:80px}.mui-table-view .mui-media .mui-subtitle{color:#000}.mui-table-view .mui-media-object{line-height:42px;max-width:42px;height:42px}.mui-table-view .mui-media-object.mui-pull-left{margin-right:10px}.mui-table-view .mui-media-object.mui-pull-right{margin-left:10px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object{line-height:29px;max-width:29px;height:29px;margin:-4px 0}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object img{line-height:29px;max-width:29px;height:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object.mui-pull-left{margin-right:10px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-object .mui-icon{font-size:29px}.mui-table-view .mui-table-view-cell.mui-media-icon .mui-media-body:after{position:absolute;right:0;bottom:0;left:55px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view .mui-table-view-cell.mui-media-icon:after{height:0!important}.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view{display:block}.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:after,.mui-table-view.mui-unfold .mui-table-view-cell.mui-collapse .mui-table-view:before{height:0!important}.mui-table-view.mui-unfold .mui-table-view-cell.mui-media-icon.mui-collapse .mui-media-body:after{position:absolute;right:0;bottom:0;left:70px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view-cell>.mui-badge,.mui-table-view-cell>.mui-btn,.mui-table-view-cell>.mui-switch,.mui-table-view-cell>a>.mui-badge,.mui-table-view-cell>a>.mui-btn,.mui-table-view-cell>a>.mui-switch{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mui-table-view-cell .mui-navigate-right>.mui-badge,.mui-table-view-cell .mui-navigate-right>.mui-btn,.mui-table-view-cell .mui-navigate-right>.mui-switch,.mui-table-view-cell .mui-push-left>.mui-badge,.mui-table-view-cell .mui-push-left>.mui-btn,.mui-table-view-cell .mui-push-left>.mui-switch,.mui-table-view-cell .mui-push-right>.mui-badge,.mui-table-view-cell .mui-push-right>.mui-btn,.mui-table-view-cell .mui-push-right>.mui-switch,.mui-table-view-cell>a .mui-navigate-right>.mui-badge,.mui-table-view-cell>a .mui-navigate-right>.mui-btn,.mui-table-view-cell>a .mui-navigate-right>.mui-switch,.mui-table-view-cell>a .mui-push-left>.mui-badge,.mui-table-view-cell>a .mui-push-left>.mui-btn,.mui-table-view-cell>a .mui-push-left>.mui-switch,.mui-table-view-cell>a .mui-push-right>.mui-badge,.mui-table-view-cell>a .mui-push-right>.mui-btn,.mui-table-view-cell>a .mui-push-right>.mui-switch{right:35px}.mui-content>.mui-table-view:first-child{margin-top:15px}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:last-child:after,.mui-table-view-cell.mui-collapse .mui-table-view:after,.mui-table-view-cell.mui-collapse .mui-table-view:before{height:0}.mui-table-view-cell.mui-collapse>.mui-navigate-right:after,.mui-table-view-cell.mui-collapse>.mui-push-right:after{content:'\e581'}.mui-table-view-cell.mui-collapse.mui-active{margin-top:-1px}.mui-table-view-cell.mui-collapse.mui-active .mui-collapse-content,.mui-table-view-cell.mui-collapse.mui-active .mui-table-view{display:block}.mui-table-view-cell.mui-collapse.mui-active>.mui-navigate-right:after,.mui-table-view-cell.mui-collapse.mui-active>.mui-push-right:after{content:'\e580'}.mui-table-view-cell.mui-collapse.mui-active .mui-table-view-cell>a:not(.mui-btn).mui-active{margin-left:-31px;padding-left:47px}.mui-table-view-cell.mui-collapse .mui-collapse-content{position:relative;display:none;overflow:hidden;margin:11px -15px -11px;padding:8px 15px;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease;background:#fff}.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-input-group,.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-slider{width:auto;height:auto;margin:-8px -15px}.mui-table-view-cell.mui-collapse .mui-collapse-content>.mui-slider{margin:-8px -16px}.mui-table-view-cell.mui-collapse .mui-table-view{display:none;margin-top:11px;margin-right:-15px;margin-bottom:-11px;margin-left:-15px;border:0}.mui-table-view-cell.mui-collapse .mui-table-view.mui-table-view-chevron{margin-right:-65px}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell{padding-left:31px;background-position:31px 100%}.mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:30px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-table-view.mui-grid-view{font-size:0;display:block;width:100%;padding:0 10px 10px 0;white-space:normal}.mui-table-view.mui-grid-view .mui-table-view-cell{font-size:17px;display:inline-block;margin-right:-4px;padding:10px 0 0 14px;text-align:center;vertical-align:middle;background:0 0}.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-object{width:100%;max-width:100%;height:auto}.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn){margin:-10px 0 0 -14px}.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn).mui-active,.mui-table-view.mui-grid-view .mui-table-view-cell>a:not(.mui-btn):active{background:0 0}.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{font-size:15px;line-height:15px;display:block;width:100%;height:15px;margin-top:8px;text-overflow:ellipsis;color:#333}.mui-table-view.mui-grid-view .mui-table-view-cell:after,.mui-table-view.mui-grid-view .mui-table-view-cell:before{height:0}.mui-grid-view.mui-grid-9{margin:0;padding:0;border-top:1px solid #eee;border-left:1px solid #eee;background-color:#f2f2f2}.mui-grid-view.mui-grid-9:after,.mui-grid-view.mui-grid-9:before{display:table;content:' '}.mui-grid-view.mui-grid-9:after{clear:both;position:static}.mui-grid-view.mui-grid-9 .mui-table-view-cell{margin:0;padding:11px 15px;vertical-align:top;border-right:1px solid #eee;border-bottom:1px solid #eee}.mui-grid-view.mui-grid-9 .mui-table-view-cell.mui-active{background-color:#eee}.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn){margin:0;padding:10px 0}.mui-grid-view.mui-grid-9:before{height:0}.mui-grid-view.mui-grid-9 .mui-media{color:#797979}.mui-grid-view.mui-grid-9 .mui-media .mui-icon{font-size:2.4em;position:relative}.mui-slider-cell{position:relative}.mui-slider-cell>.mui-slider-handle{z-index:1}.mui-slider-cell>.mui-slider-left,.mui-slider-cell>.mui-slider-right{position:absolute;z-index:0;top:0;bottom:0}.mui-slider-cell>.mui-slider-left{left:0}.mui-slider-cell>.mui-slider-right{right:0}input,select,textarea{font-family:'Helvetica Neue',Helvetica,sans-serif;font-size:17px;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent}input:focus,select:focus,textarea:focus{-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent;-webkit-user-modify:read-write-plaintext-only}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{line-height:21px;width:100%;height:40px;margin-bottom:15px;padding:10px 15px;-webkit-user-select:text;border:1px solid rgba(0,0,0,.2);border-radius:3px;outline:0;background-color:#fff;-webkit-appearance:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}input[type=search]{font-size:16px;-webkit-box-sizing:border-box;box-sizing:border-box;height:34px;text-align:center;border:0;border-radius:6px;background-color:rgba(0,0,0,.1)}input[type=search]:focus{text-align:left}textarea{height:auto;resize:none}select{font-size:14px;height:auto;margin-top:1px;border:0!important;background-color:#fff}select:focus{-webkit-user-modify:read-only}.mui-input-group{position:relative;padding:0;border:0;background-color:#fff}.mui-input-group:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-input-group:before{position:absolute;top:0;right:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-input-group input,.mui-input-group textarea{margin-bottom:0;border:0;border-radius:0;background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.mui-input-group input[type=search]{background:0 0}.mui-input-group input:last-child{background-image:none}.mui-input-row{clear:left;overflow:hidden}.mui-input-row select{font-size:17px;height:37px;padding:0}.mui-input-row .mui-btn+input,.mui-input-row label+input,.mui-input-row:last-child{background:0 0}.mui-input-group .mui-input-row{height:40px}.mui-input-group .mui-input-row:after{position:absolute;right:0;bottom:0;left:15px;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-input-row label{font-family:'Helvetica Neue',Helvetica,sans-serif;line-height:1.1;float:left;width:35%;padding:11px 15px}.mui-input-row label~input,.mui-input-row label~select,.mui-input-row label~textarea{float:right;width:65%;margin-bottom:0;padding-left:0;border:0}.mui-input-row .mui-btn{line-height:1.1;float:right;width:15%;padding:10px 15px}.mui-input-row .mui-btn~input,.mui-input-row .mui-btn~select,.mui-input-row .mui-btn~textarea{float:left;width:85%;margin-bottom:0;padding-left:0;border:0}.mui-button-row{position:relative;padding-top:5px;text-align:center}.mui-input-group .mui-button-row{height:45px}.mui-input-row{position:relative}.mui-input-row.mui-input-range{overflow:visible;padding-right:20px}.mui-input-row .mui-inline{padding:8px 0}.mui-input-row .mui-input-clear~.mui-icon-clear,.mui-input-row .mui-input-password~.mui-icon-eye,.mui-input-row .mui-input-speech~.mui-icon-speech{font-size:20px;position:absolute;z-index:1;top:10px;right:0;width:38px;height:38px;text-align:center;color:#999}.mui-input-row .mui-input-clear~.mui-icon-clear.mui-active,.mui-input-row .mui-input-password~.mui-icon-eye.mui-active,.mui-input-row .mui-input-speech~.mui-icon-speech.mui-active{color:#007aff}.mui-input-row .mui-input-speech~.mui-icon-speech{font-size:24px;top:8px}.mui-input-row .mui-input-clear~.mui-icon-clear~.mui-icon-speech{display:none}.mui-input-row .mui-input-clear~.mui-icon-clear.mui-hidden~.mui-icon-speech{display:inline-block}.mui-input-row .mui-icon-speech~.mui-placeholder{right:38px}.mui-input-row.mui-search .mui-icon-clear{top:7px}.mui-input-row.mui-search .mui-icon-speech{top:5px}.mui-checkbox,.mui-radio{position:relative}.mui-checkbox label,.mui-radio label{display:inline-block;float:none;width:100%;padding-right:58px}.mui-checkbox.mui-left input[type=checkbox],.mui-radio.mui-left input[type=radio]{left:20px}.mui-checkbox.mui-left label,.mui-radio.mui-left label{padding-right:15px;padding-left:58px}.mui-checkbox input[type=checkbox],.mui-radio input[type=radio]{position:absolute;top:4px;right:20px;display:inline-block;width:28px;height:26px;border:0;outline:0!important;background-color:transparent;-webkit-appearance:none}.mui-checkbox input[type=checkbox][disabled]:before,.mui-radio input[type=radio][disabled]:before{opacity:.3}.mui-checkbox input[type=checkbox]:before,.mui-radio input[type=radio]:before{font-family:Muiicons;font-size:28px;font-weight:400;line-height:1;text-decoration:none;color:#aaa;border-radius:0;background:0 0;-webkit-font-smoothing:antialiased}.mui-checkbox input[type=checkbox]:checked:before,.mui-radio input[type=radio]:checked:before{color:#007aff}.mui-checkbox label.mui-disabled,.mui-checkbox.mui-disabled label,.mui-radio label.mui-disabled,.mui-radio.mui-disabled label{opacity:.4}.mui-radio input[type=radio]:before{content:'\e411'}.mui-radio input[type=radio]:checked:before{content:'\e441'}.mui-checkbox input[type=checkbox]:before{content:'\e411'}.mui-checkbox input[type=checkbox]:checked:before{content:'\e442'}.mui-select{position:relative}.mui-select:before{font-family:Muiicons;position:absolute;top:8px;right:21px;content:'\e581';color:rgba(170,170,170,.6)}.mui-input-row .mui-switch{float:right;margin-top:5px;margin-right:20px}.mui-input-range input[type=range]{position:relative;width:100%;height:2px;margin:17px 0;padding:0;cursor:pointer;border:0;border-radius:3px;outline:0;background-color:#999;-webkit-appearance:none!important}.mui-input-range input[type=range]::-webkit-slider-thumb{width:28px;height:28px;border-color:#0062cc;border-radius:50%;background-color:#007aff;background-clip:padding-box;-webkit-appearance:none!important}.mui-input-range label~input[type=range]{width:65%}.mui-input-range .mui-tooltip{font-size:36px;line-height:64px;position:absolute;z-index:1;top:-70px;width:64px;height:64px;text-align:center;opacity:.8;color:#333;border:1px solid #ddd;border-radius:6px;background-color:#fff;text-shadow:0 1px 0 #f3f3f3}.mui-search{position:relative}.mui-search input[type=search]{padding-left:30px}.mui-search .mui-placeholder{font-size:16px;line-height:34px;position:absolute;z-index:1;top:0;right:0;bottom:0;left:0;display:inline-block;height:34px;text-align:center;color:#999;border:0;border-radius:6px;background:0 0}.mui-search .mui-placeholder .mui-icon{font-size:20px;color:#333}.mui-search:before{font-family:Muiicons;font-size:20px;font-weight:400;position:absolute;top:50%;right:50%;display:none;margin-top:-18px;margin-right:31px;content:'\e466'}.mui-search.mui-active:before{font-size:20px;right:auto;left:5px;display:block;margin-right:0}.mui-search.mui-active input[type=search]{text-align:left}.mui-search.mui-active .mui-placeholder{display:none}.mui-segmented-control{font-size:15px;font-weight:400;position:relative;display:table;overflow:hidden;width:100%;table-layout:fixed;border:1px solid #007aff;border-radius:3px;background-color:transparent;-webkit-touch-callout:none}.mui-segmented-control.mui-segmented-control-vertical{border-collapse:collapse;border-width:0;border-radius:0}.mui-segmented-control.mui-segmented-control-vertical .mui-control-item{display:block;border-bottom:1px solid #c8c7cc;border-left-width:0}.mui-segmented-control.mui-scroll-wrapper{height:38px}.mui-segmented-control.mui-scroll-wrapper .mui-scroll{width:auto;height:40px;white-space:nowrap}.mui-segmented-control.mui-scroll-wrapper .mui-control-item{display:inline-block;width:auto;padding:0 20px;border:0}.mui-segmented-control .mui-control-item{line-height:38px;display:table-cell;overflow:hidden;width:1%;-webkit-transition:background-color .1s linear;transition:background-color .1s linear;text-align:center;white-space:nowrap;text-overflow:ellipsis;color:#007aff;border-color:#007aff;border-left:1px solid #007aff}.mui-segmented-control .mui-control-item:first-child{border-left-width:0}.mui-segmented-control .mui-control-item.mui-active{color:#fff;background-color:#007aff}.mui-segmented-control.mui-segmented-control-inverted{width:100%;border:0;border-radius:0}.mui-segmented-control.mui-segmented-control-inverted.mui-segmented-control-vertical .mui-control-item,.mui-segmented-control.mui-segmented-control-inverted.mui-segmented-control-vertical .mui-control-item.mui-active{border-bottom:1px solid #c8c7cc}.mui-segmented-control.mui-segmented-control-inverted .mui-control-item{color:inherit;border:0}.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{color:#007aff;border-bottom:2px solid #007aff;background:0 0}.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#007aff}.mui-segmented-control-positive{border:1px solid #4cd964}.mui-segmented-control-positive .mui-control-item{color:#4cd964;border-color:inherit}.mui-segmented-control-positive .mui-control-item.mui-active{color:#fff;background-color:#4cd964}.mui-segmented-control-positive.mui-segmented-control-inverted .mui-control-item.mui-active{color:#4cd964;border-bottom:2px solid #4cd964;background:0 0}.mui-segmented-control-positive.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#4cd964}.mui-segmented-control-negative{border:1px solid #dd524d}.mui-segmented-control-negative .mui-control-item{color:#dd524d;border-color:inherit}.mui-segmented-control-negative .mui-control-item.mui-active{color:#fff;background-color:#dd524d}.mui-segmented-control-negative.mui-segmented-control-inverted .mui-control-item.mui-active{color:#dd524d;border-bottom:2px solid #dd524d;background:0 0}.mui-segmented-control-negative.mui-segmented-control-inverted~.mui-slider-progress-bar{background-color:#dd524d}.mui-control-content{position:relative;display:none}.mui-control-content.mui-active{display:block}.mui-popover{position:absolute;z-index:999;display:none;width:280px;-webkit-transition:opacity .3s;transition:opacity .3s;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transform:none;transform:none;opacity:0;border-radius:7px;background-color:#f7f7f7;-webkit-box-shadow:0 0 15px rgba(0,0,0,.1);box-shadow:0 0 15px rgba(0,0,0,.1)}.mui-popover .mui-popover-arrow{position:absolute;z-index:1000;top:-25px;left:0;overflow:hidden;width:26px;height:26px}.mui-popover .mui-popover-arrow:after{position:absolute;top:19px;left:0;width:26px;height:26px;content:' ';-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:3px;background:#f7f7f7}.mui-popover .mui-popover-arrow.mui-bottom{top:100%;left:-26px;margin-top:-1px}.mui-popover .mui-popover-arrow.mui-bottom:after{top:-19px;left:0}.mui-popover.mui-popover-action{bottom:0;width:100%;-webkit-transition:-webkit-transform .3s,opacity .3s;transition:transform .3s,opacity .3s;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);border-radius:0;background:0 0;-webkit-box-shadow:none;box-shadow:none}.mui-popover.mui-popover-action .mui-popover-arrow{display:none}.mui-popover.mui-popover-action.mui-popover-bottom{position:fixed}.mui-popover.mui-popover-action.mui-active{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-popover.mui-popover-action .mui-table-view{margin:8px;text-align:center;color:#007aff;border-radius:4px}.mui-popover.mui-popover-action .mui-table-view .mui-table-view-cell:after{position:absolute;right:0;bottom:0;left:0;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);background-color:#c8c7cc}.mui-popover.mui-popover-action .mui-table-view small{font-weight:400;line-height:1.3;display:block}.mui-popover.mui-active{display:block;opacity:1}.mui-popover .mui-bar~.mui-table-view{padding-top:44px}.mui-backdrop{position:fixed;z-index:998;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.3)}.mui-bar-backdrop.mui-backdrop{bottom:50px;background:0 0}.mui-backdrop-action.mui-backdrop{background-color:rgba(0,0,0,.3)}.mui-backdrop-action.mui-backdrop,.mui-bar-backdrop.mui-backdrop{opacity:0}.mui-backdrop-action.mui-backdrop.mui-active,.mui-bar-backdrop.mui-backdrop.mui-active{-webkit-transition:all .4s ease;transition:all .4s ease;opacity:1}.mui-popover .mui-btn-block{margin-bottom:5px}.mui-popover .mui-btn-block:last-child{margin-bottom:0}.mui-popover .mui-bar{-webkit-box-shadow:none;box-shadow:none}.mui-popover .mui-bar-nav{border-bottom:1px solid rgba(0,0,0,.15);border-top-left-radius:12px;border-top-right-radius:12px;-webkit-box-shadow:none;box-shadow:none}.mui-popover .mui-scroll-wrapper{margin:7px 0;border-radius:7px;background-clip:padding-box}.mui-popover .mui-scroll .mui-table-view{max-height:none}.mui-popover .mui-table-view{overflow:auto;max-height:300px;margin-bottom:0;border-radius:7px;background-color:#f7f7f7;background-image:none;-webkit-overflow-scrolling:touch}.mui-popover .mui-table-view:after,.mui-popover .mui-table-view:before{height:0}.mui-popover .mui-table-view .mui-table-view-cell:first-child,.mui-popover .mui-table-view .mui-table-view-cell:first-child>a:not(.mui-btn){border-top-left-radius:12px;border-top-right-radius:12px}.mui-popover .mui-table-view .mui-table-view-cell:last-child,.mui-popover .mui-table-view .mui-table-view-cell:last-child>a:not(.mui-btn){border-bottom-right-radius:12px;border-bottom-left-radius:12px}.mui-popover.mui-bar-popover .mui-table-view{width:106px}.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell{padding:11px 15px;background-position:0 100%}.mui-popover.mui-bar-popover .mui-table-view .mui-table-view-cell>a:not(.mui-btn){margin:-11px -15px -11px -15px}.mui-popup-backdrop{position:fixed;z-index:998;top:0;right:0;bottom:0;left:0;-webkit-transition-duration:400ms;transition-duration:400ms;opacity:0;background:rgba(0,0,0,.4)}.mui-popup-backdrop.mui-active{opacity:1}.mui-popup{position:fixed;z-index:10000;top:50%;left:50%;display:none;overflow:hidden;width:270px;-webkit-transition-property:-webkit-transform,opacity;transition-property:transform,opacity;-webkit-transform:translate3d(-50%,-50%,0) scale(1.185);transform:translate3d(-50%,-50%,0) scale(1.185);text-align:center;opacity:0;color:#000;border-radius:13px}.mui-popup.mui-popup-in{display:block;-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1);opacity:1}.mui-popup.mui-popup-out{-webkit-transition-duration:400ms;transition-duration:400ms;-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1);opacity:0}.mui-popup-inner{position:relative;padding:15px;border-radius:13px 13px 0 0;background:rgba(255,255,255,.95)}.mui-popup-inner:after{position:absolute;z-index:15;top:auto;right:auto;bottom:0;left:0;display:block;width:100%;height:1px;content:'';-webkit-transform:scaleY(.5);transform:scaleY(.5);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;background-color:rgba(0,0,0,.2)}.mui-popup-title{font-size:18px;font-weight:500;text-align:center}.mui-popup-title+.mui-popup-text{font-family:inherit;font-size:14px;margin:5px 0 0}.mui-popup-buttons{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;height:44px;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.mui-popup-button{font-size:17px;line-height:44px;position:relative;display:block;overflow:hidden;box-sizing:border-box;width:100%;height:44px;padding:0 5px;cursor:pointer;text-align:center;white-space:nowrap;text-overflow:ellipsis;color:#007aff;background:rgba(255,255,255,.95);-webkit-box-flex:1}.mui-popup-button:after{position:absolute;z-index:15;top:0;right:0;bottom:auto;left:auto;display:block;width:1px;height:100%;content:'';-webkit-transform:scaleX(.5);transform:scaleX(.5);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;background-color:rgba(0,0,0,.2)}.mui-popup-button:first-child{border-radius:0 0 0 13px}.mui-popup-button:first-child:last-child{border-radius:0 0 13px 13px}.mui-popup-button:last-child{border-radius:0 0 13px}.mui-popup-button:last-child:after{display:none}.mui-popup-button.mui-popup-button-bold{font-weight:600}.mui-popup-input input{font-size:14px;width:100%;height:26px;margin:15px 0 0;padding:0 5px;border:1px solid rgba(0,0,0,.3);border-radius:0;background:#fff}.mui-plus.mui-android .mui-popup-backdrop{-webkit-transition-duration:1ms;transition-duration:1ms}.mui-plus.mui-android .mui-popup{-webkit-transition-duration:1ms;transition-duration:1ms;-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1)}.mui-progressbar{position:relative;display:block;overflow:hidden;width:100%;height:2px;-webkit-transform-origin:center top;transform-origin:center top;vertical-align:middle;border-radius:2px;background:#b6b6b6;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.mui-progressbar span{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transition:150ms;transition:150ms;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);background:#007aff}.mui-progressbar.mui-progressbar-infinite:before{position:absolute;top:0;left:0;width:100%;height:100%;content:'';-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform-origin:left center;transform-origin:left center;-webkit-animation:mui-progressbar-infinite 1s linear infinite;animation:mui-progressbar-infinite 1s linear infinite;background:#007aff}body>.mui-progressbar{position:absolute;z-index:10000;top:44px;left:0;border-radius:0}.mui-progressbar-in{-webkit-animation:mui-progressbar-in 300ms forwards;animation:mui-progressbar-in 300ms forwards}.mui-progressbar-out{-webkit-animation:mui-progressbar-out 300ms forwards;animation:mui-progressbar-out 300ms forwards}@-webkit-keyframes mui-progressbar-in{from{-webkit-transform:scaleY(0);opacity:0}to{-webkit-transform:scaleY(1);opacity:1}}@keyframes mui-progressbar-in{from{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}@-webkit-keyframes mui-progressbar-out{from{-webkit-transform:scaleY(1);opacity:1}to{-webkit-transform:scaleY(0);opacity:0}}@keyframes mui-progressbar-out{from{transform:scaleY(1);opacity:1}to{transform:scaleY(0);opacity:0}}@-webkit-keyframes mui-progressbar-infinite{0%{-webkit-transform:translate3d(-50%,0,0) scaleX(.5)}100%{-webkit-transform:translate3d(100%,0,0) scaleX(.5)}}@keyframes mui-progressbar-infinite{0%{transform:translate3d(-50%,0,0) scaleX(.5)}100%{transform:translate3d(100%,0,0) scaleX(.5)}}.mui-pagination{display:inline-block;margin:0 auto;padding-left:0;border-radius:6px}.mui-pagination>li{display:inline}.mui-pagination>li>a,.mui-pagination>li>span{line-height:1.428571429;position:relative;float:left;margin-left:-1px;padding:6px 12px;text-decoration:none;color:#007aff;border:1px solid #ddd;background-color:#fff}.mui-pagination>li:first-child>a,.mui-pagination>li:first-child>span{margin-left:0;border-top-left-radius:6px;border-bottom-left-radius:6px;background-clip:padding-box}.mui-pagination>li:last-child>a,.mui-pagination>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px;background-clip:padding-box}.mui-pagination>li.mui-active>a,.mui-pagination>li.mui-active>a:active,.mui-pagination>li.mui-active>span,.mui-pagination>li.mui-active>span:active,.mui-pagination>li:active>a,.mui-pagination>li:active>a:active,.mui-pagination>li:active>span,.mui-pagination>li:active>span:active{z-index:2;cursor:default;color:#fff;border-color:#007aff;background-color:#007aff}.mui-pagination>li.mui-disabled>a,.mui-pagination>li.mui-disabled>a:active,.mui-pagination>li.mui-disabled>span,.mui-pagination>li.mui-disabled>span:active{opacity:.6;color:#777;border:1px solid #ddd;background-color:#fff}.mui-pagination-lg>li>a,.mui-pagination-lg>li>span{font-size:18px;padding:10px 16px}.mui-pagination-sm>li>a,.mui-pagination-sm>li>span{font-size:12px;padding:5px 10px}.mui-pager{padding-left:0;list-style:none;text-align:center}.mui-pager:after,.mui-pager:before{display:table;content:' '}.mui-pager:after{clear:both}.mui-pager li{display:inline}.mui-pager li>a,.mui-pager li>span{display:inline-block;padding:5px 14px;border:1px solid #ddd;border-radius:6px;background-color:#fff;background-clip:padding-box}.mui-pager li.mui-active>a,.mui-pager li.mui-active>span,.mui-pager li:active>a,.mui-pager li:active>span{cursor:default;text-decoration:none;color:#fff;border-color:#007aff;background-color:#007aff}.mui-pager .mui-next>a,.mui-pager .mui-next>span{float:right}.mui-pager .mui-previous>a,.mui-pager .mui-previous>span{float:left}.mui-pager .mui-disabled>a,.mui-pager .mui-disabled>a:active,.mui-pager .mui-disabled>span,.mui-pager .mui-disabled>span:active{opacity:.6;color:#777;border:1px solid #ddd;background-color:#fff}.mui-modal{position:fixed;z-index:999;top:0;overflow:hidden;width:100%;min-height:100%;-webkit-transition:-webkit-transform .25s,opacity 1ms .25s;transition:transform .25s,opacity 1ms .25s;-webkit-transition-timing-function:cubic-bezier(.1,.5,.1,1);transition-timing-function:cubic-bezier(.1,.5,.1,1);-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);opacity:0;background-color:#fff}.mui-modal.mui-active{height:100%;-webkit-transition:-webkit-transform .25s;transition:transform .25s;-webkit-transition-timing-function:cubic-bezier(.1,.5,.1,1);transition-timing-function:cubic-bezier(.1,.5,.1,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.mui-android .mui-modal .mui-bar{position:static}.mui-android .mui-modal .mui-bar-nav~.mui-content{padding-top:0}.mui-slider{position:relative;z-index:1;overflow:hidden;width:100%}.mui-slider .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{border-bottom:0}.mui-slider .mui-segmented-control.mui-segmented-control-inverted~.mui-slider-group .mui-slider-item{border-top:1px solid #c8c7cc;border-bottom:1px solid #c8c7cc}.mui-slider .mui-slider-group{font-size:0;position:relative;-webkit-transition:all 0s linear;transition:all 0s linear;white-space:nowrap}.mui-slider .mui-slider-group .mui-slider-item{font-size:14px;position:relative;display:inline-block;width:100%;height:100%;vertical-align:top;white-space:normal}.mui-slider .mui-slider-group .mui-slider-item>a:not(.mui-control-item){line-height:0;position:relative;display:block}.mui-slider .mui-slider-group .mui-slider-item img{width:100%}.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:after,.mui-slider .mui-slider-group .mui-slider-item .mui-table-view:before{height:0}.mui-slider .mui-slider-group.mui-slider-loop{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}.mui-slider-title{line-height:30px;position:absolute;bottom:0;left:0;width:100%;height:30px;margin:0;text-align:left;text-indent:12px;opacity:.8;background-color:#000}.mui-slider-indicator{position:absolute;bottom:8px;width:100%;text-align:center;background:0 0}.mui-slider-indicator.mui-segmented-control{position:relative;bottom:auto}.mui-slider-indicator .mui-indicator{display:inline-block;width:6px;height:6px;margin:1px 6px;cursor:pointer;border-radius:50%;background:#aaa;-webkit-box-shadow:0 0 1px 1px rgba(130,130,130,.7);box-shadow:0 0 1px 1px rgba(130,130,130,.7)}.mui-slider-indicator .mui-active.mui-indicator{background:#fff}.mui-slider-indicator .mui-icon{font-size:20px;line-height:30px;width:40px;height:30px;margin:3px;text-align:center;border:1px solid #ddd}.mui-slider-indicator .mui-number{line-height:32px;display:inline-block;width:58px}.mui-slider-indicator .mui-number span{color:#ff5053}.mui-slider-progress-bar{z-index:1;height:2px;-webkit-transform:translateZ(0);transform:translateZ(0)}.mui-switch{position:relative;display:block;width:74px;height:30px;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:background-color,border;transition-property:background-color,border;border:2px solid #ddd;border-radius:20px;background-color:#fff;background-clip:padding-box}.mui-switch.mui-disabled{opacity:.3}.mui-switch .mui-switch-handle{position:absolute;z-index:1;top:-1px;left:-1px;width:28px;height:28px;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out;-webkit-transition-property:-webkit-transform,width,left;transition-property:transform,width,left;border-radius:16px;background-color:#fff;background-clip:padding-box;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.4);box-shadow:0 2px 5px rgba(0,0,0,.4)}.mui-switch:before{font-size:13px;position:absolute;top:3px;right:11px;content:'Off';text-transform:uppercase;color:#999}.mui-switch.mui-dragging{border-color:#f7f7f7;background-color:#f7f7f7}.mui-switch.mui-dragging .mui-switch-handle{width:38px}.mui-switch.mui-dragging.mui-active .mui-switch-handle{left:-11px;width:38px}.mui-switch.mui-active{border-color:#4cd964;background-color:#4cd964}.mui-switch.mui-active .mui-switch-handle{-webkit-transform:translate(43px,0);transform:translate(43px,0)}.mui-switch.mui-active:before{right:auto;left:15px;content:'On';color:#fff}.mui-switch input[type=checkbox]{display:none}.mui-switch-mini{width:47px}.mui-switch-mini:before{display:none}.mui-switch-mini.mui-active .mui-switch-handle{-webkit-transform:translate(16px,0);transform:translate(16px,0)}.mui-switch-blue.mui-active{border:2px solid #007aff;background-color:#007aff}.mui-content.mui-fade{left:0;opacity:0}.mui-content.mui-fade.mui-in{opacity:1}.mui-content.mui-sliding{z-index:2;-webkit-transition:-webkit-transform .4s;transition:transform .4s;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mui-content.mui-sliding.mui-left{z-index:1;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mui-content.mui-sliding.mui-right{z-index:3;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mui-navigate-right:after,.mui-push-left:after,.mui-push-right:after{font-family:Muiicons;font-size:inherit;line-height:1;position:absolute;top:50%;display:inline-block;-webkit-transform:translateY(-50%);transform:translateY(-50%);text-decoration:none;color:#bbb;-webkit-font-smoothing:antialiased}.mui-push-left:after{left:15px;content:'\e582'}.mui-navigate-right:after,.mui-push-right:after{right:15px;content:'\e583'}.mui-pull-bottom-pocket,.mui-pull-top-pocket{position:absolute;left:0;display:block;visibility:hidden;overflow:hidden;width:100%;height:50px}.mui-plus-pullrefresh .mui-pull-bottom-pocket,.mui-plus-pullrefresh .mui-pull-top-pocket{display:none;visibility:visible}.mui-pull-top-pocket{top:0}.mui-bar-nav~.mui-content .mui-pull-top-pocket{top:44px}.mui-bar-nav~.mui-bar-header-secondary~.mui-content .mui-pull-top-pocket{top:88px}.mui-pull-bottom-pocket{position:relative;bottom:0;height:40px}.mui-pull-bottom-pocket .mui-pull-loading{visibility:hidden}.mui-pull-bottom-pocket .mui-pull-loading.mui-in{display:inline-block}.mui-pull{font-weight:700;position:absolute;right:0;bottom:10px;left:0;text-align:center;color:#777}.mui-pull-loading{margin-right:10px;-webkit-transition:-webkit-transform .4s;transition:transform .4s;-webkit-transition-duration:400ms;transition-duration:400ms;vertical-align:middle}.mui-pull-loading.mui-reverse{-webkit-transform:rotate(180deg) translateZ(0);transform:rotate(180deg) translateZ(0)}.mui-pull-caption{font-size:15px;line-height:24px;position:relative;display:inline-block;overflow:visible;margin-top:0;vertical-align:middle}.mui-pull-caption span{display:none}.mui-pull-caption span.mui-in{display:inline}.mui-toast-container{line-height:17px;position:fixed;z-index:9999;bottom:50px;left:50%;-webkit-transition:opacity .3s;transition:opacity .3s;-webkit-transform:translate(-50%,0);transform:translate(-50%,0);opacity:0}.mui-toast-container.mui-active{opacity:.9}.mui-toast-message{font-size:14px;padding:10px 25px;text-align:center;color:#fff;border-radius:6px;background-color:#323232}.mui-numbox{position:relative;display:inline-block;overflow:hidden;width:120px;height:35px;padding:0 40px;vertical-align:top;vertical-align:middle;border:solid 1px #bbb;border-radius:3px;background-color:#efeff4}.mui-numbox [class*=btn-numbox],.mui-numbox [class*=numbox-btn]{font-size:18px;font-weight:400;line-height:100%;position:absolute;top:0;overflow:hidden;width:40px;height:100%;padding:0;color:#555;border:none;border-radius:0;background-color:#f9f9f9}.mui-numbox [class*=btn-numbox]:active,.mui-numbox [class*=numbox-btn]:active{background-color:#ccc}.mui-numbox [class*=btn-numbox][disabled],.mui-numbox [class*=numbox-btn][disabled]{color:silver}.mui-numbox .mui-btn-numbox-plus,.mui-numbox .mui-numbox-btn-plus{right:0;border-top-right-radius:3px;border-bottom-right-radius:3px}.mui-numbox .mui-btn-numbox-minus,.mui-numbox .mui-numbox-btn-minus{left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.mui-numbox .mui-input-numbox,.mui-numbox .mui-numbox-input{display:inline-block;overflow:hidden;width:100%!important;height:100%;margin:0;padding:0 3px!important;text-align:center;text-overflow:ellipsis;word-break:normal;border:none!important;border-right:solid 1px #ccc!important;border-left:solid 1px #ccc!important;border-radius:0!important}.mui-input-row .mui-numbox{float:right;margin:2px 8px}@font-face{font-family:Muiicons;font-weight:400;font-style:normal;src:url(../fonts/mui.ttf) format('truetype')}.mui-icon{font-family:Muiicons;font-size:24px;font-weight:400;font-style:normal;line-height:1;display:inline-block;text-decoration:none;-webkit-font-smoothing:antialiased}.mui-icon.mui-active{color:#007aff}.mui-icon.mui-right:before{float:right;padding-left:.2em}.mui-icon-contact:before{content:'\e100'}.mui-icon-person:before{content:'\e101'}.mui-icon-personadd:before{content:'\e102'}.mui-icon-contact-filled:before{content:'\e130'}.mui-icon-person-filled:before{content:'\e131'}.mui-icon-personadd-filled:before{content:'\e132'}.mui-icon-phone:before{content:'\e200'}.mui-icon-email:before{content:'\e201'}.mui-icon-chatbubble:before{content:'\e202'}.mui-icon-chatboxes:before{content:'\e203'}.mui-icon-phone-filled:before{content:'\e230'}.mui-icon-email-filled:before{content:'\e231'}.mui-icon-chatbubble-filled:before{content:'\e232'}.mui-icon-chatboxes-filled:before{content:'\e233'}.mui-icon-weibo:before{content:'\e260'}.mui-icon-weixin:before{content:'\e261'}.mui-icon-pengyouquan:before{content:'\e262'}.mui-icon-chat:before{content:'\e263'}.mui-icon-qq:before{content:'\e264'}.mui-icon-videocam:before{content:'\e300'}.mui-icon-camera:before{content:'\e301'}.mui-icon-mic:before{content:'\e302'}.mui-icon-location:before{content:'\e303'}.mui-icon-mic-filled:before,.mui-icon-speech:before{content:'\e332'}.mui-icon-location-filled:before{content:'\e333'}.mui-icon-micoff:before{content:'\e360'}.mui-icon-image:before{content:'\e363'}.mui-icon-map:before{content:'\e364'}.mui-icon-compose:before{content:'\e400'}.mui-icon-trash:before{content:'\e401'}.mui-icon-upload:before{content:'\e402'}.mui-icon-download:before{content:'\e403'}.mui-icon-close:before{content:'\e404'}.mui-icon-redo:before{content:'\e405'}.mui-icon-undo:before{content:'\e406'}.mui-icon-refresh:before{content:'\e407'}.mui-icon-star:before{content:'\e408'}.mui-icon-plus:before{content:'\e409'}.mui-icon-minus:before{content:'\e410'}.mui-icon-checkbox:before,.mui-icon-circle:before{content:'\e411'}.mui-icon-clear:before,.mui-icon-close-filled:before{content:'\e434'}.mui-icon-refresh-filled:before{content:'\e437'}.mui-icon-star-filled:before{content:'\e438'}.mui-icon-plus-filled:before{content:'\e439'}.mui-icon-minus-filled:before{content:'\e440'}.mui-icon-circle-filled:before{content:'\e441'}.mui-icon-checkbox-filled:before{content:'\e442'}.mui-icon-closeempty:before{content:'\e460'}.mui-icon-refreshempty:before{content:'\e461'}.mui-icon-reload:before{content:'\e462'}.mui-icon-starhalf:before{content:'\e463'}.mui-icon-spinner:before{content:'\e464'}.mui-icon-spinner-cycle:before{content:'\e465'}.mui-icon-search:before{content:'\e466'}.mui-icon-plusempty:before{content:'\e468'}.mui-icon-forward:before{content:'\e470'}.mui-icon-back:before,.mui-icon-left-nav:before{content:'\e471'}.mui-icon-checkmarkempty:before{content:'\e472'}.mui-icon-home:before{content:'\e500'}.mui-icon-navigate:before{content:'\e501'}.mui-icon-gear:before{content:'\e502'}.mui-icon-paperplane:before{content:'\e503'}.mui-icon-info:before{content:'\e504'}.mui-icon-help:before{content:'\e505'}.mui-icon-locked:before{content:'\e506'}.mui-icon-more:before{content:'\e507'}.mui-icon-flag:before{content:'\e508'}.mui-icon-home-filled:before{content:'\e530'}.mui-icon-gear-filled:before{content:'\e532'}.mui-icon-info-filled:before{content:'\e534'}.mui-icon-help-filled:before{content:'\e535'}.mui-icon-more-filled:before{content:'\e537'}.mui-icon-settings:before{content:'\e560'}.mui-icon-list:before{content:'\e562'}.mui-icon-bars:before{content:'\e563'}.mui-icon-loop:before{content:'\e565'}.mui-icon-paperclip:before{content:'\e567'}.mui-icon-eye:before{content:'\e568'}.mui-icon-arrowup:before{content:'\e580'}.mui-icon-arrowdown:before{content:'\e581'}.mui-icon-arrowleft:before{content:'\e582'}.mui-icon-arrowright:before{content:'\e583'}.mui-icon-arrowthinup:before{content:'\e584'}.mui-icon-arrowthindown:before{content:'\e585'}.mui-icon-arrowthinleft:before{content:'\e586'}.mui-icon-arrowthinright:before{content:'\e587'}.mui-icon-pulldown:before{content:'\e588'}.mui-fullscreen{position:absolute;top:0;right:0;bottom:0;left:0}.mui-fullscreen.mui-slider .mui-slider-group{height:100%}.mui-fullscreen .mui-segmented-control~.mui-slider-group{position:absolute;top:40px;bottom:0;width:100%;height:auto}.mui-fullscreen.mui-slider .mui-slider-item>a{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mui-fullscreen .mui-off-canvas-wrap .mui-slider-item>a{top:auto;-webkit-transform:none;transform:none}.mui-bar-nav~.mui-content .mui-slider.mui-fullscreen{top:44px}.mui-bar-tab~.mui-content .mui-slider.mui-fullscreen .mui-segmented-control~.mui-slider-group{bottom:50px}.mui-android.mui-android-4-0 input:focus,.mui-android.mui-android-4-0 textarea:focus{-webkit-user-modify:inherit}.mui-android.mui-android-4-2 input,.mui-android.mui-android-4-2 textarea,.mui-android.mui-android-4-3 input,.mui-android.mui-android-4-3 textarea{-webkit-user-select:text}.mui-ios .mui-table-view-cell{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.mui-plus-visible,.mui-wechat-visible{display:none!important}.mui-plus-hidden,.mui-wechat-hidden{display:block!important}.mui-tab-item.mui-plus-hidden,.mui-tab-item.mui-wechat-hidden{display:table-cell!important}.mui-plus .mui-plus-visible,.mui-wechat .mui-wechat-visible{display:block!important}.mui-plus .mui-tab-item.mui-plus-visible,.mui-wechat .mui-tab-item.mui-wechat-visible{display:table-cell!important}.mui-plus .mui-plus-hidden,.mui-wechat .mui-wechat-hidden{display:none!important}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav{height:64px;padding-top:20px}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav~.mui-content{padding-top:64px}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-header-secondary,.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-nav~.mui-content .mui-pull-top-pocket{top:64px}.mui-plus.mui-statusbar.mui-statusbar-offset .mui-bar-header-secondary~.mui-content{padding-top:94px}.mui-iframe-wrapper{position:absolute;right:0;left:0;-webkit-overflow-scrolling:touch}.mui-iframe-wrapper iframe{width:100%;height:100%;border:0} \ No newline at end of file diff --git a/css/my.css b/css/my.css new file mode 100644 index 0000000..2dfa928 --- /dev/null +++ b/css/my.css @@ -0,0 +1,369 @@ +body:after { + content: ""; + position: fixed; + /*top: -10px;*/ + bottom: -10px; + left: 0; + width: 100%; + height: 10px; + box-shadow: 0 -0.5vw 2.3vw 3px rgba(25, 25, 25, 0.1); + /*-webkit-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -moz-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -o-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -ms-box-shadow: 0 0.5vw 2.3vw 15px #ccc;*/ + z-index: 100; +} + +.my{ + width: 100%; + position: relative; +} + +.mui-scroll{ + /* background: url(../img/my_bg.png) no-repeat center top; */ + background-size: 100% ; +} + + +.con{ + position: absolute; + top: 35px; + left: 15px; + width: 93%; + /* height: 70px; */ + +} +.con .login{ + width: 78px; + height:78px; + border-radius: 100px; + border: 3px solid #ebebeb; + color: white; + text-align: center; + line-height: 72px; + /*margin: 0 auto;*/ + position: absolute; + top: -20px; + left: 0; + right: 0; + z-index: 0; + margin:0px auto; + /* font-size: 22px; */ + background: white; + color: black; +} +.con1{ + margin-top: 30px; + display: flex; + justify-content: flex-start; + align-items:center; + padding: 10px; + height:120px ; +} +.con1 img{ + display: inline-block; + width: 78px; + height: 78px; + border-radius: 100px; + border: 3px solid #fff; + margin-right: 20px; + /* left: 0; + top: 0; + right: 0; + margin: 0 auto; + z-index: 11; + position: absolute; */ +} +.con1 .left { + width: 60%; + height: 80px; + display: flex; + justify-content: space-around; + align-items: flex-start; + flex-direction: column; +} +.con1 p{ + display: inline-block; + /* position: absolute; */ + font-size: 19px; + color: #fff; + font-weight:300; + /* width: 60%; */ + + /* left: 0; */ + /* top: 85px; */ + /* right: 0; */ + /* margin: 0 auto; */ + /* width: 100%; */ + /* text-align: center; */ +} +.con1 .left p span { + padding-right: 10px; + font-size: 14px +} +.seeting{ + font-size: 22px; + color: #fff; + /* margin-top: 15px; + margin-left: 9px; + float: left; */ + width: 10%; +} +.hyz{ + width: 102px; + height: 26.4px; + font-size: 13.2px; + line-height: 29px; + text-indent: 27px; + color: #fff; + background: url(../img/hyz_bg.png) no-repeat center top; + background-size: 100%; + right: 0; + position: absolute; + top: 111px; +} +.nav { + width: 96%; + height: 122px; + background: white; + /* margin-bottom: 9px; */ + margin: 0 2%; + padding-top: 58px; + margin-top: 30px; +} +.nblock{ + width: 33.3%; + height: 72px; + text-align: center; + float: left; + /* padding-top: 10px; */ +} +.nblock p{ + color: #525252; + font-size: 13.2px; + margin-top: 3px; + +} + +.order, .myMoney, .myYouhuiquan, .mydata, .shenqingcon{ + margin: 6px 2%; + width: 96%; +} +/* 优惠券 */ +.myYouhuiquan{ + /* height: 150px; */ + width: 98%; + margin: 5px auto 0px; + /* padding-top: 30px; */ + /* display: none; */ +} +.myYouhuiquan_con{ + /* position: absolute; */ + height: 100px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; + background: white; + box-sizing: border-box; + border: 1px solid #FFFFFF; + border-radius: 5px; + /* border-bottom: 1px solid #e6e6e6; */ +} +.myYouhuiquan_con1{ + width: 90%; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; + /* padding-top: 111px; */ + /* background: #000000; */ + margin: 15px auto 2px; +} +.myYouhuiquan_cb{ + width:33.333%; + height: 50px; + padding: 4px auto; + text-align: center; + /* float: left; */ + /* position: relative; */ +display: flex; +flex-direction: column; +/* align-items: center; */ +justify-content: center; + border-bottom: 1px solid #c0c0c0; + /* border: 1px solid #C0C0C0; */ +} + +.myYouhuiquan_cb p{ + color: #525252; + font-size: 18px; +} +.myYouhuiquan_cb .orange{ + color:#FC773F; + font-size: 18px; +} +/* 订单 */ + +.order_title{ + width: 100%; + height: 43px; + background: white; + border-bottom: 1px solid #e6e6e6; + line-height: 43px; + +} + +.order_title p{ + font-size: 18px; + color: black; + float: left; + margin: 0; + margin-left: 12px; +} + +.order_title .order_more{ + color: #909090; + font-size: 17px; + float: right; + margin: 0; + margin-right: 12px; + +} +.order_con{ + background: white; + border-bottom: 1px solid #e6e6e6; +} +.order_cb{ + width: 20%; + height: 90px; + text-align: center; + float: left; + position: relative; +} +.orderimg{ + width: 30px; + /* height: 30px; */ + margin: 10px auto; +} + .orderimg img{ + width:100%; + /* margin-top: 15px; */ +} +.order_cb p{ + margin: 0px; + padding: 0px; + /* margin-top: 3px; */ + /* color: #525252; */ + color: #909090; + font-size: 18px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.logistics{ + height: 96px; + background: white; +} +.waitReceive{ + position: relative; +} +.num{ + position: absolute; + width: 20px; + height: 20px; + border-radius: 50%; + background: red; + color: white; + font-size: 10.8px; + text-align: center; + line-height: 20px; + top: 5px; + left: 70%; +} + +.myMoney{ + width: 96%; + background: white; + +} +.moneycon_{ + width: 25%; + float: left; + height: 100px; + position: relative; +} +.moneycon_ img{ + text-align: center; + width: 61px; + height: 61px; + position: absolute; + left: 0; + right: 0; + margin: 0 auto; + top:5px; +} +.moneycon_ p{ + text-align: center; + position: absolute; + bottom: 5px; + left: 0; + right: 0; + margin: 0 auto; + color: #E51329; + font-size: 14.4px; +} +.share{ + font-size: 14.4px; + color: #ffffff; + margin-top: 15px; + margin-right: 9px; + float: right; +} +.mydata .mydata-content{ + background: #fff; + width: 100%; + display: flex; + justify-content: flex-start; + flex-wrap: wrap; +} + +.mydata .mydata-content .mydata-table-view-cell{ + width: 25%; + text-align: center; + padding: 5px 0px; + border-right: 1px solid #ECECEC; + border-bottom: 1px solid #ECECEC; + +} +.mydata .mydata-content .mydata-table-view-cell a { + color:#525252 ; + display: inline-block; + width: 100%; +} +.mydata .mydata-content .mydata-table-view-cell p { + font-size: 18px; +} +.mydata .mydata-content .mydata-table-view-cell .mydata-media-body { + font-size: 13px; + + } + .shenqingcon { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + } + .shenqingcon .shenqingcon_{ + width: 24%; + text-align: center; + } + .shenqingcon .shenqingcon_ img{ + text-align: center; + width: 61px; + height: 61px; + /* position: absolute; + left: 0; + right: 0; */ + margin: 0 auto; + top:5px; + } diff --git a/css/myshop.css b/css/myshop.css new file mode 100644 index 0000000..7521834 --- /dev/null +++ b/css/myshop.css @@ -0,0 +1,293 @@ +.header { + background: none !important; + +} +.header_bg_con .shop_info .myshopname{ + width:200px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + + + +/* .mui-icon-gear { + font-size: 26px; + height: 30px; + position: absolute;*/ +/* top: 0px; */ +/* right: 15px; + z-index: 100; +} */ + +.header_background { + height: 200px; + width: 100%; + background: #FF7900; + border: 1px solid #ff7900; + border-radius: 10px; +} + +.header_bg_con { + margin-top: 45px; + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px; + flex: 1; +} + +.headerimg { + + width: 78px; + height: 78px; + border-radius: 100px; + border: 3px solid #fff; + margin-right: 10px; +} + +.headerimg img { + width: 100%; +} + +.header_bg_con .shop_info { + flex: 3; +} + +.header_bg_con .shop_info p { + font-size: 19px; + color: #fff; + font-weight: 300; +} + +.header_bg_con .shop_info span { + font-size: 16px; + color: #fff; + margin-right: 10px; +} + +.seeting { + font-size: 25px; + color: #fff; + + +} + + + +.myYouhuiquan_con { + /* position: absolute; */ + height: 100px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + align-items: center; + background: white; + box-sizing: border-box; + border: 1px solid #FFFFFF; + border-radius: 5px; + /* border-bottom: 1px solid #e6e6e6; */ +} + +.money { + width: 80%; + display: flex; + justify-content: space-between; + align-items: center; + margin: -35px auto 2px; + background: #fff; +} + +.myYouhuiquan_cb { + width: 48%; + height: 80px; + padding: 4px auto; + text-align: center; + display: flex; + flex-direction: column; + justify-content: space-around; + border-right: 1px solid #c0c0c0; +} + +.myYouhuiquan_cb p { + color: #525252; + font-size: 18px; +} + +.myYouhuiquan_cb .orange { + color: #FC773F; + font-size: 16px; +} + + +.order { + margin:10px auto 3px; + width: 96%; + +} + +.order_title { + width: 100%; + height: 43px; + background: white; + border-bottom: 1px solid #e6e6e6; + line-height: 43px; + +} + +.order_title p { + font-size: 17px; + color: black; + float: left; + margin: 0; + margin-left: 12px; +} + +.order_title .order_more { + color: #909090; + font-size: 17px; + float: right; + margin: 0; + margin-right: 12px; + +} + +.order_con { + background: white; + border-bottom: 1px solid #e6e6e6; + display: flex; + justify-content:flex-start; + align-items: center; +} + +.order_cb { + height: 90px; + display: flex; + flex-direction: column; + justify-content: space-around; + align-items: center; + position: relative; + /* flex: 1; */ + width: 20%; +} + +.orderimg { + width: 30px; + /* height: 30px; */ +/* margin: 10px auto; */ + +} + +.orderimg img { + width: 100%; + +} + +.order_cb p { + margin: 0px; + padding: 0px; + + color: #909090; + font-size: 15px; +} + +.waitReceive { + position: relative; +} + +.num { + position: absolute; + width: 20px; + height: 20px; + border-radius: 50%; + background: red; + color: white; + font-size: 10.8px; + text-align: center; + line-height: 20px; + top: 5px; + left: 50px; +} +.offline_order .num{ + left: 75px; + } + + +.orders-title { + padding: 10px; + /* background: #fff; */ + text-align: center; + color: #f11; +} + +.orders-title h3 { + font-size: 15px; +} + +.shop-goods{ + width: 96%; + margin: 0 auto; + background: #EFEFEF; +} + +.shop-goods-content { + width: 100%; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.shop-goods-detail { + width: 49%; + height: 240px; + padding: 10px; + background: #fff; +} + +.sgd-list { + width: 98%; + margin: 0 auto; + +} + +.shop-goods-detail .sdg-img { + width: 100%; + margin: 0 auto; + display: inline-block; +} + +.sgd-info { + font-size: 16px; + color: #000; + margin: 5px auto; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.sgd-price { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} + +.market-price span { + font-size: 15px; + color: #000; +} + +.market-price .price { + color: #F02A40; + /* font-size: 16px; */ + /* margin-left: 10px; */ +} + +.youhuilv span { + font-size: 15px; + color: #000; +} + +.youhuilv .preference-rate { + /* margin-left: 5px; */ +} diff --git a/css/myshops.css b/css/myshops.css new file mode 100644 index 0000000..8d19014 --- /dev/null +++ b/css/myshops.css @@ -0,0 +1,187 @@ +.con{ + margin-bottom: 25px; +} + +.list { + display: flex; + justify-content: space-between; + align-items: center; + width: 98%; + margin: 0 auto; + padding: 2px 5px; + background: #fff; + flex: 1; +} + +.listimg { + width: 50px; + height: 50px; + border: 1px solid #fff; + border-radius: 50px; +} + +.listimg img { + width: 100%; + height: 100%; +} + +.lctop { + display: flex; + justify-content: space-between; + align-items: center; +} + +.listcenter { + flex: 2; + align-self: flex-start; + margin: 10px; +} + +.listright { + display: flex; + justify-content: flex-start; + align-items: center; + margin: 8px auto 3px; +} + +.listcenter .name, +.listcenter .info { + display: flex; + justify-content: flex-start; + align-items: center; +} + +.nc { + display: none; + /* font-size: 14px; */ + /* color: #000; + height: 18px; + width: 20px; */ + /* width: 70%; */ + /* display: inline-block; */ + /* margin-left: 2px; */ + /* margin: 0px 11px; */ +} + +.shopname { + max-width: 120px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 18px; +} + +.infocom { + font-size: 16px; + color: #ccc; + margin: 0px 5px; +} + +.supermaket .namecom { +/* border: 1px solid #FF4500; + border-radius: 4px; */ + text-align: center; + line-height: 23px; + color:#FF4500; +} + +.commercial .namecom { +/* border: 1px solid #FEAA24; + border-radius: 4px; */ + text-align: center; + line-height: 23px; + color:#FEAA24; + +} + +.shangdu .namecom { + /* border: 1px solid #F50003; */ + /* border-radius: 4px; */ + text-align: center; + line-height: 23px; + color:#F50003; + +} + +.scinfo { + color: #FF4500; +} + +.ssinfo { + color: #FEAA24; +} + +.sdinfo { + color: #F50003; +} + +.listright p { + margin-right: 15%; + padding: 5px 15px; + border: 1px solid #ccc; + border-radius: 10px; + /* margin: 4px auto; */ + text-align: center; + font-size: 16px; + /* background: #efefef; */ +} + +.add1 { + width: 96%; + margin: 5px auto; + height: 63px; + background: #C9C9C9; + border: 1px solid #C9C9C9; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + /* margin-top: 10px; */ +} + +.addimg { + width: 40px; + height: 40px; +} + +.add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; + +} + +.lxy_zz { + width: 80%; + margin: 0 auto; + position: relative; + top: 40%; + padding-top: 10px; + padding-bottom: 10px; + background: #fff; +} + +.lxy_zz h3 { + text-align: center; + font-size: 18px; + font-weight: 200; + +} + +.lxy_zz input { + /* position: absolute; */ + width: 88%; + display: block; + /* top:50%; + left: 10%; */ + margin: 10px auto; + height: 35px; + border-radius: 5px; +} + +.lxy_zz_btn { + display: flex; + justify-content: space-between; + width: 80%; + margin: 0 auto; +} diff --git a/css/order_con.css b/css/order_con.css new file mode 100644 index 0000000..4e1cc3b --- /dev/null +++ b/css/order_con.css @@ -0,0 +1,184 @@ +.ad { + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ + width: 100%; + height: 126px; + position: relative; +} + +.ad p { + position: absolute; + color: white; + margin: 0; + font-size: 13.2px; + top: 57px; + left: 36px; +} + +.address { + background: white; + /*border-bottom: 1px solid #e6e6e6;*/ + margin-bottom: 5px; + position: relative; +} + +.add_l { + float: left; + width: 39px; + position: absolute; + top: 0; + bottom: 0; +} + +.add_l img { + width: 21.6px; + height: 21.6px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + text-align: center; +} + +.add_r { + width: calc( 100% - 39px); + float: right; + padding-right: 9px; + font-size: 18px; + color: #909090; +} + +.add_r_t { + width: 100%; + padding: 6px 0 1px; +} + +.add_r_t_l { + float: left; +} + +.add_r_t_r { + float: right; +} + +.add_r_b { + width: 100%; + padding: 0 0 3px; +} + +.shop_info { + margin-bottom: 5px; +} + +.invoice_info { + width: 100%; + padding: 3px 9px; + background: white; + margin-bottom: 6px; + +} + +.invoice_info p {font-size: 17px;} + +.cost { + border-bottom: 1px solid #e6e6e6; + background: white; + padding: 9px 9px; + border-radius: ; +} + +.c1 { + font-size: 18px; + color: #909090; +} + +.c1_l { + float: left; +} + +.c1_r { + float: right; +} + +.c2 { + font-size: 18px; + color: black; +} + +.cost .on { + color: #e51329; +} + +.jf_info { + width: 100%; + height: 45.6px; + background: white; + border-bottom: 1px solid #e6e6e6; +} + +.jf_jf { + margin-top: 10px; + margin-left: 10px; + color: #e51326; + font-size: 16px; + border: 1px solid #e51227; + border-radius: 3px; + float: left; + padding: 0 5px; +} + +.jf_p { + font-size: 18px; + color: #525252; + float: left; + margin-left: 10px; + line-height: 46px; +} + +.jf_p o { + color: #e51329; +} + +.lxmj { + width: 100%; + height: 51.6px; + position: relative; + background: white; + margin-bottom: 6px; + display: block; +} + +.lxmj img { + width: 15px; + position: absolute; + top: 50%; + left: 35%; + transform: translate(-50%, -50%); +} + +.lxmj p { + font-size: 18px; + color: #525252; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} + +.info { + width: 100%; + padding: 9px; + background: white; + margin-bottom: 6px ; +} + +.info p { + color: #909090; + font-size: 16px; +} \ No newline at end of file diff --git a/css/pay.css b/css/pay.css new file mode 100644 index 0000000..b863fe3 --- /dev/null +++ b/css/pay.css @@ -0,0 +1,201 @@ +.bg { + background: rgba(1, 1, 1, 0.1); + position: fixed; + left: 0; + top: 0; + bottom: 0; + right: 0; + z-index: 10; +} +.pay_info{ + margin-bottom: 100px; + + } +.pay,.pay_way { + position: fixed; + left: 0; + right: 0; + bottom: 0; + background: white; + margin-bottom: 52px; + min-height: 400px; + /* height: 90%; */ +} +.pay{ + /*transform: translateY(380px);*/ + display: none; +} +.pay_title { + width: 100%; + height: 49px; + border-bottom: 1px solid #e6e6e6; + position: relative; +} + +.pay_title a { + position: absolute; + z-index: 10; + font-size: 30px; + color: #909090; + line-height: 50px; + left: 5px; +} + +.pay_title p { + line-height: 48px; + text-align: center; + color: black; + font-size: 15.6px; +} + +.paynum { + font-size: 18px; + text-align: center; + color: black; + padding: 20px 0; +} + +.con_1 { + padding-left: 15px; +} + +.con_1 .row { + width: 100%; + height: 42px; + border-bottom: 1px solid #e6e6e6; + line-height: 42px; + font-size: 13.2px; +} + +.row_left { + float: left; + color: #909090; + font-size: 18px; +} + +.row_right { + float: right; + color: black; + padding-right: 15px; + position: relative; + font-size: 18px; +} + +.row_right img { + position: absolute; + right: 15px; + top: 12px; +} + +.pay_btn { + width: 92%; + margin: 3px 4% ; + color: #FFFFFF; + background: #e6122b; + border: none; + border-radius: 1%; + height: 42px; +} + +/* .pay_way .pay_title a { + font-size: 30px; + margin: 6px; +} */ +#qlg_pay_pwd .con_2 .prod .info{ + padding: 5px; + display: flex; + justify-content: space-between; + align-items: center; + margin: 0px; +} +#qlg_pay_pwd .con_2 .prod .info .p1{ +/* flex: 1; */ + padding: 0px; + margin: 0px 0px; + text-align: left; +} +#qlg_pay_pwd .con_2 .prod .info .p1 span{ + /* margin-left: 10px; */ +} +#qlg_pay_pwd .con_2 .shadown_wai input{ + width: 40%; + min-width: 65px; + padding: 0px; + margin: 5px 20px; + text-align: right; + height: 30px; + /* border: 0px; */ +} +.wangInfo .p1{ + min-width: 50px; + padding-left: 10px; +} +.pay_way .con .row .row_left { + color: black; +} + +.row .mui-icon { + color: #e6122b; + font-size: 42px; + padding: 0; +} +#pay_pwd,#qlg_pay_pwd .con_1 { + width: 70%; + margin: 0 auto; + padding:10px 0px; + text-align: center; + position: relative; +} +#pay_pwd,#qlg_pay_pwd .con_2{ + padding:0; + margin: 0; + /* position: relative; */ +} +#pay_pwd,#qlg_pay_pwd .con_2 p{ + font-size: 16px; + +} +#pay_pwd,#qlg_pay_pwd .con_1 input{ + margin: 14px 5%; + width: 70%; + height: 30px; +} +/* #pay_pwd,#qlg_pay_pwd .con_2 input{ + margin: 0 5%; + width: 90%; +} */ +#pay_pwd,#qlg_pay_pwd .con_1 .p9{ + /* margin: 30px 5%; */ + /* width: 90%; */ + position: absolute; + /* padding:10px; */ + left:18%; + /* right: 5%; */ + top:62px; + font-size: 16px +} + +/* #pay_pwd,#qlg_pay_pwd .con_2 .p1{ + display: inline-block; + padding:0; + margin: 0; + font-size:15px; +} */ +.pay_btn_pwd { + width: 50%; + text-align: center; + margin:5px 25%; + color: #FFFFFF; + background: #e6122b; + border: none; + border-radius: 2%; + height: 42px; +} +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 49px; + border-top: 1px solid #e6e6e6; +} \ No newline at end of file diff --git a/css/paymentVoucher.css b/css/paymentVoucher.css new file mode 100644 index 0000000..6b874df --- /dev/null +++ b/css/paymentVoucher.css @@ -0,0 +1,232 @@ +.con { + width: 98%; + margin: 0px auto 20px; +} +.con .info { + margin-bottom: 5px; + +} +.rowList { + display: flex; + justify-content: space-between; + align-items: center; + width: 98%; + margin: 0px auto; + padding: 3px 1px; + background: #fff; + border-bottom:1px solid #ccc; +} +.rowList label{ + min-width:70px; + font-size: 13px; + +} +.rowList input { + font-size: 13px; + padding: 0px 10px; + margin: 0px; + text-align: right; + border: 0px; + } +input{ + margin-right: 5px; + height: 20px; +} +.con_nav { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + overflow: hidden; + border: 1px solid #fff; + border-radius: 15px; +} +.nh_left{ + /* border: 1px solid #fff; */ + +} +.nav_header { + text-align: center; + flex: 1; + background: #00D793; + color: #fff; + height: 30px; + line-height: 30px; + /* border-right: 1px solid #f00; */ + +} + +.active { + background: #f00; + color: #ccc; +} +.row{ + margin:8px auto; + background: white; + padding:0px 5px; +} +.row_block_list { + display: flex; + justify-content: space-between; + align-items: flex-start; + /* background: #efefef; */ + padding: 5px auto; + +} + +.row_block_img { + width: 117px; + height: 126px; + padding: 9px 0 9px 9px; +} + +.row_block_img img { + width: 100%; + height: 100%; +} + + .row_title { + display: flex; + justify-content:space-between; + align-items: center; + padding: 5px 1%; + font-size: 14px; +} + .row_title_ { + display: flex; + justify-content:space-between; + align-items: center; + padding: 5px 1%; + font-size: 14px; +} +/* .uncommitted .row_title { + justify-content:flex-start; + +} */ +.committed .row_title { + justify-content:space-between; + font-size: 12px; +} +.store_name{ + font-size: 15px; + +} +/* .committed .oper{ + background: url(../img/bianji.png) no-repeat /50% 50%; + background: #000000; + } */ +.rcr { + flex: 0.8; + padding-top: 9px; +} + +.rcrc p { + overflow: hidden; + font-size: 12px; + color: black; +} + +.rcrc .leibie { + color: #909090; +} + +.rcrr { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + padding-top: 9px; +} + +.rcrr p { + color: black; + font-size: 12px; + margin-bottom: 5px; +} + +/* .rcrr del { + color: #909090; + font-size: 12px; + + } */ +.row_title label{ + font-size: 14px; + color: black; +} +.rcrr span { + color: #909090; + font-size: 12px; +} + +.combination { + width: 100%; + height: 37px; + border-bottom: 1px solid #e6e6e6; + background: white; + text-align: right; + font-size: 12px; + line-height: 36px; + padding-right: 9px; +} + +.combination_totle { + font-size: 15px; + background: #FF1A03; + padding: 0px 10px; + + /* flex: 1; */ + height: 30px; + line-height: 30px; + text-align: center; + border: 1px solid #f00; + border-radius: 15px; + color: #fff; +} + +.combination_totle span { + /* color: #f00; */ + margin:0px 5px; +} +.committed { + margin-top: 10px; +} +.row_cont .row_block_list{ + font-size: 13px; + align-items: center; + padding: 6px 1%; + } +.oper{ + width: 20px; + height: 20px; +} +.oper img { + width: 100%; + height: 100%; +} +.btns { + display: flex; + justify-content: space-between; + align-items: center; + margin: 10px 0px; +} +.btns input{ + height: 20px; + +} +.btns label{ + font-size: 14px; + color: black; +} +.bc_btn { + height: 30px; + line-height: 30px; + /* flex: 0.7; */ + font-size: 15px; + text-align: center; + padding: 0px 10px; + /* width: 70%; */ + /* margin: 10px auto; */ + color: #fff; + background: #FF1A03; + border-radius: 15px; +} diff --git a/css/pj.css b/css/pj.css new file mode 100644 index 0000000..02c1c3f --- /dev/null +++ b/css/pj.css @@ -0,0 +1,126 @@ +body { + background: #ebebeb; +} + +.describe { + width: 100%; + height: 70.2px; + background: #fff; + border-bottom: 1px solid #e7e7e7; + border-top: 1px solid #e7e7e7; +} + +.des_img { + width: 51px; + height: 51px; + margin-left: 3%; + margin-top: 2%; + float: left; +} + +.des_img img { + width: 50px; + height: 50px; +} + +.describe p { + font-family: "微软雅黑"; + font-size: 18px; + float: left; + line-height: 70.2px; + margin-left: 5%; + color: #000000; + width: calc(100% - 100px); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.row p { + font-family: "微软雅黑"; + font-size: 16px; + float: left; + line-height: 40px; + margin-left: 5%; + color: #000000; +} + + + +.star_a img { + width: 15px; + height: 13.8px; + float: left; + margin-top: 80%; +} + +.row { + width: 100%; + height: 40px; + background: #fff; + border-top: 1px solid transparent; +} + +.purchase { + width: 100%; + background: #fff; + border-top: 1px solid transparent; + padding: 0 5% 10px; +} + +.purchase textarea { + width: 100%; + height: 76.2px; + padding: 0; + font-family: "微软雅黑"; + font-size: 16px; + margin-top: 5px; + /*border: none;*/ +} + +.tijiao { + width: 90%; + background: #f02c43; + margin: 10px 5%; + text-align: center; + font-family: "微软雅黑"; + font-size: 15.6px; + color: #fff; + line-height: 40.8px; + border: none; +} +.star_a{ + float: left; + padding: 8px; + width: 40px; + height: 40px; + margin-left: 2%; +} +.star_off{ + width: 100%; + height: 100%; + background: url(../img/pjhx1.png)no-repeat center center; + background-size: 100%; +} +.star_on{ + width: 100%; + height: 100%; + background: url(../img/pjhx.png)no-repeat center center; + background-size: 100%; +} +.purchase_ p{ + padding:1% 0 5%; + font-size: 13.2px; + color: black; +} +.purchase_{ + background: white; + padding-bottom: 10px; + top: 1px solid transparent; + padding: 0 5% 10px; +} +.purchase_ img{ + width: 70px; + height: 70px; + padding: 5px; +} diff --git a/css/properties.css b/css/properties.css new file mode 100644 index 0000000..c4f78cf --- /dev/null +++ b/css/properties.css @@ -0,0 +1,116 @@ + +.row { + display: flex; + justify-content: space-between; + align-items: center; + background:#10B5AF; + /* height: 50px; */ + position: relative; + /* padding: 0px 7px; */ + width: 98%; + margin: 5px auto; + padding: 10px; + flex: 1; + border: 1px solid #10B5AF; +} + +.row label { + max-width: 200px; + font-size: 16px; + color: #fff; + +} + +.caozuo { + width: 25%; + display: flex; + justify-content: space-around; + align-items: space-between; +} + +.caozuo span { + display: inline-block; + /* width: 28%; */ +} +.caozuo .mui-icon{ + font-size: 32px; +} +.caozuo span img { + width: 100%; + height: 100%; + /* color: #000; */ +} +.row input { + width:180px; + border: 1px solid #CECECE; + margin: 0px; + padding: 0px 2px; + height: 26px; + text-align: right; +} +.row input::-webkit-input-placeholder{ + font-size: 13px; +} + +.addproperties-content { + width: 100%; +} +.add1{ + width: 96%; + margin: 5px auto; + height: 63px; + background:#C9C9C9; + border:1px solid #C9C9C9; + border-radius: 5px; + display:flex; + justify-content: center; + align-items:center ; + margin-top: 10px; + } + .addimg{ + width: 40px; + height: 40px; + } + .add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; + } + + + + +.addproperties-img { + width: 70px; + height: 70px; + text-align: center; + background: #fff; + margin: 0 auto; +} + +.addproperties-img .mui-icon { + width: 70px; + height: 30px; + font-size: 40px; + margin-bottom: 15px; + text-align: center; +} + +.save { + text-align: center; + margin: 50px auto 5px; +} + +.mui-btn { + width: 50%; +} +.bc_btn { + height: 30px; + line-height: 30px; + text-align: center; + width: 70%; + margin: 30px auto; + color: #fff; + background: #FF1A03; + border-radius: 15px; +} diff --git a/css/qrrz.css b/css/qrrz.css new file mode 100644 index 0000000..6375ef7 --- /dev/null +++ b/css/qrrz.css @@ -0,0 +1,107 @@ +.con{ + margin-bottom: 25px; +} +.con .block{ + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px 10px; + color: #fff; + background:#10B5AF; + margin: 5px auto; + border: 1px solid #10B5AF; + border-radius: 5px; + } + .pname{ + font-size: 16px; + + width: 80%; + color: #fff; + } + .guanxi { + width: 37%; + color: #242424; + text-align: right; + } + .caozuo { + width: 15%; + display: flex; + justify-content: space-around; + align-items: center; + } + .caozuo span { + display: inline-block; + /* width: 25%; */ + } + .caozuo .mui-icon{ + font-size: 32px; + } + .caozuo span img{ + width: 100%; + height: 100%; + } + .add1{ + width: 96%; + margin: 5px auto; + height: 63px; + background:#C9C9C9; + border:1px solid #C9C9C9; + border-radius: 5px; + display:flex; + justify-content: center; + align-items:center ; + /* margin-top: 10px; */ + } + .addimg{ + width: 40px; + height: 40px; + } + .add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; + } + + + .footer_btn{ + width: 100%; + height: 50px; + border: none; + position: fixed; + bottom: 0; + background: #E5122B; + color: white; + border-radius: 0; + } + .lxy_zz{ + width: 80%; + margin: 0 auto; + position: relative; + top:40%; + padding-top:10px; + padding-bottom:10px; + background: #fff; + } + .lxy_zz h3{ + text-align: center; + font-size: 18px; + font-weight: 200; + + } + .lxy_zz input{ + /* position: absolute; */ + width: 88%; + display:block; + /* top:50%; + left: 10%; */ + margin: 10px auto; + height: 35px; + border-radius: 5px; + } + .lxy_zz_btn{ + display: flex; + justify-content: space-between; + width: 80%; + margin: 0 auto; + } \ No newline at end of file diff --git a/css/recommend.css b/css/recommend.css new file mode 100644 index 0000000..a3001a4 --- /dev/null +++ b/css/recommend.css @@ -0,0 +1,117 @@ +.recommend{ + width: 100%; + padding: 0 1%; +} +.recommend_title{ + /* padding: 0 1%; + */ + margin: 2px auto; + height: 60px; +} +.recommend_title img{ + width: 100%; + height: 100%; + display: block; +} +.recommend_con{ + +} +.recommend_con_block{ + margin: 0 1%; + width: 48%; + border-radius: 5px; + background: white; + position: relative; + float: left; + margin-bottom: 5px; + overflow: hidden; +} +.rcb_img{ + width: 100%; + display: block; +} + +.rcb_con{ + width: 100%; + height: 105px; + padding: 3% 3% 0; +} +.rcb_title{ + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + font-size: 15px; + height: 42px; +} +.rcb_title span{ + border-radius: 5px; + font-size: 15px; + color: white; + background: #e6132c; + padding: 0 2px; +} +.rcb_pay{ + margin-top: 2px; + width: 100%; + font-size: 17px; + color: #e51329; +} +.rcb_pay span{ + border: 1px solid #e51329; + font-size: 13px; + padding: 0 2px; + border-radius: 5px; + margin-left: 10px; +} +.rcb_bottom{ + margin-top: 2px; + display: flex; + justify-content: space-between; + align-items: center; +} +.rcb_bottom span{ + color: #e51329; + font-size: 15px; + padding: 1px 2px; + /* background: #FFD7D7; */ + border-radius: 20px 0 0px 20px; +} +.rcb_bottom .s1{ + color: white; + font-size: 15px; + padding: 1px 2px; + background: -moz-linear-gradient(left, #e9c520, #ffad03); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#e9c520), to(#ffad03)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #e9c520, #ffad03); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #e9c520, #ffad03); + /*Opera11*/ + border-radius:0 20px 20px 0px; +} +.icon_icon{ + position: absolute; + width: 27px; + height: 29px; + right: 5%; + top: 10px; +} +.rcb_pay o{ + background: -moz-linear-gradient(left, #a200ff, #6600ff); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#a200ff), to(#6600ff)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #a200ff, #6600ff); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #a200ff, #6600ff); + /*Opera11*/ + color: white; + font-size: 15px; + padding: 0 3px; + border-radius:4px; +} +.rcb_pay o img{ + width: 20px; +} diff --git a/css/reviewsmanage.css b/css/reviewsmanage.css new file mode 100644 index 0000000..64b27d4 --- /dev/null +++ b/css/reviewsmanage.css @@ -0,0 +1,90 @@ +.overallmanage{ + display: flex; + justify-content: space-between; + align-items: center; + width: 98%; + height: 155px; + margin: 2px auto 10px; + background: #fff; + } + .overallmanage label{ + font-size: 15px; + /* font-weight: 300; */ + color: #414141; + } +.overallscore{ + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 100%; +} + .overallscore .score{ + font-size: 50px; + color: orange; + height: 55px; + } +.fivestars { + flex: 2; +} +.fivestars .row{ + display: flex; + justify-content: space-around; + align-items: flex-start; + padding: 5px; +} +.stars{ + display: flex; + justify-content: space-around; + align-items: center; +} +.stars span{ + display: inline-block; + width: 21px; + height: 21px; +} +.stars span img{ + width: 100%; + height: 100%; +} + +.con_con{ + padding: 5px; + margin-bottom: 5px; +} +.overallmanage_con{ + width: 98%; + margin: 3px auto; + background: #fff; +} +.con_top{ + display: flex; + justify-content: space-between; + align-items: center; +} +.con_con_con{ + display: flex; + justify-content: space-between; + align-items: center; +} +.imgs{ + display: flex; + justify-content: flex-start; + align-items: center; + flex-wrap: wrap; + align-content: flex-start; + +} +.img_con{ + width: 20%; + height: 80px; + margin: 10px auto; +} +.img_con img{ + width: 100%; + height: 100%; +} + + + \ No newline at end of file diff --git a/css/saoyisao.css b/css/saoyisao.css new file mode 100644 index 0000000..c5ea7bc --- /dev/null +++ b/css/saoyisao.css @@ -0,0 +1,34 @@ +#bcid { + width: 100%; + height: 100%; + position: absolute; + background: #000000; +} + +html, +body, +div { + height: 100%; + width: 100%; +} + +.fbt { + color: #0E76E1; + width: 50%; + background-color: #ffffff; + float: left; + line-height: 44px; + text-align: center; +} +.choose{ + height: 50px; + display: flex; + justify-content: space-between; + align-items: center; +} +.choose .cancel{ + position:static; + /* top: 10px; */ + /* right: 12px; */ + z-index: 100; + } \ No newline at end of file diff --git a/css/self_shop.css b/css/self_shop.css new file mode 100644 index 0000000..7e4060a --- /dev/null +++ b/css/self_shop.css @@ -0,0 +1,381 @@ +.saoyisao { + color: white; + font-size: 30px; + background: rgba(25, 25, 25, .4); + width: 35px; + height: 35px; + padding: 2.5px; + right: 3%; + top: 50%; + transform: translateY(-50%); + border-radius: 50%; + line-height: 27px; + } + + .mui-icon-arrowdown { + margin-top: 23px; + color: white; + font-size: 25px; + background: rgba(25, 25, 25, .4); + width: 30px; + height: 30px; + padding: 2px; + margin-left: 5px; + top: 50%; + transform: translateY(-50%); + border-radius: 50%; + line-height: 27px; + + } + + #location, + #location-r { + display: inline-block; + color: #555555; + font-size: 18px; + height: 44px; + line-height: 48px; + min-width: 44px; + } + + .search input { + padding: 0; + width: auto; + text-align: left; + font-size: 18px; + } + + .zy_ac { + width: 100%; + background: white; + margin-top: 9px; + } + + .zyac_c { + width: 50%; + float: left; + } + + .zyac_c .time_icon { + width: 43px; + } + + .zyac_c .timer { + left: 50px; + } + + .zyac_con { + padding: 2%; + } + + .zyac_block { + width: 50%; + float: left; + } + + .zyac_con img { + width: 100%; + padding: 0 8%; + display: block; + } + + .zyac_block p { + /*position: absolute;*/ + bottom: 25px; + text-align: center; + font-size: 14px; + color: #e51329; + width: 100%; + height: 21px; + } + + .zyac_block del { + text-align: center; + /*position: absolute;*/ + bottom: 5px; + font-size: 12px; + color: #808080; + width: 100%; + height: 21px; + display: block; + } + + .zy_add { + margin-top: 9px; + width: 100%; + background: white; + } + + .zya_block { + width: 50%; + float: left; + position: relative; + } + + .zya_block p { + position: absolute; + left: 5%; + } + + .zya_block .p1 { + top: 7%; + color: #333333; + font-weight: bold; + font-size: 14px; + } + + .zya_block .p2 { + top: 25%; + color: 818181; + font-size: 12px; + } + + .zya_block img { + width: 50%; + position: absolute; + right: 0; + bottom: 0; + padding: 10% 3% 3% 10%; + } + + .addsc_top img { + width: 100%; + display: block; + } + + .adds .p1 { + background: linear-gradient(to right, #f24e5a, #fd891f); + -webkit-background-clip: text; + color: transparent; + } + + .adds .p1_ { + background: linear-gradient(to right, #4ea3f2, #f94e97); + -webkit-background-clip: text; + color: transparent; + } + + .adds .p1__ { + background: linear-gradient(to right, #f24e5a, #8c3ad8); + -webkit-background-clip: text; + color: transparent; + } + + .classify { + padding: 0 4% 5px; + } + + #top_banner { + /* height: 460px; */ + width: 100%; + height: 300px; + margin: 20px auto; + /* margin: 0; */ + position: relative; + } + + #top_banner .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; + /* Center slide text vertically */ + 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; + } + + #top_banner .swiper-slide img { + width: 100%; + height: 100%; + } + + #top_banner .swiper-pagination-bullet-active { + background: white; + } + + #top_banner .swiper-pagination-bullet { + background: #eee; + } + + .shops-nav { + background: #fff; + margin: 10px auto; + padding: 10px auto; + height: 30px; + line-height: 30px; + width: 100%; + display: flex; + justify-content: space-between; + border-radius: 10px; + overflow: hidden; + } + + .shops-nav .on { + color: #f00; + /* background: #FF0000; */ + border-bottom: 1px solid #f00; + } + + .shops-nav1 { + width: 50%; + text-align: center; + } + + .shops-content1-content { + margin: 0px; + padding: 0px; + /* padding: 0px 10px; */ + } + + .shops-content1-title { + display: flex; + justify-content: space-between; + align-items: center; + height: 60px; + width: 100%; + padding: 0px 10px; + overflow: hidden; + } + + .shops-content1-title .shop-name { + font-size: 17px; + /* font-weight: 200; */ + color: #505050; + display: inline-block; + width: 65%; + } + + .shops-content1-title .aixinImg { + width: 13px; + height: 13px; + margin-left: 7px; + vertical-align: middle; + } +.aixinlevel { + display: inline-block; + height: 13px; + line-height: 13px; + font-size: 14px; + color: #F02A40; + } +/* .shops-content1-title .aixinImg img { + width: 100%; + height: 100%; + } */ + .shops-content1-title .logoimg { + display: inline-block; + width: 40px; + height: 40px; + /* height: 30px; */ + } + + .shops-con-con { + background: #fff; + margin: 5px auto; + } + + .shops-content1-title .logoimg img { + width: 100%; + height: 100%; + /* padding-top: 3px; */ + } + + .shops-content1-title .gogogo { + display: inline-block; + width: 25%; + height: 24px; + line-height: 24px; + font-size: 18px; + border: 1px solid #E94744; + text-align: center; + border-radius: 12px; + color: #fff; + background: #E94744; + } + + .t_con { + display: flex; + justify-content: flex-start; + align-items: center; + /* height: 150px; */ + padding: 5px 10px; + } + + .t_con_ { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + height: 130px; + width: 30%; + } + + .t_con_ span { + font-size: 18px; + color: #666; + } + + .t_con_img { + height: 100px; + width: 100%; + } + + .t_con_ img { + width: 100%; + height: 100%; + } + + /* #timer_swiper .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; */ + /* Center slide text vertically */ + /* 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; + } */ + + /* #timer_swiper .swiper-slide img { + width: 100%; + height: 100%; + } */ + + .pos { + margin: 5px auto; + padding: 0px 10px; + height: 25px; + line-height: 25px; + width: 100%; + text-align: right; + } + + .pos img { + display: inline-block; + width: 4%; + padding-top: 3px; + margin-right: 5px; + + } + + .pos span { + font-size: 18px; + color: #909090; + } diff --git a/css/setting.css b/css/setting.css new file mode 100644 index 0000000..a1c7521 --- /dev/null +++ b/css/setting.css @@ -0,0 +1,114 @@ +body .header1{ + z-index: 11; + width: 100%; + position: fixed; + top: 0; + background: rgba(255,255,255,1); + border: none; + box-shadow: 0 0 0; + height: 66px; + border-bottom: 1px solid #efefef; +} +.mui-bar-nav.mui-bar .mui-icon { + margin-left: 0; +} +.mui-title{ + color: #909090; +} +.header1 .on{ + border-bottom: 3px solid #ff0000; + color: #e61329; +} +.nav{ + padding: 0 50px; + height: 66px; + text-align: center; +} +.p1{ + color: #000; + display: block; + line-height: 46px; + font-size: 18px; + padding-top: 20px; +} +.header1 .mui-action-back { + margin-top: 20px; + margin-left: 0; + color: #848484; + float: left; +} + +.footer{ + position: fixed; + bottom: 0; + width: 100%; + background: white; + height: 49px; + border-top: 1px solid #e6e6e6; +} + +.z{ + width: 100%; + height: 66px; +} +.block{ + margin-top: 36px; + padding: 0 2%; +} + +.row{ + background: white; + width: 100%; + height: 42px; + border-bottom: 1px solid #ebebeb; + position: relative; + margin-bottom: 5px; +} +.row:last-child{ + border-bottom: none; +} + + + +.row .img{ + width: 15.6px; + position: absolute; + top: 12px; + left: 12px; +} +.r1{ + font-size: 18px; + color: black; + line-height: 42px; + position: absolute; + left: 35px; +} +.r2{ + font-size: 18px; + color: #909090; + line-height: 42px; + position: absolute; + right: 25px; +} +.row img.youjiantou{ + width: 6px; + position: absolute; + right: 10px; + top: 15px; +} +.loginout{ + width: 96%; + height: 42px; + line-height: 42px; + text-align: center; + margin: 36px 2%; + background: -moz-linear-gradient(left, #f5354b, #ff005a); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5354b), to(#ff005a)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5354b, #ff005a); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5354b, #ff005a); + /*Opera11*/ + color: #fff; +} diff --git a/css/setting_address.css b/css/setting_address.css new file mode 100644 index 0000000..fc5cfd3 --- /dev/null +++ b/css/setting_address.css @@ -0,0 +1,93 @@ +.con .block{ + width: 100%; + height: 125px; + background: white; + border-bottom: 5px solid #ebebeb; + position: relative; +} +.pname{ + position: absolute; + font-size: 17px; + color: black; + left: 15px; + top: 15px; +} + +.pphone{ + position: absolute; + font-size: 17px; + color: black; + right: 15px; + top: 15px; +} +.paddress{ + position: absolute; + font-size: 17px; + color: black; + left: 15px; + top: 40px; +} +.block hr{ + position: absolute; + width: 100%; + top: 75px; + border: none; + border-top: 1px dotted #909090; +} +.btnout{ + width: 42px; + height: 42px; + position: absolute; + top:82px; + bottom: 0; + padding: 12px; + left: 5px; +} +.btn{ + width: 100%; + height: 100%; + border-radius: 50%; + border: 1px solid #909090; +} +.btnout .on{ + border: none; + background: #e7172f; +} +.block .p1{ + position: absolute; + font-size: 17px; + color: black; + left: 40px; + top:82px; + bottom: 0px; + height: 42px; + padding: 0; + line-height: 42px; +} +button{ +/* padding-left: 20px; + padding-right: 20px; */ + position: absolute; + bottom: 5px; + top:88px; + padding: 2px 20px; + font-size: 17px; +} +.bj{ + right: 100px; + +} +.del{ + right: 15px; + +} +.footer_btn{ + width: 100%; + height: 50px; + border: none; + position: fixed; + bottom: 0; + background: #E5122B; + color: white; + border-radius: 0; +} diff --git a/css/sha.css b/css/sha.css new file mode 100644 index 0000000..6417234 --- /dev/null +++ b/css/sha.css @@ -0,0 +1,13 @@ +.top { + width: 100%; + height: 16px; + background: white; +} + +.con { + width: 100%; + padding: 0 2%; + transform: translateY(-16px); + position: relative; + z-index: 1000; +} diff --git a/css/shop_decorate.css b/css/shop_decorate.css new file mode 100644 index 0000000..e69de29 diff --git a/css/shop_indentcon.css b/css/shop_indentcon.css new file mode 100644 index 0000000..758d2af --- /dev/null +++ b/css/shop_indentcon.css @@ -0,0 +1,369 @@ +.search { + padding: 7.2px 12px; + background: #ebebeb; +} + +.mui-search {} + +.mui-search .mui-placeholder { + background: #fff; +} + +.mui-search input { + background: #fff; + margin-bottom: 0; +} + +.mui-active::before { + margin-top: -10px; +} + +.row_title { + width: 100%; + position: relative; + height: 36px; + background: white; + border-bottom: 1px solid #e6e6e6 ; +} + +.store_name { + position: absolute; + /*background: url(../img/youjiantou.png) no-repeat center right;*/ + /*background-size: 6px;*/ + padding-right: 12px; + padding-left: 18px; + line-height: 36px; + font-size: 14px; +} + +.indent_status { + /* position: absolute; */ + line-height: 36px; + font-size: 13px; + right: 0; + padding-right: 12px; + float: right; +} +.yellow{ + color: #ffa800; +} +.shopPhone{ + color:tomato; +} +.shopPhone a{ + text-decoration:underline; + color:tomato; + +} +.confirm_wait{ + color: cadetblue; +} +.confirm_ok{ + color: seagreen; +} +.confirm_no{ + color:red; +} +.row{ + margin-bottom: 5px ; + background: white; + padding: 5px 10px; +} +.row_block { + width: 100%; + /*height: 128px;*/ + border-bottom: 2px solid #fff; + /*background: #efefef;*/ +} + +.row_block img { + width: 117px; + height: 126px; + float: left; + padding: 9px 5px 9px 9px; +} +.rc{ + width: calc(100% - 117px); + float: right; +} +.rcr { + /* width: calc(100% - 117px); + float: right; */ + /*height: 126px;*/ + /* padding: 12px; */ + padding-top: 12px; + background: #efefef; +} + +.rcrc { + float: left; + width: calc(100% - 60px); +} + +.rcrc p { + /* height: 42px; */ + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + font-size: 12px; + color: black; +} + +.rcrc .leibie{ + color: #909090; +} + + +.rcrr { + width: 60px; + float: right; + text-align: right; +} +#expressId{ + width: 160px; +} + + +.rcrr p { + color: black; + font-size: 12px; +} + +.rcrr del { + color: #909090; + font-size: 12px; + display: block; + /* height: 20px; */ +} + +.rcrr span { + color: #909090; + font-size: 12px; +} +.rtl { + position: absolute; + /*background: url(../img/youjiantou.png) no-repeat center right;*/ + /*background-size: 6px;*/ + padding-right: 12px; + padding-left: 18px; + line-height: 36px; + font-size: 14px; +} + +.rtr { + /* position: absolute; */ + line-height: 36px; + font-size: 13px; + right: 0; + /* padding-right: 12px; */ + float: right; +} +.rcb span{ + color: #909090; + font-size: 12px; + margin-right: 20px; +} +.combination{ + width: 100%; + /* height: 37px; */ + /* border-bottom: 1px solid #e6e6e6; */ + background: white; + text-align: right; + font-size: 12px; + /* line-height: 36px; */ + padding-right: 4px; +} +.combination o{ + font-size: 14.4px; +} +.user_info_{ + padding: 5px; + background: #fff; + border-top: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; + +} +.u_address{ + display: flex; + justify-content:flex-start; + align-items: center; + height: 37px; + width: 100%; +} +.pos_c select{ + max-width: 160px; + margin: 0px; + +} +.pos_c input{ + max-width: 200px; + + +} +.u_address .pos{ + width: 20px; + height: 20px; + +} + .u_address .pos img{ + width: 100%; + height: 100%; + } + +.pos_c{ + display: flex; + justify-content: flex-start; + align-items: center; + padding: 10px; +} +.pos_c label{ + margin-right: 19px; +} +.pos_c p { + display: inline-block; + margin-right: 10px; +} +.pos_c_p{ + width: 50px; + /* margin-left: 10px; */ +} +.btns{ + text-align: right; + width: 100%; + height: 48px; + /*background: white;*/ +} +.btns_btn{ + color: black; + font-size: 12px; + padding:3px 6px; + float: right; + margin: 9.5px 6px; + border-radius: 30px; + background: -moz-linear-gradient(left, #fcff00, #ffde00); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#fcff00), to(#ffde00)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #fcff00, #ffde00); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #fcff00, #ffde00); + /*Opera11*/ + box-shadow: 1px 1px 5px #ffde00; + +} +.btns .kk{ + border: 1px solid #e6e6e6; + border-radius: 1px; +} + +.btns .qrsh{ + border: 1px solid #e5132c; + color: #e5142a; +} + +.bg_{ + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.1); + +} +.bg_ts{ + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.1); + +} +.bg_con{ + width: 90%; + /*height: 160px;*/ + background: white; + margin: 0 auto; + position: absolute; + left: 0; + right: 0; + top: 30%; + border-radius: 5px; +} +#querenshoukuan .con_1,#querentuikuan .con_1{ + /* margin-top: 20px; */ + padding: 20px; + display: flex; + justify-content: space-between; + align-items: center; +} +#querentuikuan { + text-align: center; + } +#querentuikuan textarea{ + width: 98%; + } +.bg_con p{ + border-bottom: 1px solid #efefef; + padding:10px 20px; + color: black; +} +.bg_con .info1{ + padding:10px 20px; + color: black; + border-bottom: none; +} +.en_true,.ts_true{ + background: #2AC845; + color: white; + /*position: absolute;*/ + margin-left: 30%; + border: none; + margin-bottom: 5%; +} +.en_false,.ts_false{ + background: #efefef; + color: #909090; + /*position: absolute;*/ + margin-right: 30%; + border: none; + float: right; +} +#content,#content_ts,#Tmoney{ + margin: 0 5% 5%; + width: 90%; +} +.refundInfo{ + float:left; +} +.refundTxt{ + display: block; + margin: 0 5% 5%; + width: 90% !important; +} +select{ + /*margin: 0;*/ +} +.row_block{ + background: #fbfbfb; +} +.row_block img{ + border-radius: 3px; + overflow: hidden; +} +.rcr { + background: #FBFBFB; +} + +/*20181018*/ +#select{ + margin: 5px 5%; + border: 1px solid rgba(0,0,0,.2)!important; + /*background: red;*/ + width: 90%; +} diff --git a/css/shopdecoration.css b/css/shopdecoration.css new file mode 100644 index 0000000..34eb68e --- /dev/null +++ b/css/shopdecoration.css @@ -0,0 +1,76 @@ +.shopdecoration-title { + height: 60px; + line-height: 60px; + width: 100%; + background: #000000; + text-align: center; + /* font-size: 18px; */ + display: flex; + justify-content: space-between; + align-items: center; +} + +.shopdecoration-title a { + display: inline-block; + width: 30px; + height: 30px; + background: #242424; + border-radius: 30px; + line-height: 30px; + color: #fff; + /* padding-top: 15px; */ + /* margin-top: 15px; */ +} + +.mui-action-back { + font-size: 26px; + height: 30px; + position: absolute; + /* top: 0px; */ + left: 15px; + z-index: 100; +} +.shopdecoration-title h3 { + display: inline-block; + width: 80%; + text-align: center; + font-size: 20px; + color: #fff; + height: 60px; + line-height: 60px; + /* margin-top: -3px; */ +} +.thumbnail-title{ + margin: 15px auto; +} +.thumbnail-img{ + width: 100px; + height: 100px; + text-align: center; + background: #fff; + margin: 0 auto; +} +.thumbnail-img .mui-icon{ + width: 70px; + height: 70px; + font-size: 40px; + padding-top: 20px; +} +.shopadds-title{ + margin: 15px auto; +} +.shopadds-img{ + width: 300px; + height: 200px; + overflow: hidden; + background: #fff; + margin: 0 auto; + margin-bottom: 10px; +} +.save{ + text-align: center; + margin: 10px auto; +} +.mui-btn{ + width: 50%; +} \ No newline at end of file diff --git a/css/shopgoodlist.css b/css/shopgoodlist.css new file mode 100644 index 0000000..d28a92b --- /dev/null +++ b/css/shopgoodlist.css @@ -0,0 +1,90 @@ +.con { + margin-bottom: 35px; +} + +.row { + display: flex; + justify-content: space-between; + /* align-items: center; */ + width: 98%; + height: 100px; + margin: 3px auto; + background: #0FD5F7; + padding: 8px; +} + +.row .left { + flex: 1; + margin-right: 10px; +} + +.row .left img { + width: 100%; + height: 100%; +} +.row .right { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: auto; + flex: 1; + +} + +.row .right .oper { + + display: flex; + justify-content: space-around; + align-items: center; +} + +.row .right span { + display: inline-block; + width: 30%; + height: 25px; + /* background: #0FD5F7; */ +} + +.row .right span img { + width: 100%; + height: 100%; +} + +.row .right p { + /* display: inline-block; */ + text-align: center; + background: #F0AD4E; + color: #fff; +} + +.row .center { + flex: 2; + color: #fff; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.add1 { + width: 96%; + margin: 10px auto; + height: 63px; + background: #C9C9C9; + border: 1px solid #C9C9C9; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + /* margin-top: 10px; */ +} + +.addimg { + width: 40px; + height: 40px; +} + +.add1 img { + /* position: absolute; */ + width: 100%; + height: 100%; +} diff --git a/css/shoppingcart.css b/css/shoppingcart.css new file mode 100644 index 0000000..1bcd633 --- /dev/null +++ b/css/shoppingcart.css @@ -0,0 +1,396 @@ +body:after { + content: ""; + position: fixed; + /*top: -10px;*/ + bottom: -10px; + left: 0; + width: 100%; + height: 10px; + box-shadow: 0 -0.5vw 2.3vw 3px rgba(25, 25, 25, 0.1); + /*-webkit-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -moz-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -o-box-shadow: 0 0.5vw 2.3vw 15px #ccc; + -ms-box-shadow: 0 0.5vw 2.3vw 15px #ccc;*/ + z-index: 100; +} + +.con {} + +.block { + padding: 0; + margin: 0; + background: white; + padding-bottom: 5px; + margin-bottom: 4px; +} + +.b_title { + width: 100%; + border-bottom: 1px solid #e6e6e6; +} + +.b_title .check1 { + padding: 9px 9px; + float: left; +} + +.check_0 { + width: 18px; + height: 18px; + background: url(http://img.juzi199.com/static/app2/img/no_checked.png) no-repeat top left; + background-size: 18px 18px; + border-radius: 50%; +} + +.check_1 { + width: 18px; + height: 18px; + background: url(http://img.juzi199.com/static/app2/img/checked.png) no-repeat top left; + background-size: 18px 18px; + border-radius: 50%; +} + +.b_title .b_link { + float: left; + text-indent: 17; + font-size: 13.2px; +} + +.b_title .b_link a { + color: black; + line-height: 40px; + height: 36px; + display: inline-block; +} + +.b_title img { + height: 12px; + margin: 12px 6px; + float: left; +} + +.b_con { + height: 105px; +} + +.btn_bj { + display: block; + float: right; + color: black; + line-height: 36px; + font-size: 12px; + padding: 0 12px; +} + +.b_con .check2 { + padding: 43.5px 9px; + float: left; +} + +.s_img { + width: 93px; + height: 93px; + margin: 6px 0; + float: left; +} + + +.b_con_r1 { + padding: 9px 12px; + float: left; + width: calc(100% - 129px); +} + +.p1 { + font-size: 12px; + margin: 0; + color: black; + max-height: 42px; + overflow: hidden; +} + +.p2 { + font-size: 10.8px; + margin: 0; + color: #909090; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.bz { + font-size: 10.8px; +} + +.cost { + color: #e94744; +} + +.oldcost { + color: #909090; +} + +.num { + float: right; + color: black; + padding-right: 5px; +} + +.b_con_r2 { + float: left; + height: 105px; + width: calc(100% - 129px); +} + +.b_con_r2_l { + float: left; + height: 105px; + /* 修改 */ + /* padding: 15px; */ + padding: 40px 30px; + /* width: calc(100% - 51px); */ + width: calc(100% - 56px); +} + +.b_con_r2_r { + height: 105px; + line-height: 105px; + float: right; + width: 51px; + padding: 34px 0px; + margin-right: 5px; +} + +.b_con_r2_del { + width: 51px; + + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ + color: white; + font-size: 12px; + text-align: center; + /* 修改 */ + /* height: 105px; */ + /* line-height: 105px; */ + /* float: right; */ + + line-height: 36px; + height: 36px; + /* padding-top: 30px; */ + +} + +.js { + border-top: 1px solid #e6e6e6; + width: 100%; + height: 51px; + position: fixed; + bottom: 0; + left: 0; + z-index: 10; + background: white; + line-height: 53px; +} + +.js .check { + padding: 16.5px 9px; + float: left; +} + +.qx { + font-size: 14.4px; + margin: 0; + padding: 0; +} + +.js_r { + float: right; + position: absolute; + right: 0; + top: 0; +} + +.js_r span { + font-size: 12px; +} + +.js_r span j { + color: #e94744; +} + +.js_r span o { + color: #909090; +} + +.btn_tj { + display: inline-block; + width: 102px; + height: 51px; + background: -moz-linear-gradient(left, #ff0423, #ff58a3); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff0423), to(#ff58a3)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff0423, #ff58a3); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff0423, #ff58a3); + /*Opera11*/ + text-align: center; + color: white; + font-size: 14.4px; +} + +.jian { + padding: 5px; + width: 22px; + height: 22px; + float: left; +} + +.changenum input { + float: left; + margin: 0; + padding: 0; + /* width: calc(100% - 84px); */ + width: calc(100% - 64px); + text-align: center; + height: 22px; + border: none; + /* margin: 0 20px; */ + + margin: 0 10px; +} + +.jia { + padding: 5px; + width: 22px; + height: 22px; + float: left; +} + +.changeclass { + margin-top: 18px; + font-size: 12px; + color: #909090; +} + +.changeclass img { + float: right; + height: 21px; + padding: 7.5px; + display: block; +} + +.cc1 { + width: 100%; + height: 27px; +} + +.cclass_con { + position: absolute; + bottom: 0; + left: 0; +} + +.cc2 { + width: 100%; + height: 81px; + background: white; + position: relative; + border-bottom: 1px solid #e3e6ea; +} + +.cc2 p { + font-size: 15.6px; + color: #e94744; + position: absolute; + left: 120px; + top: 24px; +} + +.cc2 span { + font-size: 12px; + position: absolute; + left: 120px; + top: 48px; +} + +.closecclass { + font-size: 15.6px; + color: #9b9b9b; + position: absolute; + padding: 9px 12px; + right: 0; + top: 0; +} + +.cclass_con .img { + background: white; + padding: 6px; + position: absolute; + border: 1px solid #f2f2f2; + border-radius: 6px; + width: 85.8px; + height: 85.8px; + top: 0; + left: 12px; + z-index: 60; +} + +.cclass_con .img img { + width: 100%; + height: 100%; + border-radius: 3px; +} + +.cclass1 { + padding: 18px 0 0 12px; + background: white; + border-bottom: 1px solid #e3e6ea; +} + +.cclass1 p { + color: #626262; + font-size: 13.2px; + padding-bottom: 18px; + margin: 0; +} + +.cclass1 .block { + padding: 3px 9px; + float: left; + border: 1px solid #9e9e9e; + margin: 0 18px 18px 0; + border-radius: 6px; + font-size: 14.4px; + color: #1d1d1d; +} + +.cclass1 .on { + border: 1px solid #e94947; +} + +.ensure { + width: 100%; + height: 48px; + background: -moz-linear-gradient(left, #f5364c, #e51329); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#f5364c), to(#e51329)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #f5364c, #e51329); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #f5364c, #e51329); + /*Opera11*/ + color: white; + font-size: 14.4px; + display: block; + line-height: 51px; + text-align: center; +} + +.con .recommend {} diff --git a/css/shopsList.css b/css/shopsList.css new file mode 100644 index 0000000..e69de29 diff --git a/css/shopsetting.css b/css/shopsetting.css new file mode 100644 index 0000000..05261c4 --- /dev/null +++ b/css/shopsetting.css @@ -0,0 +1,23 @@ +.row { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + position: relative; + padding: 0px 7px; + width: 98%; + margin: 0 auto; + flex: 1; +} +.row label { + flex: 1; + font-size: 13px; + color: #363636; +} +.sl-img{ + flex: 1; + text-align: right; +} + + \ No newline at end of file diff --git a/css/store_commodity.css b/css/store_commodity.css new file mode 100644 index 0000000..fbb3a6d --- /dev/null +++ b/css/store_commodity.css @@ -0,0 +1,29 @@ + +.commoditylistnav{ + width: 100%; + height: 45px; + background: white; +} +.nav_block{ + width: 25%; + float: left; + height: 45px; + line-height: 45px; + text-align: center; + color:#525252; + font-size: 12px; + +} +.commoditylistnav .on{ + color: #ff9300; +} +#cost_btn{ + position: relative; +} +#cost_btn img{ + position: absolute; + width: 8px; + height: 12px; + top: 15px; + +} diff --git a/css/store_home.css b/css/store_home.css new file mode 100644 index 0000000..59735f7 --- /dev/null +++ b/css/store_home.css @@ -0,0 +1,344 @@ +/* 6p */ + +@media all and (min-width: 376px) { + .mui-slider { + height: 210px; + } + .mui-slider-item { + height: 210px; + } + .mui-slider .mui-slider-item img { + height: 210px; + width: 100%; + } + .con { + + } + .cnxh_block img { + max-width: 188px; + max-height: 188px; + width: 95%; + } + .cnxh_block_info { + background: white; + max-width: 188px; + width: 95%; + margin: -5px auto 0; + } +} + + +/* 6 */ + +@media all and (min-width: 321px) and (max-width: 375px) { + .mui-slider { + height: 190px; + } + .mui-slider-item { + height: 190px; + } + .mui-slider .mui-slider-item img { + height: 190px; + width: 100%; + } + .cnxh_block img { + max-width: 168px; + max-height: 168px; + width: 95%; + } + .cnxh_block_info { + background: white; + max-width: 168px; + width: 95%; + margin: -5px auto 0; + } +} + + +/* 5 */ + +@media all and (max-width: 320px) { + .mui-slider { + height: 162.5; + } + .mui-slider-item { + height: 162.5; + } + .mui-slider .mui-slider-item img { + height: 162.5; + width: 100%; + } + .cnxh_block img { + max-width: 144px; + width: 95%; + max-height: 144px; + } + .cnxh_block_info { + background: white; + max-width: 144px; + width: 95%; + margin: -5px auto 0; + } +} + +.label { + padding: 6px 0; +} + +.l_block { + width: 25%; + border-right: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; + background: white; + text-align: center; + height: 36px; + line-height: 36px; + color: #525252; + font-size: 12px; + float: left; +} + +.lbrr { + border-right: none; +} +.cnxh_con{ + padding: 2%; +} +.cnxh_block { + width: 50%; + text-align: center; + float: left; + background: #EFEFEF; + border-bottom: 6px solid #efefef; +} + +.s_name { + font-size: 13.2px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + margin: 0; +} + +.s_name o { + font-size: 10.8px; + background: #f02e45; + color: white; + padding: 2px; + border-radius: 3px; + margin-left: 2px; +} + +.cnxh_block_info { + text-align: left; + padding: 2px; + height: 115px; +} + +.cost { + margin: 0; + margin-top: 5px; + font-size: 13.2px; + color: #f45549; +} + +.cost del { + color: #8d8d8d; + font-size: 10.8px; +} +.cost o{ + color: white; + font-size: 10.8px; + background: #E5132C; + border-radius: 3px; + line-height: 10.8px; + padding-top: 1px; +} +.cost_info{ + color: #E51329; + font-size: 9.6px; + background: #dfc4c4; + line-height: 10px; + padding: 4px 3px 1px; + display: inline-block; +} + +.recommend_title{ + padding: 0; + margin:4.8px; +} + +.time { + width: 100%; + margin-top: 3px; + background: white; + border-radius: 5px; + overflow: hidden; +} + +.t_title { + width: 100%; + height: 50px; + position: relative; +} + +.time_icon { + position: absolute; + width: 80.5px; + height: 32.5px; + top: 6px; + left: 1.5%; +} + +.timer { + border: 1px solid #f5394e; + border-radius: 3px; + width: 97.5px; + height: 15px; + line-height: 13px; + font-size: 12px; + text-align: center; + position: absolute; + left: 28%; + top: 18px; + font-family: "微软雅黑"; +} + +.timer_left { + float: left; + background: #f5394e; + color: white; + width: 45px; +} + +.timer_right { + float: left; + color: #f5394e; +} + +.timer_more { + position: absolute; + right: 0; + width: 50px; + height: 20px; + top: 15px; +} + +.timer_more span { + color: #f5364c; + font-size: 12px; + position: absolute; + line-height: 20px; + height: 20px; + left: 0; + right: 0; +} + +.timer_more img { + width: 15px; + height: 15px; + position: absolute; + right: 20%; + top: 2px; +} + +.t_con { + width: 100%; +} + +#top_banner .swiper-slide img { + width: 100%; + height: 100%; +} + +#top_banner .swiper-pagination-bullet-active { + background: white; +} + +#top_banner .swiper-pagination-bullet { + background: #eee; +} +#timer_swiper { + width: 100%; +} +#timer_swiper .swiper-wrapper .swiper-slide img{ + padding: 3px; + border-radius: 7px; +} +.t_con .swiper-container { + width: 800px; +} + +.t_con .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; + /* Center slide text vertically */ + 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; +} + +#timer_swiper .swiper-slide { + position: relative; +} + +#timer_swiper .swiper-slide img { + width: 100%; + display: block; +} + +#timer_swiper .swiper-slide p { + position: absolute; +} + +#timer_swiper .swiper-slide del { + text-align: center; + position: absolute; + bottom: 5px; + font-size: 12px; + color: #808080; + width: 100%; + height: 21px; +} + +.home_yhj{ + position: relative; +} + +.home_yhj p{ + color: #fff; +} + +.home_yhj .p1{ + position: absolute; + top: 30%; + left: 6%; + font-size: 12px; +} +.home_yhj .p2{ + position: absolute; + top: 58%; + left: 6%; + font-size: 12px; +} +.home_yhj .p3{ + position: absolute; + top: 38%; + right: 5%; + left: 45%; + text-align: center; + font-size: 50px; + letter-spacing:-4px; +} + diff --git a/css/store_info.css b/css/store_info.css new file mode 100644 index 0000000..d0294db --- /dev/null +++ b/css/store_info.css @@ -0,0 +1,16 @@ +.bg{ + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + background: transparent; +} +.con{ + width: 100%; + position: absolute; + left: 0; + right: 0; + bottom: 50px; + background: white; +} diff --git a/css/storeout.css b/css/storeout.css new file mode 100644 index 0000000..8759766 --- /dev/null +++ b/css/storeout.css @@ -0,0 +1,461 @@ +body .header { + /*background: url(../img/storetopbg.png) no-repeat center top; + background-size: 414px;*/ + background: none; +} +#store .scroll_out,#store1 .scroll_out_t{ + bottom: 50px; +} +.mui-scroll-wrapper .mui-scroll .con { + padding: 0px; +} + +/* .search{ + width: 100%; + height: 60px; + padding-top: 20px; + +} */ +/* .header_con{ + text-align: center; + background: rgba(0, 0,0, 0.8); + height: 66px; +} */ +/* .header_con h3{ + font-size: 18px; + font-weight: 300; + color: #fff; + padding-top: 25px; +} */ +/* body .header .title { + width: 100%; + text-align: center; + height: 30px; + line-height: 30px; + font-size: 16px; + position: relative; + position: absolute; + top: 5px; */ +/* } */ + +/* .mui-action-back{ + position: absolute;top:32px; + left:12px; + color: #fff; + width: 60px; + background: #777; +} */ +/* .mui-icon-email{ + width: 60px; + color: #fff; + background: #777; + +} */ +.con_ { + position: relative; + width: 100%; + /* height: 200px; */ +} + +.con_ .con_img { + width: 100%; + /* height: 200px; */ +} + + +.mui-slider .mui-slider-group .mui-slider-item a img { + width: 100%; + height: 100%; +} +.searchcon { + margin-top: 5px; + width: calc(100% - 84px); + height: 30px; + float: left; + background: #dedede; + position: relative; + border-radius: 13px; +} + +.classmenu { + width: 30px; + height: 30px; + float: left; + margin-top: 5px; + margin-left: 5px; +} + +.searchcon img { + width: 30px; + height: 30px; + padding: 7.5px; + float: left; +} + +.searchcon span { + color: #989898; + font-size: 13.2px; + line-height: 30px; +} + +.b_title { + width: 100%; + position: relative; + height: 60px; + /* top:10px; */ + display: flex; + justify-content: space-between; + align-items: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + background: rgba(256, 256, 256, 0.3); +} + +.b_title span { + display: inline-block; +} + +.b_title .b_img { + width: 60px; + height: 60px; + position: absolute; + bottom: 6px; + left: 15px; +} + +.b_title .storename { + /* position: absolute; */ + width: calc(100% - 160px); + margin: 0px auto; + color: #fff; + background: pink; + /* left: 79px; */ + /* top: 18px; */ + font-size: 19.2px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +#allmap { + /* margin-top: 15px; */ +} + +.gothere { + padding: 6px 8px; + height: 44px; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + background: #ccc; + font-size: 14px; +} + +.go, +.address { + display: flex; + justify-content: center; + align-items: center; +} +.gt_con span{ + font-size: 18px; + /* overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; */ + } + .gt_con .shopAddress{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 200px; + } +.goimg { + display: inline-block; + width: 20px; + height: 20px; +} +.sx { + margin-top: -50px; + height: 50px; + width: 100%; + text-align: center; + font-size: 12px; +} +.mui-scroll-wrapper, +.scroll_out { + /*position: relative;*/ + z-index: 10; +} +#pullrefresh .mui-scroll{ + position: relative; +} +#top_banner { + width: 100%; + height: 300px; + margin: 20px auto; + margin: 0; + position: relative; +} + +#top_banner .swiper-slide { + text-align: center; + font-size: 18px; + background: #fff; + /* Center slide text vertically */ + 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; +} + +#top_banner .swiper-slide img { + width: 100%; + height: 100%; +} + +#top_banner .swiper-pagination-bullet-active { + background: white; +} + +#top_banner .swiper-pagination-bullet { + background: #eee; +} + +.goimg img { + width: 100%; + height: 100%; +} + +.contactimg { + width: 30px; + height:30px; + /* background: #2B79C3; */ + /* border-radius: 30px; */ +} + +.contactimg img { + width: 100%; + height: 100%; +} +.gt_con_con{ + width: 100%; +} +.row{ + background: #fff; + /* padding: 10px; */ +} +.row .name{ + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px ; + width: 60%; +} +.row .name label{ + display: inline-block; + text-align: center; +} +.label-idx{ + flex: 1; +} +.label-val{ + flex: 2; +} +.time { + position: absolute; + padding: 0 2px; + /*width: calc(100% - 270px);*/ + left: 79px; + color: #fff; + font-size: 14.4px; + top: 42px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + background: -moz-linear-gradient(left, #ff6600, #ff9c00); + /*Mozilla*/ + background: -webkit-gradient(linear, 0 50%, 100% 50%, from(#ff6600), to(#ff9c00)); + /*Old gradient for webkit*/ + background: -webkit-linear-gradient(left, #ff6600, #ff9c00); + /*new gradient for Webkit*/ + background: -o-linear-gradient(left, #ff6600, #ff9c00); + /*Opera11*/ + border-radius: 5px; + text-align: center; +} + +.gz_btn { + width: 71.4px; + height: 21px; + border-radius: 15px; + color: white; + line-height: 21px; + position: absolute; + right: 12px; + font-size: 13.2px; + background: #ff0909; + /* bottom: 15px; */ + bottom: 10px; + text-align: center; +} + +.gz_btn1 { + width: 71.4px; + height: 21px; + border-radius: 15px; + color: #909090; + line-height: 21px; + position: absolute; + text-align: center; + right: 12px; + font-size: 13.2px; + /* bottom: 15px;*/ + bottom: 10px; + + background: #efefef; + /*border: 1px solid #909090;*/ +} + +.nav { + width: 100%; + background: white; + /*padding: 10px 0;*/ +} + +.nav_block { + float: left; + width: 40%; + text-align: center; + margin: 0 5%; + color: #414141; +} + +.nav span { + height: 42px; + line-height: 42px; + display: inline-block; +} + +.nav .on span { + /* color: #0F0F0F; */ + color: #E51329; + /* border-bottom: 2px solid #0f0f0f; */ + border-bottom: 2px solid #E51329; +} + +.footer { + width: 100%; + height: 50px; + border-top: 1px solid #e6e6e6; + position: fixed; + bottom: 0; + left: 0; + background: white; + padding: 12px 0; +} + +.footer div { + width: 50%; + height: 25px; + display: block; + float: left; + text-align: center; + color: #525252; + font-size: 15.6px; +} + +#rmfl { + border-right: 1px solid #e6e6e6; +} + +.rmfl { + width: 100%; + height: 100%; + position: fixed; + top: 0; + bottom: 0; + left: 0; + z-index: 101; +} + +.rmfl .con { + width: 96px; + border-radius: 6px; + overflow: hidden; + position: absolute; + bottom: 48px; + left: 20%; + box-shadow: 1px 1px 1px #eeeeee; + z-index: 110; +} + +.rmfl .con .row { + width: 100%; + height: 49px; + line-height: 48px; + border-top: 1px solid #e6e6e6; + background: white; + text-align: center; + color: #525252; + font-size: 14.4px; +} + +.rmfl .con .row:first-child { + border: none; +} + +.sanjiao { + z-index: 110; + width: 12px; + height: 12px; + position: absolute; + background: white; + border-right: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; + transform: rotate(45deg); + bottom: 41px; + left: 24%; +} + +.search button { + position: absolute; + right: 0; + top: 0; + border: none; + position: absolute; + width: 50px; + height: 30px; + border-radius: 0; + background: #007AFF; + color: white; +} + +#keyword { + background: transparent; + height: 30px; + margin: 0; +} + +.searchcon button { + position: absolute; + right: 0; + top: 0; + border: none; + position: absolute; + width: 50px; + height: 30px; + border-radius: 0; + background: #007AFF; + color: white; + border-radius: 50px; +} diff --git a/css/swiper.min.css b/css/swiper.min.css new file mode 100644 index 0000000..b222bea --- /dev/null +++ b/css/swiper.min.css @@ -0,0 +1,15 @@ +/** + * Swiper 3.4.2 + * Most modern mobile touch slider and framework with hardware accelerated transitions + * + * http://www.idangero.us/swiper/ + * + * Copyright 2017, Vladimir Kharlampidi + * The iDangero.us + * http://www.idangero.us/ + * + * Licensed under MIT + * + * Released on: March 10, 2017 + */ +.swiper-container{margin-left:auto;margin-right: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;-moz-box-orient:vertical;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-o-transform:translate(0,0);-ms-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;-moz-transition-timing-function:ease-out;-ms-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-slide{-webkit-flex-shrink:0;-ms-flex:0 0 auto;flex-shrink:0;width:100%;height:100%;position:relative}.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;-moz-transition-property:-moz-transform;-o-transition-property:-o-transform;-ms-transition-property:-ms-transform;transition-property:transform,height}.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;-moz-background-size:27px 44px;-webkit-background-size:27px 44px;background-size:27px 44px;background-position:center;background-repeat:no-repeat}.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;-moz-transition:.3s;-o-transition:.3s;transition:.3s;-webkit-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-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:#007aff}.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);-moz-transform:translate3d(0,-50%,0);-o-transform:translate(0,-50%);-ms-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);-ms-transform:scale(0);-o-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left top}.swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar{-webkit-transform-origin:right top;-moz-transform-origin:right top;-ms-transform-origin:right top;-o-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;-moz-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;-moz-transform-style:preserve-3d;-ms-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:-moz-linear-gradient(right,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-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:-moz-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-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:-moz-linear-gradient(bottom,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-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:-moz-linear-gradient(top,rgba(0,0,0,.5),rgba(0,0,0,0));background-image:-o-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;-moz-backface-visibility:hidden;-ms-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;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-slide{visibility:hidden;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-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;-moz-transform-origin:100% 0;-ms-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;-moz-transition-timing-function:ease-out;-ms-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;-moz-transition-property:opacity;-o-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-zoom-container{width:100%;height:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-moz-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-moz-box-align:center;-ms-flex-align:center;-webkit-align-items:center;align-items:center;text-align:center}.swiper-zoom-container>canvas,.swiper-zoom-container>img,.swiper-zoom-container>svg{max-width:100%;max-height:100%;object-fit:contain}.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%;-moz-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12,end) infinite;-moz-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%;-webkit-background-size:100%;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%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/css/upload.css b/css/upload.css new file mode 100644 index 0000000..86f70b0 --- /dev/null +++ b/css/upload.css @@ -0,0 +1,82 @@ +/* .ossfile{ + width: 80px; + height: 80px; + float: right; +} +.ossfile .files_out{ + width: 80px; + height: 80px; +} +.ossfile img{ + width: 100%; + height: 100%; +} */ +.btn { + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + text-decoration: none; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} + +a.btn:hover { + background-color: #3366b7; +} + +.progress { + margin-top: 2px; + width: 60px; + height: 10px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); +} + +.progress-bar { + background-color: rgb(92, 184, 92); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.14902) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.14902) 50%, rgba(255, 255, 255, 0.14902) 75%, transparent 75%, transparent); + background-size: 40px 40px; + box-shadow: rgba(0, 0, 0, 0.14902) 0px -1px 0px 0px inset; + box-sizing: border-box; + color: rgb(255, 255, 255); + display: block; + float: left; + font-size: 12px; + height: 20px; + line-height: 20px; + text-align: center; + transition-delay: 0s; + transition-duration: 0.6s; + transition-property: width; + transition-timing-function: ease; + width: 60px; +} + +.ossfile .files_out b img{ + width: 60px; + height: 60px; +} +.files_out{ + float: left; + padding: 5px; +} diff --git a/css/vouchers.css b/css/vouchers.css new file mode 100644 index 0000000..5589aef --- /dev/null +++ b/css/vouchers.css @@ -0,0 +1,44 @@ +.row{ + display: flex; + justify-content: space-between; + align-items: center; + width: 98%; + margin: 0 auto; + padding: 10px; + font-size: 12px; + color: #909090; + height: 100px; + background: pink; +} +.row .num{ + width: 100px; + text-align: center; + font-size: 22px; + color: #FA0306; + font-weight: 400; + /* height: 100px; */ +} +.row .info{ + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: space-between; + text-align: left; + flex: 2; + +} +.row .info .info_{ + font-size: 15px; + color: #525252; + +} +.row .info .time{ + font-size: 13px; + color: #666; + margin:10px 0px 20px; +} +.row .info .valid{ + font-size: 13px; + color: #666; + padding-left: 10px; +} \ No newline at end of file diff --git a/css/yhk.css b/css/yhk.css new file mode 100644 index 0000000..e69de29 diff --git a/css/zhuweiba.css b/css/zhuweiba.css new file mode 100644 index 0000000..0f5c147 --- /dev/null +++ b/css/zhuweiba.css @@ -0,0 +1,3 @@ +/* .mui-scroll-wrapper .con{ + margin-top: 40px; +} */ \ No newline at end of file diff --git a/fonts/mui-icons-extra.ttf b/fonts/mui-icons-extra.ttf new file mode 100644 index 0000000..8b5c92d Binary files /dev/null and b/fonts/mui-icons-extra.ttf differ diff --git a/fonts/mui.ttf b/fonts/mui.ttf new file mode 100644 index 0000000..45d3b04 Binary files /dev/null and b/fonts/mui.ttf differ diff --git a/getscript b/getscript new file mode 100644 index 0000000..50ac213 --- /dev/null +++ b/getscript @@ -0,0 +1 @@ +window.TILE_VERSION={"ditu":{"normal":{"version":"088","updateDate":"20190122"},"satellite":{"version":"009","updateDate":"20190122"},"normalTraffic":{"version":"081","updateDate":"20190122"},"satelliteTraffic":{"version":"083","updateDate":"20190122"},"mapJS":{"version":"104","updateDate":"20190122"},"satelliteStreet":{"version":"083","updateDate":"20190122"},"panoClick":{"version":"1033","updateDate":"20190102"},"panoUdt":{"version":"20190102","updateDate":"20190102"},"panoSwfAPI":{"version":"20150123","updateDate":"20150123"},"panoSwfPlace":{"version":"20141112","updateDate":"20141112"},"earthVector":{"version":"001","updateDate":"20190122"}},"webapp":{"high_normal":{"version":"001","updateDate":"20190122"},"lower_normal":{"version":"002","updateDate":"20190122"}},"api_for_mobile":{"vector":{"version":"002","updateDate":"20190122"},"vectorIcon":{"version":"002","updateDate":"20190122"}}};window.BMAP_AUTHENTIC_KEY="Zm7kae5pzZogp8a0uwIOlyyz";(function(){function ba(a){throw a;}var j=void 0,o=!0,p=null,q=!1;function s(){return function(){}}function ca(a){return function(b){this[a]=b}}function u(a){return function(){return this[a]}}function da(a){return function(){return a}}var ea,fa=[];function ga(a){return function(){return fa[a].apply(this,arguments)}}function ha(a,b){return fa[a]=b}var ia,x=ia=x||{version:"1.3.4"};x.ba="$BAIDU$";window[x.ba]=window[x.ba]||{};x.object=x.object||{}; x.extend=x.object.extend=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a};x.K=x.K||{};x.K.$=function(a){return"string"==typeof a||a instanceof String?document.getElementById(a):a&&a.nodeName&&(1==a.nodeType||9==a.nodeType)?a:p};x.$=x.Dc=x.K.$;x.K.U=function(a){a=x.K.$(a);if(a===p)return a;a.style.display="none";return a};x.U=x.K.U;x.lang=x.lang||{};x.lang.sg=function(a){return"[object String]"==Object.prototype.toString.call(a)};x.sg=x.lang.sg; x.K.Pj=function(a){return x.lang.sg(a)?document.getElementById(a):a};x.Pj=x.K.Pj;x.K.getElementsByClassName=function(a,b){var c;if(a.getElementsByClassName)c=a.getElementsByClassName(b);else{var d=a;d==p&&(d=document);c=[];var d=d.getElementsByTagName("*"),e=d.length,f=RegExp("(^|\\s)"+b+"(\\s|$)"),g,i;for(i=g=0;gx.da.la?(ja["for"]="htmlFor",ja["class"]="className"):(ja.htmlFor="for",ja.className="class");x.K.CG=ja; x.K.oF=function(a,b,c){a=x.K.$(a);if(a===p)return a;if("style"==b)a.style.cssText=c;else{b=x.K.CG[b]||b;a.setAttribute(b,c)}return a};x.oF=x.K.oF;x.K.pF=function(a,b){a=x.K.$(a);if(a===p)return a;for(var c in b)x.K.oF(a,c,b[c]);return a};x.pF=x.K.pF;x.Tk=x.Tk||{};(function(){var a=RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g");x.Tk.trim=function(b){return(""+b).replace(a,"")}})();x.trim=x.Tk.trim; x.Tk.To=function(a,b){var a=""+a,c=Array.prototype.slice.call(arguments,1),d=Object.prototype.toString;if(c.length){c=c.length==1?b!==p&&/\[object Array\]|\[object Object\]/.test(d.call(b))?b:c:c;return a.replace(/#\{(.+?)\}/g,function(a,b){var g=c[b];"[object Function]"==d.call(g)&&(g=g(b));return"undefined"==typeof g?"":g})}return a};x.To=x.Tk.To; x.K.Tb=function(a,b){a=x.K.$(a);if(a===p)return a;for(var c=a.className.split(/\s+/),d=b.split(/\s+/),e,f=d.length,g,i=0;i0&&b.getBoxObjectFor&&d(a,"position");var e={left:0,top:0},f;if(a==(c.la&&!c.sE?b.body:b.documentElement))return e;if(a.getBoundingClientRect){a=a.getBoundingClientRect();e.left=Math.floor(a.left)+Math.max(b.documentElement.scrollLeft,b.body.scrollLeft);e.top=Math.floor(a.top)+Math.max(b.documentElement.scrollTop,b.body.scrollTop);e.left=e.left-b.documentElement.clientLeft;e.top=e.top-b.documentElement.clientTop; a=b.body;b=parseInt(d(a,"borderLeftWidth"));d=parseInt(d(a,"borderTopWidth"));if(c.la&&!c.sE){e.left=e.left-(isNaN(b)?2:b);e.top=e.top-(isNaN(d)?2:d)}}else{f=a;do{e.left=e.left+f.offsetLeft;e.top=e.top+f.offsetTop;if(c.nM>0&&d(f,"position")=="fixed"){e.left=e.left+b.body.scrollLeft;e.top=e.top+b.body.scrollTop;break}f=f.offsetParent}while(f&&f!=a);if(c.opera>0||c.nM>0&&d(a,"position")=="absolute")e.top=e.top-b.body.offsetTop;for(f=a.offsetParent;f&&f!=b.body;){e.left=e.left-f.scrollLeft;if(!c.opera|| f.tagName!="TR")e.top=e.top-f.scrollTop;f=f.offsetParent}}return e};/firefox\/(\d+\.\d)/i.test(navigator.userAgent)&&(x.da.Se=+RegExp.$1);/BIDUBrowser/i.test(navigator.userAgent)&&(x.da.y1=o);var ka=navigator.userAgent;/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(ka)&&!/chrome/i.test(ka)&&(x.da.iF=+(RegExp.$1||RegExp.$2));/chrome\/(\d+\.\d)/i.test(navigator.userAgent)&&(x.da.Gw=+RegExp.$1);x.kc=x.kc||{}; x.kc.Gb=function(a,b){var c,d,e=a.length;if("function"==typeof b)for(d=0;d-1};x.VK=function(){function a(a){document.addEventListener&&(this.element=a,this.YK=this.zk?"touchstart":"mousedown",this.oD=this.zk?"touchmove":"mousemove",this.nD=this.zk?"touchend":"mouseup",this.oh=q,this.hu=this.gu=0,this.element.addEventListener(this.YK,this,q),ia.M(this.element,"mousedown",s()),this.handleEvent(p))}a.prototype={zk:"ontouchstart"in window||"createTouch"in document,start:function(a){ma(a);this.oh=q;this.gu=this.zk?a.touches[0].clientX:a.clientX;this.hu=this.zk?a.touches[0].clientY: a.clientY;this.element.addEventListener(this.oD,this,q);this.element.addEventListener(this.nD,this,q)},move:function(a){na(a);var c=this.zk?a.touches[0].clientY:a.clientY;if(10Math.random();0<=z.version.indexOf("#")&&(z.version="2.0");z.Fr=[];z.We=function(a){this.Fr.push(a)};z.vr=[];z.Um=function(a){this.vr.push(a)}; z.XU=z.apiLoad||function(){z.version&&z.version>=1.5&&oa(z.wc+"?qt=verify&ak="+pa,function(a){if(a&&a.error!==0){if(typeof map!=="undefined"){map.La().innerHTML="";map.Gi={}}z=p;var b="\u767e\u5ea6\u672a\u6388\u6743\u4f7f\u7528\u5730\u56feAPI\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u60a8\u63d0\u4f9b\u7684\u5bc6\u94a5\u4e0d\u662f\u6709\u6548\u7684\u767e\u5ea6LBS\u5f00\u653e\u5e73\u53f0\u5bc6\u94a5\uff0c\u6216\u6b64\u5bc6\u94a5\u672a\u5bf9\u672c\u5e94\u7528\u7684\u767e\u5ea6\u5730\u56feJavaScriptAPI\u6388\u6743\u3002\u60a8\u53ef\u4ee5\u8bbf\u95ee\u5982\u4e0b\u7f51\u5740\u4e86\u89e3\u5982\u4f55\u83b7\u53d6\u6709\u6548\u7684\u5bc6\u94a5\uff1ahttp://lbsyun.baidu.com/apiconsole/key#\u3002";switch(a.error){case 101:b= "\u5f00\u53d1\u8005\u7981\u7528\u4e86\u8be5ak\u7684jsapi\u670d\u52a1\u6743\u9650\u3002\u60a8\u53ef\u4ee5\u8bbf\u95ee\u5982\u4e0b\u7f51\u5740\u4e86\u89e3\u5982\u4f55\u83b7\u53d6\u6709\u6548\u7684\u5bc6\u94a5\uff1ahttp://lbsyun.baidu.com/apiconsole/key#\u3002";break;case 102:b="\u5f00\u53d1\u8005Referer\u4e0d\u6b63\u786e\u3002\u60a8\u53ef\u4ee5\u8bbf\u95ee\u5982\u4e0b\u7f51\u5740\u4e86\u89e3\u5982\u4f55\u83b7\u53d6\u6709\u6548\u7684\u5bc6\u94a5\uff1ahttp://lbsyun.baidu.com/apiconsole/key#\u3002"}alert(b)}})}; var pa=window.BMAP_AUTHENTIC_KEY;window.BMAP_AUTHENTIC_KEY=p;var qa=window.BMap_loadScriptTime,ra=(new Date).getTime(),sa=p,ta=o,ua=5042,va=5002,wa=5003,xa="load_mapclick",ya=5038,za=5041,Ba=5047,Ca=5036,Da=5039,Ea=5037,Fa=5040,Ga=5011,Ha=7E3;var Ia=0; function Ka(a,b){if(a=x.$(a)){var c=this;x.lang.Ca.call(c);b=b||{};c.D={rk:b.fixedZoomCenter||q,kC:200,Hb:o,bx:q,gD:o,Qo:o,Ro:b.enableWheelZoom||q,TK:o,iD:o,om:o,Is:o,pm:o,Oo:b.enable3DBuilding||q,Gc:25,q0:240,LU:450,Yb:F.Yb,Fd:F.Fd,Ox:!!b.Ox,gc:Math.round(b.minZoom)||1,$b:Math.round(b.maxZoom)||19,Jb:b.mapType||La,c4:q,OK:b.drawer||Ia,ax:o,Zw:500,xW:b.enableHighResolution!==q,lj:b.enableMapClick!==q,devicePixelRatio:b.devicePixelRatio||window.devicePixelRatio||1,TF:99,xe:b.mapStyle||p,EY:b.logoControl===q? q:o,dV:[],Aw:b.beforeClickIcon||p};c.D.xe&&(this.fY(c.D.xe.controls),this.aM(c.D.xe.geotableId));c.D.xe&&c.D.xe.styleId&&c.V2(c.D.xe.styleId);c.D.gm={dark:{backColor:"#2D2D2D",textColor:"#bfbfbf",iconUrl:"dicons"},normal:{backColor:"#F3F1EC",textColor:"#c61b1b",iconUrl:"icons"},light:{backColor:"#EBF8FC",textColor:"#017fb4",iconUrl:"licons"}};b.enableAutoResize&&(c.D.Is=b.enableAutoResize);b.enableStreetEntrance===q&&(c.D.pm=b.enableStreetEntrance);b.enableDeepZoom===q&&(c.D.TK=b.enableDeepZoom); var d=c.D.dV;if(G())for(var e=0,f=d.length;ec&&(d=o,a=c);return{zoom:a,pD:d}},La:u("Va"),bc:function(a,b){b=b||this.fa();return this.ie.bc(a,b,this.mc,this.Bb(),this.Xb)},wb:function(a,b){b= b||this.fa();return this.ie.wb(a,b,this.mc,this.Bb(),this.Xb)},Ve:function(a,b){if(a){var c=this.bc(new H(a.lng,a.lat),b);c.x-=this.offsetX;c.y-=this.offsetY;return c}},qN:function(a,b){if(a){var c=new R(a.x,a.y);c.x+=this.offsetX;c.y+=this.offsetY;return this.wb(c,b)}},pointToPixelFor3D:function(a,b){var c=map.Xb;this.Jb===Pa&&c&&cb.pK(a,this,b)},N3:function(a,b){var c=map.Xb;this.Jb===Pa&&c&&cb.oK(a,this,b)},O3:function(a,b){var c=this,d=map.Xb;c.Jb===Pa&&d&&cb.pK(a,c,function(a){a.x-=c.offsetX; a.y-=c.offsetY;b&&b(a)})},L3:function(a,b){var c=map.Xb;this.Jb===Pa&&c&&(a.x+=this.offsetX,a.y+=this.offsetY,cb.oK(a,this,b))},Hd:function(a){if(!this.Nx())return new db;var b=a||{},a=b.margins||[0,0,0,0],c=b.zoom||p,b=this.wb({x:a[3],y:this.height-a[2]},c),a=this.wb({x:this.width-a[1],y:a[0]},c);return new db(b,a)},Nx:function(){return!!this.loaded},RR:function(a,b){for(var c=this.oa(),d=b.margins||[10,10,10,10],e=b.zoomFactor||0,f=d[1]+d[3],d=d[0]+d[2],g=c.Zo(),i=c=c.vm();i>=g;i--){var k=this.oa().yc(i); if(a.LF().lng/kc&&(i=c);return i},bt:function(a,b){var c={center:this.Ha(),zoom:this.fa()};if(!a||!a instanceof db&&0===a.length||a instanceof db&&a.xj())return c;var d=[];a instanceof db?(d.push(a.nf()),d.push(a.ve())):d=a.slice(0);for(var b=b||{},e=[],f=0,g=d.length;fb&&(c.$b=b)},setMinZoom:function(a){a=Math.round(a);a>this.D.$b&&(a=this.D.$b);this.D.MO=a;this.sJ()},setMaxZoom:function(a){a=Math.round(a);aa.$b&&this.Nc(a.$b);var b=new M("onzoomspanchange");b.gc=a.gc;b.$b=a.$b;this.dispatchEvent(b)},X2:u("MB"),getKey:function(){return pa},Tt:function(a){var b= this;window.MPC_Mgr&&window.MPC_Mgr[b.ba]&&window.MPC_Mgr[b.ba].close();b.D.lj=q;z.Dn("cus.fire","count","z_setmapstylecount");if(a){b=this;a.styleJson&&(a.styleStr=b.v_(a.styleJson));G()&&x.da.iF?setTimeout(function(){b.D.xe=a;b.dispatchEvent(new M("onsetcustomstyles",a))},50):(this.D.xe=a,this.dispatchEvent(new M("onsetcustomstyles",a)),this.aM(b.D.xe.geotableId));var c={style:a.style};a.features&&0=this.D.TF&&this.oa()===La&&18>=this.fa(),b=q;try{document.createElement("canvas").getContext("2d"),b=o}catch(c){b=q}return a&&b},getCurrentCity:function(){return{name:this.Xg,code:this.bs}},wm:function(){this.P.ao();return this.P},setPanorama:function(a){this.P=a;this.P.tF(this)},v_:function(a){for(var b={featureType:"t",elementType:"e",visibility:"v",color:"c",lightness:"l",saturation:"s",weight:"w",zoom:"z",hue:"h"},c={all:"all",geometry:"g","geometry.fill":"g.f","geometry.stroke":"g.s", labels:"l","labels.text.fill":"l.t.f","labels.text.stroke":"l.t.s","lables.text":"l.t","labels.icon":"l.i"},d=[],e=0,f;f=a[e];e++){var g=f.stylers;delete f.stylers;x.extend(f,g);var g=[],i;for(i in b)if(f[i])if("elementType"===i)g.push(b[i]+":"+c[f[i]]);else{switch(f[i]){case "poilabel":f[i]="poi";break;case "districtlabel":f[i]="label"}g.push(b[i]+":"+f[i])}2=a.Yz?(Xa(a.k.va)&&a.k.va(a.k.jc(1)),Xa(a.k.finish)&&a.k.finish(),0a?2*a*a:-2*(a-2)*a-1},Z1:function(a){return 0.5>a?4*Math.pow(a,3):4*Math.pow(a-1,3)+1},a2:function(a){return(1-Math.cos(Math.PI*a))/2}};rb["ease-in"]=rb.bD;rb["ease-out"]=rb.Gs;var F={aG:34,bG:21,cG:new L(21,32),cP:new L(10,32),bP:new L(24,36),aP:new L(12,36),ZF:new L(13,1),qa:z.ma+"images/",g3:"http://api0.map.bdimg.com/images/",$F:z.ma+"images/markers_new.png",ZO:24,$O:73,gC:{"\u5317\u4eac":{my:"bj",m:new H(116.403874,39.914889)},"\u4e0a\u6d77":{my:"sh",m:new H(121.487899,31.249162)},"\u6df1\u5733":{my:"sz",m:new H(114.025974,22.546054)},"\u5e7f\u5dde":{my:"gz",m:new H(113.30765,23.120049)}},fontFamily:"arial,sans-serif"}; x.da.Se?(x.extend(F,{EK:"url("+F.qa+"ruler.cur),crosshair",Yb:"-moz-grab",Fd:"-moz-grabbing"}),x.platform.oM&&(F.fontFamily="arial,simsun,sans-serif")):x.da.Gw||x.da.iF?x.extend(F,{EK:"url("+F.qa+"ruler.cur) 2 6,crosshair",Yb:"url("+F.qa+"openhand.cur) 8 8,default",Fd:"url("+F.qa+"closedhand.cur) 8 8,move"}):x.extend(F,{EK:"url("+F.qa+"ruler.cur),crosshair",Yb:"url("+F.qa+"openhand.cur),default",Fd:"url("+F.qa+"closedhand.cur),move"});function ub(a,b){var c=a.style;c.left=b[0]+"px";c.top=b[1]+"px"}function vb(a){0>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!=f&&(b+=String.fromCharCode(d)),64!=g&&(b+=String.fromCharCode(e));while(i';var b=a.firstChild;if(!b.style)return q;b.style.behavior="url(#default#VML)";b=b?"object"===typeof b.adj:o;a.parentNode.removeChild(a);return b}function Jb(){return!!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape","1.1")} function Kb(){return!!K("canvas").getContext}function Nb(a){return a*Math.PI/180}z.DY=function(){var a=o,b=o,c=o,d=o,e=0,f=0,g=0,i=0;return{KQ:function(){e+=1;a&&(a=q,setTimeout(function(){Qa(5054,{pic:e});a=o;e=0},1E4))},K0:function(){f+=1;b&&(b=q,setTimeout(function(){Qa(5055,{move:f});b=o;f=0},1E4))},M0:function(){g+=1;c&&(c=q,setTimeout(function(){Qa(5056,{zoom:g});c=o;g=0},1E4))},L0:function(a){i+=a;d&&(d=q,setTimeout(function(){Qa(5057,{tile:i});d=o;i=0},5E3))}}}();z.iq={oG:"#83a1ff",kq:"#808080"}; function Ob(a,b,c){b.Om||(b.Om=[],b.handle={});b.Om.push({filter:c,qm:a});b.addEventListener||(b.addEventListener=function(a,c){b.attachEvent("on"+a,c)});b.handle.click||(b.addEventListener("click",function(a){for(var c=a.target||a.srcElement;c!=b;){Pb(b.Om,function(b,g){RegExp(g.filter).test(c.getAttribute("filter"))&&g.qm.call(c,a,c.getAttribute("filter"))});c=c.parentNode}},q),b.handle.click=o)}function Pb(a,b){for(var c=0,d=a.length;c0&&c.height>0)};c.onerror=function(){b(a,q)};c.src="data:image/webp;base64,"+{v3:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",u3:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==", alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",jk:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"}[a]},nc=function(a,b){return Mb.ii["WebP-"+a]=b},re=function(){return"openDatabase"in a},se=function(){return"performance"in a&&"timing"in a.performance},Nc=function(){return"performance"in a&&"mark"in a.performance},gd=function(){return!(!Array.prototype|| !Array.prototype.every||!Array.prototype.filter||!Array.prototype.forEach||!Array.prototype.indexOf||!Array.prototype.lastIndexOf||!Array.prototype.map||!Array.prototype.some||!Array.prototype.reduce||!Array.prototype.reduceRight||!Array.isArray)},te=function(){return"Promise"in a&&"cast"in a.lq&&"resolve"in a.lq&&"reject"in a.lq&&"all"in a.lq&&"race"in a.lq&&function(){var b;new a.lq(function(a){b=a});return typeof b==="function"}()},hd=function(){var b=!!a.x0,c=a.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return!!a.A0&&b&&c},nf=function(){return"geolocation"in navigator},ue=function(){var b=C("canvas"),c="probablySupportsContext"in b?"probablySupportsContext":"supportsContext";return c in b?b[c]("webgl")||b[c]("experimental-webgl"):"WebGLRenderingContext"in a},gi=function(){return!!b.createElementNS&&!!b.createElementNS("http://www.w3.org/2000/svg","svg").L1},hi=function(){return!!a.H0},ii=function(){return"WebSocket"in a&&a.E0.u0===2},ji=function(){return!!b.createElement("video").canPlayType}, ki=function(){return!!b.createElement("audio").canPlayType},li=function(){return!!(a.history&&"pushState"in a.history)},mi=function(){return!(!a.v0||!a.w0)},ni=function(){return"postMessage"in window},oi=function(){return!!a.webkitNotifications||"Notification"in a&&"permission"in a.vP&&"requestPermission"in a.vP},pi=function(){for(var b=["webkit","moz","o","ms"],c=a.requestAnimationFrame,e=0;e9)},xi=function(){return"XMLHttpRequest"in a&&"withCredentials"in new XMLHttpRequest},yi=function(){return C("progress").max!== j},zi=function(){return C("meter").max!==j},Ai=function(){return"sendBeacon"in navigator},Bi=function(){return J("borderRadius")},Ci=function(){return J("boxShadow")},Di=function(){var a=C("div").style;a.cssText=E.join("opacity:.55;");return/^0.55$/.test(a.opacity)},Ei=function(){return N(["textShadow"],j)},Fi=function(){return J("animationName")},Gi=function(){return J("transition")},Hi=function(){return navigator.userAgent.indexOf("Android 2.")===-1&&J("transform")},Mb={ii:{},pa:function(a,b,c){this.ii[a]= b.apply(this,[].slice.call(arguments,2))},Cd:function(a,b){a.apply(this,[].slice.call(arguments,1))},BZ:function(){this.pa("bdrs",Bi);this.pa("bxsd",Ci);this.pa("opat",Di);this.pa("txsd",Ei);this.pa("anim",Fi);this.pa("trsi",Gi);this.pa("trfm",Hi);this.pa("flex",ti);this.pa("3dtr",ui);this.pa("shpe",vi);this.pa("fltr",wi);this.pa("cavs",aa);this.pa("dgdp",Ja);this.pa("locs",Oa);this.pa("wctem",Ra);this.pa("wcsdd",Aa);this.pa("wccse",mc);this.pa("wchti",qe);this.Cd(Lb,"lossy",nc);this.Cd(Lb,"lossless", nc);this.Cd(Lb,"alpha",nc);this.Cd(Lb,"animation",nc);this.pa("wsql",re);this.pa("natm",se);this.pa("ustm",Nc);this.pa("arra",gd);this.pa("prms",te);this.pa("xhr2",hd);this.pa("wbgl",ue);this.pa("geol",nf);this.pa("svg",gi);this.pa("work",hi);this.pa("wbsk",ii);this.pa("vido",ji);this.pa("audo",ki);this.pa("hsty",li);this.pa("file",mi);this.pa("psmg",ni);this.pa("wknf",oi);this.pa("rqaf",pi);this.pa("json",qi);this.pa("flsc",ri);this.pa("i18n",si);this.pa("cors",xi);this.pa("prog",yi);this.pa("metr", zi);this.pa("becn",Ai);this.pa("mcrd",mf);this.pa("esrc",fd)}},v=c.alog.OF("feature");v.M("commit",function(){Mb.BZ();var a=setInterval(function(){if("WebP-lossy"in Mb.ii&&"WebP-lossless"in Mb.ii&&"WebP-alpha"in Mb.ii&&"WebP-animation"in Mb.ii){for(var b in Mb.ii)Mb.ii[b]=Mb.ii[b]?"y":"n";v.send("feature",Mb.ii);clearInterval(a)}},500)});c.alog("feature.create",{W1:4,P3:i,page:g,ub:"18"});c.alog("feature.fire","commit")}}(a,b,c)}(window,document,z);z.Dn=z.alog||s();z.alog("cus.fire","count","z_loadscriptcount"); "https:"===location.protocol&&z.alog("cus.fire","count","z_httpscount");function Qb(a){var b=window.TILE_VERSION,c="20170927";b&&b.ditu&&(b=b.ditu,b[a]&&b[a].updateDate&&(c=b[a].updateDate));return c};function oa(a,b){if(b){var c=(1E5*Math.random()).toFixed(0);z._rd["_cbk"+c]=function(a){b&&b(a);delete z._rd["_cbk"+c]};a+="&callback=BMap._rd._cbk"+c}var d=K("script",{type:"text/javascript"});d.charset="utf-8";d.src=a;d.addEventListener?d.addEventListener("load",function(a){a=a.target;a.parentNode.removeChild(a)},q):d.attachEvent&&d.attachEvent("onreadystatechange",function(){var a=window.event.srcElement;a&&("loaded"==a.readyState||"complete"==a.readyState)&&a.parentNode.removeChild(a)});setTimeout(function(){document.getElementsByTagName("head")[0].appendChild(d); d=p},1)};var Rb={map:"edvfqx",common:"vndjet",style:"hfbhis",tile:"pp5s2s",vectordrawlib:"0nwze3",newvectordrawlib:"0dw0aq",groundoverlay:"4tamms",pointcollection:"ktensf",marker:"jkmdsc",symbol:"kpbhgq",canvablepath:"leoodz",vmlcontext:"vsxc11",markeranimation:"lwkx4d",poly:"ukhgc4",draw:"ggks5n",drawbysvg:"vfyzwa", drawbyvml:"cihabl",drawbycanvas:"x0opfd",infowindow:"omcokh",oppc:"ohjjl3",opmb:"zak4zl",menu:"z5gzeq",control:"ff1mc0",navictrl:"wxtn3y",geoctrl:"ueq5fn",copyrightctrl:"diosm4",citylistcontrol:"gxia13",scommon:"ygyjhk",local:"orgsua",route:"sxpebr",othersearch:"xfqiat",mapclick:"xvhozk",buslinesearch:"wltsgk", hotspot:"43haqa",autocomplete:"hsr30d",coordtrans:"b1gup0",coordtransutils:"ybedzx",convertor:"xcp5se",clayer:"zd5r3a",pservice:"tcjn0r",pcommon:"pkqaj4",panorama:"jisiff",panoramaflash:"5rreij",vector:"1pngh3"}; x.Ly=function(){function a(a){return d&&!!c[b+a+"_"+Rb[a]]}var b="BMap_",c=window.localStorage,d="localStorage"in window&&c!==p&&c!==j;return{sY:d,set:function(a,f){if(d){for(var g=b+a+"_",i=c.length,k;i--;)k=c.key(i),-1");this.Qa==q&&x.K.U(this.B);return this.B},Nr:function(){this.qc(this.k.anchor)},qc:function(a){if(this.u1||!Wa(a)||isNaN(a)||a=a?a:0},hp:function(){return this.k.type},Ce:function(){var a=this;I.load("navictrl",function(){a.wf()})}});function Wb(a){Sb.call(this);a=a||{};this.k={anchor:a.anchor||Vb,za:a.offset||new L(10,30),l_:a.showAddressBar!==q,c2:a.enableAutoLocation||q,HM:a.locationIcon||p};var b=this;this.xz=1200;b.$_=[];this.oe=[];I.load("geoctrl",function(){(function d(){if(0!==b.oe.length){var a=b.oe.shift();b[a.method].apply(b,a.arguments);d()}})();b.ZP()});Qa(Ha)}x.lang.ua(Wb,Sb,"GeolocationControl");x.extend(Wb.prototype,{location:function(){this.oe.push({method:"location",arguments:arguments})},getAddressComponent:da(p)});function Xb(a){Sb.call(this);a=a||{};this.k={yg:q,anchor:a.anchor,za:a.offset};this.dc=[];this.defaultAnchor=Vb;this.defaultOffset=new L(5,2);this.qc(a.anchor);this.ZJ=q;this.Ce()}x.lang.ua(Xb,Sb,"CopyrightControl"); x.object.extend(Xb.prototype,{initialize:function(a){this.C=a;return this.B},rw:function(a){if(a&&Wa(a.id)&&!isNaN(a.id)){var b={bounds:p,content:""},c;for(c in a)b[c]=a[c];if(a=this.sm(a.id))for(var d in b)a[d]=b[d];else this.dc.push(b)}},sm:function(a){for(var b=0,c=this.dc.length;b=a.Zi)){for(var b=0,c=this.ya.length;ba)&&this.ya[b].Nj--;this.Ee.splice(a,1)}},Id:u("B"),show:function(){this.Ph!=o&&(this.Ph=o)},U:function(){this.Ph!=q&&(this.Ph=q)},RZ:function(a){a&&(this.k.cursor=a)},getItem:function(a){return this.Hf[a]}});var dc=F.qa+"menu_zoom_in.png",ec=F.qa+"menu_zoom_out.png";function fc(a,b,c){if(a&&Xa(b)){x.lang.Ca.call(this);this.k={width:100,id:"",Gm:""};c=c||{};this.k.width=1*c.width?c.width:100;this.k.id=c.id?c.id:"";this.k.Gm=c.iconUrl?c.iconUrl:"";this.Sg=a+"";this.Az=b;this.C=p;this.Nb="menuitem";this.Ur=this.ov=this.B=this.Hh=p;this.Lh=o;var d=this;I.load("menu",function(){d.yb()})}}x.lang.ua(fc,x.lang.Ca,"MenuItem"); x.object.extend(fc.prototype,{ra:function(a,b){this.C=a;this.Hh=b},remove:function(){this.C=this.Hh=p},Xt:function(a){a&&(this.Sg=a+"")},Vb:function(a){a&&(this.k.Gm=a)},Id:u("B"),enable:function(){this.Lh=o},disable:function(){this.Lh=q}});function db(a,b){a&&!b&&(b=a);this.He=this.Vd=this.Le=this.Xd=this.Ol=this.xl=p;a&&(this.Ol=new H(a.lng,a.lat),this.xl=new H(b.lng,b.lat),this.Le=a.lng,this.Xd=a.lat,this.He=b.lng,this.Vd=b.lat)} x.object.extend(db.prototype,{xj:function(){return!this.Ol||!this.xl},nb:function(a){return!(a instanceof db)||this.xj()?q:this.ve().nb(a.ve())&&this.nf().nb(a.nf())},ve:u("Ol"),nf:u("xl"),JV:function(a){return!(a instanceof db)||this.xj()||a.xj()?q:a.Le>this.Le&&a.Hethis.Xd&&a.VdMath.max(this.Le, this.He)||Math.max(a.Xd,a.Vd)Math.max(this.Xd,this.Vd))return p;var b=Math.max(this.Le,a.Le),c=Math.min(this.He,a.He),d=Math.max(this.Xd,a.Xd),a=Math.min(this.Vd,a.Vd);return new db(new H(b,d),new H(c,a))},fs:function(a){return!(a instanceof H)||this.xj()?q:a.lng>=this.Le&&a.lng<=this.He&&a.lat>=this.Xd&&a.lat<=this.Vd},extend:function(a){if(a instanceof H){var b=a.lng,a=a.lat;this.Ol||(this.Ol=new H(0,0));this.xl||(this.xl=new H(0,0));if(!this.Le|| this.Le>b)this.Ol.lng=this.Le=b;if(!this.He||this.Hea)this.Ol.lat=this.Xd=a;if(!this.Vd||this.Vd=a.lng&&-180<=a.lng&&74>=a.lat&&-74<=a.lat};H.prototype.nb=function(a){return a&&this.lat==a.lat&&this.lng==a.lng};function gc(){}gc.prototype.kh=function(){ba("lngLatToPoint\u65b9\u6cd5\u672a\u5b9e\u73b0")};gc.prototype.zj=function(){ba("pointToLngLat\u65b9\u6cd5\u672a\u5b9e\u73b0")};function hc(){};var cb={pK:function(a,b,c){I.load("coordtransutils",function(){cb.bV(a,b,c)},o)},oK:function(a,b,c){I.load("coordtransutils",function(){cb.aV(a,b,c)},o)}};function ic(){this.Pa=[];var a=this;I.load("convertor",function(){a.XP()})}x.ua(ic,x.lang.Ca,"Convertor");x.extend(ic.prototype,{translate:function(a,b,c,d){this.Pa.push({method:"translate",arguments:[a,b,c,d]})}});T(ic.prototype,{translate:ic.prototype.translate});function S(){}S.prototype=new gc; x.extend(S,{mP:6370996.81,tG:[1.289059486E7,8362377.87,5591021,3481989.83,1678043.12,0],Eu:[75,60,45,30,15,0],sP:[[1.410526172116255E-8,8.98305509648872E-6,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-0.03801003308653,1.73379812E7],[-7.435856389565537E-9,8.983055097726239E-6,-0.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1.026014486E7],[-3.030883460898826E-8, 8.98305509983578E-6,0.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,0.32710905363475,6856817.37],[-1.981981304930552E-8,8.983055099779535E-6,0.03278182852591,40.31678527705744,0.65659298677277,-4.44255534477492,0.85341911805263,0.12923347998204,-0.04625736007561,4482777.06],[3.09191371068437E-9,8.983055096812155E-6,6.995724062E-5,23.10934304144901,-2.3663490511E-4,-0.6321817810242,-0.00663494467273,0.03430082397953,-0.00466043876332,2555164.4], [2.890871144776878E-9,8.983055095805407E-6,-3.068298E-8,7.47137025468032,-3.53937994E-6,-0.02145144861037,-1.234426596E-5,1.0322952773E-4,-3.23890364E-6,826088.5]],qG:[[-0.0015702102444,111320.7020616939,1704480524535203,-10338987376042340,26112667856603880,-35149669176653700,26595700718403920,-10725012454188240,1800819912950474,82.5],[8.277824516172526E-4,111320.7020463578,6.477955746671607E8,-4.082003173641316E9,1.077490566351142E10,-1.517187553151559E10,1.205306533862167E10,-5.124939663577472E9, 9.133119359512032E8,67.5],[0.00337398766765,111320.7020202162,4481351.045890365,-2.339375119931662E7,7.968221547186455E7,-1.159649932797253E8,9.723671115602145E7,-4.366194633752821E7,8477230.501135234,52.5],[0.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-3.441963504368392E-4,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236, -2710.55326746645,1405.483844121726,22.5],[-3.218135878613132E-4,111320.7020701615,0.00369383431289,823725.6402795718,0.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,0.37238884252424,7.45]],y2:function(a,b){if(!a||!b)return 0;var c,d,a=this.Ab(a);if(!a)return 0;c=this.Uk(a.lng);d=this.Uk(a.lat);b=this.Ab(b);return!b?0:this.Te(c,this.Uk(b.lng),d,this.Uk(b.lat))},Xo:function(a,b){if(!a||!b)return 0;a.lng=this.OD(a.lng,-180,180);a.lat=this.SD(a.lat,-74,74);b.lng=this.OD(b.lng,-180, 180);b.lat=this.SD(b.lat,-74,74);return this.Te(this.Uk(a.lng),this.Uk(b.lng),this.Uk(a.lat),this.Uk(b.lat))},Ab:function(a){if(a===p||a===j)return new H(0,0);var b,c;b=new H(Math.abs(a.lng),Math.abs(a.lat));for(var d=0;d=this.tG[d]){c=this.sP[d];break}a=this.qK(a,c);return a=new H(a.lng.toFixed(6),a.lat.toFixed(6))},zb:function(a){if(a===p||a===j||180a.lng||90a.lat)return new H(0,0);var b,c;a.lng=this.OD(a.lng,-180,180);a.lat=this.SD(a.lat,-74, 74);b=new H(a.lng,a.lat);for(var d=0;d=this.Eu[d]){c=this.qG[d];break}if(!c)for(d=0;da.lng?-1:1),d=d*(0>a.lat?-1:1);return new H(c,d)}},Te:function(a,b,c,d){return this.mP*Math.acos(Math.sin(c)* Math.sin(d)+Math.cos(c)*Math.cos(d)*Math.cos(b-a))},Uk:function(a){return Math.PI*a/180},x4:function(a){return 180*a/Math.PI},SD:function(a,b,c){b!=p&&(a=Math.max(a,b));c!=p&&(a=Math.min(a,c));return a},OD:function(a,b,c){for(;a>c;)a-=c-b;for(;ax.da.la||"BackCompat"===document.compatMode?a.addEventListener("zoomend",function(a){setTimeout(function(){b.draw(a)},20)}):a.addEventListener("zoomend",function(a){b.draw(a)});a.addEventListener("maptypechange",function(a){b.draw(a)});a.addEventListener("addoverlay",function(a){a=a.target;if(a instanceof eb)b.wa[a.ba]||(b.wa[a.ba]= a);else{for(var d=q,e=0,f=b.De.length;e=this.z.nc&&(this.z.nc=5);if(0>this.z.rd||1this.z.pg||1a)||(this.z.rd=a)},HX:function(){return this.z.rd},Rt:function(a){1a||(this.z.pg=a)},dX:function(){return this.z.pg},Sp:function(a){"solid"!=a&&"dashed"!=a||(this.z.strokeStyle=a)},EL:function(){return this.z.strokeStyle},setFillColor:function(a){this.z.fillColor=a||""},cX:function(){return this.z.fillColor},Hd:u("Ou"),remove:function(){this.map&&this.map.removeEventListener("onmousemove",this.lv);eb.prototype.remove.call(this);this.ff.length=0},lf:function(){if(!(2> this.ia.length)){this.z.lf=o;var a=this;I.load("poly",function(){a.Ul()},o)}},iW:function(){this.z.lf=q;var a=this;I.load("poly",function(){a.mk()},o)},$W:function(){return this.z.lf}});function oc(a){eb.call(this);this.V=this.map=p;this.z={width:0,height:0,za:new L(0,0),opacity:1,background:"transparent",Tx:1,yM:"#000",BY:"solid",point:p};this.RN(a);this.point=this.z.point}x.lang.ua(oc,eb,"Division"); x.extend(oc.prototype,{Hj:function(){var a=this.z,b=this.content,c=['
');c.push(b);c.push("
");this.V=xb(this.map.Qf().GE,c.join(""))},initialize:function(a){this.map=a;this.Hj(); this.V&&x.M(this.V,G()?"touchstart":"mousedown",function(a){ma(a)});return this.V},draw:function(){var a=this.map.Ve(this.z.point);this.z.za=new L(-Math.round(this.z.width/2)-Math.round(this.z.Tx),-Math.round(this.z.height/2)-Math.round(this.z.Tx));this.V.style.left=a.x+this.z.za.width+"px";this.V.style.top=a.y+this.z.za.height+"px"},ha:function(){return this.z.point},Y0:function(){return this.map.bc(this.ha())},ta:function(a){this.z.point=a;this.draw()},SZ:function(a,b){this.z.width=Math.round(a); this.z.height=Math.round(b);this.V&&(this.V.style.width=this.z.width+"px",this.V.style.height=this.z.height+"px",this.draw())}});function pc(a,b,c){a&&b&&(this.imageUrl=a,this.size=b,a=new L(Math.floor(b.width/2),Math.floor(b.height/2)),c=c||{},a=c.anchor||a,b=c.imageOffset||new L(0,0),this.imageSize=c.imageSize,this.anchor=a,this.imageOffset=b,this.infoWindowAnchor=c.infoWindowAnchor||this.anchor,this.printImageUrl=c.printImageUrl||"")} x.extend(pc.prototype,{SN:function(a){a&&(this.imageUrl=a)},h_:function(a){a&&(this.printImageUrl=a)},Ae:function(a){a&&(this.size=new L(a.width,a.height))},qc:function(a){a&&(this.anchor=new L(a.width,a.height))},St:function(a){a&&(this.imageOffset=new L(a.width,a.height))},YZ:function(a){a&&(this.infoWindowAnchor=new L(a.width,a.height))},VZ:function(a){a&&(this.imageSize=new L(a.width,a.height))},toString:da("Icon")});function qc(a,b){if(a){b=b||{};this.style={anchor:b.anchor||new L(0,0),fillColor:b.fillColor||"#000",pg:b.fillOpacity||0,scale:b.scale||1,rotation:b.rotation||0,strokeColor:b.strokeColor||"#000",rd:b.strokeOpacity||1,nc:b.strokeWeight};this.Nb="number"===typeof a?a:"UserDefined";this.Hi=this.style.anchor;this.sr=new L(0,0);this.anchor=p;this.lB=a;var c=this;I.load("symbol",function(){c.Kn()},o)}} x.extend(qc.prototype,{setPath:ca("lB"),setAnchor:function(a){this.Hi=this.style.anchor=a},setRotation:function(a){this.style.rotation=a},setScale:function(a){this.style.scale=a},setStrokeWeight:function(a){this.style.nc=a},setStrokeColor:function(a){a=x.es.rC(a,this.style.rd);this.style.strokeColor=a},setStrokeOpacity:function(a){this.style.rd=a},setFillOpacity:function(a){this.style.pg=a},setFillColor:function(a){this.style.fillColor=a}});function rc(a,b,c,d){a&&(this.Ev={},this.cL=d?!!d:q,this.Uc=[],this.z_=a instanceof qc?a:p,this.HI=b===j?o:!!(b.indexOf("%")+1),this.Zj=isNaN(parseFloat(b))?1:this.HI?parseFloat(b)/100:parseFloat(b),this.II=!!(c.indexOf("%")+1),this.repeat=c!=j?this.II?parseFloat(c)/100:parseFloat(c):0)};function sc(a,b){x.lang.Ca.call(this);this.content=a;this.map=p;b=b||{};this.z={width:b.width||0,height:b.height||0,maxWidth:b.maxWidth||730,za:b.offset||new L(0,0),title:b.title||"",HE:b.maxContent||"",$g:b.enableMaximize||q,Hs:b.enableAutoPan===q?q:o,eD:b.enableCloseOnClick===q?q:o,margin:b.margin||[10,10,40,10],mC:b.collisions||[[10,10],[10,10],[10,10],[10,10]],aY:q,WY:b.onClosing||da(o),UK:q,jD:b.enableParano===o?o:q,message:b.message,lD:b.enableSearchTool===o?o:q,Ex:b.headerContent||"",fD:b.enableContentScroll|| q};if(0!=this.z.width&&(220>this.z.width&&(this.z.width=220),730this.z.height&&(this.z.height=60),650this.z.maxWidth&&(this.z.maxWidth=220),730a)||(0!=a&&(220>a&&(a=220),730a)||(0!=a&&(60>a&&(a=60),650a)||(0!=a&&(220>a&&(a=220),730this.z.width&&(this.z.width=0);Db(b.enableClicking)&&(this.z.hf=b.enableClicking);this.point=this.z.position;var c=this;I.load("marker",function(){c.yb()})}x.lang.ua(tc,eb,"Label"); x.extend(tc.prototype,{ha:function(){return this.tv?this.tv.ha():this.point},ta:function(a){a instanceof H&&!this.sx()&&(this.point=this.z.position=new H(a.lng,a.lat))},ad:ca("content"),uF:function(a){0<=a&&1>=a&&(this.z.opacity=a)},Xe:function(a){a instanceof L&&(this.z.za=new L(a.width,a.height))},Pf:function(){return this.z.za},Ld:function(a){a=a||{};this.z.Wp=x.extend(this.z.Wp,a)},xi:function(a){return this.Ld(a)},Cc:function(a){this.z.title=a||""},getTitle:function(){return this.z.title},UN:function(a){this.point= (this.tv=a)?this.z.position=a.ha():this.z.position=p},sx:function(){return this.tv||p},uk:u("content")});function uc(a,b){if(0!==arguments.length){eb.apply(this,arguments);b=b||{};this.z={$a:a,opacity:b.opacity||1,mp:b.imageURL||"",xs:b.displayOnMinLevel||1,mj:b.enableMassClear===q?q:o,ws:b.displayOnMaxLevel||19,t_:b.stretch||q};0===b.opacity&&(this.z.opacity=0);var c=this;I.load("groundoverlay",function(){c.yb()})}}x.lang.ua(uc,eb,"GroundOverlay"); x.extend(uc.prototype,{setBounds:function(a){this.z.$a=a},getBounds:function(){return this.z.$a},setOpacity:function(a){this.z.opacity=a},getOpacity:function(){return this.z.opacity},setImageURL:function(a){this.z.mp=a},getImageURL:function(){return this.z.mp},setDisplayOnMinLevel:function(a){this.z.xs=a},getDisplayOnMinLevel:function(){return this.z.xs},setDisplayOnMaxLevel:function(a){this.z.ws=a},getDisplayOnMaxLevel:function(){return this.z.ws}});var vc=3,wc=4;function xc(){var a=document.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))} function yc(a,b){var c=this;xc()&&(a===j&&ba(Error("\u6ca1\u6709\u4f20\u5165points\u6570\u636e")),"[object Array]"!==Object.prototype.toString.call(a)&&ba(Error("points\u6570\u636e\u4e0d\u662f\u6570\u7ec4")),b=b||{},eb.apply(c,arguments),c.ea={ia:a},c.z={shape:b.shape||vc,size:b.size||wc,color:b.color||"#fa937e",mj:o},this.iB=[],this.oe=[],I.load("pointcollection",function(){for(var a=0,b;b=c.iB[a];a++)c[b.method].apply(c,b.arguments);for(a=0;b=c.oe[a];a++)c[b.method].apply(c,b.arguments)}))} x.lang.ua(yc,eb,"PointCollection");x.extend(yc.prototype,{initialize:function(a){this.iB&&this.iB.push({method:"initialize",arguments:arguments})},setPoints:function(a){this.oe&&this.oe.push({method:"setPoints",arguments:arguments})},setStyles:function(a){this.oe&&this.oe.push({method:"setStyles",arguments:arguments})},clear:function(){this.oe&&this.oe.push({method:"clear",arguments:arguments})},remove:function(){this.oe&&this.oe.push({method:"remove",arguments:arguments})}});var zc=new pc(F.qa+"marker_red_sprite.png",new L(19,25),{anchor:new L(10,25),infoWindowAnchor:new L(10,0)}),Ac=new pc(F.qa+"marker_red_sprite.png",new L(20,11),{anchor:new L(6,11),imageOffset:new L(-19,-13)}); function U(a,b){eb.call(this);b=b||{};this.point=a;this.xq=this.map=p;this.z={za:b.offset||new L(0,0),uj:b.icon||zc,Ok:Ac,title:b.title||"",label:p,YJ:b.baseZIndex||0,hf:o,R4:q,tE:q,mj:b.enableMassClear===q?q:o,Hb:q,BN:b.raiseOnDrag===o?o:q,IN:q,Fd:b.draggingCursor||F.Fd,rotation:b.rotation||0};b.icon&&!b.shadow&&(this.z.Ok=p);b.enableDragging&&(this.z.Hb=b.enableDragging);Db(b.enableClicking)&&(this.z.hf=b.enableClicking);var c=this;I.load("marker",function(){c.yb()})}U.Ju=jc.Dm(-90)+1E6; U.mG=U.Ju+1E6;x.lang.ua(U,eb,"Marker"); x.extend(U.prototype,{Vb:function(a){if(a instanceof pc||a instanceof qc)this.z.uj=a},Yo:function(){return this.z.uj},Cy:function(a){a instanceof pc&&(this.z.Ok=a)},getShadow:function(){return this.z.Ok},fn:function(a){this.z.label=a||p},MD:function(){return this.z.label},Hb:function(){this.z.Hb=o},KC:function(){this.z.Hb=q},ha:u("point"),ta:function(a){a instanceof H&&(this.point=new H(a.lng,a.lat))},yi:function(a,b){this.z.tE=!!a;a&&(this.IG=b||0)},Cc:function(a){this.z.title=a+""},getTitle:function(){return this.z.title}, Xe:function(a){a instanceof L&&(this.z.za=a)},Pf:function(){return this.z.za},dn:ca("xq"),Qp:function(a){this.z.rotation=a},CL:function(){return this.z.rotation}});function Bc(a,b){lc.call(this,b);b=b||{};this.z.pg=b.fillOpacity?b.fillOpacity:0.65;this.z.fillColor=""==b.fillColor?"":b.fillColor?b.fillColor:"#fff";this.ke(a);var c=this;I.load("poly",function(){c.yb()})}x.lang.ua(Bc,lc,"Polygon"); x.extend(Bc.prototype,{ke:function(a,b){this.so=lc.lx(a).slice(0);var c=lc.lx(a).slice(0);1g;g+=9){var i=Math.PI/180*g,k=Math.asin(Math.sin(e)*Math.cos(d)+Math.cos(e)*Math.sin(d)*Math.cos(i)),i=new H(((f-Math.atan2(Math.sin(i)*Math.sin(d)*Math.cos(e),Math.cos(d)-Math.sin(e)* Math.sin(k))+Math.PI)%(2*Math.PI)-Math.PI)*(180/Math.PI),k*(180/Math.PI));c.push(i)}d=c[0];c.push(new H(d.lng,d.lat));return c}});var Ec={};function Fc(a){this.map=a;this.Mm=[];this.Wf=[];this.Bg=[];this.oV=300;this.$E=0;this.ug={};this.dj={};this.ph=0;this.nE=o;this.yK={};this.bo=this.Nn(1);this.ld=this.Nn(2);this.yl=this.Nn(3);a.platform.appendChild(this.bo);a.platform.appendChild(this.ld);a.platform.appendChild(this.yl);var b=256*Math.pow(2,15),c=3*b,a=S.zb(new H(180,0)).lng,c=c-a,b=-3*b,d=S.zb(new H(-180,0)).lng;this.kI=a;this.lI=d;this.PA=c+(d-b);this.mI=a-d}z.We(function(a){var b=new Fc(a);b.ra();a.eb=b}); x.extend(Fc.prototype,{ra:function(){var a=this,b=a.map;b.addEventListener("loadcode",function(){a.Ux()});b.addEventListener("addtilelayer",function(b){a.Vg(b)});b.addEventListener("removetilelayer",function(b){a.wh(b)});b.addEventListener("setmaptype",function(b){a.zg(b)});b.addEventListener("zoomstartcode",function(b){a.Jc(b)});b.addEventListener("setcustomstyles",function(b){a.Tt(b.target);a.Tf(o)})},Ux:function(){var a=this;if(x.da.la)try{document.execCommand("BackgroundImageCache",q,o)}catch(b){}this.loaded|| a.Kx();a.Tf();this.loaded||(this.loaded=o,I.load("tile",function(){a.YP()}))},Kx:function(){for(var a=this.map.oa().nr,b=0;be;)a-=d,c-=this.PA;for(;athis.kI;)b-=this.mI;for(;b=d){var k=k+c,l="id_"+k+"_"+i+"_"+ b;a[l]||(a[l]=o,f.push([k,i]))}else k<=e&&(k-=c,l="id_"+k+"_"+i+"_"+b,a[l]||(a[l]=o,f.push([k,i])))}for(g=0;gC[0]||v<=C[0]||l>C[1]||e<=C[1]))&&this.Hx(E)}B=-d.offsetX+d.width/2;E=-d.offsetY+d.height/2;i.Rb&&(i.Rb.style.left=Math.ceil(w+B)-t[0]+"px",i.Rb.style.top=Math.ceil(y+E)-t[1]+"px",i.Rb.style.WebkitTransform="translate3d(0,0,0)");w=[];for(d.MB=[];n0&&g.rJ)g.Ib.style.cssText=g.Ib.style.cssText+(';filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+g.src+'",sizingMethod=scale);')}var c=a.$E-a.oV,d;for(d in b){if(c<=0)break;if(!a.ug[d]){b[d].Pm=p;var f=b[d].Ib;if(f&&f.parentNode){f.parentNode.removeChild(f);Lc(f)}f=p;b[d].Ib=p;delete b[d];a.$E--;c--}}Mc&&new qb({Gc:20,duration:200,va:function(a){if(g.Ib&&g.Ib.style)g.Ib.style.opacity=a*1},finish:function(){g.Ib&&g.Ib.style&&delete g.Ib.style.opacity}});Hc(g)}}; this.Ib.onerror=function(){Hc(g);if(g.Pm){var a=g.Pm.map.oa();if(a.k.mD){g.error=o;g.Ib.src=a.k.mD;g.Ib&&!wb(g.Ib)&&e.Rb.appendChild(g.Ib)}}};d=p}function Jc(a,b){a.Tu.push(b)}Kc.prototype.ao=function(){this.Ib.src=0=x.da.la&&this.rJ?F.qa+"blank.gif":""!==this.src&&this.Ib.src==this.src?this.src+"&t = "+Date.now():this.src};function Hc(a){for(var b=0;bthis.k.predictDate.weekday||7this.k.predictDate.hour||23]*>/g,"");return a=a.replace(/[ | ]* /g," ")};O.dZ=function(a){return a.replace(/([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0|[1-9]\d*),([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0|[1-9]\d*)(,)/g,"$1,$2;")};O.eZ=function(a,b){return a.replace(RegExp("(((-?\\d+)(\\.\\d+)?),((-?\\d+)(\\.\\d+)?);)(((-?\\d+)(\\.\\d+)?),((-?\\d+)(\\.\\d+)?);){"+b+"}","ig"),"$1")};var dd=2,ed=3,id=0,jd="bt",kd="nav",ld="walk",md="bl",nd="bsl",od=14,pd=15,qd=18,rd=20,sd=31;z.I=window.Instance=x.lang.Kc;function td(a,b,c){x.lang.Ca.call(this);if(a){this.Va="object"==typeof a?a:x.Dc(a);this.page=1;this.Jd=100;this.UJ="pg";this.Uf=4;this.bK=b;this.update=o;a={page:1,Ye:100,Jd:100,Uf:4,UJ:"pg",update:o};c||(c=a);for(var d in c)"undefined"!=typeof c[d]&&(this[d]=c[d]);this.va()}} x.extend(td.prototype,{va:function(){this.ra()},ra:function(){this.xV();this.Va.innerHTML=this.TV()},xV:function(){isNaN(parseInt(this.page))&&(this.page=1);isNaN(parseInt(this.Jd))&&(this.Jd=1);1>this.page&&(this.page=1);1>this.Jd&&(this.Jd=1);this.page>this.Jd&&(this.page=this.Jd);this.page=parseInt(this.page);this.Jd=parseInt(this.Jd)},N2:function(){location.search.match(RegExp("[?&]?"+this.UJ+"=([^&]*)[&$]?","gi"));this.page=RegExp.$1},TV:function(){var a=[],b=this.page-1,c=this.page+1;a.push('

'); if(!(1>b)){if(this.page>=this.Uf){var d;a.push('\u9996\u9875'.replace("{temp1}","BMap.I('"+this.ba+"').toPage(1);"))}a.push('\u4e0a\u4e00\u9875'.replace("{temp2}","BMap.I('"+this.ba+"').toPage("+b+");"))}if(this.pagethis.page+d?this.page+d:this.Jd;d=this.page-d-e}this.page>this.Jd-this.Uf&&this.page>=this.Uf&&(d=this.Jd-this.Uf+1,b=this.Jd);for(e=d;e<=b;e++)0'+e+""):1<=e&&e<=this.Jd&&(d='['+e+"]",a.push(d.replace("{temp3}","BMap.I('"+this.ba+"').toPage("+e+");")))); c>this.Jd||a.push('\u4e0b\u4e00\u9875'.replace("{temp4}","BMap.I('"+this.ba+"').toPage("+c+");"));a.push("

");return a.join("")},toPage:function(a){a=a?a:1;"function"==typeof this.bK&&(this.bK(a),this.page=a);this.update&&this.va()}});function ab(a,b){W.call(this,a,b);b=b||{};b.renderOptions=b.renderOptions||{};this.Pp(b.pageCapacity);"undefined"!=typeof b.renderOptions.selectFirstResult&&!b.renderOptions.selectFirstResult?this.LC():this.hD();this.wa=[];this.vf=[];this.kb=-1;this.Pa=[];var c=this;I.load("local",function(){c.Dz()},o)}x.ua(ab,W,"LocalSearch");ab.fq=10;ab.z0=1;ab.Cn=100;ab.lG=2E3;ab.sG=1E5; x.extend(ab.prototype,{search:function(a,b){this.Pa.push({method:"search",arguments:[a,b]})},bn:function(a,b,c){this.Pa.push({method:"searchInBounds",arguments:[a,b,c]})},Lp:function(a,b,c,d){this.Pa.push({method:"searchNearby",arguments:[a,b,c,d]})},Pe:function(){delete this.Fa;delete this.Bd;delete this.ja;delete this.ga;this.kb=-1;this.sb();this.k.ka.Ia&&(this.k.ka.Ia.innerHTML="")},Em:s(),hD:function(){this.k.ka.Ot=o},LC:function(){this.k.ka.Ot=q},Pp:function(a){this.k.Gk="number"==typeof a&& !isNaN(a)?1>a?ab.fq:a>ab.Cn?ab.fq:a:ab.fq},of:function(){return this.k.Gk},toString:da("LocalSearch")});var ud=ab.prototype;T(ud,{clearResults:ud.Pe,setPageCapacity:ud.Pp,getPageCapacity:ud.of,gotoPage:ud.Em,searchNearby:ud.Lp,searchInBounds:ud.bn,search:ud.search,enableFirstResultSelection:ud.hD,disableFirstResultSelection:ud.LC});function vd(a,b){W.call(this,a,b)}x.ua(vd,W,"BaseRoute");x.extend(vd.prototype,{Pe:s()});function wd(a,b){W.call(this,a,b);b=b||{};this.Wt(b.policy);this.Pp(b.pageCapacity);this.ud=jd;this.Fu=od;this.Gu=bd;this.wa=[];this.kb=-1;this.k.ed=b.enableTraffic||q;this.Pa=[];var c=this;I.load("route",function(){c.Qd()})}wd.Cn=100;wd.oP=[0,1,0,0,0,0,0,0,2,0,0,0,1,1,1];x.ua(wd,vd,"TransitRoute"); x.extend(wd.prototype,{Wt:function(a){this.k.$c=0<=a&&4>=a?a:0},DA:function(a,b){this.Pa.push({method:"_internalSearch",arguments:[a,b]})},search:function(a,b){this.Pa.push({method:"search",arguments:[a,b]})},Pp:function(a){if("string"===typeof a&&(a=parseInt(a,10),isNaN(a))){this.k.Gk=wd.Cn;return}this.k.Gk="number"!==typeof a?wd.Cn:1<=a&&a<=wd.Cn?Math.round(a):wd.Cn},toString:da("TransitRoute"),lU:function(a){return a.replace(/\(.*\)/,"")}});var xd=wd.prototype;T(xd,{_internalSearch:xd.DA});function yd(a,b){W.call(this,a,b);this.wa=[];this.kb=-1;this.Pa=[];var c=this,d=this.k.ka;1!==d.ft&&2!==d.ft&&(d.ft=1);this.Xz=this.k.ka.Hb?o:q;I.load("route",function(){c.Qd()});this.kE&&this.kE()}yd.CP=" \u73af\u5c9b \u65e0\u5c5e\u6027\u9053\u8def \u4e3b\u8def \u9ad8\u901f\u8fde\u63a5\u8def \u4ea4\u53c9\u70b9\u5185\u8def\u6bb5 \u8fde\u63a5\u9053\u8def \u505c\u8f66\u573a\u5185\u90e8\u9053\u8def \u670d\u52a1\u533a\u5185\u90e8\u9053\u8def \u6865 \u6b65\u884c\u8857 \u8f85\u8def \u531d\u9053 \u5168\u5c01\u95ed\u9053\u8def \u672a\u5b9a\u4e49\u4ea4\u901a\u533a\u57df POI\u8fde\u63a5\u8def \u96a7\u9053 \u6b65\u884c\u9053 \u516c\u4ea4\u4e13\u7528\u9053 \u63d0\u524d\u53f3\u8f6c\u9053".split(" "); x.ua(yd,vd,"DWRoute");x.extend(yd.prototype,{search:function(a,b,c){this.Pa.push({method:"search",arguments:[a,b,c]})}});function zd(a,b){yd.call(this,a,b);b=b||{};this.k.ed=b.enableTraffic||q;this.Wt(b.policy);this.ud=kd;this.Fu=rd;this.Gu=ed}x.ua(zd,yd,"DrivingRoute");zd.prototype.Wt=function(a){this.k.$c=0<=a&&2>=a?a:0};function Ad(a,b){yd.call(this,a,b);this.ud=ld;this.Fu=sd;this.Gu=dd;this.Xz=q}x.ua(Ad,yd,"WalkingRoute");function Bd(a,b){x.lang.Ca.call(this);this.Sf=[];this.Vm=[];this.k=b;this.fc=a;this.map=this.k.ka.map||p;this.wy=this.k.wy;this.Cb=p;this.fj=0;this.Ky="";this.ce=1;this.dx="";this.Gp=[0,0,0,0,0,0,0];this.CE=[];this.js=[1,1,1,1,1,1,1];this.zO=[1,1,1,1,1,1,1];this.Mt=[0,0,0,0,0,0,0];this.Hp=[0,0,0,0,0,0,0];this.Na=[{o:"",Cd:0,tn:0,x:0,y:0,pa:-1},{o:"",Cd:0,tn:0,x:0,y:0,pa:-1},{o:"",Cd:0,tn:0,x:0,y:0,pa:-1},{o:"",Cd:0,tn:0,x:0,y:0,pa:-1},{o:"",Cd:0,tn:0,x:0,y:0,pa:-1},{o:"",Cd:0,tn:0,x:0,y:0,pa:-1}, {o:"",Cd:0,tn:0,x:0,y:0,pa:-1}];this.fi=-1;this.lu=[];this.mu=[];I.load("route",s())}x.lang.ua(Bd,x.lang.Ca,"RouteAddr");var Cd=navigator.userAgent;/ipad|iphone|ipod|iph/i.test(Cd);var Dd=/android/i.test(Cd);function Ed(a){this.qh=a||{}}x.extend(Ed.prototype,{NN:function(a,b,c){var d=this;I.load("route",function(){d.Qd(a,b,c)})}});function Fd(a){this.k={};x.extend(this.k,a);this.Pa=[];var b=this;I.load("othersearch",function(){b.Qd()})}x.ua(Fd,x.lang.Ca,"Geocoder");x.extend(Fd.prototype,{ym:function(a,b,c){this.Pa.push({method:"getPoint",arguments:[a,b,c]})},um:function(a,b,c){this.Pa.push({method:"getLocation",arguments:[a,b,c]})},toString:da("Geocoder")});var Gd=Fd.prototype;T(Gd,{getPoint:Gd.ym,getLocation:Gd.um});function Geolocation(a){a=a||{};this.D={timeout:a.timeout||1E4,maximumAge:a.maximumAge||6E5,bl:q};this.oe=[];var b=this;I.load("othersearch",function(){for(var a=0,d;d=b.oe[a];a++)b[d.method].apply(b,d.arguments)})}x.extend(Geolocation.prototype,{getCurrentPosition:function(a,b){this.oe.push({method:"getCurrentPosition",arguments:arguments})},getStatus:da(2),enableSDKLocation:function(){G()&&(this.D.bl=o)},disableSDKLocation:function(){this.D.bl=q}});function Hd(a){a=a||{};a.ka=a.renderOptions||{};this.k={ka:{map:a.ka.map||p}};this.Pa=[];var b=this;I.load("othersearch",function(){b.Qd()})}x.ua(Hd,x.lang.Ca,"LocalCity");x.extend(Hd.prototype,{get:function(a){this.Pa.push({method:"get",arguments:[a]})},toString:da("LocalCity")});function Id(){this.Pa=[];var a=this;I.load("othersearch",function(){a.Qd()})}x.ua(Id,x.lang.Ca,"Boundary");x.extend(Id.prototype,{get:function(a,b){this.Pa.push({method:"get",arguments:[a,b]})},toString:da("Boundary")});function Jd(a,b){W.call(this,a,b);this.zP=md;this.BP=pd;this.yP=nd;this.AP=qd;this.Pa=[];var c=this;I.load("buslinesearch",function(){c.Qd()})}Jd.pv=F.qa+"iw_plus.gif";Jd.ES=F.qa+"iw_minus.gif";Jd.vU=F.qa+"stop_icon.png";x.ua(Jd,W); x.extend(Jd.prototype,{getBusList:function(a){this.Pa.push({method:"getBusList",arguments:[a]})},getBusLine:function(a){this.Pa.push({method:"getBusLine",arguments:[a]})},setGetBusListCompleteCallback:function(a){this.k.gN=a||s()},setGetBusLineCompleteCallback:function(a){this.k.fN=a||s()},setBusListHtmlSetCallback:function(a){this.k.dN=a||s()},setBusLineHtmlSetCallback:function(a){this.k.cN=a||s()},setPolylinesSetCallback:function(a){this.k.NE=a||s()}});function Kd(a){W.call(this,a);a=a||{};this.pc={input:a.input||p,XB:a.baseDom||p,types:a.types||[],fy:a.onSearchComplete||s()};this.yd.src=a.location||"\u5168\u56fd";this.$i="";this.lg=p;this.YH="";this.Pi();Qa(Ga);var b=this;I.load("autocomplete",function(){b.Qd()})}x.ua(Kd,W,"Autocomplete");x.extend(Kd.prototype,{Pi:s(),show:s(),U:s(),xF:function(a){this.pc.types=a},gn:function(a){this.yd.src=a},search:ca("$i"),zy:ca("YH")});var Ta;function Na(a,b){function c(){e.k.visible?("inter"===e.Je&&e.k.haveBreakId&&e.k.indoorExitControl===o?x.K.show(e.wA):x.K.U(e.wA),this.k.closeControl&&this.yf&&this.C&&this.C.La()===this.B?x.K.show(e.yf):x.K.U(e.yf),this.k.forceCloseControl&&x.K.show(e.yf)):(x.K.U(e.yf),x.K.U(e.wA))}this.B="string"==typeof a?x.$(a):a;this.ba=Ld++;this.k={enableScrollWheelZoom:o,panoramaRenderer:"flash",swfSrc:z.rg("main_domain_nocdn","res/swf/")+"APILoader.swf",visible:o,indoorExitControl:o,indoorFloorControl:q,linksControl:o, clickOnRoad:o,navigationControl:o,closeControl:o,indoorSceneSwitchControl:o,albumsControl:q,albumsControlOptions:{},copyrightControlOptions:{},forceCloseControl:q,haveBreakId:q};var b=b||{},d;for(d in b)this.k[d]=b[d];b.closeControl===o&&(this.k.forceCloseControl=o);b.useWebGL===q&&Ma(q);this.Da={heading:0,pitch:0};this.$n=[];this.Mb=this.Ya=p;this.ck=this.cr();this.wa=[];this.Jc=1;this.Je=this.bT=this.gl="";this.Ie={};this.Lf=p;this.Og=[];this.yr=[];"cvsRender"==this.ck||Ma()?(this.Vj=90,this.Xj= -90):"cssRender"==this.ck&&(this.Vj=45,this.Xj=-45);this.Cr=q;var e=this;this.ao=function(){this.ck==="flashRender"?I.load("panoramaflash",function(){e.Pi()},o):I.load("panorama",function(){e.yb()},o);b.Of=="api"?Qa(Ca):Qa(Da);this.ao=s()};this.k.PS!==o&&(this.ao(),z.Dn("cus.fire","count","z_loadpanoramacount"));this.FT(this.B);this.addEventListener("id_changed",function(){Qa(Ba,{from:b.Of})});this.TP();this.addEventListener("indoorexit_options_changed",c);this.addEventListener("scene_type_changed", c);this.addEventListener("onclose_options_changed",c);this.addEventListener("onvisible_changed",c)}var Md=4,Nd=1,Ld=0;x.lang.ua(Na,x.lang.Ca,"Panorama"); x.extend(Na.prototype,{TP:function(){var a=this,b=this.yf=K("div");b.className="pano_close";b.style.cssText="z-index: 1201;display: none";b.title="\u9000\u51fa\u5168\u666f";b.onclick=function(){a.U()};this.B.appendChild(b);var c=this.wA=K("a");c.className="pano_pc_indoor_exit";c.style.cssText="z-index: 1201;display: none";c.innerHTML='\u51fa\u53e3';c.title="\u9000\u51fa\u5ba4\u5185\u666f";c.onclick=function(){a.So()};this.B.appendChild(c);window.ActiveXObject&& !document.addEventListener&&(b.style.backgroundColor="rgb(37,37,37)",c.style.backgroundColor="rgb(37,37,37)")},So:s(),FT:function(a){var b,c;b=a.style;c=Va(a).position;"absolute"!=c&&"relative"!=c&&(b.position="relative",b.zIndex=0);if("absolute"===c||"relative"===c)if(a=Va(a).zIndex,!a||"auto"===a)b.zIndex=0},lX:u("$n"),Zb:u("Ya"),NX:u("Yv"),bO:u("Yv"),ha:u("Mb"),Ea:u("Da"),fa:u("Jc"),eh:u("gl"),P2:function(){return this.g1||[]},K2:u("bT"),$s:u("Je"),By:function(a){a!==this.Je&&(this.Je=a,this.dispatchEvent(new M("onscene_type_changed")))}, rc:function(a,b,c){"object"===typeof b&&(c=b,b=j);a!=this.Ya&&(this.rl=this.Ya,this.sl=this.Mb,this.Ya=a,this.Je=b||"street",this.Mb=p,c&&c.pov&&this.Mc(c.pov))},ta:function(a){a.nb(this.Mb)||(this.rl=this.Ya,this.sl=this.Mb,this.Mb=a,this.Ya=p)},Mc:function(a){a&&(this.Da=a,a=this.Da.pitch,a>this.Vj?a=this.Vj:a=b?0:b},Nc:function(a){a!=this.Jc&&(a>Md&&(a=Md),ab&&(d=90);0>a&&0>b&&(d=180);0>a&&0b?180:0:0===b&&(c=0a)return Vd=q}var a=document.createElement("canvas"),c=p;try{c=a.getContext("webgl")}catch(d){Vd=q}return Vd=c===p?q:o}var Vd;function Wd(){if("boolean"===typeof Xd)return Xd;Xd=o;if(x.platform.oE)return o;var a=navigator.userAgent;return-1=x.da.la&&(c+="&color_dep=32");return c};ac.prototype.vt=da(o);Zd.Ud=new S;function Zd(){}x.extend(Zd,{lW:function(a,b,c){c=x.lang.Kc(c);b={data:b};"position_changed"==a&&(b.data=Zd.Ud.zj(new R(b.data.mercatorX,b.data.mercatorY)));c.dispatchEvent(new M("on"+a),b)}});var $d=Zd;T($d,{dispatchFlashEvent:$d.lW});var ae={qP:50};ae.Hu=z.rg("pano")[0];ae.Du={width:220,height:60}; x.extend(ae,{np:function(a,b,c,d){if(!b||!c||!c.lngLat||!c.panoInstance)d();else{this.ho===j&&(this.ho=new bc(p,{Of:"api"}));var e=this;this.ho.eC(b,function(b){b?e.ho.pj(c.lngLat,ae.qP,function(b){if(b&&b.id){var f=b.id,k=b.rh,b=b.th,l=bc.Ud.kh(c.lngLat),m=e.fS(l,{x:k,y:b}),k=e.yL(f,m,0,ae.Du.width,ae.Du.height);a.content=e.gS(a.content,k,c.titleTip,c.beforeDomId);a.addEventListener("open",function(){ia.M(x.Dc("infoWndPano"),"click",function(){c.panoInstance.rc(f);c.panoInstance.show();c.panoInstance.Mc({heading:m, pitch:0})})})}d()}):d()})}},gS:function(a,b,c,d){var c=c||"",e;!d||!a.split(d)[0]?(d=a,a=""):(d=a.split(d)[0],e=d.lastIndexOf("<"),d=a.substring(0,e),a=a.substring(e));e=[];var f=ae.Du.width,g=ae.Du.height;e.push(d);e.push("
");e.push(""+c+"\u5916\u666f");e.push("
\u8fdb\u5165\u5168\u666f>>");e.push("
");e.push(a);return e.join("")},fS:function(a,b){var c=90-180*Math.atan2(a.y-b.y,a.x-b.x)/Math.PI;0>c&&(c+=360);return c},yL:function(a,b,c,d,e){var f={panoId:a,panoHeading:b||0,panoPitch:c||0,width:d,height:e};return(ae.Hu+"?qt=pr3d&fovy=75&quality=80&panoid={panoId}&heading={panoHeading}&pitch={panoPitch}&width={width}&height={height}").replace(/\{(.*?)\}/g, function(a,b){return f[b]})}});var be=document,ce=Math,de=be.createElement("div").style,ee;a:{for(var fe=["t","webkitT","MozT","msT","OT"],ge,he=0,ie=fe.length;hec?(this.options.rD||(c=this[a+"ScrollbarIndicatorSize"]+ce.round(3*c),8>c&&(c=8),this[a+"ScrollbarIndicator"].style["h"==a?"width":"height"]=c+"px"),c=0):c>this[a+"ScrollbarMaxScroll"]&&(this.options.rD?c=this[a+"ScrollbarMaxScroll"]:(c=this[a+"ScrollbarIndicatorSize"]-ce.round(3*(c-this[a+"ScrollbarMaxScroll"])),8>c&&(c=8),this[a+"ScrollbarIndicator"].style["h"==a?"width":"height"]= c+"px",c=this[a+"ScrollbarMaxScroll"]+(this[a+"ScrollbarIndicatorSize"]-c))),this[a+"ScrollbarWrapper"].style[we]="0",this[a+"ScrollbarWrapper"].style.opacity=b&&this.options.Gx?"0":"1",this[a+"ScrollbarIndicator"].style[le]="translate("+("h"==a?c+"px,0)":"0,"+c+"px)")+Le)},FQ:function(a){if(a.BR===o)return this.OB=a.target,this.fx=Date.now(),o;if(this.OB&&this.fx){if(600this.options.aq&&(b=2*this.options.aq*Math.pow(0.5,this.options.aq/b)),this.up=b/this.scale,e=this.gy-this.gy*this.up+this.x,f=this.hy- this.hy*this.up+this.y,this.Pb.style[le]="translate("+e+"px,"+f+"px) scale("+b+")"+Le,this.options.oN&&this.options.oN.call(this,a);else{this.rh=b.pageX;this.th=b.pageY;if(0this.qf||f=this.qf||0<=this.nd?this.qf:this.nd;this.NC+=c;this.OC+=d;this.jw=ce.abs(this.NC);this.kw=ce.abs(this.OC);6>this.jw&&6>this.kw||(this.options.DE&&(this.jw>this.kw+5?(f=this.y,d=0):this.kw>this.jw+5&&(e= this.x,c=0)),this.oh=o,this.Br(e,f),this.HC=0c?1:0,this.IC=0d?1:0,300i&&b.options.Yx){f=d?b.nI(d-b.gu,i,-b.x,b.yy-b.vu+b.x,b.options.Do?b.vu:0):f;g=e?b.nI(e-b.hu,i,-b.y,0>b.nd?b.Kp-b.yn+b.y-b.qf:0,b.options.Do?b.yn:0):g;d=b.x+f.Ba;e=b.y+g.Ba;if(0b.qf&& e>b.qf||b.y=this.qf||0b.options.aq&&(d=b.options.aq),d!=b.scale)!b.Sy&&b.options.Ap&&b.options.Ap.call(b,a),b.Sy++,b.zoom(a.pageX,a.pageY,d,400),setTimeout(function(){b.Sy--;!b.Sy&&b.options.zp&&b.options.zp.call(b,a)},400)}else c=b.x+c,d=b.y+d,0b.qf?d=b.qf: db.nd&&b.scrollTo(c,d,0)},DU:function(a){a.target==this.Pb&&(this.Yd(Ie),this.CB())},CB:function(){var a=this,b=a.x,c=a.y,d=Date.now(),e,f,g;a.Yl||(a.Aj.length?(e=a.Aj.shift(),e.x==b&&e.y==c&&(e.time=0),a.Yl=o,a.oh=o,a.options.Ai)?(a.qJ(e.time),a.Br(e.x,e.y),a.Yl=q,e.time?a.ca(Ie):a.jo(0)):(g=function(){var i=Date.now(),k;if(i>=d+e.time){a.Br(e.x,e.y);a.Yl=q;a.options.VY&&a.options.VY.call(a);a.CB()}else{i=(i-d)/e.time-1;f=ce.sqrt(1-i*i);i=(e.x-b)*f+b;k=(e.y-c)*f+c;a.Br(i,k);if(a.Yl)a.WB= Je(g)}},g()):a.jo(400))},qJ:function(a){a+="ms";this.Pb.style[oe]=a;this.mi&&(this.UX.style[oe]=a);this.Bi&&(this.b0.style[oe]=a)},nI:function(a,b,c,d,e){var b=ce.abs(a)/b,f=b*b/0.0012;0c?(c+=e/(6/(6.0E-4*(f/b))),b=b*c/f,f=c):0>a&&f>d&&(d+=e/(6/(6.0E-4*(f/b))),b=b*d/f,f=d);return{Ba:f*(0>a?-1:1),time:ce.round(b/6.0E-4)}},Zj:function(a){for(var b=-a.offsetLeft,c=-a.offsetTop;a=a.offsetParent;)b-=a.offsetLeft,c-=a.offsetTop;a!=this.xn&&(b*=this.scale,c*=this.scale);return{left:b,top:c}},hJ:function(a, b){var c,d,e;e=this.Ue.length-1;c=0;for(d=this.Ue.length;c=this.Ue[c]){e=c;break}e==this.yC&&(0this.HC)&&e--;a=this.Ue[e];d=(d=ce.abs(a-this.Ue[this.yC]))?500*(ce.abs(this.x-a)/d):0;this.yC=e;e=this.sf.length-1;for(c=0;c=this.sf[c]){e=c;break}e==this.zC&&(0this.IC)&&e--;b=this.sf[e];c=(c=ce.abs(b-this.sf[this.zC]))?500*(ce.abs(this.y-b)/c):0;this.zC=e;e=ce.round(ce.max(d,c))||200;return{x:a,y:b,time:e}},ca:function(a,b,c){(b||this.Pb).addEventListener(a,this,!!c)}, Yd:function(a,b,c){(b||this.Pb).removeEventListener(a,this,!!c)},EC:ga(2),refresh:function(){var a,b,c,d=0;b=0;this.scalethis.he;this.vn=this.options.vn&&(!this.options.lV&&!this.jp||this.Kp>this.yn);this.mi=this.jp&&this.options.mi;this.Bi=this.vn&&this.options.Bi&&this.Kp>this.yn;a=this.Zj(this.xn);this.VF=-a.left;this.WF=-a.top;if("string"==typeof this.options.du){this.Ue=[];this.sf=[];c=this.Pb.querySelectorAll(this.options.du);a=0;for(b=c.length;a=this.he;)this.Ue[b]=d,d-=this.vu,b++;this.he%this.vu&&(this.Ue[this.Ue.length]=this.he-this.Ue[this.Ue.length-1]+this.Ue[this.Ue.length-1]);b=d=0;for(this.sf=[];d>=this.nd;)this.sf[b]=d,d-=this.yn,b++;this.nd%this.yn&&(this.sf[this.sf.length]=this.nd-this.sf[this.sf.length-1]+this.sf[this.sf.length-1])}this.Iv("h");this.Iv("v");this.Yk||(this.Pb.style[oe]="0",this.jo(400))},scrollTo:function(a,b,c,d){var e=a;this.stop();e.length||(e=[{x:a,y:b,time:c,oZ:d}]);a=0;for(b=e.length;athis.qf?this.qf:this.y=this.Ni.length)){var a=K("div");a.innerHTML=this.Zz;a.style.cssText="position:absolute;background:#252525";this.B.appendChild(a);this.Ks=a;this.Oc.eg.style.left=this.dg.width+8+"px";this.Ki&&(this.Ki.style.left=parseInt(this.Ki.style.left,10)+this.dg.width+8+"px");var b=this;x.M(a,"click",function(){b.P.rc(b.DW)})}},Gl:function(a){this.$j=a;this.k.showCatalog&&(0'+a[d].data+"",b+=c;return b},mL:function(a){for(var b="",c,d=0,e=a.length;d'+a[d].data+"",b+=c;return b},iX:function(a){for(var b,c,d,e,f=[],g=this.dg.height,i=this.dg.width,k=0;k'+e+''+e+"",3===recoType?Ua()?(this.Zz=b,this.DW=d,a.splice(k,1),k--):(b=''+e+'
',f.push(b)):f.push(b);return f.join("")},AX:function(a){var b=this,c=this.P.Zb();c&&this.Kl.zx(c,function(d){b.P.Zb()===c&&a(d)})},qc:function(a){if(!Wa(a)||isNaN(a)|| af&&this.Oc.scrollTo(g+d);c=g-c;f-=e;c';this.eg=this.Jv.children[0];this.Hr=this.Jv.children[1];this.B.appendChild(this.Jv); this.eg.children[0].style.marginTop=this.Hr.children[0].style.marginTop=this.eg.offsetHeight/2-this.eg.children[0].offsetHeight/2+"px"},am:function(){var a=this;x.M(this.eg,"click",function(){a.scrollTo(a.Rg.offsetLeft+a.eo)});x.M(this.Hr,"click",function(){a.scrollTo(a.Rg.offsetLeft-a.eo)})},EU:function(){x.K.Tb(this.eg,"pano_arrow_disable");x.K.Tb(this.Hr,"pano_arrow_disable");var a=this.Rg.offsetLeft;a>=this.uv&&x.K.Ua(this.eg,"pano_arrow_disable");a-this.eo<=this.RA&&x.K.Ua(this.Hr,"pano_arrow_disable")}, scrollTo:function(a){a=athis.uv&&(a=this.uv);var b=this.Rg.offsetLeft,c=this;new qb({Gc:60,jc:rb.Gs,duration:300,va:function(d){c.Rg.style.left=b+(a-b)*d+"px"},finish:function(){c.EU()}})}};z.Map=Ka;z.Hotspot=gb;z.MapType=Uc;z.Point=H;z.Pixel=R;z.Size=L;z.Bounds=db;z.TileLayer=Gc;z.Projection=gc;z.MercatorProjection=S;z.PerspectiveProjection=fb;z.Copyright=function(a,b,c){this.id=a;this.$a=b;this.content=c};z.Overlay=jc;z.Label=tc;z.GroundOverlay=uc;z.PointCollection=yc;z.Marker=U;z.Icon=pc;z.IconSequence=rc;z.Symbol=qc;z.Polyline=Cc;z.Polygon=Bc;z.InfoWindow=sc;z.Circle=Dc;z.Control=Sb;z.NavigationControl=hb;z.GeolocationControl=Wb;z.OverviewMapControl=jb;z.CopyrightControl=Xb; z.ScaleControl=ib;z.MapTypeControl=kb;z.CityListControl=Yb;z.PanoramaControl=$b;z.TrafficLayer=Qc;z.CustomLayer=lb;z.ContextMenu=cc;z.MenuItem=fc;z.LocalSearch=ab;z.TransitRoute=wd;z.DrivingRoute=zd;z.WalkingRoute=Ad;z.Autocomplete=Kd;z.RouteSearch=Ed;z.Geocoder=Fd;z.LocalCity=Hd;z.Geolocation=Geolocation;z.Convertor=ic;z.BusLineSearch=Jd;z.Boundary=Id;z.VectorCloudLayer=Oc;z.VectorTrafficLayer=Pc;z.Panorama=Na;z.PanoramaLabel=Qd;z.PanoramaService=bc;z.PanoramaCoverageLayer=ac; z.PanoramaFlashInterface=Zd;function T(a,b){for(var c in b)a[c]=b[c]}T(window,{BMap:z,_jsload2:function(a,b){ia.Ly.sY&&ia.Ly.set(a,b);I.vV(a,b)},BMAP_API_VERSION:"2.0"});var Se=Ka.prototype; T(Se,{getBounds:Se.Hd,getCenter:Se.Ha,getMapType:Se.oa,getSize:Se.Bb,setSize:Se.Ae,getViewport:Se.bt,getZoom:Se.fa,centerAndZoom:Se.Dd,panTo:Se.ui,panBy:Se.wg,setCenter:Se.Vf,setCurrentCity:Se.qF,setMapType:Se.zg,setViewport:Se.zh,setZoom:Se.Nc,highResolutionEnabled:Se.Ix,zoomTo:Se.Cg,zoomIn:Se.XF,zoomOut:Se.YF,addHotspot:Se.sw,removeHotspot:Se.qZ,clearHotspots:Se.em,checkResize:Se.yV,addControl:Se.qw,removeControl:Se.CN,getContainer:Se.La,addContextMenu:Se.wo,removeContextMenu:Se.Ep,addOverlay:Se.Ka, removeOverlay:Se.Ub,clearOverlays:Se.jK,openInfoWindow:Se.Ob,closeInfoWindow:Se.Wc,pointToOverlayPixel:Se.Ve,overlayPixelToPoint:Se.qN,getInfoWindow:Se.gh,getOverlays:Se.wx,getPanes:function(){return{floatPane:this.Wd.sD,markerMouseTarget:this.Wd.GE,floatShadow:this.Wd.eL,labelPane:this.Wd.yE,markerPane:this.Wd.LM,markerShadow:this.Wd.MM,mapPane:this.Wd.yt,vertexPane:this.Wd.SO}},addTileLayer:Se.Vg,removeTileLayer:Se.wh,pixelToPoint:Se.wb,pointToPixel:Se.bc,setFeatureStyle:Se.Np,selectBaseElement:Se.g4, setMapStyle:Se.Tt,enable3DBuilding:Se.Oo,disable3DBuilding:Se.hW,getPanorama:Se.wm,setBrowserContextmenu:Se.QZ});var Te=Uc.prototype;T(Te,{getTileLayer:Te.LX,getMinZoom:Te.Zo,getMaxZoom:Te.vm,getProjection:Te.dp,getTextColor:Te.Bm,getTips:Te.at});T(window,{BMAP_NORMAL_MAP:La,BMAP_PERSPECTIVE_MAP:Pa,BMAP_SATELLITE_MAP:Ya,BMAP_HYBRID_MAP:Sa});var Ue=S.prototype;T(Ue,{lngLatToPoint:Ue.kh,pointToLngLat:Ue.zj});var Ve=fb.prototype;T(Ve,{lngLatToPoint:Ve.kh,pointToLngLat:Ve.zj});var We=db.prototype; T(We,{equals:We.nb,containsPoint:We.fs,containsBounds:We.JV,intersects:We.kt,extend:We.extend,getCenter:We.Ha,isEmpty:We.xj,getSouthWest:We.ve,getNorthEast:We.nf,toSpan:We.LF});var Xe=jc.prototype;T(Xe,{isVisible:Xe.jh,show:Xe.show,hide:Xe.U});jc.getZIndex=jc.Dm;var Ye=eb.prototype;T(Ye,{openInfoWindow:Ye.Ob,closeInfoWindow:Ye.Wc,enableMassClear:Ye.mj,disableMassClear:Ye.jW,show:Ye.show,hide:Ye.U,getMap:Ye.qx,addContextMenu:Ye.wo,removeContextMenu:Ye.Ep});var Ze=U.prototype; T(Ze,{setIcon:Ze.Vb,getIcon:Ze.Yo,setPosition:Ze.ta,getPosition:Ze.ha,setOffset:Ze.Xe,getOffset:Ze.Pf,getLabel:Ze.MD,setLabel:Ze.fn,setTitle:Ze.Cc,setTop:Ze.yi,enableDragging:Ze.Hb,disableDragging:Ze.KC,setZIndex:Ze.Yt,getMap:Ze.qx,setAnimation:Ze.dn,setShadow:Ze.Cy,hide:Ze.U,setRotation:Ze.Qp,getRotation:Ze.CL});T(window,{BMAP_ANIMATION_DROP:1,BMAP_ANIMATION_BOUNCE:2});var $e=tc.prototype; T($e,{setStyle:$e.Ld,setStyles:$e.xi,setContent:$e.ad,setPosition:$e.ta,getPosition:$e.ha,setOffset:$e.Xe,getOffset:$e.Pf,setTitle:$e.Cc,setZIndex:$e.Yt,getMap:$e.qx,getContent:$e.uk});var af=pc.prototype;T(af,{setImageUrl:af.SN,setSize:af.Ae,setAnchor:af.qc,setImageOffset:af.St,setImageSize:af.VZ,setInfoWindowAnchor:af.YZ,setPrintImageUrl:af.h_});var bf=sc.prototype; T(bf,{redraw:bf.je,setTitle:bf.Cc,setContent:bf.ad,getContent:bf.uk,getPosition:bf.ha,enableMaximize:bf.$g,disableMaximize:bf.Yw,isOpen:bf.Wa,setMaxContent:bf.Ut,maximize:bf.Xx,enableAutoPan:bf.Hs});var cf=lc.prototype; T(cf,{getPath:cf.te,setPath:cf.ke,setPositionAt:cf.hn,getStrokeColor:cf.GX,setStrokeWeight:cf.Tp,getStrokeWeight:cf.FL,setStrokeOpacity:cf.Rp,getStrokeOpacity:cf.HX,setFillOpacity:cf.Rt,getFillOpacity:cf.dX,setStrokeStyle:cf.Sp,getStrokeStyle:cf.EL,getFillColor:cf.cX,getBounds:cf.Hd,enableEditing:cf.lf,disableEditing:cf.iW,getEditing:cf.$W});var df=Dc.prototype;T(df,{setCenter:df.Vf,getCenter:df.Ha,getRadius:df.AL,setRadius:df.uf});var ef=Bc.prototype;T(ef,{getPath:ef.te,setPath:ef.ke,setPositionAt:ef.hn}); var ff=gb.prototype;T(ff,{getPosition:ff.ha,setPosition:ff.ta,getText:ff.WD,setText:ff.Xt});H.prototype.equals=H.prototype.nb;R.prototype.equals=R.prototype.nb;L.prototype.equals=L.prototype.nb;T(window,{BMAP_ANCHOR_TOP_LEFT:Tb,BMAP_ANCHOR_TOP_RIGHT:Ub,BMAP_ANCHOR_BOTTOM_LEFT:Vb,BMAP_ANCHOR_BOTTOM_RIGHT:3});var gf=Sb.prototype;T(gf,{setAnchor:gf.qc,getAnchor:gf.yD,setOffset:gf.Xe,getOffset:gf.Pf,show:gf.show,hide:gf.U,isVisible:gf.jh,toString:gf.toString});var hf=hb.prototype; T(hf,{getType:hf.hp,setType:hf.jn});T(window,{BMAP_NAVIGATION_CONTROL_LARGE:0,BMAP_NAVIGATION_CONTROL_SMALL:1,BMAP_NAVIGATION_CONTROL_PAN:2,BMAP_NAVIGATION_CONTROL_ZOOM:3});var jf=jb.prototype;T(jf,{changeView:jf.qe,setSize:jf.Ae,getSize:jf.Bb});var kf=ib.prototype;T(kf,{getUnit:kf.PX,setUnit:kf.yF});T(window,{BMAP_UNIT_METRIC:"metric",BMAP_UNIT_IMPERIAL:"us"});var lf=Xb.prototype;T(lf,{addCopyright:lf.rw,removeCopyright:lf.bF,getCopyright:lf.sm,getCopyrightCollection:lf.FD}); T(window,{BMAP_MAPTYPE_CONTROL_HORIZONTAL:Zb,BMAP_MAPTYPE_CONTROL_DROPDOWN:1,BMAP_MAPTYPE_CONTROL_MAP:2});var of=Gc.prototype;T(of,{getMapType:of.oa,getCopyright:of.sm,isTransparentPng:of.vt});var pf=cc.prototype;T(pf,{addItem:pf.tw,addSeparator:pf.SB,removeSeparator:pf.dF});var qf=fc.prototype;T(qf,{setText:qf.Xt});var rf=W.prototype; T(rf,{getStatus:rf.zm,setSearchCompleteCallback:rf.wF,getPageCapacity:rf.of,setPageCapacity:rf.Pp,setLocation:rf.gn,disableFirstResultSelection:rf.LC,enableFirstResultSelection:rf.hD,gotoPage:rf.Em,searchNearby:rf.Lp,searchInBounds:rf.bn,search:rf.search});T(window,{BMAP_STATUS_SUCCESS:0,BMAP_STATUS_CITY_LIST:1,BMAP_STATUS_UNKNOWN_LOCATION:2,BMAP_STATUS_UNKNOWN_ROUTE:3,BMAP_STATUS_INVALID_KEY:4,BMAP_STATUS_INVALID_REQUEST:5,BMAP_STATUS_PERMISSION_DENIED:6,BMAP_STATUS_SERVICE_UNAVAILABLE:7,BMAP_STATUS_TIMEOUT:8}); T(window,{BMAP_POI_TYPE_NORMAL:0,BMAP_POI_TYPE_BUSSTOP:1,BMAP_POI_TYPE_BUSLINE:2,BMAP_POI_TYPE_SUBSTOP:3,BMAP_POI_TYPE_SUBLINE:4});T(window,{BMAP_TRANSIT_POLICY_LEAST_TIME:0,BMAP_TRANSIT_POLICY_LEAST_TRANSFER:2,BMAP_TRANSIT_POLICY_LEAST_WALKING:3,BMAP_TRANSIT_POLICY_AVOID_SUBWAYS:4,BMAP_LINE_TYPE_BUS:0,BMAP_LINE_TYPE_SUBWAY:1,BMAP_LINE_TYPE_FERRY:2});var sf=vd.prototype;T(sf,{clearResults:sf.Pe});xd=wd.prototype;T(xd,{setPolicy:xd.Wt,toString:xd.toString,setPageCapacity:xd.Pp}); T(window,{BMAP_DRIVING_POLICY_LEAST_TIME:0,BMAP_DRIVING_POLICY_LEAST_DISTANCE:1,BMAP_DRIVING_POLICY_AVOID_HIGHWAYS:2});T(window,{BMAP_MODE_DRIVING:"driving",BMAP_MODE_TRANSIT:"transit",BMAP_MODE_WALKING:"walking",BMAP_MODE_NAVIGATION:"navigation"});var tf=Ed.prototype;T(tf,{routeCall:tf.NN});T(window,{BMAP_HIGHLIGHT_STEP:1,BMAP_HIGHLIGHT_ROUTE:2});T(window,{BMAP_ROUTE_TYPE_DRIVING:ed,BMAP_ROUTE_TYPE_WALKING:dd});T(window,{BMAP_ROUTE_STATUS_NORMAL:id,BMAP_ROUTE_STATUS_EMPTY:1,BMAP_ROUTE_STATUS_ADDRESS:2}); var uf=zd.prototype;T(uf,{setPolicy:uf.Wt});var vf=Kd.prototype;T(vf,{show:vf.show,hide:vf.U,setTypes:vf.xF,setLocation:vf.gn,search:vf.search,setInputValue:vf.zy});T(lb.prototype,{});var wf=Id.prototype;T(wf,{get:wf.get});T(ac.prototype,{});T(bb.prototype,{});T(window,{BMAP_POINT_DENSITY_HIGH:200,BMAP_POINT_DENSITY_MEDIUM:Tc,BMAP_POINT_DENSITY_LOW:50});T(window,{BMAP_POINT_SHAPE_STAR:1,BMAP_POINT_SHAPE_WATERDROP:2,BMAP_POINT_SHAPE_CIRCLE:vc,BMAP_POINT_SHAPE_SQUARE:4,BMAP_POINT_SHAPE_RHOMBUS:5}); T(window,{BMAP_POINT_SIZE_TINY:1,BMAP_POINT_SIZE_SMALLER:2,BMAP_POINT_SIZE_SMALL:3,BMAP_POINT_SIZE_NORMAL:wc,BMAP_POINT_SIZE_BIG:5,BMAP_POINT_SIZE_BIGGER:6,BMAP_POINT_SIZE_HUGE:7}); T(window,{BMap_Symbol_SHAPE_CAMERA:11,BMap_Symbol_SHAPE_WARNING:12,BMap_Symbol_SHAPE_SMILE:13,BMap_Symbol_SHAPE_CLOCK:14,BMap_Symbol_SHAPE_POINT:9,BMap_Symbol_SHAPE_PLANE:10,BMap_Symbol_SHAPE_CIRCLE:1,BMap_Symbol_SHAPE_RECTANGLE:2,BMap_Symbol_SHAPE_RHOMBUS:3,BMap_Symbol_SHAPE_STAR:4,BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW:5,BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW:6,BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW:7,BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW:8});T(window,{BMAP_CONTEXT_MENU_ICON_ZOOMIN:dc,BMAP_CONTEXT_MENU_ICON_ZOOMOUT:ec}); T(window,{BMAP_SYS_DRAWER:Ia,BMAP_SVG_DRAWER:1,BMAP_VML_DRAWER:2,BMAP_CANVAS_DRAWER:3,BMAP_SVG_DRAWER_FIRST:4});z.XU(); })() \ No newline at end of file diff --git a/img/+.png b/img/+.png new file mode 100644 index 0000000..2692856 Binary files /dev/null and b/img/+.png differ diff --git a/img/1.png b/img/1.png new file mode 100644 index 0000000..afbdf1a Binary files /dev/null and b/img/1.png differ diff --git a/img/11223456.png b/img/11223456.png new file mode 100644 index 0000000..a1d0a42 Binary files /dev/null and b/img/11223456.png differ diff --git a/img/2.png b/img/2.png new file mode 100644 index 0000000..7cf548d Binary files /dev/null and b/img/2.png differ diff --git a/img/3.png b/img/3.png new file mode 100644 index 0000000..4e3cdfd Binary files /dev/null and b/img/3.png differ diff --git a/img/4.png b/img/4.png new file mode 100644 index 0000000..9896764 Binary files /dev/null and b/img/4.png differ diff --git a/img/5.png b/img/5.png new file mode 100644 index 0000000..b82284b Binary files /dev/null and b/img/5.png differ diff --git a/img/ac1111_title.png b/img/ac1111_title.png new file mode 100644 index 0000000..ba3da46 Binary files /dev/null and b/img/ac1111_title.png differ diff --git a/img/acbg1111.png b/img/acbg1111.png new file mode 100644 index 0000000..b82e389 Binary files /dev/null and b/img/acbg1111.png differ diff --git a/img/activity_jt.png b/img/activity_jt.png new file mode 100644 index 0000000..a3b79ae Binary files /dev/null and b/img/activity_jt.png differ diff --git a/img/adds_title_bg1.png b/img/adds_title_bg1.png new file mode 100644 index 0000000..677c906 Binary files /dev/null and b/img/adds_title_bg1.png differ diff --git a/img/adds_title_bg2.png b/img/adds_title_bg2.png new file mode 100644 index 0000000..1a29000 Binary files /dev/null and b/img/adds_title_bg2.png differ diff --git a/img/adds_title_bg3.png b/img/adds_title_bg3.png new file mode 100644 index 0000000..4828144 Binary files /dev/null and b/img/adds_title_bg3.png differ diff --git a/img/adds_title_bg4.png b/img/adds_title_bg4.png new file mode 100644 index 0000000..eb70330 Binary files /dev/null and b/img/adds_title_bg4.png differ diff --git a/img/adds_title_bg5.png b/img/adds_title_bg5.png new file mode 100644 index 0000000..0ab56e3 Binary files /dev/null and b/img/adds_title_bg5.png differ diff --git a/img/aixin.png b/img/aixin.png new file mode 100644 index 0000000..ea7b51f Binary files /dev/null and b/img/aixin.png differ diff --git a/img/banner_ectin.png b/img/banner_ectin.png new file mode 100644 index 0000000..0ff3186 Binary files /dev/null and b/img/banner_ectin.png differ diff --git a/img/be.png b/img/be.png new file mode 100644 index 0000000..7aa2dc1 Binary files /dev/null and b/img/be.png differ diff --git a/img/beiwang.png b/img/beiwang.png new file mode 100644 index 0000000..65f0f9c Binary files /dev/null and b/img/beiwang.png differ diff --git a/img/beiwanglu.png b/img/beiwanglu.png new file mode 100644 index 0000000..6cc5c31 Binary files /dev/null and b/img/beiwanglu.png differ diff --git a/img/bg_miaosha.png b/img/bg_miaosha.png new file mode 100644 index 0000000..b8fe5e9 Binary files /dev/null and b/img/bg_miaosha.png differ diff --git a/img/bg_pay_list.png b/img/bg_pay_list.png new file mode 100644 index 0000000..861a63b Binary files /dev/null and b/img/bg_pay_list.png differ diff --git a/img/bianji.png b/img/bianji.png new file mode 100644 index 0000000..882421b Binary files /dev/null and b/img/bianji.png differ diff --git a/img/bianji3.png b/img/bianji3.png new file mode 100644 index 0000000..e8de503 Binary files /dev/null and b/img/bianji3.png differ diff --git a/img/bianji9.png b/img/bianji9.png new file mode 100644 index 0000000..89b8a8d Binary files /dev/null and b/img/bianji9.png differ diff --git a/img/bianjiblack.png b/img/bianjiblack.png new file mode 100644 index 0000000..99a92a0 Binary files /dev/null and b/img/bianjiblack.png differ diff --git a/img/bianjihei.png b/img/bianjihei.png new file mode 100644 index 0000000..1014c4f Binary files /dev/null and b/img/bianjihei.png differ diff --git a/img/button.png b/img/button.png new file mode 100644 index 0000000..001037f Binary files /dev/null and b/img/button.png differ diff --git a/img/button2.png b/img/button2.png new file mode 100644 index 0000000..b0d50a6 Binary files /dev/null and b/img/button2.png differ diff --git a/img/cainixihuan.png b/img/cainixihuan.png new file mode 100644 index 0000000..e9f38a6 Binary files /dev/null and b/img/cainixihuan.png differ diff --git a/img/class.png b/img/class.png new file mode 100644 index 0000000..d6cd940 Binary files /dev/null and b/img/class.png differ diff --git a/img/classmenu.png b/img/classmenu.png new file mode 100644 index 0000000..89b1f97 Binary files /dev/null and b/img/classmenu.png differ diff --git a/img/close.png b/img/close.png new file mode 100644 index 0000000..5c61b74 Binary files /dev/null and b/img/close.png differ diff --git a/img/com.png b/img/com.png new file mode 100644 index 0000000..b1adb05 Binary files /dev/null and b/img/com.png differ diff --git a/img/common.js b/img/common.js new file mode 100644 index 0000000..422bc63 --- /dev/null +++ b/img/common.js @@ -0,0 +1,856 @@ +$(function() { + var act = "store_list"; + if (act == "store_list") { + $('#search ul.tab li span').eq(0).html('店铺'); + $('#search ul.tab li span').eq(1).html('商品'); + $('#search ul.tab li').eq(0).attr('act', 'store_list'); + $('#search-form').attr("action", HOMESITEURL+"/Storelist/index.html"); + + } + $('#search').hover(function() { + $('#search ul.tab li').eq(1).show(); + $('#search ul.tab li i').addClass('over').removeClass('arrow'); + }, function() { + $('#search ul.tab li').eq(1).hide(); + $('#search ul.tab li i').addClass('arrow').removeClass('over'); + }); + $('#search ul.tab li').eq(1).click(function() { + $(this).hide(); + if ($(this).find('span').html() == '店铺') { + $('#keyword').attr("placeholder", "请输入您要搜索的店铺关键字"); + $('#search ul.tab li span').eq(0).html('店铺'); + $('#search ul.tab li span').eq(1).html('商品'); + $('#search-form').attr("action", HOMESITEURL+"/Storelist/index.html"); + } else { + $('#keyword').attr('placeholder', '请输入您要搜索的商品关键字'); + $('#search ul.tab li span').eq(0).html('商品'); + $('#search ul.tab li span').eq(1).html('店铺'); + $('#search-form').attr("action", HOMESITEURL+"/Search/index.html"); + } + $("#keyword").focus(); + }); +}); +function drop_confirm(msg, url){ + if(confirm(msg)){ + window.location = url; + } +} +function ajax_confirm(msg, url){ + if(confirm(msg)){ + ajaxget(url); + } +} +function go(url){ + window.location = url; +} + + +/* 格式化金额 */ +function price_format(price){ + if(typeof(PRICE_FORMAT) == 'undefined'){ + PRICE_FORMAT = '¥%s'; + } + price = number_format(price, 2); +// return PRICE_FORMAT.replace('%s', price); + return price; +} +function number_format(num, ext){ + if(ext < 0){ + return num; + } + num = Number(num); + if(isNaN(num)){ + num = 0; + } + var _str = num.toString(); + var _arr = _str.split('.'); + var _int = _arr[0]; + var _flt = _arr[1]; + if(_str.indexOf('.') == -1){ + /* 找不到小数点,则添加 */ + if(ext == 0){ + return _str; + } + var _tmp = ''; + for(var i = 0; i < ext; i++){ + _tmp += '0'; + } + _str = _str + '.' + _tmp; + }else{ + if(_flt.length == ext){ + return _str; + } + /* 找得到小数点,则截取 */ + if(_flt.length > ext){ + _str = _str.substr(0, _str.length - (_flt.length - ext)); + if(ext == 0){ + _str = _int; + } + }else{ + for(var i = 0; i < ext - _flt.length; i++){ + _str += '0'; + } + } + } + + return _str; +} + +/* 火狐下取本地全路径 */ +function getFullPath(obj) +{ + if(obj) + { + //ie + if (window.navigator.userAgent.indexOf("MSIE")>=1) + { + obj.select(); + if(window.navigator.userAgent.indexOf("MSIE") == 25){ + obj.blur(); + } + return document.selection.createRange().text; + } + //firefox + else if(window.navigator.userAgent.indexOf("Firefox")>=1) + { + if(obj.files) + { + //return obj.files.item(0).getAsDataURL(); + return window.URL.createObjectURL(obj.files.item(0)); + } + return obj.value; + } + return obj.value; + } +} +/* 转化JS跳转中的 & */ +function transform_char(str) +{ + if(str.indexOf('&')) + { + str = str.replace(/&/g, "%26"); + } + return str; +} + +//图片垂直水平缩放裁切显示 +(function($){ + $.fn.VMiddleImg = function(options) { + var defaults={ + "width":null, + "height":null + }; + var opts = $.extend({},defaults,options); + return $(this).each(function() { + var $this = $(this); + var objHeight = $this.height(); //图片高度 + var objWidth = $this.width(); //图片宽度 + var parentHeight = opts.height||$this.parent().height(); //图片父容器高度 + var parentWidth = opts.width||$this.parent().width(); //图片父容器宽度 + var ratio = objHeight / objWidth; + if (objHeight > parentHeight && objWidth > parentWidth) { + if (objHeight > objWidth) { //赋值宽高 + $this.width(parentWidth); + $this.height(parentWidth * ratio); + } else { + $this.height(parentHeight); + $this.width(parentHeight / ratio); + } + objHeight = $this.height(); //重新获取宽高 + objWidth = $this.width(); + if (objHeight > objWidth) { + $this.css("top", (parentHeight - objHeight) / 2); + //定义top属性 + } else { + //定义left属性 + $this.css("left", (parentWidth - objWidth) / 2); + } + } + else { + if (objWidth > parentWidth) { + $this.css("left", (parentWidth - objWidth) / 2); + } + $this.css("top", (parentHeight - objHeight) / 2); + } + }); + }; +})(jQuery); +function DrawImage(ImgD,FitWidth,FitHeight){ + var image=new Image(); + image.src=ImgD.src; + if(image.width>0 && image.height>0) + { + if(image.width/image.height>= FitWidth/FitHeight) + { + if(image.width>FitWidth) + { + ImgD.width=FitWidth; + ImgD.height=(image.height*FitWidth)/image.width; + } + else + { + ImgD.width=image.width; + ImgD.height=image.height; + } + } + else + { + if(image.height>FitHeight) + { + ImgD.height=FitHeight; + ImgD.width=(image.width*FitHeight)/image.height; + } + else + { + ImgD.width=image.width; + ImgD.height=image.height; + } + } + } +} + +/** + * 浮动DIV定时显示提示信息,如操作成功, 失败等 + * @param string tips (提示的内容) + * @param int height 显示的信息距离浏览器顶部的高度 + * @param int time 显示的时间(按秒算), time > 0 + * @sample 点击 + * @sample 上面代码表示点击后显示操作成功3秒钟, 距离顶部100px + * @copyright ZhouHr 2010-08-27 + */ +function showTips( tips, height, time ){ + var windowWidth = document.documentElement.clientWidth; + var tipsDiv = '
' + tips + '
'; + + $( 'body' ).append( tipsDiv ); + $( 'div.tipsClass' ).css({ + 'top' : 200 + 'px', + 'left' : ( windowWidth / 2 ) - ( tips.length * 13 / 2 ) + 'px', + 'position' : 'fixed', + 'padding' : '20px 50px', + 'background': '#EAF2FB', + 'font-size' : 14 + 'px', + 'margin' : '0 auto', + 'text-align': 'center', + 'width' : 'auto', + 'color' : '#333', + 'border' : 'solid 1px #A8CAED', + 'opacity' : '0.90', + 'z-index' : '9999' + }).show(); + setTimeout( function(){$( 'div.tipsClass' ).fadeOut().remove();}, ( time * 1000 ) ); +} + +function trim(str) { + return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, ''); +} +//弹出框登录 +function login_dialog(){ + CUR_DIALOG = ajax_form('login','登录',HOMESITEURL+'/Login/login.html?inajax=1',360,1); +} + +/* 显示Ajax表单 */ +function ajax_form(id, title, url, width, model) +{ + if (!width) width = 480; + if (!model) model = 1; + var d = DialogManager.create(id); + d.setTitle(title); + d.setContents('ajax', url); + d.setWidth(width); + d.show('center',model); + return d; +} +//显示一个内容为自定义HTML内容的消息 +function html_form(id, title, _html, width, model) { + if (!width) width = 480; + if (!model) model = 0; + var d = DialogManager.create(id); + d.setTitle(title); + d.setContents(_html); + d.setWidth(width); + d.show('center',model); + return d; +} +//收藏店铺js +function collect_store(fav_id, jstype, jsobj) { + $.get(HOMESITEURL+'/Memberfavorites/checkLogin', function(result) { + if (result == '0') { + login_dialog(); + } else { + var url = HOMESITEURL+'/Memberfavorites/favoritesstore'; + $.getJSON(url, {'fid': fav_id}, function(data) { + if (data.done) { + showDialog(data.msg, 'succ', '', '', '', '', '', '', '', '', 2); + if (jstype == 'count') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html(parseInt($(this).text()) + 1); + }); + } + if (jstype == 'succ') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html("收藏成功"); + }); + } + if (jstype == 'store') { + $('[ds_store="' + fav_id + '"]').each(function() { + $(this).before(' '); + $(this).remove(); + }); + } + } + else + { + showDialog(data.msg, 'notice'); + } + }); + } + }); +} +//收藏商品js +function collect_goods(fav_id, jstype, jsobj) { + $.get(HOMESITEURL+'/Memberfavorites/checkLogin', function(result) { + if (result.done == '0') { + login_dialog(); + } else { + var url = HOMESITEURL+'/Memberfavorites/favoritesgoods'; + $.getJSON(url, {'fid': fav_id}, function(data) { + if (data.done) + { + showDialog(data.msg, 'succ', '', '', '', '', '', '', '', '', 2); + if (jstype == 'count') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html(parseInt($(this).text()) + 1); + }); + } + if (jstype == 'succ') { + $('[dstype="' + jsobj + '"]').each(function() { + $(this).html("收藏成功"); + }); + } + } + else + { + showDialog(data.msg, 'notice'); + } + }); + } + }); +} + +//加载购物车信息 +function load_cart_information() { + $.getJSON(HOMESITEURL + '/Cart/ajax_load', function(result) { + var obj = $('.header .user_menu .my-cart'); + var mini =$('#rtoolbar_cartlist'); + if (result) { + var html = ''; + if (result.cart_goods_num > 0) { + for (var i = 0; i < result['list'].length; i++) { + var goods = result['list'][i]; + html += '
' + goods['goods_name'] + '
'; + html += '
'; + html += '
'; + html += '
¥' + goods['goods_price'] + '×' + goods['goods_num'] + '
'; + html += '
删除
'; + html += "
"; + } + obj.find('.incart-goods').html(html); + obj.find('.incart-goods-box').perfectScrollbar('destroy'); + obj.find('.incart-goods-box').perfectScrollbar({suppressScrollX: true}); + html = "共" + result.cart_goods_num + "种商品  总计金额:¥" + result.cart_all_price + ""; + obj.find('.total-price').html(html); + mini.find('.total-price').html(html); + if (obj.find('.addcart-goods-num').size() == 0) { + obj.append('
0
'); + } + obj.find('.addcart-goods-num').html(result.cart_goods_num); + $('#rtoobar_cart_count').html(result.cart_goods_num).show(); + } else { + html = "
您的购物车中暂无商品,赶快选择心爱的商品吧!
"; + obj.find('.incart-goods').html(html); + mini.find('.total-price').html(html); + obj.find('.total-price').html(''); + $('.addcart-goods-num').remove(); + $('#rtoobar_cart_count').html('').hide(); + } + } + }); +} + +//头部删除购物车信息,登录前使用goods_id,登录后使用cart_id +function drop_topcart_item(cart_id, goods_id) { + $.getJSON(HOMESITEURL + '/Cart/del',{'cart_id': cart_id, 'goods_id': goods_id}, function(result) { + if (result.state == 'true') { + $("[ds_type='cart_item_"+cart_id+"']").remove(); + load_cart_information(); + } else { + alert(result.msg); + } + }); +} + +//加载最近浏览的商品 +function load_history_information(){ + $.getJSON(HOMESITEURL+'/Index/viewed_info.html', function(result){ + var obj = $('.header .user_menu .my-mall'); + if(result['m_id'] >0){ + if (typeof result['consult'] !== 'undefined') obj.find('#member_consult').html(result['consult']); + if (typeof result['consult'] !== 'undefined') obj.find('#member_voucher').html(result['voucher']); + } + var goods_id = 0; + var text_append = ''; + var n = 0; + if (typeof result['viewed_goods'] !== 'undefined') { + for (goods_id in result['viewed_goods']) { + var goods = result['viewed_goods'][goods_id]; + text_append += '
  • '+goods['goods_name']+''; + text_append += '
  • '; + n++; + if (n > 4) break; + } + } + if (text_append == '') text_append = '
  • 暂无商品
  • ';; + obj.find('.browse-history ul').html(text_append); + }); +} + +/* + * 弹出窗口 + */ +(function($) { + $.fn.ds_show_dialog = function(options) { + + var that = $(this); + var settings = $.extend({}, {width: 480, title: '', close_callback: function() {}}, options); + + var init_dialog = function(title) { + var _div = that; + that.addClass("dialog_wrapper"); + that.wrapInner(function(){ + return '
    '; + }); + that.wrapInner(function(){ + return '
    '; + }); + that.find('.dialog_body').prepend('

    '+settings.title+'X

    '); + that.append('
    '); + + $(".dialog_close_button").click(function(){ + settings.close_callback(); + _div.hide(); + }); + + that.draggable({handle: ".dialog_head"}); + }; + + if(!$(this).hasClass("dialog_wrapper")) { + init_dialog(settings.title); + } + settings.left = $(window).scrollLeft() + ($(window).width() - settings.width) / 2; + settings.top = ($(window).height() - $(this).height()) / 2; + $(this).attr("style","display:none; z-index: 1100; position: fixed; width: "+settings.width+"px; left: "+settings.left+"px; top: "+settings.top+"px;"); + $(this).show(); + + }; +})(jQuery); +/** + * Membership card + * + * + * Example: + * + * HTML part + * + * + * JAVASCRIPT part + * + * + * $('a[dstype="mcard"]').membershipCard(); + */ +(function($){ + $.fn.membershipCard = function(options){ + var defaults = { + type:'' + }; + options = $.extend(defaults,options); + return this.each(function(){ + var $this = $(this); + var data_str = $(this).attr('data-param');eval('data_str = '+data_str); + var _uri = HOMESITEURL+'/Membercard/index.html?callback=?&uid='+data_str.id+'&from='+options.type; + $this.qtip({ + content: { + text: 'Loading...', + ajax: { + url: _uri, + type: 'GET', + dataType: 'jsonp', + success: function(data) { + if(data){ + var _dl = $('
    '); + // sex + $('
    ').append('') + .append(''+data.name+''+(data.truename != ''?'('+data.truename+')':'')) + .appendTo(_dl); + // avatar + $('
    ') + .appendTo(_dl); + // info + var _info = ''; + if(typeof connect !== 'undefined' && connect === 1 && data.follow != 2){ + var class_html = 'chat_offline'; + var text_html = '离线'; + if (typeof user_list[data.id] !== 'undefined' && user_list[data.id]['online'] > 0 ) { + class_html = 'chat_online'; + text_html = '在线'; + } + _info += ''+text_html+''; + } + if(data.qq != ''){ + _info += ''; + } + if(data.ww != ''){ + _info += '点击这里给我发消息'; + } + if(_info == ''){ + _info = '--'; + } + var _ul = $('
      ').append('
    • 城市:'+((data.areainfo != null)?data.areainfo:'--')+'
    • ') + .append('
    • 生日:'+((data.birthday != null)?data.birthday:'--')+'
    • ') + .append('
    • 联系:'+_info+'
    • ').appendTo('
      ').parent().appendTo(_dl); + // ajax info + if(data.url != ''){ + $.getJSON(data.url+'/Membercard/mcard_info&uid='+data.id, function(d){ + if(d){ + eval('var msg = '+options.type+'_function(d);'); + msg.appendTo(_dl); + } + }); + data.url = ''; + } + + // bottom + var _bottom; + if(data.follow != 2){ + _bottom = $('
      '); + var _a; + if(data.follow == 1){ + $('') + .append('已关注') + .append('取消关注').find('a[dstype="nofollow"]').click(function(){ + onfollow($(this)); + }).end().appendTo(_bottom); + }else{ + $('') + .append('加关注').find('a[dstype="follow"]').click(function(){ + follow($(this)); + }).end().appendTo(_bottom); + } + $('').appendTo(_bottom); + } + + var _content = $('
      ').append(_dl).append(_bottom); + this.set('content.text', ' ');this.set('content.text', _content); + } + } + } + }, + position: { + viewport: $(window) + }, + hide: { + fixed: true, + delay: 300 + }, + style: 'qtip-wiki' + }); + }); + function follow(o){ + var data_str = o.parent().attr('data-param'); + eval( "data_str = "+data_str); + $.getJSON(HOMESITEURL+'/Membersnsfriend/addfollow.html?callback=?&mid='+data_str.mid, function(data){ + if(data){ + $('[dstype="follow-handle'+data_str.mid+'"]').html('已关注 取消关注').find('a[dstype="nofollow"]').click(function(){ + onfollow($(this)); + }); + } + }); + } + function onfollow(o){ + var data_str = o.parent().attr('data-param'); + eval( "data_str = "+data_str); + $.getJSON(HOMESITEURL+'/Membersnsfriend/delfollow.html?callback=?&mid='+data_str.mid, function(data){ + if(data){ + $('[dstype="follow-handle'+data_str.mid+'"]').html('加关注').find('a[dstype="follow"]').click(function(){ + follow($(this)); + }); + } + }); + } + function shop_function(d){ + return $('
      买家信用:'+((d.member_credit == 0)?'暂无信用':d.member_credit)+'
      '); + } + }; +})(jQuery); + + + + +(function($) { + $.fn.ds_region = function(options) { + var $region = $(this); + var settings = $.extend({}, { + area_id: 0, + region_span_class: "_region_value", + src: "cache", + show_deep: 0, + btn_style_html: "", + tip_type: "" + }, options); + settings.islast = false; + settings.selected_deep = 0; + settings.last_text = ""; + this.each(function() { + var $inputArea = $(this); + if ($inputArea.val() === "") { + initArea($inputArea) + } else { + var $region_span = $('' + $inputArea.val() + ""); + var $region_btn = $(''); + $inputArea.after($region_span); + $region_span.after($region_btn); + $region_btn.on("click", function() { + $region_span.remove(); + $region_btn.remove(); + initArea($inputArea) + }); + settings.islast = true + } + this.settings = settings; + if ($inputArea.val() && /^\d+$/.test($inputArea.val())) { + $.getJSON(HOMESITEURL + "/Index/json_area_show?area_id=" + $inputArea.val() + "&callback=?", function(data) { + $("#_area_span").html(data.text == null ? "无" : data.text) + }) + } + }); + + function initArea($inputArea) { + settings.$area = $(""); + $inputArea.before(settings.$area); + loadAreaArray(function() { + loadArea(settings.$area, settings.area_id) + }) + } + function loadArea($area, area_id) { + if ($area && ds_a[area_id].length > 0) { + var areas = []; + areas = ds_a[area_id]; + if (settings.tip_type && settings.last_text != "") { + $area.append("") + } else { + $area.append("") + } + for (i = 0; i < areas.length; i++) { + $area.append("") + } + settings.islast = false + } + $area.on("change", function() { + var region_value = "", + area_ids = [], + selected_deep = 1; + $(this).nextAll("select").remove(); + $region.parent().find("select").each(function() { + if ($(this).find("option:selected").val() != "") { + region_value += $(this).find("option:selected").text() + " "; + area_ids.push($(this).find("option:selected").val()) + } + }); + settings.selected_deep = area_ids.length; + settings.area_ids = area_ids.join(" "); + $region.val(region_value); + settings.area_id_1 = area_ids[0] ? area_ids[0] : ""; + settings.area_id_2 = area_ids[1] ? area_ids[1] : ""; + settings.area_id_3 = area_ids[2] ? area_ids[2] : ""; + settings.area_id_4 = area_ids[3] ? area_ids[3] : ""; + settings.last_text = $region.prevAll("select").find("option:selected").last().text(); + var area_id = settings.area_id = $(this).val(); + if ($('#_area_1').length > 0) $("#_area_1").val(settings.area_id_1); + if ($('#_area_2').length > 0) $("#_area_2").val(settings.area_id_2); + if ($('#_area_3').length > 0) $("#_area_3").val(settings.area_id_3); + if ($('#_area_4').length > 0) $("#_area_4").val(settings.area_id_4); + if ($('#_area').length > 0) $("#_area").val(settings.area_id); + if ($('#_areas').length > 0) $("#_areas").val(settings.area_ids); + if (settings.show_deep > 0 && $region.prevAll("select").size() == settings.show_deep) { + settings.islast = true; + if (typeof settings.last_click == 'function') { + settings.last_click(area_id); + } + return + } + if (area_id > 0) { + if (ds_a[area_id] && ds_a[area_id].length > 0) { + var $newArea = $(""); + $(this).after($newArea); + loadArea($newArea, area_id); + settings.islast = false + } else { + settings.islast = true; + if (typeof settings.last_click == 'function') { + settings.last_click(area_id); + } + } + } else { + settings.islast = false + } + if ($('#islast').length > 0) $("#islast").val(""); + }) + } + function loadAreaArray(callback) { + if (typeof ds_a === "undefined") { + $.getJSON(HOMESITEURL + "/Index/json_area.html?src=" + settings.src + "&callback=?", function(data) { + ds_a = data; + callback() + }) + } else { + callback() + } + } + if (typeof jQuery.validator != 'undefined') { + jQuery.validator.addMethod("checklast", function(value, element) { + return $(element).fetch('islast'); + }, "请将地区选择完整"); + } + }; + $.fn.fetch = function(k) { + var p; + this.each(function() { + if (this.settings) { + p = eval("this.settings." + k); + return false + } + }); + return p + } + + +})(jQuery); + +/* 加入购物车 */ +function addcart(goods_id, quantity, callbackfunc,dir) { + + var url = HOMESITEURL + '/Cart/add.html'; + quantity = parseInt(quantity); + $.getJSON(url, {'goods_id': goods_id, 'quantity': quantity}, function(data) { + if (data != null) { + if (data.state) { + if (callbackfunc) { + eval(callbackfunc + "(data)"); + } + // 头部加载购物车信息 + load_cart_information(); + $("#rtoolbar_cartlist").load(HOMESITEURL + '/Cart/ajax_load?type=html'); + if(dir) { + showDialog('添加购物车成功', 'succ', '', '', '', '', '', '', '', '', 2); + } + } else { + alert(data.msg); + } + } + }); +} + +function setCookie(name, value, days) { + var exp = new Date(); + exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000); + var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); + document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); +} +function getCookie(name) { + var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); + if (arr != null) { + return unescape(arr[2]); + return null; + } +} +function delCookie(name) { + var exp = new Date(); + exp.setTime(exp.getTime() - 1); + var cval = getCookie(name); + if (cval != null) { + document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); + } +} + + +(function($) { + $.show_ds_login = function(options) { + var settings = $.extend({}, {action:HOMESITEURL+'/Login/login.html?inajax=1', nchash:'', formhash:'' ,anchor:''}, options); + var login_dialog_html = $(''); + var ref_url = document.location.href; + login_dialog_html.append('
      ').find('form') + .append('') + .append('') + .append('') + .append('
      用户名
      ') + .append('
      密   码
      ') + .append('
      验证码
      不区分大小写
      ') + .append('') + .append('
      '); + + login_dialog_html.find('input[type="submit"]').click(function(){ + ajaxpost('ajax_login', '', '', 'onerror'); + }); + html_form("form_dialog_login", "登录", login_dialog_html, 360); + }; + $.fn.ds_login = function(options) { + return this.each(function() { + $(this).on('click',function(){ + $.show_ds_login(options); + return false; + }); + }); + }; + +})(jQuery); +(function($) { + $.fn.F_slider = function(options){ + var defaults = { + page : 1, + len : 0, // 滚动篇幅 + axis : 'y' // y为上下滚动,x为左右滚动 + } + var options = $.extend(defaults,options); + return this.each(function(){ + var $this = $(this); + var len = options.len; + var page = options.page; + if(options.axis == 'y'){ + var Val = $(this).find('.F-center').height(); + var Param = 'top'; + }else if(options.axis == 'x'){ + var Val = $(this).find('.F-center').parent().width(); + var Param = 'left'; + } + $this.find('.F-prev').click(function(){ + if( page == 1){ + eval("$this.find('.F-center').animate({"+Param+":'-=' + Val*(len-1)},'slow');"); + page=len; + }else{ + eval("$this.find('.F-center').animate({"+Param+":'+=' + Val},'slow');"); + page--; + } + }); + $this.find('.F-next').click(function(){ + if(page == len){ + eval("$this.find('.F-center').animate({"+Param+":0},'slow');"); + page=1; + }else{ + eval("$this.find('.F-center').animate({"+Param+":'-=' + Val},'show');"); + page++; + } + }); + }); + } +})(jQuery); diff --git a/img/cost1.png b/img/cost1.png new file mode 100644 index 0000000..8fc371d Binary files /dev/null and b/img/cost1.png differ diff --git a/img/cost2.png b/img/cost2.png new file mode 100644 index 0000000..192996b Binary files /dev/null and b/img/cost2.png differ diff --git a/img/cost3.png b/img/cost3.png new file mode 100644 index 0000000..83cc78c Binary files /dev/null and b/img/cost3.png differ diff --git a/img/cost_1.png b/img/cost_1.png new file mode 100644 index 0000000..9c4a3ec Binary files /dev/null and b/img/cost_1.png differ diff --git a/img/cost_2.png b/img/cost_2.png new file mode 100644 index 0000000..9cffa33 Binary files /dev/null and b/img/cost_2.png differ diff --git a/img/cost_3.png b/img/cost_3.png new file mode 100644 index 0000000..60bcad3 Binary files /dev/null and b/img/cost_3.png differ diff --git a/img/daifahuo.png b/img/daifahuo.png new file mode 100644 index 0000000..863e63b Binary files /dev/null and b/img/daifahuo.png differ diff --git a/img/daifukuan.png b/img/daifukuan.png new file mode 100644 index 0000000..015deab Binary files /dev/null and b/img/daifukuan.png differ diff --git a/img/daishouhuo.png b/img/daishouhuo.png new file mode 100644 index 0000000..e2f8b81 Binary files /dev/null and b/img/daishouhuo.png differ diff --git a/img/del.png b/img/del.png new file mode 100644 index 0000000..7034b71 Binary files /dev/null and b/img/del.png differ diff --git a/img/delete.png b/img/delete.png new file mode 100644 index 0000000..2317d05 Binary files /dev/null and b/img/delete.png differ diff --git a/img/dianhuaben.png b/img/dianhuaben.png new file mode 100644 index 0000000..f9c806e Binary files /dev/null and b/img/dianhuaben.png differ diff --git a/img/dianpu.png b/img/dianpu.png new file mode 100644 index 0000000..ce25335 Binary files /dev/null and b/img/dianpu.png differ diff --git a/img/dingwei1.png b/img/dingwei1.png new file mode 100644 index 0000000..894467e Binary files /dev/null and b/img/dingwei1.png differ diff --git a/img/dis_log.png b/img/dis_log.png new file mode 100644 index 0000000..5ea288b Binary files /dev/null and b/img/dis_log.png differ diff --git a/img/ditudingwei.png b/img/ditudingwei.png new file mode 100644 index 0000000..c21ddf3 Binary files /dev/null and b/img/ditudingwei.png differ diff --git a/img/dituzhibiao.png b/img/dituzhibiao.png new file mode 100644 index 0000000..7405911 Binary files /dev/null and b/img/dituzhibiao.png differ diff --git a/img/ect.png b/img/ect.png new file mode 100644 index 0000000..ce42779 Binary files /dev/null and b/img/ect.png differ diff --git a/img/ect_address.png b/img/ect_address.png new file mode 100644 index 0000000..9f4a1b7 Binary files /dev/null and b/img/ect_address.png differ diff --git a/img/ect_index_title.png b/img/ect_index_title.png new file mode 100644 index 0000000..5fc511c Binary files /dev/null and b/img/ect_index_title.png differ diff --git a/img/ect_list.png b/img/ect_list.png new file mode 100644 index 0000000..e85c7c4 Binary files /dev/null and b/img/ect_list.png differ diff --git a/img/ect_list1.png b/img/ect_list1.png new file mode 100644 index 0000000..cbaf087 Binary files /dev/null and b/img/ect_list1.png differ diff --git a/img/ect_list_bg.png b/img/ect_list_bg.png new file mode 100644 index 0000000..8e446b3 Binary files /dev/null and b/img/ect_list_bg.png differ diff --git a/img/ect_pre.png b/img/ect_pre.png new file mode 100644 index 0000000..aaa51e8 Binary files /dev/null and b/img/ect_pre.png differ diff --git a/img/ect_pre_log.png b/img/ect_pre_log.png new file mode 100644 index 0000000..2acb28a Binary files /dev/null and b/img/ect_pre_log.png differ diff --git a/img/ect_right.png b/img/ect_right.png new file mode 100644 index 0000000..a0f35a4 Binary files /dev/null and b/img/ect_right.png differ diff --git a/img/ect_setting.png b/img/ect_setting.png new file mode 100644 index 0000000..cab5d14 Binary files /dev/null and b/img/ect_setting.png differ diff --git a/img/ect_wall.png b/img/ect_wall.png new file mode 100644 index 0000000..412ddcd Binary files /dev/null and b/img/ect_wall.png differ diff --git a/img/ect_wall1.png b/img/ect_wall1.png new file mode 100644 index 0000000..d1bcbe8 Binary files /dev/null and b/img/ect_wall1.png differ diff --git a/img/eye.png b/img/eye.png new file mode 100644 index 0000000..987793c Binary files /dev/null and b/img/eye.png differ diff --git a/img/faxianhaohuo1.png b/img/faxianhaohuo1.png new file mode 100644 index 0000000..19690cf Binary files /dev/null and b/img/faxianhaohuo1.png differ diff --git a/img/feichangdapai.png b/img/feichangdapai.png new file mode 100644 index 0000000..1a45688 Binary files /dev/null and b/img/feichangdapai.png differ diff --git a/img/fenlei.png b/img/fenlei.png new file mode 100644 index 0000000..71404b1 Binary files /dev/null and b/img/fenlei.png differ diff --git a/img/fenx111.png b/img/fenx111.png new file mode 100644 index 0000000..b5175c6 Binary files /dev/null and b/img/fenx111.png differ diff --git a/img/god_bg.png b/img/god_bg.png new file mode 100644 index 0000000..b2a08eb Binary files /dev/null and b/img/god_bg.png differ diff --git a/img/god_rech.png b/img/god_rech.png new file mode 100644 index 0000000..d5a5c94 Binary files /dev/null and b/img/god_rech.png differ diff --git a/img/god_shop .png b/img/god_shop .png new file mode 100644 index 0000000..df50aeb Binary files /dev/null and b/img/god_shop .png differ diff --git a/img/god_shopp.png b/img/god_shopp.png new file mode 100644 index 0000000..82017ab Binary files /dev/null and b/img/god_shopp.png differ diff --git a/img/god_success.png b/img/god_success.png new file mode 100644 index 0000000..a639cfc Binary files /dev/null and b/img/god_success.png differ diff --git a/img/god_success_shop.png b/img/god_success_shop.png new file mode 100644 index 0000000..3450322 Binary files /dev/null and b/img/god_success_shop.png differ diff --git a/img/gothere.png b/img/gothere.png new file mode 100644 index 0000000..4418829 Binary files /dev/null and b/img/gothere.png differ diff --git a/img/gouwuche.png b/img/gouwuche.png new file mode 100644 index 0000000..ab3d5fd Binary files /dev/null and b/img/gouwuche.png differ diff --git a/img/gouwuquan.png b/img/gouwuquan.png new file mode 100644 index 0000000..b0a622a Binary files /dev/null and b/img/gouwuquan.png differ diff --git a/img/guangshangchang.png b/img/guangshangchang.png new file mode 100644 index 0000000..f77d165 Binary files /dev/null and b/img/guangshangchang.png differ diff --git a/img/guangshangchang1.png b/img/guangshangchang1.png new file mode 100644 index 0000000..030115c Binary files /dev/null and b/img/guangshangchang1.png differ diff --git a/img/haitunlogo.png b/img/haitunlogo.png new file mode 100644 index 0000000..e65aed0 Binary files /dev/null and b/img/haitunlogo.png differ diff --git a/img/heart.png b/img/heart.png new file mode 100644 index 0000000..e3f7502 Binary files /dev/null and b/img/heart.png differ diff --git a/img/hot_title.png b/img/hot_title.png new file mode 100644 index 0000000..9af2846 Binary files /dev/null and b/img/hot_title.png differ diff --git a/img/hui.png b/img/hui.png new file mode 100644 index 0000000..6ff51b4 Binary files /dev/null and b/img/hui.png differ diff --git a/img/hukou.jpg b/img/hukou.jpg new file mode 100644 index 0000000..ea30840 Binary files /dev/null and b/img/hukou.jpg differ diff --git a/img/icon-test-copy.png b/img/icon-test-copy.png new file mode 100644 index 0000000..084311f Binary files /dev/null and b/img/icon-test-copy.png differ diff --git a/img/icon_1.png b/img/icon_1.png new file mode 100644 index 0000000..f902a4c Binary files /dev/null and b/img/icon_1.png differ diff --git a/img/icon_10.png b/img/icon_10.png new file mode 100644 index 0000000..775d937 Binary files /dev/null and b/img/icon_10.png differ diff --git a/img/icon_2.png b/img/icon_2.png new file mode 100644 index 0000000..64b5688 Binary files /dev/null and b/img/icon_2.png differ diff --git a/img/icon_3.png b/img/icon_3.png new file mode 100644 index 0000000..d8ebdae Binary files /dev/null and b/img/icon_3.png differ diff --git a/img/icon_4.png b/img/icon_4.png new file mode 100644 index 0000000..6b07842 Binary files /dev/null and b/img/icon_4.png differ diff --git a/img/icon_5.png b/img/icon_5.png new file mode 100644 index 0000000..90dd6b3 Binary files /dev/null and b/img/icon_5.png differ diff --git a/img/icon_6.png b/img/icon_6.png new file mode 100644 index 0000000..0d986b4 Binary files /dev/null and b/img/icon_6.png differ diff --git a/img/icon_7.png b/img/icon_7.png new file mode 100644 index 0000000..dc4568c Binary files /dev/null and b/img/icon_7.png differ diff --git a/img/icon_8.png b/img/icon_8.png new file mode 100644 index 0000000..2a91b77 Binary files /dev/null and b/img/icon_8.png differ diff --git a/img/icon_9.png b/img/icon_9.png new file mode 100644 index 0000000..862e615 Binary files /dev/null and b/img/icon_9.png differ diff --git a/img/icon_ac1111left.png b/img/icon_ac1111left.png new file mode 100644 index 0000000..9b6be41 Binary files /dev/null and b/img/icon_ac1111left.png differ diff --git a/img/icon_ac1111right.png b/img/icon_ac1111right.png new file mode 100644 index 0000000..d46c791 Binary files /dev/null and b/img/icon_ac1111right.png differ diff --git a/img/icon_back.png b/img/icon_back.png new file mode 100644 index 0000000..18543c8 Binary files /dev/null and b/img/icon_back.png differ diff --git a/img/icon_car.png b/img/icon_car.png new file mode 100644 index 0000000..50a99b2 Binary files /dev/null and b/img/icon_car.png differ diff --git a/img/icon_check0.png b/img/icon_check0.png new file mode 100644 index 0000000..ce6f490 Binary files /dev/null and b/img/icon_check0.png differ diff --git a/img/icon_check1.png b/img/icon_check1.png new file mode 100644 index 0000000..642610f Binary files /dev/null and b/img/icon_check1.png differ diff --git a/img/icon_clock.png b/img/icon_clock.png new file mode 100644 index 0000000..8233151 Binary files /dev/null and b/img/icon_clock.png differ diff --git a/img/icon_close.png b/img/icon_close.png new file mode 100644 index 0000000..22a98c8 Binary files /dev/null and b/img/icon_close.png differ diff --git a/img/icon_down.png b/img/icon_down.png new file mode 100644 index 0000000..d1c62f7 Binary files /dev/null and b/img/icon_down.png differ diff --git a/img/icon_ect111111.png b/img/icon_ect111111.png new file mode 100644 index 0000000..0bd5229 Binary files /dev/null and b/img/icon_ect111111.png differ diff --git a/img/icon_eye.png b/img/icon_eye.png new file mode 100644 index 0000000..f644dd5 Binary files /dev/null and b/img/icon_eye.png differ diff --git a/img/icon_juzitoutiao.png b/img/icon_juzitoutiao.png new file mode 100644 index 0000000..de7d7fc Binary files /dev/null and b/img/icon_juzitoutiao.png differ diff --git a/img/icon_market.png b/img/icon_market.png new file mode 100644 index 0000000..92ad65b Binary files /dev/null and b/img/icon_market.png differ diff --git a/img/icon_menu.png b/img/icon_menu.png new file mode 100644 index 0000000..ebb7e71 Binary files /dev/null and b/img/icon_menu.png differ diff --git a/img/icon_more.png b/img/icon_more.png new file mode 100644 index 0000000..dcebe09 Binary files /dev/null and b/img/icon_more.png differ diff --git a/img/icon_msg.png b/img/icon_msg.png new file mode 100644 index 0000000..b357990 Binary files /dev/null and b/img/icon_msg.png differ diff --git a/img/icon_msg1.png b/img/icon_msg1.png new file mode 100644 index 0000000..17bcd63 Binary files /dev/null and b/img/icon_msg1.png differ diff --git a/img/icon_phone1.png b/img/icon_phone1.png new file mode 100644 index 0000000..d35ffdc Binary files /dev/null and b/img/icon_phone1.png differ diff --git a/img/icon_photo.png b/img/icon_photo.png new file mode 100644 index 0000000..9daa35f Binary files /dev/null and b/img/icon_photo.png differ diff --git a/img/icon_pwd1.png b/img/icon_pwd1.png new file mode 100644 index 0000000..e9cc9f3 Binary files /dev/null and b/img/icon_pwd1.png differ diff --git a/img/icon_right.png b/img/icon_right.png new file mode 100644 index 0000000..6967dfb Binary files /dev/null and b/img/icon_right.png differ diff --git a/img/icon_rocket.png b/img/icon_rocket.png new file mode 100644 index 0000000..747c89d Binary files /dev/null and b/img/icon_rocket.png differ diff --git a/img/icon_s.png b/img/icon_s.png new file mode 100644 index 0000000..1ba8288 Binary files /dev/null and b/img/icon_s.png differ diff --git a/img/icon_search.png b/img/icon_search.png new file mode 100644 index 0000000..ed1e671 Binary files /dev/null and b/img/icon_search.png differ diff --git a/img/icon_search1.png b/img/icon_search1.png new file mode 100644 index 0000000..d0398f2 Binary files /dev/null and b/img/icon_search1.png differ diff --git a/img/icon_select.png b/img/icon_select.png new file mode 100644 index 0000000..fce1a0d Binary files /dev/null and b/img/icon_select.png differ diff --git a/img/icon_select1.png b/img/icon_select1.png new file mode 100644 index 0000000..a2c32eb Binary files /dev/null and b/img/icon_select1.png differ diff --git a/img/icon_shop.png b/img/icon_shop.png new file mode 100644 index 0000000..f5212f2 Binary files /dev/null and b/img/icon_shop.png differ diff --git a/img/icon_smjd.png b/img/icon_smjd.png new file mode 100644 index 0000000..548e11d Binary files /dev/null and b/img/icon_smjd.png differ diff --git a/img/icon_sscl.png b/img/icon_sscl.png new file mode 100644 index 0000000..8926f43 Binary files /dev/null and b/img/icon_sscl.png differ diff --git a/img/icon_star.png b/img/icon_star.png new file mode 100644 index 0000000..a99aea5 Binary files /dev/null and b/img/icon_star.png differ diff --git a/img/icon_user1.png b/img/icon_user1.png new file mode 100644 index 0000000..96904f8 Binary files /dev/null and b/img/icon_user1.png differ diff --git a/img/icon_ziying.png b/img/icon_ziying.png new file mode 100644 index 0000000..adb1bfe Binary files /dev/null and b/img/icon_ziying.png differ diff --git a/img/icon_zy1.png b/img/icon_zy1.png new file mode 100644 index 0000000..a6079b6 Binary files /dev/null and b/img/icon_zy1.png differ diff --git a/img/icon_zy2.png b/img/icon_zy2.png new file mode 100644 index 0000000..cb2846f Binary files /dev/null and b/img/icon_zy2.png differ diff --git a/img/icon_zy3.png b/img/icon_zy3.png new file mode 100644 index 0000000..9768b37 Binary files /dev/null and b/img/icon_zy3.png differ diff --git a/img/icon_zy4.png b/img/icon_zy4.png new file mode 100644 index 0000000..d247d98 Binary files /dev/null and b/img/icon_zy4.png differ diff --git a/img/icon_zy5.png b/img/icon_zy5.png new file mode 100644 index 0000000..775d937 Binary files /dev/null and b/img/icon_zy5.png differ diff --git a/img/imail.png b/img/imail.png new file mode 100644 index 0000000..b48b215 Binary files /dev/null and b/img/imail.png differ diff --git a/img/imail2.png b/img/imail2.png new file mode 100644 index 0000000..890e860 Binary files /dev/null and b/img/imail2.png differ diff --git a/img/img_white.png b/img/img_white.png new file mode 100644 index 0000000..8f542b5 Binary files /dev/null and b/img/img_white.png differ diff --git a/img/jia.png b/img/jia.png new file mode 100644 index 0000000..d3e7f88 Binary files /dev/null and b/img/jia.png differ diff --git a/img/jian.png b/img/jian.png new file mode 100644 index 0000000..978f9e1 Binary files /dev/null and b/img/jian.png differ diff --git a/img/jifen.png b/img/jifen.png new file mode 100644 index 0000000..db88270 Binary files /dev/null and b/img/jifen.png differ diff --git a/img/jingpintuijian.png b/img/jingpintuijian.png new file mode 100644 index 0000000..ba069ca Binary files /dev/null and b/img/jingpintuijian.png differ diff --git a/img/juan.png b/img/juan.png new file mode 100644 index 0000000..3361ef6 Binary files /dev/null and b/img/juan.png differ diff --git a/img/juan_yes.png b/img/juan_yes.png new file mode 100644 index 0000000..47d536d Binary files /dev/null and b/img/juan_yes.png differ diff --git a/img/jxyh.png b/img/jxyh.png new file mode 100644 index 0000000..df0e2da Binary files /dev/null and b/img/jxyh.png differ diff --git a/img/kaidian.png b/img/kaidian.png new file mode 100644 index 0000000..280e434 Binary files /dev/null and b/img/kaidian.png differ diff --git a/img/kong.png b/img/kong.png new file mode 100644 index 0000000..2f2fb0a Binary files /dev/null and b/img/kong.png differ diff --git a/img/lianxishangjia4.png b/img/lianxishangjia4.png new file mode 100644 index 0000000..cf2d58d Binary files /dev/null and b/img/lianxishangjia4.png differ diff --git a/img/likelogo.png b/img/likelogo.png new file mode 100644 index 0000000..7b92f60 Binary files /dev/null and b/img/likelogo.png differ diff --git a/img/likelogo1.png b/img/likelogo1.png new file mode 100644 index 0000000..4ec90cd Binary files /dev/null and b/img/likelogo1.png differ diff --git a/img/likelogoon.png b/img/likelogoon.png new file mode 100644 index 0000000..23a351e Binary files /dev/null and b/img/likelogoon.png differ diff --git a/img/loginbg.jpg b/img/loginbg.jpg new file mode 100644 index 0000000..5a0667e Binary files /dev/null and b/img/loginbg.jpg differ diff --git a/img/marker_red_sprite.png b/img/marker_red_sprite.png new file mode 100644 index 0000000..38a5900 Binary files /dev/null and b/img/marker_red_sprite.png differ diff --git a/img/meirigengxin.png b/img/meirigengxin.png new file mode 100644 index 0000000..ad6093a Binary files /dev/null and b/img/meirigengxin.png differ diff --git a/img/menu.png b/img/menu.png new file mode 100644 index 0000000..c2fdad5 Binary files /dev/null and b/img/menu.png differ diff --git a/img/menu_dian.png b/img/menu_dian.png new file mode 100644 index 0000000..d5b22cb Binary files /dev/null and b/img/menu_dian.png differ diff --git a/img/miaoshabg.png b/img/miaoshabg.png new file mode 100644 index 0000000..9cbbc67 Binary files /dev/null and b/img/miaoshabg.png differ diff --git a/img/ms_1.png b/img/ms_1.png new file mode 100644 index 0000000..80d1046 Binary files /dev/null and b/img/ms_1.png differ diff --git a/img/mu.png b/img/mu.png new file mode 100644 index 0000000..c67d9f5 Binary files /dev/null and b/img/mu.png differ diff --git a/img/muji_quan.png b/img/muji_quan.png new file mode 100644 index 0000000..412d13d Binary files /dev/null and b/img/muji_quan.png differ diff --git a/img/mujiimg.png b/img/mujiimg.png new file mode 100644 index 0000000..786f447 Binary files /dev/null and b/img/mujiimg.png differ diff --git a/img/my_bg.png b/img/my_bg.png new file mode 100644 index 0000000..8324793 Binary files /dev/null and b/img/my_bg.png differ diff --git a/img/nav_0_0.png b/img/nav_0_0.png new file mode 100644 index 0000000..d103a21 Binary files /dev/null and b/img/nav_0_0.png differ diff --git a/img/nav_0_1.png b/img/nav_0_1.png new file mode 100644 index 0000000..2feb77e Binary files /dev/null and b/img/nav_0_1.png differ diff --git a/img/nav_1_0.png b/img/nav_1_0.png new file mode 100644 index 0000000..e464d39 Binary files /dev/null and b/img/nav_1_0.png differ diff --git a/img/nav_1_1.png b/img/nav_1_1.png new file mode 100644 index 0000000..dc4020d Binary files /dev/null and b/img/nav_1_1.png differ diff --git a/img/nav_2_0.png b/img/nav_2_0.png new file mode 100644 index 0000000..e934c11 Binary files /dev/null and b/img/nav_2_0.png differ diff --git a/img/nav_2_1.png b/img/nav_2_1.png new file mode 100644 index 0000000..0c8f55c Binary files /dev/null and b/img/nav_2_1.png differ diff --git a/img/nav_2_in.png b/img/nav_2_in.png new file mode 100644 index 0000000..2f3756b Binary files /dev/null and b/img/nav_2_in.png differ diff --git a/img/nav_2_out.png b/img/nav_2_out.png new file mode 100644 index 0000000..65fb7a6 Binary files /dev/null and b/img/nav_2_out.png differ diff --git a/img/nav_3_0.png b/img/nav_3_0.png new file mode 100644 index 0000000..b248ab6 Binary files /dev/null and b/img/nav_3_0.png differ diff --git a/img/nav_3_1.png b/img/nav_3_1.png new file mode 100644 index 0000000..cb83e88 Binary files /dev/null and b/img/nav_3_1.png differ diff --git a/img/nav_4_0.png b/img/nav_4_0.png new file mode 100644 index 0000000..df8746a Binary files /dev/null and b/img/nav_4_0.png differ diff --git a/img/nav_4_1.png b/img/nav_4_1.png new file mode 100644 index 0000000..d1324cd Binary files /dev/null and b/img/nav_4_1.png differ diff --git a/img/news_title.png b/img/news_title.png new file mode 100644 index 0000000..9b91b3c Binary files /dev/null and b/img/news_title.png differ diff --git a/img/next_title.png b/img/next_title.png new file mode 100644 index 0000000..2951625 Binary files /dev/null and b/img/next_title.png differ diff --git a/img/oc_logo1.png b/img/oc_logo1.png new file mode 100644 index 0000000..9e1f15c Binary files /dev/null and b/img/oc_logo1.png differ diff --git a/img/oc_logo2.png b/img/oc_logo2.png new file mode 100644 index 0000000..0e2095c Binary files /dev/null and b/img/oc_logo2.png differ diff --git a/img/oc_logo3.png b/img/oc_logo3.png new file mode 100644 index 0000000..2601d41 Binary files /dev/null and b/img/oc_logo3.png differ diff --git a/img/oc_logo4.png b/img/oc_logo4.png new file mode 100644 index 0000000..17440c5 Binary files /dev/null and b/img/oc_logo4.png differ diff --git a/img/oc_shop.png b/img/oc_shop.png new file mode 100644 index 0000000..aa8d05b Binary files /dev/null and b/img/oc_shop.png differ diff --git a/img/order-icons.png b/img/order-icons.png new file mode 100644 index 0000000..6c083df Binary files /dev/null and b/img/order-icons.png differ diff --git a/img/orderdetail.png b/img/orderdetail.png new file mode 100644 index 0000000..7d667ce Binary files /dev/null and b/img/orderdetail.png differ diff --git a/img/paihangbang.png b/img/paihangbang.png new file mode 100644 index 0000000..30b6be5 Binary files /dev/null and b/img/paihangbang.png differ diff --git a/img/pengyou.png b/img/pengyou.png new file mode 100644 index 0000000..e162113 Binary files /dev/null and b/img/pengyou.png differ diff --git a/img/phone1.png b/img/phone1.png new file mode 100644 index 0000000..66bf91e Binary files /dev/null and b/img/phone1.png differ diff --git a/img/pingjia.png b/img/pingjia.png new file mode 100644 index 0000000..f5ff9b2 Binary files /dev/null and b/img/pingjia.png differ diff --git a/img/pingpaijie.png b/img/pingpaijie.png new file mode 100644 index 0000000..332b37f Binary files /dev/null and b/img/pingpaijie.png differ diff --git a/img/pingzheng.png b/img/pingzheng.png new file mode 100644 index 0000000..73470ba Binary files /dev/null and b/img/pingzheng.png differ diff --git a/img/pingzheng1.png b/img/pingzheng1.png new file mode 100644 index 0000000..73d6753 Binary files /dev/null and b/img/pingzheng1.png differ diff --git a/img/pingzheng2.png b/img/pingzheng2.png new file mode 100644 index 0000000..ce4b322 Binary files /dev/null and b/img/pingzheng2.png differ diff --git a/img/pingzheng3.png b/img/pingzheng3.png new file mode 100644 index 0000000..4acdd53 Binary files /dev/null and b/img/pingzheng3.png differ diff --git a/img/pingzheng4.png b/img/pingzheng4.png new file mode 100644 index 0000000..64d459b Binary files /dev/null and b/img/pingzheng4.png differ diff --git a/img/pinzhishishang.png b/img/pinzhishishang.png new file mode 100644 index 0000000..f2013d1 Binary files /dev/null and b/img/pinzhishishang.png differ diff --git a/img/pjhx.png b/img/pjhx.png new file mode 100644 index 0000000..77b8f7c Binary files /dev/null and b/img/pjhx.png differ diff --git a/img/pjhx1.png b/img/pjhx1.png new file mode 100644 index 0000000..0e88ee8 Binary files /dev/null and b/img/pjhx1.png differ diff --git a/img/pjimg.png b/img/pjimg.png new file mode 100644 index 0000000..2c322cf Binary files /dev/null and b/img/pjimg.png differ diff --git a/img/pos.png b/img/pos.png new file mode 100644 index 0000000..b792abb Binary files /dev/null and b/img/pos.png differ diff --git a/img/qidong_bg.jpg b/img/qidong_bg.jpg new file mode 100644 index 0000000..0d5b81e Binary files /dev/null and b/img/qidong_bg.jpg differ diff --git a/img/recommend.png b/img/recommend.png new file mode 100644 index 0000000..6e67725 Binary files /dev/null and b/img/recommend.png differ diff --git a/img/recommend_title1.png b/img/recommend_title1.png new file mode 100644 index 0000000..45f2b66 Binary files /dev/null and b/img/recommend_title1.png differ diff --git a/img/recommend_title2.png b/img/recommend_title2.png new file mode 100644 index 0000000..96d050a Binary files /dev/null and b/img/recommend_title2.png differ diff --git a/img/recommend_title3.png b/img/recommend_title3.png new file mode 100644 index 0000000..b73ba14 Binary files /dev/null and b/img/recommend_title3.png differ diff --git a/img/renzheng.png b/img/renzheng.png new file mode 100644 index 0000000..e025abd Binary files /dev/null and b/img/renzheng.png differ diff --git a/img/renzheng1.png b/img/renzheng1.png new file mode 100644 index 0000000..e0a7e6d Binary files /dev/null and b/img/renzheng1.png differ diff --git a/img/sanjiaoshang.png b/img/sanjiaoshang.png new file mode 100644 index 0000000..4a2fd37 Binary files /dev/null and b/img/sanjiaoshang.png differ diff --git a/img/sanjiaoxia.png b/img/sanjiaoxia.png new file mode 100644 index 0000000..72b9284 Binary files /dev/null and b/img/sanjiaoxia.png differ diff --git a/img/saoyisao.png b/img/saoyisao.png new file mode 100644 index 0000000..73f8324 Binary files /dev/null and b/img/saoyisao.png differ diff --git a/img/saoyisao1.png b/img/saoyisao1.png new file mode 100644 index 0000000..47c3f73 Binary files /dev/null and b/img/saoyisao1.png differ diff --git a/img/saved_resource b/img/saved_resource new file mode 100644 index 0000000..14af93b Binary files /dev/null and b/img/saved_resource differ diff --git a/img/saved_resource(1) b/img/saved_resource(1) new file mode 100644 index 0000000..49d027a Binary files /dev/null and b/img/saved_resource(1) differ diff --git a/img/saved_resource(2) b/img/saved_resource(2) new file mode 100644 index 0000000..f29fe5e Binary files /dev/null and b/img/saved_resource(2) differ diff --git a/img/saved_resource(3) b/img/saved_resource(3) new file mode 100644 index 0000000..98c41b1 Binary files /dev/null and b/img/saved_resource(3) differ diff --git a/img/saved_resource(4) b/img/saved_resource(4) new file mode 100644 index 0000000..9adc626 Binary files /dev/null and b/img/saved_resource(4) differ diff --git a/img/saved_resource(5) b/img/saved_resource(5) new file mode 100644 index 0000000..6af7a85 Binary files /dev/null and b/img/saved_resource(5) differ diff --git a/img/search1.png b/img/search1.png new file mode 100644 index 0000000..d0398f2 Binary files /dev/null and b/img/search1.png differ diff --git a/img/send.png b/img/send.png new file mode 100644 index 0000000..724bf63 Binary files /dev/null and b/img/send.png differ diff --git a/img/setting.png b/img/setting.png new file mode 100644 index 0000000..2a94a63 Binary files /dev/null and b/img/setting.png differ diff --git a/img/setting_lock1.png b/img/setting_lock1.png new file mode 100644 index 0000000..d8bd133 Binary files /dev/null and b/img/setting_lock1.png differ diff --git a/img/setting_user1.png b/img/setting_user1.png new file mode 100644 index 0000000..3b993b2 Binary files /dev/null and b/img/setting_user1.png differ diff --git a/img/shangchang.png b/img/shangchang.png new file mode 100644 index 0000000..804f70a Binary files /dev/null and b/img/shangchang.png differ diff --git a/img/shangchangkefu.png b/img/shangchangkefu.png new file mode 100644 index 0000000..e545578 Binary files /dev/null and b/img/shangchangkefu.png differ diff --git a/img/shangxin.png b/img/shangxin.png new file mode 100644 index 0000000..3235ea8 Binary files /dev/null and b/img/shangxin.png differ diff --git a/img/share.png b/img/share.png new file mode 100644 index 0000000..93a15b8 Binary files /dev/null and b/img/share.png differ diff --git a/img/shoplogo.png b/img/shoplogo.png new file mode 100644 index 0000000..f2bfc4a Binary files /dev/null and b/img/shoplogo.png differ diff --git a/img/site_logo.png b/img/site_logo.png new file mode 100644 index 0000000..8e02cac --- /dev/null +++ b/img/site_logo.png @@ -0,0 +1,1230 @@ + + + + + System Error + + + + + +
      +
      +
      +
      + +
      +
      +

      [0] HttpException in App.php line 361

      +
      +

      模块不存在:uploads

      +
      + +
      +
      +
      1. +
      2. // 模块初始化 +
      3. if ($module && $available) { +
      4. // 初始化模块 +
      5. $request->module($module); +
      6. $config = self::init($module); +
      7. // 模块请求缓存检查 +
      8. $request->cache($config['request_cache'], $config['request_cache_expire'], $config['request_cache_except']); +
      9. } else { +
      10. throw new HttpException(404, 'module not exists:' . $module); +
      11. } +
      12. } else { +
      13. // 单一模块部署 +
      14. $module = ''; +
      15. $request->module($module); +
      16. } +
      17. // 当前模块路径 +
      18. App::$modulePath = APP_PATH . ($module ? $module . DS : ''); +
      19. +
      +
      +
      +

      Call Stack

      +
        +
      1. in App.php line 361
      2. +
      3. + at App::module(['uploads', 'home', 'common'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], null) in App.php line 296
      4. +
      5. + at App::exec(['type' => 'module', 'module' => ['uploads', 'home', 'common']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 124
      6. +
      7. + at App::run() in start.php line 18
      8. +
      9. + at require('D:\wwwroot\mall\thin...') in index.php line 19
      10. +
      +
      +
      + + +
      +

      Environment Variables

      +
      +
      +
      GET Data
      +
      empty
      +
      +
      +
      +
      +
      POST Data
      +
      empty
      +
      +
      +
      +
      +
      Files
      +
      empty
      +
      +
      +
      +

      Cookies

      +
      +
      +
      PHPSESSID
      +
      + 3c22e0jntkb2jncja6vlefne6n
      +
      +
      +
      __guid
      +
      + 155745575.1562149503273026300.1548253012647.3384
      +
      +
      +
      cart_goods_num
      +
      + 0
      +
      +
      +
      msgnewnum1
      +
      + 3
      +
      +
      +
      username
      +
      + fuhuigou
      +
      +
      +
      key
      +
      + f7b4b5e4248a2e99042cd20c5b1af10c
      +
      +
      +
      cart_count
      +
      + 0
      +
      +
      +
      msgnewnum381
      +
      + 23
      +
      +
      +
      monitor_count
      +
      + 52
      +
      +
      +
      +
      +
      +
      Session
      +
      empty
      +
      +
      +
      +

      Server/Request Data

      +
      +
      +
      PATH
      +
      + C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\TortoiseSVN\bin;D:\Program Files\nodejs\;d:\Program Files\Git\cmd;C:\Users\63003\AppData\Local\Microsoft\WindowsApps;C:\Users\63003\AppData\Roaming\npm
      +
      +
      +
      SYSTEMROOT
      +
      + C:\Windows
      +
      +
      +
      COMSPEC
      +
      + C:\Windows\system32\cmd.exe
      +
      +
      +
      PATHEXT
      +
      + .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
      +
      +
      +
      WINDIR
      +
      + C:\Windows
      +
      +
      +
      PHP_FCGI_MAX_REQUESTS
      +
      + 1000
      +
      +
      +
      PHPRC
      +
      + D:/phpStudy/PHPTutorial/php/php-7.0.12-nts/
      +
      +
      +
      _FCGI_SHUTDOWN_EVENT_
      +
      + 2248
      +
      +
      +
      SCRIPT_NAME
      +
      + /index.php
      +
      +
      +
      REQUEST_URI
      +
      + /uploads/home/common/site_logo.png
      +
      +
      +
      QUERY_STRING
      +
      +
      +
      +
      +
      REQUEST_METHOD
      +
      + GET
      +
      +
      +
      SERVER_PROTOCOL
      +
      + HTTP/1.1
      +
      +
      +
      GATEWAY_INTERFACE
      +
      + CGI/1.1
      +
      +
      +
      REDIRECT_URL
      +
      + /uploads/home/common/site_logo.png
      +
      +
      +
      REMOTE_PORT
      +
      + 64728
      +
      +
      +
      SCRIPT_FILENAME
      +
      + D:/wwwroot/mall/public/index.php
      +
      +
      +
      SERVER_ADMIN
      +
      + admin@php.cn
      +
      +
      +
      CONTEXT_DOCUMENT_ROOT
      +
      + D:/wwwroot/mall/public
      +
      +
      +
      CONTEXT_PREFIX
      +
      +
      +
      +
      +
      REQUEST_SCHEME
      +
      + http
      +
      +
      +
      DOCUMENT_ROOT
      +
      + D:/wwwroot/mall/public
      +
      +
      +
      REMOTE_ADDR
      +
      + 127.0.0.1
      +
      +
      +
      SERVER_PORT
      +
      + 80
      +
      +
      +
      SERVER_ADDR
      +
      + 127.0.0.1
      +
      +
      +
      SERVER_NAME
      +
      + mall.com
      +
      +
      +
      SERVER_SOFTWARE
      +
      + Apache/2.4.23 (Win32) OpenSSL/1.0.2j mod_fcgid/2.3.9
      +
      +
      +
      SERVER_SIGNATURE
      +
      +
      +
      +
      +
      SystemRoot
      +
      + C:\Windows
      +
      +
      +
      HTTP_COOKIE
      +
      + PHPSESSID=3c22e0jntkb2jncja6vlefne6n; __guid=155745575.1562149503273026300.1548253012647.3384; cart_goods_num=0; msgnewnum1=3; username=fuhuigou; key=f7b4b5e4248a2e99042cd20c5b1af10c; cart_count=0; msgnewnum381=23; monitor_count=52
      +
      +
      +
      HTTP_ACCEPT_LANGUAGE
      +
      + zh-CN,zh;q=0.9
      +
      +
      +
      HTTP_ACCEPT_ENCODING
      +
      + gzip, deflate
      +
      +
      +
      HTTP_REFERER
      +
      + http://mall.com/index.php/home/Sellerjoininc2c/step1.html
      +
      +
      +
      HTTP_ACCEPT
      +
      + image/webp,image/apng,image/*,*/*;q=0.8
      +
      +
      +
      HTTP_USER_AGENT
      +
      + Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
      +
      +
      +
      HTTP_CONNECTION
      +
      + close
      +
      +
      +
      HTTP_HOST
      +
      + mall.com
      +
      +
      +
      REDIRECT_STATUS
      +
      + 200
      +
      +
      +
      REDIRECT_PATH_INFO
      +
      + uploads/home/common/site_logo.png
      +
      +
      +
      FCGI_ROLE
      +
      + RESPONDER
      +
      +
      +
      PHP_SELF
      +
      + /index.php
      +
      +
      +
      REQUEST_TIME_FLOAT
      +
      + 1548323988.6424
      +
      +
      +
      REQUEST_TIME
      +
      + 1548323988
      +
      +
      +
      PATH_INFO
      +
      + uploads/home/common/site_logo.png
      +
      +
      +
      +
      +
      +
      Environment Variables
      +
      empty
      +
      +
      +
      +

      ThinkPHP Constants

      +
      +
      +
      APP_PATH
      +
      + D:\wwwroot\mall\public/../application/
      +
      +
      +
      THINK_VERSION
      +
      + 5.0.12
      +
      +
      +
      THINK_START_TIME
      +
      + 1548323988.6453
      +
      +
      +
      THINK_START_MEM
      +
      + 373392
      +
      +
      +
      EXT
      +
      + .php
      +
      +
      +
      DS
      +
      + \
      +
      +
      +
      THINK_PATH
      +
      + D:\wwwroot\mall\thinkphp\
      +
      +
      +
      LIB_PATH
      +
      + D:\wwwroot\mall\thinkphp\library\
      +
      +
      +
      CORE_PATH
      +
      + D:\wwwroot\mall\thinkphp\library\think\
      +
      +
      +
      TRAIT_PATH
      +
      + D:\wwwroot\mall\thinkphp\library\traits\
      +
      +
      +
      ROOT_PATH
      +
      + D:\wwwroot\mall\
      +
      +
      +
      EXTEND_PATH
      +
      + D:\wwwroot\mall\extend\
      +
      +
      +
      VENDOR_PATH
      +
      + D:\wwwroot\mall\vendor\
      +
      +
      +
      RUNTIME_PATH
      +
      + D:\wwwroot\mall\runtime\
      +
      +
      +
      LOG_PATH
      +
      + D:\wwwroot\mall\runtime\log\
      +
      +
      +
      CACHE_PATH
      +
      + D:\wwwroot\mall\runtime\cache\
      +
      +
      +
      TEMP_PATH
      +
      + D:\wwwroot\mall\runtime\temp\
      +
      +
      +
      CONF_PATH
      +
      + D:\wwwroot\mall\public/../application/
      +
      +
      +
      CONF_EXT
      +
      + .php
      +
      +
      +
      ENV_PREFIX
      +
      + PHP_
      +
      +
      +
      IS_CLI
      +
      + false
      +
      +
      +
      IS_WIN
      +
      + true
      +
      +
      +
      MD5_KEY
      +
      + a2382918dbb49c8643f19bc3ab90ecf9
      +
      +
      +
      CHARSET
      +
      + UTF-8
      +
      +
      +
      BASE_SITE_ROOT
      +
      +
      +
      +
      +
      PLUGINS_SITE_ROOT
      +
      + /static/plugins
      +
      +
      +
      ADMIN_SITE_ROOT
      +
      + /static/admin
      +
      +
      +
      HOME_SITE_ROOT
      +
      + /static/home
      +
      +
      +
      REWRITE_MODEL
      +
      + false
      +
      +
      +
      BASE_SITE_URL
      +
      + http://mall.com/index.php
      +
      +
      +
      HOME_SITE_URL
      +
      + http://mall.com/index.php/home
      +
      +
      +
      ADMIN_SITE_URL
      +
      + http://mall.com/index.php/admin
      +
      +
      +
      MOBILE_SITE_URL
      +
      + http://mall.com/index.php/mobile
      +
      +
      +
      WAP_SITE_URL
      +
      + http://mall.com/wap
      +
      +
      +
      UPLOAD_SITE_URL
      +
      + http://mall.com/uploads
      +
      +
      +
      EXAMPLES_SITE_URL
      +
      + http://mall.com/examples
      +
      +
      +
      CHAT_SITE_URL
      +
      + http://mall.com/static/chat
      +
      +
      +
      SESSION_EXPIRE
      +
      + 3600
      +
      +
      +
      PUBLIC_PATH
      +
      + D:\wwwroot\mall\/public
      +
      +
      +
      BASE_DATA_PATH
      +
      + D:\wwwroot\mall\/public/data
      +
      +
      +
      BASE_UPLOAD_PATH
      +
      + D:\wwwroot\mall\/public/uploads
      +
      +
      +
      BASE_RESOURCE_PATH
      +
      + D:\wwwroot\mall\/public/resource
      +
      +
      +
      TIMESTAMP
      +
      + 1548323988
      +
      +
      +
      DIR_SHOP
      +
      + shop
      +
      +
      +
      DIR_ADMIN
      +
      + admin
      +
      +
      +
      DIR_API
      +
      + api
      +
      +
      +
      DIR_MOBILE
      +
      + mobile
      +
      +
      +
      DIR_WAP
      +
      + wap
      +
      +
      +
      DIR_RESOURCE
      +
      + data/resource
      +
      +
      +
      DIR_UPLOAD
      +
      + public/uploads
      +
      +
      +
      ATTACH_PATH
      +
      + home
      +
      +
      +
      ATTACH_COMMON
      +
      + home/common
      +
      +
      +
      ATTACH_AVATAR
      +
      + home/avatar
      +
      +
      +
      ATTACH_INVITER
      +
      + home/inviter
      +
      +
      +
      ATTACH_EDITOR
      +
      + home/editor
      +
      +
      +
      ATTACH_MEMBERTAG
      +
      + home/membertag
      +
      +
      +
      ATTACH_STORE
      +
      + home/store
      +
      +
      +
      ATTACH_GOODS
      +
      + home/store/goods
      +
      +
      +
      ATTACH_STORE_DECORATION
      +
      + home/store/decoration
      +
      +
      +
      ATTACH_LOGIN
      +
      + home/login
      +
      +
      +
      ATTACH_WAYBILL
      +
      + home/waybill
      +
      +
      +
      ATTACH_ARTICLE
      +
      + home/article
      +
      +
      +
      ATTACH_BRAND
      +
      + home/brand
      +
      +
      +
      ATTACH_COMPLAIN
      +
      + home/complain
      +
      +
      +
      ATTACH_GOODS_CLASS
      +
      + home/goods_class
      +
      +
      +
      ATTACH_DELIVERY
      +
      + /delivery
      +
      +
      +
      ATTACH_ADV
      +
      + home/adv
      +
      +
      +
      ATTACH_APPADV
      +
      + home/appadv
      +
      +
      +
      ATTACH_ACTIVITY
      +
      + home/activity
      +
      +
      +
      ATTACH_WATERMARK
      +
      + home/watermark
      +
      +
      +
      ATTACH_POINTPROD
      +
      + home/pointprod
      +
      +
      +
      ATTACH_GROUPBUY
      +
      + home/groupbuy
      +
      +
      +
      ATTACH_LIVE_GROUPBUY
      +
      + home/livegroupbuy
      +
      +
      +
      ATTACH_SLIDE
      +
      + home/store/slide
      +
      +
      +
      ATTACH_VOUCHER
      +
      + home/voucher
      +
      +
      +
      ATTACH_STORE_JOININ
      +
      + home/store_joinin
      +
      +
      +
      ATTACH_MOBILE
      +
      + mobile
      +
      +
      +
      ATTACH_LIVE
      +
      + live
      +
      +
      +
      ATTACH_MALBUM
      +
      + home/member
      +
      +
      +
      TPL_SHOP_NAME
      +
      + default
      +
      +
      +
      TPL_ADMIN_NAME
      +
      + default
      +
      +
      +
      TPL_DELIVERY_NAME
      +
      + default
      +
      +
      +
      TPL_MEMBER_NAME
      +
      + default
      +
      +
      +
      DEFAULT_CONNECT_SMS_TIME
      +
      + 60
      +
      +
      +
      STORE_JOIN_STATE_NEW
      +
      + 10
      +
      +
      +
      STORE_JOIN_STATE_PAY
      +
      + 11
      +
      +
      +
      STORE_JOIN_STATE_VERIFY_SUCCESS
      +
      + 20
      +
      +
      +
      STORE_JOIN_STATE_VERIFY_FAIL
      +
      + 30
      +
      +
      +
      STORE_JOIN_STATE_PAY_FAIL
      +
      + 31
      +
      +
      +
      STORE_JOIN_STATE_FINAL
      +
      + 40
      +
      +
      +
      DEFAULT_SPEC_COLOR_ID
      +
      + 1
      +
      +
      +
      GOODS_IMAGES_WIDTH
      +
      + 60,240,360,1280
      +
      +
      +
      GOODS_IMAGES_HEIGHT
      +
      + 60,240,360,12800
      +
      +
      +
      GOODS_IMAGES_EXT
      +
      + _60,_240,_360,_1280
      +
      +
      +
      ORDER_STATE_CANCEL
      +
      + 0
      +
      +
      +
      ORDER_STATE_NEW
      +
      + 10
      +
      +
      +
      ORDER_STATE_PAY
      +
      + 20
      +
      +
      +
      ORDER_STATE_SEND
      +
      + 30
      +
      +
      +
      ORDER_STATE_SUCCESS
      +
      + 40
      +
      +
      +
      ORDER_AUTO_CANCEL_DAY
      +
      + 3
      +
      +
      +
      ORDER_AUTO_RECEIVE_DAY
      +
      + 7
      +
      +
      +
      CODE_INVALID_REFUND
      +
      + 7
      +
      +
      +
      ORDER_DEL_STATE_DEFAULT
      +
      + 0
      +
      +
      +
      ORDER_DEL_STATE_DELETE
      +
      + 1
      +
      +
      +
      ORDER_DEL_STATE_DROP
      +
      + 2
      +
      +
      +
      ORDER_EVALUATE_TIME
      +
      + 1296000
      +
      +
      +
      OFFLINE_ORDER_CANCEL_TIME
      +
      + 3
      +
      +
      +
      +
      + + + + + diff --git a/img/sousuo.png b/img/sousuo.png new file mode 100644 index 0000000..873650f Binary files /dev/null and b/img/sousuo.png differ diff --git a/img/spotmkrs.png b/img/spotmkrs.png new file mode 100644 index 0000000..191efd9 Binary files /dev/null and b/img/spotmkrs.png differ diff --git a/img/start.png b/img/start.png new file mode 100644 index 0000000..bc9f5ec Binary files /dev/null and b/img/start.png differ diff --git a/img/tanhao.png b/img/tanhao.png new file mode 100644 index 0000000..d98b5fc Binary files /dev/null and b/img/tanhao.png differ diff --git a/img/tianjia.png b/img/tianjia.png new file mode 100644 index 0000000..962178a Binary files /dev/null and b/img/tianjia.png differ diff --git a/img/time_bg.png b/img/time_bg.png new file mode 100644 index 0000000..8507300 Binary files /dev/null and b/img/time_bg.png differ diff --git a/img/time_icon.png b/img/time_icon.png new file mode 100644 index 0000000..7018616 Binary files /dev/null and b/img/time_icon.png differ diff --git a/img/time_more.png b/img/time_more.png new file mode 100644 index 0000000..edaf0ef Binary files /dev/null and b/img/time_more.png differ diff --git a/img/timer_logo.png b/img/timer_logo.png new file mode 100644 index 0000000..6e8eadd Binary files /dev/null and b/img/timer_logo.png differ diff --git a/img/title_ac11next.png b/img/title_ac11next.png new file mode 100644 index 0000000..eccc41f Binary files /dev/null and b/img/title_ac11next.png differ diff --git a/img/title_brand.png b/img/title_brand.png new file mode 100644 index 0000000..aec8a83 Binary files /dev/null and b/img/title_brand.png differ diff --git a/img/title_miaosha.png b/img/title_miaosha.png new file mode 100644 index 0000000..3cf7294 Binary files /dev/null and b/img/title_miaosha.png differ diff --git a/img/title_miaoshaqu.png b/img/title_miaoshaqu.png new file mode 100644 index 0000000..f5c3005 Binary files /dev/null and b/img/title_miaoshaqu.png differ diff --git a/img/title_news.png b/img/title_news.png new file mode 100644 index 0000000..307416e Binary files /dev/null and b/img/title_news.png differ diff --git a/img/title_pp.png b/img/title_pp.png new file mode 100644 index 0000000..4174108 Binary files /dev/null and b/img/title_pp.png differ diff --git a/img/title_zhekouqu.png b/img/title_zhekouqu.png new file mode 100644 index 0000000..1950adc Binary files /dev/null and b/img/title_zhekouqu.png differ diff --git a/img/tixian.png b/img/tixian.png new file mode 100644 index 0000000..50ffcaf Binary files /dev/null and b/img/tixian.png differ diff --git a/img/tixian6.png b/img/tixian6.png new file mode 100644 index 0000000..d029533 Binary files /dev/null and b/img/tixian6.png differ diff --git a/img/touxiang.jpg b/img/touxiang.jpg new file mode 100644 index 0000000..9047ca2 Binary files /dev/null and b/img/touxiang.jpg differ diff --git a/img/trade.png b/img/trade.png new file mode 100644 index 0000000..0528aa5 Binary files /dev/null and b/img/trade.png differ diff --git a/img/trade1.png b/img/trade1.png new file mode 100644 index 0000000..19d387a Binary files /dev/null and b/img/trade1.png differ diff --git a/img/true.jpg b/img/true.jpg new file mode 100644 index 0000000..e186417 Binary files /dev/null and b/img/true.jpg differ diff --git a/img/tuijian.png b/img/tuijian.png new file mode 100644 index 0000000..8c0ad4c Binary files /dev/null and b/img/tuijian.png differ diff --git a/img/weiba.png b/img/weiba.png new file mode 100644 index 0000000..622c3ff Binary files /dev/null and b/img/weiba.png differ diff --git a/img/xiajiantou.png b/img/xiajiantou.png new file mode 100644 index 0000000..bab4af5 Binary files /dev/null and b/img/xiajiantou.png differ diff --git a/img/xianshiqianggou.png b/img/xianshiqianggou.png new file mode 100644 index 0000000..a54828e Binary files /dev/null and b/img/xianshiqianggou.png differ diff --git a/img/xiaodian.png b/img/xiaodian.png new file mode 100644 index 0000000..4dafe95 Binary files /dev/null and b/img/xiaodian.png differ diff --git a/img/xinyongka.png b/img/xinyongka.png new file mode 100644 index 0000000..48965bd Binary files /dev/null and b/img/xinyongka.png differ diff --git a/img/youjiantou.png b/img/youjiantou.png new file mode 100644 index 0000000..1976dc6 Binary files /dev/null and b/img/youjiantou.png differ diff --git a/img/yuan.png b/img/yuan.png new file mode 100644 index 0000000..2b4f820 Binary files /dev/null and b/img/yuan.png differ diff --git a/img/zan1.png b/img/zan1.png new file mode 100644 index 0000000..54ed64e Binary files /dev/null and b/img/zan1.png differ diff --git a/img/zan2.png b/img/zan2.png new file mode 100644 index 0000000..a58019d Binary files /dev/null and b/img/zan2.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..fa5e149 --- /dev/null +++ b/index.html @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/js/addessay.js b/js/addessay.js new file mode 100644 index 0000000..e69de29 diff --git a/js/addgoods.1.js b/js/addgoods.1.js new file mode 100644 index 0000000..3754144 --- /dev/null +++ b/js/addgoods.1.js @@ -0,0 +1,658 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); + +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + var goodsId = self.goodsId; + // //console.log(shopId); + // var isSale = typeof(self.isSale)!= 'undefined' ? self.isSale : ""; + // var isSpec = typeof(self.isSpec)!= 'undefined' ? self.isSpec : ""; + if (goodsId > 0) { + $(".title").text("编辑商品") + + JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { + shopId: shopId, + goodsId: goodsId + }, function(data) { + //console.log(data); + if (data.status == 1) { + var html1 = ''; + var data = data.data; + var i = 0, + j = 0; + var res = ''; + var id = data.setNameId; + if (1 == data.isSpec) { + getRecommend(page, pageSize, id) + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(datas) { + setSpec(data.spec, specList) + }); + + } + if (1 == data.isSale) { + $('#isSale').prop("checked", "checked"); + } + mui.each(data, function(index, element) { + if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex; + // //console.log(obj); + // if ($(obj)!= "") { + if ($(obj).is('img')) { + // //console.log(element); + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index).val(element) + // } + } else if ($('#' + index).hasClass('gallery')) { + var html = '' + // //console.log(element.length); + if (element.length > 0) { + var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; + //console.log("test"); + + html = '' + for (var i = 0; i < imgurls.length; i++) { + html += '
      ' + // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) + } + var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; + html += '
      '; + $(".batchImg").html(html) + } else { + html = ""; + html = + '
      '; + $(".batchImg").html(html) + } + } + } else if (index == 'goodsCatIdPath') { + // data.goodsCatIdPath 三级目录 + var goodsCatIdPathArr = []; + var pathArr = ["largeCat", "mediumCat", "smallCat"] + // //console.log(data.goodsCatIdPath); + goodsCatIdPathArr = data.goodsCatIdPath.split('_') + goodsCatIdPathArr.pop() + // //console.log(goodsCatIdPathArr); + mui.each(pathArr, function(idx, ele) { + // //console.log(idx); + switch (ele) { + case 'largeCat': + getCatIdPathName(goodsCatIdPathArr[0], function(data) { + // //console.log(data); + getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); + }) + break; + case 'mediumCat': + getCatIdPathName(goodsCatIdPathArr[1], function(data) { + $('#mediumCat').html('') + }); + break; + case 'smallCat': + getCatIdPathName(goodsCatIdPathArr[2], function(data) { + $('#smallCat').html('') + }); + break; + } + }) + + } else { + $('#' + index).val(element) + } + }) + } + }) + + } else { + getGoodsCats("largeCat", 0) + getRecommend(page, pageSize); + + $(".title").text("添加商品") + } + + function setSpec(goodsSpec, specList) { + var html1 = '', + res = '', + goodsRes = '' + + var arr = []; + var arr2 = {}; + for (var i = 0; i < specList.length; i++) { + arr.push(specList[i].list); + arr2[specList[i].catId] = specList[i].list; + } + var a = combins(arr); + var cLength = 0; + var catId = 0; + var showSpecNames = []; + while (c = a.next()) { + res = c.join(' '); + cLength = c.length; + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + }) + html1 += '' + + '' + + ''; + } + html1 += '' + + '
      ' + j++; + } + $('.pricset_con_con').html(html1); + mui.each(goodsSpec, function(idx, val) { + goodsRes = ''; + i = 0; + mui.each(val.names, function(index, value) { + goodsRes += value.itemName + ' '; //hongse 39ma + }) + var showSpecNames = $('label[name="showSpecNames[]"]'); + + var specNameArr=[]; + for(var k=0;k' + +// '' + +// ''; +// goodsRes += value.itemName + ' '; +// i++; +// }) +// html1 += '' + +// '
      '; + // j++; + }) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // $('.pricset_con_con').html(html1); + } + +}) +} + +function getCatIdPathName(catId, callback) { + JZL.ajax(qlgUrl("app/goodscats/getCatName"), { + catId: catId + }, function(data) { + callback(data); + }) +} + +//获取商品总规格列表 +var page = 1; +var pageSize = 100; +var isjiazai = 1; + +function getRecommend(page, pageSize, defaultVal) { + + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 100 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { + + + // //console.log(data); + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if (typeof(defaultVal) == "undefined") { + // //console.log(1); + $.each(data.Rows, function() { + html += '' + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + } else { + // //console.log(defaultVal); + $.each(data.Rows, function() { + if (this.id = defaultVal) { + selected = 'selected'; + } else { + selected = ''; + } + html = ''; + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + }); + + + } + + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + isjiazai = 1; + }) +} + +//获取商品规格 + +combins = function(args) { + + if (args.length < 2) return args[0] || []; + // if (arguments.length < 2) return arguments[0] || []; + //var args = Array.prototype.slice.call(arguments); + var that = { + index: 0, + nth: function(n) { + var result = [], + d = 0; + for (; d < this.dim; d++) { + var l = this[d].length; + var i = n % l; + result.push(this[d][i]); + n -= i; + n /= l; + } + return result; + }, + next: function() { + if (this.index >= size) return; + var result = this.nth(this.index); + this.index++; + return result; + } + }; + var size = 1; + for (var i = 0; i < args.length; i++) { + size = size * args[i].length; + that[i] = args[i]; + } + that.size = size; + that.dim = args.length; + return that; +} + +// 判断是否上架 +var isSale = "", + setNameId, + isSpec; +if ($("#isSale").prop("checked")) { + isSale = "1"; +} else { + isSale = "0"; +} +// 判断有没有商品属性 + +if ($("#setNameId option:selected").val() != "") { + isSpec = 1; +} else { + isSpec = 0; +} + +$('#setNameId').change(function() { + var id = $('#setNameId option:selected').val() + + var html1 = ""; + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data) { + + // //console.log(data); + if (1 == data.status) { + + var arr = []; + var arr2 = {}; + for (var i = 0; i < data.data.length; i++) { + arr.push(data.data[i].list); + arr2[data.data[i].catId] = data.data[i].list; + } + var a = combins(arr); + var j = 0; + var res = ''; + var cLength = 0; + var catId = 0; + while (c = a.next()) { + res = c.join(','); + cLength = c.length; + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + + }) + html1 += '' + + '' + + ''; + + } + html1 += '' + + '
      ' + j++; + } + $('.pricset_con_con').html(html1); + } + }) +}) + +// 下一页 +var check = true; +mui("body").on('tap', '.next_btn', function() { + check = true; + $('.isemptyinp').each(function() { + // //console.log(this); + + if (!this.value || "" == $.trim(this.value)) { + var label = this.previousElementSibling; + //console.log(label); + mui.alert(label.innerText + "不允许为空") + check = false; + return false; + } + }) + + if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { + mui.alert("商品没有属性必须输入商品价格") + check = false; + return false; + } + + if ($("#setNameId option:selected").val() != "" & check == true) { + $('.pricset_con_con input').each(function() { + if ((!this.value || "" == $.trim(this.value))) { + mui.alert("请输入数据") + check = false; + return false; + } + }) + } + + + if (check == true) { + $(".addcon").css("display", "none") + $(".pre").css("display", "block"); + backTop(); + let E = window.wangEditor; + + let editor = new E('#goodsDesc'); + editor.customConfig.uploadImgShowBase64 = true; + editor.create(); + } + + +}) +//预览 +mui("body").on('tap', '.prelook', function() { + + + +}) + + + +// 上一页 +mui('body').on('tap', '.pre_btn', function() { + $(".addcon").css("display", "block") + $(".pre").css("display", "none") +}) +// //console.log($("#goodsDesc").text()); + +//提交 +var click = false; +mui('.btn').on('tap', '.submit_btn ', function() { + if (click == true) { + return + } + + var imgs = ''; + var data = $('input[name="gallery[]"]'); + // //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + + + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + + + $('#gallery').val(imgs); + // //console.log($('#gallery').val()); + + var params = JZL.getParams(".inp"); + params.shopId = shopId; + params.isSale = isSale; + params.isSpec = isSpec; + params.goodsDesc = $("#goodsDesc").text(); + params.setNameId = $('#setNameId option:selected').val() + click = true; + if (goodsId > 0) { + params.goodsId = goodsId; + + } + JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { + // //console.log(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + + }) + + +}) + +//获取类目 +$('.selectarea').on("change", ".area", function() { + var objs = ['largeCat', 'mediumCat', 'smallCat']; + // var areaStr = ['请选择', '请选择', '请选择']; + var level = +$(this).attr('data-level') + 1; //0 + pid = $('#' + objs[level - 1] + ' option:selected').val(); + getGoodsCats(objs[level], pid); + +}) + +//三级类目 +function getGoodsCats(obj, pid, defaultId) { + JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { + pid: pid + }, + function(data) { + // //console.log(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + // //console.log(this); + html += '' + }); + } else { + $.each(data, function() { + if (this.catId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + $('#' + obj).html(html); + } + }) +} + +// 上传图片 +$(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + // //console.log($('#galleryImg[' + num + ']')); + //if ($('#galleryImg[' + num + ']').length > 0) { + that.html(html); + //} else { + // $(".batchImg").append(html); + //} + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); +}) + +$(".oneImg").on("tap", '#goods', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("goodsImg", "test", "goods") + openCamera(function(t, status, fileName, serverName) { + var html = ''; + + $(".goods").html(html); + + }) +}) +// 删除图片 +$(".batchImg").on('tap', '.delete', function(e) { + +e.preventDefault(); +e.stopPropagation() + +// //console.log(this); +var that = $(this) +//var idx = that.parent().attr('data-id'); +//var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; +if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; +} +}) + +}) diff --git a/js/addgoods.2.js b/js/addgoods.2.js new file mode 100644 index 0000000..ed9ccdb --- /dev/null +++ b/js/addgoods.2.js @@ -0,0 +1,859 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +$(".pricset_con").hide(); +function escape2Html(str) { + var arrEntities = { + 'lt': '<', + 'gt': '>', + 'nbsp': ' ', + 'amp': '&', + 'quot': '"' + }; + return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, i) { + return arrEntities[i]; + }); +}; +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + // ////console.log(self); + var shopId = self.id; + var goodsId = self.goodsId; + var richText = ''; + + var E = window.wangEditor + var editor = new E('#goodsDesc') + // editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab + // editor.customConfig.uploadFileName = 'yourFileName' //给上传的本地图片文件命名的统一名称 + // editor.customConfig.uploadImgServer = '/upload'; //官方文档上写的是服务器地址,也就是上传图片的方法名 + + // 允许上传到七牛云存储 + editor.customConfig.qiniu = true; + editor.customConfig.debug = true; + // editor.customConfig.onchange = function (html) { + // // 监控变化,同步更新到 textarea + // // $text1.val(html) + // }; + editor.create(); + // 初始化七牛上传 + + + if (goodsId > 0) { + $(".title").text("编辑商品") + + JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { + shopId: shopId, + goodsId: goodsId + }, function(data) { + //console.log(data); + if (data.status == 1) { + var html1 = ''; + var data = data.data; + var i = 0, + j = 0; + var res = ''; + var bjSpec = data.isSpec; + if (1 == data.isSpec) { + $(".pricset_con").show() + var id = data.setNameId; + + // ////console.log(id); + getRecommend(page, pageSize, id) + + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data1) { + //console.log(data1); + if (1 == data1.status) { + var that = this + var arr = []; + var arr2 = {}; + for (var i = 0; i < data1.data.length; i++) { + arr.push(data1.data[i].list); + arr2[data1.data[i].catId] = data1.data[i].list; + } + + // ////console.log(a); + var cLength = 0; + var catId = 0; + var goodsRes = ""; + if (arr.length > 0) { + var tmpI = 0; + var a = combins(arr); + while (true) { + if (arr.length > 1) { + c = a.next(); + if (!c) break; + cLength = c.length; + res = c.join(' '); + } else { + if (tmpI >= arr[0].length) { + break; + } + c = arr[0]; + res = arr[0][tmpI]; + cLength = arr[0].length; + } + tmpI++; + // ////console.log(c); + // ////console.log(res); + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + + }) + html1 += '' + //属性值id + '' + //分类ID + ''; + } + //console.log(j); + html1 += '' + //规格表ID 新增传0 + '
      '; + j++; + } + + $('.pricset_con_con').html(html1); + var setNum = 0; + mui.each(data.spec, function(idx, val) { + if (cLength != val.names.length) return false; + goodsRes = ''; + i = 0; + if (arr.length > 1) { + mui.each(val.names, function(index, value) { + goodsRes += value.itemName + ' '; //hongse 39ma + }) + } else { + // //console.log(val); + //console.log(val.names); + goodsRes = val.names[setNum].itemName; + setNum++; + } + var showSpecNames = $('label[name="showSpecNames[]"]'); + var specNameArr = []; + for (var k = 0; k < showSpecNames.length; k++) { + specNameArr[$(showSpecNames[k]).attr('data-id')] = $(showSpecNames[k]).text(); + } + $.each(specNameArr, function(sitem, sval) { + if ($.trim(goodsRes) == $.trim(sval)) { //去除空格 不然报错 + i = 0; + mui.each(val.names, function(index, value) { + // ////console.log(i); + document.getElementById('specItemIds[' + +sitem + '][' + i + ']').value = value.itemId //属性值ID 新增传0 + i++; + }); + document.getElementById('specIds[' + +sitem + ']').value = val.id //规格表ID,新增传0 + document.getElementById('specPrice[' + +sitem + ']').value = val.specPrice + document.getElementById('specStock[' + +sitem + ']').value = val.specStock + if (1 == val.isDefault) { + + //checked + var inputList = $('input[name=defaultId]') + + + $.each(inputList, function(index, value) { + // ////console.log(value, index); + this.previousElementSibling + if (sitem == this.value) { + this.checked = true + } + }) + } + + } + }) + + }) + } + } + }) + + + } else if (0 == data.isSpec) { + // $('#setNameId').html('') + getRecommend(page, pageSize) + } + if (1 == data.isSale) { + $('#isSale').prop("checked", "checked"); + } + mui.each(data, function(index, element) { + if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex; + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index).val(element) + } else if ($('#' + index).hasClass('gallery')) { + var html = ''; + if (element.length > 0) { + var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; + html = '' + for (var i = 0; i < imgurls.length; i++) { + html += '
      ' + // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) + } + var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; + html += '
      '; + $(".batchImg").html(html) + } else { + html = ""; + html = + '
      '; + $(".batchImg").html(html) + } + } + } else if (index == 'goodsCatIdPath') { + // data.goodsCatIdPath 三级目录 + var goodsCatIdPathArr = []; + var pathArr = ["largeCat", "mediumCat", "smallCat"] + // ////console.log(data.goodsCatIdPath); + goodsCatIdPathArr = data.goodsCatIdPath.split('_') + goodsCatIdPathArr.pop() //移除最后一个数组元素 _ + mui.each(pathArr, function(idx, ele) { + // ////console.log(idx); + switch (ele) { + case 'largeCat': + getCatIdPathName(goodsCatIdPathArr[0], function(data) { + getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); + }) + break; + case 'mediumCat': + getCatIdPathName(goodsCatIdPathArr[1], function(data) { + $('#mediumCat').html('') + }); + break; + case 'smallCat': + getCatIdPathName(goodsCatIdPathArr[2], function(data) { + $('#smallCat').html('') + }); + break; + } + }) + + } else { + $('#' + index).val(element) + } + }) + if ('' != data.goodsDesc) { + var Desc = escape2Html(data.goodsDesc) + // var Desc= HtmlUtils.htmlUnescape(data.goodsDesc) + ////console.log(Desc) + // $('#goodsDesc').val(Desc) + // $('#goodsDesc').html(Desc) + editor.txt.html(Desc) + } + + // params.goodsDesc = editor.txt.html(); + + } else { + mui.alert(data.msg) + } + }) + + } else { + getGoodsCats("largeCat", 0) + getRecommend(page, pageSize); + + $(".title").text("添加商品") + } + + + function getCatIdPathName(catId, callback) { + JZL.ajax(qlgUrl("app/goodscats/getCatName"), { + catId: catId + }, function(data) { + callback(data); + }) + } + + //获取商品总规格列表 + var page = 1; + var pageSize = 100; + var isjiazai = 1; + + function getRecommend(page, pageSize, defaultVal) { + + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 100 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { + + + // ////console.log(data); + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if (typeof(defaultVal) == "undefined") { + // ////console.log(1); + $.each(data.Rows, function() { + html += '' + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + } else { + // ////console.log(defaultVal); + $.each(data.Rows, function() { + if (this.id == defaultVal) { + selected = 'selected'; + } else { + selected = ''; + } + html += ''; + + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + + } + + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg); + // location.reload(); + } + isjiazai = 1; + }) + } + + //获取商品规格 + // 笛卡尔积 + combins = function(args) { + + if (args.length < 2) return args[0] || []; + // if (arguments.length < 2) return arguments[0] || []; + //var args = Array.prototype.slice.call(arguments); + var that = { + index: 0, + nth: function(n) { + var result = [], + d = 0; + for (; d < this.dim; d++) { + var l = this[d].length; + var i = n % l; + result.push(this[d][i]); + n -= i; + n /= l; + } + return result; + }, + next: function() { + if (this.index >= size) return; + var result = this.nth(this.index); + this.index++; + return result; + } + }; + var size = 1; + for (var i = 0; i < args.length; i++) { + size = size * args[i].length; + that[i] = args[i]; + } + that.size = size; + that.dim = args.length; + return that; + } + + + + $('#setNameId').change(function() { + var id = $('#setNameId option:selected').attr('data-id') + // ////console.log(id); + + var html1 = ""; + if (typeof id == "undefined" || 0 == id) { + $(".pricset_con").hide() + } else { + $(".pricset_con").show() + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data) { + // ////console.log(data); + if (1 == data.status) { + html1 = ""; + var arr = []; + var arr2 = {}; + for (var i = 0; i < data.data.length; i++) { + arr.push(data.data[i].list); + arr2[data.data[i].catId] = data.data[i].list; + } + + var j = 0; + var res = ''; + var cLength = 0; + var catId = 0; + var tmpI = 0; + var a = combins(arr); + while (true) { + if (arr.length > 1) { + c = a.next(); + if (!c) break; + cLength = c.length; + res = c.join(' '); + } else { + if (tmpI >= arr[0].length) { + break; + } + c = arr[0]; + res = arr[0][tmpI]; + cLength = arr[0].length; + } + tmpI++; + for (i = 0; i < cLength; i++) { + $.each(arr2, function(ind, val) { + $.each(val, function(index, value) { + if (value == c[i]) { + catId = ind; + return; + } + }); + + }) + html1 += '' + + '' + + ''; + + } + html1 += '' + + '
      ' + j++; + } + $('.pricset_con_con').html(html1); + } else { + mui.alert(data.msg) + } + }) + } + }) + + // 下一页 + var check = true; + mui("body").on('tap', '.next_btn', function() { + check = true; + $('.isemptyinp').each(function() { + if (!this.value || "" == $.trim(this.value)) { + var label = this.previousElementSibling; + mui.alert(label.innerText + "不允许为空") + check = false; + return false; + } + }) + + if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { + mui.alert("商品没有属性必须输入商品价格") + check = false; + return false; + } + if ($("#setNameId option:selected").val() != 0 && check == true) { + + if ($('input[name="defaultId"]:checked').length == 0) { + mui.alert("请选择默认规格") + check = false; + return false + } + $('.pricset_con_con input').each(function() { + if ((!$(this).val() || "" == $.trim(this.value))) { + + + mui.alert("请输入数据") + $(this).focus(); + check = false; + return false; + } + }) + } + // var shopPrice= $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + // ////console.log(shopPrice) + if ($("#isSale").prop("checked")) { + isSale = "1"; + } else { + isSale = "0"; + } + if (check == true) { + $(".addcon").css("display", "none") + $(".pre").css("display", "block"); + backTop(); + + } + + + }) + //预览 + $('.prelook').hide(); + // mui("body").on('tap', '.prelook', function() { + // + // + // + // }) + // 上一页 + mui('body').on('tap', '.pre_btn', function() { + $(".addcon").css("display", "block") + $(".pre").css("display", "none") + }) + // ////console.log($("#goodsDesc").text()); + + //提交 + // 判断是否上架 + var isSale = "", + setNameId, + isSpec; + + // ////console.log(typeof($("#setNameId option:selected").val())); + + + //提交 + var click = false; + mui('.btn').on('tap', '.submit_btn ', function() { + richText = editor.txt.text() + // 判断有没有商品属性 + if ($("#setNameId option:selected").val() != 0) { + isSpec = 1; + } else { + isSpec = 0; + } + if (click == true) { + return + } + + if ($("#isSale").prop("checked")) { + // ////console.log(1); + isSale = "1"; + } else { + // ////console.log(0); + isSale = "0"; + } + var imgs = ''; + var data = $('input[name="gallery[]"]'); + // ////console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + + + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + + + $('#gallery').val(imgs); + //默认选中 + var defaultPrice = $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + var params = JZL.getParams(".inp"); + params.shopId = shopId; + params.isSale = isSale; + params.isSpec = isSpec; + params.defaultId = $('input[name="defaultId"]:checked').val(); + params.goodsDesc = editor.txt.html(); + params.setNameId = $('#setNameId option:selected').val() + if (isSpec == 1) { + // params.shopPrice = shopPrice + $('#shopPrice').val(defaultPrice); + + } + params.shopPrice = $('#shopPrice').val() + click = true; + if (goodsId > 0) { + params.goodsId = goodsId; + + } + // alert(editor.txt.html()) + JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { + // ////console.log(data); + if (data.status == 1) { + mui.toast(data.msg); + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + + }) + + + }) + + //获取类目 + $('.selectarea').on("change", ".area", function() { + var objs = ['largeCat', 'mediumCat', 'smallCat']; + // var areaStr = ['请选择', '请选择', '请选择']; + var level = +$(this).attr('data-level') + 1; //0 + pid = $('#' + objs[level - 1] + ' option:selected').val(); + getGoodsCats(objs[level], pid); + + }) + + //三级类目 + function getGoodsCats(obj, pid, defaultId) { + JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { + pid: pid + }, + function(data) { + // ////console.log(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + // ////console.log(this); + html += '' + }); + } else { + $.each(data, function() { + if (this.catId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + $('#' + obj).html(html); + } + }) + } + + // 上传图片 + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + // ////console.log($('#galleryImg[' + num + ']')); + //if ($('#galleryImg[' + num + ']').length > 0) { + that.html(html); + //} else { + // $(".batchImg").append(html); + //} + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + + $(".oneImg").on("tap", '#goods', function() { + // UP.init("accountBookImg", "test", "accountBookImgTag") + + UP.init("goodsImg", "test", "goods") + openCamera(function(t, status, fileName, serverName) { + var html = ''; + + $(".goods").html(html); + + }) + }) + // 删除图片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // ////console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + //上传图片到七牛; + + var uptoken = ''; + var rs = send_request(); + rs = JSON.parse(rs); + + uptoken = rs.token; + + function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + // ////console.log(dir) + serverUrl = hyhUrl('oss/qiniu.php'); + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + + }; + + + // 初始化七牛上传的方法 + function uploadInit() { + var btnId = editor.imgMenuId; + var containerId = editor.toolbarElemId; + var textElemId = editor.textElemId; + // 创建上传对象 + var uploader = Qiniu.uploader({ + runtimes: 'html5,flash,html4', //上传模式,依次退化 + browse_button: btnId, //上传选择的点选按钮,**必需** + //uptoken_url: rs, + //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) + uptoken: uptoken, + // url: 'http://up-z1.qiniup.com', + + // uptoken : '', + //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 + // unique_names: true, + // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) + // save_key: true, + // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 + // domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', + // domain:$('#domain').val(), + domain: rs.url, + + //bucket 域名,下载资源时用到,**必需** + container: containerId, //上传区域DOM ID,默认是browser_button的父元素, + max_file_size: '100mb', //最大文件体积限制 + flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 + filters: { + mime_types: [ + //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) + { + title: "图片文件", + extensions: "jpg,gif,png,bmp" + } + ] + }, + max_retries: 3, //上传失败最大重试次数 + dragdrop: true, //开启可拖曳上传 + drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 + chunk_size: '4mb', //分块上传时,每片的体积 + auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 + init: { + 'FilesAdded': function(up, files) { + plupload.each(files, function(file) { + // 文件添加进队列后,处理相关的事情 + // printLog('on FilesAdded'); + }); + }, + 'BeforeUpload': function(up, file) { + // 每个文件上传前,处理相关的事情 + // printLog('on BeforeUpload'); + }, + 'UploadProgress': function(up, file) { + // 显示进度 + // printLog('进度 ' + file.percent) + }, + 'FileUploaded': function(up, file, info) { + // 每个文件上传成功后,处理相关的事情 + // 其中 info 是文件上传成功后,服务端返回的json,形式如 + // { + // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", + // "key": "gogopher.jpg" + // } + // printLog(info); + // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html + + var domain = up.getOption('domain'); + var res = $.parseJSON(info); + var sourceLink = domain + res.key; //获取上传成功后的文件的Url + // 插入图片到editor + editor.cmd.do('insertHtml', '') + }, + 'Error': function(up, err, errTip) { + //上传出错时,处理相关的事情 + // printLog('on Error'); + }, + 'UploadComplete': function() { + //队列文件处理完毕后,处理相关的事情 + // printLog('on UploadComplete'); + } + // Key 函数如果有需要自行配置,无特殊需要请注释 + //, + // 'Key': function(up, file) { + // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 + // // 该配置必须要在 unique_names: false , save_key: false 时才生效 + // var key = ""; + // // do something with key here + // return key + // } + } + // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 + // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs + }); + } + uploadInit(); + // 封装 ////console.log 函数 + function printLog(title, info) { + window.console && console.log(title, info); + } +}) diff --git a/js/addgoods.js b/js/addgoods.js new file mode 100644 index 0000000..715f8f7 --- /dev/null +++ b/js/addgoods.js @@ -0,0 +1,855 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +$(".pricset_con").hide(); + +function escape2Html(str) { + var arrEntities = { + 'lt': '<', + 'gt': '>', + 'nbsp': ' ', + 'amp': '&', + 'quot': '"' + }; + return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, i) { + return arrEntities[i]; + }); +}; +mui.plusReady(function() { + $("#isSale").prop("checked", true); + var self = plus.webview.currentWebview(); + + var shopId = self.id; + var goodsId = self.goodsId; + var richText = ''; + + var E = window.wangEditor + var editor = new E('#goodsDesc') + // editor.customConfig.showLinkImg = false // 隐藏“网络图片”tab + // editor.customConfig.uploadFileName = 'yourFileName' //给上传的本地图片文件命名的统一名称 + // editor.customConfig.uploadImgServer = '/upload'; //官方文档上写的是服务器地址,也就是上传图片的方法名 + + // 允许上传到七牛云存储 + editor.customConfig.qiniu = true; + editor.customConfig.debug = true; + // editor.customConfig.onchange = function (html) { + // // 监控变化,同步更新到 textarea + // // $text1.val(html) + // }; + editor.create(); + // 初始化七牛上传 + + + if (goodsId > 0) { + $(".title").text("编辑商品") + + JZL.ajax(qlgUrl("app/shops/getGoodsInfo"), { + shopId: shopId, + goodsId: goodsId + }, function(data) { + //console.log(data); + if (data.status == 1) { + var html1 = ''; + var data = data.data; + var i = 0, + j = 0; + var res = ''; + var bjSpec = data.isSpec; + if (1 == data.isSpec) { + $(".pricset_con").show() + var id = data.setNameId; + + + getRecommend(page, pageSize, id) + + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data1) { + + if (1 == data1.status) { + var that = this + var arr = []; + var arr2 = {}; + for (var i = 0; i < data1.data.length; i++) { + arr.push(data1.data[i].list); + arr2[data1.data[i].catId] = data1.data[i].list; + } + + + var cLength = 0; + var catId = 0; + var goodsRes = ""; + if (arr.length > 0) { + var calc = calcDescartes(arr); + var cIndex = 0, + cArr = []; + while (true) { + if (cIndex >= calc.length) { + break; + } + //区分单规格和多规格 + if (Array.isArray(calc[cIndex])) { + res = calc[cIndex].join(' '); + cArr = calc[cIndex]; + cLength = calc[cIndex].length; + } else { + res = calc[cIndex]; + cArr[0] = res; + cLength = 1; + } + for (i = 0; i < cArr.length; i++) { + //获取catId + + // console.log(cArr[i]); + $.each(arr2, function(ind, val) { + //console.log(val); + $.each(val, function(index, value) { + if (value == cArr[i]) { + catId = ind; + // console.log(catId); + return; + } + }); + }); + html1 += '' + //属性值id + '' + //分类ID + ''; + } + //console.log(j); + html1 += '' + //规格表ID 新增传0 + '
      '; + j++; + cIndex++; + } + + $('.pricset_con_con').html(html1); + //var setNum = 0; + + mui.each(data.spec, function(idx, val) { + // console.log(val.names); + //if (calc[setNum].length != val.names.length) return false; + //setNum++; + goodsRes = ''; + i = 0; + mui.each(val.names, function(index, value) { + goodsRes += value.itemName + ' '; //hongse 39ma + }) + + var showSpecNames = $('label[name="showSpecNames[]"]'); + var specNameArr = []; + for (var k = 0; k < showSpecNames.length; k++) { + specNameArr[$(showSpecNames[k]).attr('data-id')] = $(showSpecNames[k]).text(); + } + $.each(specNameArr, function(sitem, sval) { + if ($.trim(goodsRes) == $.trim(sval)) { //去除空格 不然报错 + i = 0; + mui.each(val.names, function(index, value) { + + document.getElementById('specItemIds[' + +sitem + '][' + i + ']').value = value.itemId //属性值ID 新增传0 + i++; + }); + document.getElementById('specIds[' + +sitem + ']').value = val.id //规格表ID,新增传0 + document.getElementById('specPrice[' + +sitem + ']').value = val.specPrice + document.getElementById('specStock[' + +sitem + ']').value = val.specStock + if (1 == val.isDefault) { + + //checked + var inputList = $('input[name=defaultId]') + + + $.each(inputList, function(index, value) { + + this.previousElementSibling + if (sitem == this.value) { + this.checked = true + } + }) + } + + } + }) + + }) + } + } + }) + + + } else if (0 == data.isSpec) { + // $('#setNameId').html('') + getRecommend(page, pageSize) + } + if (1 == data.isSale) { + $('#isSale').prop("checked", "checked"); + } + mui.each(data, function(index, element) { + if ($('#' + index).attr("type") == "hidden" & $('#' + index).hasClass('inp')) { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex; + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index).val(element) + } else if ($('#' + index).hasClass('gallery')) { + var html = ''; + if (element.length > 0) { + var imgurls = element.split(",") ? imgurls = element.split(",") : imgurls = element; + html = '' + for (var i = 0; i < imgurls.length; i++) { + html += '
      ' + // $('#' + index+'Img['+i+']').val(hyhImgUrl(imgurls[i])) + } + var maxNum = +$('.galleryImg').last().attr('data-id') + 1; //$('.batchImg').children('.galleryImg').length - 1; + html += '
      '; + $(".batchImg").html(html) + } else { + html = ""; + html = + '
      '; + $(".batchImg").html(html) + } + } + } else if (index == 'goodsCatIdPath') { + // data.goodsCatIdPath 三级目录 + var goodsCatIdPathArr = []; + var pathArr = ["largeCat", "mediumCat", "smallCat"] + //console.log(data.goodsCatIdPath); + goodsCatIdPathArr = data.goodsCatIdPath.split('_') + goodsCatIdPathArr.pop() //移除最后一个数组元素 _ + mui.each(pathArr, function(idx, ele) { + //console.log(idx); + switch (ele) { + case 'largeCat': + getCatIdPathName(goodsCatIdPathArr[0], function(data) { + getGoodsCats('largeCat', 0, goodsCatIdPathArr[0]); + }) + break; + case 'mediumCat': + getCatIdPathName(goodsCatIdPathArr[1], function(data) { + $('#mediumCat').html('') + }); + break; + case 'smallCat': + getCatIdPathName(goodsCatIdPathArr[2], function(data) { + $('#smallCat').html('') + }); + break; + } + }) + + } else { + $('#' + index).val(element) + } + }) + if ('' != data.goodsDesc) { + var Desc = escape2Html(data.goodsDesc) + editor.txt.html(Desc) + } + } else { + mui.alert(data.msg) + } + }) + + } else { + getGoodsCats("largeCat", 0) + getRecommend(page, pageSize); + $(".title").text("添加商品") + } + function getCatIdPathName(catId, callback) { + JZL.ajax(qlgUrl("app/goodscats/getCatName"), { + catId: catId + }, function(data) { + callback(data); + }) + } + + //获取商品总规格列表 + var page = 1; + var pageSize = 100; + var isjiazai = 1; + function getRecommend(page, pageSize, defaultVal) { + var recommenddata = { + page: page ? page : 1, + pageSize: pageSize ? pageSize : 100 + } + recommenddata.shopId = shopId + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/shops/getSpecs'), recommenddata, function(data) { + + + // ////console.log(data); + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if (typeof(defaultVal) == "undefined") { + // ////console.log(1); + $.each(data.Rows, function() { + html += '' + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + } else { + // ////console.log(defaultVal); + $.each(data.Rows, function() { + if (this.id == defaultVal) { + selected = 'selected'; + } else { + selected = ''; + } + html += ''; + + }); + if (page == 1) { + $('#setNameId').html(html); + + } else { + $('#setNameId').append(html); + + } + + } + + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg); + // location.reload(); + } + isjiazai = 1; + }) + } + + //获取商品规格 + //笛卡尔积 + function calcDescartes(array) { + if (array.length < 2) return array[0] || []; + return [].reduce.call(array, function(col, set) { + var res = []; + col.forEach(function(c) { + set.forEach(function(s) { + var t = [].concat(Array.isArray(c) ? c : [c]); + t.push(s); + res.push(t); + }) + }); + return res; + }); + } + // 笛卡尔积 +// combins = function(args) { +// +// if (args.length < 2) return args[0] || []; +// // if (arguments.length < 2) return arguments[0] || []; +// //var args = Array.prototype.slice.call(arguments); +// var that = { +// index: 0, +// nth: function(n) { +// var result = [], +// d = 0; +// for (; d < this.dim; d++) { +// var l = this[d].length; +// var i = n % l; +// result.push(this[d][i]); +// n -= i; +// n /= l; +// } +// return result; +// }, +// next: function() { +// if (this.index >= size) return; +// var result = this.nth(this.index); +// this.index++; +// return result; +// } +// }; +// var size = 1; +// for (var i = 0; i < args.length; i++) { +// size = size * args[i].length; +// that[i] = args[i]; +// } +// that.size = size; +// that.dim = args.length; +// return that; +// } + + + + $('#setNameId').change(function() { + var id = $('#setNameId option:selected').attr('data-id') + // ////console.log(id); + + var html1 = ""; + if (typeof id == "undefined" || 0 == id) { + $(".pricset_con").hide() + } else { + $(".pricset_con").show() + JZL.ajax(qlgUrl('app/shops/getGoodsSpecCats'), { + shopId: shopId, + id: id + }, function(data) { + // ////console.log(data); + if (1 == data.status) { + html1 = ""; + var arr = []; + var arr2 = {}; + for (var i = 0; i < data.data.length; i++) { + arr.push(data.data[i].list); + arr2[data.data[i].catId] = data.data[i].list; + } + var calc = calcDescartes(arr); + var cIndex = 0; + var i = 0, + j = 0, + cArr = []; + while (true) { + if (cIndex >= calc.length) { + break; + } + //区分单规格和多规格 + if (Array.isArray(calc[cIndex])) { + res = calc[cIndex].join(' '); + cArr = calc[cIndex]; + cLength = calc[cIndex].length; + } else { + res = calc[cIndex]; + cArr[0] = res; + cLength = 1; + } + for (i = 0; i < cArr.length; i++) { + //获取catId + + // console.log(cArr[i]); + $.each(arr2, function(ind, val) { + //console.log(val); + $.each(val, function(index, value) { + if (value == cArr[i]) { + catId = ind; + // console.log(catId); + return; + } + }); + }); + html1 += '' + //属性值id + '' + //分类ID + ''; + } + //console.log(j); + html1 += '' + //规格表ID 新增传0 + '
      '; + j++; + cIndex++; + } + + $('.pricset_con_con').html(html1); + } else { + mui.alert(data.msg) + } + }) + } + }) + + // 下一页 + var check = true; + mui("body").on('tap', '.next_btn', function() { + check = true; + $('.isemptyinp').each(function() { + if (!this.value || "" == $.trim(this.value)) { + var label = this.previousElementSibling; + mui.alert(label.innerText + "不允许为空") + check = false; + return false; + } + }) + + if ($("#shopPrice").val() == "" & $("#setNameId option:selected").val() == "0" & check == true) { + mui.alert("商品没有属性必须输入商品价格") + check = false; + return false; + } + if ($("#setNameId option:selected").val() != 0 && check == true) { + + if ($('input[name="defaultId"]:checked').length == 0) { + mui.alert("请选择默认规格") + check = false; + return false + } + $('.pricset_con_con input').each(function() { + if ((!$(this).val() || "" == $.trim(this.value))) { + + + mui.alert("请输入数据") + $(this).focus(); + check = false; + return false; + } + }) + } + // var shopPrice= $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + // ////console.log(shopPrice) + if ($("#isSale").prop("checked")) { + isSale = "1"; + } else { + isSale = "0"; + } + if (check == true) { + $(".addcon").css("display", "none") + $(".pre").css("display", "block"); + backTop(); + } + + + }) + //预览 + $('.prelook').hide(); + // mui("body").on('tap', '.prelook', function() { + // + // + // + // }) + // 上一页 + mui('body').on('tap', '.pre_btn', function() { + $(".addcon").css("display", "block") + $(".pre").css("display", "none") + }) + // ////console.log($("#goodsDesc").text()); + + //提交 + // 判断是否上架 + var isSale = "", + setNameId, + isSpec; + //提交 + var click = false; + mui('.btn').on('tap', '.submit_btn ', function() { + // if (click == true) return; + richText = editor.txt.text() + // 判断有没有商品属性 + if ($("#setNameId option:selected").val() != 0) { + isSpec = 1; + } else { + isSpec = 0; + } + if (click == true) return; + if ($("#isSale").prop("checked")) { + isSale = "1"; + } else { + isSale = "0"; + } + var imgs = ''; + var data = $('input[name="gallery[]"]'); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + + }) + + + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + + + $('#gallery').val(imgs); + //默认选中 + var defaultPrice = $('input[name="defaultId"]:checked').parent().parent().find('input[name="specPrice[]"]').val(); + var params = JZL.getParams(".inp"); + params.shopId = shopId; + params.isSale = isSale; + params.isSpec = isSpec; + params.defaultId = $('input[name="defaultId"]:checked').val(); + params.goodsDesc = editor.txt.html(); + params.setNameId = $('#setNameId option:selected').val() + if (isSpec == 1) { + // params.shopPrice = shopPrice + $('#shopPrice').val(defaultPrice); + + } + params.shopPrice = $('#shopPrice').val() + click = true; + if (goodsId > 0) { + params.goodsId = goodsId; + + } + + JZL.ajax(qlgUrl('app/shops/addGoods'), params, function(data) { + + if (data.status == 1) { + click = false; + mui.toast(data.msg); + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + + }) + + + }) + + //获取类目 + $('.selectarea').on("change", ".area", function() { + var objs = ['largeCat', 'mediumCat', 'smallCat']; + // var areaStr = ['请选择', '请选择', '请选择']; + var level = +$(this).attr('data-level') + 1; //0 + pid = $('#' + objs[level - 1] + ' option:selected').val(); + getGoodsCats(objs[level], pid); + + }) + + //三级类目 + function getGoodsCats(obj, pid, defaultId) { + JZL.ajax(qlgUrl('app/shops/getGoodsCats'), { + pid: pid + }, + function(data) { + // ////console.log(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + // ////console.log(this); + html += '' + }); + } else { + $.each(data, function() { + if (this.catId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + $('#' + obj).html(html); + } + }) + } + + // 上传图片 + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + + that.html(html); + + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + + $(".oneImg").on("tap", '#goods', function() { + + + UP.init("goodsImg", "test", "goods") + openCamera(function(t, status, fileName, serverName) { + var html = ''; + + $(".goods").html(html); + + }) + }) + // 删除图片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + + var that = $(this) + + if (confirm('确认删除图片?')) { + that.parent().remove() + + } + }) + //上传图片到七牛; + + var uptoken = ''; + var rs = send_request(); + rs = JSON.parse(rs); + + uptoken = rs.token; + + function send_request() { + var xmlhttp = null; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + + if (xmlhttp != null) { + + serverUrl = hyhUrl('oss/qiniu.php'); + xmlhttp.open("GET", serverUrl, false); + xmlhttp.send(null); + return xmlhttp.responseText + } else { + mui.alert("Your browser does not support XMLHTTP."); + } + + }; + + + // 初始化七牛上传的方法 + function uploadInit() { + var btnId = editor.imgMenuId; + var containerId = editor.toolbarElemId; + var textElemId = editor.textElemId; + // 创建上传对象 + var uploader = Qiniu.uploader({ + runtimes: 'html5,flash,html4', //上传模式,依次退化 + browse_button: btnId, //上传选择的点选按钮,**必需** + //uptoken_url: rs, + //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) + uptoken: uptoken, + // url: 'http://up-z1.qiniup.com', + + // uptoken : '', + //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 + // unique_names: true, + // 默认 false,key为文件名。若开启该选项,SDK会为每个文件自动生成key(文件名) + // save_key: true, + // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK在前端将不对key进行任何处理 + // domain: 'http://7xrjl5.com1.z0.glb.clouddn.com/', + // domain:$('#domain').val(), + domain: rs.url, + + //bucket 域名,下载资源时用到,**必需** + container: containerId, //上传区域DOM ID,默认是browser_button的父元素, + max_file_size: '100mb', //最大文件体积限制 + flash_swf_url: '../js/plupload/Moxie.swf', //引入flash,相对路径 + filters: { + mime_types: [ + //只允许上传图片文件 (注意,extensions中,逗号后面不要加空格) + { + title: "图片文件", + extensions: "jpg,gif,png,bmp" + } + ] + }, + max_retries: 3, //上传失败最大重试次数 + dragdrop: true, //开启可拖曳上传 + drop_element: textElemId, //拖曳上传区域元素的ID,拖曳文件或文件夹后可触发上传 + chunk_size: '4mb', //分块上传时,每片的体积 + auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 + init: { + 'FilesAdded': function(up, files) { + plupload.each(files, function(file) { + // 文件添加进队列后,处理相关的事情 + // printLog('on FilesAdded'); + }); + }, + 'BeforeUpload': function(up, file) { + // 每个文件上传前,处理相关的事情 + // printLog('on BeforeUpload'); + }, + 'UploadProgress': function(up, file) { + // 显示进度 + // printLog('进度 ' + file.percent) + }, + 'FileUploaded': function(up, file, info) { + // 每个文件上传成功后,处理相关的事情 + // 其中 info 是文件上传成功后,服务端返回的json,形式如 + // { + // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", + // "key": "gogopher.jpg" + // } + // printLog(info); + // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html + + var domain = up.getOption('domain'); + var res = $.parseJSON(info); + var sourceLink = domain + res.key; //获取上传成功后的文件的Url + // 插入图片到editor + editor.cmd.do('insertHtml', '') + }, + 'Error': function(up, err, errTip) { + //上传出错时,处理相关的事情 + // printLog('on Error'); + }, + 'UploadComplete': function() { + //队列文件处理完毕后,处理相关的事情 + // printLog('on UploadComplete'); + } + // Key 函数如果有需要自行配置,无特殊需要请注释 + //, + // 'Key': function(up, file) { + // // 若想在前端对每个文件的key进行个性化处理,可以配置该函数 + // // 该配置必须要在 unique_names: false , save_key: false 时才生效 + // var key = ""; + // // do something with key here + // return key + // } + } + // domain 为七牛空间(bucket)对应的域名,选择某个空间后,可通过"空间设置->基本设置->域名设置"查看获取 + // uploader 为一个plupload对象,继承了所有plupload的方法,参考http://plupload.com/docs + }); + } + uploadInit(); + // 封装 ////console.log 函数 + function printLog(title, info) { + window.console && console.log(title, info); + } +}) diff --git a/js/addhhrrz.js b/js/addhhrrz.js new file mode 100644 index 0000000..95e78fb --- /dev/null +++ b/js/addhhrrz.js @@ -0,0 +1,174 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var hhrrzid = self.id ? self.id : 0; + //console.log(hhrrzid); + if (hhrrzid > 0) { + $('.header .title').html("编辑合伙人认证信息") + $('#home_zhezhao').hide(); + + JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalInfo'), { + id: hhrrzid + }, function(data) { + // //console.log(data); + if (data.status == 1) { + var data = data.data + $('#userName').val(data.familyName); + $('#cardId').val(data.familyIdCard); + $('#familyRelations').val(data.familyRelations); + // var html=''; + $("#familyRelationsImg").val(data.familyRelationsImg) + $("#idCardFrontImg").val(data.idCardFrontImg) + $("#idCardBackImg").val(data.idCardBackImg) + + $("#familyRelationsimg").attr("src", hyhImgUrl(data.familyRelationsImg)) + $("#idCardBack").attr("src", hyhImgUrl(data.idCardBackImg)) + + $("#idCardFront").attr("src", hyhImgUrl(data.idCardFrontImg)) + }else{ + mui.alert(data.msg) + } + }) + } else { + $('.header .title').html("添加合伙人认证信息") + } + + $('.lxy_home_zz ul').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + var wait = 120; + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').val("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + mui('.lxy_home_zz ul').on('tap', '.HQYZM', function() { + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + if ('' == pargams.userPhone) { + mui.alert('手机号不能为空!'); + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pargams.userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + + JZL.ajax(qlgUrl('app/auth/getPartnerPhoneCode'), pargams, function(data) { + data = toJson(data); + //console.log(data) + if (data.status == 1) { + telephoneNo = pargams.userPhone; + time(); + } else { + mui.alert(data.msg); + } + }); + }) + var click = 0; + + mui('.lxy_home_zz ul').on('tap', '.lxy_zz_btn', function() { + if (1 == click) return + click = 1 + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + pargams.mobileCode = $('.YZM').val(); + if ('' == pargams.mobileCode) { + mui.alert('请输入验证码!'); + return; + } + JZL.ajax(qlgUrl('app/auth/getAuthInfoByMobile'), { + mobileCode: pargams.mobileCode + }, function(data) { + //console.log(data); + if (data.status == 1) { + var data = data.data; + $('#home_zhezhao').hide(); + + $('#familyName').val(data.uName); + $('#familyIdCard').val(data.idCard); + }else{ + mui.alert (data.msg) + } + }) + + }) + $(".photos_con").on("tap", '.business', function() { + UP.init("businessImg", "test", "business") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardFront', function() { + UP.init("idCardFrontImg", "test", "idCardFront") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardBack', function() { + UP.init("idCardBackImg", "test", "idCardBack") + openCamera(); + }) + + +var bcclick = 0 + $(".bc_btn").on('tap',function() { + if (bcclick == 1) return; + bcclick = 1; + var pargams = JZL.getParams('.inp'); + pargams.id = hhrrzid + + if (pargams.positionName == '') { + mui.alert('职位名不能为空!'); + return; + } + if (pargams.stake == '') { + mui.alert('持股比例不能为空!'); + return; + } + if (pargams.businessImg == '') { + mui.alert('请上传手持营业执照照!'); + return; + } + if (pargams.idCardFrontImg == '') { + mui.alert('请上传身份证正面照!'); + return; + } + if (pargams.idCardBackImg == '') { + mui.alert('请上传身份证反面照!'); + return; + } + + + JZL.ajax(qlgUrl('app/auth/setAuthPartner'), pargams, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }) + + + }) +}) diff --git a/js/addmemorandum.js b/js/addmemorandum.js new file mode 100644 index 0000000..6e53ac0 --- /dev/null +++ b/js/addmemorandum.js @@ -0,0 +1,84 @@ +mui.plusReady(function () { + + + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: 'selectfiles', + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementById('ossfile').innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false, 'complains'); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementById('ossfile').innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if (info.status == 200) { + console.log(get_uploaded_object_name (file.name)); + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if (err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if (err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if (err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); +}) \ No newline at end of file diff --git a/js/addproperties.js b/js/addproperties.js new file mode 100644 index 0000000..6923ee9 --- /dev/null +++ b/js/addproperties.js @@ -0,0 +1,125 @@ +mui.plusReady(function() { + mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } + }); + var self = plus.webview.currentWebview(); + //console.log(self); + var shopId = self.id; + var specCatsId = self.specCatsId ? self.specCatsId : 0; + var setName = self.setName ? self.setName : 0; + var index = 0; + //console.log(shopId,specCatsId,setName); + if (specCatsId > 0) { + $(".title").html("编辑产品规格属性") + JZL.ajax(qlgUrl("app/shops/getSpecCats"), { + id: specCatsId, + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + $("#setName").val(setName) + //var specNames = $('input[name="specNames[]"]'); + //var specItems = $('input[name="specItems[]"]');// + var html = ''; + $.each(data.data, function(i, v) { + + html += + '
      ' + }) + + $('.con_con').append(html); + + // $(specNames[i]).val(data.data[i].catName) + // $(specItems[i]).val(data.data[i].itemNames) + // } + } else { + mui.alert(data.msg) + } + + }) + + } else { + $(".title").html("添加产品规格属性") + + var html = ''; + html = '
      ' + index++ + $('.con_con').append(html); + + } + + mui('body').on('tap', '.add1', function() { + var html = ''; + html += '
      ' + $('.con_con').append(html); + index++; + }) + var click = false; + mui('body').on('tap', '.bc_btn', function() { + //if (true == click) return; + click = true; + var length = $('input[name="specNames[]"]').length; + var specName,specItem; + for (var i = 0; i < length; i++) { + specName = document.getElementById('specNames[' + +i + ']'); + specItem = document.getElementById('specItems[' + +i + ']'); + if ('' == specItem.value && '' == specItem.value) { + if (specCatsId == 0) { + specName.classList.remove("inp"); + specItem.classList.remove("inp"); + document.getElementById('specNamesId[' + +i + ']').classList.remove("inp"); + document.getElementById('specItemsId[' + +i + ']').classList.remove("inp"); + } + } else { + if ('' == specName.value) { + mui.alert('请输入属性名'); + specName.focus(); + return; + } + if ('' == specItem.value) { + specItem.focus(); + mui.alert('请输入属性值'); + return; + } + specItem.value = specItem.value.replace(/,/g, ','); + } + } + var params = JZL.getParams(".inp"); +// $.each(params,function(i,v){ +// params[i] = v.replace(/,/g, ','); +// }) + params.shopId = shopId; + if (specCatsId > 0) { + params.id = specCatsId; + } + JZL.ajax(qlgUrl("app/shops/setSpecs"), params, function(data) { + //console.log(data); + if (data.status == 1) { + mui.toast('添加规格成功'); + mui.back(); + } else { + mui.alert(data.msg); + //location.reload(); + } + click = false; + }) + }) +}) diff --git a/js/addqrbb.js b/js/addqrbb.js new file mode 100644 index 0000000..d86471e --- /dev/null +++ b/js/addqrbb.js @@ -0,0 +1,89 @@ +mui.init({ + beforeback: function() {     //获得父页面的webview + var list = plus.webview.currentWebview().opener();     //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { +var self = plus.webview.currentWebview(); + // //console.log(self); + var qrbbid = self.id ? self.id : 0; + //console.log(qrbbid);// + + if (qrbbid >0) { + $('.header .title').html("编辑亲人报备信息") + JZL.ajax(qlgUrl('app/auth/getAuthFamilyReportInfo'), {id: qrbbid}, function(data) { + //console.log(data); + if (data.status == 1) { + var data = data.data + $('#familyName').val(data.familyName); + $('#familyIdCard').val(data.familyIdCard); + $('#familyRelations').val(data.familyRelations); +// var html=''; +// $('#ossfile').html(html); +$('#familyRelationsImg').val(data.familyRelationsImg) +$('#familyRelations1').attr('src',hyhImgUrl(data.familyRelationsImg)) + } else { + mui.alert(data.msg); + } + }) + }else{ + $('.header .title').html("添加亲人报备信息") + + } +var click = false; + + $(".bc_btn").on('tap', function() { + if(click ==true) return; + + click=true; + + var pargams = JZL.getParams('.inp'); + if (pargams.familyName == '') { + mui.alert('姓名不能为空!'); + return; + } + if (pargams.familyIdCard == '') { + mui.alert('身份证号不能为空!'); + return; + } + if (pargams.familyRelations == '') { + mui.alert('与户主关系不能为空!'); + return; + } + if (pargams.familyRelationsImg == '') { + mui.alert('请上传与户主关系照!'); + return; + } + // $('.bc_btn').attr('disabled','disabled'); + if (qrbbid >0) { + //console.log(qrbbid); + pargams.id=qrbbid + } + + JZL.ajax(qlgUrl('app/auth/setAuthFamilyReport'),pargams,function(data){ + + //console.log(data); + var data = toJson(data); + if(data.status == 1) { + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + + click = false + + }) +//上传图片 + $('.renzhengphoto').on('tap','.familyRelations',function () { + UP.init("familyRelationsImg", "test", "familyRelations1") + openCamera() + }) + + }) + diff --git a/js/addqrrz.js b/js/addqrrz.js new file mode 100644 index 0000000..ece9bc4 --- /dev/null +++ b/js/addqrrz.js @@ -0,0 +1,213 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var qrrzid = self.id ? self.id : 0; + //console.log(qrrzid); + if (qrrzid > 0) { + $('.header .title').html("编辑亲人认证信息") + $('#home_zhezhao').hide(); + + JZL.ajax(qlgUrl('app/auth/getAuthFamilyPersonalInfo'), { + id: qrrzid + }, function(data) { + //console.log(data); + if (data.status == 1) { + var data = data.data + $('#userName').val(data.familyName); + $('#cardId').val(data.familyIdCard); + $('#familyRelations').val(data.familyRelations); + // var html=''; + $("#familyRelationsImg").val(data.familyRelationsImg) + $("#idCardFrontImg").val(data.idCardFrontImg) + $("#idCardBackImg").val(data.idCardBackImg) + + $("#familyRelationsimg").attr("src", hyhImgUrl(data.familyRelationsImg)) + $("#idCardBack").attr("src", hyhImgUrl(data.idCardBackImg)) + $("#idCardFront").attr("src", hyhImgUrl(data.idCardFrontImg)) + } else { + mui.alert(data.msg) + } + }) + + + var click = false; + + $(".bc_btn").on('tap', function() { + if (click == true) return; + var pargams = JZL.getParams('.inp'); + pargams.id = qrrzid + if (pargams.familyRelations == '') { + mui.alert('与户主关系不能为空!'); + return; + } + if (pargams.familyRelationsImg == '') { + mui.alert('请上传与户主关系照!'); + return; + } + if (pargams.idCardFrontImg == '') { + mui.alert('请上传身份证正面照!'); + return; + } + if (pargams.idCardBackImg == '') { + mui.alert('请上传身份证反面照!'); + return; + } + click = true; + JZL.ajax(qlgUrl('app/auth/setAuthFamilyPersonal'), pargams, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + + + }) + } else { + $('.header .title').html("添加亲人认证信息") + } + + + + + + + + + + + + $('.lxy_home_zz ul').on('tap', function(e) { + e.preventDefault(); + e.stopPropagation() + }) + var wait = 120; + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').val("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + mui('.lxy_home_zz ul').on('tap', '.HQYZM', function() { + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + if ('' == pargams.userPhone) { + mui.alert('手机号不能为空!'); + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(pargams.userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + + JZL.ajax(qlgUrl('app/auth/getFamilyPhoneCode'), pargams, function(data) { + data = toJson(data); + //console.log(data) + if (data.status == 1) { + telephoneNo = pargams.userPhone; + time(); + } else { + mui.alert(data.msg); + } + }); + }) + mui('.lxy_home_zz ul').on('tap', '.lxy_zz_btn', function() { + var pargams = {} + pargams.userPhone = $('#indiv-tel').val(); + pargams.mobileCode = $('.YZM').val(); + if ('' == pargams.mobileCode) { + mui.alert('请输入验证码!'); + return; + } + JZL.ajax(qlgUrl('app/auth/getAuthInfoByMobile'), pargams, function(data) { + //console.log(data) + if (data.status == 1) { + var data = data.data; + $('#home_zhezhao').hide(); + $('#userName').val(data.uName); + $('#cardId').val(data.idCard); + $('#telephone').val(pargams.userPhone); + } else { + mui.alert(data.msg); + } + }) + + + }) + $(".photos_con").on("tap", '.familyRelations', function() { + UP.init("familyRelationsImg", "test", "familyRelationsimg") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardFront', function() { + UP.init("idCardFrontImg", "test", "idCardFront") + openCamera(); + }) + $(".photos_con").on("tap", '.idCardBack', function() { + UP.init("idCardBackImg", "test", "idCardBack") + openCamera(); + }) + + var click = false; + + $(".bc_btn").on('tap', function() { + if (click == true) return; + var pargams = JZL.getParams('.inp'); + + if (pargams.familyRelations == '') { + mui.alert('与户主关系不能为空!'); + return; + } + if (pargams.familyRelationsImg == '') { + mui.alert('请上传与户主关系照!'); + return; + } + if (pargams.idCardFrontImg == '') { + mui.alert('请上传身份证正面照!'); + return; + } + if (pargams.idCardBackImg == '') { + mui.alert('请上传身份证反面照!'); + return; + } + // $('.bc_btn').attr('disabled','disabled'); + click = true; + JZL.ajax(qlgUrl('app/auth/setAuthFamilyPersonal'), pargams, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + + + }) +}) diff --git a/js/addshopping.js b/js/addshopping.js new file mode 100644 index 0000000..e69de29 diff --git a/js/addyhk.js b/js/addyhk.js new file mode 100644 index 0000000..2eb3497 --- /dev/null +++ b/js/addyhk.js @@ -0,0 +1,98 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + + $('#_select').on('change', function() { + var selectValue = $('#_select option:selected').text(); //选中select的内容 + // alert("selectValue" + selectValue); + + $("#bankUserName").val(selectValue); + }) + var self = plus.webview.currentWebview(); + ////console.log(self); + var yhkid = self.id ? self.id : 0; + // //console.log(yhkid);// + + if (yhkid > 0) { + $('.header .title').html("编辑银行卡") + JZL.ajax(qlgUrl('app/auth/getCompanyBankInfo'), { + id: yhkid + }, function(data) { + ////console.log(data); + if (data.status == 1) { + var data = data.data + $('#_select').css("background", "none"); + $("#bankUserName").val(data.accountName); + $('.bankname').prepend(''); + $("#cardnum").val(data.bankNo); + } else { + mui.alert(data.msg); + } + }) + }else{ + $('.header .title').html("添加银行卡") + + } + // 选择银行 + JZL.ajax(qlgUrl('app/auth/getBankNameList'), {}, function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(data) + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('.bankname').append(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + +//提交 +var click = false + $('.bc_btn').on('tap', function() { + if(true == click) return; + click =true; + var pargams = {}; + //编辑页面需要加id + if (yhkid > 0) { + pargams.id = yhkid; + } + pargams.accountName = $("#bankUserName").val(); + pargams.bankName = $(".bankname option:selected").text(); + pargams.bankNo = $("#cardnum").val(); + if ('' == pargams.accountName) { + mui.alert("请输入持卡人姓名") + return; + } + if ('' == pargams.bankNo) { + mui.alert("请输入银行卡号") + return; + } + if ('选择银行' == pargams.bankName) { + mui.alert("请输入银行名称") + return; + } + JZL.ajax(qlgUrl('app/auth/setBank'), pargams, function(data) { + data = toJson(data); + ////console.log(data) + if (data.status == 1) { + mui.back(); + } else { + mui.alert(data.msg); + } + }); + + }) +}) diff --git a/js/applicationopen.js b/js/applicationopen.js new file mode 100644 index 0000000..1e01209 --- /dev/null +++ b/js/applicationopen.js @@ -0,0 +1,443 @@ +mui.plusReady(function() { + mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } + }); + var shopAddress = ""; + $('.header_con').append('

      保存

      ') + $(".oper .next").css("width", "100%") + $(".oper .pre").css("width", "0px") + // 判断是编辑还是新增 + var self = plus.webview.currentWebview(); + // //console.log(self); + var shopId = self.id ? self.id : 0; + // //console.log(shopid); + if (shopId > 0) { + //console.log(22); + JZL.ajax(qlgUrl('app/shops/getShopJoinInfo'), { + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + getMap(data.lng, data.lat); + mui.each(data, function(index, element) { + //console.log(element); + if ($('#' + index).attr("type") == "hidden") { + var imgindex = index.substring(0, index.length - 3); + var obj = '#' + imgindex + '' + // //console.log('#' + imgindex + '') + if (imgindex != "") { + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index + '').val(element) + } + } + + } else if ($('#' + index).is("select")) { + + switch (index) { + case 'provinceId': + getAreaName(element, 1, function(data) { + getArea(index, 1, 0, '请选择省', data.data.areaId); + // $('#'+index).html('') + }) + break; + case 'cityId': + getAreaName(element, 2, function(data) { + $('#' + index).html('') + }); + break; + case 'countyId': + getAreaName(element, 3, function(data) { + $('#' + index).html('') + }); + break; + case 'townId': + getAreaName(element, 4, function(data) { + $('#' + index).html('') + }); + break; + case 'villageId': + getAreaName(element, 5, function(data) { + $('#' + index).html('') + }); + break; + case 'bankName': + getBankList(element); + + break; + default: + break; + } + // $('#'+index+' option:selected').text(element) + // $('#'+index+' option:selected').attr('value',element) + // $('#'+index+' option:selected').attr('text',element) + } else { + $('#' + index).val(element) + // //console.log(this); + } + }) + shopAddress = $('#shopAddress').val(); + } else { + mui.alert(data.msg) + } + }) + setTimeout(function() { + $('#shopAddress').val(shopAddress) + }, 1000) + } else { + + getBankList(); + getArea('provinceId', 1, 0, '请选择省'); + getLocation(function(data) { + //console.log(11); + if (1 == data.status) { + $('#lng').val(data.lng); + $('#lat').val(data.lat); + getMap(data.lng, data.lat) + //console.log(JSON.stringify(data)); + } else { + mui.alert(data.errStr); + return; + } + }); + JZL.getItems('editorShopInfo') + } + + function getAreaName(id, level, callback) { + JZL.ajax(qlgUrl("app/Position/getAreaName"), { + id: id, + level: level + }, function(data) { + callback(data); + }) + } + //下一步 + mui('.next').on('tap', '.bc_btn', function() { + var params = JZL.getParams(".inp") + // //console.log(params); + // var html= + var idx = $(this).index() + 1; + var prenum = idx + 1; + // checkStep(idx) + if (checkStep(idx)) { + if (prenum !== 1) { + // //console.log(1); + $(".pre").attr("display", "block") + $(".oper .pre").css("width", "50%") + $(".oper .next").css("width", "50%") + } + if (prenum == 1) { + // //console.log(1); + $(".oper .next").css("width", "100%") + $(".oper .pre").css("width", "0px") + } + $('.con-nav ul li').eq(idx).addClass("active") + $('.next .bc_btn').eq(idx).show().siblings().hide() + $('.pre .pre_btn').eq(idx).show().siblings().hide() + $('.con-content .num').eq(idx).show().siblings().hide() + JZL.saveItems('.localinp', 'auth_personal'); + backTop() + } + }) + //上一步 + mui('.pre').on('tap', '.pre_btn', function() { + var idx = $(this).index() - 1; + var prenum = idx + 1; + if (checkStep(idx)) { + if (prenum !== 1) { + $(".pre").attr("display", "block") + $(".oper .pre").css("width", "50%") + $(".oper .next").css("width", "50%") + } + if (prenum == 1) { + $(".oper .next").css("width", "100%") + $(".oper .pre").css("width", "0px") + } + $('.con-nav ul li').eq(idx + 1).removeClass("active") + $('.next .bc_btn').eq(idx).show().siblings().hide() + $('.pre .pre_btn').eq(idx).show().siblings().hide() + $('.con-content .num').eq(idx).show().siblings().hide() + JZL.getItems('auth_personal'); + backTop() + } + }) + //五级联动 + $('.selectarea').on("change", ".area", function() { + var areas = ['province', 'city', 'county', 'town', 'village']; + var areaStr = ['请选择省', '请选择市', '选择区县', '选择乡镇', '选择村社区']; + var level = $(this).attr('data-level'); //1 + pid = $("#" + areas[level - 1] + "Id option:selected").val(); + var sonLevel = +level + 1; + getArea(areas[level] + 'Id', sonLevel, pid, areaStr[level]); + + }) + + function getArea(area, level, pid, selectAreaStr, defaultId) { + JZL.ajax(qlgUrl('app/Position/listQuery'), { + level: level, + pid: pid + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('undefined' == typeof(defaultId)) { + $.each(data, function() { + html += '' + }); + } else { + $.each(data, function() { + if (this.areaId == defaultId) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + + // //console.log(area) + $('#' + area).html(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + mui.alert(data.msg) + } + }) + } + + // 上传图片 + + $(".photos_con").on("tap", '.sfzzm', function() { + UP.init("idCardFrontImg", "test", "idCardFront") + openCamera(); + }) + + $(".photos_con").on("tap", '.sfzfm', function() { + UP.init("idCardBackImg", "test", "idCardBack") + openCamera(); + }) + $(".photos_con").on("tap", '.weituoshu', function() { + UP.init("commissionImg", "test", "commission") + openCamera(); + }) + $(".photos_con").on("tap", '.shopsimg', function() { + UP.init("businessLicenceImg", "test", "businessLicence") + openCamera(); + }) + $(".photos_con").on("tap", '.querenshu', function() { + UP.init("confirmationImg", "test", "confirmation") + openCamera(); + }) + + function getBankList(defaultBankName) { + JZL.ajax(qlgUrl('app/auth/getBankNameList'), { + + }, + function(data) { + //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(data) + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + // var html=""; + if ('undefined' == typeof(defaultBankName)) { + $.each(data, function() { + // //console.log(data); + html += '' + }); + } else { + // //console.log(data); + $.each(data, function() { + // //console.log(data); + if (this.bankName == defaultBankName) { + selected = 'selected'; + } else { + selected = ''; + } + html += '' + }); + } + + $('.bankname').append(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + mui.alert(data.msg) + } + }) + } + + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 112 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.confirmationtext_con').html(data.articleContent) + + // } + + }); + + + function checkStep(step) { + var params = JZL.getParams(".inp") + // //console.log(params); + // //console.log(step); + switch (step) { + case 1: + if ('' == params.shopName) { + mui.alert("请输入店铺名称") + return; + } + if ('' == params.phone) { + mui.alert("请输入手机号码") + //console.log(params); + return; + } + if ('' == params.userName) { + mui.alert("请输入姓名") + return; + + } + + if ('' == params.provinceId) { + mui.alert("请输入所在省") + return; + + } + if ('' == params.cityId) { + mui.alert("请输入所在市") + return; + + } + if ('' == params.countyId) { + mui.alert("请输入所在区") + return; + + } + if ('' == params.townId) { + mui.alert("请输入所在镇") + return; + } + if ('' == params.villageId) { + mui.alert("请输入所在村") + return; + } + if ('' == params.shopAddress) { + mui.alert("请输入详细地址") + return; + } + if ('' == params.lat) { + mui.alert("请在地图上选择位置") + return; + } + break; + case 2: + if ('' == params.accountName) { + mui.alert("请输入持卡人姓名") + return; + + } + if ('' == params.bankName) { + mui.alert("请输入银行名称") + return; + + } + if ('' == params.bankNo) { + mui.alert("请输入银行卡号") + return; + + } + if ('' == params.userName) { + mui.alert("请输入开户行") + return; + + } + break; + case 3: + if ('' == params.idCardFrontImg) { + mui.alert("请上传身份证正面照") + return; + } + if ('' == params.idCardBackImg) { + mui.alert("请上传身份证反面照") + return; + } + if ('' == params.commissionImg) { + mui.alert("请上传直营人委托书照片") + return; + } + if ('' == params.businessLicenceImg) { + mui.alert("请上传营业执照照片") + return; + } + break; + case 4: + + + if ('' == params.commissionImg) { + mui.alert("请上传手持确认书照片") + return; + } + + break; + default: + break; + } + return true; + } + + // 保存 + mui('.header').on('tap','.header_con_bc',function(){ + JZL.saveItems (".inp","editorShopInfo"); + mui.toast('保存成功'); + }) + //提交 + var flag = false; + + + mui('.next').on('tap', '.finish', function() { + if (flag == true) return; + flag = true + var params = JZL.getParams(".inp") + if (shopId > 0) { + params.shopId = shopId + } + + JZL.ajax(qlgUrl('app/shops/shopJoin'), params, function(data) { + + //console.log(data); + if (1 == data.status) { + // JZL.saveItems ("inp","editorShopInfo"); + mui.toast(data.msg) + localStorage.removeItem("editorShopInfo") + mui.back() + // JZL.openWindow("myshops.html", "myshops.html") + // JZL.openWindow("myshop.html", "myshop.html") + + } else { + mui.alert(data.msg) + } + + + }) + + }) + +}) diff --git a/js/appraise.js b/js/appraise.js new file mode 100644 index 0000000..37d3996 --- /dev/null +++ b/js/appraise.js @@ -0,0 +1,319 @@ +var isjiazai = 1; +var type = ''; +var page = 1 + +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var data_id = self.goodsId; + // //console.log(data_id) + + function getData(page, pagesize, type) { + var set_data = { + goodsId: data_id, + type: type ? type : '', + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + if (isjiazai == 1) { + isjiazai = 0 + + } else { + return; + } + mui.ajax(qlgUrl('app/goodsappraises/getById'), { + + data: set_data, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + var html = ''; + + if (data.status == 1) { + data = data.data; + $('#sum').html('全部(' + data.sum + ')'); + $('#pic').html('有图(' + data.picNum + ')'); + $('#bad').html('差评(' + data.badNum + ')'); + $('#good').html('中评(' + data.goodNum + ')'); + $('#best').html('好评(' + data.bestNum + ')'); + if (data.Rows == '') { + if (page == 1) { + $('.pj_list').html('

      没有更多评价

      '); + } else { + $('.pj_list').append( + '

      没有更多评价

      '); + } + + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + var userImg = ''; + if (this.userPhoto) { + userImg = hyhImgUrl(this.userPhoto); + } else { + userImg = '../img/mujiimg.png' + } + + html += '

      ' + this.loginName + + '

      ' + this.content + '
      '; + + if (this.shopReply != null) { + html += '
      商家回复:' + this.shopReply + + '
      '; + } + html += '
      ' + this.goodsSpecNames + '
      ' + this.createTime + + '
      '; + if (this.images != '' && this.images != null) { + html += '
      '; + } + + html += '
      '; + + }); + if (page == 1) { + $('.pj_list').html(html); + } else { + $('.pj_list').append(html); + } + + isjiazai = 1; + + setTimeout(function() { + $('.img-dv a').each(function() { + var that = $(this); + var img_ = new Image() + img_.src = that.attr('href'); + img_.onload = function() { + that.attr('data-size', img_.width + 'x' + img_.height); + } + }); + document.addEventListener('DOMAttrModified', function() { + $('.img-dv a').each(function() { + var that = $(this); + var img_ = new Image() + img_.src = that.attr('href'); + img_.onload = function() { + that.attr('data-size', img_.width + 'x' + img_.height); + } + }); + }, false); + + var initPhotoSwipeFromDOM = function(gallerySelector) { + // 解析来自DOM元素幻灯片数据(URL,标题,大小...) + var parseThumbnailElements = function(el) { + var thumbElements = el.childNodes, + numNodes = thumbElements.length, + items = [], + figureEl, + linkEl, + size, + item, + divEl; + for (var i = 0; i < numNodes; i++) { + figureEl = thumbElements[i]; //
      element + // 仅包括元素节点 + if (figureEl.nodeType !== 1) { + continue; + } + divEl = figureEl.children[0]; + linkEl = divEl.children[0]; // element + size = linkEl.getAttribute('data-size').split('x'); + // 创建幻灯片对象 + item = { + src: linkEl.getAttribute('href'), + w: parseInt(size[0], 10), + h: parseInt(size[1], 10) + // w: '100%' + }; + if (figureEl.children.length > 1) { + item.title = figureEl.children[1].innerHTML; + } + if (linkEl.children.length > 0) { + // 缩略图节点, 检索缩略图网址 + item.msrc = linkEl.children[0].getAttribute('src'); + } + item.el = figureEl; // 保存链接元素 for getThumbBoundsFn + items.push(item); + } + return items; + }; + + // 查找最近的父节点 + var closest = function closest(el, fn) { + return el && (fn(el) ? el : closest(el.parentNode, fn)); + }; + + // 当用户点击缩略图触发 + var onThumbnailsClick = function(e) { + e = e || window.event; + e.preventDefault ? e.preventDefault() : e.returnValue = false; + var eTarget = e.target || e.srcElement; + var clickedListItem = closest(eTarget, function(el) { + return (el.tagName && el.tagName.toUpperCase() === 'FIGURE'); + }); + if (!clickedListItem) { + return; + } + var clickedGallery = clickedListItem.parentNode, + childNodes = clickedListItem.parentNode.childNodes, + numChildNodes = childNodes.length, + nodeIndex = 0, + index; + for (var i = 0; i < numChildNodes; i++) { + if (childNodes[i].nodeType !== 1) { + continue; + } + if (childNodes[i] === clickedListItem) { + index = nodeIndex; + break; + } + nodeIndex++; + } + if (index >= 0) { + openPhotoSwipe(index, clickedGallery); + } + return false; + }; + + var photoswipeParseHash = function() { + var hash = window.location.hash.substring(1), + params = {}; + if (hash.length < 5) { + return params; + } + var vars = hash.split('&'); + for (var i = 0; i < vars.length; i++) { + if (!vars[i]) { + continue; + } + var pair = vars[i].split('='); + if (pair.length < 2) { + continue; + } + params[pair[0]] = pair[1]; + } + if (params.gid) { + params.gid = parseInt(params.gid, 10); + } + return params; + }; + + var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) { + var pswpElement = document.querySelectorAll('.pswp')[0], + gallery, + options, + items; + items = parseThumbnailElements(galleryElement); + // 这里可以定义参数 + options = { + barsSize: { + top: 100, + bottom: 100 + }, + fullscreenEl: false, + shareButtons: [{ + id: 'wechat', + label: '分享微信', + url: '#' + }, + { + id: 'weibo', + label: '新浪微博', + url: '#' + }, + { + id: 'download', + label: '保存图片', + url: '{{raw_image_url}}', + download: true + } + ], + galleryUID: galleryElement.getAttribute('data-pswp-uid'), + getThumbBoundsFn: function(index) { + var thumbnail = items[index].el.getElementsByTagName('img')[0], // find thumbnail + pageYScroll = window.pageYOffset || document.documentElement.scrollTop, + rect = thumbnail.getBoundingClientRect(); + return { + x: rect.left, + y: rect.top + pageYScroll, + w: rect.width + }; + } + }; + if (fromURL) { + if (options.galleryPIDs) { + for (var j = 0; j < items.length; j++) { + if (items[j].pid == index) { + options.index = j; + break; + } + } + } else { + options.index = parseInt(index, 10) - 1; + } + } else { + options.index = parseInt(index, 10); + } + if (isNaN(options.index)) { + return; + } + if (disableAnimation) { + options.showAnimationDuration = 0; + } + gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); + gallery.init(); + }; + + var galleryElements = document.querySelectorAll(gallerySelector); + for (var i = 0, l = galleryElements.length; i < l; i++) { + galleryElements[i].setAttribute('data-pswp-uid', i + 1); + galleryElements[i].onclick = onThumbnailsClick; + } + var hashData = photoswipeParseHash(); + if (hashData.pid && hashData.gid) { + openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true); + } + }; + + initPhotoSwipeFromDOM('.my-gallery'); + }, 500) + } else { + //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + + }) + } + getData(1, 10) + $('.nav').on('tap', '.nav_', function() { + $(this).addClass('on').siblings().removeClass('on'); + type = $(this).attr('id'); + page = 1; + isjiazai = 1; + getData(page, 10, type) + }) + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getData(page, 10, type) + } + + } + }) + +}) diff --git a/js/bill.js b/js/bill.js new file mode 100644 index 0000000..231248c --- /dev/null +++ b/js/bill.js @@ -0,0 +1,72 @@ +var vouchersType = '', + isExpected = ''; +var data_href = ''; +var pageSize = 20; +var count = 1; +var isLoading = false; +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + //console.log(self) + vouchersType = self.data_type; + isExpected = self.data_expected; + data_href = data_href; + getBillList(count, pageSize) + + function getBillList(count, pageSize) { + if (true == isLoading) return; + isLoading = true; + JZL.ajax(qlgUrl('app/Uservouchers/getVouchers'), { + page: count, + perPage: pageSize, + vouchersType: vouchersType, + isExpected: isExpected, + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + //console.log(data); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.Rows == '') { + $('.con').append( + '

      没有更多数据

      '); + return; + } + var html = '' + $.each(data.Rows, function() { + html += + '

      ' + + this.remark + '

      ' + this.createTime + '

      -' + this.num + + '
      '; + + }) + if (count == 1) { + $('.con').html(html); + } else { + $('.con').append(html); + } + + } else { + mui.alert(data.msg) + } + isLoading = false; + }); + } + + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isLoading == false) { + count++; + getBillList(count, pageSize) + } + } + }) +}) diff --git a/js/cash-out.js b/js/cash-out.js new file mode 100644 index 0000000..edef770 --- /dev/null +++ b/js/cash-out.js @@ -0,0 +1,110 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); + +mui.plusReady(function() { + //获取数值 + $('.bg').css("display", 'none') + var self = plus.webview.currentWebview() + var shopId = self.id; + var totlemoney = ""; + JZL.ajax(qlgUrl('app/users/getMoney'), { + type: 3 + }, function(data) { + if (1 == data.status) { + var data = data.data; + totlemoney = data.wangNum; + // $('.idc-total span').html('¥'+data.wangNum) + $('#money').val(totlemoney) + } else { + mui.alert(data.msg) + } + $('.btns').on('tap', '.sqtx', function() { + if ($('#money').val() > totlemoney) { + mui.alert("超过最大提现金额") + return; + } else if ('' == $('#money').val()) { + mui.alert("请输入提现金额") + return; + } else if (1 > $('#money').val()) { + mui.alert("提现金额不能小于1") + return; + } + $('.bg').css('display', 'block'); + $('.footer').hide(); + JZL.ajax(qlgUrl('app/shops/getBank'), { + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data + $('#bankUserName').val(data.accountName) + // $('.bankname').prepend('') + $('.bankname').val(data.bankName) + $('#cardnum').val(data.bankNo) + $('#money').on('focus', function() { + $('.bg').css('display', 'none'); + $('.footer').show(); + }) + + } else { + mui.alert(data.msg) + } + }) + }) + $('.bg').on('tap', '.qrtx', function() { + // mui.prompt("请输入操作密码:") + mui.prompt('请输入操作密码', '', '全亮共商城', ['取消', '忘记密码', '确定'], function(e) { + //console.log(e); + if (2 == e.index) { + var payPwd = e.value; + if ('' == payPwd) { + mui.alert('密码不能为空') + return; + } + var money = $('#money').val(); + JZL.ajax(qlgUrl('app/shops/withdrawal'), { + payPwd: payPwd, + money: money, + shopId: shopId + }, function(data) { + //console.log(data); + if (1 == data.status) { + mui.toast(data.msg) + mui.back() + } else { + mui.alert(data.msg) + } + }) + } else if (1 == e.index) { + JZL.openWindow('setting_fogetPwd.html', 'setting_fogetPwd.html') + } + + }, 'div') + document.querySelector('.mui-popup-input input').type = 'password' + + // var mark=mui.prompt("请输入操作密码:") + // //console.log(document.querySelector('.mui-popup-input input').value) + // if(null!=mark){ + // var payPwd =document.getElementById('mark') + // //console.log(payPwd); + // } + }) + $('.bg').on('tap', '.mui-icon-left-nav', function() { + $('.bg').css('display', 'none'); + $('.footer').show(); + }) + }) + + $('.btns').on('tap', '.ckmx', function() { + JZL.openWindow("vouchers.html", "vouchers.html", { + data_href: "wang", + isExpected: 1 + }) + }) +}) diff --git a/js/choiceness.js b/js/choiceness.js new file mode 100644 index 0000000..f061b73 --- /dev/null +++ b/js/choiceness.js @@ -0,0 +1,316 @@ +$('.mui-slider-indicator').html('') + +mui.init({ + pullRefresh: { + container: '#pullrefresh', + down: { + style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 + color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 + height: '50px', //可选,默认50px.下拉刷新控件的高度, + range: '100px', //可选 默认100px,控件可下拉拖拽的范围 + offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 + // auto: true, //可选,默认false.首次加载自动上拉刷新一次 + contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 + contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 + contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 + callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; + }, + up: { + contentrefresh: '正在加载...', + callback: pullupRefresh + } + } +}); +var count = 1; + +function pullupRefresh() { + count += 1; + ////console.log(count) + setTimeout(function() { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(); + + // //console.log(order_class) + mui.ajax(qlgUrl('addon/hyhchosen-Hyhchosen-getChosen'), { + + data: { + page: count, + goodsSize: 3, + pagesize: 10 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + data = data.data; + if (data.Rows.length == 0) { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); + return; + } + var html = '' + $.each(data.Rows, function() { + html += '

      ' + this.shopName + + '

      ' + this.newTime + + '

      + 关注
      '; + + $.each(this.goods, function() { + + html += '

      ¥' + this.shopPrice + '

      '; + }); + html += '
      ' + }); + $('.con').append(html); + } else { + mui.alert(data.msg) + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }, 500); +} + +/** + * 下拉刷新具体业务实现 + */ +function pulldownRefresh() { + setTimeout(function() { + window.location.reload(); + mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed + }, 1500); +} +mui.plusReady(function() { + function openAds(item) { + if (item.attr('data-adURL') == '' || item.attr('data-targetType') == 0) { + return; + } + var adURL = item.attr('data-adURL'); + var targetType = ''; + var data_set = {}; + if (item.attr('data-targetType') == 1) { + //商品 + targetType = 'details.html'; + data_set = { + data_id: adURL + } + } else if (item.attr('data-targetType') == 2) { + //商家 + targetType = 'storeout.html'; + + if (adURL == 1) { + // targetType='self_shop.html'; + } + data_set = { + shopId: adURL + } + } else if (item.attr('data-targetType') == 3) { + //活动 + targetType = adURL + '.html'; + } + mui.openWindow({ + url: targetType, + id: targetType + adURL, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: data_set, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + var data = ''; + mui.ajax(qlgUrl('addon/hyhchosen-Hyhchosen-getChosen'), { + data: { + pagesize: 10, + goodsSize: 3, + page: 1 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + + data = data.data; + + var html = ''; + $.each(data.Rows, function() { + html += '

      ' + this.shopName + + '

      ' + this.newTime + + '

      + 关注
      '; + + $.each(this.goods, function() { + html += '

      ¥' + this.shopPrice + '

      '; + }); + html += '
      ' + }); + $('.con').html(html) + if (data.chosenAdsList.length != 0) { + var html1 = '
      '; + var html2 = '
      '; + $.each(data.chosenAdsList, function() { + html1 += '
      ' + html2 += '
      ' + }) + html2 += '
      ' + html1 += '
      ' + html1 += html2; + $('#slider').html(html1); + + mui("#slider").slider({ + interval: 5000 + }); + document.getElementsByClassName('mui-indicator')[0].className += ' mui-active'; + } + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + mui('.con').on('tap', '.storename', function() { + var shopId = $(this).parent().attr('data-shopId'); + var url = 'storeout.html'; + if (shopId == 1) { + // url='self_shop.html' + } + mui.openWindow({ + url: url, + id: url + shopId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + shopId: shopId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.bc_img', function() { + var goodsId = $(this).attr('data-goodsId'); + mui.openWindow({ + url: 'details.html', + id: 'details.html' + goodsId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_id: goodsId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.btn_gz', function() { + var shopId = $(this).parent().attr('data-shopId'); + var that = $(this); + mui.ajax(hyhUrl('app/Favorites/add'), { + + data: { + id: shopId, + type: 1 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + that.html('已关注'); + that.addClass('btn_gz1').removeClass('btn_gz'); + } else { + mui.alert(data.msg) ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + //轮播图跳转 + $('#slider').on('tap', '.mui-slider-item', function() { + openAds($(this)); + }) + +}) diff --git a/js/commercial.js b/js/commercial.js new file mode 100644 index 0000000..e080b3a --- /dev/null +++ b/js/commercial.js @@ -0,0 +1,222 @@ +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + //console.log(self); + + + var id = self.ssid ? self.ssid : ''; + JZL.ajax(qlgUrl('app/shops/getUserUpdate'), { + applyLevel: 3 + }, function(data) { + //console.log(data); + if (1 == data.status & undefined != data.data) { + var data = data.data; + + if (0 == data.status || 2 == data.status) { + if (id == '') { + id = data.id + } + getShopList(data.shopId); + + $('#confirm').attr('src', hyhImgUrl(data.confirmImg)) + $('#confirmImg').val(data.confirmImg) + + var imgs = data.shopImg + imgs = Array.from(imgs.split(',')) + //console.log(imgs); + var html = ""; + var html1 = ''; + mui.each(imgs, function(index, element) { + //console.log(index, element); + html += '
      '; + }) + // $(".batchImg").html(html); + + // var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + var maxNum = imgs.length; + + + // if (num == maxNum) { + // maxNum++; + html += '
      '; + $(".batchImg").html(html); + // } + + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 116 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + + } else if (1 == data.status) { + //tiaozhuandao shangdu yemian + } + } else { + getShopList(); + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 116 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + } + }) + + + // 上传图片 + $('.photos_con').on('tap', '.confirm', function() { + UP.init("confirmImg", "test", "confirm") + openCamera() + }) + // 获取店铺信息 + + function getShopList(defaultShopId) { + + JZL.ajax(qlgUrl('app/shops/userShopList'), { + shopType: 1 + }, function(data) { + //console.log(data); + if (1 == data.status) { + var html = ""; + html = ``; + if (undefined == typeof defaultShop) { + + mui.each(data.data, function() { + // //console.log(index, element); + html += ``; + }) + } else { + mui.each(data.data, function() { + if (this.shopId == defaultShopId) { + selected = 'selected'; + } else { + selected = ''; + } + html += ``; + }) + + } + $("#shopId").html(html) + } else { + mui.alert(data.msg) + } + // }) + }) + } + + $(".batchImg").on("tap", '.galleryImg', function() { + var num = $(this).attr('data-id'); + UP.init("gallery[" + num + "]", "test", "galleryImg[" + num + "]", 1); + var that = $(this); + openCamera(function(t, status, fileName, serverName) { + var html = '
      '; + + that.html(html); + + var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (num == maxNum) { + maxNum++; + html = '
      '; + $(".batchImg").append(html); + } + }); + }) + //删除照片 + $(".batchImg").on('tap', '.delete', function(e) { + + e.preventDefault(); + e.stopPropagation() + + // //console.log(this); + var that = $(this) + //var idx = that.parent().attr('data-id'); + //var maxNum = $('.galleryImg').last().attr('data-id'); //$('.batchImg').children('.galleryImg').length - 1; + if (confirm('确认删除图片?')) { + that.parent().remove() + //delete galleryarr[idx]; + } + }) + //获取协议 + JZL.ajax(qlgUrl('app/Tags/articleDetail'), { + articleId: 116 + }, function(data) { + //console.log(data); + // if (1==data.status) { + // $('.zcxycontent').html(data.data.articleContent) + $('.zcxycontent').html(data.articleContent) + + // } + + }) + var click = 0; + $('.down').on('tap', '.btn', function() { + + if (click == 1) { + return; + } + click = 1 + var imgs = ''; + var data = $('input[name="gallery[]"]'); + //console.log(data); + $.each(data, function() { + if ('' != $(this).val()) + imgs = $(this).val() + ',' + imgs; + }) + imgs = imgs.substring(0, imgs.lastIndexOf(',')); + $('#shopImg').val(imgs); + if ('' == $('#shopId option:selected').val()) { + mui.alert('请选择要升级的店铺名称') + return; + } + + if ('' == $('#confirmImg').val()) { + mui.alert('请上传确认书照片') + return; + } + if ('' == $('#shopImg').val()) { + mui.alert('请上传店铺照片') + return; + } + + + var params = JZL.getParams(".inp"); + params.applyLevel = 3; + if ("" != id) { + params.id = id; + + } + JZL.ajax(qlgUrl('app/shops/userUpdate'), params, function(data) { + // //console.log(data); + if (1 == data.status) { + mui.back() + } else { + mui.alert(data.msg) + } + }) + }) +}) diff --git a/js/common.js b/js/common.js new file mode 100644 index 0000000..e1c9f9b --- /dev/null +++ b/js/common.js @@ -0,0 +1,474 @@ +var is_app = 1; +var imgUrl = 'http://img.zgqlg.com.cn/'; +var webUrl = 'http://www.zgqlg.com.cn/'; +var webUrl1 = 'http://www.zgqlg.com.cn/'; +var cssUrl = localStorage.getItem("cssUrl"); +var jsUrl = localStorage.getItem("jsUrl"); +var version = localStorage.getItem("version"); +function qlgUrl(url) { + return webUrl + url; +} + +function hyhUrl(url) { + return webUrl + url; +} + +function llUrl(url) { + return webUrl + url; +} + +function hgUrl(url) { + return webUrl + url; +} + +function kxUrl(url) { + return webUrl + url; +} + +function hyhImgUrl(url) { + return imgUrl + url; +} + +function ectUrl(url) { + return webUrl + url; +} + +function ectImgUrl(url) { + return imgUrl + url; +} + +function cssUrl(url) { + return '../css/' + url; +} + +function formatDate(date) { + var d = new Date(date), + + month = '' + (d.getMonth() + 1), + day = '' + d.getDate(), + year = d.getFullYear(), + hour = d.getHours(), + minute =d.getMinutes(), + second = d.getSeconds(); + console.log(hour ); + if (month.length < 2) month = '0' + month; + if (day.length < 2) day = '0' + day; + if (hour< 10) hour = '0' + hour; + if (minute< 10) minute = '0' + minute; + if (second < 10) second = '0' + second; + // return [year, month, day].join('-')+" "+[hour,minute,second].join(':'); + return year+"年"+month +"月"+day+"日"; +} + +function backTop() { + mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 0); +} +function bMapTransQQMap(lng, lat) { + var x_pi = 3.14159265358979324 * 3000.0 / 180.0; + var x = lng - 0.0065; + var y = lat - 0.006; + var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); + var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); + var lngs = z * Math.cos(theta); + var lats = z * Math.sin(theta); + + return { + lng: lngs, + lat: lats + } +} +function toJson(str, notLimit) { + var json = {}; + if (str) { + try { + if (typeof(str) == "object") { + json = str; + } else { + json = eval("(" + str + ")"); + } + if(json.status && (json.status == '-555' || json.status == '-666')){ + //topingzheng + var type = 0; + if(json.status == '-666') type = 1; + JZL.openWindow("paymentVoucher.html",json.data.shopId,{'type':type}); + } + if (!notLimit) { + if (json.status && json.status == '-999') { + //console.log(str.msg) + inLogin(); + + } + } + } catch (e) { + mui.alert("系统发生错误:" + e.getMessage); + json = {}; + } + return json; + } else { + return; + } +} +var JZL = JZL || {}; +JZL.js_init = function(cdn) { + var typeName = 'script'; + var type = 'text/javascript'; + var element, i = 0, + file, parent = document.body; + + for (i; i < cdn.length; i++) { + file = cdn[i]; + element = document.createElement(typeName); + element.type = type; + element.src = file; + parent.appendChild(element); + //free file's value + file = null; + } + /* + * Cleanup at end of function, which isn't necessary unless lots of memory is being + * used up. + * No point nulling a Number, however. In some ECMAScript implementations + * (ActionScript 3), this throws a warning. + */ + //empty array + cdn.splice(0, cdn.length); + //clear variable values + element = null; + parent = null; + cdn = null; +} +JZL.css_init = function(cdn) { + var typeName = 'style'; + var type = 'text/css'; + var rel = 'stylesheet'; + var element, i = 0, + file, head, parent = document.head || document.getElementsByTagName('head')[0]; + for (i; i < cdn.length; i++) { + file = cdn[i]; + element = document.createElement('link'); + element.rel = rel; + element.type = type; + element.href = file; + parent.appendChild(element); + //free file's value + file = null; + } + cdn.splice(0, cdn.length); + element = null; + parent = null; + cdn = null; +} +JZL.getToken = function() { + return localStorage.getItem('token'); +} +JZL.getCssUrl = function(cssName) { + return cssUrl + cssName + '?ver=' + version +} +JZL.getJsUrl = function(jsName) { + return jsUrl + jsName + '?ver=' + version +} +JZL.openWindow = function(openUrl, openId, extras, targetUrl) { + if (1 == is_app) { + if (typeof(extras) == "undefined") extras = {}; + mui.openWindow({ + url: openUrl, + id: openId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: extras, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } else { + location.href = targetUrl; + } + +} + +JZL.closeWindow = function(closeId) { + if (1 == is_app) { + plus.webview.getWebviewById(closeId).close(); + } +} + +JZL.ajax = function(url, data, fnDeal, sendType, sendToken) { + if (typeof(sendType) == "undefined") sendType = 'POST'; + if (typeof(sendToken) == "undefined") sendToken = 1; + if (1 == sendToken) + headers = { + "HYH-Token": JZL.getToken() + }; + else + headers = {}; + // //console.log(JSON.stringify(headers)) + if (1 == is_app) { + + mui.ajax(url, { + headers: headers, + data: data, + dataType: 'json', //服务器返回json格式数据 + type: sendType, //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(result) { //服务器返回响应,根据响应结果,分析是否登录成功; + + if (typeof(fnDeal) != "undefined") { + fnDeal(result); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + //alert(xhr+type+errorThrown); + console.log(JSON.stringify(data)); + console.log(url); + //mui.alert(xhr); + } + }); + } else { + + $.ajax(url, { + headers: headers, + data: data, + dataType: 'jsonp', //服务器返回json格式数据 + type: sendType, //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(result) { //服务器返回响应,根据响应结果,分析是否登录成功; + if (typeof(fnDeal) != "undefined") { + fnDeal(result); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + //alert(xhr+type+errorThrown); + alert(type); + } + }); + } + +} + +function inLogin() { + JZL.openWindow('login.html', 'login.html'); +} + +var scroll = mui('.mui-scroll-wrapper').scroll(); + +var ua = navigator.userAgent.toLowerCase(); +if (/iphone|ipad|ipod/.test(ua)) { //苹果手机 + if (document.getElementsByClassName('zhe')[0]) { + document.getElementsByClassName('zhe')[0].style.display = 'none'; + } + // document.getElementsByClassName('zhe')[0].style.display='none'; +} else if (/android/.test(ua)) { + // document.getElementsByClassName('zhe')[0].style.display='block'; + if (document.getElementsByClassName('zhe')[0]) { + document.getElementsByClassName('zhe')[0].style.display = 'none'; + } +} + +var hSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; +var hPadding = 22 + (+localStorage.getItem('ipxSizeTop')) + 'px'; +$('.header').css('height', hSize); +$('.header').css('padding-top', hPadding); +$('.scroll_out_tb').css('top', hSize); +$('.scroll_out_t').css('top', hSize); +mui.plusReady(function() { + plus.navigator.setStatusBarStyle('dark'); +}) + +mui('.nav').on('tap', '.nav_block', function() { + $(this).addClass('on').siblings().removeClass('on'); +}) + +//打开广告 +function openAds(item) { + if (item.attr('data-adURL') == '' || item.attr('data-targetType') == 0) { + return; + } + var adURL = item.attr('data-adURL'); + var targetType = ''; + var data_set = {}; + if (item.attr('data-targetType') == 1) { + //商品 + targetType = 'details.html'; + data_set = { + data_id: adURL + } + } else if (item.attr('data-targetType') == 2) { + //商家 + targetType = 'storeout.html'; + if (adURL == 1) { + // targetType = 'self_shop.html' + } + data_set = { + shopId: adURL + } + } else if (item.attr('data-targetType') == 3) { + //活动 + targetType = adURL; + data_set = { + adURLId: adURL.split('?')[1] + } + } + ////console.log(item.attr('data-adURL')); + JZL.openWindow(targetType, targetType + adURL, data_set); +} + +//返回顶部 +//var scrollToTopBox = document.getElementById('scrollToTop'); //返回按钮tap +//scrollToTopBox.addEventListener('tap', function(e) { +// e.stopPropagation(); +// mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 100); //滚动到顶部 +//}); +// Android上监听原生滚动,iOS上监听div滚动,上拉超过一屏后显示按钮,否则隐藏,可自行在条件判断中修改 +//if(mui.os.android) { +// window.addEventListener('scroll', function(e) { +// if(window.pageYOffset >= window.innerHeight && scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.remove('hide'); +// } else if(window.pageYOffset < window.innerHeight && !scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.add('hide'); +// } +// }); +//} else { +// document.getElementsByClassName('mui-scroll-wrapper')[0].addEventListener('scroll', function() { +// if(mui('.mui-scroll-wrapper').scroll().y <= window.innerHeight * (-1) && scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.remove('hide'); +// } else if(mui('.mui-scroll-wrapper').scroll().y > window.innerHeight * (-1) && !scrollToTopBox.classList.contains('hide')) { +// scrollToTopBox.classList.add('hide'); +// } +// }); +//} +JZL.saveItems = function(className, itemName) { + var params = JZL.getParams(className); + localStorage.setItem(itemName, JSON.stringify(params)); +} +JZL.getItems = function(itemName) { + var itemNames = localStorage.getItem(itemName); + //if(null != itemNames) + JZL.setValues(JSON.parse(itemNames)); + +} +JZL.getParams = function(obj) { + var params = {}; + var chk = {}; + var s; + $(obj).each(function() { + // //console.log($(this)[0]); + if ($(this)[0].type == 'hidden' || $(this)[0].type == 'number' || $(this)[0].type == 'tel' || $(this)[0].type == + 'password' || $(this)[0].type == 'select-one' || $(this)[0].type == 'textarea' || $(this)[0].type == 'text') { + params[$(this).attr('id')] = $.trim($(this).val()); + } else if ($(this).is('img')) { + // //console.log(1) + params[$(this).attr('id')] = $.trim($(this).attr('data-src')); + } else if ($(this)[0].type == 'radio') { + if ($(this).attr('name')) { + params[$(this).attr('name')] = $('input[name=' + $(this).attr('name') + ']:checked').val(); + } + } else if ($(this)[0].type == 'checkbox') { + if ($(this).attr('name') && !chk[$(this).attr('name')]) { + s = []; + chk[$(this).attr('name')] = 1; + $('input[name=' + $(this).attr('name') + ']:checked').each(function() { + s.push($(this).val()); + }); + params[$(this).attr('name')] = s.join(','); + } + } + }); + chk = null, s = null; + return params; +} +JZL.setValue = function(name, value) { + + var first = name.substr(0, 1), + input, i = 0, + val; + if ("#" === first || "." === first) { + input = $(name); + } else { + input = $("[name='" + name + "']"); + } + + if (input.eq(0).is(":radio")) { //单选按钮 + input.filter("[value='" + value + "']").each(function() { + this.checked = true + }); + } else if (input.eq(0).is(":checkbox")) { //复选框 + if (!$.isArray(value)) { + val = new Array(); + val[0] = value; + } else { + val = value; + } + for (i = 0, len = val.length; i < len; i++) { + input.filter("[value='" + val[i] + "']").each(function() { + this.checked = true + }); + } + } else if (input.is('img')) { //图片 + + if (''!= value) { + input.attr('src',hyhImgUrl(value)); + input.attr('data-src',value); + } + + } else { //其他表单选项直接设置值 + input.val(value); + } + +} +JZL.setValues = function(obj) { + var input, value, val; + for (var key in obj) { + if ($('#' + key)[0]) { + JZL.setValue('#' + key, obj[key]); + } else if ($("[name='" + key + "']")[0]) { + JZL.setValue(key, obj[key]); + } + } +} + + + + +/** + * 邮箱格式判断 + * @param str + */ +function checkEmail(str){ + var reg = /^[a-z0-9]([a-z0-9\\.]*[-_]{0,4}?[a-z0-9-_\\.]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+([\.][\w_-]+){1,5}$/i; + if(reg.test(str)){ + return true; + }else{ + return false; + } +} +/** + * 输入为空检查 + * @param name '#id' '.id' (name模式直接写名称) + * @param type 类型 0 默认是id或者class方式 1 name='X'模式 + */ +function is_empty(name,type){ + if(type == 1){ + if($('input[name="'+name+'"]').val() == ''){ + return true; + } + }else{ + if($(name).val() == ''){ + return true; + } + } + return false; +} + + diff --git a/js/compare.js b/js/compare.js new file mode 100644 index 0000000..7ba4287 --- /dev/null +++ b/js/compare.js @@ -0,0 +1,96 @@ +//加载对比商品 +function loadCompare(isrefresh) { + $("#comparelist").load(HOMESITEURL + '/Compare/showcompare.html'); + return; + if (!$("#comparelist").html()) { + isrefresh = true; + } + if (isrefresh == true) { + $("#comparelist").load(HOMESITEURL + '/Compare/showcompare.html'); + } +} +//添加对比商品 +function addCompare(gid) { + gid = parseInt(gid); + if (gid > 0) { + $.ajax({ + type: "GET", + dataType: "json", + url: HOMESITEURL + '/Compare/addcompare.html?id=' + gid, + async: false, + success: function (data) { + if (data.done == true) { + $("[ds_type='compare_" + gid + "']").addClass('selected'); + loadCompare(true); + $(".top #content-compare").animate({right: '40px'}); + } else { + showDialog(data.msg); + } + } + }); + } else { + showDialog('参数错误'); + } + $("#lockcompare").val('unlock');//解除加入对比按钮的锁定 +} +//清空对比栏 +function delCompare(gid, type) { + $.ajax({ + type: "GET", + dataType: "json", + url: HOMESITEURL + '/Compare/delcompare?gid=' + gid + '&type=' + type, + async: false, + success: function (data) { + if (data.done == true) { + //将对比按钮置为未对比状态 + if (type == 'mini') { + if (gid == 'all') { + $("[ds_type^='compare_']").removeClass('selected'); + } else { + $("[ds_type='compare_" + gid + "']").removeClass('selected'); + } + } + //加载对比信息 + if (type == 'mini') { + //加载对比栏 + loadCompare(true); + $("#content-compare").animate({right: '40px'}); + } else { + go(HOMESITEURL + '/Compare/index/gids/' + data.gid_str); + } + } + $("#lockcompare").val('unlock');//解除加入对比按钮的锁定 + } + }); +} +//初始加入对比按钮 +function initCompare() { + //绑定对比按钮事件 + $("[ds_type^='compare_']").bind('click', function () { + if ($("#lockcompare").val() == 'unlock') { + $("#lockcompare").val('lock');//锁定加入对比按钮 + //处理参数 + var data_str = ''; + eval('data_str =' + $(this).attr('data-param')); + var gid = data_str.gid; + + if ($(this).hasClass('selected')) { + $(this).removeClass('selected'); + //删除该对比商品 + delCompare(gid, 'mini'); + } else { + //新增该对比商品 + addCompare(gid); + } + } + }); + + //根据是否已加入对比,显示不同样式 + $.getJSON(HOMESITEURL + '/Compare/checkcompare', function (data) { + if (data) { + $.each(data, function (i, val) { + $("[ds_type='compare_" + val + "']").addClass('selected'); + }); + } + }); +} \ No newline at end of file diff --git a/js/complain.js b/js/complain.js new file mode 100644 index 0000000..5039f1e --- /dev/null +++ b/js/complain.js @@ -0,0 +1,156 @@ +mui.plusReady(function() { + var token = localStorage.getItem('token'); + var self = plus.webview.currentWebview(); + var data_order_id = self.data_order_id; + + mui.ajax(hyhUrl('app/Ordercomplains/getComplainCause'), { + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += ''; + }) + $('select').html(html); + + } else { + mui.alert(data.msg) + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + var uploader = new plupload.Uploader({ + runtimes: 'html5,flash,silverlight,html4', + browse_button: 'selectfiles', + //multi_selection: false, + // container: document.getElementById('container'), + flash_swf_url: '../lib/plupload-2.1.2/js/Moxie.swf', + silverlight_xap_url: '../lib/plupload-2.1.2/js/Moxie.xap', + url: 'http://oss.aliyuncs.com', + + filters: { + mime_types: [ //只允许上传图片和zip,rar文件 + { + title: "Image files", + extensions: "jpg,gif,png,bmp" + } + ], + max_file_size: '10mb', //最大只能上传10mb的文件 + prevent_duplicates: true //不允许选取重复文件 + }, + + init: { + PostInit: function() { + document.getElementById('ossfile').innerHTML = ''; + // document.getElementById('postfiles').onclick = function() { + // set_upload_param(uploader, '', false); + // return false; + // }; + uploader.bind('FilesAdded', function() { + set_upload_param(uploader, '', false, 'complains'); + return false; + }); + }, + + FilesAdded: function(up, files) { + plupload.each(files, function(file) { + document.getElementById('ossfile').innerHTML += '
      ' + + '
      ' + + '
      '; + }); + }, + + BeforeUpload: function(up, file) { + check_object_radio(); + set_upload_param(up, file.name, true); + }, + + UploadProgress: function(up, file) { + var d = document.getElementById(file.id); + d.getElementsByTagName('b')[0].innerHTML = '' + file.percent + "%"; + var prog = d.getElementsByTagName('div')[0]; + var progBar = prog.getElementsByTagName('div')[0] + progBar.style.width = 2 * file.percent + 'px'; + progBar.setAttribute('aria-valuenow', file.percent); + }, + + FileUploaded: function(up, file, info) { + if (info.status == 200) { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = ''; + } else { + document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = info.response; + } + }, + + Error: function(up, err) { + if (err.code == -600) { + mui.alert("\n选择的文件太大了"); + } else if (err.code == -601) { + mui.alert("\n选择的文件后缀不对"); + } else if (err.code == -602) { + mui.alert("\n这个文件已经上传过一遍了"); + } else { + mui.alert("\nError xml:" + err.response); + } + } + } + }); + + uploader.init(); + + $('button').on('tap', function() { + var complainType = $('select').val(); + var complainContent = $('textarea').val(); + var imagesArr = []; + $('#ossfile').children('.files_out').children('b').children('img').each(function() { + imagesArr.push($(this).attr('data-src')) + }) + var images = imagesArr.join(','); + if (complainType == 0) { + mui.alert('请选择投诉原因!'); + return; + } + if (complainContent.length < 5) { + mui.alert('投诉内容不小于5个字!'); + return; + } + var that = $(this); + mui.ajax(hyhUrl('app/Ordercomplains/saveComplain'), { + data: { + orderId: data_order_id, + complainType: complainType, + complainContent: complainContent, + complainAnnex: images + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + mui.alert('提交成功!'); + var targetTab = plus.webview.getWebviewById('complain.html'); + mui.fire(targetTab, 'refresh'); + mui.back(); + } else { + mui.alert(data.msg) + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + }) + +}) diff --git a/js/confirmOrder.js b/js/confirmOrder.js new file mode 100644 index 0000000..1e20e9d --- /dev/null +++ b/js/confirmOrder.js @@ -0,0 +1,717 @@ +//$('.pay_info .row_left').eq(0).html('桔子链账号'); +var wxChannel = null; // 微信支付 +var aliChannel = null; // 支付宝支付 +var channel = null; //支付通道 +mui.init(); +mui.plusReady(function() { + window.addEventListener('setAddress', function(e) { + var addressId = localStorage.getItem('addressId') ? localStorage.getItem('addressId') : 0; + if (addressId == 0) { + return; + } + mui.ajax(hyhUrl('app/useraddress/getById'), { + data: { + addressId: addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + // for(i in data.data){ + // //console.log(i) + // //console.log(data.data[i]) + // } + var html = + '
      收货人:' + + data.userName + '
      ' + data.userPhone + + '
      收货地址:' + data.areaName + ' ' + data.userAddress + '
      '; + $('.address').html(html); + $('.address').attr('data-addressId', data.addressId); + $('.address').attr('data-areaId', data.areaId2); + + } else { + mui.alert(data.msg); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }); + + $('.con').on('tap', '.address', function() { + var addressId = $(this).attr('data-addressId'); + localStorage.setItem('addressId', addressId); + var isOrder = true; + mui.openWindow({ + url: 'setting_address.html', + id: 'setting_address.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_addressId: addressId, + data_isOrder: isOrder + + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + }) + //支付插件 + plus.payment.getChannels(function(channels) { + for (var i in channels) { + if (channels[i].id == "wxpay") { + wxChannel = channels[i]; + } else { + aliChannel = channels[i]; + } + } + }, function(e) { + mui.alert("获取支付通道失败:" + e.message); + }); + // var ALIPAYSERVER = 'http://demo.dcloud.net.cn/helloh5/payment/alipay.php?total='; + var ALIPAYSERVER = hyhUrl('app/Alipays/toAlipay?isBatch=1&orderNo='); + // 2. 发起支付请求 + function pay(id, orderNo) { + // 从服务器请求支付订单 + var PAYSERVER = ''; + if (id == 'alipay') { + PAYSERVER = ALIPAYSERVER; + channel = aliChannel; + } else if (id == 'wxpay') { + PAYSERVER = WXPAYSERVER; + channel = wxChannel; + } else { + plus.nativeUI.alert("不支持此支付通道!", null, "捐赠"); + return; + } + var xhr = new XMLHttpRequest(); + // var amount = 1; + + xhr.onreadystatechange = function() { + switch (xhr.readyState) { + case 4: + if (xhr.status == 200) { + plus.payment.request(channel, xhr.responseText, function(result) { + plus.nativeUI.alert("支付成功!", function() { + // back(); + + }); + }, function(error) { + // plus.nativeUI.alert("支付失败:" + error.code); + plus.webview.getWebviewById('confirmOrder.html').close(); + }); + } else { + mui.alert("获取订单信息失败!"); + ////console.log(xhr.status) + } + break; + default: + break; + } + } + xhr.open('GET', PAYSERVER + orderNo); + xhr.send(); + + } + var self = plus.webview.currentWebview(); + var type = self.type; + var data_1 = {}; + var isUseScore = 0; + var orderNo; + var priceT = 0; + var payCode = ''; + var userCoupon = ''; + var couponIds = []; + var areaId2 = ''; + // //console.log(type) + + mui.ajax(qlgUrl('app/carts/settlement'), { + data: { + type: type + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data) + var data = toJson(data); + // //console.log(JSON.stringify(data)); + if (data.status == 1) { + var allallnum = 0; + data = data.data; + data_1 = data; + if (data.userAddress.addressId) { + var html = '
      收货人:' + + data.userAddress.userName + '
      ' + data.userAddress.userPhone + + '
      收货地址:' + data.userAddress.areaName + ' ' + data.userAddress.userAddress + + '
      '; + } else { + var html = + '
      请选择收货地址
      '; + } + $.each(data.carts, function() { + var allNum = 0; + html += '
      ' + this.shopName + + '
      '; + $.each(this.list, function() { + allNum += this.cartNum; + var price = ''; + if (this.isWhsle == 1) { + price = this.whslePrice; + } else if (this.specPrice != 'null') { + price = this.shopPrice; + } else { + price = this.specPrice; + } + var specNames = ''; + for (var i in this.specNames[0]) { + if (i == "catName") { + specNames = this.specNames[0][i] + ':'; + } else if (i == "itemName") { + specNames += this.specNames[0][i] + } + } + + html += '

      ' + this.goodsName + '

      '; + $.each(this.specNames, function() { + html += this.catName + ':' + this.itemName + ';'; + }); + + html += '

      ¥' + price + '

      ¥' + this.marketPrice + 'x' + + this.cartNum + '
      ' + }); + allallnum += allNum; + html += + '
      买家留言:
      '; + // if (this.coupons != '') { + // couponName = ''; + // html += + // '
      选择优惠券:
      '; + // } else { + html += ''; + //} + + html += '
      共' + allNum + + '件商品 小计:¥' + this.goodsMoney + ' + 运费:¥' + this.shippingMoney + + '
      '; + }); + html += '
      发货方式:
      '; + // $.each(data.userCoupon, function() { + // html += ''; + // }); + // html += '
      ' + //木吉抵扣 + if (data.is_seckilling == 1 || data.promotion_goods == 1 || data.ect_pay == 1) { + // data.useOrderScore=0; + } else { + // html += '
      木吉抵用    可抵用木吉:' + data.useOrderScore + '
      ' + + } + // html+='
      购买数量
      -+
      ' + // html += '
      木吉
      成交后奖励成交价20%的木吉
      '; + priceT = (Math.floor((+data.goodsTotalMoney - (+data.promotionMoney)) * 100)) / 100; + priceT = priceT >= 0 ? priceT : 0; + var html1 = '共' + allallnum + '件商品 合计:¥' + priceT + + '  '; + // if(data.ect_pay == 1) { + // var htmlpay = '

      ECT余额:' + data.userECT + '

      '; + // + // $('.pay_info .con_1').append(htmlpay); + // // $('.pay_info .con_1 .row').eq(0).attr('style','display: none;'); + // $('.pay_info .con_1 .row').eq(1).remove(); + // }; + $.each(data.payments, function(i, v) { + $.each(v, function() { + $('#pay_way,.pay_info .con_1').append('

      付款方式

      ' + this.payName + '

      '); + }) + }) + $('.con').html(html); + $('.js_r').html(html1); + $('#loginName').html(data.loginName); + $('.userMoney').html(data.userMoney); + + $('#goodsTotalMoney').html(priceT); + } else { + mui.alert(data.msg); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + //店铺优惠券 + $('.con').on('change', '.yhq_', function() { + userCoupon = $('#userCoupon').val(); + areaId2 = $('.address').attr('data-areaId2'); + couponIds = []; + $('select').each(function() { + couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); + }) + // var addressId = $('.address').attr('data-addressId') + var areaId2 = $('.address').attr('data-areaId2') + var couponIdsArr = couponIds.join(','); + mui.ajax(qlgUrl('app/carts/getMoney'), { + data: { + type: type, + areaId2: areaId2, + isUseScore: isUseScore, + useScore: data_1.useOrderScore, + couponIds: couponIdsArr, + recordId: userCoupon + + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + data = toJson(data); + // //console.log(data.msg) + if (data.status == 1) { + data_1.useOrderScore = data.data.maxScore; + $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); + priceT = data.data.realTotalMoney; + $('.js_r span j').html('¥' + data.data.realTotalMoney) + $('#goodsTotalMoney').html(data.data.realTotalMoney); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + }); + //订单优惠券 + $('body').on('change', '#userCoupon,#deliverType', function() { + userCoupon = $('#userCoupon').val(); + areaId2 = $('.address').attr('data-areaId2'); + couponIds = []; + $('select').each(function() { + couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); + }) + // var addressId = $('.address').attr('data-addressId') + var areaId2 = $('.address').attr('data-areaId2') + var couponIdsArr = couponIds.join(','); + mui.ajax(hyhUrl('app/carts/getMoney'), { + data: { + type: type, + deliverType:$('#deliverType').val(), + areaId2: areaId2, + //isUseScore: isUseScore, + useScore: data_1.useOrderScore, + //couponIds: couponIdsArr, + //recordId: userCoupon + + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + //console.log(JSON.stringify( data)) + data = toJson(data); + // //console.log(data.msg) + if (data.status == 1) { + data_1.useOrderScore = data.data.maxScore; + $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); + $('.js_r span j').html('¥' + data.data.realTotalMoney); + priceT = data.data.realTotalMoney; + $('#goodsTotalMoney').html(data.data.realTotalMoney); + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + }); + //是否使用木吉 +// $('.con').on('tap', '.checkout', function() { +// userCoupon = $('#userCoupon').val(); +// $(this).toggleClass('on'); +// if ($(this).hasClass('on')) { +// isUseScore = 1; +// } else { +// isUseScore = 0; +// } +// couponIds = []; +// $('select').each(function() { +// couponIds.push($(this).attr('data-shopId') + ':' + $(this).val()); +// }) +// couponIdsArr = couponIds.join(','); +// areaId2 = $('.address').attr('data-areaId2'); +// // //console.log(areaId2) +// // //console.log(couponIdsArr) +// // //console.log(data_1.userAddress.areaId2) +// // //console.log(data_1.userAddress) +// +// // //console.log( areaId2) +// // //console.log(isUseScore) +// // //console.log( data_1.useOrderScore) +// // //console.log(couponIdsArr) +// // //console.log(userCoupon); +// mui.ajax(hyhUrl('app/carts/getMoney'), { +// data: { +// type: type, +// areaId2: areaId2, +// isUseScore: isUseScore, +// useScore: data_1.useOrderScore, +// couponIds: couponIdsArr, +// recordId: userCoupon +// +// }, +// dataType: 'json', //服务器返回json格式数据 +// type: 'post', //HTTP请求类型 +// timeout: 10000, //超时时间设置为10秒; +// success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; +// +// data = toJson(data); +// +// if (data.status == 1) { +// data_1.useOrderScore = data.data.maxScore; +// $('#huibao').html('可抵用木吉:' + data_1.useOrderScore); +// // //console.log(data) +// // //console.log(data.data.shopFreight) +// // for(i in data.data){ +// // //console.log(i) +// // //console.log(data.data[i]) +// // } +// priceT = data.data.realTotalMoney; +// $('.js_r span j').html('¥' + data.data.realTotalMoney) +// $('#goodsTotalMoney').html(data.data.realTotalMoney); +// } else { +// mui.alert('发生错误请刷新后重试!'); +// // location.reload(); +// } +// }, +// error: function(xhr, type, errorThrown) { //异常处理; +// //alert(errorThrown); +// } +// }); +// }) + $('.footer').on('tap', '.btn_tj', function() { + payCode = $('.select_payway').attr('data-payCode'); + var that = $(this); + if (payCode == 'ect') { + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/ect/getToEctNum'), { + + data: { + total_money: priceT + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + var btnArray = ['是', '否']; + mui.confirm(data.msg, 'ECT确认支付', btnArray, function(e) { + if (e.index == 1) { + that.removeAttr('disabled'); + return; + + } else { + var addressId = $('.address').attr('data-addressId'); + if (addressId) { + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } else { + mui.alert('未设置收货地址!') + } + that.removeAttr('disabled'); + } + }) + } else { + mui.alert(data.msg); + return; + } + + } + }) + } else { + var addressId = $('.address').attr('data-addressId'); + if (addressId) { + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } else { + mui.alert('未设置收货地址!') + } + } + + }) + + $('.bg').on('tap', '.mui-icon-left-nav', function() { + $('.pay').css('display', 'block'); + $('.pay_way').css('display', 'none'); + }) + $('.bg').on('tap', '.mui-icon-closeempty', function() { + $('.bg').css('display', 'none'); + $(".pay").slideUp(300, function() { + + }); + }) + + $('#pay_way').on('tap', '.row', function() { + $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); + $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); + $('.select_payway .row_right o').html($(this).children('.row_left').html()); + $('.select_payway').attr('data-payCode', $(this).attr('data-payCode')) + $('.pay').css('display', 'block'); + $('#pay_way').css('display', 'none'); + + }) + $('.pay').on('tap', '.select_payway', function() { + if ($(this).attr('data-payCode') == 'ect') {} else { + $('.pay').css('display', 'none'); + $('#pay_way').css('display', 'block'); + } + + }) + var click = false; + $('.pay_btn').on('tap', function() { + + var addressId = $('.address').attr('data-addressId'); + var areaId = $('.address').attr('data-areaId'); + var that = $(this); + payCode = $('.select_payway').attr('data-payCode'); + var data_send = { + type: type, + s_addressId: addressId, + s_areaId: areaId, + payCode: payCode, + payType: 1, + isUseScore: isUseScore, + useScore: data_1.useOrderScore, + deliverType: $('#deliverType').val(), + isInvoice: 0, + invoiceId: 0, + invoiceClient: '', + recordId: userCoupon + } + $('.remark').each(function() { + data_send['remark_' + ($(this).attr('data-shopid'))] = $(this).val(); + }); + $('select').each(function() { + data_send['couponId_' + ($(this).attr('data-shopid'))] = $(this).val(); + }) + if (true == click) return; + click = true; + that.attr('disabled', 'disabled'); + mui.ajax(qlgUrl('app/orders/submit'), { + data: data_send, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(JSON.stringify(data)) + data = toJson(data); + if (data.status == 1) { + orderNo = data.data; + if (payCode == 'qlgpay') { + JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + orderNo: orderNo, + isBatch: 1 + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(JSON.stringify(data)); + var data = toJson(data); + // //console.log(JSON.stringify(data)) + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#qlg_pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置操作密码!'); + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + //return; + } + $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); + $('#productNum').val(data.data.product.useProduct); + if (data.data.product.useProduct > 0) { + var html1 = '

      抵扣额' + data.data.product.useProductOk + + '

      扣税 ' + data.data.product.useProductTaxFee + + '

      手续费 ' + data.data.product.useProductHandlingFee + + '

      '; + $('.productInfo_').html(html1) + // $('#productInfo').html('产品券[抵扣额:'+data.data.product.useProductOk+',扣税:'+data.data.product.useProductTaxFee+',手续费:'+data.data.product.useProductHandlingFee+']'); + } + $('#couponsNum').val(data.data.coupons.useCoupons); + if (data.data.coupons.useCoupons > 0) { + var html2 = '

      抵扣额' + data.data.coupons.useCouponsOk + + '

      扣税 ' + data.data.coupons.useCouponsTaxFee + + '

      手续费 ' + data.data.coupons.useCouponsHandlingFee + + '

      '; + $('.couponsInfo_').html(html2) + // $('#coupousInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + + // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); + } + $('#wangNum').val(data.data.wang.useWang); + $('#moneyNum').val(data.data.money.useMoney); + + } else { + mui.alert(data.msg) + } + }); + //显示支付页面 + } else if (payCode == 'wallets' || payCode == 'ect') { + //跳输入密码的页面 + JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + orderNo: data.data, + isBatch: 1 + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置支付密码!'); + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + } + } + }); + + } else if (payCode == 'alipays') { + pay('alipay', data.data); + // plus.nativeUI.showWaiting(); + // mui.post(hyhUrl('app/Alipays/payment'), { + // orderNo: data.data, + // isBatch: 1 + // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); + + } + } else { + mui.alert(data.msg); //'发生错误请刷新后重试!'); + if (-2 == data.status) { + JZL.openWindow('indent.html', 'waitPay', { + data_href: 'waitPay' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 500) + } else { + //location.reload(); + } + + //mui.back(); + + } + click = false; + that.removeAttr('disabled'); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // //console.log(type) + // //console.log(errorThrown) + //mui.alert(errorThrown); + } + }) + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { + var payPwd = $('#payPwd').val(); + if (payPwd == '') { + mui.alert('支付密码不能为空!'); + return; + } + var that = $(this); + that.attr('disabled', 'disabled'); + var srcc = '' + if (payCode == 'qlgpay') { + srcc = 'payByQlg'; + } else if (payCode == 'ect') { + srcc = 'payByEct'; + } else { + srcc = 'payByWallet'; + } + JZL.ajax(hyhUrl('app/' + payCode + '/' + srcc), { + orderNo: orderNo, + isBatch: 1, + payPwd: payPwd + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(JSON.stringify(data)); + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + JZL.openWindow('indent.html', 'waitDeliver', { + data_href: 'waitDeliver' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 700) + + } else { + if (-1 == data.status) { + JZL.openWindow('indent.html', 'waitPay', { + data_href: 'waitPay' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 700) + } else if (-2 == data.status) { + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + } else if (-3 == data.status) { + + } else if (-4 == data.status) { + JZL.openWindow('indent.html', 'waitDeliver', { + data_href: 'waitDeliver' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + }, 700) + } + + } + that.removeAttr('disabled'); + }); + }) +}) diff --git a/js/cooperative.js b/js/cooperative.js new file mode 100644 index 0000000..de49c37 --- /dev/null +++ b/js/cooperative.js @@ -0,0 +1,187 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + JZL.getItems('auth_company'); + var id = ''; + var count = 0; + $('.header_con_bc').on('tap', function() { + JZL.saveItems('.localinp', 'auth_company'); + mui.toast('保存成功'); + }) + + if ('' == $('#headImg').val()) { + $("#headImgTag").attr("src", "../img/touxiang.jpg") + + } + JZL.ajax(qlgUrl('app/auth/getAuthInfo'), { + isCompany: 1 + }, function(data) { + //console.log(data); + + if ('undefined' != typeof(data.data) && 1 == data.status) { //编辑 + count = 1; + $('.mobileCode').hide() + $('.userPhone').hide() + $('.payPwd').show() + id = data.data.id + + //赋值 + ////console.log(data); + mui.each(data.data, function(index, element) { + if ($('#' + index).attr("type") == "hidden") { + // var imgindex = index.substring(0, index.length - 3); + var imgindex = index + 'Tag' + var obj = '#' + imgindex + // //console.log('#' + imgindex + '') + if (imgindex != "") { + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index + '').val(element) + } + } + + } else { + $('#' + index).val(element) + } + + + }) + + } else { // 添加 + count = 0 + $('.userPhone').show() + $('.mobileCode').show() + $('.payPwd').hide() + JZL.getItems('auth_company'); + + } + + }) + mui('.mui-content').on('tap', '.yhk', function() { + JZL.openWindow('yhk.html', 'yhk.html'); + + }) + mui('.mui-content').on('tap', '.hhrrz', function() { + JZL.openWindow('hhrrz.html', 'hhrrz.html'); + + }) + + var wait = 120; + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').val("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').css("background", "#c0a0a0"); + $('.HQYZM').val("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + //获取验证码 + mui('.mui-table-view-cell').on('tap', '.HQYZM', function() { + var userPhone = $('.indiv-tel').val(); + // if (userPhone == '') { + // mui.alert('手机号不能为空!'); + // return; + // } + // 判断手机号码格式 + // if (!( + // /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + // .test(userPhone))) { + // mui.alert("手机号码有误,请重填!"); + // return; + // } + // $(".HQYZM").attr("disabled", true); + JZL.ajax(qlgUrl('app/auth/getPhoneCode'), { + userPhone: userPhone + }, function(data) { + //console.log(data); + if (1 == data.status) { + time(); + } + mui.toast(data.msg); + }) + + + }) + + // 上传头像 + $("#headerimg").on("tap", '#headImgTag', function() { + UP.init("headImg", "test", "headImgTag") + openCamera(); + }) + + $('.bc_btn').on('tap', function() { + + + var params = JZL.getParams(".inp"); + if ('' == params.trueName) { + mui.alert("请输入直营人姓名"); + return; + + } + if ('' == params.idCard) { + mui.alert("请输入身份证号"); + return; + + } + if ('' == params.companyName) { + mui.alert("请输入合作名称"); + return; + } + if ('' == params.companyAddress) { + mui.alert("请输入地址"); + return; + } + + + if ('' == params.companyName) { + mui.alert("请输入合作名称"); + return; + } + if (0 == count) { //添加 + if ('' == $('#mobileCode').val()) { + mui.alert("请输入验证码"); + return; + } + params.mobileCode = $('#mobileCode').val(); + + } else if (1 == count) { //编辑 + if ('' == $('#payPwd').val()) { + mui.alert("请输入操作密码"); + return; + } + params.authId = id; + params.payPwd = $('#payPwd').val(); + } + params.isCompany = 1 + JZL.ajax(qlgUrl('app/auth/setAuthInfo'), params, function(data) { + //console.log(data); + if (data.status == 1) { + JZL.saveItems('.localinp', 'auth_company'); + localStorage.setItem("authType","2") + mui.toast("提交成功 请等待审核") + // $(".mui-table-view").attr("readonly", "readonly") + $(".mobileCode").hide() + $('.userPhone').hide() + mui.back(); + } else { + mui.alert(data.msg); + } + + }) + }) +}) diff --git a/js/details.js b/js/details.js new file mode 100644 index 0000000..cc9ab84 --- /dev/null +++ b/js/details.js @@ -0,0 +1,872 @@ +var data = ''; +var data_saleSpec = {} +var arry_str = ''; +var data_bak = {}; +var shopQQ = ''; +var shopTle = ''; +var shopName=''; +var isDefaultArr = []; +var token = localStorage.getItem('token'); +var isShowWhsle = 0; +var seckilling_end_time = '' +var shareImgThumbs = []; +var shares = null; +var img_data=''; +var Intent = null, + File = null, + Uri = null, + main = null; + +//点击遮罩关闭 +$('.cclass_con').before('
      ') +$('.header_con').append(''); +function getNextDate(dayStr) { + var dd = new Date(dayStr); + dd.setDate(dd.getDate() + 1); + var y = dd.getFullYear(); + var m = dd.getMonth() + 1; //获取当前月份的日期 + var d = dd.getDate(); + return y + "/" + m + "/" + d + " 00:00:00"; +}; +//倒计时 +function countTime() { + + //获取当前时间 + var date = new Date(); + var now = date.getTime(); + //设置截止时间 + var endDate = new Date(getNextDate(seckilling_end_time * 1000)); + var end = endDate.getTime(); + //时间差 + var leftTime = seckilling_end_time * 1000 - now; + //定义变量 d,h,m,s保存倒计时的时间 + var d, h, m, s; + if(leftTime >= 0) { + d = Math.floor(leftTime / 1000 / 60 / 60 / 24); + h = Math.floor(leftTime / 1000 / 60 / 60); + m = Math.floor(leftTime / 1000 / 60 % 60); + s = Math.floor(leftTime / 1000 % 60); + //将倒计时赋值到div中 + if(d < 10) { + d = "0" + d; + } + if(h < 10) { + h = "0" + h; + } + if(m < 10) { + m = "0" + m; + } + if(s < 10) { + s = "0" + s; + } + // $("#_d").html(d); + $("#_h").html(h); + $("#_m").html(m); + $("#_s").html(s); + } + + //递归每秒调用countTime方法,显示动态时间效果 + setTimeout(countTime, 1000); + +} + + //秒杀限购四件 + var xg = ''; + $('.miaosha').append(xg); +//秒杀规格选择 +function miaoshaSaleSpec(specId, SaleSpec) { + for(i in SaleSpec) { + if(SaleSpec[i].id == specId) { + var data_sArry = i.split(':'); + var data_s = SaleSpec[i]; + arry_str = i; + isDefaultArr = i.split(':'); + $.each(data_sArry, function() { + var that = this; + $('.cclass1 .block').each(function() { + if($(this).attr('data-itemId') == that) { + $(this).addClass('on'); + $(this).parent().attr('data-class', that); + } + + }) + + }) + seckilling_end_time = data_s.seckilling_end_time; + html_miaosha = '

      ' + data_s.specPrice + '

      ¥' + data_s.marketPrice + '
      限购四件

      00:00:00

      桔子抢购

      距结束还剩

      '; + $('.miaosha').html(html_miaosha); + $('.cclass_con .cc2 p').html(data_s.specPrice); + $('.miaosha').css('display', 'block'); + $('.price').css('display', 'none'); + $('.price_old').css('display', 'none'); + countTime(); + $('.mujidikou').css('display', 'none'); + + } + } + +} +// H5 plus事件处理 +function plusReady() { + updateSerivces(); + if(plus.os.name == "Android") { + main = plus.android.runtimeMainActivity(); + Intent = plus.android.importClass("android.content.Intent"); + File = plus.android.importClass("java.io.File"); + Uri = plus.android.importClass("android.net.Uri"); + } +} +if(window.plus) { + plusReady(); +} else { + document.addEventListener("plusready", plusReady, false); +} + +/** + * + * 更新分享服务 + */ +function updateSerivces() { + plus.share.getServices(function(s) { + shares = {}; + for(var i in s) { + var t = s[i]; + shares[t.id] = t; + } + }, function(e) { + plus.nativeUI.toast("获取分享服务列表失败:" + e.message); + }); +} + +/** + * 分享操作 + * @param {JSON} sb 分享操作对象s.s为分享通道对象(plus.share.ShareService) + * @param {Boolean} bh 是否分享链接 + */ +function shareAction(sb, bh) { + if(!sb || !sb.s) { + plus.nativeUI.toast("无效的分享服务!"); + return; + } + + var msg = { + content: sharehrefDes.value, + extra: { + scene: sb.x + }, + type: "web" + }; + if(bh) { + msg.href = sharehref.value; + if(sharehrefTitle && sharehrefTitle.value != "") { + msg.title = sharehrefTitle.value; + } + if(sharehrefDes && sharehrefDes.value != "") { + msg.content = sharehrefDes.value; + } + // msg.thumbs = ["_www/logo.png"]; + msg.thumbs = $('.swiper-slide img').eq(0).attr('src') ? [$('.swiper-slide img').eq(0).attr('src') + '/thumb60'] : ["_www/logo.png"]; + + msg.pictures = ["_www/logo.png"]; + } else { + if(pic && pic.realUrl) { + msg.pictures = [pic.realUrl]; + } + } + // 发送分享 + if(sb.s.authenticated) { + // plus.nativeUI.toast("---已授权---"); + shareMessage(msg, sb.s); + } else { + plus.nativeUI.toast("---未授权---"); + sb.s.authorize(function() { + shareMessage(msg, sb.s); + }, function(e) { + plus.nativeUI.toast("认证授权失败:" + e.code + " - " + e.message); + + }); + } +} +/** + * 发送分享消息 + * @param {JSON} msg + * @param {plus.share.ShareService} s + */ +function shareMessage(msg, s) { + + // plus.nativeUI.toast(JSON.stringify(msg)); + s.send(msg, function() { + plus.nativeUI.toast("分享到\"" + s.description + "\"成功! "); + + }, function(e) { + plus.nativeUI.toast("分享到\"" + s.description + "\"失败 "); + + }); +} +// 分析链接 +function shareHref() { + var shareBts = []; + // 更新分享列表 + var ss = shares['weixin']; + ss && ss.nativeClient && (shareBts.push({ + title: '微信朋友圈', + s: ss, + x: 'WXSceneTimeline' + }), + shareBts.push({ + title: '微信好友', + s: ss, + x: 'WXSceneSession' + })); + + // 弹出分享列表 + shareBts.length > 0 ? plus.nativeUI.actionSheet({ + title: '分享注册链接', + cancel: '取消', + buttons: shareBts + }, function(e) { + (e.index > 0) && shareAction(shareBts[e.index - 1], true); + }) : plus.nativeUI.plus.nativeUI.toast('当前环境无法支持分享链接操作!'); +} + +function whslePrice(num, arry_str) { + for(var i in data_saleSpec) { + if(i == arry_str) { + // if(num >= (+(data_saleSpec[i].initNum)) && data_saleSpec[i].whslePrice > 0) { + if(isShowWhsle == 1 && data_saleSpec[i].whslePrice > 0) { + $('.cclass_con .cc2 o').html('批发单价:¥' + data_saleSpec[i].whslePrice); + $('.cclass_con .cc2 l').html('起批数:' + data_saleSpec[i].initNum + '件'); + } + } + } + for(var i in data_saleSpec) { + if(i == arry_str) { + $('.cclass_con .cc2 p').html('¥' + data_saleSpec[i].specPrice); + } + } +} +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var goodsType; + if (self.goodsType) { + goodsType=self.goodsType; + } + var goodsId = self.data_id; + var isEct = self.isEct; + var isMiaosha = self.isMiaosha; + var MiaoshaSaleSpec = self.MiaoshaSaleSpec; + var specsId = ''; +// //console.log(isMiaosha) + // isMiaosha = 1; + // MiaoshaSaleSpec = '0'; +// console.log(goodsId) + + // mui.ajax(hyhUrl('app/Goods/detail'), { + mui.ajax(qlgUrl('app/Goods/detail'), { + data: { + goodsId: goodsId + // goodsId: 1206 + // goodsId: 1203 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // console.log(data) + var data = toJson(data); + // console.log(data.status) + if(data.status == 1) { + // mui.alert('加载失败请重试!'); + + data = data.data; + data_bak = data; + shopQQ = data.shop.shopQQ; + shopTel = data.shop.phone; + var isEct = data.isEct; + shopName = data.shop.shopName; + // if(!shopQQ && shopTel) { + $('#lxkf').html('

      客服

      ') + // } + if(1 == data.isFavorites){ + $('#scbtn img').attr('src','../img/likelogo1.png') + $('#scbtn p').html("已收藏") + } + var html = '

      ECT专享价¥' + data.shopPrice + '

      市场价 ¥' + data.marketPrice + '

      '; + } else { + html += '

      ¥' + data.shopPrice + '

      市场价 ¥' + data.marketPrice + '

      '; + } + + // var str1 = '

      到手价¥' + Math.round(data.shopPrice * 0.8 * 100) / 100 + '

      ' + + html += '

      ' + data.goodsName + '

      '; + if(data.goodsTips) { + html += '

      ' + data.goodsTips + '

      '; + } + if(data.isFreeShipping == '1') { + html += '
      免运费'; + } else { + //html += '
      不包邮'; + html += '
      运费'+data.freight; + } + html += '月销:' + data.saleNum + '件
      ' + + html += '
      领取优惠券
      ';//
      木吉购买后可获得成交价格20%木吉
      + if(isEct != 1) { + //html += '
      木吉本商品可用木吉抵扣20%
      ' + } else {} + if(data.promotionList != '') { +// html += '
      促销信息 :' + data.promotionList.rewardTitle + '
      '; +// $.each(data.promotionList.json, function() { +// html += '

      满' + this.orderMoney + '元

      '; +// +// if(this.favourableJson.chk0 == true) { +// html += '
      减' + this.favourableJson.chk0val + '元
      '; +// } +// if(this.favourableJson.chk1 == true) { +// html += '
      送' + this.favourableJson.chk1val.text + '
      '; +// } +// if(this.favourableJson.chk2 == true) { +// html += '
      免运费
      '; +// } +// if(this.favourableJson.chk3 == true) { +// html += '
      送满' + this.favourableJson.chk3val.text + '元优惠券 满' + this.favourableJson.chk3val.data.useMoney + '元使用
      '; +// } +// +// }); +// +// html += '
      '; + } + var showShopMsg = '正品保证 '; + // if(1778 == data.shopId){ + // showShopMsg+='此商品拆封概不退货换'; + // showShopMsg+='温馨提示:不支持7天无理由退货'; + // + // } + html += '
      '+showShopMsg+'
      选择颜色分类 号码尺寸
      '; + if(data.oneAppraises == '') { + + } else { + var userImg = ''; + if(data.oneAppraises.userPhoto) { + userImg = hyhImgUrl(data.oneAppraises.userPhoto); + } else { + userImg = '../img/mujiimg.png' + } + + html += '

      商品评价(' + data.appraiseNum + ')

      ' + data.oneAppraises.loginName + '

      ' + data.oneAppraises.content + '
      ' + data.oneAppraises.goodsSpecNames + '
      查看全部评价
      '; + } + + img_data = data.goodsDesc.replace(/src=\"__ROOT__\//g, 'data-src="').replace(/data-echo=\"__ROOT__\//g, 'src="' + hyhImgUrl('')).replace(/src=\"\//g, 'src="' + hyhImgUrl('')); + img_data = img_data.replace(/src=\"http\:\/\/img.heyuanhui.cn\//g,'src="' + hyhImgUrl('')); + ////console.log(img_data) + html += '

      ' + data.shop.shopName + '

      ' + data.goodsCount + '
      全部宝贝
      ' + data.newGoodsCount + '
      上新宝贝
      ' + data.favoritesShopsNum + '
      关注人数
      宝贝描述 ' + data.shop.goodsScore + '
      卖家服务 ' + data.shop.serviceScore + '
      物流服务 ' + data.shop.timeScore + '
      '; + $('.con_').html(html); + + $('.cclass_con .img').html(''); + $('.cclass_con .cc2 p').html('¥' + data.shopPrice); + $('.cclass_con .cc2 span').html('库存' + data.goodsStock + '件'); + if(data.showWhsle == 1) { + isShowWhsle = 1; + } + $('#storebtn').attr('data-shopId', data.shopId); + $('.swiper-slide img').height($('.swiper-slide img').width()); + $('.swiper-slide').height($('.swiper-slide').width()); + //$('.swiper-slide').height($('.swiper-slide').width() * 460 / 750); + //$('.swiper-slide img').height($('.swiper-slide img').width() * 460 / 750); + + // $('.banner').height($('.banner').width()); + var swiper = new Swiper('.swiper-container', { + pagination: '.swiper-pagination', + paginationClickable: true, + spaceBetween: 30, + autoplay: 3000 + }); + var html1 = ''; + // var html1 = '
      '; + $.each(data.spec, function() { + html1 += '

      ' + this.name + '

      ' + $.each(this.list, function() { + // //console.log(this.itemId) + html1 += '
      ' + this.itemName + '
      ' + }); + html1 += '
      ' + }); + // html1+='
      ' + $('.ccclass').html(html1); + // var hahaha = mui('#hahaha').scroll(); + // $('.ccclass').height($('#hahaha').height()) + for(var i in data.saleSpec) { + data_saleSpec[i] = data.saleSpec[i]; + // if(data.saleSpec[i]["id"] == MiaoshaSaleSpec) { + // specsId = i + // arry_str = i; + // isDefaultArr = i.split(':'); + // } + if(data.saleSpec[i]["isDefault"] == 1) { + isDefaultArr = i.split(':'); + arry_str = i; + } + + } + if(data.couponList == '') { + $('.yyyhhhqqq').css('display', 'none'); + } else { + $.each(data.couponList, function() { + html2 += '

      ¥' + this.couponValue + '

      满' + this.useMoney + '元使用
      '; + }); + $('.yhqcon').html(html2); + } + + // if(isMiaosha == 1 || (data.is_seckilling&&data.is_seckilling == 1)||(data_saleSpec[arry_str].is_seckilling&&data_saleSpec[arry_str].is_seckilling==1)) { + var html_miaosha = '' + if(data.is_seckilling && data.is_seckilling == '1') { + $('.mujidikou').css('display', 'none'); + seckilling_end_time = data.seckilling_end_time; + html_miaosha = '

      ' + data.shopPrice + '

      ¥' + data.marketPrice + '
      限购四件

      00:00:00

      桔子抢购

      距结束还剩

      '; + + $('.miaosha').html(html_miaosha); + $('.miaosha').css('display', 'block'); + $('.price').css('display', 'none'); + $('.price_old').css('display', 'none'); + countTime(); + } else if(data_saleSpec[arry_str] && data_saleSpec[arry_str].is_seckilling && data_saleSpec[arry_str].is_seckilling == 1) { + miaoshaSaleSpec(data_saleSpec[arry_str].id, data_saleSpec); + } else if(isMiaosha == 1) { + miaoshaSaleSpec(MiaoshaSaleSpec, data_saleSpec); + } + // } + else { + $.each(isDefaultArr, function() { + var that = this; + $('.cclass1 .block').each(function() { + + if($(this).attr('data-itemId') == that) { + $(this).addClass('on'); + $(this).parent().attr('data-class', that); + } + + }) + + }) + } + } else if(data.status == -22) { + alert(data.msg); + mui.back(); + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + //console.log(errorThrown); + } + }); + var scroll = mui('.mui-scroll-wrapper').scroll({ + //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006 + deceleration: 0.002 + }); + var show_img=false; + //导航栏渐变 + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + var num; + if(scroll.y >= -387 && scroll.y < 0) { + + num = scroll.y / -387; + // //console.log('渐变',num) + $('.header1').css({ + 'display': 'block', + 'opacity': num + }) + if(false == show_img){ + show_img=true; + $('.imgcon').html(img_data); + } + var num1 = 0.2 - num * 0.2; + } else if(scroll.y >= 0) { + num = 0; + // //console.log('透明',num) + $('.header1').css({ + 'display': 'none', + 'opacity': num + }) + } else if(scroll.y < -387) { + + num = 1; + // //console.log('不透明',num) + $('.header1').css({ + 'display': 'block', + 'opacity': num + }) + } + //导航栏自动切换 + if($('.imgcon').offset().top >= 66) { + $('#nav1').addClass("on").siblings().removeClass('on'); + } else if($('.imgcon').offset().top < 66) { + $('#nav3').addClass("on").siblings().removeClass('on'); + } + }) + + mui('.header').on('tap', '.icon-cart', function() { + JZL.openWindow('shoppingcart.html','shoppingcart.html'); + }); + //点击导航栏跳转 + mui('.nav').on('tap', '#nav1', function() { + mui('.mui-scroll-wrapper').scroll().scrollTo(0, 0, 100); + $('#nav1').addClass("on").siblings().removeClass('on'); + }); + mui('.nav').on('tap', '#nav2', function() { + JZL.openWindow('appraise.html','appraise.html',{goodsId: goodsId}); + }); + mui('.nav').on('tap', '#nav3', function() { + mui('.mui-scroll-wrapper').scroll().scrollTo(0, -1124, 100); + $('#nav3').addClass("on").siblings().removeClass('on'); + }); + + mui('.con_').on('tap', '#changeclass', function() { + $('#changeclass_con').show(); + }) + + //选择类型 + mui('.ccclass').on('tap', '.block', function() { + $(this).addClass('on').siblings().removeClass('on'); + $(this).parent().attr('data-class', $(this).attr('data-itemId')); + + var data_itemId = $(this).attr('data-itemId'); + if($(this).attr('data-itemImg') != '') { + $('.cclass_con .img').html(''); + } + + var arry = []; + + $.each($('.cclass1'), function() { + arry.push($(this).attr('data-class')) + }); + arry.sort(function(a, b) { + return a - b; + }); + + arry_str = arry.join(':'); + + for(var i in data_saleSpec) { + if(i == arry_str) { + $('.cclass_con .cc2 p').html(data_saleSpec[i].specPrice); + $('.cclass_con .cc2 span').html('库存' + data_saleSpec[i].specStock + '件'); + + if(data_saleSpec[i].is_seckilling && data_saleSpec[i].is_seckilling == 1) { + miaoshaSaleSpec(data_saleSpec[i].id, data_saleSpec); + } else { + + $('.miaosha').html(''); + $('.miaosha').css('display', 'none'); + $('.price').html('¥' + data_saleSpec[i].specPrice); + $('.price_old').html('市场价 ¥' + data_saleSpec[i].marketPrice + ''); + $('.price').css('display', 'block'); + $('.price_old').css('display', 'block'); + } + } + } + + var num = +$('.change_num input').val(); + whslePrice(num, arry_str); + + }) + //跳转选择类型 + + $('.footer').on('tap', '.btn_ljgm', function() { + $('#changeclass_con').show(); + }) + //关闭 + mui('.cc2').on('tap', '.closecclass', function() { + $('#changeclass_con').hide(); + }) + + mui('.en').on('tap', '.engwc', function() { + $('#changeclass_con').hide(); + }) + + //改变数量 + mui('.change_num').on('tap', '.jia', function() { + // //console.log($(this).siblings('input').val()) + var num = +$(this).siblings('input').val() + 1; + if(num <= 0) { + alert('购买数最小为1!'); + return; + } + $(this).siblings('input').val(num); + whslePrice(num, arry_str) + }) + mui('.change_num').on('tap', '.jian', function() { + var num = +$(this).siblings('input').val() - 1; + if(num <= 0) { + alert('购买数最小为1!'); + return; + } + $(this).siblings('input').val(num); + whslePrice(num, arry_str) + }) + $('.change_num input').on('change', function() { + var num = +$(this).val(); + + whslePrice(num, arry_str); + }) + + mui('.mui-backdrop').on('tap', '.mask', function() { + $('#changeclass_con').hide(); + }) + //加入购物车&购买 + mui('.en').on('tap', '.enarr', function() { + + var that = $(this); + // var goodsId = goodsId; + var buyNum = $('.change_num input').val(); + var isGoodsSpecId = 0; + var goodsSpecId = 0; + var url = ''; + if($(this).hasClass('engwc')) { + url = 'addCart'; + } else if($(this).hasClass('ensure')) { + url = 'buy'; + } + // //console.log(data_bak.isSpec) + for(var i in data_saleSpec) { + if(i == arry_str) { + isGoodsSpecId = 1; + goodsSpecId = data_saleSpec[i].id; + } + } + if(isGoodsSpecId == 1) { + // goodsSpecId = arry_str; + } else if(data_bak.isSpec == 0) { + goodsSpecId = 0; + } else { + alert('请选择商品分类!'); + return + } + if(goodsType==2 & $(this).hasClass('engwc')) { + mui.alert ("助微吧商品不能加入购物车") + return; + } + // //console.log(arry_str) + // //console.log(goodsSpecId) + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/carts/' + url), { + headers: { + "HYH-Token": token + }, + data: { + goodsType:goodsType, + goodsId: goodsId, + buyNum: buyNum, + goodsSpecId: goodsSpecId + + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + data = toJson(data); + // //console.log(data.msg); + // //console.log(data.status); + if(data.status == 1) { + if(url == 'buy') { + mui.openWindow({ + url: 'confirmOrder.html', + id: 'confirmOrder.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // goodsId: goodsId + + type: 1 + + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } else if(url == 'addCart') { + mui.alert('添加购物车成功!') + } + + } else { + mui.alert(data.msg); + //location.reload(); + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + + }) + + //打开评价列表 + mui('.con_').on('tap', '.pjrk', function() { + JZL.openWindow('appraise.html','appraise.html',{goodsId: goodsId}); + }) + $('.footer').on('tap', '#scbtn', function() { + var goodId = goodsId; + var that = $(this); + if($('#scbtn p').html() == '收藏') { + mui.ajax(qlgUrl('app/Favorites/add'), { + + data: { + id: goodId, + type : 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if(data.status == 1) { + $('#scbtn p').html('已收藏'); + $('#scbtn p').css('color', '#E41F4A'); + $('#scbtn img').attr('src', '../img/likelogo1.png'); + // that.addClass('gz_btn1').removeClass('gz_btn'); + } else { + mui.alert(data.msg) + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + } else { + mui.ajax(hyhUrl('app/Favorites/cancel'), { + + data: { + id: goodId, + type : 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if(data.status == 1) { + $('#scbtn p').html('收藏'); + $('#scbtn p').css('color', '#8f8f94'); + $('#scbtn img').attr('src', '../img/likelogo.png'); + // that.addClass('gz_btn1').removeClass('gz_btn'); + } else { + mui.alert(data.msg) + ////console.log(data.status) + } + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + } + + }) + $('.footer').on('tap', '#storebtn', function() { + var shopId = this.attributes["data-shopId"].nodeValue; + JZL.openWindow('storeout.html','storeout.html'+ shopId,{shopId: shopId,shopName:shopName}); + }) + $('.con').on('tap', '.shop_title p', function() { + var shopId = this.attributes["data-shopId"].nodeValue; + JZL.openWindow('storeout.html','storeout.html'+ shopId,{shopId: shopId}); + }) + //弹出优惠券 + $('.con_').on('tap', '.lq', function() { + $('#youhuiquan_con').css('display', 'block'); + }) + //关闭优惠券 + $('#youhuiquan_con').on('tap', '.thq_close', function() { + $('#youhuiquan_con').css('display', 'none'); + }) + //领取优惠券 + $('#youhuiquan_con').on('tap', '.lq_btn', function() { + var couponId = $(this).attr('data-couponId'); + mui.ajax(hyhUrl('addon/coupon-Coupons-receive'), { + headers: { + "HYH-Token": token + }, + data: { + couponId: couponId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + + var data = toJson(data); + alert(data.msg); + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // alert(type); + } + }); + }) + //联系客服 + + $('#lxkf').on('tap', function() { + if(shopQQ) { + // location.href="http://wpa.qq.com/msgrd?v=3&uin="+ shopQQ +"&site=qq&menu=yes"; + // mui.back(); + // window.open("http://wpa.qq.com/msgrd?v=3&uin="+ shopQQ +"&site=qq&menu=yes") + if(plus.os.name == "iOS") { + plus.runtime.launchApplication({ + action: "mqq://im/chat?chat_type=wpa&uin=" + shopQQ + "&version=1&src_type=web" + }, function(e) { + plus.nativeUI.confirm("检查到您未安装qq,请先到appstore搜索下载?", function(i) { + if(i.index == 0) { + iosAppstore("itunes.apple.com/cn/app/mqq/"); + } + }); + }); + } else if(plus.os.name == "Android") { + var Intent = plus.android.importClass('android.content.Intent'); + var Uri = plus.android.importClass('android.net.Uri'); + var main = plus.android.runtimeMainActivity(); + var uri = Uri.parse("mqqwpa://im/chat?chat_type=wpa&uin=" + shopQQ); + main.startActivity(new Intent(Intent.ACTION_VIEW, uri)); + } + } + }) + //分享 + $('.con_').on('tap', '#share', function() { + shareHref(); + }) + + + +}) +// var self = plus.webview.currentWebview(); +// //console.log(self.aaa) \ No newline at end of file diff --git a/js/discounts.js b/js/discounts.js new file mode 100644 index 0000000..5700646 --- /dev/null +++ b/js/discounts.js @@ -0,0 +1,80 @@ +jumpPage(); + +function jumpPage() { + //跳转页面 + var subpages = ['choiceness.html', 'dynamic.html', 'new_product.html']; + var subpage_style = { + top: '103px', + bottom: '0px', + scrollIndicator: 'none' + }; + + var aniShow = {}; //动画显示 + //当前激活选项 + var activeTab = subpages[0]; + //选项卡点击事件 + mui('.nav').on('tap', 'a', function(e) { + var targetTab = this.getAttribute('href'); + if(targetTab == activeTab) { + return; + } + //显示目标选项卡 + //若为iOS平台或非首次显示,则直接显示 + if(mui.os.ios || aniShow[targetTab]) { + plus.webview.show(targetTab); + } else { + //否则,使用fade-in动画,且保存变量 + var temp = {}; + temp[targetTab] = "true"; + mui.extend(aniShow, temp); + plus.webview.show(targetTab, "fade-in", 300); + } + //隐藏当前; + plus.webview.hide(activeTab); + //更改当前活跃的选项卡 + activeTab = targetTab; + + if(targetTab == 'choiceness.html') { + document.getElementsByClassName('p1')[1].classList.remove('on') + document.getElementsByClassName('p1')[2].classList.remove('on') + this.classList.add('on'); + } + + if(targetTab == 'dynamic.html') { + document.getElementsByClassName('p1')[0].classList.remove('on') + document.getElementsByClassName('p1')[2].classList.remove('on') + this.classList.add('on'); + } + + if(targetTab == 'new_product.html') { + document.getElementsByClassName('p1')[0].classList.remove('on') + document.getElementsByClassName('p1')[1].classList.remove('on') + this.classList.add('on'); + } + + }); + + //首次启动切滑效果 + + mui.plusReady(function() { + window.addEventListener('refresh', function(e) { + location.reload(); + }) + // launchScreen(); + // plus.navigator.setStatusBarStyle('dark'); + // //console.log(plus.navigator.getStatusBarStyle()) + var self = plus.webview.currentWebview(); + for(var i = 0; i < subpages.length; i++) { + var temp = {}; + //http://www.html5plus.org/doc/zh_cn/webview.html#plus.webview.create + var sub = plus.webview.create(subpages[i], subpages[i], subpage_style); + if(i > 0) { + sub.hide(); + } else { + temp[subpages[i]] = "true"; + mui.extend(aniShow, temp); //合并对象 + } + self.append(sub); + } + }); +} \ No newline at end of file diff --git a/js/distribution.js b/js/distribution.js new file mode 100644 index 0000000..0c80aa2 --- /dev/null +++ b/js/distribution.js @@ -0,0 +1,98 @@ +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var userId = self.userId + var idx = 0; + var curIdx; + var productNum = ""; + var couponsNum = ''; + var click = false; + var type, payPwd, num; + //获取数据 + JZL.ajax(qlgUrl('app/users/getInvestmentMoney'), { + userId: userId + }, function(data) { + // console.log(data); + if (1 == data.status) { + var data = data.data; + productNum = data.productNum; + couponsNum = data.couponsNum; + $(".product .productNum").val(productNum); + + } + }) + + + $(".nav").on("tap", ".nav-item", function() { + curIdx = idx + idx = $(this).index() + + $(".nav .nav-item ").eq(idx).addClass("active") + $(".nav .nav-item ").not($(".nav .nav-item ").eq(idx)).removeClass("active") + $(".content .content_ ").eq(idx).show() + $(".content .content_ ").not($(".content .content_ ").eq(idx)).hide() + if (0 == idx) { //product + if (curIdx != idx) { + //获取数据 + $(".product .productNum").val(productNum); + } + + } else if (1 == idx) { //voucher + if (curIdx != idx) { + //获取数据 + $('.voucher .couponsNum ').val(couponsNum) + } + } + + }) + + + $(".down").on("tap", function() { + if (true == click) { + return + } + click = true; + + + if ('' == $('.product .productNum').val() || '' == $.trim($('.product .productNum').val())) { + mui.alert("券值不能为空"); + return; + } + if ($('.product .productNum').val() < 15) { + mui.alert("券值不能低于15 "); + return; + } + + if (0 == idx) { //product + num = parseFloat($('.product .productNum').val()) + type = 1; + payPwd = $('.proPassWord').val(); + + } + if (1 == idx) { //voucher + //ajax + num = parseFloat($('.voucher .couponsNum').val()) + type = 2; + payPwd = $('.vouPassWord').val(); + + } + if ('' == payPwd) { + mui.alert("操作密码不能为空"); + return; + } + console.log(idx); + JZL.ajax(qlgUrl("app/users/distributionInvestmentMoney"), { + userId: userId, + type: type, + num: num, + payPwd: payPwd + }, function(data) { + if (1 == data.status){ + mui.toast(data.msg) + mui.back(); + }else { + mui.alert (data.msg) + } + }) + + }) +}) diff --git a/js/editAddress.js b/js/editAddress.js new file mode 100644 index 0000000..c6593af --- /dev/null +++ b/js/editAddress.js @@ -0,0 +1,299 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}); +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var addressId = self.data_addressId ? self.data_addressId : 0; + var isParentId = 1; + var isProvince; + var isCity; + var userName = $('#userName'); + var userPhone = $('#userPhone'); + var province = $('#province'); + var city = $('#city'); + var Area = $('#area'); + var Textarea = $('textarea'); + var areaVal; + if (addressId != 0) { + $('.address_info').css('display', 'none'); + $('.add_info').css('display', 'block'); + mui.ajax(qlgUrl('app/useraddress/getById'), { + data: { + addressId: addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { + //console.log(data);//服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + //console.log(data); + userName.val(data.userName) + userPhone.val(data.userPhone) + $('.add_info').html(data.areaName) + Textarea.val(data.userAddress) + areaVal = data.areaId + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#province').html(html); + + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + $('.scroll_out_t').on('tap', '#province', function() { + if (isParentId == 1) { + isParentId = 0; + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#province').html(html); + var province = data[0].areaId; + mui.ajax(hyhUrl('app/areas/listQuery'), { + data: { + parentId: province + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#city').html(html); + var city = data[0].areaId; + mui.ajax(hyhUrl('app/areas/listQuery'), { + data: { + parentId: city + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#area').html(html); + isCity = city; + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + isProvince = province; + } else { + mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + + }) + $('.scroll_out_t').on('change', '#province', function() { + var province = $(this).val() + //console.log(province) + if (isProvince != province) { + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: province + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#city').html(html); + // var city = data[0].areaId; + // mui.ajax(hyhUrl('app/areas/listQuery'), { + // data: { + // parentId: city + // }, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // data = toJson(data); + // if(data.status == 1) { + // data = data.data; + var html = ''; + // $.each(data, function() { + // html += '' + // }); + $('#area').html(html); + // isCity = city; + // } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + // } + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }); + isProvince = province; + } else { + // mui.alert('发生错误请刷新后重试!'); + mui.alert(data.msg) + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + }) + $('.scroll_out_t').on('change', '#city', function() { + var city = $(this).val() + if (isCity != city) { + mui.ajax(qlgUrl('app/areas/listQuery'), { + data: { + parentId: city, + level: 2 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + $.each(data, function() { + html += '' + }); + $('#area').html(html); + isCity = city; + } else { + mui.alert(data.msg) + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + }) + + $('.bc_btn').on('tap', function() { + var isDefault = $('input:radio[name="isDefault"]:checked').val() ? $('input:radio[name="isDefault"]:checked').val() : + 0; + areaVal = $('#area').val() ? $('#area').val() : areaVal; + var data = { + isDefault: isDefault, + addressId: addressId, + userName: $('#userName').val(), + areaId: areaVal, + userPhone: $('#userPhone').val(), + userAddress: $('textarea').val(), + } + mui.ajax(hyhUrl('app/useraddress/edits'), { + data: data, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + mui.back(); + } else { + mui.alert(data.msg) + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + $('.add_info').on('tap', function() { + $('.address_info').css('display', 'block'); + $('.add_info').css('display', 'none'); + }) + +}) diff --git a/js/essay.js b/js/essay.js new file mode 100644 index 0000000..e69de29 diff --git a/js/essaylist.js b/js/essaylist.js new file mode 100644 index 0000000..7d9354f --- /dev/null +++ b/js/essaylist.js @@ -0,0 +1,9 @@ +mui.plusReady(function () { + // var url ="", + $("body").on("tap" ,".add1",function () { + JZL.openWindow('addessay.html', 'addessay.html') + }) + $(".row_con").on("tap" ,".memorandum",function () { + JZL.openWindow('memorandumlist.html', 'memorandumlist.html') + }) +}) \ No newline at end of file diff --git a/js/friends.js b/js/friends.js new file mode 100644 index 0000000..c32019c --- /dev/null +++ b/js/friends.js @@ -0,0 +1,53 @@ +mui.plusReady(function() { + var level = ''; + JZL.ajax(qlgUrl('app/users/myFriend'), {}, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + var html = '', + html1 = ''; + + html1 = '

      ' + data.pInfo.trueName + '' + data.pInfo.userStatus + + '

      ' + data.pInfo.userLevel + '' + data.pInfo.userPhone + + ''; + html = + '
      '; + // html1=data.user.loginName+" "+data.user.userId + $('.fri-con').html(html) + $('.shop_info').html(html1) + $('.userInfo').text(data.user.loginName) + //二维码生成 + // var content='' + var qrcode = new QRCode(document.getElementById("qrcode"), { + width: 100, //设置宽高 + height: 100 + }); + //console.log(data.share_url); + //$('body').append(''); + qrcode.makeCode(data.share_url); + // //console.log('http://t.ect99.com/mobile/users/reg?pName='+ data.user.loginName); + $('#qrcode').show(); + }else{ + mui.alert(data.msg) + } + }) + + $('body').on("tap", '.row', function() { + // alert(1) + level = $(this).attr('data-level'); + JZL.openWindow('friendsList.html', 'friendsList.html', { + 'level': level + }) + }) + + + +}) diff --git a/js/friendsList.js b/js/friendsList.js new file mode 100644 index 0000000..b8b2679 --- /dev/null +++ b/js/friendsList.js @@ -0,0 +1,86 @@ +mui.plusReady(function() { + var self = plus.webview.currentWebview(); + var userLevel = self.level + // mui.alert(userLevel) + var page = 1; + var pagesize = 10; + var isjiazai = 1; + getRecommend(page, pagesize) + + function getRecommend(page, pagesize) { + var recommenddata = { + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + recommenddata.userLevel = userLevel; + if (-1 == userLevel) { + recommenddata.isLock = 1; + } else { + recommenddata.isLock = 0; + + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + JZL.ajax(qlgUrl('app/users/myFriendList'), recommenddata, function(data) { + //console.log(data); + if (1 == data.status) { + var data = data.data; + var html = ''; + if (data.Rows == '') { + $('.fri-con').append( + '

      没有更多朋友

      '); + isjiazai = 0; + return; + } + mui.each(data.Rows, function() { + if (!this.lockReason || '' == this.lockReason) { + html += '
      ' + this.trueName + + '' + this.userPhone + '
      ' + } else { + html += '
      ' + this.trueName + + '' + this.userPhone + + '' + this.lockReason + + '8' + this.lockTime + + '小时' + this.createTime + '
      ' + + } + + }) + + if (page == 1) { + $('.fri-con').html(html); + } else { + $('.fri-con').append(html); + } + isjiazai = 1; + } else { + mui.alert(data.msg) + } + }) + } + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // 判断默认行为是否可以被禁用 + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pagesize); + } + } + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } + }, false) +}) diff --git a/js/goodslist.js b/js/goodslist.js new file mode 100644 index 0000000..c419697 --- /dev/null +++ b/js/goodslist.js @@ -0,0 +1,216 @@ +var msort = 1; +var page = 1; +var condition = 2; +var desc = 0; +var catId; +var keyword; +var isjiazai = 1; +var count = 1; +var goodsType; + +function pullupRefresh() { + // setTimeout(function() { + + // mui('#pullrefresh').pullRefresh().endPullupToRefresh(); + count += 1; + + var data_set = { + page: count, + pagesize: 10, + condition: condition, + desc: desc + } + // //console.log(order_class) + if (catId) { + data_set.catId = catId; + } else if (keyword) { + data_set.keyword = keyword; + } + if (goodsType) { + data_set.goodsType = goodsType; + } + mui.ajax(qlgUrl('app/Goods/pageQuery'), { + + data: data_set, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + + var data = toJson(data); + data = data.data; + var html = ''; + if (data.Rows == '') { + $('.mui-scroll').append('

      没有更多商品

      '); + return; + } + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + this.discountRate + + '%
      '; + // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; + }); + $('.recommend_con').append(html); + $('.rcb_img').height($('.rcb_img').width()); + isjiazai = 1; + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + // }, 500); +} + +/** + * 下拉刷新具体业务实现 + */ +// function pulldownRefresh() { +// setTimeout(function() { +// window.location.reload(); +// mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed +// }, 1500); +// } +mui.plusReady(function() { + var costnum = 0; + var self = plus.webview.currentWebview(); + catId = self.data_catId; + keyword = self.data_keyword; + goodsType = self.goodsType?self.goodsType :""; + $('.commoditylistnav').on('tap', '.nav_block', function() { + page = 1; + count = 1; + $(this).addClass('on').siblings().removeClass('on'); + + condition = $(this).attr('data-condition'); + + if ($('#cost_btn').hasClass('on')) { + + costnum += 1; + + if (costnum % 2 == 1) { + + $('#cost_btn').html('价格 '); + + desc = 1; + + } else if (costnum % 2 == 0) { + + $('#cost_btn').html('价格 '); + + desc = 0; + + } + + } else { + + $('#cost_btn').html('价格 ') + + costnum = 0; + desc = 0 + } + + var data = { + pagesize: 10, + page: 1, + condition: condition, + desc: desc, + goodsType :goodsType + } + if (catId) { + data.catId = catId; + } else if (keyword) { + data.keyword = keyword; + } + + mui.ajax(qlgUrl('app/Goods/pageQuery'), { + data: data, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + data = data.data; + var html = ''; + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + + this.discountRate + + '%
      '; + // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; + }); + $('.recommend_con').html(html); + $('.rcb_img').height($('.rcb_img').width()); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + var data_1 = { + pagesize: 10, + page: 1, + condition: 2, + desc: 0 + } + if (catId) { + data_1.catId = catId; + } else if (keyword) { + data_1.keyword = keyword; + } + mui.ajax(qlgUrl('app/Goods/pageQuery'), { + data: data_1, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + data = data.data; + var html = ''; + $.each(data.Rows, function() { + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      ' + this.saleNum + + '人购买
      优惠率   ' + this.discountRate + + '%
      '; + // html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + ' 满减
      可用木吉抵扣20%货款
      '; + }); + $('.recommend_con').html(html); + $('.rcb_img').height($('.rcb_img').width()); + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // //console.log(scroll.y); + // //console.log(scroll.maxScrollY); + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + isjiazai = 0; + pullupRefresh() + } + } + }) + +}) + +// setInterval(function() { +// $('.cnxh_block img').height($('.cnxh_block img').width()); +// $('.cnxh_block').height($('.cnxh_block').width() * 266 / 198); +// }, 100) diff --git a/js/guide.js b/js/guide.js new file mode 100644 index 0000000..f83db23 --- /dev/null +++ b/js/guide.js @@ -0,0 +1,61 @@ + +var swiperTest = null; +var banerArray = new Array(); + +mui.init({ + swipeBack: true //启用右滑关闭功能 +}); + +/**/ +mui.back = function() {}; +mui.plusReady(function() { + var timestamp1 = Date.parse(new Date()); +if(timestamp1 >= 1542470400000) { + plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示 + plus.navigator.setFullscreen(false); + plus.webview.currentWebview().close(); + return; +} + $.ajax('http://www.juzi199.com/get_startup.php', { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + var html = ''; + $.each(data.img, function() { + html += '
      ' + }); + $('.mui-slider-group').html(html) + $('.mui-slider-item').eq(0).addClass('mui-slider-item-duplicate'); + $('.mui-slider-item').eq(data.img.length - 1).append(''); + var slider = mui("#slider"); + swiperTest = document.getElementById('swiperTest'); + plus.navigator.setFullscreen(true); + plus.navigator.closeSplashscreen(); + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + + mui('body').on('tap', '#close', function() { +// plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示 + plus.storage.removeItem("lauchFlag"); + plus.navigator.setFullscreen(false); + plus.webview.currentWebview().close(); + + }) + setTimeout(function(){ +// plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示 + plus.storage.removeItem("lauchFlag"); + plus.navigator.setFullscreen(false); + plus.webview.currentWebview().close(); + },5000) + +}); +//立即体验按钮点击事件 +//document.getElementById("close").addEventListener('tap', function(event) { +// +//}, false); \ No newline at end of file diff --git a/js/hhrrz.js b/js/hhrrz.js new file mode 100644 index 0000000..92e58eb --- /dev/null +++ b/js/hhrrz.js @@ -0,0 +1,44 @@ +mui.plusReady(function() { + window.addEventListener('reload', function(e) { //执行刷新 + location.reload(); + }); + + + + var self = plus.webview.currentWebview(); + + mui('.block').on('tap', '.bj', function() { + JZL.openWindow('addhhrrz.html', 'addhhrrz.html'); + + }) + $('.con').on('tap', '.del', function() { + var data_addressId = $(this).parent().attr('data-addressId'); + if (confirm('确认删除信息?')) { + mui.ajax(qlgUrl('app/Useraddress/del'), { + data: { + id: data_addressId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + location.reload() + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } + + }) + $('.add1').on('tap', function() { + JZL.openWindow('addhhrrz.html', 'addhhrrz.html'); + }) + +}) diff --git a/js/home.js b/js/home.js new file mode 100644 index 0000000..1661bcd --- /dev/null +++ b/js/home.js @@ -0,0 +1,299 @@ +// $('.saoyisao').css('display', 'none'); +$('#search').css('width', '80%'); +$('#search').css('left', '5%'); +$('.searchimg').css('left', '8%'); + + +var page = 1; +var pagesize = 10; +var isjiazai = 1; + +function getRecommend(page, pagesize) { + var recommenddata = { + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + mui.ajax(qlgUrl('addon/shuff-Shuff-recommend'), { + data: recommenddata, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + var data = data.data; + if (data.Rows == '') { + $('.mui-scroll').append('

      没有更多商品

      '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + html += '
      自营' + this.goodsName + '
      ¥' + this.shopPrice + + ' 满减
      可用木吉抵扣20%货款
      '; + }); + + if (page == 1) { + $('#recommend_con').html(html); + } else { + $('#recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + } else { + mui.alert(data.msg) + // //console.log(2) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + +} +mui.plusReady(function() { + var ua = navigator.userAgent.toLowerCase(); + var issx = 0; + + //bannerTop + mui.ajax(qlgUrl('addon/shuff-Shuff-homeCarousel'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
      '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + $('#top_banner').height($('#top_banner').width() * 460 / 750); + } else { + mui.alert(data.msg) + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + //为你推荐 + getRecommend(page, pagesize); + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pagesize); + } + } + }) + setInterval(function() { + + $('.add_top_left img').height($('.add_top_left img').width()); + $('.add_top_right_con img').height($('.add_top_right_con img').width()); + $('.add_bottom_con img').height($('.add_bottom_con img').width()); + + $('.rcb_img').height($('.rcb_img').width()); + + }, 100) + + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + // $('#search').css('color', 'black'); + // $('#keyword').css('color', 'black'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + // $('#search').css('color', 'white'); + // $('#keyword').css('color', 'white'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } + + }) + //轮播图跳转 + $('#top_banner').on('tap', '.swiper-slide', function() { + openAds($(this)); + }) + + var num = 0; + + + mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == 5) { + url = 'classify.html'; + } + + mui.openWindow({ + url: url, + id: url, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + classifyId: classifyId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }) + + + + //搜索 + $('#keyword').on('focus', function() { + $(".search button").css('display', 'block'); + }) + $('#keyword').on('blur', function() { + $(".search button").css('display', 'none'); + }) + $(".search button").on('tap', function() { + var searchName = $('#keyword').val(); + var url = ''; + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + }) + $("#keyword").on('keypress', function(e) { + var keycode = e.keyCode; + var searchName = $(this).val(); + var url = ''; + if (keycode == '13') { + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + } + }); + +}) diff --git a/js/home_new.js b/js/home_new.js new file mode 100644 index 0000000..8cd0109 --- /dev/null +++ b/js/home_new.js @@ -0,0 +1,452 @@ + +var timestamp1 = Date.parse(new Date()); +//$('.getquan').css('display', 'none'); +$('#search').css('width', '82%'); +$('#search').css('left', '5%'); +$('.searchimg').css('left', '8%'); +//$('.time').css('display', 'none'); +//首页navId +$('.class_block').eq(0).attr('data-classifyId', 0); +$('.class_block').eq(1).attr('data-classifyId', 2); +$('.class_block').eq(2).attr('data-classifyId', 4); +$('.class_block').eq(3).attr('data-classifyId', 3); +$('.class_block').eq(4).attr('data-classifyId', 9); +$('.class_block').eq(5).attr('data-classifyId', 1); +$('.class_block').eq(6).attr('data-classifyId', 10); +$('.class_block').eq(7).attr('data-classifyId', 11); +$('.class_block').eq(8).attr('data-classifyId', 12); +$('.class_block').eq(9).attr('data-classifyId', ''); +var $uList = $(".scroll-box ul"); +var timer = null; +//触摸清空定时器 +$uList.hover(function() { + clearInterval(timer); + }, + function() { //离开启动定时器 + timer = setInterval(function() { + scrollList($uList); + }, + 2000); + }).trigger("mouseleave"); //自动触发触摸事件 +//滚动动画 +function scrollList(obj) { + //获得当前
    • 的高度 + var scrollHeight = $("ul li:first").height(); + //滚动出一个
    • 的高度 + $uList.stop().animate({ + marginTop: -scrollHeight + }, + 600, + function() { + //动画结束后,将当前
        marginTop置为初始值0状态,再将第一个
      • 拼接到末尾。 + $uList.css({ + marginTop: 0 + }).find("li:first").appendTo($uList); + }); +} + +$('.bcon_left').height($('.bcon_left').width() * 345 / 185); + +$('.bcr_block').height($('.bcr_block').width()); +$('.addsct_block').height($('.addsct_block').width() * 225 / 355); +$('.addscb_block').height($('.addscb_block').width() * 260 / 180); + +var page = 1; +var pagesize = 10; +var isjiazai = 1; + +function getRecommend(page, pagesize) { + var recommenddata = { + page: page ? page : 1, + pagesize: pagesize ? pagesize : 10 + } + if (isjiazai == 0) { + return; + } else { + isjiazai = 0; + } + mui.ajax(qlgUrl('app/index/getHotGoods'), { + data: recommenddata, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data); + + // var data = toJson(data, 1); + if (data.status == 1) { + //console.log(data); + + var html = ''; + var data = data.data; + if (data.Rows == '') { + $('.mui-scroll').append('

        没有更多商品

        '); + isjiazai = 0; + return; + } + $.each(data.Rows, function() { + + html += '
        自营' + this.goodsName + '
        ¥' + this.shopPrice + + ' 满减
        '+this.saleNum+'人购买
        优惠率   '+this.discountRate+'%
        '; + }); + + if (page == 1) { + $('#recommend_con').html(html); + } else { + $('#recommend_con').append(html); + } + isjiazai = 1; + $('.rcb_title span').each(function() { + if ($(this).attr('data-goodsId') == 1) { + $(this).css('display', 'none'); + } + }) + $('.rcb_img').height($('.rcb_img').width()); + + } else { + // //console.log(2) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + +} + + +//滚动动画 +function scrollList(obj) { + //获得当前
      • 的高度 + var scrollHeight = $("ul li:first").height(); + //滚动出一个
      • 的高度 + $uList.stop().animate({ + marginTop: -scrollHeight + }, + 600, + function() { + //动画结束后,将当前
          marginTop置为初始值0状态,再将第一个
        • 拼接到末尾。 + $uList.css({ + marginTop: 0 + }).find("li:first").appendTo($uList); + }); +} +mui.plusReady(function() { + var ua = navigator.userAgent.toLowerCase(); + var issx = 0; + + if (timestamp1 <= 1550678400000) { + //活动弹窗 + var lxy_div = + '
          '; + + $('body').append(lxy_div); + } + //点击让遮罩层消失 + mui('body').on('tap', '#home_zhezhao', function() { + $('#home_zhezhao').css('display', 'none'); + }); + + //跳转活动会场 + mui('#home_zhezhao').on('tap', '.lxy_zz', function() { + mui.openWindow({ + url: 'journalism_con.html', + id: 'journalism_con.html21', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + data_articleId: 21 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }); +// 点击扫一扫 +$('.saoyisao').on('tap',function () { + JZL.openWindow('saoyisao.html','saoyisao.html') +}) + + //bannerTop + mui.ajax(qlgUrl('app/appport/appBanner'), { + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data, 1); + if (data.status == 1) { + var html = ''; + var data = data.data; + $.each(data, function() { + html += '
          '; + }); + $('#top_banner .swiper-wrapper').html(html); + var swiper = new Swiper('#top_banner', { + pagination: '#top_banner_pagination', + spaceBetween: 0, + loop: true, + autoplay: 3500, + autoplayDisableOnInteraction: false + }); + // console.log($('#top_banner').width()); + var topBannerheight=($('#top_banner').width() )* 460 / 750; + // console.log(topBannerheight); + $('#top_banner').height(($('#top_banner').width() )* 460 / 750); + localStorage.setItem('topBannerheight',topBannerheight) + } else { + // //console.log(data.status) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + //为你推荐 + getRecommend(page, pagesize); + document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) { + // 判断默认行为是否可以被禁用 + if (e.cancelable) { + // 判断默认行为是否已经被禁用 + if (!e.defaultPrevented) { + e.preventDefault(); + } + } + if (scroll.y == scroll.maxScrollY) { + if (isjiazai == 1) { + page++; + getRecommend(page, pagesize); + } + } + if (-scroll.y < 0) { + num = 0; + } else if ((-scroll.y > 0 || scroll.y == 0) && -scroll.y < 150) { + num = -scroll.y / 150; + } else { + num = 1; + } + $('.header').css('background-color', 'rgba(255,255,255,' + num + ')') + + if (-scroll.y < 75) { + $('.saoyisao').attr('src', '../img/saoyisao.png'); + $('.msg').attr('src', '../img/icon_msg.png'); + $('.search').attr('src', '../img/icon_search.png'); + $('#search').css('background-color', 'white'); + // $('#search').css('color', 'black'); + // $('#keyword').css('color', 'black'); + $('.header').removeClass('shadown_wai'); + } else { + $('.saoyisao').attr('src', '../img/saoyisao1.png'); + $('.msg').attr('src', '../img/icon_msg1.png'); + $('.search').attr('src', '../img/icon_search1.png'); + $('#search').css('background-color', '#d8d8d8'); + // $('#search').css('color', 'white'); + // $('#keyword').css('color', 'white'); + $('.header').addClass('shadown_wai'); + } + + if (scroll.y > 80 && issx == 0) { + issx = 1; + setTimeout(function() { + location.reload() + }, 1000) + } + }, false) + setInterval(function() { + + $('.add_top_left img').height($('.add_top_left img').width()); + $('.add_top_right_con img').height($('.add_top_right_con img').width()); + $('.add_bottom_con img').height($('.add_bottom_con img').width()); + + $('.rcb_img').height($('.rcb_img').width()); + + }, 100) + //轮播图跳转 + $('#top_banner').on('tap', '.swiper-slide', function() { + openAds($(this)); + }) + + mui('body').on('tap', '.bannerAdd', function() { + localStorage.setItem('aaaaaa', 1); + }) + mui('.classify').on('tap', '.class_block', function() { + var classifyId = $(this).attr('data-classifyId'); + var url = 'orSupermarket.html'; + + if (classifyId == 0) { + url = 'self_shop.html'; + } + if (classifyId == '') { + url = 'classify.html'; + } + + mui.openWindow({ + url: url, + id: url, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + classifyId: classifyId + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }) +// mui('body').on('tap', '.add_bcr', function() { +// //var brandId = $(this).attr('data-brandId'); +// +// // openAds($(this)); +// mui.openWindow({ +// url: 'storeout.html', +// id: 'storeout.html' + shopId, +// styles: { +// top: '0px', //新页面顶部位置 +// bottom: '0px', //新页面底部位置 +// }, +// extras: { +// shopId: shopId +// // ..... //自定义扩展参数,可以用来处理页面间传值 +// }, +// createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 +// show: {}, +// waiting: {} +// }) +// }) + + + //领券 + mui('body').on('tap', '.getquan', function() { + if (timestamp1 >= 1542470400000) { + mui.alert('敬请期待!'); + return; + } + mui.openWindow({ + url: 'god_ect.html', + id: 'god_ect.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + }, + extras: { + // data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: {}, + waiting: {} + }) + }) + + //搜索 + $('#keyword').on('focus', function() { + $(".search button").css('display', 'block'); + }) + $('#keyword').on('blur', function() { + $(".search button").css('display', 'none'); + }) + $(".search button").on('tap', function() { + var searchName = $('#keyword').val(); + var url = ''; + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) +$('#keyword').val("") + }) + $("#keyword").on('keypress', function(e) { + var keycode = e.keyCode; + var searchName = $(this).val(); + var url = ''; + if (keycode == '13') { + // e.preventDefault(); + // //console.log(searchName) + //请求搜索接口 + // //console.log($('.search select').val()) + if ($('.search select').val() == 0) { + url = 'goodslist.html'; + } else if ($('.search select').val() == 1) { + url = 'shopsList.html'; + } + + mui.openWindow({ + url: url, + id: url + searchName, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_keyword: searchName + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + + } + }); +}) diff --git a/js/income-details.js b/js/income-details.js new file mode 100644 index 0000000..16f6043 --- /dev/null +++ b/js/income-details.js @@ -0,0 +1,20 @@ +mui.plusReady(function() { + var self=plus.webview.currentWebview(); + //console.log(self) + var shopId=self.id; + var data_href=self.data_href; + var data_expect=self.data_expect; + if('wait_money' == data_href){ + $('.title')="待收款" + } + if('comp_money' == data_href){ + $('.title')="已收款" + } + + + + + + + +}) \ No newline at end of file diff --git a/js/indent.js b/js/indent.js new file mode 100644 index 0000000..1131288 --- /dev/null +++ b/js/indent.js @@ -0,0 +1,42 @@ +mui.init({ + beforeback: function() { //获得父页面的webview + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'reload'); + //返回true,继续页面关闭逻辑 + return true; + } +}) + +mui.plusReady(function() { + + var self = plus.webview.currentWebview(); + var data_href = self.data_href; + if(data_href == 'all') { + $('.title').html('全部订单'); + + } + if(data_href == 'waitPay') { + $('.title').html('待付款'); + } + if(data_href == 'waitDeliver') { + $('.title').html('待发货'); + } + if(data_href == 'waitReceive') { + $('.title').html('待收货'); + } + if(data_href == 'waitAppraise') { + $('.title').html('待评价'); + } + if(data_href == 'abnormal') { + $('.title').html('退款/售后'); + } + localStorage.setItem('order_class', data_href); + var bSize = 64 + (+localStorage.getItem('ipxSizeTop')) + 'px'; + var sub = plus.webview.create('indentcon.html', data_href, { + top: bSize, + bottom: '0px', + scrollIndicator: 'none' + }); + self.append(sub); + +}) \ No newline at end of file diff --git a/js/indentcon.js b/js/indentcon.js new file mode 100644 index 0000000..4064789 --- /dev/null +++ b/js/indentcon.js @@ -0,0 +1,939 @@ +$('#content').after('
          '); +var pay_name = 0; +var token = localStorage.getItem('token'); +var order_class = localStorage.getItem('order_class'); +var orderNo; +var orderId; +var getReasonUrl = ''; +var priceT = 0; +var payCode = ''; +var wxChannel = null; // 微信支付 +var aliChannel = null; // 支付宝支付 +var channel = null; //支付通道 +mui.init({ + pullRefresh: { + container: '#pullrefresh', + down: { + style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式 + color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色 + height: '50px', //可选,默认50px.下拉刷新控件的高度, + range: '100px', //可选 默认100px,控件可下拉拖拽的范围 + offset: '0px', //可选 默认0px,下拉刷新控件的起始位置 + // auto: true, //可选,默认false.首次加载自动上拉刷新一次 + contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容 + contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容 + contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容 + contentnomore: '没有更多数据了', + callback: pulldownRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据; + }, + up: { + contentrefresh: '正在加载...', + callback: pullupRefresh + } + } +}); +var count = 1; + +function pullupRefresh() { + count += 1; + getData(count); + mui('#pullrefresh').pullRefresh().endPullupToRefresh(); +} + +/** + * 下拉刷新具体业务实现 + */ +function pulldownRefresh() { + setTimeout(function() { + window.location.reload(); + //mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed + }, 1500); +} +var isLoad = false; + +function getData(page) { + if (true == isLoad) return; + isLoad = true; + JZL.ajax(qlgUrl('app/Orders/getOrderList'), { + type: order_class, + page: page, + pagesize: 10 + }, function(data) { + //console.log(data); + var data = toJson(data); + var html = '' + if ('' == data.data.Rows) { + mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); + return; + } + $.each(data.data.Rows, function() { + //this.pay_name = 1; + var shopConfirmHtml = ''; + if (this.orderStatus == 0) { + if (0 == this.shopConfirm) { + shopConfirmHtml = '
          待商家确认
          '; + } else if (1 == this.shopConfirm) { + shopConfirmHtml = '
          商家已确认
          '; + } else if (2 == this.shopConfirm) { + shopConfirmHtml = '
          商家未收款
          '; + } + } + html += '
          ' + this.shopName + + '
          商家电话:' + this.phone + '
          ' + shopConfirmHtml + '
          ' + + this.status + '
          ' + $.each(this.list, function() { + html += '

          ' + this.goodsName + '

          ' + this.goodsSpecNames + + '

          ¥' + this.goodsPrice + '

          ¥' + this.marketPrice + 'x' + + this.goodsNum + '
          '; + }) + html += '
          共' + this.list.length + '件商品 合计:¥' + this.realTotalMoney + + '(含运费¥' + this.deliverMoney + ')
          '; + if (this.orderStatus == -2) { + html += '
          立即付款
          取消订单
          '; + } else if (this.orderStatus == 0) { + html += '
          上传凭证
          '; + if (this.noticeDeliver == 0) { + html += '
          取消订单
          '; + } else { + html += '
          取消订单
          '; + } + + } else if (this.orderStatus == 1) { + html += + '
          确认收货
          查看物流
          拒收
          延长收货
          '; + } else if (this.orderStatus == 2) { + if (this.isAppraise == 0) { + html += '
          立即评价
          '; + } else { + html += '
          查看评价
          '; + } + + } + if (this.orderStatus != 1 && this.orderStatus != -2 && this.isComplain == 0) { + html += '
          投诉
          '; + } + if (this.allowRefund == 1 && (this.orderStatus == -1 || this.orderStatus == -3)) { + html += '
          申请退款
          '; + } + + html += '
          ' + }) + + $('.con').append(html); + isLoad = false; + }) +} +mui.plusReady(function() { + + // window.addEventListener('refresh', function(e) { //执行刷新 + // location.reload(); + // }); + // //console.log(order_class) + if (order_class == 'all') { + order_class = ''; + } + getData(count); + + //支付插件 + plus.payment.getChannels(function(channels) { + for (var i in channels) { + if (channels[i].id == "wxpay") { + wxChannel = channels[i]; + } else { + aliChannel = channels[i]; + } + } + }, function(e) { + mui.alert("获取支付通道失败:" + e.message); + }); + // var ALIPAYSERVER = 'http://demo.dcloud.net.cn/helloh5/payment/alipay.php?total='; + var ALIPAYSERVER = hyhUrl('app/Alipays/toAlipay?isBatch=0&orderNo='); + // 2. 发起支付请求 + function pay(id, orderNo) { + // 从服务器请求支付订单 + var PAYSERVER = ''; + if (id == 'alipay') { + PAYSERVER = ALIPAYSERVER; + channel = aliChannel; + } else if (id == 'wxpay') { + PAYSERVER = WXPAYSERVER; + channel = wxChannel; + } else { + plus.nativeUI.alert("不支持此支付通道!", null, "捐赠"); + return; + } + var xhr = new XMLHttpRequest(); + // var amount = 1; + + xhr.onreadystatechange = function() { + switch (xhr.readyState) { + case 4: + if (xhr.status == 200) { + plus.payment.request(channel, xhr.responseText, function(result) { + plus.nativeUI.alert("支付成功!", function() { + // back(); + var targetTab = plus.webview.getWebviewById("templete/my.html"); + mui.fire(targetTab, 'refresh'); + location.reload(); + }); + }, function(error) { + // plus.nativeUI.alert("支付失败:" + error.code); + // plus.webview.getWebviewById('confirmOrder.html').close() + }); + } else { + mui.alert("获取订单信息失败!"); + //console.log(xhr.status) + } + break; + default: + break; + } + } + xhr.open('GET', PAYSERVER + orderNo); + xhr.send(); + + } + $('#pay_way,.pay_info .con_1').append( + '

          付款方式

          线下支付

          ' + ); + + // mui.ajax(hyhUrl('/app/Users/get_name_and_money'), { + // headers: { + // "HYH-Token": token + // }, + // data: {}, + // dataType: 'json', //服务器返回json格式数据 + // type: 'post', //HTTP请求类型 + // timeout: 10000, //超时时间设置为10秒; + // success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // // //console.log(data) + // data = toJson(data); + // + // if(data.status == 1) { + // $('#loginName').html(data.data.name); + // $('.userMoney').html(data.data.money); + // var htmlpay = '

          ECT余额:' + data.data.userECT + '

          '; + // $('.pay_info .con_1').append(htmlpay); + // } else { + // mui.alert('发生错误请刷新后重试!'); + // // location.reload(); + // } + // }, + // error: function(xhr, type, errorThrown) { //异常处理; + // // mui.alert(type); + // } + // }) + $('.con').on('tap', '.ljfk', function() { + var that = $(this); + pay_name = $(this).attr('data-payName'); + priceT = $(this).parent().siblings('.combination').children('o').html().slice(1); + $('#goodsTotalMoney').html($(this).parent().siblings('.combination').children('o').html()) + orderNo = $(this).parent().parent().attr('data-orderNo'); + if (pay_name == 1) { + $('.pay_info .con_1 .row').eq(1).attr('style', 'display: none;'); + $('.pay_info .con_1 .row').eq(2).addClass('on'); + that.attr('disabled', 'disabled'); + mui.ajax(hqlgUrl('app/ect/getToEctNum'), { + + data: { + total_money: priceT + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + var data = toJson(data); + if (data.status == 1) { + var btnArray = ['是', '否']; + mui.confirm(data.msg, 'ECT确认支付', btnArray, function(e) { + if (e.index == 1) { + return; + } else { + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } + that.removeAttr('disabled'); + }) + } else { + mui.alert(data.msg); + that.removeAttr('disabled'); + return; + } + + } + }) + } else { + $('.pay_info .con_1 .row').eq(1).addClass('on'); + $('.pay_info .con_1 .row').eq(2).attr('style', 'display: none;'); + $('.bg').css('display', 'block'); + $(".pay").slideDown(300); + } + + }) + + $('.bg').on('tap', '.mui-icon-left-nav', function() { + $('.pay').css('display', 'block'); + $('.pay_way').css('display', 'none'); + }) + $('.bg').on('tap', '.mui-icon-closeempty', function() { + $('.bg').css('display', 'none'); + $(".pay").slideUp(300, function() { + + }); + }) + $('#pay_way').on('tap', '.row', function() { + $('#pay_way .row .mui-icon').removeClass('mui-icon-checkmarkempty'); + $(this).children('.mui-icon').addClass('mui-icon-checkmarkempty'); + $('.con_1 .on .row_right o').html($(this).children('.row_left').html()); + $('.con_1 .on').attr('data-payCode', $(this).attr('data-payCode')) + $('.pay').css('display', 'block'); + $('#pay_way').css('display', 'none'); + + }) + $('.pay').on('tap', '.con_1 .on', function() { + if ($(this).attr('data-payCode') == 'ect') { + + } else { + $('.pay').css('display', 'none'); + $('#pay_way').css('display', 'block'); + } + + }) + $('.pay_btn').on('tap', function() { + payCode = $('.con_1 .on').attr('data-payCode'); + ////console.log(payCode) + var that = $(this); + var data_ljfk = { + isBatch: 0, + orderNo: orderNo + } + that.attr('disabled', 'disabled'); + mui.ajax(hyhUrl('app/orders/succeed'), { + data: data_ljfk, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + data = toJson(data); + + if (data.status == 1) { + if (payCode == 'qlgpay') { + JZL.ajax(hyhUrl('app/' + payCode + '/payment'), { + orderNo: orderNo, + isBatch: 0 + }, function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(JSON.stringify(data)); + var data = toJson(data); + // //console.log(JSON.stringify(data)) + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#qlg_pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置操作密码!'); + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + //return; + } + $('#totalMoney').html('付款总额:¥' + data.data.needPay + ''); + $('#productNum').val(data.data.product.useProduct); + if (data.data.product.useProduct > 0) { + var html1 = '

          抵扣额' + data.data.product.useProductOk + + '

          扣税 ' + data.data.product.useProductTaxFee + + '

          手续费 ' + data.data.product.useProductHandlingFee + + '

          '; + // $('#productInfo').html('产品券[抵扣额:' + data.data.product.useProductOk + ',扣税:' + data.data.product.useProductTaxFee + + // ',手续费:' + data.data.product.useProductHandlingFee + ']'); + $('.productInfo_').html(html1) + + } + $('#couponsNum').val(data.data.coupons.useCoupons); + if (data.data.coupons.useCoupons > 0) { + var html2 = '

          抵扣额' + data.data.coupons.useCouponsOk + + '

          扣税 ' + data.data.coupons.useCouponsTaxFee + + '

          手续费 ' + data.data.coupons.useCouponsHandlingFee + + '

          '; + $('.couponsInfo_').html(html2) + // $('#couponsInfo').html('优惠券[抵扣额:' + data.data.coupons.useCouponsOk + ',扣税:' + data.data.coupons.useCouponsTaxFee + + // ',手续费:' + data.data.coupons.useCouponsHandlingFee + ']'); + } + $('#wangNum').val(data.data.wang.useWang); + $('#moneyNum').val(data.data.money.useMoney); + + } else { + mui.alert(data.msg) + } + }); + } else if (payCode == 'wallets' || payCode == 'ect') { + //跳输入密码的页面 + mui.ajax(hyhUrl('app/' + payCode + '/payment'), { + data: { + orderNo: orderNo, + isBatch: 0 + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data); + if (data.status == 1) { + $('.pay').css('display', 'none'); + $('#pay_pwd').css('display', 'block'); + if (data.data.payPwd == '0') { + mui.alert('还未设置支付密码请先设置支付密码!'); + var url = 'setting_fogetPayPwd'; + mui.openWindow({ + url: url + '.html', + id: url + '.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + // data_href: data_href + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + } + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + } else if (payCode == 'alipays') { + pay('alipay', orderNo); + // plus.nativeUI.showWaiting(); + // mui.post(hyhUrl('app/Alipays/payment'), { + // orderNo: data.data, + // isBatch: 1 + // var ALIPAYSERVER = hyhUrl('app/Alipays/payment?orderNo=' + data.data + '&isBatch=1'); + + } + + that.removeAttr('disabled'); + } else { + mui.alert(data.msg) + // mui.alert('发生错误请刷新后重试!'); + // location.reload(); + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + mui.alert(type); + } + }) + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.p9', function() { + var url = 'setting_fogetPayPwd'; + JZL.openWindow(url + '.html', url + '.html'); + }) + $('#pay_pwd,#qlg_pay_pwd').on('tap', '.pay_btn_pwd', function() { + // var self = plus.webview.currentWebview(); + // var data_href = self.id; + // //console.log(data_href) + // JZL.closeWindow('waitPay'); + //return; + var payPwd = $('#payPwd').val(); + if (payPwd == '') { + mui.alert('支付密码不能为空!'); + return; + } + var that = $(this); + that.attr('disabled', 'disabled') + var srcc = '' + if (payCode == 'qlgpay') { + srcc = 'payByQlg'; + } else if (payCode == 'ect') { + srcc = 'payByEct'; + } else { + srcc = 'payByWallet'; + } + + mui.ajax(hyhUrl('app/' + payCode + '/' + srcc), { + + data: { + orderNo: orderNo, + isBatch: 0, + payPwd: payPwd + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + var data = toJson(data); + mui.alert(data.msg) + //console.log(data.status) + if (data.status == 1) { + JZL.openWindow('indent.html', 'waitDeliver', { + data_href: 'waitDeliver' + }); + setTimeout(function() { + JZL.closeWindow(plus.webview.currentWebview().id); + // JZL.closeWindow('indent.html'); + }, 700) + // var targetTab = plus.webview.getWebviewById("templete/my.html"); + // mui.fire(targetTab, 'refresh'); + // location.reload(); + } else { + + } + that.removeAttr('disabled') + + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + + }) + + mui('.con').on('tap', '.row_con', function() { + var data_order_id = $(this).attr('data-id'); + mui.openWindow({ + url: 'order_out.html', + id: 'order_out.html', + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: data_order_id + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + mui('.con').on('tap', '.ckwl', function() { + var data_order_id = $(this).parent().parent().attr('data-id'); //$(this).attr('data-id'); + JZL.openWindow('logistics.html', 'logistics.html', { + data_order_id: data_order_id + }); + }) + //上传凭证 + mui('.con').on('tap', '.uploadCertificate', function() { + var orderId = $(this).parent().parent().attr('data-id'); + // mui.alert('跳到上传凭证页'+orderId) + + JZL.openWindow('uploadVoucher.html', 'uploadVoucher.html' + orderId, { + orderId: orderId + }); + + }) + $('.con').on('tap', '.qxdd_js', function() { + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if ($(this).html() == '取消订单') { + getReasonUrl = 'getCancelCause'; + } else if ($(this).html() == '拒收') { + getReasonUrl = 'getRejectCause'; + } else if ($(this).html() == '申请退款') { + getReasonUrl = 'getRefundCause'; + JZL.ajax(hyhUrl('/app/Orders/getRefund'), { + id: orderId + }, function(data) { //服务器返回响应 + // //console.log(JSON.stringify(data)); + var data = toJson(data); + if (data.status == 1) { + data = data.data; + var html = ''; + if ('qlgpay' == data.payFrom) { + html = ' 退款产品券数量:' + + ' 退款优惠券数量:' + + ' 退款旺旺券数量:' + + ' 退款现金数量:' + data.moneyNum + ',现金方面请与商家协商' + + // '

          (金额不能超过¥' + data.realTotalMoney + + ')

          '; + } else { + html = '

          (金额不能超过¥' + data.realTotalMoney + + ')

          (积分数量:' + data.ectNum + ')

          '; + } + + $('.tui').html(html) + } else { + mui.alert(data.msg) + } + }); + } + $('.bg_').css('display', 'block'); + $('.bg_con').css('display', 'none'); + $('.bg_con').slideDown(300, function() {}); + + mui.ajax(hyhUrl('/app/Orders/' + getReasonUrl), { + data: {}, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + if (data.status == 1) { + var html = ''; + $.each(data.data, function() { + html += '' + }); + $('#select').html(html) + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + }) + + $('.bg_').on('tap', '.en_false', function() { + $('.bg_').css('display', 'none'); + + }) + $('.bg_').on('tap', '.en_true', function() { + var setReasonUrl = ''; + var content = $('#content').val(); + var reason = $('#select').val(); + if ($('#select').val() == 0) { + mui.alert('请选择原因!'); + return; + } + if ($('#select').val() == 10000 && content == '') { + mui.alert('请输入其他原因!'); + return; + } + if (getReasonUrl == 'getCancelCause') { + setReasonUrl = 'cancellation'; + mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { + data: { + reason: reason, + id: orderId, + content: content + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + // mui.fire(list, 'refresh'); + if ('waitPay' == plus.webview.currentWebview().id) { + location.reload(); + } else { + JZL.openWindow('indent.html', 'abnormal', { + data_href: 'abnormal' + }); + setTimeout(function() { + //plus.webview.currentWebview().close(); + JZL.closeWindow(plus.webview.currentWebview().id); + }, 500) + } + // JZL.openWindow('indent.html', 'abnormal', { + // data_href: 'abnormal' + // }); + // setTimeout(function() { + // plus.webview.currentWebview().close(); + // // JZL.closeWindow(plus.webview.currentWebview().id); + // }, 500) + //location.reload(); + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else if (getReasonUrl == 'getRejectCause') { + setReasonUrl = 'reject'; + mui.ajax(qlgUrl('app/Orders/' + setReasonUrl), { + data: { + reason: reason, + id: orderId, + content: content + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + // //console.log(data.data.goodsFavoritesNum) + // //console.log(data.data.Rows) + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + // var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + // mui.fire(list, 'refresh'); + location.reload(); + + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(type); + } + }); + } else if (getReasonUrl == 'getRefundCause') { + var params = {} + // params.money = $('#Tmoney').val(); + // if (params.money < 0 || params.money == 0) { + // mui.alert('退款金额不能为0!'); + // return; + // } + params.productNum = $('#productNum').val(); + params.couponsNum = $('#couponsNum').val(); + params.wangNum = $('#wangNum').val(); + params.reason = reason; + params.id = orderId; + params.content = content; + JZL.ajax(qlgUrl('app/Orderrefunds/refund'), params, function(data) { + var data = toJson(data); + mui.alert(data.msg); + if (data.status == 1) { + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload(); + + } + }) + + } + + }) + + $('.con').on('tap', '.yssh', function() { + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if (confirm('你要延长收货么?')) { + mui.ajax(qlgUrl('/app/orders/delay'), { + headers: { + "HYH-Token": token + }, + data: { + id: orderId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(data.data.goodsFavoritesNum) + ////console.log(data.data.Rows) + var data = toJson(data); + ////console.log(data.status) + if (data.status == 1) { + mui.alert(data.msg); + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + } + }) + + $('.con').on('tap', '.qrsh', function() { + //$('.bg_').css('display', 'block'); + orderNo = $(this).parent().parent().attr('data-orderNo'); + orderId = $(this).parent().parent().attr('data-id'); + if (confirm('确认收货?')) { + mui.ajax(hyhUrl('/app/Orders/receive'), { + headers: { + "HYH-Token": token + }, + data: { + id: orderId + }, + dataType: 'json', //服务器返回json格式数据 + type: 'post', //HTTP请求类型 + timeout: 10000, //超时时间设置为10秒; + success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功; + ////console.log(data.data.goodsFavoritesNum) + ////console.log(data.data.Rows) + var data = toJson(data); + ////console.log(data.status) + if (data.status == 1) { + var list = plus.webview.currentWebview().opener(); //触发父页面的自定义事件(refresh),从而进行刷新 + mui.fire(list, 'refresh'); + location.reload() + } else { + mui.alert(data.msg) + } + }, + error: function(xhr, type, errorThrown) { //异常处理; + // mui.alert(errorThrown); + } + }); + } + + }) + $('#select').on('change', function() { + if ($(this).val() == '10000') { + $('#content').css('display', 'block'); + } else { + $('#content').css('display', 'none'); + } + }) + //跳转到评价 + mui('.con').on('tap', '.ljpj', function() { + var oId = $(this).parent().parent().attr('data-id'); + mui.openWindow({ + url: 'pj.html', + id: 'pj.html' + oId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: oId + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + //跳转到评价 + mui('.con').on('tap', '.ckpj', function() { + var oId = $(this).parent().parent().attr('data-id'); + mui.openWindow({ + url: 'pj.html', + id: 'pj.html' + oId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: oId + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + //跳转到评价 + mui('.con').on('tap', '.tsdd', function() { + var oId = $(this).parent().parent().attr('data-id'); + mui.openWindow({ + url: 'complain.html', + id: 'complain.html' + oId, + styles: { + top: '0px', //新页面顶部位置 + bottom: '0px', //新页面底部位置 + width: '100%', //新页面宽度,默认为100% + height: '100%' //新页面高度,默认为100% + }, + extras: { + data_order_id: oId + // data_id: data_id + // ..... //自定义扩展参数,可以用来处理页面间传值 + }, + createNew: false, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示 + show: { + // autoShow: true, //页面loaded事件发生后自动显示,默认为true + // aniShow: animationType, //页面显示动画,默认为”slide-in-right“; + // duration: animationTime, //页面动画持续时间,Android平台默认100毫秒,iOS平台默认200毫秒; + // event: 'titleUpdate', //页面显示时机,默认为titleUpdate事件时显示 + // extras: {} //窗口动画是否使用图片加速 + }, + waiting: { + autoShow: true, //自动显示等待框,默认为true + title: '正在加载...', //等待对话框上显示的提示内容 + options: { + // width: waiting - dialog - widht, //等待框背景区域宽度,默认根据内容自动计算合适宽度 + // height: waiting - dialog - height, //等待框背景区域高度,默认根据内容自动计算合适高度 + // ...... + } + } + }) + }) + +}) diff --git a/js/index.js b/js/index.js new file mode 100644 index 0000000..6111c8c --- /dev/null +++ b/js/index.js @@ -0,0 +1,74 @@ +var wgtVer = null; +var is_juzi_online = 0; + +function plusReady() { // 获取本地应用资源版本号 + plus.runtime.getProperty(plus.runtime.appid, function(inf) { + wgtVer = inf.version; + }); +} +//休眠方法 +var ver; +//获取数据 +function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } +} + +mui.init({ + swipeBack: true +}); +var firstBackbutton = null; +mui.back = function() { + if (!firstBackbutton) { + window.plus.nativeUI.toast('再按一次退出应用'); + firstBackbutton = new Date().getTime(); + setTimeout(function() { + firstBackbutton = null + }, 2000); + return false; + } else { + if (new Date().getTime() - firstBackbutton < 2000) { + if (mui.os.ios) { + const threadClass = plus.ios.importClass("NSThread"); + const mainThread = plus.ios.invoke(threadClass, "mainThread"); + plus.ios.invoke(mainThread, "exit"); + } else { + plus.runtime.quit(); + } + } + } +}; +//获取cid用于推送 +mui.plusReady(function() { + // var cid = plus.push.getClientInfo().clientid; + var timer = 0; + timer = setInterval(function() { + getData(); + }, 3000) + getData(); + + function getData() { + + if (!localStorage.getItem('isFirstDownlodad')) { + localStorage.setItem('isFirstDownlodad', true); + } + clearInterval(timer); + localStorage.setItem('cssUrl', "../css/"); + localStorage.setItem('jsUrl', "../js/"); + $('nav').css('display', 'block'); + $('#bg').css('display', 'none'); + var ipxSizeTop = 0; + var ipxSizeBottom = 0; + localStorage.setItem('ipxSizeTop', ipxSizeTop); + localStorage.setItem('ipxSizeBottom', ipxSizeBottom); + init(data); + jumpPage(ipxSizeBottom); + nav(0); + } + +}) diff --git a/js/individual.js b/js/individual.js new file mode 100644 index 0000000..b7e8807 --- /dev/null +++ b/js/individual.js @@ -0,0 +1,179 @@ +mui.plusReady(function() { + var wait = 120; + var count = 0; + var authId = ''; + JZL.getItems('auth_personal'); + + $('.header_con_bc').on('tap', function() { + JZL.saveItems('.localinp', 'auth_personal'); + mui.toast('保存成功'); + }) + // //console.log($('#headImg').val()); + + if ('' == $('#headImg').val()) { + $("#headImgTag").attr("src", "../img/touxiang.jpg") + } + if ('' == $('#accountBookImg').val()) { + $("#accountBookImgTag").attr("src", "../img/hukou.jpg") + } + + JZL.ajax(qlgUrl('app/auth/getAuthInfo'), {}, function(data) { + //console.log(data); + // //console.log(typeof(data.data)); + if ('undefined' != typeof(data.data) && 1 == data.status) { //编辑 + count = 1; + authId = data.data.id + $('.mobileCode').hide() + $('.userPhone').hide() + $('.payPwd').show() + mui.each(data.data, function(index, element) { + if ($('#' + index).attr("type") == "hidden") { + // var imgindex = index.substring(0, index.length - 3); + var imgindex = index + 'Tag' + var obj = '#' + imgindex + // //console.log('#' + imgindex + '') + if (imgindex != "") { + if ($(obj).is('img')) { + $(obj).attr("src", hyhImgUrl(element)) + $('#' + index + '').val(element) + } + } + + } else { + $('#' + index).val(element) + } + + + }) + // if (data.status == 1) { + // $('.qrbb').show(); + // $('.qrrz').show(); + // } else { + // $('.qrbb').hide(); + // $('.qrrz').hide(); + // } + } else { + //console.log(2222); + $('.userPhone').show() + $('.mobileCode').show() + $('.payPwd').hide() + JZL.getItems('auth_company'); + } + }) + + function time() { + if (wait == 0) { + $('.HQYZM').removeAttr("disabled"); + $('.HQYZM').html("重新发送"); + wait = 120; + } else { + $('.HQYZM').attr("disabled", true); + $('.HQYZM').html("重新发送(" + wait + ")"); + wait--; + setTimeout(function() { + time() + }, + 1000) + } + } + $(".HQYZM").on("tap", function() { + var userPhone = $('#userPhone').val(); + if ('' == userPhone) { + mui.alert("请输入手机号") + return; + } + if (!( + /^134[0-8]\d{7}$|^13[^4]\d{8}$|^14[5-9]\d{8}$|^15[^4]\d{8}$|^16[6]\d{8}$|^17[0-8]\d{8}$|^18[\d]{9}$|^19[8,9]\d{8}$/ + .test(userPhone))) { + mui.alert("手机号码有误,请重填!"); + return; + } + $(".HQYZM").attr("disabled", true); + + JZL.ajax(qlgUrl('app/auth/getPhoneCode'), { + userPhone: userPhone + }, function(data) { + //console.log(data); + if (data.status == 1) { + time(); + $('.YZM').focus(); + } else { + mui.alert(data.msg); + } + + }) + }) + + $('.bc_btn').on('tap', function() { + var params = JZL.getParams(".inp"); + if ('' == params.houseAddress) { + mui.alert("请输入地址"); + return; + } + if ('' == params.householdIdCard) { + mui.alert("请输入身份证号"); + return; + + } + if ('' == params.householdName) { + mui.alert("请输入户主姓名"); + return; + + } + if (0 == count) { + if ('' == params.mobileCode) { + mui.alert("请输入验证码"); + return; + + } + } else if (1 == count) { + if ('' == params.payPwd) { + mui.alert("请输入操作密码"); + return; + } + params.authId = authId; + } + + //console.log(params); + JZL.ajax(qlgUrl('app/auth/setAuthInfo'), params, function(data) { + //console.log(data); + if (data.status == 1) { + + JZL.saveItems('.localinp', 'auth_personal'); + localStorage.setItem("authType","1") + mui.toast("提交成功 请等待审核") + // $(".mui-table-view").attr("readonly", "readonly") + $(".mobileCode").attr("display", "none") + mui.back(); + } else { + mui.alert(data.msg); + } + + }) + }) + + mui('.mui-table-content').on('tap', '.qrbb', function() { + JZL.openWindow('qrbb.html', 'qrbb.html'); + + }) + mui('.mui-table-content').on('tap', '.qrrz', function() { + JZL.openWindow('qrrz.html', 'qrrz.html'); + + }) + + + $(".ossfile").on("tap", '#accountBookImgTag', function() { + UP.init("accountBookImg", "test", "accountBookImgTag") + + // UP.init("id", "test", "imgId") + + openCamera(); + }) + //更换头像 + $("#headerimg").on("tap", '#headImgTag', function() { + UP.init("headImg", "test", "headImgTag") + openCamera(); + }) + + +}) diff --git a/js/invest.js b/js/invest.js new file mode 100644 index 0000000..5303cda --- /dev/null +++ b/js/invest.js @@ -0,0 +1,27 @@ +mui.plusReady(function () { + var userId=""; + var shopName=""; + // 获取数据 + JZL.ajax(qlgUrl('app/users/familyInvestmentList'),{},function (data ) { + console.log(data); + var html =""; + if (1 == data.status){ + var data = data.data + $.each(data,function () { + html+='
          '+this.companyName+'
          合作人'+this.count +'人
          '+formatDate(new Date(this.createTime*1000))+'创建
          '+this.stake+'%

          持股

          '+this.companyAddress+'
          ' + }) + + $('.con').append(html) + + } + + }) + + + $("body").on("tap",".con_",function () { + userId=$(this).attr("data-id") + shopName=$(this).attr("data-shopName") + + JZL.openWindow('investdetail.html', 'investdetail.html',{userId : userId,shopName:shopName}) + }) +}) \ No newline at end of file diff --git a/js/investdetail.js b/js/investdetail.js new file mode 100644 index 0000000..f8d4f58 --- /dev/null +++ b/js/investdetail.js @@ -0,0 +1,24 @@ +mui.plusReady(function () { + var self =plus.webview.currentWebview() + var userId = self.userId; + var shopName = self.shopName; + var html = ""; + + // console.log(self.userId); + //获取数据 + JZL.ajax(qlgUrl("app/users/investmentInfo"),{userId:userId},function (data) { + console.log(data); + if (1 == data.status) { + var data =data.data; + html ='
          '+shopName+'
          ' + $.each(data,function () { + html += '
          '+ this.uName+'
          '+this.positionName+'
          '+formatDate(new Date(this.createTime*1000))+'加入
          '+this.stake+'%

          持股

          ' + }) + $('.con').html(html) + } + }) + + $('.down').on ("tap",".btn",function () { + JZL.openWindow("distribution.html","distribution.html",{userId :userId}) + }) +}) \ No newline at end of file diff --git a/js/jquery-3.2.1.min.js b/js/jquery-3.2.1.min.js new file mode 100644 index 0000000..644d35e --- /dev/null +++ b/js/jquery-3.2.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
          "],col:[2,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + */ + var dispatches = [ + /** + Dispatched when runtime is connected and file-picker is ready to be used. + + @event ready + @param {Object} event + */ + 'ready', + + /** + Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. + Check [corresponding documentation entry](#method_refresh) for more info. + + @event refresh + @param {Object} event + */ + + /** + Dispatched when selection of files in the dialog is complete. + + @event change + @param {Object} event + */ + 'change', + + 'cancel', // TODO: might be useful + + /** + Dispatched when mouse cursor enters file-picker area. Can be used to style element + accordingly. + + @event mouseenter + @param {Object} event + */ + 'mouseenter', + + /** + Dispatched when mouse cursor leaves file-picker area. Can be used to style element + accordingly. + + @event mouseleave + @param {Object} event + */ + 'mouseleave', + + /** + Dispatched when functional mouse button is pressed on top of file-picker area. + + @event mousedown + @param {Object} event + */ + 'mousedown', + + /** + Dispatched when functional mouse button is released on top of file-picker area. + + @event mouseup + @param {Object} event + */ + 'mouseup' + ]; + + function FileInput(options) { + var self = this, + container, browseButton, defaults; + + // if flat argument passed it should be browse_button id + if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { + options = { browse_button : options }; + } + + // this will help us to find proper default container + browseButton = Dom.get(options.browse_button); + if (!browseButton) { + // browse button is required + throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); + } + + // figure out the options + defaults = { + accept: [{ + title: I18n.translate('All Files'), + extensions: '*' + }], + name: 'file', + multiple: false, + required_caps: false, + container: browseButton.parentNode || document.body + }; + + options = Basic.extend({}, defaults, options); + + // convert to object representation + if (typeof(options.required_caps) === 'string') { + options.required_caps = Runtime.parseCaps(options.required_caps); + } + + // normalize accept option (could be list of mime types or array of title/extensions pairs) + if (typeof(options.accept) === 'string') { + options.accept = Mime.mimes2extList(options.accept); + } + + container = Dom.get(options.container); + // make sure we have container + if (!container) { + container = document.body; + } + + // make container relative, if it's not + if (Dom.getStyle(container, 'position') === 'static') { + container.style.position = 'relative'; + } + + container = browseButton = null; // IE + + RuntimeClient.call(self); + + Basic.extend(self, { + /** + Unique id of the component + + @property uid + @protected + @readOnly + @type {String} + @default UID + */ + uid: Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if any. + + @property ruid + @protected + @type {String} + */ + ruid: null, + + /** + Unique id of the runtime container. Useful to get hold of it for various manipulations. + + @property shimid + @protected + @type {String} + */ + shimid: null, + + /** + Array of selected mOxie.File objects + + @property files + @type {Array} + @default null + */ + files: null, + + /** + Initializes the file-picker, connects it to runtime and dispatches event ready when done. + + @method init + */ + init: function() { + self.convertEventPropsToHandlers(dispatches); + + self.bind('RuntimeInit', function(e, runtime) { + self.ruid = runtime.uid; + self.shimid = runtime.shimid; + + self.bind("Ready", function() { + self.trigger("Refresh"); + }, 999); + + self.bind("Change", function() { + var files = runtime.exec.call(self, 'FileInput', 'getFiles'); + + self.files = []; + + Basic.each(files, function(file) { + // ignore empty files (IE10 for example hangs if you try to send them via XHR) + if (file.size === 0) { + return true; + } + self.files.push(new File(self.ruid, file)); + }); + }, 999); + + // re-position and resize shim container + self.bind('Refresh', function() { + var pos, size, browseButton, shimContainer; + + browseButton = Dom.get(options.browse_button); + shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist + + if (browseButton) { + pos = Dom.getPos(browseButton, Dom.get(options.container)); + size = Dom.getSize(browseButton); + + if (shimContainer) { + Basic.extend(shimContainer.style, { + top : pos.y + 'px', + left : pos.x + 'px', + width : size.w + 'px', + height : size.h + 'px' + }); + } + } + shimContainer = browseButton = null; + }); + + runtime.exec.call(self, 'FileInput', 'init', options); + }); + + // runtime needs: options.required_features, options.runtime_order and options.container + self.connectRuntime(Basic.extend({}, options, { + required_caps: { + select_file: true + } + })); + }, + + /** + Disables file-picker element, so that it doesn't react to mouse clicks. + + @method disable + @param {Boolean} [state=true] Disable component if - true, enable if - false + */ + disable: function(state) { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); + } + }, + + + /** + Reposition and resize dialog trigger to match the position and size of browse_button element. + + @method refresh + */ + refresh: function() { + self.trigger("Refresh"); + }, + + + /** + Destroy component. + + @method destroy + */ + destroy: function() { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileInput', 'destroy'); + this.disconnectRuntime(); + } + + if (Basic.typeOf(this.files) === 'array') { + // no sense in leaving associated files behind + Basic.each(this.files, function(file) { + file.destroy(); + }); + } + this.files = null; + } + }); + } + + FileInput.prototype = EventTarget.instance; + + return FileInput; +}); + +// Included from: src/javascript/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileDrop', [ + 'moxie/core/I18n', + 'moxie/core/utils/Dom', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic', + 'moxie/file/File', + 'moxie/runtime/RuntimeClient', + 'moxie/core/EventTarget', + 'moxie/core/utils/Mime' +], function(I18n, Dom, x, Basic, File, RuntimeClient, EventTarget, Mime) { + /** + Turn arbitrary DOM element to a drop zone accepting files. Converts selected files to _File_ objects, to be used + in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through + _XMLHttpRequest_. + + @example +
          + Drop files here +
          +
          +
          + + + + @class FileDrop + @constructor + @extends EventTarget + @uses RuntimeClient + @param {Object|String} options If options has typeof string, argument is considered as options.drop_zone + @param {String|DOMElement} options.drop_zone DOM Element to turn into a drop zone + @param {Array} [options.accept] Array of mime types to accept. By default accepts all + @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support + */ + var dispatches = [ + /** + Dispatched when runtime is connected and drop zone is ready to accept files. + + @event ready + @param {Object} event + */ + 'ready', + + /** + Dispatched when dragging cursor enters the drop zone. + + @event dragenter + @param {Object} event + */ + 'dragenter', + + /** + Dispatched when dragging cursor leaves the drop zone. + + @event dragleave + @param {Object} event + */ + 'dragleave', + + /** + Dispatched when file is dropped onto the drop zone. + + @event drop + @param {Object} event + */ + 'drop', + + /** + Dispatched if error occurs. + + @event error + @param {Object} event + */ + 'error' + ]; + + function FileDrop(options) { + var self = this, defaults; + + // if flat argument passed it should be drop_zone id + if (typeof(options) === 'string') { + options = { drop_zone : options }; + } + + // figure out the options + defaults = { + accept: [{ + title: I18n.translate('All Files'), + extensions: '*' + }], + required_caps: { + drag_and_drop: true + } + }; + + options = typeof(options) === 'object' ? Basic.extend({}, defaults, options) : defaults; + + // this will help us to find proper default container + options.container = Dom.get(options.drop_zone) || document.body; + + // make container relative, if it is not + if (Dom.getStyle(options.container, 'position') === 'static') { + options.container.style.position = 'relative'; + } + + // normalize accept option (could be list of mime types or array of title/extensions pairs) + if (typeof(options.accept) === 'string') { + options.accept = Mime.mimes2extList(options.accept); + } + + RuntimeClient.call(self); + + Basic.extend(self, { + uid: Basic.guid('uid_'), + + ruid: null, + + files: null, + + init: function() { + + self.convertEventPropsToHandlers(dispatches); + + self.bind('RuntimeInit', function(e, runtime) { + self.ruid = runtime.uid; + + self.bind("Drop", function() { + var files = runtime.exec.call(self, 'FileDrop', 'getFiles'); + + self.files = []; + + Basic.each(files, function(file) { + self.files.push(new File(self.ruid, file)); + }); + }, 999); + + runtime.exec.call(self, 'FileDrop', 'init', options); + + self.dispatchEvent('ready'); + }); + + // runtime needs: options.required_features, options.runtime_order and options.container + self.connectRuntime(options); // throws RuntimeError + }, + + destroy: function() { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileDrop', 'destroy'); + this.disconnectRuntime(); + } + this.files = null; + } + }); + } + + FileDrop.prototype = EventTarget.instance; + + return FileDrop; +}); + +// Included from: src/javascript/runtime/RuntimeTarget.js + +/** + * RuntimeTarget.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/RuntimeTarget', [ + 'moxie/core/utils/Basic', + 'moxie/runtime/RuntimeClient', + "moxie/core/EventTarget" +], function(Basic, RuntimeClient, EventTarget) { + /** + Instance of this class can be used as a target for the events dispatched by shims, + when allowing them onto components is for either reason inappropriate + + @class RuntimeTarget + @constructor + @protected + @extends EventTarget + */ + function RuntimeTarget() { + this.uid = Basic.guid('uid_'); + + RuntimeClient.call(this); + + this.destroy = function() { + this.disconnectRuntime(); + this.unbindAll(); + }; + } + + RuntimeTarget.prototype = EventTarget.instance; + + return RuntimeTarget; +}); + +// Included from: src/javascript/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileReader', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Encode', + 'moxie/core/Exceptions', + 'moxie/core/EventTarget', + 'moxie/file/Blob', + 'moxie/file/File', + 'moxie/runtime/RuntimeTarget' +], function(Basic, Encode, x, EventTarget, Blob, File, RuntimeTarget) { + /** + Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) + interface. Where possible uses native FileReader, where - not falls back to shims. + + @class FileReader + @constructor FileReader + @extends EventTarget + @uses RuntimeClient + */ + var dispatches = [ + + /** + Dispatched when the read starts. + + @event loadstart + @param {Object} event + */ + 'loadstart', + + /** + Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). + + @event progress + @param {Object} event + */ + 'progress', + + /** + Dispatched when the read has successfully completed. + + @event load + @param {Object} event + */ + 'load', + + /** + Dispatched when the read has been aborted. For instance, by invoking the abort() method. + + @event abort + @param {Object} event + */ + 'abort', + + /** + Dispatched when the read has failed. + + @event error + @param {Object} event + */ + 'error', + + /** + Dispatched when the request has completed (either in success or failure). + + @event loadend + @param {Object} event + */ + 'loadend' + ]; + + function FileReader() { + var self = this, _fr; + + Basic.extend(this, { + /** + UID of the component instance. + + @property uid + @type {String} + */ + uid: Basic.guid('uid_'), + + /** + Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING + and FileReader.DONE. + + @property readyState + @type {Number} + @default FileReader.EMPTY + */ + readyState: FileReader.EMPTY, + + /** + Result of the successful read operation. + + @property result + @type {String} + */ + result: null, + + /** + Stores the error of failed asynchronous read operation. + + @property error + @type {DOMError} + */ + error: null, + + /** + Initiates reading of File/Blob object contents to binary string. + + @method readAsBinaryString + @param {Blob|File} blob Object to preload + */ + readAsBinaryString: function(blob) { + _read.call(this, 'readAsBinaryString', blob); + }, + + /** + Initiates reading of File/Blob object contents to dataURL string. + + @method readAsDataURL + @param {Blob|File} blob Object to preload + */ + readAsDataURL: function(blob) { + _read.call(this, 'readAsDataURL', blob); + }, + + /** + Initiates reading of File/Blob object contents to string. + + @method readAsText + @param {Blob|File} blob Object to preload + */ + readAsText: function(blob) { + _read.call(this, 'readAsText', blob); + }, + + /** + Aborts preloading process. + + @method abort + */ + abort: function() { + this.result = null; + + if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { + return; + } else if (this.readyState === FileReader.LOADING) { + this.readyState = FileReader.DONE; + } + + if (_fr) { + _fr.getRuntime().exec.call(this, 'FileReader', 'abort'); + } + + this.trigger('abort'); + this.trigger('loadend'); + }, + + /** + Destroy component and release resources. + + @method destroy + */ + destroy: function() { + this.abort(); + + if (_fr) { + _fr.getRuntime().exec.call(this, 'FileReader', 'destroy'); + _fr.disconnectRuntime(); + } + + self = _fr = null; + } + }); + + + function _read(op, blob) { + _fr = new RuntimeTarget(); + + function error(err) { + self.readyState = FileReader.DONE; + self.error = err; + self.trigger('error'); + loadEnd(); + } + + function loadEnd() { + _fr.destroy(); + _fr = null; + self.trigger('loadend'); + } + + function exec(runtime) { + _fr.bind('Error', function(e, err) { + error(err); + }); + + _fr.bind('Progress', function(e) { + self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); + self.trigger(e); + }); + + _fr.bind('Load', function(e) { + self.readyState = FileReader.DONE; + self.result = runtime.exec.call(_fr, 'FileReader', 'getResult'); + self.trigger(e); + loadEnd(); + }); + + runtime.exec.call(_fr, 'FileReader', 'read', op, blob); + } + + this.convertEventPropsToHandlers(dispatches); + + if (this.readyState === FileReader.LOADING) { + return error(new x.DOMException(x.DOMException.INVALID_STATE_ERR)); + } + + this.readyState = FileReader.LOADING; + this.trigger('loadstart'); + + // if source is o.Blob/o.File + if (blob instanceof Blob) { + if (blob.isDetached()) { + var src = blob.getSource(); + switch (op) { + case 'readAsText': + case 'readAsBinaryString': + this.result = src; + break; + case 'readAsDataURL': + this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); + break; + } + this.readyState = FileReader.DONE; + this.trigger('load'); + loadEnd(); + } else { + exec(_fr.connectRuntime(blob.ruid)); + } + } else { + error(new x.DOMException(x.DOMException.NOT_FOUND_ERR)); + } + } + } + + /** + Initial FileReader state + + @property EMPTY + @type {Number} + @final + @static + @default 0 + */ + FileReader.EMPTY = 0; + + /** + FileReader switches to this state when it is preloading the source + + @property LOADING + @type {Number} + @final + @static + @default 1 + */ + FileReader.LOADING = 1; + + /** + Preloading is complete, this is a final state + + @property DONE + @type {Number} + @final + @static + @default 2 + */ + FileReader.DONE = 2; + + FileReader.prototype = EventTarget.instance; + + return FileReader; +}); + +// Included from: src/javascript/core/utils/Url.js + +/** + * Url.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Url', [], function() { + /** + Parse url into separate components and fill in absent parts with parts from current url, + based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js + + @method parseUrl + @for Utils + @static + @param {String} url Url to parse (defaults to empty string if undefined) + @return {Object} Hash containing extracted uri components + */ + var parseUrl = function(url, currentUrl) { + var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] + , i = key.length + , ports = { + http: 80, + https: 443 + } + , uri = {} + , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ + , m = regex.exec(url || '') + ; + + while (i--) { + if (m[i]) { + uri[key[i]] = m[i]; + } + } + + // when url is relative, we set the origin and the path ourselves + if (!uri.scheme) { + // come up with defaults + if (!currentUrl || typeof(currentUrl) === 'string') { + currentUrl = parseUrl(currentUrl || document.location.href); + } + + uri.scheme = currentUrl.scheme; + uri.host = currentUrl.host; + uri.port = currentUrl.port; + + var path = ''; + // for urls without trailing slash we need to figure out the path + if (/^[^\/]/.test(uri.path)) { + path = currentUrl.path; + // if path ends with a filename, strip it + if (!/(\/|\/[^\.]+)$/.test(path)) { + path = path.replace(/\/[^\/]+$/, '/'); + } else { + path += '/'; + } + } + uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir + } + + if (!uri.port) { + uri.port = ports[uri.scheme] || 80; + } + + uri.port = parseInt(uri.port, 10); + + if (!uri.path) { + uri.path = "/"; + } + + delete uri.source; + + return uri; + }; + + /** + Resolve url - among other things will turn relative url to absolute + + @method resolveUrl + @static + @param {String} url Either absolute or relative + @return {String} Resolved, absolute url + */ + var resolveUrl = function(url) { + var ports = { // we ignore default ports + http: 80, + https: 443 + } + , urlp = parseUrl(url) + ; + + return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); + }; + + /** + Check if specified url has the same origin as the current document + + @method hasSameOrigin + @param {String|Object} url + @return {Boolean} + */ + var hasSameOrigin = function(url) { + function origin(url) { + return [url.scheme, url.host, url.port].join('/'); + } + + if (typeof url === 'string') { + url = parseUrl(url); + } + + return origin(parseUrl()) === origin(url); + }; + + return { + parseUrl: parseUrl, + resolveUrl: resolveUrl, + hasSameOrigin: hasSameOrigin + }; +}); + +// Included from: src/javascript/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileReaderSync', [ + 'moxie/core/utils/Basic', + 'moxie/runtime/RuntimeClient', + 'moxie/core/utils/Encode' +], function(Basic, RuntimeClient, Encode) { + /** + Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here + it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, + but probably < 1mb). Not meant to be used directly by user. + + @class FileReaderSync + @private + @constructor + */ + return function() { + RuntimeClient.call(this); + + Basic.extend(this, { + uid: Basic.guid('uid_'), + + readAsBinaryString: function(blob) { + return _read.call(this, 'readAsBinaryString', blob); + }, + + readAsDataURL: function(blob) { + return _read.call(this, 'readAsDataURL', blob); + }, + + /*readAsArrayBuffer: function(blob) { + return _read.call(this, 'readAsArrayBuffer', blob); + },*/ + + readAsText: function(blob) { + return _read.call(this, 'readAsText', blob); + } + }); + + function _read(op, blob) { + if (blob.isDetached()) { + var src = blob.getSource(); + switch (op) { + case 'readAsBinaryString': + return src; + case 'readAsDataURL': + return 'data:' + blob.type + ';base64,' + Encode.btoa(src); + case 'readAsText': + var txt = ''; + for (var i = 0, length = src.length; i < length; i++) { + txt += String.fromCharCode(src[i]); + } + return txt; + } + } else { + var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); + this.disconnectRuntime(); + return result; + } + } + }; +}); + +// Included from: src/javascript/xhr/FormData.js + +/** + * FormData.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/xhr/FormData", [ + "moxie/core/Exceptions", + "moxie/core/utils/Basic", + "moxie/file/Blob" +], function(x, Basic, Blob) { + /** + FormData + + @class FormData + @constructor + */ + function FormData() { + var _blob, _fields = []; + + Basic.extend(this, { + /** + Append another key-value pair to the FormData object + + @method append + @param {String} name Name for the new field + @param {String|Blob|Array|Object} value Value for the field + */ + append: function(name, value) { + var self = this, valueType = Basic.typeOf(value); + + // according to specs value might be either Blob or String + if (value instanceof Blob) { + _blob = { + name: name, + value: value // unfortunately we can only send single Blob in one FormData + }; + } else if ('array' === valueType) { + name += '[]'; + + Basic.each(value, function(value) { + self.append(name, value); + }); + } else if ('object' === valueType) { + Basic.each(value, function(value, key) { + self.append(name + '[' + key + ']', value); + }); + } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { + self.append(name, "false"); + } else { + _fields.push({ + name: name, + value: value.toString() + }); + } + }, + + /** + Checks if FormData contains Blob. + + @method hasBlob + @return {Boolean} + */ + hasBlob: function() { + return !!this.getBlob(); + }, + + /** + Retrieves blob. + + @method getBlob + @return {Object} Either Blob if found or null + */ + getBlob: function() { + return _blob && _blob.value || null; + }, + + /** + Retrieves blob field name. + + @method getBlobName + @return {String} Either Blob field name or null + */ + getBlobName: function() { + return _blob && _blob.name || null; + }, + + /** + Loop over the fields in FormData and invoke the callback for each of them. + + @method each + @param {Function} cb Callback to call for each field + */ + each: function(cb) { + Basic.each(_fields, function(field) { + cb(field.value, field.name); + }); + + if (_blob) { + cb(_blob.value, _blob.name); + } + }, + + destroy: function() { + _blob = null; + _fields = []; + } + }); + } + + return FormData; +}); + +// Included from: src/javascript/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/xhr/XMLHttpRequest", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/core/EventTarget", + "moxie/core/utils/Encode", + "moxie/core/utils/Url", + "moxie/runtime/Runtime", + "moxie/runtime/RuntimeTarget", + "moxie/file/Blob", + "moxie/file/FileReaderSync", + "moxie/xhr/FormData", + "moxie/core/utils/Env", + "moxie/core/utils/Mime" +], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { + + var httpCode = { + 100: 'Continue', + 101: 'Switching Protocols', + 102: 'Processing', + + 200: 'OK', + 201: 'Created', + 202: 'Accepted', + 203: 'Non-Authoritative Information', + 204: 'No Content', + 205: 'Reset Content', + 206: 'Partial Content', + 207: 'Multi-Status', + 226: 'IM Used', + + 300: 'Multiple Choices', + 301: 'Moved Permanently', + 302: 'Found', + 303: 'See Other', + 304: 'Not Modified', + 305: 'Use Proxy', + 306: 'Reserved', + 307: 'Temporary Redirect', + + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Request Entity Too Large', + 414: 'Request-URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Requested Range Not Satisfiable', + 417: 'Expectation Failed', + 422: 'Unprocessable Entity', + 423: 'Locked', + 424: 'Failed Dependency', + 426: 'Upgrade Required', + + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 510: 'Not Extended' + }; + + function XMLHttpRequestUpload() { + this.uid = Basic.guid('uid_'); + } + + XMLHttpRequestUpload.prototype = EventTarget.instance; + + /** + Implementation of XMLHttpRequest + + @class XMLHttpRequest + @constructor + @uses RuntimeClient + @extends EventTarget + */ + var dispatches = ['loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend']; // & readystatechange (for historical reasons) + + var NATIVE = 1, RUNTIME = 2; + + function XMLHttpRequest() { + var self = this, + // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible + props = { + /** + The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. + + @property timeout + @type Number + @default 0 + */ + timeout: 0, + + /** + Current state, can take following values: + UNSENT (numeric value 0) + The object has been constructed. + + OPENED (numeric value 1) + The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. + + HEADERS_RECEIVED (numeric value 2) + All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. + + LOADING (numeric value 3) + The response entity body is being received. + + DONE (numeric value 4) + + @property readyState + @type Number + @default 0 (UNSENT) + */ + readyState: XMLHttpRequest.UNSENT, + + /** + True when user credentials are to be included in a cross-origin request. False when they are to be excluded + in a cross-origin request and when cookies are to be ignored in its response. Initially false. + + @property withCredentials + @type Boolean + @default false + */ + withCredentials: false, + + /** + Returns the HTTP status code. + + @property status + @type Number + @default 0 + */ + status: 0, + + /** + Returns the HTTP status text. + + @property statusText + @type String + */ + statusText: "", + + /** + Returns the response type. Can be set to change the response type. Values are: + the empty string (default), "arraybuffer", "blob", "document", "json", and "text". + + @property responseType + @type String + */ + responseType: "", + + /** + Returns the document response entity body. + + Throws an "InvalidStateError" exception if responseType is not the empty string or "document". + + @property responseXML + @type Document + */ + responseXML: null, + + /** + Returns the text response entity body. + + Throws an "InvalidStateError" exception if responseType is not the empty string or "text". + + @property responseText + @type String + */ + responseText: null, + + /** + Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). + Can become: ArrayBuffer, Blob, Document, JSON, Text + + @property response + @type Mixed + */ + response: null + }, + + _async = true, + _url, + _method, + _headers = {}, + _user, + _password, + _encoding = null, + _mimeType = null, + + // flags + _sync_flag = false, + _send_flag = false, + _upload_events_flag = false, + _upload_complete_flag = false, + _error_flag = false, + _same_origin_flag = false, + + // times + _start_time, + _timeoutset_time, + + _finalMime = null, + _finalCharset = null, + + _options = {}, + _xhr, + _responseHeaders = '', + _responseHeadersBag + ; + + + Basic.extend(this, props, { + /** + Unique id of the component + + @property uid + @type String + */ + uid: Basic.guid('uid_'), + + /** + Target for Upload events + + @property upload + @type XMLHttpRequestUpload + */ + upload: new XMLHttpRequestUpload(), + + + /** + Sets the request method, request URL, synchronous flag, request username, and request password. + + Throws a "SyntaxError" exception if one of the following is true: + + method is not a valid HTTP method. + url cannot be resolved. + url contains the "user:password" format in the userinfo production. + Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. + + Throws an "InvalidAccessError" exception if one of the following is true: + + Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. + There is an associated XMLHttpRequest document and either the timeout attribute is not zero, + the withCredentials attribute is true, or the responseType attribute is not the empty string. + + + @method open + @param {String} method HTTP method to use on request + @param {String} url URL to request + @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. + @param {String} [user] Username to use in HTTP authentication process on server-side + @param {String} [password] Password to use in HTTP authentication process on server-side + */ + open: function(method, url, async, user, password) { + var urlp; + + // first two arguments are required + if (!method || !url) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method + if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 3 + if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { + _method = method.toUpperCase(); + } + + + // 4 - allowing these methods poses a security risk + if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { + throw new x.DOMException(x.DOMException.SECURITY_ERR); + } + + // 5 + url = Encode.utf8_encode(url); + + // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". + urlp = Url.parseUrl(url); + + _same_origin_flag = Url.hasSameOrigin(urlp); + + // 7 - manually build up absolute url + _url = Url.resolveUrl(url); + + // 9-10, 12-13 + if ((user || password) && !_same_origin_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + _user = user || urlp.user; + _password = password || urlp.pass; + + // 11 + _async = async || true; + + if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 14 - terminate abort() + + // 15 - terminate send() + + // 18 + _sync_flag = !_async; + _send_flag = false; + _headers = {}; + _reset.call(this); + + // 19 + _p('readyState', XMLHttpRequest.OPENED); + + // 20 + this.convertEventPropsToHandlers(['readystatechange']); // unify event handlers + this.dispatchEvent('readystatechange'); + }, + + /** + Appends an header to the list of author request headers, or if header is already + in the list of author request headers, combines its value with value. + + Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. + Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value + is not a valid HTTP header field value. + + @method setRequestHeader + @param {String} header + @param {String|Number} value + */ + setRequestHeader: function(header, value) { + var uaHeaders = [ // these headers are controlled by the user agent + "accept-charset", + "accept-encoding", + "access-control-request-headers", + "access-control-request-method", + "connection", + "content-length", + "cookie", + "cookie2", + "content-transfer-encoding", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "user-agent", + "via" + ]; + + // 1-2 + if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3 + if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 4 + /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values + if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + }*/ + + header = Basic.trim(header).toLowerCase(); + + // setting of proxy-* and sec-* headers is prohibited by spec + if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { + return false; + } + + // camelize + // browsers lowercase header names (at least for custom ones) + // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); + + if (!_headers[header]) { + _headers[header] = value; + } else { + // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) + _headers[header] += ', ' + value; + } + return true; + }, + + /** + Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. + + @method getAllResponseHeaders + @return {String} reponse headers or empty string + */ + getAllResponseHeaders: function() { + return _responseHeaders || ''; + }, + + /** + Returns the header field value from the response of which the field name matches header, + unless the field name is Set-Cookie or Set-Cookie2. + + @method getResponseHeader + @param {String} header + @return {String} value(s) for the specified header or null + */ + getResponseHeader: function(header) { + header = header.toLowerCase(); + + if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { + return null; + } + + if (_responseHeaders && _responseHeaders !== '') { + // if we didn't parse response headers until now, do it and keep for later + if (!_responseHeadersBag) { + _responseHeadersBag = {}; + Basic.each(_responseHeaders.split(/\r\n/), function(line) { + var pair = line.split(/:\s+/); + if (pair.length === 2) { // last line might be empty, omit + pair[0] = Basic.trim(pair[0]); // just in case + _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form + header: pair[0], + value: Basic.trim(pair[1]) + }; + } + }); + } + if (_responseHeadersBag.hasOwnProperty(header)) { + return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; + } + } + return null; + }, + + /** + Sets the Content-Type header for the response to mime. + Throws an "InvalidStateError" exception if the state is LOADING or DONE. + Throws a "SyntaxError" exception if mime is not a valid media type. + + @method overrideMimeType + @param String mime Mime type to set + */ + overrideMimeType: function(mime) { + var matches, charset; + + // 1 + if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2 + mime = Basic.trim(mime.toLowerCase()); + + if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { + mime = matches[1]; + if (matches[2]) { + charset = matches[2]; + } + } + + if (!Mime.mimes[mime]) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 3-4 + _finalMime = mime; + _finalCharset = charset; + }, + + /** + Initiates the request. The optional argument provides the request entity body. + The argument is ignored if request method is GET or HEAD. + + Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. + + @method send + @param {Blob|Document|String|FormData} [data] Request entity body + @param {Object} [options] Set of requirements and pre-requisities for runtime initialization + */ + send: function(data, options) { + if (Basic.typeOf(options) === 'string') { + _options = { ruid: options }; + } else if (!options) { + _options = {}; + } else { + _options = options; + } + + this.convertEventPropsToHandlers(dispatches); + this.upload.convertEventPropsToHandlers(dispatches); + + // 1-2 + if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3 + // sending Blob + if (data instanceof Blob) { + _options.ruid = data.ruid; + _mimeType = data.type || 'application/octet-stream'; + } + + // FormData + else if (data instanceof FormData) { + if (data.hasBlob()) { + var blob = data.getBlob(); + _options.ruid = blob.ruid; + _mimeType = blob.type || 'application/octet-stream'; + } + } + + // DOMString + else if (typeof data === 'string') { + _encoding = 'UTF-8'; + _mimeType = 'text/plain;charset=UTF-8'; + + // data should be converted to Unicode and encoded as UTF-8 + data = Encode.utf8_encode(data); + } + + // if withCredentials not set, but requested, set it automatically + if (!this.withCredentials) { + this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; + } + + // 4 - storage mutex + // 5 + _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP + // 6 + _error_flag = false; + // 7 + _upload_complete_flag = !data; + // 8 - Asynchronous steps + if (!_sync_flag) { + // 8.1 + _send_flag = true; + // 8.2 + // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr + // 8.3 + //if (!_upload_complete_flag) { + // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr + //} + } + // 8.5 - Return the send() method call, but continue running the steps in this algorithm. + _doXHR.call(this, data); + }, + + /** + Cancels any network activity. + + @method abort + */ + abort: function() { + _error_flag = true; + _sync_flag = false; + + if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { + _p('readyState', XMLHttpRequest.DONE); + _send_flag = false; + + if (_xhr) { + _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); + } else { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + _upload_complete_flag = true; + } else { + _p('readyState', XMLHttpRequest.UNSENT); + } + }, + + destroy: function() { + if (_xhr) { + if (Basic.typeOf(_xhr.destroy) === 'function') { + _xhr.destroy(); + } + _xhr = null; + } + + this.unbindAll(); + + if (this.upload) { + this.upload.unbindAll(); + this.upload = null; + } + } + }); + + /* this is nice, but maybe too lengthy + + // if supported by JS version, set getters/setters for specific properties + o.defineProperty(this, 'readyState', { + configurable: false, + + get: function() { + return _p('readyState'); + } + }); + + o.defineProperty(this, 'timeout', { + configurable: false, + + get: function() { + return _p('timeout'); + }, + + set: function(value) { + + if (_sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // timeout still should be measured relative to the start time of request + _timeoutset_time = (new Date).getTime(); + + _p('timeout', value); + } + }); + + // the withCredentials attribute has no effect when fetching same-origin resources + o.defineProperty(this, 'withCredentials', { + configurable: false, + + get: function() { + return _p('withCredentials'); + }, + + set: function(value) { + // 1-2 + if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3-4 + if (_anonymous_flag || _sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 5 + _p('withCredentials', value); + } + }); + + o.defineProperty(this, 'status', { + configurable: false, + + get: function() { + return _p('status'); + } + }); + + o.defineProperty(this, 'statusText', { + configurable: false, + + get: function() { + return _p('statusText'); + } + }); + + o.defineProperty(this, 'responseType', { + configurable: false, + + get: function() { + return _p('responseType'); + }, + + set: function(value) { + // 1 + if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2 + if (_sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 3 + _p('responseType', value.toLowerCase()); + } + }); + + o.defineProperty(this, 'responseText', { + configurable: false, + + get: function() { + // 1 + if (!~o.inArray(_p('responseType'), ['', 'text'])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2-3 + if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + return _p('responseText'); + } + }); + + o.defineProperty(this, 'responseXML', { + configurable: false, + + get: function() { + // 1 + if (!~o.inArray(_p('responseType'), ['', 'document'])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2-3 + if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + return _p('responseXML'); + } + }); + + o.defineProperty(this, 'response', { + configurable: false, + + get: function() { + if (!!~o.inArray(_p('responseType'), ['', 'text'])) { + if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { + return ''; + } + } + + if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { + return null; + } + + return _p('response'); + } + }); + + */ + + function _p(prop, value) { + if (!props.hasOwnProperty(prop)) { + return; + } + if (arguments.length === 1) { // get + return Env.can('define_property') ? props[prop] : self[prop]; + } else { // set + if (Env.can('define_property')) { + props[prop] = value; + } else { + self[prop] = value; + } + } + } + + /* + function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { + // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 + return str.toLowerCase(); + } + */ + + + function _doXHR(data) { + var self = this; + + _start_time = new Date().getTime(); + + _xhr = new RuntimeTarget(); + + function loadEnd() { + if (_xhr) { // it could have been destroyed by now + _xhr.destroy(); + _xhr = null; + } + self.dispatchEvent('loadend'); + self = null; + } + + function exec(runtime) { + _xhr.bind('LoadStart', function(e) { + _p('readyState', XMLHttpRequest.LOADING); + self.dispatchEvent('readystatechange'); + + self.dispatchEvent(e); + + if (_upload_events_flag) { + self.upload.dispatchEvent(e); + } + }); + + _xhr.bind('Progress', function(e) { + if (_p('readyState') !== XMLHttpRequest.LOADING) { + _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) + self.dispatchEvent('readystatechange'); + } + self.dispatchEvent(e); + }); + + _xhr.bind('UploadProgress', function(e) { + if (_upload_events_flag) { + self.upload.dispatchEvent({ + type: 'progress', + lengthComputable: false, + total: e.total, + loaded: e.loaded + }); + } + }); + + _xhr.bind('Load', function(e) { + _p('readyState', XMLHttpRequest.DONE); + _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); + _p('statusText', httpCode[_p('status')] || ""); + + _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); + + if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { + _p('responseText', _p('response')); + } else if (_p('responseType') === 'document') { + _p('responseXML', _p('response')); + } + + _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); + + self.dispatchEvent('readystatechange'); + + if (_p('status') > 0) { // status 0 usually means that server is unreachable + if (_upload_events_flag) { + self.upload.dispatchEvent(e); + } + self.dispatchEvent(e); + } else { + _error_flag = true; + self.dispatchEvent('error'); + } + loadEnd(); + }); + + _xhr.bind('Abort', function(e) { + self.dispatchEvent(e); + loadEnd(); + }); + + _xhr.bind('Error', function(e) { + _error_flag = true; + _p('readyState', XMLHttpRequest.DONE); + self.dispatchEvent('readystatechange'); + _upload_complete_flag = true; + self.dispatchEvent(e); + loadEnd(); + }); + + runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { + url: _url, + method: _method, + async: _async, + user: _user, + password: _password, + headers: _headers, + mimeType: _mimeType, + encoding: _encoding, + responseType: self.responseType, + withCredentials: self.withCredentials, + options: _options + }, data); + } + + // clarify our requirements + if (typeof(_options.required_caps) === 'string') { + _options.required_caps = Runtime.parseCaps(_options.required_caps); + } + + _options.required_caps = Basic.extend({}, _options.required_caps, { + return_response_type: self.responseType + }); + + if (data instanceof FormData) { + _options.required_caps.send_multipart = true; + } + + if (!_same_origin_flag) { + _options.required_caps.do_cors = true; + } + + + if (_options.ruid) { // we do not need to wait if we can connect directly + exec(_xhr.connectRuntime(_options)); + } else { + _xhr.bind('RuntimeInit', function(e, runtime) { + exec(runtime); + }); + _xhr.bind('RuntimeError', function(e, err) { + self.dispatchEvent('RuntimeError', err); + }); + _xhr.connectRuntime(_options); + } + } + + + function _reset() { + _p('responseText', ""); + _p('responseXML', null); + _p('response', null); + _p('status', 0); + _p('statusText', ""); + _start_time = _timeoutset_time = null; + } + } + + XMLHttpRequest.UNSENT = 0; + XMLHttpRequest.OPENED = 1; + XMLHttpRequest.HEADERS_RECEIVED = 2; + XMLHttpRequest.LOADING = 3; + XMLHttpRequest.DONE = 4; + + XMLHttpRequest.prototype = EventTarget.instance; + + return XMLHttpRequest; +}); + +// Included from: src/javascript/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/runtime/Transporter", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Encode", + "moxie/runtime/RuntimeClient", + "moxie/core/EventTarget" +], function(Basic, Encode, RuntimeClient, EventTarget) { + function Transporter() { + var mod, _runtime, _data, _size, _pos, _chunk_size; + + RuntimeClient.call(this); + + Basic.extend(this, { + uid: Basic.guid('uid_'), + + state: Transporter.IDLE, + + result: null, + + transport: function(data, type, options) { + var self = this; + + options = Basic.extend({ + chunk_size: 204798 + }, options); + + // should divide by three, base64 requires this + if ((mod = options.chunk_size % 3)) { + options.chunk_size += 3 - mod; + } + + _chunk_size = options.chunk_size; + + _reset.call(this); + _data = data; + _size = data.length; + + if (Basic.typeOf(options) === 'string' || options.ruid) { + _run.call(self, type, this.connectRuntime(options)); + } else { + // we require this to run only once + var cb = function(e, runtime) { + self.unbind("RuntimeInit", cb); + _run.call(self, type, runtime); + }; + this.bind("RuntimeInit", cb); + this.connectRuntime(options); + } + }, + + abort: function() { + var self = this; + + self.state = Transporter.IDLE; + if (_runtime) { + _runtime.exec.call(self, 'Transporter', 'clear'); + self.trigger("TransportingAborted"); + } + + _reset.call(self); + }, + + + destroy: function() { + this.unbindAll(); + _runtime = null; + this.disconnectRuntime(); + _reset.call(this); + } + }); + + function _reset() { + _size = _pos = 0; + _data = this.result = null; + } + + function _run(type, runtime) { + var self = this; + + _runtime = runtime; + + //self.unbind("RuntimeInit"); + + self.bind("TransportingProgress", function(e) { + _pos = e.loaded; + + if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { + _transport.call(self); + } + }, 999); + + self.bind("TransportingComplete", function() { + _pos = _size; + self.state = Transporter.DONE; + _data = null; // clean a bit + self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); + }, 999); + + self.state = Transporter.BUSY; + self.trigger("TransportingStarted"); + _transport.call(self); + } + + function _transport() { + var self = this, + chunk, + bytesLeft = _size - _pos; + + if (_chunk_size > bytesLeft) { + _chunk_size = bytesLeft; + } + + chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); + _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); + } + } + + Transporter.IDLE = 0; + Transporter.BUSY = 1; + Transporter.DONE = 2; + + Transporter.prototype = EventTarget.instance; + + return Transporter; +}); + +// Included from: src/javascript/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/image/Image", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/file/FileReaderSync", + "moxie/xhr/XMLHttpRequest", + "moxie/runtime/Runtime", + "moxie/runtime/RuntimeClient", + "moxie/runtime/Transporter", + "moxie/core/utils/Env", + "moxie/core/EventTarget", + "moxie/file/Blob", + "moxie/file/File", + "moxie/core/utils/Encode" +], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) { + /** + Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data. + + @class Image + @constructor + @extends EventTarget + */ + var dispatches = [ + 'progress', + + /** + Dispatched when loading is complete. + + @event load + @param {Object} event + */ + 'load', + + 'error', + + /** + Dispatched when resize operation is complete. + + @event resize + @param {Object} event + */ + 'resize', + + /** + Dispatched when visual representation of the image is successfully embedded + into the corresponsing container. + + @event embedded + @param {Object} event + */ + 'embedded' + ]; + + function Image() { + RuntimeClient.call(this); + + Basic.extend(this, { + /** + Unique id of the component + + @property uid + @type {String} + */ + uid: Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if any. + + @property ruid + @type {String} + */ + ruid: null, + + /** + Name of the file, that was used to create an image, if available. If not equals to empty string. + + @property name + @type {String} + @default "" + */ + name: "", + + /** + Size of the image in bytes. Actual value is set only after image is preloaded. + + @property size + @type {Number} + @default 0 + */ + size: 0, + + /** + Width of the image. Actual value is set only after image is preloaded. + + @property width + @type {Number} + @default 0 + */ + width: 0, + + /** + Height of the image. Actual value is set only after image is preloaded. + + @property height + @type {Number} + @default 0 + */ + height: 0, + + /** + Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded. + + @property type + @type {String} + @default "" + */ + type: "", + + /** + Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded. + + @property meta + @type {Object} + @default {} + */ + meta: {}, + + /** + Alias for load method, that takes another mOxie.Image object as a source (see load). + + @method clone + @param {Image} src Source for the image + @param {Boolean} [exact=false] Whether to activate in-depth clone mode + */ + clone: function() { + this.load.apply(this, arguments); + }, + + /** + Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File, + native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL, + Image will be downloaded from remote destination and loaded in memory. + + @example + var img = new mOxie.Image(); + img.onload = function() { + var blob = img.getAsBlob(); + + var formData = new mOxie.FormData(); + formData.append('file', blob); + + var xhr = new mOxie.XMLHttpRequest(); + xhr.onload = function() { + // upload complete + }; + xhr.open('post', 'upload.php'); + xhr.send(formData); + }; + img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg) + + + @method load + @param {Image|Blob|File|String} src Source for the image + @param {Boolean|Object} [mixed] + */ + load: function() { + // this is here because to bind properly we need an uid first, which is created above + this.bind('Load Resize', function() { + _updateInfo.call(this); + }, 999); + + this.convertEventPropsToHandlers(dispatches); + + _load.apply(this, arguments); + }, + + /** + Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions. + + @method downsize + @param {Number} width Resulting width + @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) + @param {Boolean} [crop=false] Whether to crop the image to exact dimensions + @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) + */ + downsize: function(opts) { + var defaults = { + width: this.width, + height: this.height, + crop: false, + preserveHeaders: true + }; + + if (typeof(opts) === 'object') { + opts = Basic.extend(defaults, opts); + } else { + opts = Basic.extend(defaults, { + width: arguments[0], + height: arguments[1], + crop: arguments[2], + preserveHeaders: arguments[3] + }); + } + + try { + if (!this.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // no way to reliably intercept the crash due to high resolution, so we simply avoid it + if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { + throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); + } + + this.getRuntime().exec.call(this, 'Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders); + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + }, + + /** + Alias for downsize(width, height, true). (see downsize) + + @method crop + @param {Number} width Resulting width + @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) + @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) + */ + crop: function(width, height, preserveHeaders) { + this.downsize(width, height, true, preserveHeaders); + }, + + getAsCanvas: function() { + if (!Env.can('create_canvas')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + var runtime = this.connectRuntime(this.ruid); + return runtime.exec.call(this, 'Image', 'getAsCanvas'); + }, + + /** + Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsBlob + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {Blob} Image as Blob + */ + getAsBlob: function(type, quality) { + if (!this.size) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + if (!type) { + type = 'image/jpeg'; + } + + if (type === 'image/jpeg' && !quality) { + quality = 90; + } + + return this.getRuntime().exec.call(this, 'Image', 'getAsBlob', type, quality); + }, + + /** + Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsDataURL + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {String} Image as dataURL string + */ + getAsDataURL: function(type, quality) { + if (!this.size) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + return this.getRuntime().exec.call(this, 'Image', 'getAsDataURL', type, quality); + }, + + /** + Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsBinaryString + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {String} Image as binary string + */ + getAsBinaryString: function(type, quality) { + var dataUrl = this.getAsDataURL(type, quality); + return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)); + }, + + /** + Embeds a visual representation of the image into the specified node. Depending on the runtime, + it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare, + can be used in legacy browsers that do not have canvas or proper dataURI support). + + @method embed + @param {DOMElement} el DOM element to insert the image object into + @param {Object} [options] + @param {Number} [options.width] The width of an embed (defaults to the image width) + @param {Number} [options.height] The height of an embed (defaults to the image height) + @param {String} [type="image/jpeg"] Mime type + @param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg + @param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions + */ + embed: function(el) { + var self = this + , imgCopy + , type, quality, crop + , options = arguments[1] || {} + , width = this.width + , height = this.height + , runtime // this has to be outside of all the closures to contain proper runtime + ; + + function onResize() { + // if possible, embed a canvas element directly + if (Env.can('create_canvas')) { + var canvas = imgCopy.getAsCanvas(); + if (canvas) { + el.appendChild(canvas); + canvas = null; + imgCopy.destroy(); + self.trigger('embedded'); + return; + } + } + + var dataUrl = imgCopy.getAsDataURL(type, quality); + if (!dataUrl) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + if (Env.can('use_data_uri_of', dataUrl.length)) { + el.innerHTML = ''; + imgCopy.destroy(); + self.trigger('embedded'); + } else { + var tr = new Transporter(); + + tr.bind("TransportingComplete", function() { + runtime = self.connectRuntime(this.result.ruid); + + self.bind("Embedded", function() { + // position and size properly + Basic.extend(runtime.getShimContainer().style, { + //position: 'relative', + top: '0px', + left: '0px', + width: imgCopy.width + 'px', + height: imgCopy.height + 'px' + }); + + // some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's + // position type changes (in Gecko), but since we basically need this only in IEs 6/7 and + // sometimes 8 and they do not have this problem, we can comment this for now + /*tr.bind("RuntimeInit", function(e, runtime) { + tr.destroy(); + runtime.destroy(); + onResize.call(self); // re-feed our image data + });*/ + + runtime = null; + }, 999); + + runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height); + imgCopy.destroy(); + }); + + tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, Basic.extend({}, options, { + required_caps: { + display_media: true + }, + runtime_order: 'flash,silverlight', + container: el + })); + } + } + + try { + if (!(el = Dom.get(el))) { + throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR); + } + + if (!this.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { + throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); + } + + type = options.type || this.type || 'image/jpeg'; + quality = options.quality || 90; + crop = Basic.typeOf(options.crop) !== 'undefined' ? options.crop : false; + + // figure out dimensions for the thumb + if (options.width) { + width = options.width; + height = options.height || width; + } else { + // if container element has measurable dimensions, use them + var dimensions = Dom.getSize(el); + if (dimensions.w && dimensions.h) { // both should be > 0 + width = dimensions.w; + height = dimensions.h; + } + } + + imgCopy = new Image(); + + imgCopy.bind("Resize", function() { + onResize.call(self); + }); + + imgCopy.bind("Load", function() { + imgCopy.downsize(width, height, crop, false); + }); + + imgCopy.clone(this, false); + + return imgCopy; + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + }, + + /** + Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object. + + @method destroy + */ + destroy: function() { + if (this.ruid) { + this.getRuntime().exec.call(this, 'Image', 'destroy'); + this.disconnectRuntime(); + } + this.unbindAll(); + } + }); + + + function _updateInfo(info) { + if (!info) { + info = this.getRuntime().exec.call(this, 'Image', 'getInfo'); + } + + this.size = info.size; + this.width = info.width; + this.height = info.height; + this.type = info.type; + this.meta = info.meta; + + // update file name, only if empty + if (this.name === '') { + this.name = info.name; + } + } + + + function _load(src) { + var srcType = Basic.typeOf(src); + + try { + // if source is Image + if (src instanceof Image) { + if (!src.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + _loadFromImage.apply(this, arguments); + } + // if source is o.Blob/o.File + else if (src instanceof Blob) { + if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + _loadFromBlob.apply(this, arguments); + } + // if native blob/file + else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) { + _load.call(this, new File(null, src), arguments[1]); + } + // if String + else if (srcType === 'string') { + // if dataUrl String + if (/^data:[^;]*;base64,/.test(src)) { + _load.call(this, new Blob(null, { data: src }), arguments[1]); + } + // else assume Url, either relative or absolute + else { + _loadFromUrl.apply(this, arguments); + } + } + // if source seems to be an img node + else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') { + _load.call(this, src.src, arguments[1]); + } + else { + throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR); + } + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + } + + + function _loadFromImage(img, exact) { + var runtime = this.connectRuntime(img.ruid); + this.ruid = runtime.uid; + runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact)); + } + + + function _loadFromBlob(blob, options) { + var self = this; + + self.name = blob.name || ''; + + function exec(runtime) { + self.ruid = runtime.uid; + runtime.exec.call(self, 'Image', 'loadFromBlob', blob); + } + + if (blob.isDetached()) { + this.bind('RuntimeInit', function(e, runtime) { + exec(runtime); + }); + + // convert to object representation + if (options && typeof(options.required_caps) === 'string') { + options.required_caps = Runtime.parseCaps(options.required_caps); + } + + this.connectRuntime(Basic.extend({ + required_caps: { + access_image_binary: true, + resize_image: true + } + }, options)); + } else { + exec(this.connectRuntime(blob.ruid)); + } + } + + + function _loadFromUrl(url, options) { + var self = this, xhr; + + xhr = new XMLHttpRequest(); + + xhr.open('get', url); + xhr.responseType = 'blob'; + + xhr.onprogress = function(e) { + self.trigger(e); + }; + + xhr.onload = function() { + _loadFromBlob.call(self, xhr.response, true); + }; + + xhr.onerror = function(e) { + self.trigger(e); + }; + + xhr.onloadend = function() { + xhr.destroy(); + }; + + xhr.bind('RuntimeError', function(e, err) { + self.trigger('RuntimeError', err); + }); + + xhr.send(null, options); + } + } + + // virtual world will crash on you if image has a resolution higher than this: + Image.MAX_RESIZE_WIDTH = 6500; + Image.MAX_RESIZE_HEIGHT = 6500; + + Image.prototype = EventTarget.instance; + + return Image; +}); + +// Included from: src/javascript/runtime/html5/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global File:true */ + +/** +Defines constructor for HTML5 runtime. + +@class moxie/runtime/html5/Runtime +@private +*/ +define("moxie/runtime/html5/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/Runtime", + "moxie/core/utils/Env" +], function(Basic, x, Runtime, Env) { + + var type = "html5", extensions = {}; + + function Html5Runtime(options) { + var I = this + , Test = Runtime.capTest + , True = Runtime.capTrue + ; + + var caps = Basic.extend({ + access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL), + access_image_binary: function() { + return I.can('access_binary') && !!extensions.Image; + }, + display_media: Test(Env.can('create_canvas') || Env.can('use_data_uri_over32kb')), + do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), + drag_and_drop: Test(function() { + // this comes directly from Modernizr: http://www.modernizr.com/ + var div = document.createElement('div'); + // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop + return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && (Env.browser !== 'IE' || Env.version > 9); + }()), + filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest + return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10); + }()), + return_response_headers: True, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported + return true; + } + return Env.can('return_response_type', responseType); + }, + return_status_code: True, + report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload), + resize_image: function() { + return I.can('access_binary') && Env.can('create_canvas'); + }, + select_file: function() { + return Env.can('use_fileinput') && window.File; + }, + select_folder: function() { + return I.can('select_file') && Env.browser === 'Chrome' && Env.version >= 21; + }, + select_multiple: function() { + // it is buggy on Safari Windows and iOS + return I.can('select_file') && + !(Env.browser === 'Safari' && Env.os === 'Windows') && + !(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.4", '<')); + }, + send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))), + send_custom_headers: Test(window.XMLHttpRequest), + send_multipart: function() { + return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string'); + }, + slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)), + stream_upload: function(){ + return I.can('slice_blob') && I.can('send_multipart'); + }, + summon_file_dialog: Test(function() { // yeah... some dirty sniffing here... + return (Env.browser === 'Firefox' && Env.version >= 4) || + (Env.browser === 'Opera' && Env.version >= 12) || + (Env.browser === 'IE' && Env.version >= 10) || + !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']); + }()), + upload_filesize: True + }, + arguments[2] + ); + + Runtime.call(this, options, (arguments[1] || type), caps); + + + Basic.extend(this, { + + init : function() { + this.trigger("Init"); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + destroy = I = null; + }; + }(this.destroy)) + }); + + Basic.extend(this.getShim(), extensions); + } + + Runtime.addConstructor(type, Html5Runtime); + + return extensions; +}); + +// Included from: src/javascript/runtime/html5/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/Blob +@private +*/ +define("moxie/runtime/html5/file/Blob", [ + "moxie/runtime/html5/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + function HTML5Blob() { + function w3cBlobSlice(blob, start, end) { + var blobSlice; + + if (window.File.prototype.slice) { + try { + blob.slice(); // depricated version will throw WRONG_ARGUMENTS_ERR exception + return blob.slice(start, end); + } catch (e) { + // depricated slice method + return blob.slice(start, end - start); + } + // slice method got prefixed: https://bugzilla.mozilla.org/show_bug.cgi?id=649672 + } else if ((blobSlice = window.File.prototype.webkitSlice || window.File.prototype.mozSlice)) { + return blobSlice.call(blob, start, end); + } else { + return null; // or throw some exception + } + } + + this.slice = function() { + return new Blob(this.getRuntime().uid, w3cBlobSlice.apply(this, arguments)); + }; + } + + return (extensions.Blob = HTML5Blob); +}); + +// Included from: src/javascript/core/utils/Events.js + +/** + * Events.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Events', [ + 'moxie/core/utils/Basic' +], function(Basic) { + var eventhash = {}, uid = 'moxie_' + Basic.guid(); + + // IE W3C like event funcs + function preventDefault() { + this.returnValue = false; + } + + function stopPropagation() { + this.cancelBubble = true; + } + + /** + Adds an event handler to the specified object and store reference to the handler + in objects internal Plupload registry (@see removeEvent). + + @method addEvent + @for Utils + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Name to add event listener to. + @param {Function} callback Function to call when event occurs. + @param {String} [key] that might be used to add specifity to the event record. + */ + var addEvent = function(obj, name, callback, key) { + var func, events; + + name = name.toLowerCase(); + + // Add event listener + if (obj.addEventListener) { + func = callback; + + obj.addEventListener(name, func, false); + } else if (obj.attachEvent) { + func = function() { + var evt = window.event; + + if (!evt.target) { + evt.target = evt.srcElement; + } + + evt.preventDefault = preventDefault; + evt.stopPropagation = stopPropagation; + + callback(evt); + }; + + obj.attachEvent('on' + name, func); + } + + // Log event handler to objects internal mOxie registry + if (!obj[uid]) { + obj[uid] = Basic.guid(); + } + + if (!eventhash.hasOwnProperty(obj[uid])) { + eventhash[obj[uid]] = {}; + } + + events = eventhash[obj[uid]]; + + if (!events.hasOwnProperty(name)) { + events[name] = []; + } + + events[name].push({ + func: func, + orig: callback, // store original callback for IE + key: key + }); + }; + + + /** + Remove event handler from the specified object. If third argument (callback) + is not specified remove all events with the specified name. + + @method removeEvent + @static + @param {Object} obj DOM element to remove event listener(s) from. + @param {String} name Name of event listener to remove. + @param {Function|String} [callback] might be a callback or unique key to match. + */ + var removeEvent = function(obj, name, callback) { + var type, undef; + + name = name.toLowerCase(); + + if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) { + type = eventhash[obj[uid]][name]; + } else { + return; + } + + for (var i = type.length - 1; i >= 0; i--) { + // undefined or not, key should match + if (type[i].orig === callback || type[i].key === callback) { + if (obj.removeEventListener) { + obj.removeEventListener(name, type[i].func, false); + } else if (obj.detachEvent) { + obj.detachEvent('on'+name, type[i].func); + } + + type[i].orig = null; + type[i].func = null; + type.splice(i, 1); + + // If callback was passed we are done here, otherwise proceed + if (callback !== undef) { + break; + } + } + } + + // If event array got empty, remove it + if (!type.length) { + delete eventhash[obj[uid]][name]; + } + + // If mOxie registry has become empty, remove it + if (Basic.isEmptyObj(eventhash[obj[uid]])) { + delete eventhash[obj[uid]]; + + // IE doesn't let you remove DOM object property with - delete + try { + delete obj[uid]; + } catch(e) { + obj[uid] = undef; + } + } + }; + + + /** + Remove all kind of events from the specified object + + @method removeAllEvents + @static + @param {Object} obj DOM element to remove event listeners from. + @param {String} [key] unique key to match, when removing events. + */ + var removeAllEvents = function(obj, key) { + if (!obj || !obj[uid]) { + return; + } + + Basic.each(eventhash[obj[uid]], function(events, name) { + removeEvent(obj, name, key); + }); + }; + + return { + addEvent: addEvent, + removeEvent: removeEvent, + removeAllEvents: removeAllEvents + }; +}); + +// Included from: src/javascript/runtime/html5/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileInput +@private +*/ +define("moxie/runtime/html5/file/FileInput", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, Basic, Dom, Events, Mime, Env) { + + function FileInput() { + var _files = [], _options; + + Basic.extend(this, { + init: function(options) { + var comp = this, I = comp.getRuntime(), input, shimContainer, mimes, browseButton, zIndex, top; + + _options = options; + _files = []; + + // figure out accept string + mimes = _options.accept.mimes || Mime.extList2mimes(_options.accept, I.can('filter_by_extension')); + + shimContainer = I.getShimContainer(); + + shimContainer.innerHTML = ''; + + input = Dom.get(I.uid); + + // prepare file input to be placed underneath the browse_button element + Basic.extend(input.style, { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + + browseButton = Dom.get(_options.browse_button); + + // Route click event to the input[type=file] element for browsers that support such behavior + if (I.can('summon_file_dialog')) { + if (Dom.getStyle(browseButton, 'position') === 'static') { + browseButton.style.position = 'relative'; + } + + zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; + + browseButton.style.zIndex = zIndex; + shimContainer.style.zIndex = zIndex - 1; + + Events.addEvent(browseButton, 'click', function(e) { + var input = Dom.get(I.uid); + if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] + input.click(); + } + e.preventDefault(); + }, comp.uid); + } + + /* Since we have to place input[type=file] on top of the browse_button for some browsers, + browse_button loses interactivity, so we restore it here */ + top = I.can('summon_file_dialog') ? browseButton : shimContainer; + + Events.addEvent(top, 'mouseover', function() { + comp.trigger('mouseenter'); + }, comp.uid); + + Events.addEvent(top, 'mouseout', function() { + comp.trigger('mouseleave'); + }, comp.uid); + + Events.addEvent(top, 'mousedown', function() { + comp.trigger('mousedown'); + }, comp.uid); + + Events.addEvent(Dom.get(_options.container), 'mouseup', function() { + comp.trigger('mouseup'); + }, comp.uid); + + + input.onchange = function onChange() { // there should be only one handler for this + _files = []; + + if (_options.directory) { + // folders are represented by dots, filter them out (Chrome 11+) + Basic.each(this.files, function(file) { + if (file.name !== ".") { // if it doesn't looks like a folder + _files.push(file); + } + }); + } else { + _files = [].slice.call(this.files); + } + + // clearing the value enables the user to select the same file again if they want to + if (Env.browser !== 'IE' && Env.browser !== 'IEMobile') { + this.value = ''; + } else { + // in IE input[type="file"] is read-only so the only way to reset it is to re-insert it + var clone = this.cloneNode(true); + this.parentNode.replaceChild(clone, this); + clone.onchange = onChange; + } + comp.trigger('change'); + }; + + // ready event is perfectly asynchronous + comp.trigger({ + type: 'ready', + async: true + }); + + shimContainer = null; + }, + + getFiles: function() { + return _files; + }, + + disable: function(state) { + var I = this.getRuntime(), input; + + if ((input = Dom.get(I.uid))) { + input.disabled = !!state; + } + }, + + destroy: function() { + var I = this.getRuntime() + , shim = I.getShim() + , shimContainer = I.getShimContainer() + ; + + Events.removeAllEvents(shimContainer, this.uid); + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); + + if (shimContainer) { + shimContainer.innerHTML = ''; + } + + shim.removeInstance(this.uid); + + _files = _options = shimContainer = shim = null; + } + }); + } + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/html5/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileDrop +@private +*/ +define("moxie/runtime/html5/file/FileDrop", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime" +], function(extensions, Basic, Dom, Events, Mime) { + + function FileDrop() { + var _files = [], _allowedExts = [], _options; + + Basic.extend(this, { + init: function(options) { + var comp = this, dropZone; + + _options = options; + _allowedExts = _extractExts(_options.accept); + dropZone = _options.container; + + Events.addEvent(dropZone, 'dragover', function(e) { + if (!_hasFiles(e)) { + return; + } + e.preventDefault(); + e.dataTransfer.dropEffect = 'copy'; + }, comp.uid); + + Events.addEvent(dropZone, 'drop', function(e) { + if (!_hasFiles(e)) { + return; + } + e.preventDefault(); + + _files = []; + + // Chrome 21+ accepts folders via Drag'n'Drop + if (e.dataTransfer.items && e.dataTransfer.items[0].webkitGetAsEntry) { + _readItems(e.dataTransfer.items, function() { + comp.trigger("drop"); + }); + } else { + Basic.each(e.dataTransfer.files, function(file) { + if (_isAcceptable(file)) { + _files.push(file); + } + }); + comp.trigger("drop"); + } + }, comp.uid); + + Events.addEvent(dropZone, 'dragenter', function(e) { + comp.trigger("dragenter"); + }, comp.uid); + + Events.addEvent(dropZone, 'dragleave', function(e) { + comp.trigger("dragleave"); + }, comp.uid); + }, + + getFiles: function() { + return _files; + }, + + destroy: function() { + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + _files = _allowedExts = _options = null; + } + }); + + + function _hasFiles(e) { + if (!e.dataTransfer || !e.dataTransfer.types) { // e.dataTransfer.files is not available in Gecko during dragover + return false; + } + + var types = Basic.toArray(e.dataTransfer.types || []); + + return Basic.inArray("Files", types) !== -1 || + Basic.inArray("public.file-url", types) !== -1 || // Safari < 5 + Basic.inArray("application/x-moz-file", types) !== -1 // Gecko < 1.9.2 (< Firefox 3.6) + ; + } + + + function _extractExts(accept) { + var exts = []; + for (var i = 0; i < accept.length; i++) { + [].push.apply(exts, accept[i].extensions.split(/\s*,\s*/)); + } + return Basic.inArray('*', exts) === -1 ? exts : []; + } + + + function _isAcceptable(file) { + if (!_allowedExts.length) { + return true; + } + var ext = Mime.getFileExtension(file.name); + return !ext || Basic.inArray(ext, _allowedExts) !== -1; + } + + + function _readItems(items, cb) { + var entries = []; + Basic.each(items, function(item) { + var entry = item.webkitGetAsEntry(); + // Address #998 (https://code.google.com/p/chromium/issues/detail?id=332579) + if (entry) { + // file() fails on OSX when the filename contains a special character (e.g. umlaut): see #61 + if (entry.isFile) { + var file = item.getAsFile(); + if (_isAcceptable(file)) { + _files.push(file); + } + } else { + entries.push(entry); + } + } + }); + + if (entries.length) { + _readEntries(entries, cb); + } else { + cb(); + } + } + + + function _readEntries(entries, cb) { + var queue = []; + Basic.each(entries, function(entry) { + queue.push(function(cbcb) { + _readEntry(entry, cbcb); + }); + }); + Basic.inSeries(queue, function() { + cb(); + }); + } + + + function _readEntry(entry, cb) { + if (entry.isFile) { + entry.file(function(file) { + if (_isAcceptable(file)) { + _files.push(file); + } + cb(); + }, function() { + // fire an error event maybe + cb(); + }); + } else if (entry.isDirectory) { + _readDirEntry(entry, cb); + } else { + cb(); // not file, not directory? what then?.. + } + } + + + function _readDirEntry(dirEntry, cb) { + var entries = [], dirReader = dirEntry.createReader(); + + // keep quering recursively till no more entries + function getEntries(cbcb) { + dirReader.readEntries(function(moreEntries) { + if (moreEntries.length) { + [].push.apply(entries, moreEntries); + getEntries(cbcb); + } else { + cbcb(); + } + }, cbcb); + } + + // ...and you thought FileReader was crazy... + getEntries(function() { + _readEntries(entries, cb); + }); + } + } + + return (extensions.FileDrop = FileDrop); +}); + +// Included from: src/javascript/runtime/html5/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileReader +@private +*/ +define("moxie/runtime/html5/file/FileReader", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Encode", + "moxie/core/utils/Basic" +], function(extensions, Encode, Basic) { + + function FileReader() { + var _fr, _convertToBinary = false; + + Basic.extend(this, { + + read: function(op, blob) { + var target = this; + + _fr = new window.FileReader(); + + _fr.addEventListener('progress', function(e) { + target.trigger(e); + }); + + _fr.addEventListener('load', function(e) { + target.trigger(e); + }); + + _fr.addEventListener('error', function(e) { + target.trigger(e, _fr.error); + }); + + _fr.addEventListener('loadend', function() { + _fr = null; + }); + + if (Basic.typeOf(_fr[op]) === 'function') { + _convertToBinary = false; + _fr[op](blob.getSource()); + } else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+ + _convertToBinary = true; + _fr.readAsDataURL(blob.getSource()); + } + }, + + getResult: function() { + return _fr && _fr.result ? (_convertToBinary ? _toBinary(_fr.result) : _fr.result) : null; + }, + + abort: function() { + if (_fr) { + _fr.abort(); + } + }, + + destroy: function() { + _fr = null; + } + }); + + function _toBinary(str) { + return Encode.atob(str.substring(str.indexOf('base64,') + 7)); + } + } + + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/html5/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +@class moxie/runtime/html5/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/html5/xhr/XMLHttpRequest", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Mime", + "moxie/core/utils/Url", + "moxie/file/File", + "moxie/file/Blob", + "moxie/xhr/FormData", + "moxie/core/Exceptions", + "moxie/core/utils/Env" +], function(extensions, Basic, Mime, Url, File, Blob, FormData, x, Env) { + + function XMLHttpRequest() { + var self = this + , _xhr + , _filename + ; + + Basic.extend(this, { + send: function(meta, data) { + var target = this + , isGecko2_5_6 = (Env.browser === 'Mozilla' && Env.version >= 4 && Env.version < 7) + , isAndroidBrowser = Env.browser === 'Android Browser' + , mustSendAsBinary = false + ; + + // extract file name + _filename = meta.url.replace(/^.+?\/([\w\-\.]+)$/, '$1').toLowerCase(); + + _xhr = _getNativeXHR(); + _xhr.open(meta.method, meta.url, meta.async, meta.user, meta.password); + + + // prepare data to be sent + if (data instanceof Blob) { + if (data.isDetached()) { + mustSendAsBinary = true; + } + data = data.getSource(); + } else if (data instanceof FormData) { + + if (data.hasBlob()) { + if (data.getBlob().isDetached()) { + data = _prepareMultipart.call(target, data); // _xhr must be instantiated and be in OPENED state + mustSendAsBinary = true; + } else if ((isGecko2_5_6 || isAndroidBrowser) && Basic.typeOf(data.getBlob().getSource()) === 'blob' && window.FileReader) { + // Gecko 2/5/6 can't send blob in FormData: https://bugzilla.mozilla.org/show_bug.cgi?id=649150 + // Android browsers (default one and Dolphin) seem to have the same issue, see: #613 + _preloadAndSend.call(target, meta, data); + return; // _preloadAndSend will reinvoke send() with transmutated FormData =%D + } + } + + // transfer fields to real FormData + if (data instanceof FormData) { // if still a FormData, e.g. not mangled by _prepareMultipart() + var fd = new window.FormData(); + data.each(function(value, name) { + if (value instanceof Blob) { + fd.append(name, value.getSource()); + } else { + fd.append(name, value); + } + }); + data = fd; + } + } + + + // if XHR L2 + if (_xhr.upload) { + if (meta.withCredentials) { + _xhr.withCredentials = true; + } + + _xhr.addEventListener('load', function(e) { + target.trigger(e); + }); + + _xhr.addEventListener('error', function(e) { + target.trigger(e); + }); + + // additionally listen to progress events + _xhr.addEventListener('progress', function(e) { + target.trigger(e); + }); + + _xhr.upload.addEventListener('progress', function(e) { + target.trigger({ + type: 'UploadProgress', + loaded: e.loaded, + total: e.total + }); + }); + // ... otherwise simulate XHR L2 + } else { + _xhr.onreadystatechange = function onReadyStateChange() { + + // fake Level 2 events + switch (_xhr.readyState) { + + case 1: // XMLHttpRequest.OPENED + // readystatechanged is fired twice for OPENED state (in IE and Mozilla) - neu + break; + + // looks like HEADERS_RECEIVED (state 2) is not reported in Opera (or it's old versions) - neu + case 2: // XMLHttpRequest.HEADERS_RECEIVED + break; + + case 3: // XMLHttpRequest.LOADING + // try to fire progress event for not XHR L2 + var total, loaded; + + try { + if (Url.hasSameOrigin(meta.url)) { // Content-Length not accessible for cross-domain on some browsers + total = _xhr.getResponseHeader('Content-Length') || 0; // old Safari throws an exception here + } + + if (_xhr.responseText) { // responseText was introduced in IE7 + loaded = _xhr.responseText.length; + } + } catch(ex) { + total = loaded = 0; + } + + target.trigger({ + type: 'progress', + lengthComputable: !!total, + total: parseInt(total, 10), + loaded: loaded + }); + break; + + case 4: // XMLHttpRequest.DONE + // release readystatechange handler (mostly for IE) + _xhr.onreadystatechange = function() {}; + + // usually status 0 is returned when server is unreachable, but FF also fails to status 0 for 408 timeout + if (_xhr.status === 0) { + target.trigger('error'); + } else { + target.trigger('load'); + } + break; + } + }; + } + + + // set request headers + if (!Basic.isEmptyObj(meta.headers)) { + Basic.each(meta.headers, function(value, header) { + _xhr.setRequestHeader(header, value); + }); + } + + // request response type + if ("" !== meta.responseType && 'responseType' in _xhr) { + if ('json' === meta.responseType && !Env.can('return_response_type', 'json')) { // we can fake this one + _xhr.responseType = 'text'; + } else { + _xhr.responseType = meta.responseType; + } + } + + // send ... + if (!mustSendAsBinary) { + _xhr.send(data); + } else { + if (_xhr.sendAsBinary) { // Gecko + _xhr.sendAsBinary(data); + } else { // other browsers having support for typed arrays + (function() { + // mimic Gecko's sendAsBinary + var ui8a = new Uint8Array(data.length); + for (var i = 0; i < data.length; i++) { + ui8a[i] = (data.charCodeAt(i) & 0xff); + } + _xhr.send(ui8a.buffer); + }()); + } + } + + target.trigger('loadstart'); + }, + + getStatus: function() { + // according to W3C spec it should return 0 for readyState < 3, but instead it throws an exception + try { + if (_xhr) { + return _xhr.status; + } + } catch(ex) {} + return 0; + }, + + getResponse: function(responseType) { + var I = this.getRuntime(); + + try { + switch (responseType) { + case 'blob': + var file = new File(I.uid, _xhr.response); + + // try to extract file name from content-disposition if possible (might be - not, if CORS for example) + var disposition = _xhr.getResponseHeader('Content-Disposition'); + if (disposition) { + // extract filename from response header if available + var match = disposition.match(/filename=([\'\"'])([^\1]+)\1/); + if (match) { + _filename = match[2]; + } + } + file.name = _filename; + + // pre-webkit Opera doesn't set type property on the blob response + if (!file.type) { + file.type = Mime.getFileMime(_filename); + } + return file; + + case 'json': + if (!Env.can('return_response_type', 'json')) { + return _xhr.status === 200 && !!window.JSON ? JSON.parse(_xhr.responseText) : null; + } + return _xhr.response; + + case 'document': + return _getDocument(_xhr); + + default: + return _xhr.responseText !== '' ? _xhr.responseText : null; // against the specs, but for consistency across the runtimes + } + } catch(ex) { + return null; + } + }, + + getAllResponseHeaders: function() { + try { + return _xhr.getAllResponseHeaders(); + } catch(ex) {} + return ''; + }, + + abort: function() { + if (_xhr) { + _xhr.abort(); + } + }, + + destroy: function() { + self = _filename = null; + } + }); + + + // here we go... ugly fix for ugly bug + function _preloadAndSend(meta, data) { + var target = this, blob, fr; + + // get original blob + blob = data.getBlob().getSource(); + + // preload blob in memory to be sent as binary string + fr = new window.FileReader(); + fr.onload = function() { + // overwrite original blob + data.append(data.getBlobName(), new Blob(null, { + type: blob.type, + data: fr.result + })); + // invoke send operation again + self.send.call(target, meta, data); + }; + fr.readAsBinaryString(blob); + } + + + function _getNativeXHR() { + if (window.XMLHttpRequest && !(Env.browser === 'IE' && Env.version < 8)) { // IE7 has native XHR but it's buggy + return new window.XMLHttpRequest(); + } else { + return (function() { + var progIDs = ['Msxml2.XMLHTTP.6.0', 'Microsoft.XMLHTTP']; // if 6.0 available, use it, otherwise failback to default 3.0 + for (var i = 0; i < progIDs.length; i++) { + try { + return new ActiveXObject(progIDs[i]); + } catch (ex) {} + } + })(); + } + } + + // @credits Sergey Ilinsky (http://www.ilinsky.com/) + function _getDocument(xhr) { + var rXML = xhr.responseXML; + var rText = xhr.responseText; + + // Try parsing responseText (@see: http://www.ilinsky.com/articles/XMLHttpRequest/#bugs-ie-responseXML-content-type) + if (Env.browser === 'IE' && rText && rXML && !rXML.documentElement && /[^\/]+\/[^\+]+\+xml/.test(xhr.getResponseHeader("Content-Type"))) { + rXML = new window.ActiveXObject("Microsoft.XMLDOM"); + rXML.async = false; + rXML.validateOnParse = false; + rXML.loadXML(rText); + } + + // Check if there is no error in document + if (rXML) { + if ((Env.browser === 'IE' && rXML.parseError !== 0) || !rXML.documentElement || rXML.documentElement.tagName === "parsererror") { + return null; + } + } + return rXML; + } + + + function _prepareMultipart(fd) { + var boundary = '----moxieboundary' + new Date().getTime() + , dashdash = '--' + , crlf = '\r\n' + , multipart = '' + , I = this.getRuntime() + ; + + if (!I.can('send_binary_string')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + _xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); + + // append multipart parameters + fd.each(function(value, name) { + // Firefox 3.6 failed to convert multibyte characters to UTF-8 in sendAsBinary(), + // so we try it here ourselves with: unescape(encodeURIComponent(value)) + if (value instanceof Blob) { + // Build RFC2388 blob + multipart += dashdash + boundary + crlf + + 'Content-Disposition: form-data; name="' + name + '"; filename="' + unescape(encodeURIComponent(value.name || 'blob')) + '"' + crlf + + 'Content-Type: ' + (value.type || 'application/octet-stream') + crlf + crlf + + value.getSource() + crlf; + } else { + multipart += dashdash + boundary + crlf + + 'Content-Disposition: form-data; name="' + name + '"' + crlf + crlf + + unescape(encodeURIComponent(value)) + crlf; + } + }); + + multipart += dashdash + boundary + dashdash + crlf; + + return multipart; + } + } + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/html5/utils/BinaryReader.js + +/** + * BinaryReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/utils/BinaryReader +@private +*/ +define("moxie/runtime/html5/utils/BinaryReader", [], function() { + return function() { + var II = false, bin; + + // Private functions + function read(idx, size) { + var mv = II ? 0 : -8 * (size - 1), sum = 0, i; + + for (i = 0; i < size; i++) { + sum |= (bin.charCodeAt(idx + i) << Math.abs(mv + i*8)); + } + + return sum; + } + + function putstr(segment, idx, length) { + length = arguments.length === 3 ? length : bin.length - idx - 1; + bin = bin.substr(0, idx) + segment + bin.substr(length + idx); + } + + function write(idx, num, size) { + var str = '', mv = II ? 0 : -8 * (size - 1), i; + + for (i = 0; i < size; i++) { + str += String.fromCharCode((num >> Math.abs(mv + i*8)) & 255); + } + + putstr(str, idx, size); + } + + // Public functions + return { + II: function(order) { + if (order === undefined) { + return II; + } else { + II = order; + } + }, + + init: function(binData) { + II = false; + bin = binData; + }, + + SEGMENT: function(idx, length, segment) { + switch (arguments.length) { + case 1: + return bin.substr(idx, bin.length - idx - 1); + case 2: + return bin.substr(idx, length); + case 3: + putstr(segment, idx, length); + break; + default: return bin; + } + }, + + BYTE: function(idx) { + return read(idx, 1); + }, + + SHORT: function(idx) { + return read(idx, 2); + }, + + LONG: function(idx, num) { + if (num === undefined) { + return read(idx, 4); + } else { + write(idx, num, 4); + } + }, + + SLONG: function(idx) { // 2's complement notation + var num = read(idx, 4); + + return (num > 2147483647 ? num - 4294967296 : num); + }, + + STRING: function(idx, size) { + var str = ''; + + for (size += idx; idx < size; idx++) { + str += String.fromCharCode(read(idx, 1)); + } + + return str; + } + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/JPEGHeaders.js + +/** + * JPEGHeaders.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/JPEGHeaders +@private +*/ +define("moxie/runtime/html5/image/JPEGHeaders", [ + "moxie/runtime/html5/utils/BinaryReader" +], function(BinaryReader) { + + return function JPEGHeaders(data) { + var headers = [], read, idx, marker, length = 0; + + read = new BinaryReader(); + read.init(data); + + // Check if data is jpeg + if (read.SHORT(0) !== 0xFFD8) { + return; + } + + idx = 2; + + while (idx <= data.length) { + marker = read.SHORT(idx); + + // omit RST (restart) markers + if (marker >= 0xFFD0 && marker <= 0xFFD7) { + idx += 2; + continue; + } + + // no headers allowed after SOS marker + if (marker === 0xFFDA || marker === 0xFFD9) { + break; + } + + length = read.SHORT(idx + 2) + 2; + + // APPn marker detected + if (marker >= 0xFFE1 && marker <= 0xFFEF) { + headers.push({ + hex: marker, + name: 'APP' + (marker & 0x000F), + start: idx, + length: length, + segment: read.SEGMENT(idx, length) + }); + } + + idx += length; + } + + read.init(null); // free memory + + return { + headers: headers, + + restore: function(data) { + var max, i; + + read.init(data); + + idx = read.SHORT(2) == 0xFFE0 ? 4 + read.SHORT(4) : 2; + + for (i = 0, max = headers.length; i < max; i++) { + read.SEGMENT(idx, 0, headers[i].segment); + idx += headers[i].length; + } + + data = read.SEGMENT(); + read.init(null); + return data; + }, + + strip: function(data) { + var headers, jpegHeaders, i; + + jpegHeaders = new JPEGHeaders(data); + headers = jpegHeaders.headers; + jpegHeaders.purge(); + + read.init(data); + + i = headers.length; + while (i--) { + read.SEGMENT(headers[i].start, headers[i].length, ''); + } + + data = read.SEGMENT(); + read.init(null); + return data; + }, + + get: function(name) { + var array = []; + + for (var i = 0, max = headers.length; i < max; i++) { + if (headers[i].name === name.toUpperCase()) { + array.push(headers[i].segment); + } + } + return array; + }, + + set: function(name, segment) { + var array = [], i, ii, max; + + if (typeof(segment) === 'string') { + array.push(segment); + } else { + array = segment; + } + + for (i = ii = 0, max = headers.length; i < max; i++) { + if (headers[i].name === name.toUpperCase()) { + headers[i].segment = array[ii]; + headers[i].length = array[ii].length; + ii++; + } + if (ii >= array.length) { + break; + } + } + }, + + purge: function() { + headers = []; + read.init(null); + read = null; + } + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/ExifParser.js + +/** + * ExifParser.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/ExifParser +@private +*/ +define("moxie/runtime/html5/image/ExifParser", [ + "moxie/core/utils/Basic", + "moxie/runtime/html5/utils/BinaryReader" +], function(Basic, BinaryReader) { + + return function ExifParser() { + // Private ExifParser fields + var data, tags, Tiff, offsets = {}, tagDescs; + + data = new BinaryReader(); + + tags = { + tiff : { + /* + The image orientation viewed in terms of rows and columns. + + 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. + 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. + 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. + 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. + 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. + 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. + 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. + 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. + */ + 0x0112: 'Orientation', + 0x010E: 'ImageDescription', + 0x010F: 'Make', + 0x0110: 'Model', + 0x0131: 'Software', + 0x8769: 'ExifIFDPointer', + 0x8825: 'GPSInfoIFDPointer' + }, + exif : { + 0x9000: 'ExifVersion', + 0xA001: 'ColorSpace', + 0xA002: 'PixelXDimension', + 0xA003: 'PixelYDimension', + 0x9003: 'DateTimeOriginal', + 0x829A: 'ExposureTime', + 0x829D: 'FNumber', + 0x8827: 'ISOSpeedRatings', + 0x9201: 'ShutterSpeedValue', + 0x9202: 'ApertureValue' , + 0x9207: 'MeteringMode', + 0x9208: 'LightSource', + 0x9209: 'Flash', + 0x920A: 'FocalLength', + 0xA402: 'ExposureMode', + 0xA403: 'WhiteBalance', + 0xA406: 'SceneCaptureType', + 0xA404: 'DigitalZoomRatio', + 0xA408: 'Contrast', + 0xA409: 'Saturation', + 0xA40A: 'Sharpness' + }, + gps : { + 0x0000: 'GPSVersionID', + 0x0001: 'GPSLatitudeRef', + 0x0002: 'GPSLatitude', + 0x0003: 'GPSLongitudeRef', + 0x0004: 'GPSLongitude' + } + }; + + tagDescs = { + 'ColorSpace': { + 1: 'sRGB', + 0: 'Uncalibrated' + }, + + 'MeteringMode': { + 0: 'Unknown', + 1: 'Average', + 2: 'CenterWeightedAverage', + 3: 'Spot', + 4: 'MultiSpot', + 5: 'Pattern', + 6: 'Partial', + 255: 'Other' + }, + + 'LightSource': { + 1: 'Daylight', + 2: 'Fliorescent', + 3: 'Tungsten', + 4: 'Flash', + 9: 'Fine weather', + 10: 'Cloudy weather', + 11: 'Shade', + 12: 'Daylight fluorescent (D 5700 - 7100K)', + 13: 'Day white fluorescent (N 4600 -5400K)', + 14: 'Cool white fluorescent (W 3900 - 4500K)', + 15: 'White fluorescent (WW 3200 - 3700K)', + 17: 'Standard light A', + 18: 'Standard light B', + 19: 'Standard light C', + 20: 'D55', + 21: 'D65', + 22: 'D75', + 23: 'D50', + 24: 'ISO studio tungsten', + 255: 'Other' + }, + + 'Flash': { + 0x0000: 'Flash did not fire.', + 0x0001: 'Flash fired.', + 0x0005: 'Strobe return light not detected.', + 0x0007: 'Strobe return light detected.', + 0x0009: 'Flash fired, compulsory flash mode', + 0x000D: 'Flash fired, compulsory flash mode, return light not detected', + 0x000F: 'Flash fired, compulsory flash mode, return light detected', + 0x0010: 'Flash did not fire, compulsory flash mode', + 0x0018: 'Flash did not fire, auto mode', + 0x0019: 'Flash fired, auto mode', + 0x001D: 'Flash fired, auto mode, return light not detected', + 0x001F: 'Flash fired, auto mode, return light detected', + 0x0020: 'No flash function', + 0x0041: 'Flash fired, red-eye reduction mode', + 0x0045: 'Flash fired, red-eye reduction mode, return light not detected', + 0x0047: 'Flash fired, red-eye reduction mode, return light detected', + 0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode', + 0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected', + 0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected', + 0x0059: 'Flash fired, auto mode, red-eye reduction mode', + 0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode', + 0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode' + }, + + 'ExposureMode': { + 0: 'Auto exposure', + 1: 'Manual exposure', + 2: 'Auto bracket' + }, + + 'WhiteBalance': { + 0: 'Auto white balance', + 1: 'Manual white balance' + }, + + 'SceneCaptureType': { + 0: 'Standard', + 1: 'Landscape', + 2: 'Portrait', + 3: 'Night scene' + }, + + 'Contrast': { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard' + }, + + 'Saturation': { + 0: 'Normal', + 1: 'Low saturation', + 2: 'High saturation' + }, + + 'Sharpness': { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard' + }, + + // GPS related + 'GPSLatitudeRef': { + N: 'North latitude', + S: 'South latitude' + }, + + 'GPSLongitudeRef': { + E: 'East longitude', + W: 'West longitude' + } + }; + + function extractTags(IFD_offset, tags2extract) { + var length = data.SHORT(IFD_offset), i, ii, + tag, type, count, tagOffset, offset, value, values = [], hash = {}; + + for (i = 0; i < length; i++) { + // Set binary reader pointer to beginning of the next tag + offset = tagOffset = IFD_offset + 12 * i + 2; + + tag = tags2extract[data.SHORT(offset)]; + + if (tag === undefined) { + continue; // Not the tag we requested + } + + type = data.SHORT(offset+=2); + count = data.LONG(offset+=2); + + offset += 4; + values = []; + + switch (type) { + case 1: // BYTE + case 7: // UNDEFINED + if (count > 4) { + offset = data.LONG(offset) + offsets.tiffHeader; + } + + for (ii = 0; ii < count; ii++) { + values[ii] = data.BYTE(offset + ii); + } + + break; + + case 2: // STRING + if (count > 4) { + offset = data.LONG(offset) + offsets.tiffHeader; + } + + hash[tag] = data.STRING(offset, count - 1); + + continue; + + case 3: // SHORT + if (count > 2) { + offset = data.LONG(offset) + offsets.tiffHeader; + } + + for (ii = 0; ii < count; ii++) { + values[ii] = data.SHORT(offset + ii*2); + } + + break; + + case 4: // LONG + if (count > 1) { + offset = data.LONG(offset) + offsets.tiffHeader; + } + + for (ii = 0; ii < count; ii++) { + values[ii] = data.LONG(offset + ii*4); + } + + break; + + case 5: // RATIONAL + offset = data.LONG(offset) + offsets.tiffHeader; + + for (ii = 0; ii < count; ii++) { + values[ii] = data.LONG(offset + ii*4) / data.LONG(offset + ii*4 + 4); + } + + break; + + case 9: // SLONG + offset = data.LONG(offset) + offsets.tiffHeader; + + for (ii = 0; ii < count; ii++) { + values[ii] = data.SLONG(offset + ii*4); + } + + break; + + case 10: // SRATIONAL + offset = data.LONG(offset) + offsets.tiffHeader; + + for (ii = 0; ii < count; ii++) { + values[ii] = data.SLONG(offset + ii*4) / data.SLONG(offset + ii*4 + 4); + } + + break; + + default: + continue; + } + + value = (count == 1 ? values[0] : values); + + if (tagDescs.hasOwnProperty(tag) && typeof value != 'object') { + hash[tag] = tagDescs[tag][value]; + } else { + hash[tag] = value; + } + } + + return hash; + } + + function getIFDOffsets() { + var idx = offsets.tiffHeader; + + // Set read order of multi-byte data + data.II(data.SHORT(idx) == 0x4949); + + // Check if always present bytes are indeed present + if (data.SHORT(idx+=2) !== 0x002A) { + return false; + } + + offsets.IFD0 = offsets.tiffHeader + data.LONG(idx += 2); + Tiff = extractTags(offsets.IFD0, tags.tiff); + + if ('ExifIFDPointer' in Tiff) { + offsets.exifIFD = offsets.tiffHeader + Tiff.ExifIFDPointer; + delete Tiff.ExifIFDPointer; + } + + if ('GPSInfoIFDPointer' in Tiff) { + offsets.gpsIFD = offsets.tiffHeader + Tiff.GPSInfoIFDPointer; + delete Tiff.GPSInfoIFDPointer; + } + return true; + } + + // At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported + function setTag(ifd, tag, value) { + var offset, length, tagOffset, valueOffset = 0; + + // If tag name passed translate into hex key + if (typeof(tag) === 'string') { + var tmpTags = tags[ifd.toLowerCase()]; + for (var hex in tmpTags) { + if (tmpTags[hex] === tag) { + tag = hex; + break; + } + } + } + offset = offsets[ifd.toLowerCase() + 'IFD']; + length = data.SHORT(offset); + + for (var i = 0; i < length; i++) { + tagOffset = offset + 12 * i + 2; + + if (data.SHORT(tagOffset) == tag) { + valueOffset = tagOffset + 8; + break; + } + } + + if (!valueOffset) { + return false; + } + + data.LONG(valueOffset, value); + return true; + } + + + // Public functions + return { + init: function(segment) { + // Reset internal data + offsets = { + tiffHeader: 10 + }; + + if (segment === undefined || !segment.length) { + return false; + } + + data.init(segment); + + // Check if that's APP1 and that it has EXIF + if (data.SHORT(0) === 0xFFE1 && data.STRING(4, 5).toUpperCase() === "EXIF\0") { + return getIFDOffsets(); + } + return false; + }, + + TIFF: function() { + return Tiff; + }, + + EXIF: function() { + var Exif; + + // Populate EXIF hash + Exif = extractTags(offsets.exifIFD, tags.exif); + + // Fix formatting of some tags + if (Exif.ExifVersion && Basic.typeOf(Exif.ExifVersion) === 'array') { + for (var i = 0, exifVersion = ''; i < Exif.ExifVersion.length; i++) { + exifVersion += String.fromCharCode(Exif.ExifVersion[i]); + } + Exif.ExifVersion = exifVersion; + } + + return Exif; + }, + + GPS: function() { + var GPS; + + GPS = extractTags(offsets.gpsIFD, tags.gps); + + // iOS devices (and probably some others) do not put in GPSVersionID tag (why?..) + if (GPS.GPSVersionID && Basic.typeOf(GPS.GPSVersionID) === 'array') { + GPS.GPSVersionID = GPS.GPSVersionID.join('.'); + } + + return GPS; + }, + + setExif: function(tag, value) { + // Right now only setting of width/height is possible + if (tag !== 'PixelXDimension' && tag !== 'PixelYDimension') {return false;} + + return setTag('exif', tag, value); + }, + + + getBinary: function() { + return data.SEGMENT(); + }, + + purge: function() { + data.init(null); + data = Tiff = null; + offsets = {}; + } + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/JPEG.js + +/** + * JPEG.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/JPEG +@private +*/ +define("moxie/runtime/html5/image/JPEG", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/html5/image/JPEGHeaders", + "moxie/runtime/html5/utils/BinaryReader", + "moxie/runtime/html5/image/ExifParser" +], function(Basic, x, JPEGHeaders, BinaryReader, ExifParser) { + + function JPEG(binstr) { + var _binstr, _br, _hm, _ep, _info, hasExif; + + function _getDimensions() { + var idx = 0, marker, length; + + // examine all through the end, since some images might have very large APP segments + while (idx <= _binstr.length) { + marker = _br.SHORT(idx += 2); + + if (marker >= 0xFFC0 && marker <= 0xFFC3) { // SOFn + idx += 5; // marker (2 bytes) + length (2 bytes) + Sample precision (1 byte) + return { + height: _br.SHORT(idx), + width: _br.SHORT(idx += 2) + }; + } + length = _br.SHORT(idx += 2); + idx += length - 2; + } + return null; + } + + _binstr = binstr; + + _br = new BinaryReader(); + _br.init(_binstr); + + // check if it is jpeg + if (_br.SHORT(0) !== 0xFFD8) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + // backup headers + _hm = new JPEGHeaders(binstr); + + // extract exif info + _ep = new ExifParser(); + hasExif = !!_ep.init(_hm.get('app1')[0]); + + // get dimensions + _info = _getDimensions.call(this); + + Basic.extend(this, { + type: 'image/jpeg', + + size: _binstr.length, + + width: _info && _info.width || 0, + + height: _info && _info.height || 0, + + setExif: function(tag, value) { + if (!hasExif) { + return false; // or throw an exception + } + + if (Basic.typeOf(tag) === 'object') { + Basic.each(tag, function(value, tag) { + _ep.setExif(tag, value); + }); + } else { + _ep.setExif(tag, value); + } + + // update internal headers + _hm.set('app1', _ep.getBinary()); + }, + + writeHeaders: function() { + if (!arguments.length) { + // if no arguments passed, update headers internally + return (_binstr = _hm.restore(_binstr)); + } + return _hm.restore(arguments[0]); + }, + + stripHeaders: function(binstr) { + return _hm.strip(binstr); + }, + + purge: function() { + _purge.call(this); + } + }); + + if (hasExif) { + this.meta = { + tiff: _ep.TIFF(), + exif: _ep.EXIF(), + gps: _ep.GPS() + }; + } + + function _purge() { + if (!_ep || !_hm || !_br) { + return; // ignore any repeating purge requests + } + _ep.purge(); + _hm.purge(); + _br.init(null); + _binstr = _info = _hm = _ep = _br = null; + } + } + + return JPEG; +}); + +// Included from: src/javascript/runtime/html5/image/PNG.js + +/** + * PNG.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/PNG +@private +*/ +define("moxie/runtime/html5/image/PNG", [ + "moxie/core/Exceptions", + "moxie/core/utils/Basic", + "moxie/runtime/html5/utils/BinaryReader" +], function(x, Basic, BinaryReader) { + + function PNG(binstr) { + var _binstr, _br, _hm, _ep, _info; + + _binstr = binstr; + + _br = new BinaryReader(); + _br.init(_binstr); + + // check if it's png + (function() { + var idx = 0, i = 0 + , signature = [0x8950, 0x4E47, 0x0D0A, 0x1A0A] + ; + + for (i = 0; i < signature.length; i++, idx += 2) { + if (signature[i] != _br.SHORT(idx)) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + } + }()); + + function _getDimensions() { + var chunk, idx; + + chunk = _getChunkAt.call(this, 8); + + if (chunk.type == 'IHDR') { + idx = chunk.start; + return { + width: _br.LONG(idx), + height: _br.LONG(idx += 4) + }; + } + return null; + } + + function _purge() { + if (!_br) { + return; // ignore any repeating purge requests + } + _br.init(null); + _binstr = _info = _hm = _ep = _br = null; + } + + _info = _getDimensions.call(this); + + Basic.extend(this, { + type: 'image/png', + + size: _binstr.length, + + width: _info.width, + + height: _info.height, + + purge: function() { + _purge.call(this); + } + }); + + // for PNG we can safely trigger purge automatically, as we do not keep any data for later + _purge.call(this); + + function _getChunkAt(idx) { + var length, type, start, CRC; + + length = _br.LONG(idx); + type = _br.STRING(idx += 4, 4); + start = idx += 4; + CRC = _br.LONG(idx + length); + + return { + length: length, + type: type, + start: start, + CRC: CRC + }; + } + } + + return PNG; +}); + +// Included from: src/javascript/runtime/html5/image/ImageInfo.js + +/** + * ImageInfo.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/ImageInfo +@private +*/ +define("moxie/runtime/html5/image/ImageInfo", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/html5/image/JPEG", + "moxie/runtime/html5/image/PNG" +], function(Basic, x, JPEG, PNG) { + /** + Optional image investigation tool for HTML5 runtime. Provides the following features: + - ability to distinguish image type (JPEG or PNG) by signature + - ability to extract image width/height directly from it's internals, without preloading in memory (fast) + - ability to extract APP headers from JPEGs (Exif, GPS, etc) + - ability to replace width/height tags in extracted JPEG headers + - ability to restore APP headers, that were for example stripped during image manipulation + + @class ImageInfo + @constructor + @param {String} binstr Image source as binary string + */ + return function(binstr) { + var _cs = [JPEG, PNG], _img; + + // figure out the format, throw: ImageError.WRONG_FORMAT if not supported + _img = (function() { + for (var i = 0; i < _cs.length; i++) { + try { + return new _cs[i](binstr); + } catch (ex) { + // console.info(ex); + } + } + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + }()); + + Basic.extend(this, { + /** + Image Mime Type extracted from it's depths + + @property type + @type {String} + @default '' + */ + type: '', + + /** + Image size in bytes + + @property size + @type {Number} + @default 0 + */ + size: 0, + + /** + Image width extracted from image source + + @property width + @type {Number} + @default 0 + */ + width: 0, + + /** + Image height extracted from image source + + @property height + @type {Number} + @default 0 + */ + height: 0, + + /** + Sets Exif tag. Currently applicable only for width and height tags. Obviously works only with JPEGs. + + @method setExif + @param {String} tag Tag to set + @param {Mixed} value Value to assign to the tag + */ + setExif: function() {}, + + /** + Restores headers to the source. + + @method writeHeaders + @param {String} data Image source as binary string + @return {String} Updated binary string + */ + writeHeaders: function(data) { + return data; + }, + + /** + Strip all headers from the source. + + @method stripHeaders + @param {String} data Image source as binary string + @return {String} Updated binary string + */ + stripHeaders: function(data) { + return data; + }, + + /** + Dispose resources. + + @method purge + */ + purge: function() {} + }); + + Basic.extend(this, _img); + + this.purge = function() { + _img.purge(); + _img = null; + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/MegaPixel.js + +/** +(The MIT License) + +Copyright (c) 2012 Shinichi Tomita ; + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * Mega pixel image rendering library for iOS6 Safari + * + * Fixes iOS6 Safari's image file rendering issue for large size image (over mega-pixel), + * which causes unexpected subsampling when drawing it in canvas. + * By using this library, you can safely render the image with proper stretching. + * + * Copyright (c) 2012 Shinichi Tomita + * Released under the MIT license + */ + +/** +@class moxie/runtime/html5/image/MegaPixel +@private +*/ +define("moxie/runtime/html5/image/MegaPixel", [], function() { + + /** + * Rendering image element (with resizing) into the canvas element + */ + function renderImageToCanvas(img, canvas, options) { + var iw = img.naturalWidth, ih = img.naturalHeight; + var width = options.width, height = options.height; + var x = options.x || 0, y = options.y || 0; + var ctx = canvas.getContext('2d'); + if (detectSubsampling(img)) { + iw /= 2; + ih /= 2; + } + var d = 1024; // size of tiling canvas + var tmpCanvas = document.createElement('canvas'); + tmpCanvas.width = tmpCanvas.height = d; + var tmpCtx = tmpCanvas.getContext('2d'); + var vertSquashRatio = detectVerticalSquash(img, iw, ih); + var sy = 0; + while (sy < ih) { + var sh = sy + d > ih ? ih - sy : d; + var sx = 0; + while (sx < iw) { + var sw = sx + d > iw ? iw - sx : d; + tmpCtx.clearRect(0, 0, d, d); + tmpCtx.drawImage(img, -sx, -sy); + var dx = (sx * width / iw + x) << 0; + var dw = Math.ceil(sw * width / iw); + var dy = (sy * height / ih / vertSquashRatio + y) << 0; + var dh = Math.ceil(sh * height / ih / vertSquashRatio); + ctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh); + sx += d; + } + sy += d; + } + tmpCanvas = tmpCtx = null; + } + + /** + * Detect subsampling in loaded image. + * In iOS, larger images than 2M pixels may be subsampled in rendering. + */ + function detectSubsampling(img) { + var iw = img.naturalWidth, ih = img.naturalHeight; + if (iw * ih > 1024 * 1024) { // subsampling may happen over megapixel image + var canvas = document.createElement('canvas'); + canvas.width = canvas.height = 1; + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, -iw + 1, 0); + // subsampled image becomes half smaller in rendering size. + // check alpha channel value to confirm image is covering edge pixel or not. + // if alpha value is 0 image is not covering, hence subsampled. + return ctx.getImageData(0, 0, 1, 1).data[3] === 0; + } else { + return false; + } + } + + + /** + * Detecting vertical squash in loaded image. + * Fixes a bug which squash image vertically while drawing into canvas for some images. + */ + function detectVerticalSquash(img, iw, ih) { + var canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = ih; + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); + var data = ctx.getImageData(0, 0, 1, ih).data; + // search image edge pixel position in case it is squashed vertically. + var sy = 0; + var ey = ih; + var py = ih; + while (py > sy) { + var alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) { + ey = py; + } else { + sy = py; + } + py = (ey + sy) >> 1; + } + canvas = null; + var ratio = (py / ih); + return (ratio === 0) ? 1 : ratio; + } + + return { + isSubsampled: detectSubsampling, + renderTo: renderImageToCanvas + }; +}); + +// Included from: src/javascript/runtime/html5/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/Image +@private +*/ +define("moxie/runtime/html5/image/Image", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/core/utils/Encode", + "moxie/file/File", + "moxie/runtime/html5/image/ImageInfo", + "moxie/runtime/html5/image/MegaPixel", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, Basic, x, Encode, File, ImageInfo, MegaPixel, Mime, Env) { + + function HTML5Image() { + var me = this + , _img, _imgInfo, _canvas, _binStr, _blob + , _modified = false // is set true whenever image is modified + , _preserveHeaders = true + ; + + Basic.extend(this, { + loadFromBlob: function(blob) { + var comp = this, I = comp.getRuntime() + , asBinary = arguments.length > 1 ? arguments[1] : true + ; + + if (!I.can('access_binary')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + _blob = blob; + + if (blob.isDetached()) { + _binStr = blob.getSource(); + _preload.call(this, _binStr); + return; + } else { + _readAsDataUrl.call(this, blob.getSource(), function(dataUrl) { + if (asBinary) { + _binStr = _toBinary(dataUrl); + } + _preload.call(comp, dataUrl); + }); + } + }, + + loadFromImage: function(img, exact) { + this.meta = img.meta; + + _blob = new File(null, { + name: img.name, + size: img.size, + type: img.type + }); + + _preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL()); + }, + + getInfo: function() { + var I = this.getRuntime(), info; + + if (!_imgInfo && _binStr && I.can('access_image_binary')) { + _imgInfo = new ImageInfo(_binStr); + } + + info = { + width: _getImg().width || 0, + height: _getImg().height || 0, + type: _blob.type || Mime.getFileMime(_blob.name), + size: _binStr && _binStr.length || _blob.size || 0, + name: _blob.name || '', + meta: _imgInfo && _imgInfo.meta || this.meta || {} + }; + + return info; + }, + + downsize: function() { + _downsize.apply(this, arguments); + }, + + getAsCanvas: function() { + if (_canvas) { + _canvas.id = this.uid + '_canvas'; + } + return _canvas; + }, + + getAsBlob: function(type, quality) { + if (type !== this.type) { + // if different mime type requested prepare image for conversion + _downsize.call(this, this.width, this.height, false); + } + return new File(null, { + name: _blob.name || '', + type: type, + data: me.getAsBinaryString.call(this, type, quality) + }); + }, + + getAsDataURL: function(type) { + var quality = arguments[1] || 90; + + // if image has not been modified, return the source right away + if (!_modified) { + return _img.src; + } + + if ('image/jpeg' !== type) { + return _canvas.toDataURL('image/png'); + } else { + try { + // older Geckos used to result in an exception on quality argument + return _canvas.toDataURL('image/jpeg', quality/100); + } catch (ex) { + return _canvas.toDataURL('image/jpeg'); + } + } + }, + + getAsBinaryString: function(type, quality) { + // if image has not been modified, return the source right away + if (!_modified) { + // if image was not loaded from binary string + if (!_binStr) { + _binStr = _toBinary(me.getAsDataURL(type, quality)); + } + return _binStr; + } + + if ('image/jpeg' !== type) { + _binStr = _toBinary(me.getAsDataURL(type, quality)); + } else { + var dataUrl; + + // if jpeg + if (!quality) { + quality = 90; + } + + try { + // older Geckos used to result in an exception on quality argument + dataUrl = _canvas.toDataURL('image/jpeg', quality/100); + } catch (ex) { + dataUrl = _canvas.toDataURL('image/jpeg'); + } + + _binStr = _toBinary(dataUrl); + + if (_imgInfo) { + _binStr = _imgInfo.stripHeaders(_binStr); + + if (_preserveHeaders) { + // update dimensions info in exif + if (_imgInfo.meta && _imgInfo.meta.exif) { + _imgInfo.setExif({ + PixelXDimension: this.width, + PixelYDimension: this.height + }); + } + + // re-inject the headers + _binStr = _imgInfo.writeHeaders(_binStr); + } + + // will be re-created from fresh on next getInfo call + _imgInfo.purge(); + _imgInfo = null; + } + } + + _modified = false; + + return _binStr; + }, + + destroy: function() { + me = null; + _purge.call(this); + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + + + function _getImg() { + if (!_canvas && !_img) { + throw new x.ImageError(x.DOMException.INVALID_STATE_ERR); + } + return _canvas || _img; + } + + + function _toBinary(str) { + return Encode.atob(str.substring(str.indexOf('base64,') + 7)); + } + + + function _toDataUrl(str, type) { + return 'data:' + (type || '') + ';base64,' + Encode.btoa(str); + } + + + function _preload(str) { + var comp = this; + + _img = new Image(); + _img.onerror = function() { + _purge.call(this); + comp.trigger('error', x.ImageError.WRONG_FORMAT); + }; + _img.onload = function() { + comp.trigger('load'); + }; + + _img.src = /^data:[^;]*;base64,/.test(str) ? str : _toDataUrl(str, _blob.type); + } + + + function _readAsDataUrl(file, callback) { + var comp = this, fr; + + // use FileReader if it's available + if (window.FileReader) { + fr = new FileReader(); + fr.onload = function() { + callback(this.result); + }; + fr.onerror = function() { + comp.trigger('error', x.ImageError.WRONG_FORMAT); + }; + fr.readAsDataURL(file); + } else { + return callback(file.getAsDataURL()); + } + } + + function _downsize(width, height, crop, preserveHeaders) { + var self = this + , scale + , mathFn + , x = 0 + , y = 0 + , img + , destWidth + , destHeight + , orientation + ; + + _preserveHeaders = preserveHeaders; // we will need to check this on export (see getAsBinaryString()) + + // take into account orientation tag + orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1; + + if (Basic.inArray(orientation, [5,6,7,8]) !== -1) { // values that require 90 degree rotation + // swap dimensions + var tmp = width; + width = height; + height = tmp; + } + + img = _getImg(); + + // unify dimensions + if (!crop) { + scale = Math.min(width/img.width, height/img.height); + } else { + // one of the dimensions may exceed the actual image dimensions - we need to take the smallest value + width = Math.min(width, img.width); + height = Math.min(height, img.height); + + scale = Math.max(width/img.width, height/img.height); + } + + // we only downsize here + if (scale > 1 && !crop && preserveHeaders) { + this.trigger('Resize'); + return; + } + + // prepare canvas if necessary + if (!_canvas) { + _canvas = document.createElement("canvas"); + } + + // calculate dimensions of proportionally resized image + destWidth = Math.round(img.width * scale); + destHeight = Math.round(img.height * scale); + + // scale image and canvas + if (crop) { + _canvas.width = width; + _canvas.height = height; + + // if dimensions of the resulting image still larger than canvas, center it + if (destWidth > width) { + x = Math.round((destWidth - width) / 2); + } + + if (destHeight > height) { + y = Math.round((destHeight - height) / 2); + } + } else { + _canvas.width = destWidth; + _canvas.height = destHeight; + } + + // rotate if required, according to orientation tag + if (!_preserveHeaders) { + _rotateToOrientaion(_canvas.width, _canvas.height, orientation); + } + + _drawToCanvas.call(this, img, _canvas, -x, -y, destWidth, destHeight); + + this.width = _canvas.width; + this.height = _canvas.height; + + _modified = true; + self.trigger('Resize'); + } + + + function _drawToCanvas(img, canvas, x, y, w, h) { + if (Env.OS === 'iOS') { + // avoid squish bug in iOS6 + MegaPixel.renderTo(img, canvas, { width: w, height: h, x: x, y: y }); + } else { + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, x, y, w, h); + } + } + + + /** + * Transform canvas coordination according to specified frame size and orientation + * Orientation value is from EXIF tag + * @author Shinichi Tomita + */ + function _rotateToOrientaion(width, height, orientation) { + switch (orientation) { + case 5: + case 6: + case 7: + case 8: + _canvas.width = height; + _canvas.height = width; + break; + default: + _canvas.width = width; + _canvas.height = height; + } + + /** + 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. + 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. + 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. + 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. + 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. + 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. + 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. + 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. + */ + + var ctx = _canvas.getContext('2d'); + switch (orientation) { + case 2: + // horizontal flip + ctx.translate(width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180 rotate left + ctx.translate(width, height); + ctx.rotate(Math.PI); + break; + case 4: + // vertical flip + ctx.translate(0, height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + case 6: + // 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -height); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(width, -height); + ctx.scale(-1, 1); + break; + case 8: + // 90 rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-width, 0); + break; + } + } + + + function _purge() { + if (_imgInfo) { + _imgInfo.purge(); + _imgInfo = null; + } + _binStr = _img = _canvas = _blob = null; + _modified = false; + } + } + + return (extensions.Image = HTML5Image); +}); + +// Included from: src/javascript/runtime/flash/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +Defines constructor for Flash runtime. + +@class moxie/runtime/flash/Runtime +@private +*/ +define("moxie/runtime/flash/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Env", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/runtime/Runtime" +], function(Basic, Env, Dom, x, Runtime) { + + var type = 'flash', extensions = {}; + + /** + Get the version of the Flash Player + + @method getShimVersion + @private + @return {Number} Flash Player version + */ + function getShimVersion() { + var version; + + try { + version = navigator.plugins['Shockwave Flash']; + version = version.description; + } catch (e1) { + try { + version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); + } catch (e2) { + version = '0.0'; + } + } + version = version.match(/\d+/g); + return parseFloat(version[0] + '.' + version[1]); + } + + /** + Constructor for the Flash Runtime + + @class FlashRuntime + @extends Runtime + */ + function FlashRuntime(options) { + var I = this, initTimer; + + options = Basic.extend({ swf_url: Env.swf_url }, options); + + Runtime.call(this, options, type, { + access_binary: function(value) { + return value && I.mode === 'browser'; + }, + access_image_binary: function(value) { + return value && I.mode === 'browser'; + }, + display_media: Runtime.capTrue, + do_cors: Runtime.capTrue, + drag_and_drop: false, + report_upload_progress: function() { + return I.mode === 'client'; + }, + resize_image: Runtime.capTrue, + return_response_headers: false, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { + return true; + } + return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser'; + }, + return_status_code: function(code) { + return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]); + }, + select_file: Runtime.capTrue, + select_multiple: Runtime.capTrue, + send_binary_string: function(value) { + return value && I.mode === 'browser'; + }, + send_browser_cookies: function(value) { + return value && I.mode === 'browser'; + }, + send_custom_headers: function(value) { + return value && I.mode === 'browser'; + }, + send_multipart: Runtime.capTrue, + slice_blob: function(value) { + return value && I.mode === 'browser'; + }, + stream_upload: function(value) { + return value && I.mode === 'browser'; + }, + summon_file_dialog: false, + upload_filesize: function(size) { + return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client'; + }, + use_http_method: function(methods) { + return !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }, { + // capabilities that require specific mode + access_binary: function(value) { + return value ? 'browser' : 'client'; + }, + access_image_binary: function(value) { + return value ? 'browser' : 'client'; + }, + report_upload_progress: function(value) { + return value ? 'browser' : 'client'; + }, + return_response_type: function(responseType) { + return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser']; + }, + return_status_code: function(code) { + return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser']; + }, + send_binary_string: function(value) { + return value ? 'browser' : 'client'; + }, + send_browser_cookies: function(value) { + return value ? 'browser' : 'client'; + }, + send_custom_headers: function(value) { + return value ? 'browser' : 'client'; + }, + stream_upload: function(value) { + return value ? 'client' : 'browser'; + }, + upload_filesize: function(size) { + return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser'; + } + }, 'client'); + + + // minimal requirement for Flash Player version + if (getShimVersion() < 10) { + this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before + } + + + Basic.extend(this, { + + getShim: function() { + return Dom.get(this.uid); + }, + + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return I.getShim().exec(this.uid, component, action, args); + }, + + init: function() { + var html, el, container; + + container = this.getShimContainer(); + + // if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc) + Basic.extend(container.style, { + position: 'absolute', + top: '-8px', + left: '-8px', + width: '9px', + height: '9px', + overflow: 'hidden' + }); + + // insert flash object + html = '' + + '' + + '' + + '' + + ''; + + if (Env.browser === 'IE') { + el = document.createElement('div'); + container.appendChild(el); + el.outerHTML = html; + el = container = null; // just in case + } else { + container.innerHTML = html; + } + + // Init is dispatched by the shim + initTimer = setTimeout(function() { + if (I && !I.initialized) { // runtime might be already destroyed by this moment + I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + } + }, 5000); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + clearTimeout(initTimer); // initialization check might be still onwait + options = initTimer = destroy = I = null; + }; + }(this.destroy)) + + }, extensions); + } + + Runtime.addConstructor(type, FlashRuntime); + + return extensions; +}); + +// Included from: src/javascript/runtime/flash/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/Blob +@private +*/ +define("moxie/runtime/flash/file/Blob", [ + "moxie/runtime/flash/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + var FlashBlob = { + slice: function(blob, start, end, type) { + var self = this.getRuntime(); + + if (start < 0) { + start = Math.max(blob.size + start, 0); + } else if (start > 0) { + start = Math.min(start, blob.size); + } + + if (end < 0) { + end = Math.max(blob.size + end, 0); + } else if (end > 0) { + end = Math.min(end, blob.size); + } + + blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || ''); + + if (blob) { + blob = new Blob(self.uid, blob); + } + return blob; + } + }; + + return (extensions.Blob = FlashBlob); +}); + +// Included from: src/javascript/runtime/flash/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileInput +@private +*/ +define("moxie/runtime/flash/file/FileInput", [ + "moxie/runtime/flash/Runtime" +], function(extensions) { + + var FileInput = { + init: function(options) { + this.getRuntime().shimExec.call(this, 'FileInput', 'init', { + name: options.name, + accept: options.accept, + multiple: options.multiple + }); + this.trigger('ready'); + } + }; + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/flash/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileReader +@private +*/ +define("moxie/runtime/flash/file/FileReader", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Encode" +], function(extensions, Encode) { + + var _result = ''; + + function _formatData(data, op) { + switch (op) { + case 'readAsText': + return Encode.atob(data, 'utf8'); + case 'readAsBinaryString': + return Encode.atob(data); + case 'readAsDataURL': + return data; + } + return null; + } + + var FileReader = { + read: function(op, blob) { + var target = this, self = target.getRuntime(); + + // special prefix for DataURL read mode + if (op === 'readAsDataURL') { + _result = 'data:' + (blob.type || '') + ';base64,'; + } + + target.bind('Progress', function(e, data) { + if (data) { + _result += _formatData(data, op); + } + }); + + return self.shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid); + }, + + getResult: function() { + return _result; + }, + + destroy: function() { + _result = null; + } + }; + + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/flash/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileReaderSync +@private +*/ +define("moxie/runtime/flash/file/FileReaderSync", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Encode" +], function(extensions, Encode) { + + function _formatData(data, op) { + switch (op) { + case 'readAsText': + return Encode.atob(data, 'utf8'); + case 'readAsBinaryString': + return Encode.atob(data); + case 'readAsDataURL': + return data; + } + return null; + } + + var FileReaderSync = { + read: function(op, blob) { + var result, self = this.getRuntime(); + + result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid); + if (!result) { + return null; // or throw ex + } + + // special prefix for DataURL read mode + if (op === 'readAsDataURL') { + result = 'data:' + (blob.type || '') + ';base64,' + result; + } + + return _formatData(result, op, blob.type); + } + }; + + return (extensions.FileReaderSync = FileReaderSync); +}); + +// Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/flash/xhr/XMLHttpRequest", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Basic", + "moxie/file/Blob", + "moxie/file/File", + "moxie/file/FileReaderSync", + "moxie/xhr/FormData", + "moxie/runtime/Transporter" +], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) { + + var XMLHttpRequest = { + + send: function(meta, data) { + var target = this, self = target.getRuntime(); + + function send() { + meta.transport = self.mode; + self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data); + } + + + function appendBlob(name, blob) { + self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid); + data = null; + send(); + } + + + function attachBlob(blob, cb) { + var tr = new Transporter(); + + tr.bind("TransportingComplete", function() { + cb(this.result); + }); + + tr.transport(blob.getSource(), blob.type, { + ruid: self.uid + }); + } + + // copy over the headers if any + if (!Basic.isEmptyObj(meta.headers)) { + Basic.each(meta.headers, function(value, header) { + self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object + }); + } + + // transfer over multipart params and blob itself + if (data instanceof FormData) { + var blobField; + data.each(function(value, name) { + if (value instanceof Blob) { + blobField = name; + } else { + self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value); + } + }); + + if (!data.hasBlob()) { + data = null; + send(); + } else { + var blob = data.getBlob(); + if (blob.isDetached()) { + attachBlob(blob, function(attachedBlob) { + blob.destroy(); + appendBlob(blobField, attachedBlob); + }); + } else { + appendBlob(blobField, blob); + } + } + } else if (data instanceof Blob) { + if (data.isDetached()) { + attachBlob(data, function(attachedBlob) { + data.destroy(); + data = attachedBlob.uid; + send(); + }); + } else { + data = data.uid; + send(); + } + } else { + send(); + } + }, + + getResponse: function(responseType) { + var frs, blob, self = this.getRuntime(); + + blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob'); + + if (blob) { + blob = new File(self.uid, blob); + + if ('blob' === responseType) { + return blob; + } + + try { + frs = new FileReaderSync(); + + if (!!~Basic.inArray(responseType, ["", "text"])) { + return frs.readAsText(blob); + } else if ('json' === responseType && !!window.JSON) { + return JSON.parse(frs.readAsText(blob)); + } + } finally { + blob.destroy(); + } + } + return null; + }, + + abort: function(upload_complete_flag) { + var self = this.getRuntime(); + + self.shimExec.call(this, 'XMLHttpRequest', 'abort'); + + this.dispatchEvent('readystatechange'); + // this.dispatchEvent('progress'); + this.dispatchEvent('abort'); + + //if (!upload_complete_flag) { + // this.dispatchEvent('uploadprogress'); + //} + } + }; + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/flash/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/runtime/Transporter +@private +*/ +define("moxie/runtime/flash/runtime/Transporter", [ + "moxie/runtime/flash/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + var Transporter = { + getAsBlob: function(type) { + var self = this.getRuntime() + , blob = self.shimExec.call(this, 'Transporter', 'getAsBlob', type) + ; + if (blob) { + return new Blob(self.uid, blob); + } + return null; + } + }; + + return (extensions.Transporter = Transporter); +}); + +// Included from: src/javascript/runtime/flash/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/image/Image +@private +*/ +define("moxie/runtime/flash/image/Image", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/Transporter", + "moxie/file/Blob", + "moxie/file/FileReaderSync" +], function(extensions, Basic, Transporter, Blob, FileReaderSync) { + + var Image = { + loadFromBlob: function(blob) { + var comp = this, self = comp.getRuntime(); + + function exec(srcBlob) { + self.shimExec.call(comp, 'Image', 'loadFromBlob', srcBlob.uid); + comp = self = null; + } + + if (blob.isDetached()) { // binary string + var tr = new Transporter(); + tr.bind("TransportingComplete", function() { + exec(tr.result.getSource()); + }); + tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); + } else { + exec(blob.getSource()); + } + }, + + loadFromImage: function(img) { + var self = this.getRuntime(); + return self.shimExec.call(this, 'Image', 'loadFromImage', img.uid); + }, + + getAsBlob: function(type, quality) { + var self = this.getRuntime() + , blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality) + ; + if (blob) { + return new Blob(self.uid, blob); + } + return null; + }, + + getAsDataURL: function() { + var self = this.getRuntime() + , blob = self.Image.getAsBlob.apply(this, arguments) + , frs + ; + if (!blob) { + return null; + } + frs = new FileReaderSync(); + return frs.readAsDataURL(blob); + } + }; + + return (extensions.Image = Image); +}); + +// Included from: src/javascript/runtime/silverlight/Runtime.js + +/** + * RunTime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +Defines constructor for Silverlight runtime. + +@class moxie/runtime/silverlight/Runtime +@private +*/ +define("moxie/runtime/silverlight/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Env", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/runtime/Runtime" +], function(Basic, Env, Dom, x, Runtime) { + + var type = "silverlight", extensions = {}; + + function isInstalled(version) { + var isVersionSupported = false, control = null, actualVer, + actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0; + + try { + try { + control = new ActiveXObject('AgControl.AgControl'); + + if (control.IsVersionSupported(version)) { + isVersionSupported = true; + } + + control = null; + } catch (e) { + var plugin = navigator.plugins["Silverlight Plug-In"]; + + if (plugin) { + actualVer = plugin.description; + + if (actualVer === "1.0.30226.2") { + actualVer = "2.0.30226.2"; + } + + actualVerArray = actualVer.split("."); + + while (actualVerArray.length > 3) { + actualVerArray.pop(); + } + + while ( actualVerArray.length < 4) { + actualVerArray.push(0); + } + + reqVerArray = version.split("."); + + while (reqVerArray.length > 4) { + reqVerArray.pop(); + } + + do { + requiredVersionPart = parseInt(reqVerArray[index], 10); + actualVersionPart = parseInt(actualVerArray[index], 10); + index++; + } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); + + if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) { + isVersionSupported = true; + } + } + } + } catch (e2) { + isVersionSupported = false; + } + + return isVersionSupported; + } + + /** + Constructor for the Silverlight Runtime + + @class SilverlightRuntime + @extends Runtime + */ + function SilverlightRuntime(options) { + var I = this, initTimer; + + options = Basic.extend({ xap_url: Env.xap_url }, options); + + Runtime.call(this, options, type, { + access_binary: Runtime.capTrue, + access_image_binary: Runtime.capTrue, + display_media: Runtime.capTrue, + do_cors: Runtime.capTrue, + drag_and_drop: false, + report_upload_progress: Runtime.capTrue, + resize_image: Runtime.capTrue, + return_response_headers: function(value) { + return value && I.mode === 'client'; + }, + return_response_type: function(responseType) { + if (responseType !== 'json') { + return true; + } else { + return !!window.JSON; + } + }, + return_status_code: function(code) { + return I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]); + }, + select_file: Runtime.capTrue, + select_multiple: Runtime.capTrue, + send_binary_string: Runtime.capTrue, + send_browser_cookies: function(value) { + return value && I.mode === 'browser'; + }, + send_custom_headers: function(value) { + return value && I.mode === 'client'; + }, + send_multipart: Runtime.capTrue, + slice_blob: Runtime.capTrue, + stream_upload: true, + summon_file_dialog: false, + upload_filesize: Runtime.capTrue, + use_http_method: function(methods) { + return I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }, { + // capabilities that require specific mode + return_response_headers: function(value) { + return value ? 'client' : 'browser'; + }, + return_status_code: function(code) { + return Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser']; + }, + send_browser_cookies: function(value) { + return value ? 'browser' : 'client'; + }, + send_custom_headers: function(value) { + return value ? 'client' : 'browser'; + }, + use_http_method: function(methods) { + return Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser']; + } + }); + + + // minimal requirement + if (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') { + this.mode = false; + } + + + Basic.extend(this, { + getShim: function() { + return Dom.get(this.uid).content.Moxie; + }, + + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return I.getShim().exec(this.uid, component, action, args); + }, + + init : function() { + var container; + + container = this.getShimContainer(); + + container.innerHTML = '' + + '' + + '' + + '' + + '' + + '' + + ''; + + // Init is dispatched by the shim + initTimer = setTimeout(function() { + if (I && !I.initialized) { // runtime might be already destroyed by this moment + I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + } + }, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac) + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + clearTimeout(initTimer); // initialization check might be still onwait + options = initTimer = destroy = I = null; + }; + }(this.destroy)) + + }, extensions); + } + + Runtime.addConstructor(type, SilverlightRuntime); + + return extensions; +}); + +// Included from: src/javascript/runtime/silverlight/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/Blob +@private +*/ +define("moxie/runtime/silverlight/file/Blob", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/Blob" +], function(extensions, Basic, Blob) { + return (extensions.Blob = Basic.extend({}, Blob)); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileInput +@private +*/ +define("moxie/runtime/silverlight/file/FileInput", [ + "moxie/runtime/silverlight/Runtime" +], function(extensions) { + + var FileInput = { + init: function(options) { + + function toFilters(accept) { + var filter = ''; + for (var i = 0; i < accept.length; i++) { + filter += (filter !== '' ? '|' : '') + accept[i].title + " | *." + accept[i].extensions.replace(/,/g, ';*.'); + } + return filter; + } + + this.getRuntime().shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.name, options.multiple); + this.trigger('ready'); + } + }; + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileDrop +@private +*/ +define("moxie/runtime/silverlight/file/FileDrop", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Dom", + "moxie/core/utils/Events" +], function(extensions, Dom, Events) { + + // not exactly useful, since works only in safari (...crickets...) + var FileDrop = { + init: function() { + var comp = this, self = comp.getRuntime(), dropZone; + + dropZone = self.getShimContainer(); + + Events.addEvent(dropZone, 'dragover', function(e) { + e.preventDefault(); + e.stopPropagation(); + e.dataTransfer.dropEffect = 'copy'; + }, comp.uid); + + Events.addEvent(dropZone, 'dragenter', function(e) { + e.preventDefault(); + var flag = Dom.get(self.uid).dragEnter(e); + // If handled, then stop propagation of event in DOM + if (flag) { + e.stopPropagation(); + } + }, comp.uid); + + Events.addEvent(dropZone, 'drop', function(e) { + e.preventDefault(); + var flag = Dom.get(self.uid).dragDrop(e); + // If handled, then stop propagation of event in DOM + if (flag) { + e.stopPropagation(); + } + }, comp.uid); + + return self.shimExec.call(this, 'FileDrop', 'init'); + } + }; + + return (extensions.FileDrop = FileDrop); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileReader +@private +*/ +define("moxie/runtime/silverlight/file/FileReader", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/FileReader" +], function(extensions, Basic, FileReader) { + return (extensions.FileReader = Basic.extend({}, FileReader)); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileReaderSync +@private +*/ +define("moxie/runtime/silverlight/file/FileReaderSync", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/FileReaderSync" +], function(extensions, Basic, FileReaderSync) { + return (extensions.FileReaderSync = Basic.extend({}, FileReaderSync)); +}); + +// Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/silverlight/xhr/XMLHttpRequest", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/xhr/XMLHttpRequest" +], function(extensions, Basic, XMLHttpRequest) { + return (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest)); +}); + +// Included from: src/javascript/runtime/silverlight/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/runtime/Transporter +@private +*/ +define("moxie/runtime/silverlight/runtime/Transporter", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/runtime/Transporter" +], function(extensions, Basic, Transporter) { + return (extensions.Transporter = Basic.extend({}, Transporter)); +}); + +// Included from: src/javascript/runtime/silverlight/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/image/Image +@private +*/ +define("moxie/runtime/silverlight/image/Image", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/image/Image" +], function(extensions, Basic, Image) { + return (extensions.Image = Basic.extend({}, Image, { + + getInfo: function() { + var self = this.getRuntime() + , grps = ['tiff', 'exif', 'gps'] + , info = { meta: {} } + , rawInfo = self.shimExec.call(this, 'Image', 'getInfo') + ; + + if (rawInfo.meta) { + Basic.each(grps, function(grp) { + var meta = rawInfo.meta[grp] + , tag + , i + , length + , value + ; + if (meta && meta.keys) { + info.meta[grp] = {}; + for (i = 0, length = meta.keys.length; i < length; i++) { + tag = meta.keys[i]; + value = meta[tag]; + if (value) { + // convert numbers + if (/^(\d|[1-9]\d+)$/.test(value)) { // integer (make sure doesn't start with zero) + value = parseInt(value, 10); + } else if (/^\d*\.\d+$/.test(value)) { // double + value = parseFloat(value); + } + info.meta[grp][tag] = value; + } + } + } + }); + } + + info.width = parseInt(rawInfo.width, 10); + info.height = parseInt(rawInfo.height, 10); + info.size = parseInt(rawInfo.size, 10); + info.type = rawInfo.type; + info.name = rawInfo.name; + + return info; + } + })); +}); + +// Included from: src/javascript/runtime/html4/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global File:true */ + +/** +Defines constructor for HTML4 runtime. + +@class moxie/runtime/html4/Runtime +@private +*/ +define("moxie/runtime/html4/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/Runtime", + "moxie/core/utils/Env" +], function(Basic, x, Runtime, Env) { + + var type = 'html4', extensions = {}; + + function Html4Runtime(options) { + var I = this + , Test = Runtime.capTest + , True = Runtime.capTrue + ; + + Runtime.call(this, options, type, { + access_binary: Test(window.FileReader || window.File && File.getAsDataURL), + access_image_binary: false, + display_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))), + do_cors: false, + drag_and_drop: false, + filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest + return (Env.browser === 'Chrome' && Env.version >= 28) || (Env.browser === 'IE' && Env.version >= 10); + }()), + resize_image: function() { + return extensions.Image && I.can('access_binary') && Env.can('create_canvas'); + }, + report_upload_progress: false, + return_response_headers: false, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { + return true; + } + return !!~Basic.inArray(responseType, ['text', 'document', '']); + }, + return_status_code: function(code) { + return !Basic.arrayDiff(code, [200, 404]); + }, + select_file: function() { + return Env.can('use_fileinput'); + }, + select_multiple: false, + send_binary_string: false, + send_custom_headers: false, + send_multipart: true, + slice_blob: false, + stream_upload: function() { + return I.can('select_file'); + }, + summon_file_dialog: Test(function() { // yeah... some dirty sniffing here... + return (Env.browser === 'Firefox' && Env.version >= 4) || + (Env.browser === 'Opera' && Env.version >= 12) || + !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']); + }()), + upload_filesize: True, + use_http_method: function(methods) { + return !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }); + + + Basic.extend(this, { + init : function() { + this.trigger("Init"); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + destroy = I = null; + }; + }(this.destroy)) + }); + + Basic.extend(this.getShim(), extensions); + } + + Runtime.addConstructor(type, Html4Runtime); + + return extensions; +}); + +// Included from: src/javascript/runtime/html4/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/file/FileInput +@private +*/ +define("moxie/runtime/html4/file/FileInput", [ + "moxie/runtime/html4/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, Basic, Dom, Events, Mime, Env) { + + function FileInput() { + var _uid, _files = [], _mimes = [], _options; + + function addInput() { + var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid; + + uid = Basic.guid('uid_'); + + shimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE + + if (_uid) { // move previous form out of the view + currForm = Dom.get(_uid + '_form'); + if (currForm) { + Basic.extend(currForm.style, { top: '100%' }); + } + } + + // build form in DOM, since innerHTML version not able to submit file for some reason + form = document.createElement('form'); + form.setAttribute('id', uid + '_form'); + form.setAttribute('method', 'post'); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('encoding', 'multipart/form-data'); + + Basic.extend(form.style, { + overflow: 'hidden', + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + input = document.createElement('input'); + input.setAttribute('id', uid); + input.setAttribute('type', 'file'); + input.setAttribute('name', _options.name || 'Filedata'); + input.setAttribute('accept', _mimes.join(',')); + + Basic.extend(input.style, { + fontSize: '999px', + opacity: 0 + }); + + form.appendChild(input); + shimContainer.appendChild(form); + + // prepare file input to be placed underneath the browse_button element + Basic.extend(input.style, { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + if (Env.browser === 'IE' && Env.version < 10) { + Basic.extend(input.style, { + filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)" + }); + } + + input.onchange = function() { // there should be only one handler for this + var file; + + if (!this.value) { + return; + } + + if (this.files) { + file = this.files[0]; + } else { + file = { + name: this.value + }; + } + + _files = [file]; + + this.onchange = function() {}; // clear event handler + addInput.call(comp); + + // after file is initialized as o.File, we need to update form and input ids + comp.bind('change', function onChange() { + var input = Dom.get(uid), form = Dom.get(uid + '_form'), file; + + comp.unbind('change', onChange); + + if (comp.files.length && input && form) { + file = comp.files[0]; + + input.setAttribute('id', file.uid); + form.setAttribute('id', file.uid + '_form'); + + // set upload target + form.setAttribute('target', file.uid + '_iframe'); + } + input = form = null; + }, 998); + + input = form = null; + comp.trigger('change'); + }; + + + // route click event to the input + if (I.can('summon_file_dialog')) { + browseButton = Dom.get(_options.browse_button); + Events.removeEvent(browseButton, 'click', comp.uid); + Events.addEvent(browseButton, 'click', function(e) { + if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] + input.click(); + } + e.preventDefault(); + }, comp.uid); + } + + _uid = uid; + + shimContainer = currForm = browseButton = null; + } + + Basic.extend(this, { + init: function(options) { + var comp = this, I = comp.getRuntime(), shimContainer; + + // figure out accept string + _options = options; + _mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension')); + + shimContainer = I.getShimContainer(); + + (function() { + var browseButton, zIndex, top; + + browseButton = Dom.get(options.browse_button); + + // Route click event to the input[type=file] element for browsers that support such behavior + if (I.can('summon_file_dialog')) { + if (Dom.getStyle(browseButton, 'position') === 'static') { + browseButton.style.position = 'relative'; + } + + zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; + + browseButton.style.zIndex = zIndex; + shimContainer.style.zIndex = zIndex - 1; + } + + /* Since we have to place input[type=file] on top of the browse_button for some browsers, + browse_button loses interactivity, so we restore it here */ + top = I.can('summon_file_dialog') ? browseButton : shimContainer; + + Events.addEvent(top, 'mouseover', function() { + comp.trigger('mouseenter'); + }, comp.uid); + + Events.addEvent(top, 'mouseout', function() { + comp.trigger('mouseleave'); + }, comp.uid); + + Events.addEvent(top, 'mousedown', function() { + comp.trigger('mousedown'); + }, comp.uid); + + Events.addEvent(Dom.get(options.container), 'mouseup', function() { + comp.trigger('mouseup'); + }, comp.uid); + + browseButton = null; + }()); + + addInput.call(this); + + shimContainer = null; + + // trigger ready event asynchronously + comp.trigger({ + type: 'ready', + async: true + }); + }, + + getFiles: function() { + return _files; + }, + + disable: function(state) { + var input; + + if ((input = Dom.get(_uid))) { + input.disabled = !!state; + } + }, + + destroy: function() { + var I = this.getRuntime() + , shim = I.getShim() + , shimContainer = I.getShimContainer() + ; + + Events.removeAllEvents(shimContainer, this.uid); + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); + + if (shimContainer) { + shimContainer.innerHTML = ''; + } + + shim.removeInstance(this.uid); + + _uid = _files = _mimes = _options = shimContainer = shim = null; + } + }); + } + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/html4/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/file/FileReader +@private +*/ +define("moxie/runtime/html4/file/FileReader", [ + "moxie/runtime/html4/Runtime", + "moxie/runtime/html5/file/FileReader" +], function(extensions, FileReader) { + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/html4/xhr/XMLHttpRequest", [ + "moxie/runtime/html4/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Url", + "moxie/core/Exceptions", + "moxie/core/utils/Events", + "moxie/file/Blob", + "moxie/xhr/FormData" +], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) { + + function XMLHttpRequest() { + var _status, _response, _iframe; + + function cleanup(cb) { + var target = this, uid, form, inputs, i, hasFile = false; + + if (!_iframe) { + return; + } + + uid = _iframe.id.replace(/_iframe$/, ''); + + form = Dom.get(uid + '_form'); + if (form) { + inputs = form.getElementsByTagName('input'); + i = inputs.length; + + while (i--) { + switch (inputs[i].getAttribute('type')) { + case 'hidden': + inputs[i].parentNode.removeChild(inputs[i]); + break; + case 'file': + hasFile = true; // flag the case for later + break; + } + } + inputs = []; + + if (!hasFile) { // we need to keep the form for sake of possible retries + form.parentNode.removeChild(form); + } + form = null; + } + + // without timeout, request is marked as canceled (in console) + setTimeout(function() { + Events.removeEvent(_iframe, 'load', target.uid); + if (_iframe.parentNode) { // #382 + _iframe.parentNode.removeChild(_iframe); + } + + // check if shim container has any other children, if - not, remove it as well + var shimContainer = target.getRuntime().getShimContainer(); + if (!shimContainer.children.length) { + shimContainer.parentNode.removeChild(shimContainer); + } + + shimContainer = _iframe = null; + cb(); + }, 1); + } + + Basic.extend(this, { + send: function(meta, data) { + var target = this, I = target.getRuntime(), uid, form, input, blob; + + _status = _response = null; + + function createIframe() { + var container = I.getShimContainer() || document.body + , temp = document.createElement('div') + ; + + // IE 6 won't be able to set the name using setAttribute or iframe.name + temp.innerHTML = ''; + _iframe = temp.firstChild; + container.appendChild(_iframe); + + /* _iframe.onreadystatechange = function() { + console.info(_iframe.readyState); + };*/ + + Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8 + var el; + + try { + el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document; + + // try to detect some standard error pages + if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error + _status = el.title.replace(/^(\d+).*$/, '$1'); + } else { + _status = 200; + // get result + _response = Basic.trim(el.body.innerHTML); + + // we need to fire these at least once + target.trigger({ + type: 'progress', + loaded: _response.length, + total: _response.length + }); + + if (blob) { // if we were uploading a file + target.trigger({ + type: 'uploadprogress', + loaded: blob.size || 1025, + total: blob.size || 1025 + }); + } + } + } catch (ex) { + if (Url.hasSameOrigin(meta.url)) { + // if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm + // which obviously results to cross domain error (wtf?) + _status = 404; + } else { + cleanup.call(target, function() { + target.trigger('error'); + }); + return; + } + } + + cleanup.call(target, function() { + target.trigger('load'); + }); + }, target.uid); + } // end createIframe + + // prepare data to be sent and convert if required + if (data instanceof FormData && data.hasBlob()) { + blob = data.getBlob(); + uid = blob.uid; + input = Dom.get(uid); + form = Dom.get(uid + '_form'); + if (!form) { + throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); + } + } else { + uid = Basic.guid('uid_'); + + form = document.createElement('form'); + form.setAttribute('id', uid + '_form'); + form.setAttribute('method', meta.method); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('encoding', 'multipart/form-data'); + form.setAttribute('target', uid + '_iframe'); + + I.getShimContainer().appendChild(form); + } + + if (data instanceof FormData) { + data.each(function(value, name) { + if (value instanceof Blob) { + if (input) { + input.setAttribute('name', name); + } + } else { + var hidden = document.createElement('input'); + + Basic.extend(hidden, { + type : 'hidden', + name : name, + value : value + }); + + // make sure that input[type="file"], if it's there, comes last + if (input) { + form.insertBefore(hidden, input); + } else { + form.appendChild(hidden); + } + } + }); + } + + // set destination url + form.setAttribute("action", meta.url); + + createIframe(); + form.submit(); + target.trigger('loadstart'); + }, + + getStatus: function() { + return _status; + }, + + getResponse: function(responseType) { + if ('json' === responseType) { + // strip off
          ..
          tags that might be enclosing the response + if (Basic.typeOf(_response) === 'string' && !!window.JSON) { + try { + return JSON.parse(_response.replace(/^\s*]*>/, '').replace(/<\/pre>\s*$/, '')); + } catch (ex) { + return null; + } + } + } else if ('document' === responseType) { + + } + return _response; + }, + + abort: function() { + var target = this; + + if (_iframe && _iframe.contentWindow) { + if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome + _iframe.contentWindow.stop(); + } else if (_iframe.contentWindow.document.execCommand) { // IE + _iframe.contentWindow.document.execCommand('Stop'); + } else { + _iframe.src = "about:blank"; + } + } + + cleanup.call(this, function() { + // target.dispatchEvent('readystatechange'); + target.dispatchEvent('abort'); + }); + } + }); + } + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/html4/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/image/Image +@private +*/ +define("moxie/runtime/html4/image/Image", [ + "moxie/runtime/html4/Runtime", + "moxie/runtime/html5/image/Image" +], function(extensions, Image) { + return (extensions.Image = Image); +}); + +expose(["moxie/core/utils/Basic","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/file/File","moxie/file/FileInput","moxie/file/FileDrop","moxie/runtime/RuntimeTarget","moxie/file/FileReader","moxie/core/utils/Url","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"]); +})(this);/** + * o.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global moxie:true */ + +/** +Globally exposed namespace with the most frequently used public classes and handy methods. + +@class o +@static +@private +*/ +(function(exports) { + "use strict"; + + var o = {}, inArray = exports.moxie.core.utils.Basic.inArray; + + // directly add some public classes + // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included) + (function addAlias(ns) { + var name, itemType; + for (name in ns) { + itemType = typeof(ns[name]); + if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) { + addAlias(ns[name]); + } else if (itemType === 'function') { + o[name] = ns[name]; + } + } + })(exports.moxie); + + // add some manually + o.Env = exports.moxie.core.utils.Env; + o.Mime = exports.moxie.core.utils.Mime; + o.Exceptions = exports.moxie.core.Exceptions; + + // expose globally + exports.mOxie = o; + if (!exports.o) { + exports.o = o; + } + return o; +})(this); diff --git a/lib/plupload-2.1.2/js/moxie.min.js b/lib/plupload-2.1.2/js/moxie.min.js new file mode 100644 index 0000000..8d94a0d --- /dev/null +++ b/lib/plupload-2.1.2/js/moxie.min.js @@ -0,0 +1,15 @@ +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.2.1 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2014-05-14 + */ +!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r0&&n(o,function(n,o){n!==r&&(e(i[o])===e(n)&&~a(e(n),["array","object"])?t(i[o],n):i[o]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++rn;n++)if(t[n]===e)return n}return-1},s=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===a(t[r],n)&&i.push(t[r]);return i.length?i:!1},u=function(e,t){var i=[];return n(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},c=function(e){var t,n=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),d=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},f=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),e};return{guid:l,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inParallel:o,inArray:a,arrayDiff:s,arrayIntersect:u,toArray:c,trim:d,parseSizeStr:f}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),i(l,[u,c],function(e,t){var n="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;ni;i++)if(e[i]!=t[i]){if(e[i]=u(e[i]),t[i]=u(t[i]),e[i]t[i]){o=1;break}}if(!n)return o;switch(n){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",n="?",i="function",r="undefined",o="object",a="major",s="model",u="name",c="type",l="vendor",d="version",f="architecture",h="console",p="mobile",m="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},v={rgx:function(){for(var t,n=0,a,s,u,c,l,d,f=arguments;n0?2==c.length?t[c[0]]=typeof c[1]==i?c[1].call(this,d):c[1]:3==c.length?t[c[0]]=typeof c[1]!==i||c[1].exec&&c[1].test?d?d.replace(c[1],c[2]):e:d?c[1].call(this,d,c[2]):e:4==c.length&&(t[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):e):t[c]=d?d:e;break}if(l)break}return t},str:function(t,i){for(var r in i)if(typeof i[r]===o&&i[r].length>0){for(var a=0;a=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),r={can:i,browser:n.browser.name,version:parseFloat(n.browser.major),os:n.os.name,osVersion:n.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return r.OS=r.os,r}),i(f,[d],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){if(!e.className)return!1;var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return n.test(e.className)},i=function(e,t){n(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),i(h,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(p,[h,u],function(e,t){function n(){var n={};t.extend(this,{uid:null,init:function(){this.uid||(this.uid=t.guid("uid_"))},addEventListener:function(e,i,r,o){var a=this,s;return e=t.trim(e),/\s/.test(e)?void t.each(e.split(/\s+/),function(e){a.addEventListener(e,i,r,o)}):(e=e.toLowerCase(),r=parseInt(r,10)||0,s=n[this.uid]&&n[this.uid][e]||[],s.push({fn:i,priority:r,scope:o||this}),n[this.uid]||(n[this.uid]={}),void(n[this.uid][e]=s))},hasEventListener:function(e){return e?!(!n[this.uid]||!n[this.uid][e]):!!n[this.uid]},removeEventListener:function(e,i){e=e.toLowerCase();var r=n[this.uid]&&n[this.uid][e],o;if(r){if(i){for(o=r.length-1;o>=0;o--)if(r[o].fn===i){r.splice(o,1);break}}else r=[];r.length||(delete n[this.uid][e],t.isEmptyObj(n[this.uid])&&delete n[this.uid])}},removeAllEventListeners:function(){n[this.uid]&&delete n[this.uid]},dispatchEvent:function(i){var r,o,a,s,u={},c=!0,l;if("string"!==t.typeOf(i)){if(s=i,"string"!==t.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);i=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==i.indexOf("::")?!function(e){r=e[0],i=e[1]}(i.split("::")):r=this.uid,i=i.toLowerCase(),o=n[r]&&n[r][i]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=i,a.unshift(u);var d=[];t.each(o,function(e){a[0].target=e.scope,d.push(u.async?function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}:function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&t.inSeries(d,function(e){c=!e})}return c},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(e){var n;"array"!==t.typeOf(e)&&(e=[e]);for(var i=0;i>16&255,o=d>>8&255,a=255&d,m[h++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(f>18&63,u=d>>12&63,c=d>>6&63,l=63&d,m[h++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(fa;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(A,[h,u,y],function(e,t,n){function i(){var e,i=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):i.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(n){t.each(i,function(e){n(e.value,e.name)}),e&&n(e.value,e.name)},destroy:function(){e=null,i=[]}})}return i}),i(S,[u,h,p,m,R,g,x,y,T,A,d,l],function(e,t,n,i,r,o,a,s,u,c,l,d){function f(){this.uid=e.guid("uid_")}function h(){function n(e,t){return y.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?y[e]:v[e]:void(l.can("define_property")?y[e]=t:v[e]=t):void 0}function u(t){function i(){k&&(k.destroy(),k=null),s.dispatchEvent("loadend"),s=null}function r(r){k.bind("LoadStart",function(e){n("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),I&&s.upload.dispatchEvent(e)}),k.bind("Progress",function(e){n("readyState")!==h.LOADING&&(n("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),k.bind("UploadProgress",function(e){I&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),k.bind("Load",function(t){n("readyState",h.DONE),n("status",Number(r.exec.call(k,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(k,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),U=r.exec.call(k,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(I&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(N=!0,s.dispatchEvent("error")),i()}),k.bind("Abort",function(e){s.dispatchEvent(e),i()}),k.bind("Error",function(e){N=!0,n("readyState",h.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(k,"XMLHttpRequest","send",{url:E,method:_,async:w,user:b,password:R,headers:x,mimeType:A,encoding:T,responseType:s.responseType,withCredentials:s.withCredentials,options:P},t)}var s=this;M=(new Date).getTime(),k=new a,"string"==typeof P.required_caps&&(P.required_caps=o.parseCaps(P.required_caps)),P.required_caps=e.extend({},P.required_caps,{return_response_type:s.responseType}),t instanceof c&&(P.required_caps.send_multipart=!0),L||(P.required_caps.do_cors=!0),P.ruid?r(k.connectRuntime(P)):(k.bind("RuntimeInit",function(e,t){r(t)}),k.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),k.connectRuntime(P))}function g(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),M=C=null}var v=this,y={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},w=!0,E,_,x={},b,R,T=null,A=null,S=!1,O=!1,I=!1,D=!1,N=!1,L=!1,M,C,F=null,H=null,P={},k,U="",B;e.extend(this,y,{uid:e.guid("uid_"),upload:new f,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(_=o.toUpperCase()),~e.inArray(_,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),L=r.hasSameOrigin(l),E=r.resolveUrl(a),(u||c)&&!L)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(b=u||l.user,R=c||l.pass,w=s||!0,w===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);S=!w,O=!1,x={},g.call(this),n("readyState",h.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(n("readyState")!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(x[r]?x[r]+=", "+o:x[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),N||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(B||(B={},e.each(U.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),B[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),B.hasOwnProperty(t))?B[t].header+": "+B[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!d.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);F=i,H=o},send:function(n,r){if(P="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.convertEventPropsToHandlers(m),this.upload.convertEventPropsToHandlers(m),this.readyState!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)P.ruid=n.ruid,A=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();P.ruid=o.ruid,A=o.type||"application/octet-stream"}}else"string"==typeof n&&(T="UTF-8",A="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=P.required_caps&&P.required_caps.send_browser_cookies&&!L),I=!S&&this.upload.hasEventListener(),N=!1,D=!n,S||(O=!0),u.call(this,n)},abort:function(){if(N=!0,S=!1,~e.inArray(n("readyState"),[h.UNSENT,h.OPENED,h.DONE]))n("readyState",h.UNSENT);else{if(n("readyState",h.DONE),O=!1,!k)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);k.getRuntime().exec.call(k,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){k&&("function"===e.typeOf(k.destroy)&&k.destroy(),k=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var p={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};f.prototype=n.instance;var m=["loadstart","progress","abort","error","load","timeout","loadend"],g=1,v=2;return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=n.instance,h}),i(O,[u,m,v,p],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[u,f,h,T,S,g,v,O,d,p,y,w,m],function(e,t,n,i,r,o,a,s,u,c,l,d,f){function h(){function i(e){e||(e=this.getRuntime().exec.call(this,"Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var i=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);m.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===i)/^data:[^;]*;base64,/.test(t)?c.call(this,new l(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),n&&"string"==typeof n.required_caps&&(n.required_caps=o.parseCaps(n.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){i.call(this)},999),this.convertEventPropsToHandlers(p),c.apply(this,arguments)},downsize:function(t){var i={width:this.width,height:this.height,crop:!1,preserveHeaders:!0};t="object"==typeof t?e.extend(i,t):e.extend(i,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);this.getRuntime().exec.call(this,"Image","downsize",t.width,t.height,t.crop,t.preserveHeaders)}catch(r){this.trigger("error",r.code)}},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return f.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i){function r(){if(u.can("create_canvas")){var t=a.getAsCanvas();if(t)return i.appendChild(t),t=null,a.destroy(),void o.trigger("embedded")}var r=a.getAsDataURL(c,l);if(!r)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",r.length))i.innerHTML='',a.destroy(),o.trigger("embedded");else{var d=new s;d.bind("TransportingComplete",function(){v=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){e.extend(v.getShimContainer().style,{top:"0px",left:"0px",width:a.width+"px",height:a.height+"px"}),v=null},999),v.exec.call(o,"ImageView","display",this.result.uid,m,g),a.destroy()}),d.transport(f.atob(r.substring(r.indexOf("base64,")+7)),c,e.extend({},p,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i}))}}var o=this,a,c,l,d,p=arguments[1]||{},m=this.width,g=this.height,v;try{if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);if(c=p.type||this.type||"image/jpeg",l=p.quality||90,d="undefined"!==e.typeOf(p.crop)?p.crop:!1,p.width)m=p.width,g=p.height||m;else{var y=t.getSize(i);y.w&&y.h&&(m=y.w,g=y.h)}return a=new h,a.bind("Resize",function(){r.call(o)}),a.bind("Load",function(){a.downsize(m,g,d,!1)}),a.clone(this,!1),a}catch(w){this.trigger("error",w.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var p=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=6500,h.MAX_RESIZE_HEIGHT=6500,h.prototype=c.instance,h}),i(D,[u,h,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue,c=e.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return r.can("access_binary")&&!!a.Image},display_media:s(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.version>9)}()),filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),return_response_headers:u,return_response_type:function(e){return"json"===e&&window.JSON?!0:i.can("return_response_type",e)},return_status_code:u,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return r.can("access_binary")&&i.can("create_canvas")},select_file:function(){return i.can("use_fileinput")&&window.File},select_folder:function(){return r.can("select_file")&&"Chrome"===i.browser&&i.version>=21},select_multiple:function(){return!(!r.can("select_file")||"Safari"===i.browser&&"Windows"===i.os||"iOS"===i.os&&i.verComp(i.osVersion,"7.0.4","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||r.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return r.can("slice_blob")&&r.can("send_multipart")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u},arguments[2]);n.call(this,t,arguments[1]||o,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i(N,[D,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(L,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(M,[D,u,f,L,l,d],function(e,t,n,i,r,o){function a(){var e=[],a;t.extend(this,{init:function(s){var u=this,c=u.getRuntime(),l,d,f,h,p,m;a=s,e=[],f=a.accept.mimes||r.extList2mimes(a.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='",l=n.get(c.uid),t.extend(l.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=n.get(a.browse_button),c.can("summon_file_dialog")&&("static"===n.getStyle(h,"position")&&(h.style.position="relative"),p=parseInt(n.getStyle(h,"z-index"),10)||1,h.style.zIndex=p,d.style.zIndex=p-1,i.addEvent(h,"click",function(e){var t=n.get(c.uid);t&&!t.disabled&&t.click(),e.preventDefault()},u.uid)),m=c.can("summon_file_dialog")?h:d,i.addEvent(m,"mouseover",function(){u.trigger("mouseenter")},u.uid),i.addEvent(m,"mouseout",function(){u.trigger("mouseleave")},u.uid),i.addEvent(m,"mousedown",function(){u.trigger("mousedown")},u.uid),i.addEvent(n.get(a.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function g(){if(e=[],a.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),"IE"!==o.browser&&"IEMobile"!==o.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=g}u.trigger("change")},u.trigger({type:"ready",async:!0}),d=null},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShim(),o=t.getShimContainer();i.removeAllEvents(o,this.uid),i.removeAllEvents(a&&n.get(a.container),this.uid),i.removeAllEvents(a&&n.get(a.browse_button),this.uid),o&&(o.innerHTML=""),r.removeInstance(this.uid),e=a=o=r=null}})}return e.FileInput=a}),i(C,[D,u,f,L,l],function(e,t,n,i,r){function o(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var n=t.toArray(e.dataTransfer.types||[]);return-1!==t.inArray("Files",n)||-1!==t.inArray("public.file-url",n)||-1!==t.inArray("application/x-moz-file",n)}function o(e){for(var n=[],i=0;i=4&&u.version<7,f="Android Browser"===u.browser,m=!1;if(p=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),h=c(),h.open(n.method,n.url,n.async,n.user,n.password),r instanceof o)r.isDetached()&&(m=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),m=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,n,r);if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}h.upload?(n.withCredentials&&(h.withCredentials=!0),h.addEventListener("load",function(e){s.trigger(e)}),h.addEventListener("error",function(e){s.trigger(e)}),h.addEventListener("progress",function(e){s.trigger(e)}),h.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):h.onreadystatechange=function v(){switch(h.readyState){case 1:break;case 2:break;case 3:var e,t;try{i.hasSameOrigin(n.url)&&(e=h.getResponseHeader("Content-Length")||0),h.responseText&&(t=h.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:h.onreadystatechange=function(){},s.trigger(0===h.status?"error":"load")}},t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){h.setRequestHeader(t,e)}),""!==n.responseType&&"responseType"in h&&(h.responseType="json"!==n.responseType||u.can("return_response_type","json")?n.responseType:"text"),m?h.sendAsBinary?h.sendAsBinary(r):!function(){for(var e=new Uint8Array(r.length),t=0;ta;a++)i|=o.charCodeAt(e+a)<s;s++)o+=String.fromCharCode(t>>Math.abs(a+8*s)&255);n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:void(r=e)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):void i(n,r,4)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(k,[P],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;o<=n.length;)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(U,[u,P],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,h,p,m=[],g={};for(r=0;i>r;r++)if(h=f=e+12*r+2,s=n[a.SHORT(h)],s!==t){switch(u=a.SHORT(h+=2),d=a.LONG(h+=2),h+=4,m=[],u){case 1:case 7:for(d>4&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(h+o);break;case 2:d>4&&(h=a.LONG(h)+c.tiffHeader),g[s]=a.STRING(h,d-1);continue;case 3:for(d>2&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(h+2*o);break;case 4:for(d>1&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(h+4*o);break;case 5:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.LONG(h+4*o)/a.LONG(h+4*o+4);break;case 9:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o);break;case 10:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o)/a.SLONG(h+4*o+4);break;default:continue}p=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof p?l[s][p]:p}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12*f+2,a.SHORT(o)==t){u=o+8;break}return u?(a.LONG(u,n),!0):!1}var a,s,u,c={},l;return a=new n,s={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},{init:function(e){return c={tiffHeader:10},e!==t&&e.length?(a.init(e),65505===a.SHORT(0)&&"EXIF\x00"===a.STRING(4,5).toUpperCase()?r():!1):!1 +},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return e+=5,{height:c.SHORT(e),width:c.SHORT(e+=2)};n=c.SHORT(e+=2),e+=n-2}return null}function s(){d&&l&&c&&(d.purge(),l.purge(),c.init(null),u=f=l=d=c=null)}var u,c,l,d,f,h;if(u=o,c=new i,c.init(u),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o),d=new r,h=!!d.init(l.get("app1")[0]),f=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length,width:f&&f.width||0,height:f&&f.height||0,setExif:function(t,n){return h?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),void l.set("app1",d.getBinary())):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):u=l.restore(u)},stripHeaders:function(e){return l.strip(e)},purge:function(){s.call(this)}}),h&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS()})}return o}),i(z,[h,u,P],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;ng;){for(var v=g+f>a?a-g:f,y=0;o>y;){var w=y+f>o?o-y:f;p.clearRect(0,0,f,f),p.drawImage(e,-y,-g);var E=y*s/o+c<<0,_=Math.ceil(w*s/o),x=g*u/a/m+l<<0,b=Math.ceil(v*u/a/m);d.drawImage(h,0,0,w,v,E,x,_,b),y+=f}g+=f}h=p=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[D,u,h,m,w,G,q,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!E&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return E||y}function c(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function l(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function d(e){var t=this;y=new Image,y.onerror=function(){g.call(this),t.trigger("error",n.ImageError.WRONG_FORMAT)},y.onload=function(){t.trigger("load")},y.src=/^data:[^;]*;base64,/.test(e)?e:l(e,x.type)}function f(e,t){var i=this,r;return window.FileReader?(r=new FileReader,r.onload=function(){t(this.result)},r.onerror=function(){i.trigger("error",n.ImageError.WRONG_FORMAT)},r.readAsDataURL(e),void 0):t(e.getAsDataURL())}function h(n,i,r,o){var a=this,s,u,c=0,l=0,d,f,h,g;if(R=o,g=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(g,[5,6,7,8])){var v=n;n=i,i=v}return d=e(),r?(n=Math.min(n,d.width),i=Math.min(i,d.height),s=Math.max(n/d.width,i/d.height)):s=Math.min(n/d.width,i/d.height),s>1&&!r&&o?void this.trigger("Resize"):(E||(E=document.createElement("canvas")),f=Math.round(d.width*s),h=Math.round(d.height*s),r?(E.width=n,E.height=i,f>n&&(c=Math.round((f-n)/2)),h>i&&(l=Math.round((h-i)/2))):(E.width=f,E.height=h),R||m(E.width,E.height,g),p.call(this,d,E,-c,-l,f,h),this.width=E.width,this.height=E.height,b=!0,void a.trigger("Resize"))}function p(e,t,n,i,r,o){if("iOS"===u.OS)a.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var s=t.getContext("2d");s.drawImage(e,n,i,r,o)}}function m(e,t,n){switch(n){case 5:case 6:case 7:case 8:E.width=t,E.height=e;break;default:E.width=e,E.height=t}var i=E.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function g(){w&&(w.purge(),w=null),_=y=E=x=null,b=!1}var v=this,y,w,E,_,x,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return x=e,e.isDetached()?(_=e.getSource(),void d.call(this,_)):void f.call(this,e.getSource(),function(e){r&&(_=c(e)),d.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,x=new r(null,{name:e.name,size:e.size,type:e.type}),d.call(this,t?_=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!w&&_&&t.can("access_image_binary")&&(w=new o(_)),n={width:e().width||0,height:e().height||0,type:x.type||s.getFileMime(x.name),size:_&&_.length||x.size||0,name:x.name||"",meta:w&&w.meta||this.meta||{}}},downsize:function(){h.apply(this,arguments)},getAsCanvas:function(){return E&&(E.id=this.uid+"_canvas"),E},getAsBlob:function(e,t){return e!==this.type&&h.call(this,this.width,this.height,!1),new r(null,{name:x.name||"",type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return y.src;if("image/jpeg"!==e)return E.toDataURL("image/png");try{return E.toDataURL("image/jpeg",t/100)}catch(n){return E.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return _||(_=c(v.getAsDataURL(e,t))),_;if("image/jpeg"!==e)_=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=E.toDataURL("image/jpeg",t/100)}catch(i){n=E.toDataURL("image/jpeg")}_=c(n),w&&(_=w.stripHeaders(_),R&&(w.meta&&w.meta.exif&&w.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),_=w.writeHeaders(_)),w.purge(),w=null)}return b=!1,_},destroy:function(){v=null,g.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(j,[u,d,f,h,g],function(e,t,n,i,r){function o(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(n){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function a(a){var c=this,l;a=e.extend({swf_url:t.swf_url},a),r.call(this,a,s,{access_binary:function(e){return e&&"browser"===c.mode},access_image_binary:function(e){return e&&"browser"===c.mode},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===c.mode},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===c.mode},return_status_code:function(t){return"browser"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===c.mode},send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"browser"===c.mode},send_multipart:r.capTrue,slice_blob:function(e){return e&&"browser"===c.mode},stream_upload:function(e){return e&&"browser"===c.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===c.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),o()<10&&(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='',"IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=n,r=o=null):o.innerHTML=n,l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="flash",u={};return r.addConstructor(s,a),u}),i(V,[j,y],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i(W,[j],function(e){var t={init:function(e){this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=t}),i(Y,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i="",r={read:function(e,t){var r=this,o=r.getRuntime();return"readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"),r.bind("Progress",function(t,r){r&&(i+=n(r,e))}),o.shimExec.call(this,"FileReader","readAsBase64",t.uid)},getResult:function(){return i},destroy:function(){i=null}};return e.FileReader=r}),i($,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i,r=this.getRuntime();return(i=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(J,[j,u,y,w,T,A,O],function(e,t,n,i,r,o,a){var s={send:function(e,i){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){t(this.result)}),n.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var f=i.getBlob();f.isDetached()?u(f,function(e){f.destroy(),s(d,e)}):s(d,f)}else i=null,r()}else i instanceof n?i.isDetached()?u(i,function(e){i.destroy(),i=e.uid,r()}):(i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;try{if(n=new r,~t.inArray(e,["","text"]))return n.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(n.readAsText(o))}finally{o.destroy()}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(Z,[j,y],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(K,[j,u,O,y,T],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(Q,[u,d,f,h,g],function(e,t,n,i,r){function o(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do a=parseInt(o[u],10),s=parseInt(r[u],10),u++;while(u=a&&!isNaN(a)&&(t=!0)}}}catch(d){t=!1}return t}function a(a){var c=this,l;a=e.extend({xap_url:t.xap_url},a),r.call(this,a,s,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"client"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),o("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='',l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="silverlight",u={};return r.addConstructor(s,a),u}),i(et,[Q,u,V],function(e,t,n){return e.Blob=t.extend({},n)}),i(tt,[Q],function(e){var t={init:function(e){function t(e){for(var t="",n=0;no;o++)n=t.keys[o],s=t[n],s&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),i.meta[e][n]=s)}),i.width=parseInt(r.width,10),i.height=parseInt(r.height,10),i.size=parseInt(r.size,10),i.type=r.type,i.name=r.name,i}})}),i(ut,[u,h,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue;n.call(this,t,o,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),resize_image:function(){return a.Image&&r.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return i.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return r.can("select_file")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i(ct,[ut,u,f,L,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,h,p,m,g;g=t.guid("uid_"),d=l.getShimContainer(),a&&(h=n.get(a+"_form"),h&&t.extend(h.style,{top:"100%"})),p=document.createElement("form"),p.setAttribute("id",g+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),t.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name",c.name||"Filedata"),m.setAttribute("accept",u.join(",")),t.extend(m.style,{fontSize:"999px",opacity:0}),p.appendChild(m),d.appendChild(p),t.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.onchange=function(){var t;this.value&&(t=this.files?this.files[0]:{name:this.value},s=[t],this.onchange=function(){},e.call(r),r.bind("change",function i(){var e=n.get(g),t=n.get(g+"_form"),o;r.unbind("change",i),r.files.length&&e&&t&&(o=r.files[0],e.setAttribute("id",o.uid),t.setAttribute("id",o.uid+"_form"),t.setAttribute("target",o.uid+"_iframe")),e=t=null},998),m=p=null,r.trigger("change"))},l.can("summon_file_dialog")&&(f=n.get(c.browse_button),i.removeEvent(f,"click",r.uid),i.addEvent(f,"click",function(e){m&&!m.disabled&&m.click(),e.preventDefault()},r.uid)),a=g,d=h=f=null}var a,s=[],u=[],c;t.extend(this,{init:function(t){var o=this,a=o.getRuntime(),s;c=t,u=t.accept.mimes||r.extList2mimes(t.accept,a.can("filter_by_extension")),s=a.getShimContainer(),function(){var e,r,u;e=n.get(t.browse_button),a.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),r=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=r,s.style.zIndex=r-1),u=a.can("summon_file_dialog")?e:s,i.addEvent(u,"mouseover",function(){o.trigger("mouseenter")},o.uid),i.addEvent(u,"mouseout",function(){o.trigger("mouseleave")},o.uid),i.addEvent(u,"mousedown",function(){o.trigger("mousedown")},o.uid),i.addEvent(n.get(t.container),"mouseup",function(){o.trigger("mouseup")},o.uid),e=null}(),e.call(this),s=null,o.trigger({type:"ready",async:!0})},getFiles:function(){return s},disable:function(e){var t;(t=n.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),r=e.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(c&&n.get(c.container),this.uid),i.removeAllEvents(c&&n.get(c.browse_button),this.uid),r&&(r.innerHTML=""),t.removeInstance(this.uid),a=s=u=c=r=t=null}})}return e.FileInput=a}),i(lt,[ut,F],function(e,t){return e.FileReader=t}),i(dt,[ut,u,f,R,h,L,y,A],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t=this,i,r,a,s,u=!1;if(l){if(i=l.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(l,"load",t.uid),l.parentNode&&l.parentNode.removeChild(l);var n=t.getRuntime().getShimContainer();n.children.length||n.parentNode.removeChild(n),n=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,f){function h(){var n=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),p.trigger({type:"progress",loaded:c.length,total:c.length}),w&&p.trigger({type:"uploadprogress",loaded:w.size||1025,total:w.size||1025}))}catch(r){if(!i.hasSameOrigin(d.url))return void e.call(p,function(){p.trigger("error")});u=404}e.call(p,function(){p.trigger("load")})},p.uid)}var p=this,m=p.getRuntime(),g,v,y,w;if(u=c=null,f instanceof s&&f.hasBlob()){if(w=f.getBlob(),g=w.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),y?v.insertBefore(i,y):v.appendChild(i)}}),v.setAttribute("action",d.url),h(),v.submit(),p.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i(ft,[ut,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,h,p,m,g,v,y,w,E,_,x,b,R,T,A,S,O,I,L])}(this);;(function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;return function r(e){var i,s;for(i in e)s=typeof e[i],s==="object"&&!~n(i,["Exceptions","Env","Mime"])?r(e[i]):s==="function"&&(t[i]=e[i])}(e.moxie),t.Env=e.moxie.core.utils.Env,t.Mime=e.moxie.core.utils.Mime,t.Exceptions=e.moxie.core.Exceptions,e.mOxie=t,e.o||(e.o=t),t})(this); \ No newline at end of file diff --git a/lib/plupload-2.1.2/js/plupload.dev.js b/lib/plupload-2.1.2/js/plupload.dev.js new file mode 100644 index 0000000..732231e --- /dev/null +++ b/lib/plupload-2.1.2/js/plupload.dev.js @@ -0,0 +1,2315 @@ +/** + * Plupload - multi-runtime File Uploader + * v2.1.2 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2014-05-14 + */ +/** + * Plupload.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global mOxie:true */ + +;(function(window, o, undef) { + +var delay = window.setTimeout +, fileFilters = {} +; + +// convert plupload features to caps acceptable by mOxie +function normalizeCaps(settings) { + var features = settings.required_features, caps = {}; + + function resolve(feature, value, strict) { + // Feature notation is deprecated, use caps (this thing here is required for backward compatibility) + var map = { + chunks: 'slice_blob', + jpgresize: 'send_binary_string', + pngresize: 'send_binary_string', + progress: 'report_upload_progress', + multi_selection: 'select_multiple', + dragdrop: 'drag_and_drop', + drop_element: 'drag_and_drop', + headers: 'send_custom_headers', + urlstream_upload: 'send_binary_string', + canSendBinary: 'send_binary', + triggerDialog: 'summon_file_dialog' + }; + + if (map[feature]) { + caps[map[feature]] = value; + } else if (!strict) { + caps[feature] = value; + } + } + + if (typeof(features) === 'string') { + plupload.each(features.split(/\s*,\s*/), function(feature) { + resolve(feature, true); + }); + } else if (typeof(features) === 'object') { + plupload.each(features, function(value, feature) { + resolve(feature, value); + }); + } else if (features === true) { + // check settings for required features + if (settings.chunk_size > 0) { + caps.slice_blob = true; + } + + if (settings.resize.enabled || !settings.multipart) { + caps.send_binary_string = true; + } + + plupload.each(settings, function(value, feature) { + resolve(feature, !!value, true); // strict check + }); + } + + return caps; +} + +/** + * @module plupload + * @static + */ +var plupload = { + /** + * Plupload version will be replaced on build. + * + * @property VERSION + * @for Plupload + * @static + * @final + */ + VERSION : '2.1.2', + + /** + * Inital state of the queue and also the state ones it's finished all it's uploads. + * + * @property STOPPED + * @static + * @final + */ + STOPPED : 1, + + /** + * Upload process is running + * + * @property STARTED + * @static + * @final + */ + STARTED : 2, + + /** + * File is queued for upload + * + * @property QUEUED + * @static + * @final + */ + QUEUED : 1, + + /** + * File is being uploaded + * + * @property UPLOADING + * @static + * @final + */ + UPLOADING : 2, + + /** + * File has failed to be uploaded + * + * @property FAILED + * @static + * @final + */ + FAILED : 4, + + /** + * File has been uploaded successfully + * + * @property DONE + * @static + * @final + */ + DONE : 5, + + // Error constants used by the Error event + + /** + * Generic error for example if an exception is thrown inside Silverlight. + * + * @property GENERIC_ERROR + * @static + * @final + */ + GENERIC_ERROR : -100, + + /** + * HTTP transport error. For example if the server produces a HTTP status other than 200. + * + * @property HTTP_ERROR + * @static + * @final + */ + HTTP_ERROR : -200, + + /** + * Generic I/O error. For example if it wasn't possible to open the file stream on local machine. + * + * @property IO_ERROR + * @static + * @final + */ + IO_ERROR : -300, + + /** + * @property SECURITY_ERROR + * @static + * @final + */ + SECURITY_ERROR : -400, + + /** + * Initialization error. Will be triggered if no runtime was initialized. + * + * @property INIT_ERROR + * @static + * @final + */ + INIT_ERROR : -500, + + /** + * File size error. If the user selects a file that is too large it will be blocked and an error of this type will be triggered. + * + * @property FILE_SIZE_ERROR + * @static + * @final + */ + FILE_SIZE_ERROR : -600, + + /** + * File extension error. If the user selects a file that isn't valid according to the filters setting. + * + * @property FILE_EXTENSION_ERROR + * @static + * @final + */ + FILE_EXTENSION_ERROR : -601, + + /** + * Duplicate file error. If prevent_duplicates is set to true and user selects the same file again. + * + * @property FILE_DUPLICATE_ERROR + * @static + * @final + */ + FILE_DUPLICATE_ERROR : -602, + + /** + * Runtime will try to detect if image is proper one. Otherwise will throw this error. + * + * @property IMAGE_FORMAT_ERROR + * @static + * @final + */ + IMAGE_FORMAT_ERROR : -700, + + /** + * While working on files runtime may run out of memory and will throw this error. + * + * @since 2.1.2 + * @property MEMORY_ERROR + * @static + * @final + */ + MEMORY_ERROR : -701, + + /** + * Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error. + * + * @property IMAGE_DIMENSIONS_ERROR + * @static + * @final + */ + IMAGE_DIMENSIONS_ERROR : -702, + + /** + * Mime type lookup table. + * + * @property mimeTypes + * @type Object + * @final + */ + mimeTypes : o.mimes, + + /** + * In some cases sniffing is the only way around :( + */ + ua: o.ua, + + /** + * Gets the true type of the built-in object (better version of typeof). + * @credits Angus Croll (http://javascriptweblog.wordpress.com/) + * + * @method typeOf + * @static + * @param {Object} o Object to check. + * @return {String} Object [[Class]] + */ + typeOf: o.typeOf, + + /** + * Extends the specified object with another object. + * + * @method extend + * @static + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + extend : o.extend, + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an ansteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property + * to an user unique key. + * + * @method guid + * @static + * @return {String} Virtually unique id. + */ + guid : o.guid, + + /** + * Get array of DOM Elements by their ids. + * + * @method get + * @for Utils + * @param {String} id Identifier of the DOM Element + * @return {Array} + */ + get : function get(ids) { + var els = [], el; + + if (o.typeOf(ids) !== 'array') { + ids = [ids]; + } + + var i = ids.length; + while (i--) { + el = o.get(ids[i]); + if (el) { + els.push(el); + } + } + + return els.length ? els : null; + }, + + /** + * Executes the callback function for each item in array/object. If you return false in the + * callback it will break the loop. + * + * @method each + * @static + * @param {Object} obj Object to iterate. + * @param {function} callback Callback function to execute for each item. + */ + each : o.each, + + /** + * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + * + * @method getPos + * @static + * @param {Element} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + getPos : o.getPos, + + /** + * Returns the size of the specified node in pixels. + * + * @method getSize + * @static + * @param {Node} node Node to get the size of. + * @return {Object} Object with a w and h property. + */ + getSize : o.getSize, + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @static + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + xmlEncode : function(str) { + var xmlEncodeChars = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'}, xmlEncodeRegExp = /[<>&\"\']/g; + + return str ? ('' + str).replace(xmlEncodeRegExp, function(chr) { + return xmlEncodeChars[chr] ? '&' + xmlEncodeChars[chr] + ';' : chr; + }) : str; + }, + + /** + * Forces anything into an array. + * + * @method toArray + * @static + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + toArray : o.toArray, + + /** + * Find an element in array and return it's index if present, otherwise return -1. + * + * @method inArray + * @static + * @param {mixed} needle Element to find + * @param {Array} array + * @return {Int} Index of the element, or -1 if not found + */ + inArray : o.inArray, + + /** + * Extends the language pack object with new items. + * + * @method addI18n + * @static + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + addI18n : o.addI18n, + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @method translate + * @static + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + translate : o.translate, + + /** + * Checks if object is empty. + * + * @method isEmptyObj + * @static + * @param {Object} obj Object to check. + * @return {Boolean} + */ + isEmptyObj : o.isEmptyObj, + + /** + * Checks if specified DOM element has specified class. + * + * @method hasClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + hasClass : o.hasClass, + + /** + * Adds specified className to specified DOM element. + * + * @method addClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + addClass : o.addClass, + + /** + * Removes specified className from specified DOM element. + * + * @method removeClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + removeClass : o.removeClass, + + /** + * Returns a given computed style of a DOM element. + * + * @method getStyle + * @static + * @param {Object} obj DOM element like object. + * @param {String} name Style you want to get from the DOM element + */ + getStyle : o.getStyle, + + /** + * Adds an event handler to the specified object and store reference to the handler + * in objects internal Plupload registry (@see removeEvent). + * + * @method addEvent + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Name to add event listener to. + * @param {Function} callback Function to call when event occurs. + * @param {String} (optional) key that might be used to add specifity to the event record. + */ + addEvent : o.addEvent, + + /** + * Remove event handler from the specified object. If third argument (callback) + * is not specified remove all events with the specified name. + * + * @method removeEvent + * @static + * @param {Object} obj DOM element to remove event listener(s) from. + * @param {String} name Name of event listener to remove. + * @param {Function|String} (optional) might be a callback or unique key to match. + */ + removeEvent: o.removeEvent, + + /** + * Remove all kind of events from the specified object + * + * @method removeAllEvents + * @static + * @param {Object} obj DOM element to remove event listeners from. + * @param {String} (optional) unique key to match, when removing events. + */ + removeAllEvents: o.removeAllEvents, + + /** + * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @static + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + cleanName : function(name) { + var i, lookup; + + // Replace diacritics + lookup = [ + /[\300-\306]/g, 'A', /[\340-\346]/g, 'a', + /\307/g, 'C', /\347/g, 'c', + /[\310-\313]/g, 'E', /[\350-\353]/g, 'e', + /[\314-\317]/g, 'I', /[\354-\357]/g, 'i', + /\321/g, 'N', /\361/g, 'n', + /[\322-\330]/g, 'O', /[\362-\370]/g, 'o', + /[\331-\334]/g, 'U', /[\371-\374]/g, 'u' + ]; + + for (i = 0; i < lookup.length; i += 2) { + name = name.replace(lookup[i], lookup[i + 1]); + } + + // Replace whitespace + name = name.replace(/\s+/g, '_'); + + // Remove anything else + name = name.replace(/[^a-z0-9_\-\.]+/gi, ''); + + return name; + }, + + /** + * Builds a full url out of a base URL and an object with items to append as query string items. + * + * @method buildUrl + * @static + * @param {String} url Base URL to append query string items to. + * @param {Object} items Name/value object to serialize as a querystring. + * @return {String} String with url + serialized query string items. + */ + buildUrl : function(url, items) { + var query = ''; + + plupload.each(items, function(value, name) { + query += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value); + }); + + if (query) { + url += (url.indexOf('?') > 0 ? '&' : '?') + query; + } + + return url; + }, + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @static + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + formatSize : function(size) { + + if (size === undef || /\D/.test(size)) { + return plupload.translate('N/A'); + } + + function round(num, precision) { + return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision); + } + + var boundary = Math.pow(1024, 4); + + // TB + if (size > boundary) { + return round(size / boundary, 1) + " " + plupload.translate('tb'); + } + + // GB + if (size > (boundary/=1024)) { + return round(size / boundary, 1) + " " + plupload.translate('gb'); + } + + // MB + if (size > (boundary/=1024)) { + return round(size / boundary, 1) + " " + plupload.translate('mb'); + } + + // KB + if (size > 1024) { + return Math.round(size / 1024) + " " + plupload.translate('kb'); + } + + return size + " " + plupload.translate('b'); + }, + + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @static + * @param {String|Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + parseSize : o.parseSizeStr, + + + /** + * A way to predict what runtime will be choosen in the current environment with the + * specified settings. + * + * @method predictRuntime + * @static + * @param {Object|String} config Plupload settings to check + * @param {String} [runtimes] Comma-separated list of runtimes to check against + * @return {String} Type of compatible runtime + */ + predictRuntime : function(config, runtimes) { + var up, runtime; + + up = new plupload.Uploader(config); + runtime = o.Runtime.thatCan(up.getOption().required_features, runtimes || config.runtimes); + up.destroy(); + return runtime; + }, + + /** + * Registers a filter that will be executed for each file added to the queue. + * If callback returns false, file will not be added. + * + * Callback receives two arguments: a value for the filter as it was specified in settings.filters + * and a file to be filtered. Callback is executed in the context of uploader instance. + * + * @method addFileFilter + * @static + * @param {String} name Name of the filter by which it can be referenced in settings.filters + * @param {String} cb Callback - the actual routine that every added file must pass + */ + addFileFilter: function(name, cb) { + fileFilters[name] = cb; + } +}; + + +plupload.addFileFilter('mime_types', function(filters, file, cb) { + if (filters.length && !filters.regexp.test(file.name)) { + this.trigger('Error', { + code : plupload.FILE_EXTENSION_ERROR, + message : plupload.translate('File extension error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +plupload.addFileFilter('max_file_size', function(maxSize, file, cb) { + var undef; + + maxSize = plupload.parseSize(maxSize); + + // Invalid file size + if (file.size !== undef && maxSize && file.size > maxSize) { + this.trigger('Error', { + code : plupload.FILE_SIZE_ERROR, + message : plupload.translate('File size error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +plupload.addFileFilter('prevent_duplicates', function(value, file, cb) { + if (value) { + var ii = this.files.length; + while (ii--) { + // Compare by name and size (size might be 0 or undefined, but still equivalent for both) + if (file.name === this.files[ii].name && file.size === this.files[ii].size) { + this.trigger('Error', { + code : plupload.FILE_DUPLICATE_ERROR, + message : plupload.translate('Duplicate file error.'), + file : file + }); + cb(false); + return; + } + } + } + cb(true); +}); + + +/** +@class Uploader +@constructor + +@param {Object} settings For detailed information about each option check documentation. + @param {String|DOMElement} settings.browse_button id of the DOM element or DOM element itself to use as file dialog trigger. + @param {String} settings.url URL of the server-side upload handler. + @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled. + @param {Boolean} [settings.send_chunk_number=true] Whether to send chunks and chunk numbers, or total and offset bytes. + @param {String} [settings.container] id of the DOM element to use as a container for uploader structures. Defaults to document.body. + @param {String|DOMElement} [settings.drop_element] id of the DOM element or DOM element itself to use as a drop zone for Drag-n-Drop. + @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message. + @param {Object} [settings.filters={}] Set of file type filters. + @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR` + @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. + @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. + @param {String} [settings.flash_swf_url] URL of the Flash swf. + @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs. + @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event. + @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message. + @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload. + @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog. + @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess. + @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}` + @param {Number} [settings.resize.width] If image is bigger, it will be resized. + @param {Number} [settings.resize.height] If image is bigger, it will be resized. + @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100). + @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally. + @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. + @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap. + @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files. + @param {Boolean} [settings.send_file_name=true] Whether to send file name as additional argument - 'name' (required for chunked uploads and some other cases where file name cannot be sent via normal ways). +*/ +plupload.Uploader = function(options) { + /** + * Fires when the current RunTime has been initialized. + * + * @event Init + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + * Fires after the init event incase you need to perform actions there. + * + * @event PostInit + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + * Fires when the option is changed in via uploader.setOption(). + * + * @event OptionChanged + * @since 2.1 + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {String} name Name of the option that was changed + * @param {Mixed} value New value for the specified option + * @param {Mixed} oldValue Previous value of the option + */ + + /** + * Fires when the silverlight/flash or other shim needs to move. + * + * @event Refresh + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + * Fires when the overall state is being changed for the upload queue. + * + * @event StateChanged + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + * Fires when browse_button is clicked and browse dialog shows. + * + * @event Browse + * @since 2.1.2 + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + * Fires for every filtered file before it is added to the queue. + * + * @event FileFiltered + * @since 2.1 + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file Another file that has to be added to the queue. + */ + + /** + * Fires when the file queue is changed. In other words when files are added/removed to the files array of the uploader instance. + * + * @event QueueChanged + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + * Fires after files were filtered and added to the queue. + * + * @event FilesAdded + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {Array} files Array of file objects that were added to queue by the user. + */ + + /** + * Fires when file is removed from the queue. + * + * @event FilesRemoved + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {Array} files Array of files that got removed. + */ + + /** + * Fires when just before a file is uploaded. This event enables you to override settings + * on the uploader instance before the file is uploaded. + * + * @event BeforeUpload + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File to be uploaded. + */ + + /** + * Fires when a file is to be uploaded by the runtime. + * + * @event UploadFile + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File to be uploaded. + */ + + /** + * Fires while a file is being uploaded. Use this event to update the current file upload progress. + * + * @event UploadProgress + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File that is currently being uploaded. + */ + + /** + * Fires when file chunk is uploaded. + * + * @event ChunkUploaded + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File that the chunk was uploaded for. + * @param {Object} response Object with response properties. + */ + + /** + * Fires when a file is successfully uploaded. + * + * @event FileUploaded + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {plupload.File} file File that was uploaded. + * @param {Object} response Object with response properties. + */ + + /** + * Fires when all files in a queue are uploaded. + * + * @event UploadComplete + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {Array} files Array of file objects that was added to queue/selected by the user. + */ + + /** + * Fires when a error occurs. + * + * @event Error + * @param {plupload.Uploader} uploader Uploader instance sending the event. + * @param {Object} error Contains code, message and sometimes file and other details. + */ + + /** + * Fires when destroy method is called. + * + * @event Destroy + * @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + var uid = plupload.guid() + , settings + , files = [] + , preferred_caps = {} + , fileInputs = [] + , fileDrops = [] + , startTime + , total + , disabled = false + , xhr + ; + + + // Private methods + function uploadNext() { + var file, count = 0, i; + + if (this.state == plupload.STARTED) { + // Find first QUEUED file + for (i = 0; i < files.length; i++) { + if (!file && files[i].status == plupload.QUEUED) { + file = files[i]; + if (this.trigger("BeforeUpload", file)) { + file.status = plupload.UPLOADING; + this.trigger("UploadFile", file); + } + } else { + count++; + } + } + + // All files are DONE or FAILED + if (count == files.length) { + if (this.state !== plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger("StateChanged"); + } + this.trigger("UploadComplete", files); + } + } + } + + + function calcFile(file) { + file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 100; + calc(); + } + + + function calc() { + var i, file; + + // Reset stats + total.reset(); + + // Check status, size, loaded etc on all files + for (i = 0; i < files.length; i++) { + file = files[i]; + + if (file.size !== undef) { + // We calculate totals based on original file size + total.size += file.origSize; + + // Since we cannot predict file size after resize, we do opposite and + // interpolate loaded amount to match magnitude of total + total.loaded += file.loaded * file.origSize / file.size; + } else { + total.size = undef; + } + + if (file.status == plupload.DONE) { + total.uploaded++; + } else if (file.status == plupload.FAILED) { + total.failed++; + } else { + total.queued++; + } + } + + // If we couldn't calculate a total file size then use the number of files to calc percent + if (total.size === undef) { + total.percent = files.length > 0 ? Math.ceil(total.uploaded / files.length * 100) : 0; + } else { + total.bytesPerSec = Math.ceil(total.loaded / ((+new Date() - startTime || 1) / 1000.0)); + total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0; + } + } + + + function getRUID() { + var ctrl = fileInputs[0] || fileDrops[0]; + if (ctrl) { + return ctrl.getRuntime().uid; + } + return false; + } + + + function runtimeCan(file, cap) { + if (file.ruid) { + var info = o.Runtime.getInfo(file.ruid); + if (info) { + return info.can(cap); + } + } + return false; + } + + + function bindEventListeners() { + this.bind('FilesAdded FilesRemoved', function(up) { + up.trigger('QueueChanged'); + up.refresh(); + }); + + this.bind('CancelUpload', onCancelUpload); + + this.bind('BeforeUpload', onBeforeUpload); + + this.bind('UploadFile', onUploadFile); + + this.bind('UploadProgress', onUploadProgress); + + this.bind('StateChanged', onStateChanged); + + this.bind('QueueChanged', calc); + + this.bind('Error', onError); + + this.bind('FileUploaded', onFileUploaded); + + this.bind('Destroy', onDestroy); + } + + + function initControls(settings, cb) { + var self = this, inited = 0, queue = []; + + // common settings + var options = { + runtime_order: settings.runtimes, + required_caps: settings.required_features, + preferred_caps: preferred_caps, + swf_url: settings.flash_swf_url, + xap_url: settings.silverlight_xap_url + }; + + // add runtime specific options if any + plupload.each(settings.runtimes.split(/\s*,\s*/), function(runtime) { + if (settings[runtime]) { + options[runtime] = settings[runtime]; + } + }); + + // initialize file pickers - there can be many + if (settings.browse_button) { + plupload.each(settings.browse_button, function(el) { + queue.push(function(cb) { + var fileInput = new o.FileInput(plupload.extend({}, options, { + accept: settings.filters.mime_types, + name: settings.file_data_name, + multiple: settings.multi_selection, + container: settings.container, + browse_button: el + })); + + fileInput.onready = function() { + var info = o.Runtime.getInfo(this.ruid); + + // for backward compatibility + o.extend(self.features, { + chunks: info.can('slice_blob'), + multipart: info.can('send_multipart'), + multi_selection: info.can('select_multiple') + }); + + inited++; + fileInputs.push(this); + cb(); + }; + + fileInput.onchange = function() { + self.addFile(this.files); + }; + + fileInput.bind('mouseenter mouseleave mousedown mouseup', function(e) { + if (!disabled) { + if (settings.browse_button_hover) { + if ('mouseenter' === e.type) { + o.addClass(el, settings.browse_button_hover); + } else if ('mouseleave' === e.type) { + o.removeClass(el, settings.browse_button_hover); + } + } + + if (settings.browse_button_active) { + if ('mousedown' === e.type) { + o.addClass(el, settings.browse_button_active); + } else if ('mouseup' === e.type) { + o.removeClass(el, settings.browse_button_active); + } + } + } + }); + + fileInput.bind('mousedown', function() { + self.trigger('Browse'); + }); + + fileInput.bind('error runtimeerror', function() { + fileInput = null; + cb(); + }); + + fileInput.init(); + }); + }); + } + + // initialize drop zones + if (settings.drop_element) { + plupload.each(settings.drop_element, function(el) { + queue.push(function(cb) { + var fileDrop = new o.FileDrop(plupload.extend({}, options, { + drop_zone: el + })); + + fileDrop.onready = function() { + var info = o.Runtime.getInfo(this.ruid); + + self.features.dragdrop = info.can('drag_and_drop'); // for backward compatibility + + inited++; + fileDrops.push(this); + cb(); + }; + + fileDrop.ondrop = function() { + self.addFile(this.files); + }; + + fileDrop.bind('error runtimeerror', function() { + fileDrop = null; + cb(); + }); + + fileDrop.init(); + }); + }); + } + + + o.inSeries(queue, function() { + if (typeof(cb) === 'function') { + cb(inited); + } + }); + } + + + function resizeImage(blob, params, cb) { + var img = new o.Image(); + + try { + img.onload = function() { + // no manipulation required if... + if (params.width > this.width && + params.height > this.height && + params.quality === undef && + params.preserve_headers && + !params.crop + ) { + this.destroy(); + return cb(blob); + } + // otherwise downsize + img.downsize(params.width, params.height, params.crop, params.preserve_headers); + }; + + img.onresize = function() { + cb(this.getAsBlob(blob.type, params.quality)); + this.destroy(); + }; + + img.onerror = function() { + cb(blob); + }; + + img.load(blob); + } catch(ex) { + cb(blob); + } + } + + + function setOption(option, value, init) { + var self = this, reinitRequired = false; + + function _setOption(option, value, init) { + var oldValue = settings[option]; + + switch (option) { + case 'max_file_size': + if (option === 'max_file_size') { + settings.max_file_size = settings.filters.max_file_size = value; + } + break; + + case 'chunk_size': + if (value = plupload.parseSize(value)) { + settings[option] = value; + settings.send_file_name = true; + } + break; + + case 'multipart': + settings[option] = value; + if (!value) { + settings.send_file_name = true; + } + break; + + case 'unique_names': + settings[option] = value; + if (value) { + settings.send_file_name = true; + } + break; + + case 'filters': + // for sake of backward compatibility + if (plupload.typeOf(value) === 'array') { + value = { + mime_types: value + }; + } + + if (init) { + plupload.extend(settings.filters, value); + } else { + settings.filters = value; + } + + // if file format filters are being updated, regenerate the matching expressions + if (value.mime_types) { + settings.filters.mime_types.regexp = (function(filters) { + var extensionsRegExp = []; + + plupload.each(filters, function(filter) { + plupload.each(filter.extensions.split(/,/), function(ext) { + if (/^\s*\*\s*$/.test(ext)) { + extensionsRegExp.push('\\.*'); + } else { + extensionsRegExp.push('\\.' + ext.replace(new RegExp('[' + ('/^$.*+?|()[]{}\\'.replace(/./g, '\\$&')) + ']', 'g'), '\\$&')); + } + }); + }); + + return new RegExp('(' + extensionsRegExp.join('|') + ')$', 'i'); + }(settings.filters.mime_types)); + } + break; + + case 'resize': + if (init) { + plupload.extend(settings.resize, value, { + enabled: true + }); + } else { + settings.resize = value; + } + break; + + case 'prevent_duplicates': + settings.prevent_duplicates = settings.filters.prevent_duplicates = !!value; + break; + + case 'browse_button': + case 'drop_element': + value = plupload.get(value); + + case 'container': + case 'runtimes': + case 'multi_selection': + case 'flash_swf_url': + case 'silverlight_xap_url': + settings[option] = value; + if (!init) { + reinitRequired = true; + } + break; + + default: + settings[option] = value; + } + + if (!init) { + self.trigger('OptionChanged', option, value, oldValue); + } + } + + if (typeof(option) === 'object') { + plupload.each(option, function(value, option) { + _setOption(option, value, init); + }); + } else { + _setOption(option, value, init); + } + + if (init) { + // Normalize the list of required capabilities + settings.required_features = normalizeCaps(plupload.extend({}, settings)); + + // Come up with the list of capabilities that can affect default mode in a multi-mode runtimes + preferred_caps = normalizeCaps(plupload.extend({}, settings, { + required_features: true + })); + } else if (reinitRequired) { + self.trigger('Destroy'); + + initControls.call(self, settings, function(inited) { + if (inited) { + self.runtime = o.Runtime.getInfo(getRUID()).type; + self.trigger('Init', { runtime: self.runtime }); + self.trigger('PostInit'); + } else { + self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + } + }); + } + } + + + // Internal event handlers + function onBeforeUpload(up, file) { + // Generate unique target filenames + if (up.settings.unique_names) { + var matches = file.name.match(/\.([^.]+)$/), ext = "part"; + if (matches) { + ext = matches[1]; + } + file.target_name = file.id + '.' + ext; + } + } + + + function onUploadFile(up, file) { + var url = up.settings.url + , chunkSize = up.settings.chunk_size + , retries = up.settings.max_retries + , features = up.features + , offset = 0 + , blob + ; + + // make sure we start at a predictable offset + if (file.loaded) { + offset = file.loaded = chunkSize ? chunkSize * Math.floor(file.loaded / chunkSize) : 0; + } + + function handleError() { + if (retries-- > 0) { + delay(uploadNextChunk, 1000); + } else { + file.loaded = offset; // reset all progress + + up.trigger('Error', { + code : plupload.HTTP_ERROR, + message : plupload.translate('HTTP Error.'), + file : file, + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + } + } + + function uploadNextChunk() { + var chunkBlob, formData, args = {}, curChunkSize; + + // make sure that file wasn't cancelled and upload is not stopped in general + if (file.status !== plupload.UPLOADING || up.state === plupload.STOPPED) { + return; + } + + // send additional 'name' parameter only if required + if (up.settings.send_file_name) { + args.name = file.target_name || file.name; + } + + if (chunkSize && features.chunks && blob.size > chunkSize) { // blob will be of type string if it was loaded in memory + curChunkSize = Math.min(chunkSize, blob.size - offset); + chunkBlob = blob.slice(offset, offset + curChunkSize); + } else { + curChunkSize = blob.size; + chunkBlob = blob; + } + + // If chunking is enabled add corresponding args, no matter if file is bigger than chunk or smaller + if (chunkSize && features.chunks) { + // Setup query string arguments + if (up.settings.send_chunk_number) { + args.chunk = Math.ceil(offset / chunkSize); + args.chunks = Math.ceil(blob.size / chunkSize); + } else { // keep support for experimental chunk format, just in case + args.offset = offset; + args.total = blob.size; + } + } + + xhr = new o.XMLHttpRequest(); + + // Do we have upload progress support + if (xhr.upload) { + xhr.upload.onprogress = function(e) { + file.loaded = Math.min(file.size, offset + e.loaded); + up.trigger('UploadProgress', file); + }; + } + + xhr.onload = function() { + // check if upload made itself through + if (xhr.status >= 400) { + handleError(); + return; + } + + retries = up.settings.max_retries; // reset the counter + + // Handle chunk response + if (curChunkSize < blob.size) { + chunkBlob.destroy(); + + offset += curChunkSize; + file.loaded = Math.min(offset, blob.size); + + up.trigger('ChunkUploaded', file, { + offset : file.loaded, + total : blob.size, + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + + // stock Android browser doesn't fire upload progress events, but in chunking mode we can fake them + if (o.Env.browser === 'Android Browser') { + // doesn't harm in general, but is not required anywhere else + up.trigger('UploadProgress', file); + } + } else { + file.loaded = file.size; + } + + chunkBlob = formData = null; // Free memory + + // Check if file is uploaded + if (!offset || offset >= blob.size) { + // If file was modified, destory the copy + if (file.size != file.origSize) { + blob.destroy(); + blob = null; + } + + up.trigger('UploadProgress', file); + + file.status = plupload.DONE; + + up.trigger('FileUploaded', file, { + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + } else { + // Still chunks left + delay(uploadNextChunk, 1); // run detached, otherwise event handlers interfere + } + }; + + xhr.onerror = function() { + handleError(); + }; + + xhr.onloadend = function() { + this.destroy(); + xhr = null; + }; + + // Build multipart request + if (up.settings.multipart && features.multipart) { + xhr.open("post", url, true); + + // Set custom headers + plupload.each(up.settings.headers, function(value, name) { + xhr.setRequestHeader(name, value); + }); + + formData = new o.FormData(); + + // Add multipart params + plupload.each(plupload.extend(args, up.settings.multipart_params), function(value, name) { + formData.append(name, value); + }); + + // Add file and send it + formData.append(up.settings.file_data_name, chunkBlob); + xhr.send(formData, { + runtime_order: up.settings.runtimes, + required_caps: up.settings.required_features, + preferred_caps: preferred_caps, + swf_url: up.settings.flash_swf_url, + xap_url: up.settings.silverlight_xap_url + }); + } else { + // if no multipart, send as binary stream + url = plupload.buildUrl(up.settings.url, plupload.extend(args, up.settings.multipart_params)); + + xhr.open("post", url, true); + + xhr.setRequestHeader('Content-Type', 'application/octet-stream'); // Binary stream header + + // Set custom headers + plupload.each(up.settings.headers, function(value, name) { + xhr.setRequestHeader(name, value); + }); + + xhr.send(chunkBlob, { + runtime_order: up.settings.runtimes, + required_caps: up.settings.required_features, + preferred_caps: preferred_caps, + swf_url: up.settings.flash_swf_url, + xap_url: up.settings.silverlight_xap_url + }); + } + } + + blob = file.getSource(); + + // Start uploading chunks + if (up.settings.resize.enabled && runtimeCan(blob, 'send_binary_string') && !!~o.inArray(blob.type, ['image/jpeg', 'image/png'])) { + // Resize if required + resizeImage.call(this, blob, up.settings.resize, function(resizedBlob) { + blob = resizedBlob; + file.size = resizedBlob.size; + uploadNextChunk(); + }); + } else { + uploadNextChunk(); + } + } + + + function onUploadProgress(up, file) { + calcFile(file); + } + + + function onStateChanged(up) { + if (up.state == plupload.STARTED) { + // Get start time to calculate bps + startTime = (+new Date()); + } else if (up.state == plupload.STOPPED) { + // Reset currently uploading files + for (var i = up.files.length - 1; i >= 0; i--) { + if (up.files[i].status == plupload.UPLOADING) { + up.files[i].status = plupload.QUEUED; + calc(); + } + } + } + } + + + function onCancelUpload() { + if (xhr) { + xhr.abort(); + } + } + + + function onFileUploaded(up) { + calc(); + + // Upload next file but detach it from the error event + // since other custom listeners might want to stop the queue + delay(function() { + uploadNext.call(up); + }, 1); + } + + + function onError(up, err) { + if (err.code === plupload.INIT_ERROR) { + up.destroy(); + } + // Set failed status if an error occured on a file + else if (err.file) { + err.file.status = plupload.FAILED; + calcFile(err.file); + + // Upload next file but detach it from the error event + // since other custom listeners might want to stop the queue + if (up.state == plupload.STARTED) { // upload in progress + up.trigger('CancelUpload'); + delay(function() { + uploadNext.call(up); + }, 1); + } + } + } + + + function onDestroy(up) { + up.stop(); + + // Purge the queue + plupload.each(files, function(file) { + file.destroy(); + }); + files = []; + + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.destroy(); + }); + fileInputs = []; + } + + if (fileDrops.length) { + plupload.each(fileDrops, function(fileDrop) { + fileDrop.destroy(); + }); + fileDrops = []; + } + + preferred_caps = {}; + disabled = false; + startTime = xhr = null; + total.reset(); + } + + + // Default settings + settings = { + runtimes: o.Runtime.order, + max_retries: 0, + chunk_size: 0, + multipart: true, + multi_selection: true, + file_data_name: 'file', + flash_swf_url: 'js/Moxie.swf', + silverlight_xap_url: 'js/Moxie.xap', + filters: { + mime_types: [], + prevent_duplicates: false, + max_file_size: 0 + }, + resize: { + enabled: false, + preserve_headers: true, + crop: false + }, + send_file_name: true, + send_chunk_number: true + }; + + + setOption.call(this, options, null, true); + + // Inital total state + total = new plupload.QueueProgress(); + + // Add public methods + plupload.extend(this, { + + /** + * Unique id for the Uploader instance. + * + * @property id + * @type String + */ + id : uid, + uid : uid, // mOxie uses this to differentiate between event targets + + /** + * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. + * These states are controlled by the stop/start methods. The default value is STOPPED. + * + * @property state + * @type Number + */ + state : plupload.STOPPED, + + /** + * Map of features that are available for the uploader runtime. Features will be filled + * before the init event is called, these features can then be used to alter the UI for the end user. + * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize. + * + * @property features + * @type Object + */ + features : {}, + + /** + * Current runtime name. + * + * @property runtime + * @type String + */ + runtime : null, + + /** + * Current upload queue, an array of File instances. + * + * @property files + * @type Array + * @see plupload.File + */ + files : files, + + /** + * Object with name/value settings. + * + * @property settings + * @type Object + */ + settings : settings, + + /** + * Total progess information. How many files has been uploaded, total percent etc. + * + * @property total + * @type plupload.QueueProgress + */ + total : total, + + + /** + * Initializes the Uploader instance and adds internal event listeners. + * + * @method init + */ + init : function() { + var self = this; + + if (typeof(settings.preinit) == "function") { + settings.preinit(self); + } else { + plupload.each(settings.preinit, function(func, name) { + self.bind(name, func); + }); + } + + bindEventListeners.call(this); + + // Check for required options + if (!settings.browse_button || !settings.url) { + this.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + return; + } + + initControls.call(this, settings, function(inited) { + if (typeof(settings.init) == "function") { + settings.init(self); + } else { + plupload.each(settings.init, function(func, name) { + self.bind(name, func); + }); + } + + if (inited) { + self.runtime = o.Runtime.getInfo(getRUID()).type; + self.trigger('Init', { runtime: self.runtime }); + self.trigger('PostInit'); + } else { + self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + } + }); + }, + + /** + * Set the value for the specified option(s). + * + * @method setOption + * @since 2.1 + * @param {String|Object} option Name of the option to change or the set of key/value pairs + * @param {Mixed} [value] Value for the option (is ignored, if first argument is object) + */ + setOption: function(option, value) { + setOption.call(this, option, value, !this.runtime); // until runtime not set we do not need to reinitialize + }, + + /** + * Get the value for the specified option or the whole configuration, if not specified. + * + * @method getOption + * @since 2.1 + * @param {String} [option] Name of the option to get + * @return {Mixed} Value for the option or the whole set + */ + getOption: function(option) { + if (!option) { + return settings; + } + return settings[option]; + }, + + /** + * Refreshes the upload instance by dispatching out a refresh event to all runtimes. + * This would for example reposition flash/silverlight shims on the page. + * + * @method refresh + */ + refresh : function() { + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.trigger('Refresh'); + }); + } + this.trigger('Refresh'); + }, + + /** + * Starts uploading the queued files. + * + * @method start + */ + start : function() { + if (this.state != plupload.STARTED) { + this.state = plupload.STARTED; + this.trigger('StateChanged'); + + uploadNext.call(this); + } + }, + + /** + * Stops the upload of the queued files. + * + * @method stop + */ + stop : function() { + if (this.state != plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger('StateChanged'); + this.trigger('CancelUpload'); + } + }, + + + /** + * Disables/enables browse button on request. + * + * @method disableBrowse + * @param {Boolean} disable Whether to disable or enable (default: true) + */ + disableBrowse : function() { + disabled = arguments[0] !== undef ? arguments[0] : true; + + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.disable(disabled); + }); + } + + this.trigger('DisableBrowse', disabled); + }, + + /** + * Returns the specified file object by id. + * + * @method getFile + * @param {String} id File id to look for. + * @return {plupload.File} File object or undefined if it wasn't found; + */ + getFile : function(id) { + var i; + for (i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return files[i]; + } + } + }, + + /** + * Adds file to the queue programmatically. Can be native file, instance of Plupload.File, + * instance of mOxie.File, input[type="file"] element, or array of these. Fires FilesAdded, + * if any files were added to the queue. Otherwise nothing happens. + * + * @method addFile + * @since 2.0 + * @param {plupload.File|mOxie.File|File|Node|Array} file File or files to add to the queue. + * @param {String} [fileName] If specified, will be used as a name for the file + */ + addFile : function(file, fileName) { + var self = this + , queue = [] + , filesAdded = [] + , ruid + ; + + function filterFile(file, cb) { + var queue = []; + o.each(self.settings.filters, function(rule, name) { + if (fileFilters[name]) { + queue.push(function(cb) { + fileFilters[name].call(self, rule, file, function(res) { + cb(!res); + }); + }); + } + }); + o.inSeries(queue, cb); + } + + /** + * @method resolveFile + * @private + * @param {o.File|o.Blob|plupload.File|File|Blob|input[type="file"]} file + */ + function resolveFile(file) { + var type = o.typeOf(file); + + // o.File + if (file instanceof o.File) { + if (!file.ruid && !file.isDetached()) { + if (!ruid) { // weird case + return false; + } + file.ruid = ruid; + file.connectRuntime(ruid); + } + resolveFile(new plupload.File(file)); + } + // o.Blob + else if (file instanceof o.Blob) { + resolveFile(file.getSource()); + file.destroy(); + } + // plupload.File - final step for other branches + else if (file instanceof plupload.File) { + if (fileName) { + file.name = fileName; + } + + queue.push(function(cb) { + // run through the internal and user-defined filters, if any + filterFile(file, function(err) { + if (!err) { + // make files available for the filters by updating the main queue directly + files.push(file); + // collect the files that will be passed to FilesAdded event + filesAdded.push(file); + + self.trigger("FileFiltered", file); + } + delay(cb, 1); // do not build up recursions or eventually we might hit the limits + }); + }); + } + // native File or blob + else if (o.inArray(type, ['file', 'blob']) !== -1) { + resolveFile(new o.File(null, file)); + } + // input[type="file"] + else if (type === 'node' && o.typeOf(file.files) === 'filelist') { + // if we are dealing with input[type="file"] + o.each(file.files, resolveFile); + } + // mixed array of any supported types (see above) + else if (type === 'array') { + fileName = null; // should never happen, but unset anyway to avoid funny situations + o.each(file, resolveFile); + } + } + + ruid = getRUID(); + + resolveFile(file); + + if (queue.length) { + o.inSeries(queue, function() { + // if any files left after filtration, trigger FilesAdded + if (filesAdded.length) { + self.trigger("FilesAdded", filesAdded); + } + }); + } + }, + + /** + * Removes a specific file. + * + * @method removeFile + * @param {plupload.File|String} file File to remove from queue. + */ + removeFile : function(file) { + var id = typeof(file) === 'string' ? file : file.id; + + for (var i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return this.splice(i, 1)[0]; + } + } + }, + + /** + * Removes part of the queue and returns the files removed. This will also trigger the FilesRemoved and QueueChanged events. + * + * @method splice + * @param {Number} start (Optional) Start index to remove from. + * @param {Number} length (Optional) Lengh of items to remove. + * @return {Array} Array of files that was removed. + */ + splice : function(start, length) { + // Splice and trigger events + var removed = files.splice(start === undef ? 0 : start, length === undef ? files.length : length); + + // if upload is in progress we need to stop it and restart after files are removed + var restartRequired = false; + if (this.state == plupload.STARTED) { // upload in progress + plupload.each(removed, function(file) { + if (file.status === plupload.UPLOADING) { + restartRequired = true; // do not restart, unless file that is being removed is uploading + return false; + } + }); + + if (restartRequired) { + this.stop(); + } + } + + this.trigger("FilesRemoved", removed); + + // Dispose any resources allocated by those files + plupload.each(removed, function(file) { + file.destroy(); + }); + + if (restartRequired) { + this.start(); + } + + return removed; + }, + + /** + * Dispatches the specified event name and it's arguments to all listeners. + * + * + * @method trigger + * @param {String} name Event name to fire. + * @param {Object..} Multiple arguments to pass along to the listener functions. + */ + + /** + * Check whether uploader has any listeners to the specified event. + * + * @method hasEventListener + * @param {String} name Event name to check for. + */ + + + /** + * Adds an event listener by name. + * + * @method bind + * @param {String} name Event name to listen for. + * @param {function} func Function to call ones the event gets fired. + * @param {Object} scope Optional scope to execute the specified function in. + */ + bind : function(name, func, scope) { + var self = this; + // adapt moxie EventTarget style to Plupload-like + plupload.Uploader.prototype.bind.call(this, name, function() { + var args = [].slice.call(arguments); + args.splice(0, 1, self); // replace event object with uploader instance + return func.apply(this, args); + }, 0, scope); + }, + + /** + * Removes the specified event listener. + * + * @method unbind + * @param {String} name Name of event to remove. + * @param {function} func Function to remove from listener. + */ + + /** + * Removes all event listeners. + * + * @method unbindAll + */ + + + /** + * Destroys Plupload instance and cleans after itself. + * + * @method destroy + */ + destroy : function() { + this.trigger('Destroy'); + settings = total = null; // purge these exclusively + this.unbindAll(); + } + }); +}; + +plupload.Uploader.prototype = o.EventTarget.instance; + +/** + * Constructs a new file instance. + * + * @class File + * @constructor + * + * @param {Object} file Object containing file properties + * @param {String} file.name Name of the file. + * @param {Number} file.size File size. + */ +plupload.File = (function() { + var filepool = {}; + + function PluploadFile(file) { + + plupload.extend(this, { + + /** + * File id this is a globally unique id for the specific file. + * + * @property id + * @type String + */ + id: plupload.guid(), + + /** + * File name for example "myfile.gif". + * + * @property name + * @type String + */ + name: file.name || file.fileName, + + /** + * File type, `e.g image/jpeg` + * + * @property type + * @type String + */ + type: file.type || '', + + /** + * File size in bytes (may change after client-side manupilation). + * + * @property size + * @type Number + */ + size: file.size || file.fileSize, + + /** + * Original file size in bytes. + * + * @property origSize + * @type Number + */ + origSize: file.size || file.fileSize, + + /** + * Number of bytes uploaded of the files total size. + * + * @property loaded + * @type Number + */ + loaded: 0, + + /** + * Number of percentage uploaded of the file. + * + * @property percent + * @type Number + */ + percent: 0, + + /** + * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. + * + * @property status + * @type Number + * @see plupload + */ + status: plupload.QUEUED, + + /** + * Date of last modification. + * + * @property lastModifiedDate + * @type {String} + */ + lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString(), // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) + + /** + * Returns native window.File object, when it's available. + * + * @method getNative + * @return {window.File} or null, if plupload.File is of different origin + */ + getNative: function() { + var file = this.getSource().getSource(); + return o.inArray(o.typeOf(file), ['blob', 'file']) !== -1 ? file : null; + }, + + /** + * Returns mOxie.File - unified wrapper object that can be used across runtimes. + * + * @method getSource + * @return {mOxie.File} or null + */ + getSource: function() { + if (!filepool[this.id]) { + return null; + } + return filepool[this.id]; + }, + + /** + * Destroys plupload.File object. + * + * @method destroy + */ + destroy: function() { + var src = this.getSource(); + if (src) { + src.destroy(); + delete filepool[this.id]; + } + } + }); + + filepool[this.id] = file; + } + + return PluploadFile; +}()); + + +/** + * Constructs a queue progress. + * + * @class QueueProgress + * @constructor + */ + plupload.QueueProgress = function() { + var self = this; // Setup alias for self to reduce code size when it's compressed + + /** + * Total queue file size. + * + * @property size + * @type Number + */ + self.size = 0; + + /** + * Total bytes uploaded. + * + * @property loaded + * @type Number + */ + self.loaded = 0; + + /** + * Number of files uploaded. + * + * @property uploaded + * @type Number + */ + self.uploaded = 0; + + /** + * Number of files failed to upload. + * + * @property failed + * @type Number + */ + self.failed = 0; + + /** + * Number of files yet to be uploaded. + * + * @property queued + * @type Number + */ + self.queued = 0; + + /** + * Total percent of the uploaded bytes. + * + * @property percent + * @type Number + */ + self.percent = 0; + + /** + * Bytes uploaded per second. + * + * @property bytesPerSec + * @type Number + */ + self.bytesPerSec = 0; + + /** + * Resets the progress to it's initial values. + * + * @method reset + */ + self.reset = function() { + self.size = self.loaded = self.uploaded = self.failed = self.queued = self.percent = self.bytesPerSec = 0; + }; +}; + +window.plupload = plupload; + +}(window, mOxie)); diff --git a/lib/plupload-2.1.2/js/plupload.full.min.js b/lib/plupload-2.1.2/js/plupload.full.min.js new file mode 100644 index 0000000..ca6cdf8 --- /dev/null +++ b/lib/plupload-2.1.2/js/plupload.full.min.js @@ -0,0 +1,28 @@ +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.2.1 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2014-05-14 + */ +!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r0&&n(o,function(n,o){n!==r&&(e(i[o])===e(n)&&~a(e(n),["array","object"])?t(i[o],n):i[o]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++rn;n++)if(t[n]===e)return n}return-1},s=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===a(t[r],n)&&i.push(t[r]);return i.length?i:!1},u=function(e,t){var i=[];return n(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},c=function(e){var t,n=[];for(t=0;ti;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),d=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},f=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),e};return{guid:l,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inParallel:o,inArray:a,arrayDiff:s,arrayIntersect:u,toArray:c,trim:d,parseSizeStr:f}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),i(l,[u,c],function(e,t){var n="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;ni;i++)if(e[i]!=t[i]){if(e[i]=u(e[i]),t[i]=u(t[i]),e[i]t[i]){o=1;break}}if(!n)return o;switch(n){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",n="?",i="function",r="undefined",o="object",a="major",s="model",u="name",c="type",l="vendor",d="version",f="architecture",h="console",p="mobile",m="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},v={rgx:function(){for(var t,n=0,a,s,u,c,l,d,f=arguments;n0?2==c.length?t[c[0]]=typeof c[1]==i?c[1].call(this,d):c[1]:3==c.length?t[c[0]]=typeof c[1]!==i||c[1].exec&&c[1].test?d?d.replace(c[1],c[2]):e:d?c[1].call(this,d,c[2]):e:4==c.length&&(t[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):e):t[c]=d?d:e;break}if(l)break}return t},str:function(t,i){for(var r in i)if(typeof i[r]===o&&i[r].length>0){for(var a=0;a=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),r={can:i,browser:n.browser.name,version:parseFloat(n.browser.major),os:n.os.name,osVersion:n.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return r.OS=r.os,r}),i(f,[d],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){if(!e.className)return!1;var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return n.test(e.className)},i=function(e,t){n(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),i(h,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(p,[h,u],function(e,t){function n(){var n={};t.extend(this,{uid:null,init:function(){this.uid||(this.uid=t.guid("uid_"))},addEventListener:function(e,i,r,o){var a=this,s;return e=t.trim(e),/\s/.test(e)?void t.each(e.split(/\s+/),function(e){a.addEventListener(e,i,r,o)}):(e=e.toLowerCase(),r=parseInt(r,10)||0,s=n[this.uid]&&n[this.uid][e]||[],s.push({fn:i,priority:r,scope:o||this}),n[this.uid]||(n[this.uid]={}),void(n[this.uid][e]=s))},hasEventListener:function(e){return e?!(!n[this.uid]||!n[this.uid][e]):!!n[this.uid]},removeEventListener:function(e,i){e=e.toLowerCase();var r=n[this.uid]&&n[this.uid][e],o;if(r){if(i){for(o=r.length-1;o>=0;o--)if(r[o].fn===i){r.splice(o,1);break}}else r=[];r.length||(delete n[this.uid][e],t.isEmptyObj(n[this.uid])&&delete n[this.uid])}},removeAllEventListeners:function(){n[this.uid]&&delete n[this.uid]},dispatchEvent:function(i){var r,o,a,s,u={},c=!0,l;if("string"!==t.typeOf(i)){if(s=i,"string"!==t.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);i=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==i.indexOf("::")?!function(e){r=e[0],i=e[1]}(i.split("::")):r=this.uid,i=i.toLowerCase(),o=n[r]&&n[r][i]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=i,a.unshift(u);var d=[];t.each(o,function(e){a[0].target=e.scope,d.push(u.async?function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}:function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&t.inSeries(d,function(e){c=!e})}return c},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(e){var n;"array"!==t.typeOf(e)&&(e=[e]);for(var i=0;i>16&255,o=d>>8&255,a=255&d,m[h++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(f>18&63,u=d>>12&63,c=d>>6&63,l=63&d,m[h++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(fa;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(A,[h,u,y],function(e,t,n){function i(){var e,i=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):i.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(n){t.each(i,function(e){n(e.value,e.name)}),e&&n(e.value,e.name)},destroy:function(){e=null,i=[]}})}return i}),i(S,[u,h,p,m,R,g,x,y,T,A,d,l],function(e,t,n,i,r,o,a,s,u,c,l,d){function f(){this.uid=e.guid("uid_")}function h(){function n(e,t){return y.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?y[e]:v[e]:void(l.can("define_property")?y[e]=t:v[e]=t):void 0}function u(t){function i(){k&&(k.destroy(),k=null),s.dispatchEvent("loadend"),s=null}function r(r){k.bind("LoadStart",function(e){n("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),I&&s.upload.dispatchEvent(e)}),k.bind("Progress",function(e){n("readyState")!==h.LOADING&&(n("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),k.bind("UploadProgress",function(e){I&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),k.bind("Load",function(t){n("readyState",h.DONE),n("status",Number(r.exec.call(k,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(k,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),U=r.exec.call(k,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(I&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(N=!0,s.dispatchEvent("error")),i()}),k.bind("Abort",function(e){s.dispatchEvent(e),i()}),k.bind("Error",function(e){N=!0,n("readyState",h.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(k,"XMLHttpRequest","send",{url:E,method:_,async:w,user:b,password:R,headers:x,mimeType:A,encoding:T,responseType:s.responseType,withCredentials:s.withCredentials,options:P},t)}var s=this;M=(new Date).getTime(),k=new a,"string"==typeof P.required_caps&&(P.required_caps=o.parseCaps(P.required_caps)),P.required_caps=e.extend({},P.required_caps,{return_response_type:s.responseType}),t instanceof c&&(P.required_caps.send_multipart=!0),L||(P.required_caps.do_cors=!0),P.ruid?r(k.connectRuntime(P)):(k.bind("RuntimeInit",function(e,t){r(t)}),k.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),k.connectRuntime(P))}function g(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),M=C=null}var v=this,y={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},w=!0,E,_,x={},b,R,T=null,A=null,S=!1,O=!1,I=!1,D=!1,N=!1,L=!1,M,C,F=null,H=null,P={},k,U="",B;e.extend(this,y,{uid:e.guid("uid_"),upload:new f,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(_=o.toUpperCase()),~e.inArray(_,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),L=r.hasSameOrigin(l),E=r.resolveUrl(a),(u||c)&&!L)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(b=u||l.user,R=c||l.pass,w=s||!0,w===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);S=!w,O=!1,x={},g.call(this),n("readyState",h.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(n("readyState")!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(x[r]?x[r]+=", "+o:x[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),N||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(B||(B={},e.each(U.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),B[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),B.hasOwnProperty(t))?B[t].header+": "+B[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!d.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);F=i,H=o},send:function(n,r){if(P="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.convertEventPropsToHandlers(m),this.upload.convertEventPropsToHandlers(m),this.readyState!==h.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)P.ruid=n.ruid,A=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();P.ruid=o.ruid,A=o.type||"application/octet-stream"}}else"string"==typeof n&&(T="UTF-8",A="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=P.required_caps&&P.required_caps.send_browser_cookies&&!L),I=!S&&this.upload.hasEventListener(),N=!1,D=!n,S||(O=!0),u.call(this,n)},abort:function(){if(N=!0,S=!1,~e.inArray(n("readyState"),[h.UNSENT,h.OPENED,h.DONE]))n("readyState",h.UNSENT);else{if(n("readyState",h.DONE),O=!1,!k)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);k.getRuntime().exec.call(k,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){k&&("function"===e.typeOf(k.destroy)&&k.destroy(),k=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var p={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};f.prototype=n.instance;var m=["loadstart","progress","abort","error","load","timeout","loadend"],g=1,v=2;return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=n.instance,h}),i(O,[u,m,v,p],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[u,f,h,T,S,g,v,O,d,p,y,w,m],function(e,t,n,i,r,o,a,s,u,c,l,d,f){function h(){function i(e){e||(e=this.getRuntime().exec.call(this,"Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var i=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);m.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===i)/^data:[^;]*;base64,/.test(t)?c.call(this,new l(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),n&&"string"==typeof n.required_caps&&(n.required_caps=o.parseCaps(n.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){i.call(this)},999),this.convertEventPropsToHandlers(p),c.apply(this,arguments)},downsize:function(t){var i={width:this.width,height:this.height,crop:!1,preserveHeaders:!0};t="object"==typeof t?e.extend(i,t):e.extend(i,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);this.getRuntime().exec.call(this,"Image","downsize",t.width,t.height,t.crop,t.preserveHeaders)}catch(r){this.trigger("error",r.code)}},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return f.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i){function r(){if(u.can("create_canvas")){var t=a.getAsCanvas();if(t)return i.appendChild(t),t=null,a.destroy(),void o.trigger("embedded")}var r=a.getAsDataURL(c,l);if(!r)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",r.length))i.innerHTML='',a.destroy(),o.trigger("embedded");else{var d=new s;d.bind("TransportingComplete",function(){v=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){e.extend(v.getShimContainer().style,{top:"0px",left:"0px",width:a.width+"px",height:a.height+"px"}),v=null},999),v.exec.call(o,"ImageView","display",this.result.uid,m,g),a.destroy()}),d.transport(f.atob(r.substring(r.indexOf("base64,")+7)),c,e.extend({},p,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i}))}}var o=this,a,c,l,d,p=arguments[1]||{},m=this.width,g=this.height,v;try{if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);if(c=p.type||this.type||"image/jpeg",l=p.quality||90,d="undefined"!==e.typeOf(p.crop)?p.crop:!1,p.width)m=p.width,g=p.height||m;else{var y=t.getSize(i);y.w&&y.h&&(m=y.w,g=y.h)}return a=new h,a.bind("Resize",function(){r.call(o)}),a.bind("Load",function(){a.downsize(m,g,d,!1)}),a.clone(this,!1),a}catch(w){this.trigger("error",w.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var p=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=6500,h.MAX_RESIZE_HEIGHT=6500,h.prototype=c.instance,h}),i(D,[u,h,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue,c=e.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return r.can("access_binary")&&!!a.Image},display_media:s(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.version>9)}()),filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),return_response_headers:u,return_response_type:function(e){return"json"===e&&window.JSON?!0:i.can("return_response_type",e)},return_status_code:u,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return r.can("access_binary")&&i.can("create_canvas")},select_file:function(){return i.can("use_fileinput")&&window.File},select_folder:function(){return r.can("select_file")&&"Chrome"===i.browser&&i.version>=21},select_multiple:function(){return!(!r.can("select_file")||"Safari"===i.browser&&"Windows"===i.os||"iOS"===i.os&&i.verComp(i.osVersion,"7.0.4","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||r.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return r.can("slice_blob")&&r.can("send_multipart")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u},arguments[2]);n.call(this,t,arguments[1]||o,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i(N,[D,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(L,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(M,[D,u,f,L,l,d],function(e,t,n,i,r,o){function a(){var e=[],a;t.extend(this,{init:function(s){var u=this,c=u.getRuntime(),l,d,f,h,p,m;a=s,e=[],f=a.accept.mimes||r.extList2mimes(a.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='",l=n.get(c.uid),t.extend(l.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=n.get(a.browse_button),c.can("summon_file_dialog")&&("static"===n.getStyle(h,"position")&&(h.style.position="relative"),p=parseInt(n.getStyle(h,"z-index"),10)||1,h.style.zIndex=p,d.style.zIndex=p-1,i.addEvent(h,"click",function(e){var t=n.get(c.uid);t&&!t.disabled&&t.click(),e.preventDefault()},u.uid)),m=c.can("summon_file_dialog")?h:d,i.addEvent(m,"mouseover",function(){u.trigger("mouseenter")},u.uid),i.addEvent(m,"mouseout",function(){u.trigger("mouseleave")},u.uid),i.addEvent(m,"mousedown",function(){u.trigger("mousedown")},u.uid),i.addEvent(n.get(a.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function g(){if(e=[],a.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),"IE"!==o.browser&&"IEMobile"!==o.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=g}u.trigger("change")},u.trigger({type:"ready",async:!0}),d=null},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShim(),o=t.getShimContainer();i.removeAllEvents(o,this.uid),i.removeAllEvents(a&&n.get(a.container),this.uid),i.removeAllEvents(a&&n.get(a.browse_button),this.uid),o&&(o.innerHTML=""),r.removeInstance(this.uid),e=a=o=r=null}})}return e.FileInput=a}),i(C,[D,u,f,L,l],function(e,t,n,i,r){function o(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var n=t.toArray(e.dataTransfer.types||[]);return-1!==t.inArray("Files",n)||-1!==t.inArray("public.file-url",n)||-1!==t.inArray("application/x-moz-file",n)}function o(e){for(var n=[],i=0;i=4&&u.version<7,f="Android Browser"===u.browser,m=!1;if(p=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),h=c(),h.open(n.method,n.url,n.async,n.user,n.password),r instanceof o)r.isDetached()&&(m=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),m=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return void e.call(s,n,r);if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}h.upload?(n.withCredentials&&(h.withCredentials=!0),h.addEventListener("load",function(e){s.trigger(e)}),h.addEventListener("error",function(e){s.trigger(e)}),h.addEventListener("progress",function(e){s.trigger(e)}),h.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):h.onreadystatechange=function v(){switch(h.readyState){case 1:break;case 2:break;case 3:var e,t;try{i.hasSameOrigin(n.url)&&(e=h.getResponseHeader("Content-Length")||0),h.responseText&&(t=h.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:h.onreadystatechange=function(){},s.trigger(0===h.status?"error":"load")}},t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){h.setRequestHeader(t,e)}),""!==n.responseType&&"responseType"in h&&(h.responseType="json"!==n.responseType||u.can("return_response_type","json")?n.responseType:"text"),m?h.sendAsBinary?h.sendAsBinary(r):!function(){for(var e=new Uint8Array(r.length),t=0;ta;a++)i|=o.charCodeAt(e+a)<s;s++)o+=String.fromCharCode(t>>Math.abs(a+8*s)&255);n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:void(r=e)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):void i(n,r,4)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(k,[P],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;o<=n.length;)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(U,[u,P],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,h,p,m=[],g={};for(r=0;i>r;r++)if(h=f=e+12*r+2,s=n[a.SHORT(h)],s!==t){switch(u=a.SHORT(h+=2),d=a.LONG(h+=2),h+=4,m=[],u){case 1:case 7:for(d>4&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(h+o);break;case 2:d>4&&(h=a.LONG(h)+c.tiffHeader),g[s]=a.STRING(h,d-1);continue;case 3:for(d>2&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(h+2*o);break;case 4:for(d>1&&(h=a.LONG(h)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(h+4*o);break;case 5:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.LONG(h+4*o)/a.LONG(h+4*o+4);break;case 9:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o);break;case 10:for(h=a.LONG(h)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(h+4*o)/a.SLONG(h+4*o+4);break;default:continue}p=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof p?l[s][p]:p}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12*f+2,a.SHORT(o)==t){u=o+8;break}return u?(a.LONG(u,n),!0):!1}var a,s,u,c={},l;return a=new n,s={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},{init:function(e){return c={tiffHeader:10},e!==t&&e.length?(a.init(e),65505===a.SHORT(0)&&"EXIF\x00"===a.STRING(4,5).toUpperCase()?r():!1):!1 +},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n=65472&&65475>=t)return e+=5,{height:c.SHORT(e),width:c.SHORT(e+=2)};n=c.SHORT(e+=2),e+=n-2}return null}function s(){d&&l&&c&&(d.purge(),l.purge(),c.init(null),u=f=l=d=c=null)}var u,c,l,d,f,h;if(u=o,c=new i,c.init(u),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o),d=new r,h=!!d.init(l.get("app1")[0]),f=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length,width:f&&f.width||0,height:f&&f.height||0,setExif:function(t,n){return h?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),void l.set("app1",d.getBinary())):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):u=l.restore(u)},stripHeaders:function(e){return l.strip(e)},purge:function(){s.call(this)}}),h&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS()})}return o}),i(z,[h,u,P],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;ng;){for(var v=g+f>a?a-g:f,y=0;o>y;){var w=y+f>o?o-y:f;p.clearRect(0,0,f,f),p.drawImage(e,-y,-g);var E=y*s/o+c<<0,_=Math.ceil(w*s/o),x=g*u/a/m+l<<0,b=Math.ceil(v*u/a/m);d.drawImage(h,0,0,w,v,E,x,_,b),y+=f}g+=f}h=p=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[D,u,h,m,w,G,q,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!E&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return E||y}function c(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function l(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function d(e){var t=this;y=new Image,y.onerror=function(){g.call(this),t.trigger("error",n.ImageError.WRONG_FORMAT)},y.onload=function(){t.trigger("load")},y.src=/^data:[^;]*;base64,/.test(e)?e:l(e,x.type)}function f(e,t){var i=this,r;return window.FileReader?(r=new FileReader,r.onload=function(){t(this.result)},r.onerror=function(){i.trigger("error",n.ImageError.WRONG_FORMAT)},r.readAsDataURL(e),void 0):t(e.getAsDataURL())}function h(n,i,r,o){var a=this,s,u,c=0,l=0,d,f,h,g;if(R=o,g=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(g,[5,6,7,8])){var v=n;n=i,i=v}return d=e(),r?(n=Math.min(n,d.width),i=Math.min(i,d.height),s=Math.max(n/d.width,i/d.height)):s=Math.min(n/d.width,i/d.height),s>1&&!r&&o?void this.trigger("Resize"):(E||(E=document.createElement("canvas")),f=Math.round(d.width*s),h=Math.round(d.height*s),r?(E.width=n,E.height=i,f>n&&(c=Math.round((f-n)/2)),h>i&&(l=Math.round((h-i)/2))):(E.width=f,E.height=h),R||m(E.width,E.height,g),p.call(this,d,E,-c,-l,f,h),this.width=E.width,this.height=E.height,b=!0,void a.trigger("Resize"))}function p(e,t,n,i,r,o){if("iOS"===u.OS)a.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var s=t.getContext("2d");s.drawImage(e,n,i,r,o)}}function m(e,t,n){switch(n){case 5:case 6:case 7:case 8:E.width=t,E.height=e;break;default:E.width=e,E.height=t}var i=E.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function g(){w&&(w.purge(),w=null),_=y=E=x=null,b=!1}var v=this,y,w,E,_,x,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return x=e,e.isDetached()?(_=e.getSource(),void d.call(this,_)):void f.call(this,e.getSource(),function(e){r&&(_=c(e)),d.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,x=new r(null,{name:e.name,size:e.size,type:e.type}),d.call(this,t?_=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!w&&_&&t.can("access_image_binary")&&(w=new o(_)),n={width:e().width||0,height:e().height||0,type:x.type||s.getFileMime(x.name),size:_&&_.length||x.size||0,name:x.name||"",meta:w&&w.meta||this.meta||{}}},downsize:function(){h.apply(this,arguments)},getAsCanvas:function(){return E&&(E.id=this.uid+"_canvas"),E},getAsBlob:function(e,t){return e!==this.type&&h.call(this,this.width,this.height,!1),new r(null,{name:x.name||"",type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return y.src;if("image/jpeg"!==e)return E.toDataURL("image/png");try{return E.toDataURL("image/jpeg",t/100)}catch(n){return E.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return _||(_=c(v.getAsDataURL(e,t))),_;if("image/jpeg"!==e)_=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=E.toDataURL("image/jpeg",t/100)}catch(i){n=E.toDataURL("image/jpeg")}_=c(n),w&&(_=w.stripHeaders(_),R&&(w.meta&&w.meta.exif&&w.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),_=w.writeHeaders(_)),w.purge(),w=null)}return b=!1,_},destroy:function(){v=null,g.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(j,[u,d,f,h,g],function(e,t,n,i,r){function o(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(n){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function a(a){var c=this,l;a=e.extend({swf_url:t.swf_url},a),r.call(this,a,s,{access_binary:function(e){return e&&"browser"===c.mode},access_image_binary:function(e){return e&&"browser"===c.mode},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===c.mode},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===c.mode},return_status_code:function(t){return"browser"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===c.mode},send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"browser"===c.mode},send_multipart:r.capTrue,slice_blob:function(e){return e&&"browser"===c.mode},stream_upload:function(e){return e&&"browser"===c.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===c.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),o()<10&&(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='',"IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=n,r=o=null):o.innerHTML=n,l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="flash",u={};return r.addConstructor(s,a),u}),i(V,[j,y],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i(W,[j],function(e){var t={init:function(e){this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=t}),i(Y,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i="",r={read:function(e,t){var r=this,o=r.getRuntime();return"readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"),r.bind("Progress",function(t,r){r&&(i+=n(r,e))}),o.shimExec.call(this,"FileReader","readAsBase64",t.uid)},getResult:function(){return i},destroy:function(){i=null}};return e.FileReader=r}),i($,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i,r=this.getRuntime();return(i=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(J,[j,u,y,w,T,A,O],function(e,t,n,i,r,o,a){var s={send:function(e,i){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){t(this.result)}),n.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var f=i.getBlob();f.isDetached()?u(f,function(e){f.destroy(),s(d,e)}):s(d,f)}else i=null,r()}else i instanceof n?i.isDetached()?u(i,function(e){i.destroy(),i=e.uid,r()}):(i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;try{if(n=new r,~t.inArray(e,["","text"]))return n.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(n.readAsText(o))}finally{o.destroy()}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(Z,[j,y],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(K,[j,u,O,y,T],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(Q,[u,d,f,h,g],function(e,t,n,i,r){function o(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do a=parseInt(o[u],10),s=parseInt(r[u],10),u++;while(u=a&&!isNaN(a)&&(t=!0)}}}catch(d){t=!1}return t}function a(a){var c=this,l;a=e.extend({xap_url:t.xap_url},a),r.call(this,a,s,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"client"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),o("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='',l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="silverlight",u={};return r.addConstructor(s,a),u}),i(et,[Q,u,V],function(e,t,n){return e.Blob=t.extend({},n)}),i(tt,[Q],function(e){var t={init:function(e){function t(e){for(var t="",n=0;no;o++)n=t.keys[o],s=t[n],s&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),i.meta[e][n]=s)}),i.width=parseInt(r.width,10),i.height=parseInt(r.height,10),i.size=parseInt(r.size,10),i.type=r.type,i.name=r.name,i}})}),i(ut,[u,h,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue;n.call(this,t,o,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),resize_image:function(){return a.Image&&r.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return i.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return r.can("select_file")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i(ct,[ut,u,f,L,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,h,p,m,g;g=t.guid("uid_"),d=l.getShimContainer(),a&&(h=n.get(a+"_form"),h&&t.extend(h.style,{top:"100%"})),p=document.createElement("form"),p.setAttribute("id",g+"_form"),p.setAttribute("method","post"),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),t.extend(p.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name",c.name||"Filedata"),m.setAttribute("accept",u.join(",")),t.extend(m.style,{fontSize:"999px",opacity:0}),p.appendChild(m),d.appendChild(p),t.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.onchange=function(){var t;this.value&&(t=this.files?this.files[0]:{name:this.value},s=[t],this.onchange=function(){},e.call(r),r.bind("change",function i(){var e=n.get(g),t=n.get(g+"_form"),o;r.unbind("change",i),r.files.length&&e&&t&&(o=r.files[0],e.setAttribute("id",o.uid),t.setAttribute("id",o.uid+"_form"),t.setAttribute("target",o.uid+"_iframe")),e=t=null},998),m=p=null,r.trigger("change"))},l.can("summon_file_dialog")&&(f=n.get(c.browse_button),i.removeEvent(f,"click",r.uid),i.addEvent(f,"click",function(e){m&&!m.disabled&&m.click(),e.preventDefault()},r.uid)),a=g,d=h=f=null}var a,s=[],u=[],c;t.extend(this,{init:function(t){var o=this,a=o.getRuntime(),s;c=t,u=t.accept.mimes||r.extList2mimes(t.accept,a.can("filter_by_extension")),s=a.getShimContainer(),function(){var e,r,u;e=n.get(t.browse_button),a.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),r=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=r,s.style.zIndex=r-1),u=a.can("summon_file_dialog")?e:s,i.addEvent(u,"mouseover",function(){o.trigger("mouseenter")},o.uid),i.addEvent(u,"mouseout",function(){o.trigger("mouseleave")},o.uid),i.addEvent(u,"mousedown",function(){o.trigger("mousedown")},o.uid),i.addEvent(n.get(t.container),"mouseup",function(){o.trigger("mouseup")},o.uid),e=null}(),e.call(this),s=null,o.trigger({type:"ready",async:!0})},getFiles:function(){return s},disable:function(e){var t;(t=n.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),r=e.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(c&&n.get(c.container),this.uid),i.removeAllEvents(c&&n.get(c.browse_button),this.uid),r&&(r.innerHTML=""),t.removeInstance(this.uid),a=s=u=c=r=t=null}})}return e.FileInput=a}),i(lt,[ut,F],function(e,t){return e.FileReader=t}),i(dt,[ut,u,f,R,h,L,y,A],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t=this,i,r,a,s,u=!1;if(l){if(i=l.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(l,"load",t.uid),l.parentNode&&l.parentNode.removeChild(l);var n=t.getRuntime().getShimContainer();n.children.length||n.parentNode.removeChild(n),n=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,f){function h(){var n=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),p.trigger({type:"progress",loaded:c.length,total:c.length}),w&&p.trigger({type:"uploadprogress",loaded:w.size||1025,total:w.size||1025}))}catch(r){if(!i.hasSameOrigin(d.url))return void e.call(p,function(){p.trigger("error")});u=404}e.call(p,function(){p.trigger("load")})},p.uid)}var p=this,m=p.getRuntime(),g,v,y,w;if(u=c=null,f instanceof s&&f.hasBlob()){if(w=f.getBlob(),g=w.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),y?v.insertBefore(i,y):v.appendChild(i)}}),v.setAttribute("action",d.url),h(),v.submit(),p.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i(ft,[ut,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,h,p,m,g,v,y,w,E,_,x,b,R,T,A,S,O,I,L])}(this);;(function(e){"use strict";var t={},n=e.moxie.core.utils.Basic.inArray;return function r(e){var i,s;for(i in e)s=typeof e[i],s==="object"&&!~n(i,["Exceptions","Env","Mime"])?r(e[i]):s==="function"&&(t[i]=e[i])}(e.moxie),t.Env=e.moxie.core.utils.Env,t.Mime=e.moxie.core.utils.Mime,t.Exceptions=e.moxie.core.Exceptions,e.mOxie=t,e.o||(e.o=t),t})(this); +/** + * Plupload - multi-runtime File Uploader + * v2.1.2 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2014-05-14 + */ +;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function c(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function h(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!l)return!1;e.ruid=l,e.connectRuntime(l)}h(new o.File(e))}else e instanceof t.Blob?(h(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){c(e,function(n){n||(f.push(e),a.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?h(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,h):i==="array"&&(n=null,t.each(e,h))}var s=this,u=[],a=[],l;l=w(),h(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger("FilesAdded",a)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie); \ No newline at end of file diff --git a/lib/plupload-2.1.2/js/plupload.min.js b/lib/plupload-2.1.2/js/plupload.min.js new file mode 100644 index 0000000..1f4279d --- /dev/null +++ b/lib/plupload-2.1.2/js/plupload.min.js @@ -0,0 +1,13 @@ +/** + * Plupload - multi-runtime File Uploader + * v2.1.2 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2014-05-14 + */ +;(function(e,t,n){function s(e){function r(e,t,r){var i={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};i[e]?n[i[e]]=t:r||(n[e]=t)}var t=e.required_features,n={};if(typeof t=="string")o.each(t.split(/\s*,\s*/),function(e){r(e,!0)});else if(typeof t=="object")o.each(t,function(e,t){r(t,e)});else if(t===!0){e.chunk_size>0&&(n.slice_blob=!0);if(e.resize.enabled||!e.multipart)n.send_binary_string=!0;o.each(e,function(e,t){r(t,!!e,!0)})}return n}var r=e.setTimeout,i={},o={VERSION:"2.1.2",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:t.mimes,ua:t.ua,typeOf:t.typeOf,extend:t.extend,guid:t.guid,get:function(n){var r=[],i;t.typeOf(n)!=="array"&&(n=[n]);var s=n.length;while(s--)i=t.get(n[s]),i&&r.push(i);return r.length?r:null},each:t.each,getPos:t.getPos,getSize:t.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},n=/[<>&\"\']/g;return e?(""+e).replace(n,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:t.toArray,inArray:t.inArray,addI18n:t.addI18n,translate:t.translate,isEmptyObj:t.isEmptyObj,hasClass:t.hasClass,addClass:t.addClass,removeClass:t.removeClass,getStyle:t.getStyle,addEvent:t.addEvent,removeEvent:t.removeEvent,removeAllEvents:t.removeAllEvents,cleanName:function(e){var t,n;n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(t=0;t0?"&":"?")+n),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===n||/\D/.test(e))return o.translate("N/A");var r=Math.pow(1024,4);return e>r?t(e/r,1)+" "+o.translate("tb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("gb"):e>(r/=1024)?t(e/r,1)+" "+o.translate("mb"):e>1024?Math.round(e/1024)+" "+o.translate("kb"):e+" "+o.translate("b")},parseSize:t.parseSizeStr,predictRuntime:function(e,n){var r,i;return r=new o.Uploader(e),i=t.Runtime.thatCan(r.getOption().required_features,n||e.runtimes),r.destroy(),i},addFileFilter:function(e,t){i[e]=t}};o.addFileFilter("mime_types",function(e,t,n){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:o.FILE_EXTENSION_ERROR,message:o.translate("File extension error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("max_file_size",function(e,t,n){var r;e=o.parseSize(e),t.size!==r&&e&&t.size>e?(this.trigger("Error",{code:o.FILE_SIZE_ERROR,message:o.translate("File size error."),file:t}),n(!1)):n(!0)}),o.addFileFilter("prevent_duplicates",function(e,t,n){if(e){var r=this.files.length;while(r--)if(t.name===this.files[r].name&&t.size===this.files[r].size){this.trigger("Error",{code:o.FILE_DUPLICATE_ERROR,message:o.translate("Duplicate file error."),file:t}),n(!1);return}}n(!0)}),o.Uploader=function(e){function g(){var e,t=0,n;if(this.state==o.STARTED){for(n=0;n0?Math.ceil(e.loaded/e.size*100):100,b()}function b(){var e,t;d.reset();for(e=0;e0?Math.ceil(d.uploaded/f.length*100):0:(d.bytesPerSec=Math.ceil(d.loaded/((+(new Date)-p||1)/1e3)),d.percent=d.size>0?Math.ceil(d.loaded/d.size*100):0)}function w(){var e=c[0]||h[0];return e?e.getRuntime().uid:!1}function E(e,n){if(e.ruid){var r=t.Runtime.getInfo(e.ruid);if(r)return r.can(n)}return!1}function S(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",O),this.bind("BeforeUpload",C),this.bind("UploadFile",k),this.bind("UploadProgress",L),this.bind("StateChanged",A),this.bind("QueueChanged",b),this.bind("Error",_),this.bind("FileUploaded",M),this.bind("Destroy",D)}function x(e,n){var r=this,i=0,s=[],u={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:l,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};o.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(u[t]=e[t])}),e.browse_button&&o.each(e.browse_button,function(n){s.push(function(s){var a=new t.FileInput(o.extend({},u,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:n}));a.onready=function(){var e=t.Runtime.getInfo(this.ruid);t.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),i++,c.push(this),s()},a.onchange=function(){r.addFile(this.files)},a.bind("mouseenter mouseleave mousedown mouseup",function(r){v||(e.browse_button_hover&&("mouseenter"===r.type?t.addClass(n,e.browse_button_hover):"mouseleave"===r.type&&t.removeClass(n,e.browse_button_hover)),e.browse_button_active&&("mousedown"===r.type?t.addClass(n,e.browse_button_active):"mouseup"===r.type&&t.removeClass(n,e.browse_button_active)))}),a.bind("mousedown",function(){r.trigger("Browse")}),a.bind("error runtimeerror",function(){a=null,s()}),a.init()})}),e.drop_element&&o.each(e.drop_element,function(e){s.push(function(n){var s=new t.FileDrop(o.extend({},u,{drop_zone:e}));s.onready=function(){var e=t.Runtime.getInfo(this.ruid);r.features.dragdrop=e.can("drag_and_drop"),i++,h.push(this),n()},s.ondrop=function(){r.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,n()}),s.init()})}),t.inSeries(s,function(){typeof n=="function"&&n(i)})}function T(e,r,i){var s=new t.Image;try{s.onload=function(){if(r.width>this.width&&r.height>this.height&&r.quality===n&&r.preserve_headers&&!r.crop)return this.destroy(),i(e);s.downsize(r.width,r.height,r.crop,r.preserve_headers)},s.onresize=function(){i(this.getAsBlob(e.type,r.quality)),this.destroy()},s.onerror=function(){i(e)},s.load(e)}catch(o){i(e)}}function N(e,n,r){function f(e,t,n){var r=a[e];switch(e){case"max_file_size":e==="max_file_size"&&(a.max_file_size=a.filters.max_file_size=t);break;case"chunk_size":if(t=o.parseSize(t))a[e]=t,a.send_file_name=!0;break;case"multipart":a[e]=t,t||(a.send_file_name=!0);break;case"unique_names":a[e]=t,t&&(a.send_file_name=!0);break;case"filters":o.typeOf(t)==="array"&&(t={mime_types:t}),n?o.extend(a.filters,t):a.filters=t,t.mime_types&&(a.filters.mime_types.regexp=function(e){var t=[];return o.each(e,function(e){o.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(a.filters.mime_types));break;case"resize":n?o.extend(a.resize,t,{enabled:!0}):a.resize=t;break;case"prevent_duplicates":a.prevent_duplicates=a.filters.prevent_duplicates=!!t;break;case"browse_button":case"drop_element":t=o.get(t);case"container":case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":a[e]=t,n||(u=!0);break;default:a[e]=t}n||i.trigger("OptionChanged",e,t,r)}var i=this,u=!1;typeof e=="object"?o.each(e,function(e,t){f(t,e,r)}):f(e,n,r),r?(a.required_features=s(o.extend({},a)),l=s(o.extend({},a,{required_features:!0}))):u&&(i.trigger("Destroy"),x.call(i,a,function(e){e?(i.runtime=t.Runtime.getInfo(w()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})}))}function C(e,t){if(e.settings.unique_names){var n=t.name.match(/\.([^.]+)$/),r="part";n&&(r=n[1]),t.target_name=t.id+"."+r}}function k(e,n){function h(){u-->0?r(p,1e3):(n.loaded=f,e.trigger("Error",{code:o.HTTP_ERROR,message:o.translate("HTTP Error."),file:n,response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()}))}function p(){var d,v,g={},y;if(n.status!==o.UPLOADING||e.state===o.STOPPED)return;e.settings.send_file_name&&(g.name=n.target_name||n.name),s&&a.chunks&&c.size>s?(y=Math.min(s,c.size-f),d=c.slice(f,f+y)):(y=c.size,d=c),s&&a.chunks&&(e.settings.send_chunk_number?(g.chunk=Math.ceil(f/s),g.chunks=Math.ceil(c.size/s)):(g.offset=f,g.total=c.size)),m=new t.XMLHttpRequest,m.upload&&(m.upload.onprogress=function(t){n.loaded=Math.min(n.size,f+t.loaded),e.trigger("UploadProgress",n)}),m.onload=function(){if(m.status>=400){h();return}u=e.settings.max_retries,y=c.size?(n.size!=n.origSize&&(c.destroy(),c=null),e.trigger("UploadProgress",n),n.status=o.DONE,e.trigger("FileUploaded",n,{response:m.responseText,status:m.status,responseHeaders:m.getAllResponseHeaders()})):r(p,1)},m.onerror=function(){h()},m.onloadend=function(){this.destroy(),m=null},e.settings.multipart&&a.multipart?(m.open("post",i,!0),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),v=new t.FormData,o.each(o.extend(g,e.settings.multipart_params),function(e,t){v.append(t,e)}),v.append(e.settings.file_data_name,d),m.send(v,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(i=o.buildUrl(e.settings.url,o.extend(g,e.settings.multipart_params)),m.open("post",i,!0),m.setRequestHeader("Content-Type","application/octet-stream"),o.each(e.settings.headers,function(e,t){m.setRequestHeader(t,e)}),m.send(d,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:l,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url}))}var i=e.settings.url,s=e.settings.chunk_size,u=e.settings.max_retries,a=e.features,f=0,c;n.loaded&&(f=n.loaded=s?s*Math.floor(n.loaded/s):0),c=n.getSource(),e.settings.resize.enabled&&E(c,"send_binary_string")&&!!~t.inArray(c.type,["image/jpeg","image/png"])?T.call(this,c,e.settings.resize,function(e){c=e,n.size=e.size,p()}):p()}function L(e,t){y(t)}function A(e){if(e.state==o.STARTED)p=+(new Date);else if(e.state==o.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==o.UPLOADING&&(e.files[t].status=o.QUEUED,b())}function O(){m&&m.abort()}function M(e){b(),r(function(){g.call(e)},1)}function _(e,t){t.code===o.INIT_ERROR?e.destroy():t.file&&(t.file.status=o.FAILED,y(t.file),e.state==o.STARTED&&(e.trigger("CancelUpload"),r(function(){g.call(e)},1)))}function D(e){e.stop(),o.each(f,function(e){e.destroy()}),f=[],c.length&&(o.each(c,function(e){e.destroy()}),c=[]),h.length&&(o.each(h,function(e){e.destroy()}),h=[]),l={},v=!1,p=m=null,d.reset()}var u=o.guid(),a,f=[],l={},c=[],h=[],p,d,v=!1,m;a={runtimes:t.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},N.call(this,e,null,!0),d=new o.QueueProgress,o.extend(this,{id:u,uid:u,state:o.STOPPED,features:{},runtime:null,files:f,settings:a,total:d,init:function(){var e=this;typeof a.preinit=="function"?a.preinit(e):o.each(a.preinit,function(t,n){e.bind(n,t)}),S.call(this);if(!a.browse_button||!a.url){this.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")});return}x.call(this,a,function(n){typeof a.init=="function"?a.init(e):o.each(a.init,function(t,n){e.bind(n,t)}),n?(e.runtime=t.Runtime.getInfo(w()).type,e.trigger("Init",{runtime:e.runtime}),e.trigger("PostInit")):e.trigger("Error",{code:o.INIT_ERROR,message:o.translate("Init error.")})})},setOption:function(e,t){N.call(this,e,t,!this.runtime)},getOption:function(e){return e?a[e]:a},refresh:function(){c.length&&o.each(c,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=o.STARTED&&(this.state=o.STARTED,this.trigger("StateChanged"),g.call(this))},stop:function(){this.state!=o.STOPPED&&(this.state=o.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){v=arguments[0]!==n?arguments[0]:!0,c.length&&o.each(c,function(e){e.disable(v)}),this.trigger("DisableBrowse",v)},getFile:function(e){var t;for(t=f.length-1;t>=0;t--)if(f[t].id===e)return f[t]},addFile:function(e,n){function c(e,n){var r=[];t.each(s.settings.filters,function(t,n){i[n]&&r.push(function(r){i[n].call(s,t,e,function(e){r(!e)})})}),t.inSeries(r,n)}function h(e){var i=t.typeOf(e);if(e instanceof t.File){if(!e.ruid&&!e.isDetached()){if(!l)return!1;e.ruid=l,e.connectRuntime(l)}h(new o.File(e))}else e instanceof t.Blob?(h(e.getSource()),e.destroy()):e instanceof o.File?(n&&(e.name=n),u.push(function(t){c(e,function(n){n||(f.push(e),a.push(e),s.trigger("FileFiltered",e)),r(t,1)})})):t.inArray(i,["file","blob"])!==-1?h(new t.File(null,e)):i==="node"&&t.typeOf(e.files)==="filelist"?t.each(e.files,h):i==="array"&&(n=null,t.each(e,h))}var s=this,u=[],a=[],l;l=w(),h(e),u.length&&t.inSeries(u,function(){a.length&&s.trigger("FilesAdded",a)})},removeFile:function(e){var t=typeof e=="string"?e:e.id;for(var n=f.length-1;n>=0;n--)if(f[n].id===t)return this.splice(n,1)[0]},splice:function(e,t){var r=f.splice(e===n?0:e,t===n?f.length:t),i=!1;return this.state==o.STARTED&&(o.each(r,function(e){if(e.status===o.UPLOADING)return i=!0,!1}),i&&this.stop()),this.trigger("FilesRemoved",r),o.each(r,function(e){e.destroy()}),i&&this.start(),r},bind:function(e,t,n){var r=this;o.Uploader.prototype.bind.call(this,e,function(){var e=[].slice.call(arguments);return e.splice(0,1,r),t.apply(this,e)},0,n)},destroy:function(){this.trigger("Destroy"),a=d=null,this.unbindAll()}})},o.Uploader.prototype=t.EventTarget.instance,o.File=function(){function n(n){o.extend(this,{id:o.guid(),name:n.name||n.fileName,type:n.type||"",size:n.size||n.fileSize,origSize:n.size||n.fileSize,loaded:0,percent:0,status:o.QUEUED,lastModifiedDate:n.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return t.inArray(t.typeOf(e),["blob","file"])!==-1?e:null},getSource:function(){return e[this.id]?e[this.id]:null},destroy:function(){var t=this.getSource();t&&(t.destroy(),delete e[this.id])}}),e[this.id]=n}var e={};return n}(),o.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=o})(window,mOxie); \ No newline at end of file diff --git a/lib/plupload-2.1.2/license.txt b/lib/plupload-2.1.2/license.txt new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/lib/plupload-2.1.2/license.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/lib/plupload-2.1.2/readme.md b/lib/plupload-2.1.2/readme.md new file mode 100644 index 0000000..8fa2238 --- /dev/null +++ b/lib/plupload-2.1.2/readme.md @@ -0,0 +1,147 @@ +# Plupload + +Plupload is a cross-browser multi-runtime file uploading API. Basically, a set of tools that will help you to +build a reliable and visually appealing file uploader in minutes. + +Historically, Plupload comes from a dark and hostile age of no HTML5, hence all the alternative fallbacks, +like Flash, Silverlight and Java (still in development). It is meant to provide an API, that +will work anywhere and in any case, in one way or another. While having very solid fallbacks, Plupload +is built with the future of HTML5 in mind. + +### Table of Contents +* [Backstory](https://github.com/moxiecode/plupload/blob/master/readme.md#backstory) +* [Structure](https://github.com/moxiecode/plupload/blob/master/readme.md#structure) + * [File API and XHR L2 pollyfills](https://github.com/moxiecode/moxie/blob/master/README.md) + * [Plupload API](https://github.com/moxiecode/plupload/wiki/API) + * [UI Widget](https://github.com/moxiecode/plupload/wiki/UI.Plupload) + * [Queue Widget](https://github.com/moxiecode/plupload/wiki/pluploadQueue) +* [Demos](https://github.com/jayarjo/plupload-demos/blob/master/README.md) +* [Building Instructions](https://github.com/moxiecode/plupload/blob/master/readme.md#build) +* [Getting Started](https://github.com/moxiecode/plupload/wiki/Getting-Started) + * [Options](https://github.com/moxiecode/plupload/wiki/Options) + * [Events](https://github.com/moxiecode/plupload/wiki/Uploader#wiki-events) + * [Methods](https://github.com/moxiecode/plupload/wiki/Uploader#wiki-methods) + * [Plupload in Your Language](https://github.com/moxiecode/plupload/wiki/Plupload-in-Your-Language) + * [File Filters](https://github.com/moxiecode/plupload/wiki/File-Filters) + * [Image Resizing on Client-Side](https://github.com/moxiecode/plupload/wiki/Image-Resizing-on-Client-Side) + * [Chunking](https://github.com/moxiecode/plupload/wiki/Chunking) + * [Upload to Amazon S3](https://github.com/moxiecode/plupload/wiki/Upload-to-Amazon-S3) +* [FAQ](https://github.com/moxiecode/plupload/wiki/Frequently-Asked-Questions) +* [Support](https://github.com/moxiecode/plupload/blob/master/readme.md##support) + * [Create a Fiddle](https://github.com/moxiecode/plupload/wiki/Create-a-Fiddle) +* [Contributing](https://github.com/moxiecode/plupload/blob/master/readme.md#contribute) +* [License](https://github.com/moxiecode/plupload/blob/master/readme.md#license) +* [Contact Us](http://www.moxiecode.com/contact.php) + + +### Backstory + +Plupload started in a time when uploading a file in a responsive and customizable manner was a real pain. +Internally, browsers only had the `input[type="file"]` element. It was ugly and clunky at the same time. +One couldn't even change it's visuals, without hiding it and coding another one on top of it from scratch. +And then there was no progress indication for the upload process... Sounds pretty crazy today. + +It was very logical for developers to look for alternatives and writing their own implementations, using +Flash and Java, in order to somehow extend limited browser capabilities. And so did we, in our search for +a reliable and flexible file uploader for +our [TinyMCE](http://www.tinymce.com/index.php)'s +[MCImageManager](http://www.tinymce.com/enterprise/mcimagemanager.php). + +Quickly enough though, Plupload grew big. It easily split into a standalone project. +With major *version 2.0* it underwent another huge reconstruction, basically +[from the ground up](http://blog.moxiecode.com/2012/11/28/first-public-beta-plupload-2/), +as all the low-level runtime logic has been extracted into separate [File API](http://www.w3.org/TR/FileAPI/) +and [XHR L2](http://www.w3.org/TR/XMLHttpRequest/) pollyfills (currently known under combined name of [mOxie](https://github.com/moxiecode/moxie)), +giving Plupload a chance to evolve further. + + +### Structure + +Currently, Plupload may be considered as consisting of three parts: low-level pollyfills, +Plupload API and Widgets (UI and Queue). Initially, Widgets were meant only to serve as examples +of the API, but quickly formed into fully-functional API implementations that now come bundled with +the Plupload API. This has been a source for multiple misconceptions about the API as Widgets were +easily mistaken for the Plupload itself. They are only implementations, such as any of you can +build by yourself out of the API. + +* [Low-level pollyfills (mOxie)](https://github.com/moxiecode/moxie) - have their own [code base](https://github.com/moxiecode/moxie) and [documentation](https://github.com/moxiecode/moxie/wiki) on GitHub. +* [Plupload API](https://github.com/moxiecode/plupload/wiki/API) +* [UI Widget](https://github.com/moxiecode/plupload/wiki/UI.Plupload) +* [Queue Widget](https://github.com/moxiecode/plupload/wiki/pluploadQueue) + + +### Building instructions + +Plupload depends on File API and XHR2 L2 pollyfills that currently have their +[own repository](https://github.com/moxiecode/moxie) on GitHub. However, in most cases you shouldn't +care as we bundle the latest build of mOxie, including full and minified JavaScript source and +pre-compiled `SWF` and `XAP` components, with [every release](https://github.com/moxiecode/plupload/releases). You can find everything you may need under `js/` folder. + +There are cases where you might need a custom build, for example free of unnecessary runtimes, half the +original size, etc. The difficult part of this task comes from mOxie and its set of additional runtimes +that require special tools on your workstation in order to compile. +Consider [build instructions for mOxie](https://github.com/moxiecode/moxie#build-instructions) - +everything applies to Plupload as well. + +First of all, if you want to build custom Plupload packages you will require [Node.js](http://nodejs.org/), +as this is our build environment of choice. Node.js binaries (as well as Source) +[are available](http://nodejs.org/download/) for all major operating systems. + +Plupload includes _mOxie_ as a submodule, it also depends on some other repositories for building up it's dev +environment - to avoid necessity of downloading them one by one, we recommended you to simply clone Plupload +with [git](http://git-scm.com/) recursively (you will require git installed on your system for this operation +to succeed): + +``` +git clone --recursive https://github.com/moxiecode/plupload.git +``` + +And finalize the preparation stage with: `npm install` - this will install all additional modules, including those +required by dev and test environments. In case you would rather keep it minimal, add a `--production` flag. + +*Note:* Currently, for an unknown reason, locally installed Node.js modules on Windows, may not be automatically +added to the system PATH. So, if `jake` commands below are not recognized you will need to add them manually: + +``` +set PATH=%PATH%;%CD%\node_modules\.bin\ +``` + + +### Support + +We are actively standing behind the Plupload and now that we are done with major rewrites and refactoring, +the only real goal that we have ahead is making it as reliable and bulletproof as possible. We are open to +all the suggestions and feature requests. We ask you to file bug reports if you encounter any. We may not +react to them instantly, but we constantly bear them in my mind as we extend the code base. + +In addition to dedicated support for those who dare to buy our OEM licenses, we got +[discussion boards](http://www.plupload.com/punbb/index.php), which is like an enormous FAQ, +covering every possible application case. Of course, you are welcome to file a bug report or feature request, +here on [GitHub](https://github.com/moxiecode/plupload/issues). + +Sometimes it is easier to notice the problem when bug report is accompained by the actual code. Consider providing +[a Plupload fiddle](https://github.com/moxiecode/plupload/wiki/Create-a-Fiddle) for the troublesome code. + + +### Contributing + +We are open to suggestions and code revisions, however there are some rules and limitations that you might +want to consider first. + +* Code that you contribute will automatically be licensed under the LGPL, but will not be limited to LGPL. +* Although all contributors will get the credit for their work, copyright notices will be changed to [Moxiecode Systems AB](http://www.moxiecode.com/). +* Third party code will be reviewed, tested and possibly modified before being released. + +These basic rules help us earn a living and ensure that code remains Open Source and compatible with LGPL license. All contributions will be added to the changelog and appear in every release and on the site. + +An easy place to start is to [translate Plupload to your language](https://github.com/moxiecode/plupload/wiki/Plupload-in-Your-Language#contribute). + +You can read more about how to contribute at: [http://www.plupload.com/contributing](http://www.plupload.com/contributing) + + +### License + +Copyright 2013, [Moxiecode Systems AB](http://www.moxiecode.com/) +Released under [GPLv2 License](https://github.com/moxiecode/plupload/blob/master/license.txt). + +We also provide [commercial license](http://www.plupload.com/commercial.php). diff --git a/lib/wangEditor.min.js b/lib/wangEditor.min.js new file mode 100644 index 0000000..dd2ede2 --- /dev/null +++ b/lib/wangEditor.min.js @@ -0,0 +1,4 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.wangEditor=t()}(this,function(){"use strict";function e(e){var t=void 0;return t=document.createElement("div"),t.innerHTML=e,t.children}function t(e){return!!e&&(e instanceof HTMLCollection||e instanceof NodeList)}function n(e){var n=document.querySelectorAll(e);return t(n)?n:[n]}function i(o){if(o){if(o instanceof i)return o;this.selector=o;var A=o.nodeType,r=[];9===A?r=[o]:1===A?r=[o]:t(o)||o instanceof Array?r=o:"string"==typeof o&&(o=o.replace("/\n/mg","").trim(),r=0===o.indexOf("<")?e(o):n(o));var c=r.length;if(!c)return this;var a=void 0;for(a=0;a/gm,">").replace(/"/gm,""").replace(/(\r\n|\r|\n)/g,"
          ")}function s(e){return"function"==typeof e}function l(e){this.editor=e,this.$elem=o('
          \n \n
          '),this.type="click",this._active=!1}function d(e,t){var n=this,i=e.editor;this.menu=e,this.opt=t;var A=o('
          '),r=t.$title,c=void 0;r&&(c=r.html(),c=O(i,c),r.html(c),r.addClass("w-e-dp-title"),A.append(r));var a=t.list||[],s=t.type||"list",l=t.onClick||$,d=o('
            ');A.append(d),a.forEach(function(e){var t=e.$elem,A=t.html();A=O(i,A),t.html(A);var r=e.value,c=o('
          • ');t&&(c.append(t),d.append(c),c.on("click",function(e){l(r),n.hideTimeoutId=setTimeout(function(){n.hide()},0)}))}),A.on("mouseleave",function(e){n.hideTimeoutId=setTimeout(function(){n.hide()},0)}),this.$container=A,this._rendered=!1,this._show=!1}function u(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:100,$title:o("

            设置标题

            "),type:"list",list:[{$elem:o("

            H1

            "),value:"

            "},{$elem:o("

            H2

            "),value:"

            "},{$elem:o("

            H3

            "),value:"

            "},{$elem:o("

            H4

            "),value:"

            "},{$elem:o("

            H5
            "),value:"
            "},{$elem:o("

            正文

            "),value:"

            "}],onClick:function(e){t._command(e)}})}function h(e){var t=this;this.editor=e,this.$elem=o('

            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:160,$title:o("

            字号

            "),type:"list",list:[{$elem:o('x-small'),value:"1"},{$elem:o('small'),value:"2"},{$elem:o("normal"),value:"3"},{$elem:o('large'),value:"4"},{$elem:o('x-large'),value:"5"},{$elem:o('xx-large'),value:"6"}],onClick:function(e){t._command(e)}})}function p(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1;var n=e.config,i=n.fontNames||[];this.droplist=new d(this,{width:100,$title:o("

            字体

            "),type:"list",list:i.map(function(e){return{$elem:o(''+e+""),value:e}}),onClick:function(e){t._command(e)}})}function f(e,t){this.menu=e,this.opt=t}function m(e){this.editor=e,this.$elem=o('
            '),this.type="panel",this._active=!1}function g(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function w(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function v(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function E(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function b(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function B(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:120,$title:o("

            设置列表

            "),type:"list",list:[{$elem:o(' 有序列表'),value:"insertOrderedList"},{$elem:o(' 无序列表'),value:"insertUnorderedList"}],onClick:function(e){t._command(e)}})}function y(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:100,$title:o("

            对齐方式

            "),type:"list",list:[{$elem:o(' 靠左'),value:"justifyLeft"},{$elem:o(' 居中'),value:"justifyCenter"},{$elem:o(' 靠右'),value:"justifyRight"}],onClick:function(e){t._command(e)}})}function C(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist";var n=e.config,i=n.colors||[];this._active=!1,this.droplist=new d(this,{width:120,$title:o("

            文字颜色

            "),type:"inline-block",list:i.map(function(e){return{$elem:o(''),value:e}}),onClick:function(e){t._command(e)}})}function x(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist";var n=e.config,i=n.colors||[];this._active=!1,this.droplist=new d(this,{width:120,$title:o("

            背景色

            "),type:"inline-block",list:i.map(function(e){return{$elem:o(''),value:e}}),onClick:function(e){t._command(e)}})}function I(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function Q(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="panel",this._active=!1}function M(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="panel",this._active=!1}function S(e){this.editor=e,this.$elem=o('
            '),this.type="panel",this._active=!1}function k(e){this.editor=e,this.$elem=o('
            '),this.type="panel",this._active=!1}function D(e){this.editor=e;var t=c("w-e-img");this.$elem=o('
            '),e.imgMenuId=t,this.type="panel",this._active=!1}function _(e){this.editor=e,this.menus={}}function N(e){var t=e.clipboardData||e.originalEvent&&e.originalEvent.clipboardData,n=void 0;return n=null==t?window.clipboardData&&window.clipboardData.getData("text"):t.getData("text/plain"),a(n)}function F(e,t,n){var i=e.clipboardData||e.originalEvent&&e.originalEvent.clipboardData,o=void 0,A=void 0;if(null==i?o=window.clipboardData&&window.clipboardData.getData("text"):(o=i.getData("text/plain"),A=i.getData("text/html")),!A&&o&&(A="

            "+a(o)+"

            "),A){var r=A.split("");return 2===r.length&&(A=r[0]),A=A.replace(/<(meta|script|link).+?>/gim,""),A=A.replace(//gm,""),A=A.replace(/\s?data-.+?=('|").+?('|")/gim,""),n&&(A=A.replace(//gim,"")),A=t?A.replace(/\s?(class|style)=('|").*?('|")/gim,""):A.replace(/\s?class=('|").*?('|")/gim,"")}}function T(e){var t=[];if(N(e))return t;var n=e.clipboardData||e.originalEvent&&e.originalEvent.clipboardData||{},i=n.items;return i?(A(i,function(e,n){var i=n.type;/image/i.test(i)&&t.push(n.getAsFile())}),t):t}function R(e){var t=[];return(e.childNodes()||[]).forEach(function(e){var n=void 0,i=e.nodeType;if(3===i&&(n=e.textContent,n=a(n)),1===i){n={},n.tag=e.nodeName.toLowerCase();for(var A=[],r=e.attributes||{},c=r.length||0,s=0;s
      • ')}function L(e){this.editor=e}function j(e,t){if(null==e)throw new Error("错误:初始化编辑器时候未传入任何参数,请查阅文档");this.id="wangEditor-"+W++,this.toolbarSelector=e,this.textSelector=t,this.customConfig={}}var G=[];i.prototype={constructor:i,forEach:function(e){var t=void 0;for(t=0;t=t&&(e%=t),o(this[e])},first:function(){return this.get(0)},last:function(){var e=this.length;return this.get(e-1)},on:function(e,t,n){n||(n=t,t=null);var i=[];return i=e.split(/\s+/),this.forEach(function(e){i.forEach(function(i){if(i){if(G.push({elem:e,type:i,fn:n}),!t)return void e.addEventListener(i,n);e.addEventListener(i,function(e){var i=e.target;i.matches(t)&&n.call(i,e)})}})})},off:function(e,t){return this.forEach(function(n){n.removeEventListener(e,t)})},attr:function(e,t){return null==t?this[0].getAttribute(e):this.forEach(function(n){n.setAttribute(e,t)})},addClass:function(e){return e?this.forEach(function(t){var n=void 0;t.className?(n=t.className.split(/\s/),n=n.filter(function(e){return!!e.trim()}),n.indexOf(e)<0&&n.push(e),t.className=n.join(" ")):t.className=e}):this},removeClass:function(e){return e?this.forEach(function(t){var n=void 0;t.className&&(n=t.className.split(/\s/),n=n.filter(function(t){return!(!(t=t.trim())||t===e)}),t.className=n.join(" "))}):this},css:function(e,t){var n=e+":"+t+";";return this.forEach(function(t){var i=(t.getAttribute("style")||"").trim(),o=void 0,A=[];i?(o=i.split(";"),o.forEach(function(e){var t=e.split(":").map(function(e){return e.trim()});2===t.length&&A.push(t[0]+":"+t[1])}),A=A.map(function(t){return 0===t.indexOf(e)?n:t}),A.indexOf(n)<0&&A.push(n),t.setAttribute("style",A.join("; "))):t.setAttribute("style",n)})},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},children:function(){var e=this[0];return e?o(e.children):null},childNodes:function(){var e=this[0];return e?o(e.childNodes):null},append:function(e){return this.forEach(function(t){e.forEach(function(e){t.appendChild(e)})})},remove:function(){return this.forEach(function(e){if(e.remove)e.remove();else{var t=e.parentElement;t&&t.removeChild(e)}})},isContain:function(e){var t=this[0],n=e[0];return t.contains(n)},getSizeData:function(){return this[0].getBoundingClientRect()},getNodeName:function(){return this[0].nodeName},find:function(e){return o(this[0].querySelectorAll(e))},text:function(e){return e?this.forEach(function(t){t.innerHTML=e}):this[0].innerHTML.replace(/<.*?>/g,function(){return""})},html:function(e){var t=this[0];return null==e?t.innerHTML:(t.innerHTML=e,this)},val:function(){return this[0].value.trim()},focus:function(){return this.forEach(function(e){e.focus()})},parent:function(){return o(this[0].parentElement)},parentUntil:function(e,t){var n=document.querySelectorAll(e),i=n.length;if(!i)return null;var A=t||this[0];if("BODY"===A.nodeName)return null;var r=A.parentElement,c=void 0;for(c=0;c=0)){var n=t.editor,i=o("body"),A=n.$textContainerElem,r=this.opt,c=o('
        '),a=r.width||300;c.css("width",a+"px").css("margin-left",(0-a)/2+"px");var s=o('');c.append(s),s.on("click",function(){e.hide()});var l=o('
          '),d=o('
          ');c.append(l).append(d);var u=r.height;u&&d.css("height",u+"px").css("overflow-y","auto");var h=r.tabs||[],p=[],f=[];h.forEach(function(e,t){if(e){var i=e.title||"",A=e.tpl||"";i=O(n,i),A=O(n,A);var r=o('
        • '+i+"
        • ");l.append(r);var c=o(A);d.append(c),r._index=t,p.push(r),f.push(c),0===t?(r._active=!0,r.addClass("w-e-active")):c.hide(),r.on("click",function(e){r._active||(p.forEach(function(e){e._active=!1,e.removeClass("w-e-active")}),f.forEach(function(e){e.hide()}),r._active=!0,r.addClass("w-e-active"),c.show())})}}),c.on("click",function(e){e.stopPropagation()}),i.on("click",function(t){e.hide()}),A.append(c),h.forEach(function(t,n){if(t){(t.events||[]).forEach(function(t){var i=t.selector,o=t.type,A=t.fn||V;f[n].find(i).on(o,function(t){t.stopPropagation(),A(t)&&e.hide()})})}});var m=c.find("input[type=text],textarea");m.length&&m.get(0).focus(),this.$container=c,this._hideOtherPanels(),K.push(t)}},hide:function(){var e=this.menu,t=this.$container;t&&t.remove(),K=K.filter(function(t){return t!==e})},_hideOtherPanels:function(){K.length&&K.forEach(function(e){var t=e.panel||{};t.hide&&t.hide()})}},m.prototype={constructor:m,onClick:function(e){var t=this.editor,n=void 0;if(this._active){if(!(n=t.selection.getSelectionContainerElem()))return;t.selection.createRangeByElem(n),t.selection.restoreSelection(),this._createPanel(n.text(),n.attr("href"))}else t.selection.isSelectionEmpty()?this._createPanel("",""):this._createPanel(t.selection.getSelectionText(),"")},_createPanel:function(e,t){var n=this,i=c("input-link"),A=c("input-text"),r=c("btn-ok"),a=c("btn-del"),s=this._active?"inline-block":"none",l=new f(this,{width:300,tabs:[{title:"链接",tpl:'
          \n \n \n
          \n \n \n
          \n
          ',events:[{selector:"#"+r,type:"click",fn:function(){var e=o("#"+i),t=o("#"+A),r=e.val(),c=t.val();return n._insertLink(c,r),!0}},{selector:"#"+a,type:"click",fn:function(){return n._delLink(),!0}}]}]});l.show(),this.panel=l},_delLink:function(){if(this._active){var e=this.editor;if(e.selection.getSelectionContainerElem()){var t=e.selection.getSelectionText();e.cmd.do("insertHTML",""+t+"")}}},_insertLink:function(e,t){var n=this.editor,i=n.config,o=i.linkCheck,A=!0;o&&"function"==typeof o&&(A=o(e,t)),!0===A?n.cmd.do("insertHTML",'
          '+e+""):alert(A)},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=t.selection.getSelectionContainerElem();i&&("A"===i.getNodeName()?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active")))}},g.prototype={constructor:g,onClick:function(e){var t=this.editor,n=t.selection.isSelectionEmpty();n&&t.selection.createEmptyRange(),t.cmd.do("italic"),n&&(t.selection.collapseRange(),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("italic")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},w.prototype={constructor:w,onClick:function(e){this.editor.cmd.do("redo")}},v.prototype={constructor:v,onClick:function(e){var t=this.editor,n=t.selection.isSelectionEmpty();n&&t.selection.createEmptyRange(),t.cmd.do("strikeThrough"),n&&(t.selection.collapseRange(),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("strikeThrough")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},E.prototype={constructor:E,onClick:function(e){var t=this.editor,n=t.selection.isSelectionEmpty();n&&t.selection.createEmptyRange(),t.cmd.do("underline"),n&&(t.selection.collapseRange(),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("underline")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},b.prototype={constructor:b,onClick:function(e){this.editor.cmd.do("undo")}},B.prototype={constructor:B,_command:function(e){var t=this.editor,n=t.$textElem;if(t.selection.restoreSelection(),!t.cmd.queryCommandState(e)){t.cmd.do(e);var i=t.selection.getSelectionContainerElem();if("LI"===i.getNodeName()&&(i=i.parent()),!1!==/^ol|ul$/i.test(i.getNodeName())&&!i.equal(n)){var o=i.parent();o.equal(n)||(i.insertAfter(o),o.remove())}}},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("insertUnOrderedList")||t.cmd.queryCommandState("insertOrderedList")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},y.prototype={constructor:y,_command:function(e){this.editor.cmd.do(e)}},C.prototype={constructor:C,_command:function(e){this.editor.cmd.do("foreColor",e)}},x.prototype={constructor:x,_command:function(e){this.editor.cmd.do("backColor",e)}},I.prototype={constructor:I,onClick:function(e){var t=this.editor,n=t.selection.getSelectionContainerElem(),i=n.getNodeName();if(!J.isIE())return void("BLOCKQUOTE"===i?t.cmd.do("formatBlock","

          "):t.cmd.do("formatBlock","

          "));var A=void 0,r=void 0;if("P"===i)return A=n.text(),r=o("
          "+A+"
          "),r.insertAfter(n),void n.remove();"BLOCKQUOTE"===i&&(A=n.text(),r=o("

          "+A+"

          "),r.insertAfter(n),n.remove())},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=/^BLOCKQUOTE$/i,o=t.cmd.queryCommandValue("formatBlock");i.test(o)?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},Q.prototype={constructor:Q,onClick:function(e){var t=this.editor,n=t.selection.getSelectionStartElem(),i=t.selection.getSelectionEndElem(),A=t.selection.isSelectionEmpty(),r=t.selection.getSelectionText(),c=void 0;return n.equal(i)?A?void(this._active?this._createPanel(n.html()):this._createPanel()):(c=o(""+r+""),t.cmd.do("insertElem",c),t.selection.createRangeByElem(c,!1),void t.selection.restoreSelection()):void t.selection.restoreSelection()},_createPanel:function(e){var t=this;e=e||"";var n=e?"edit":"new",i=c("texxt"),A=c("btn"),r=new f(this,{width:500,tabs:[{title:"插入代码",tpl:'
          \n \n
          \n \n
          \n
          ',events:[{selector:"#"+A,type:"click",fn:function(){var e=o("#"+i),A=e.val()||e.html();return A=a(A),"new"===n?t._insertCode(A):t._updateCode(A),!0}}]}]});r.show(),this.panel=r},_insertCode:function(e){this.editor.cmd.do("insertHTML","
          "+e+"


          ")},_updateCode:function(e){var t=this.editor,n=t.selection.getSelectionContainerElem();n&&(n.html(e),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=t.selection.getSelectionContainerElem();if(i){var o=i.parent();"CODE"===i.getNodeName()&&"PRE"===o.getNodeName()?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}}},M.prototype={constructor:M,onClick:function(){this._createPanel()},_createPanel:function(){var e=this,t=this.editor,n=t.config,i=n.emotions||[],A=[];i.forEach(function(t){var n=t.type,i=t.content||[],r="";"emoji"===n&&i.forEach(function(e){e&&(r+=''+e+"")}),"image"===n&&i.forEach(function(e){var t=e.src,n=e.alt;t&&(r+=''+n+'')}),A.push({title:t.title,tpl:'
          '+r+"
          ",events:[{selector:"span.w-e-item",type:"click",fn:function(t){var n=t.target,i=o(n),A=i.getNodeName(),r=void 0;return r="IMG"===A?i.parent().html():""+i.html()+"",e._insert(r),!0}}]})});var r=new f(this,{width:300,height:200,tabs:A});r.show(),this.panel=r},_insert:function(e){this.editor.cmd.do("insertHTML",e)}},S.prototype={constructor:S,onClick:function(){this._active?this._createEditPanel():this._createInsertPanel()},_createInsertPanel:function(){var e=this,t=c("btn"),n=c("row"),i=c("col"),A=new f(this,{width:250,tabs:[{title:"插入表格",tpl:'
          \n

          \n 创建\n \n 行\n \n 列的表格\n

          \n
          \n \n
          \n
          ',events:[{selector:"#"+t,type:"click",fn:function(){var t=parseInt(o("#"+n).val()),A=parseInt(o("#"+i).val());return t&&A&&t>0&&A>0&&e._insert(t,A),!0}}]}]});A.show(),this.panel=A},_insert:function(e,t){var n=void 0,i=void 0,o='';for(n=0;n",0===n)for(i=0;i ";else for(i=0;i ";o+=""}o+="


          ";var A=this.editor;A.cmd.do("insertHTML",o),A.cmd.do("enableObjectResizing",!1),A.cmd.do("enableInlineTableEditing",!1)},_createEditPanel:function(){var e=this,t=c("add-row"),n=c("add-col"),i=c("del-row"),o=c("del-col"),A=c("del-table");new f(this,{width:320,tabs:[{title:"编辑表格",tpl:'
          \n
          \n \n \n \n \n
          \n
          \n \n \n
          ',events:[{selector:"#"+t,type:"click",fn:function(){return e._addRow(),!0}},{selector:"#"+n,type:"click",fn:function(){return e._addCol(),!0}},{selector:"#"+i,type:"click",fn:function(){return e._delRow(),!0}},{selector:"#"+o,type:"click",fn:function(){return e._delCol(),!0}},{selector:"#"+A,type:"click",fn:function(){return e._delTable(),!0}}]}]}).show()},_getLocationData:function(){var e={},t=this.editor,n=t.selection.getSelectionContainerElem();if(n){var i=n.getNodeName();if("TD"===i||"TH"===i){var o=n.parent(),A=o.children(),r=A.length;A.forEach(function(t,i){if(t===n[0])return e.td={index:i,elem:t,length:r},!1});var c=o.parent(),a=c.children(),s=a.length;return a.forEach(function(t,n){if(t===o[0])return e.tr={index:n,elem:t,length:s},!1}),e}}},_addRow:function(){var e=this._getLocationData();if(e){var t=e.tr,n=o(t.elem),i=e.td,A=i.length,r=document.createElement("tr"),c="",a=void 0;for(a=0;a ";r.innerHTML=c,o(r).insertAfter(n)}},_addCol:function(){var e=this._getLocationData();if(e){var t=e.tr,n=e.td,i=n.index;o(t.elem).parent().children().forEach(function(e){var t=o(e),n=t.children(),A=n.get(i),r=A.getNodeName().toLowerCase();o(document.createElement(r)).insertAfter(A)})}},_delRow:function(){var e=this._getLocationData();if(e){o(e.tr.elem).remove()}},_delCol:function(){var e=this._getLocationData();if(e){var t=e.tr,n=e.td,i=n.index;o(t.elem).parent().children().forEach(function(e){o(e).children().get(i).remove()})}},_delTable:function(){var e=this.editor,t=e.selection.getSelectionContainerElem();if(t){var n=t.parentUntil("table");n&&n.remove()}},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=t.selection.getSelectionContainerElem();if(i){var o=i.getNodeName();"TD"===o||"TH"===o?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}}},k.prototype={constructor:k,onClick:function(){this._createPanel()},_createPanel:function(){var e=this,t=c("text-val"),n=c("btn"),i=new f(this,{width:350,tabs:[{title:"插入视频",tpl:'
          \n \n
          \n \n
          \n
          ',events:[{selector:"#"+n,type:"click",fn:function(){var n=o("#"+t),i=n.val().trim();return i&&e._insert(i),!0}}]}]});i.show(),this.panel=i},_insert:function(e){this.editor.cmd.do("insertHTML",e+"


          ")}},D.prototype={constructor:D,onClick:function(){this.editor.config.qiniu||(this._active?this._createEditPanel():this._createInsertPanel())},_createEditPanel:function(){var e=this.editor,t=c("width-30"),n=c("width-50"),i=c("width-100"),o=c("del-btn"),A=[{title:"编辑图片",tpl:'
          \n
          \n 最大宽度:\n \n \n \n
          \n
          \n \n \n
          ',events:[{selector:"#"+t,type:"click",fn:function(){var t=e._selectedImg;return t&&t.css("max-width","30%"),!0}},{selector:"#"+n,type:"click",fn:function(){var t=e._selectedImg;return t&&t.css("max-width","50%"),!0}},{selector:"#"+i,type:"click",fn:function(){var t=e._selectedImg;return t&&t.css("max-width","100%"),!0}},{selector:"#"+o,type:"click",fn:function(){var t=e._selectedImg;return t&&t.remove(),!0}}]}],r=new f(this,{width:300,tabs:A});r.show(),this.panel=r},_createInsertPanel:function(){var e=this.editor,t=e.uploadImg,n=e.config,i=c("up-trigger"),A=c("up-file"),r=c("link-url"),a=c("link-btn"),s=[{title:"上传图片",tpl:'
          \n
          \n \n
          \n
          \n \n
          \n
          ',events:[{selector:"#"+i,type:"click",fn:function(){var e=o("#"+A),t=e[0];if(!t)return!0;t.click()}},{selector:"#"+A,type:"change",fn:function(){var e=o("#"+A),n=e[0];if(!n)return!0;var i=n.files;return i.length&&t.uploadImg(i),!0}}]},{title:"网络图片", +tpl:'
          \n \n
          \n \n
          \n
          ',events:[{selector:"#"+a,type:"click",fn:function(){var e=o("#"+r),n=e.val().trim();return n&&t.insertLinkImg(n),!0}}]}],l=[];(n.uploadImgShowBase64||n.uploadImgServer||n.customUploadImg)&&window.FileReader&&l.push(s[0]),n.showLinkImg&&l.push(s[1]);var d=new f(this,{width:300,tabs:l});d.show(),this.panel=d},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t._selectedImg?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}};var q={};q.bold=l,q.head=u,q.fontSize=h,q.fontName=p,q.link=m,q.italic=g,q.redo=w,q.strikeThrough=v,q.underline=E,q.undo=b,q.list=B,q.justify=y,q.foreColor=C,q.backColor=x,q.quote=I,q.code=Q,q.emoticon=M,q.table=S,q.video=k,q.image=D,_.prototype={constructor:_,init:function(){var e=this,t=this.editor;((t.config||{}).menus||[]).forEach(function(n){var i=q[n];i&&"function"==typeof i&&(e.menus[n]=new i(t))}),this._addToToolbar(),this._bindEvent()},_addToToolbar:function(){var e=this.editor,t=e.$toolbarElem,n=this.menus,i=e.config,o=i.zIndex+1;A(n,function(e,n){var i=n.$elem;i&&(i.css("z-index",o),t.append(i))})},_bindEvent:function(){var e=this.menus,t=this.editor;A(e,function(e,n){var i=n.type;if(i){var o=n.$elem,A=n.droplist;n.panel;"click"===i&&n.onClick&&o.on("click",function(e){null!=t.selection.getRange()&&n.onClick(e)}),"droplist"===i&&A&&o.on("mouseenter",function(e){null!=t.selection.getRange()&&(A.showTimeoutId=setTimeout(function(){A.show()},200))}).on("mouseleave",function(e){A.hideTimeoutId=setTimeout(function(){A.hide()},0)}),"panel"===i&&n.onClick&&o.on("click",function(e){e.stopPropagation(),null!=t.selection.getRange()&&n.onClick(e)})}})},changeActive:function(){A(this.menus,function(e,t){t.tryChangeActive&&setTimeout(function(){t.tryChangeActive()},100)})}},U.prototype={constructor:U,init:function(){this._bindEvent()},clear:function(){this.html("


          ")},html:function(e){var t=this.editor,n=t.$textElem,i=void 0;if(null==e)return i=n.html(),i=i.replace(/\u200b/gm,""),i;n.html(e),t.initSelection()},getJSON:function(){return R(this.editor.$textElem)},text:function(e){var t=this.editor,n=t.$textElem,i=void 0;if(null==e)return i=n.text(),i=i.replace(/\u200b/gm,""),i;n.text("

          "+e+"

          "),t.initSelection()},append:function(e){var t=this.editor;t.$textElem.append(o(e)),t.initSelection()},_bindEvent:function(){this._saveRangeRealTime(),this._enterKeyHandle(),this._clearHandle(),this._pasteHandle(),this._tabHandle(),this._imgHandle(),this._dragHandle()},_saveRangeRealTime:function(){function e(e){t.selection.saveRange(),t.menus.changeActive()}var t=this.editor,n=t.$textElem;n.on("keyup",e),n.on("mousedown",function(t){n.on("mouseleave",e)}),n.on("mouseup",function(t){e(),n.off("mouseleave",e)})},_enterKeyHandle:function(){function e(e){var t=o("


          ");t.insertBefore(e),i.selection.createRangeByElem(t,!0),i.selection.restoreSelection(),e.remove()}function t(t){var n=i.selection.getSelectionContainerElem(),o=n.parent();if("
          "===o.html())return void e(n);if(o.equal(A)){"P"!==n.getNodeName()&&(n.text()||e(n))}}function n(e){var t=i.selection.getSelectionContainerElem();if(t){var n=t.parent(),A=t.getNodeName(),r=n.getNodeName();if("CODE"===A&&"PRE"===r&&i.cmd.queryCommandSupported("insertHTML")){if(!0===i._willBreakCode){var c=o("


          ");return c.insertAfter(n),i.selection.createRangeByElem(c,!0),i.selection.restoreSelection(),i._willBreakCode=!1,void e.preventDefault()}var a=i.selection.getRange().startOffset;i.cmd.do("insertHTML","\n"),i.selection.saveRange(),i.selection.getRange().startOffset===a&&i.cmd.do("insertHTML","\n");var s=t.html().length;i.selection.getRange().startOffset+1===s&&(i._willBreakCode=!0),e.preventDefault()}}}var i=this.editor,A=i.$textElem;A.on("keyup",function(e){13===e.keyCode&&t(e)}),A.on("keydown",function(e){if(13!==e.keyCode)return void(i._willBreakCode=!1);n(e)})},_clearHandle:function(){var e=this.editor,t=e.$textElem;t.on("keydown",function(e){if(8===e.keyCode){return"


          "===t.html().toLowerCase().trim()?void e.preventDefault():void 0}}),t.on("keyup",function(n){if(8===n.keyCode){var i=void 0,A=t.html().toLowerCase().trim();A&&"
          "!==A||(i=o("


          "),t.html(""),t.append(i),e.selection.createRangeByElem(i,!1,!0),e.selection.restoreSelection())}})},_pasteHandle:function(){function e(){var e=Date.now(),t=!1;return e-a>=100&&(t=!0),a=e,t}function t(){a=0}var n=this.editor,i=n.config,o=i.pasteFilterStyle,A=i.pasteTextHandle,r=i.pasteIgnoreImg,c=n.$textElem,a=0;c.on("paste",function(i){if(!J.isIE()&&(i.preventDefault(),e())){var c=F(i,o,r),a=N(i);a=a.replace(/\n/gm,"
          ");var l=n.selection.getSelectionContainerElem();if(l){var d=l.getNodeName();if("CODE"===d||"PRE"===d)return A&&s(A)&&(a=""+(A(a)||"")),void n.cmd.do("insertHTML","

          "+a+"

          ");if(!c)return void t();try{A&&s(A)&&(c=""+(A(c)||"")),n.cmd.do("insertHTML",c)}catch(e){A&&s(A)&&(a=""+(A(a)||"")),n.cmd.do("insertHTML","

          "+a+"

          ")}}}}),c.on("paste",function(t){if(!J.isIE()&&(t.preventDefault(),e())){var i=T(t);if(i&&i.length){var o=n.selection.getSelectionContainerElem();if(o){var A=o.getNodeName();if("CODE"!==A&&"PRE"!==A){n.uploadImg.uploadImg(i)}}}}})},_tabHandle:function(){var e=this.editor;e.$textElem.on("keydown",function(t){if(9===t.keyCode&&e.cmd.queryCommandSupported("insertHTML")){var n=e.selection.getSelectionContainerElem();if(n){var i=n.parent(),o=n.getNodeName(),A=i.getNodeName();"CODE"===o&&"PRE"===A?e.cmd.do("insertHTML"," "):e.cmd.do("insertHTML","    "),t.preventDefault()}}})},_imgHandle:function(){var e=this.editor,t=e.$textElem;t.on("click","img",function(t){var n=this,i=o(n);"1"!==i.attr("data-w-e")&&(e._selectedImg=i,e.selection.createRangeByElem(i),e.selection.restoreSelection())}),t.on("click keyup",function(t){t.target.matches("img")||(e._selectedImg=null)})},_dragHandle:function(){var e=this.editor;o(document).on("dragleave drop dragenter dragover",function(e){e.preventDefault()}),e.$textElem.on("drop",function(t){t.preventDefault();var n=t.dataTransfer&&t.dataTransfer.files;n&&n.length&&e.uploadImg.uploadImg(n)})}},Y.prototype={constructor:Y,do:function(e,t){var n=this.editor;if(n._useStyleWithCSS||(document.execCommand("styleWithCSS",null,!0),n._useStyleWithCSS=!0),n.selection.getRange()){n.selection.restoreSelection();var i="_"+e;this[i]?this[i](t):this._execCommand(e,t),n.menus.changeActive(),n.selection.saveRange(),n.selection.restoreSelection(),n.change&&n.change()}},_insertHTML:function(e){var t=this.editor,n=t.selection.getRange();this.queryCommandSupported("insertHTML")?this._execCommand("insertHTML",e):n.insertNode?(n.deleteContents(),n.insertNode(o(e)[0])):n.pasteHTML&&n.pasteHTML(e)},_insertElem:function(e){var t=this.editor,n=t.selection.getRange();n.insertNode&&(n.deleteContents(),n.insertNode(e[0]))},_execCommand:function(e,t){document.execCommand(e,!1,t)},queryCommandValue:function(e){return document.queryCommandValue(e)},queryCommandState:function(e){return document.queryCommandState(e)},queryCommandSupported:function(e){return document.queryCommandSupported(e)}},P.prototype={constructor:P,getRange:function(){return this._currentRange},saveRange:function(e){if(e)return void(this._currentRange=e);var t=window.getSelection();if(0!==t.rangeCount){var n=t.getRangeAt(0),i=this.getSelectionContainerElem(n);if(i&&"false"!==i.attr("contenteditable")&&!i.parentUntil("[contenteditable=false]")){this.editor.$textElem.isContain(i)&&(this._currentRange=n)}}},collapseRange:function(e){null==e&&(e=!1);var t=this._currentRange;t&&t.collapse(e)},getSelectionText:function(){return this._currentRange?this._currentRange.toString():""},getSelectionContainerElem:function(e){e=e||this._currentRange;var t=void 0;if(e)return t=e.commonAncestorContainer,o(1===t.nodeType?t:t.parentNode)},getSelectionStartElem:function(e){e=e||this._currentRange;var t=void 0;if(e)return t=e.startContainer,o(1===t.nodeType?t:t.parentNode)},getSelectionEndElem:function(e){e=e||this._currentRange;var t=void 0;if(e)return t=e.endContainer,o(1===t.nodeType?t:t.parentNode)},isSelectionEmpty:function(){var e=this._currentRange;return!(!e||!e.startContainer||e.startContainer!==e.endContainer||e.startOffset!==e.endOffset)},restoreSelection:function(){var e=window.getSelection();e.removeAllRanges(),e.addRange(this._currentRange)},createEmptyRange:function(){var e=this.editor,t=this.getRange(),n=void 0;if(t&&this.isSelectionEmpty())try{J.isWebkit()?(e.cmd.do("insertHTML","​"),t.setEnd(t.endContainer,t.endOffset+1),this.saveRange(t)):(n=o(""),e.cmd.do("insertElem",n),this.createRangeByElem(n,!0))}catch(e){}},createRangeByElem:function(e,t,n){if(e.length){var i=e[0],o=document.createRange();n?o.selectNodeContents(i):o.selectNode(i),"boolean"==typeof t&&o.collapse(t),this.saveRange(o)}}},H.prototype={constructor:H,show:function(e){var t=this;if(!this._isShow){this._isShow=!0;var n=this.$bar;if(this._isRender)this._isRender=!0;else{this.$textContainer.append(n)}Date.now()-this._time>100&&e<=1&&(n.css("width",100*e+"%"),this._time=Date.now());var i=this._timeoutId;i&&clearTimeout(i),i=setTimeout(function(){t._hide()},500)}},_hide:function(){this.$bar.remove(),this._time=0,this._isShow=!1,this._isRender=!1}};var X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};L.prototype={constructor:L,_alert:function(e,t){var n=this.editor,i=n.config.debug,o=n.config.customAlert;if(i)throw new Error("wangEditor: "+(t||e));o&&"function"==typeof o?o(e):alert(e)},insertLinkImg:function(e){var t=this;if(e){var n=this.editor,i=n.config,o=i.linkImgCheck,A=void 0;if(o&&"function"==typeof o&&"string"==typeof(A=o(e)))return void alert(A);n.cmd.do("insertHTML",'');var r=document.createElement("img");r.onload=function(){var t=i.linkImgCallback;t&&"function"==typeof t&&t(e),r=null},r.onerror=function(){r=null,t._alert("插入图片错误",'wangEditor: 插入图片出错,图片链接是 "'+e+'",下载该链接失败')},r.onabort=function(){r=null},r.src=e}},uploadImg:function(e){var t=this;if(e&&e.length){var n=this.editor,i=n.config,o=i.uploadImgServer,c=i.uploadImgShowBase64,a=i.uploadImgMaxSize,s=a/1024/1024,l=i.uploadImgMaxLength||1e4,d=i.uploadFileName||"",u=i.uploadImgParams||{},h=i.uploadImgParamsWithUrl,p=i.uploadImgHeaders||{},f=i.uploadImgHooks||{},m=i.uploadImgTimeout||3e3,g=i.withCredentials;null==g&&(g=!1);var w=i.customUploadImg;if(w||o||c){var v=[],E=[];if(r(e,function(e){var t=e.name,n=e.size;if(t&&n)return!1===/\.(jpg|jpeg|png|bmp|gif|webp)$/i.test(t)?void E.push("【"+t+"】不是图片"):al)return void this._alert("一次最多上传"+l+"张图片");if(w&&"function"==typeof w)return void w(v,this.insertLinkImg.bind(this));var b=new FormData;if(r(v,function(e){var t=d||e.name;b.append(t,e)}),o&&"string"==typeof o){var B=o.split("#");o=B[0];var y=B[1]||"";A(u,function(e,t){h&&(o.indexOf("?")>0?o+="&":o+="?",o=o+e+"="+t),b.append(e,t)}),y&&(o+="#"+y);var C=new XMLHttpRequest;if(C.open("POST",o),C.timeout=m,C.ontimeout=function(){f.timeout&&"function"==typeof f.timeout&&f.timeout(C,n),t._alert("上传图片超时")},C.upload&&(C.upload.onprogress=function(e){var t=void 0,i=new H(n);e.lengthComputable&&(t=e.loaded/e.total,i.show(t))}),C.onreadystatechange=function(){var e=void 0;if(4===C.readyState){if(C.status<200||C.status>=300)return f.error&&"function"==typeof f.error&&f.error(C,n),void t._alert("上传图片发生错误","上传图片发生错误,服务器返回状态是 "+C.status);if(e=C.responseText,"object"!==(void 0===e?"undefined":X(e)))try{e=JSON.parse(e)}catch(i){return f.fail&&"function"==typeof f.fail&&f.fail(C,n,e),void t._alert("上传图片失败","上传图片返回结果错误,返回结果是: "+e)}if(f.customInsert||"0"==e.errno){if(f.customInsert&&"function"==typeof f.customInsert)f.customInsert(t.insertLinkImg.bind(t),e,n);else{(e.data||[]).forEach(function(e){t.insertLinkImg(e)})}f.success&&"function"==typeof f.success&&f.success(C,n,e)}else f.fail&&"function"==typeof f.fail&&f.fail(C,n,e),t._alert("上传图片失败","上传图片返回结果错误,返回结果 errno="+e.errno)}},f.before&&"function"==typeof f.before){var x=f.before(C,n,v);if(x&&"object"===(void 0===x?"undefined":X(x))&&x.prevent)return void this._alert(x.msg)}return A(p,function(e,t){C.setRequestHeader(e,t)}),C.withCredentials=g,void C.send(b)}c&&r(e,function(e){var n=t,i=new FileReader;i.readAsDataURL(e),i.onload=function(){n.insertLinkImg(this.result)}})}}}};var W=1;j.prototype={constructor:j,_initConfig:function(){var e={};this.config=Object.assign(e,z,this.customConfig);var t=this.config.lang||{},n=[];A(t,function(e,t){n.push({reg:new RegExp(e,"img"),val:t})}),this.config.langArgs=n},_initDom:function(){var e=this,t=this.toolbarSelector,n=o(t),i=this.textSelector,A=this.config,r=A.zIndex,a=void 0,s=void 0,l=void 0,d=void 0;null==i?(a=o("
          "),s=o("
          "),d=n.children(),n.append(a).append(s),a.css("background-color","#f1f1f1").css("border","1px solid #ccc"),s.css("border","1px solid #ccc").css("border-top","none").css("height","300px")):(a=n,s=o(i),d=s.children()),l=o("
          "),l.attr("contenteditable","true").css("width","100%").css("height","100%"),d&&d.length?l.append(d):l.append(o("


          ")),s.append(l),a.addClass("w-e-toolbar"),s.addClass("w-e-text-container"),s.css("z-index",r),l.addClass("w-e-text");var u=c("toolbar-elem");a.attr("id",u);var h=c("text-elem");l.attr("id",h),this.$toolbarElem=a,this.$textContainerElem=s,this.$textElem=l,this.toolbarElemId=u,this.textElemId=h;var p=!0;s.on("compositionstart",function(){p=!1}),s.on("compositionend",function(){p=!0}),s.on("click keyup",function(){p&&e.change&&e.change()}),a.on("click",function(){this.change&&this.change()}),(A.onfocus||A.onblur)&&(this.isFocus=!1,o(document).on("click",function(t){var n=l.isContain(o(t.target)),i=a.isContain(o(t.target)),A=a[0]==t.target;if(n)e.isFocus||e.onfocus&&e.onfocus(),e.isFocus=!0;else{if(i&&!A)return;e.isFocus&&e.onblur&&e.onblur(),e.isFocus=!1}}))},_initCommand:function(){this.cmd=new Y(this)},_initSelectionAPI:function(){this.selection=new P(this)},_initUploadImg:function(){this.uploadImg=new L(this)},_initMenus:function(){this.menus=new _(this),this.menus.init()},_initText:function(){this.txt=new U(this),this.txt.init()},initSelection:function(e){var t=this.$textElem,n=t.children();if(!n.length)return t.append(o("


          ")),void this.initSelection();var i=n.last();if(e){var A=i.html().toLowerCase(),r=i.getNodeName();if("
          "!==A&&"
          "!==A||"P"!==r)return t.append(o("


          ")),void this.initSelection()}this.selection.createRangeByElem(i,!1,!0),this.selection.restoreSelection()},_bindEvent:function(){var e=0,t=this.txt.html(),n=this.config,i=n.onchangeTimeout;(!(i=parseInt(i,10))||i<=0)&&(i=200);var o=n.onchange;o&&"function"==typeof o&&(this.change=function(){var n=this.txt.html();n.length===t.length&&n===t||(e&&clearTimeout(e),e=setTimeout(function(){o(n),t=n},i))});var A=n.onblur;A&&"function"==typeof A&&(this.onblur=function(){var e=this.txt.html();A(e)});var r=n.onfocus;r&&"function"==typeof r&&(this.onfocus=function(){r()})},create:function(){this._initConfig(),this._initDom(),this._initCommand(),this._initSelectionAPI(),this._initText(),this._initMenus(),this._initUploadImg(),this.initSelection(!0),this._bindEvent()},_offAllEvent:function(){o.offAll()}};try{document}catch(e){throw new Error("请在浏览器环境下运行")}!function(){"function"!=typeof Object.assign&&(Object.assign=function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),i=1;i=0&&t.item(n)!==this;);return n>-1})}();var Z=document.createElement("style");return Z.type="text/css", +Z.innerHTML='.w-e-toolbar,.w-e-text-container,.w-e-menu-panel { padding: 0; margin: 0; box-sizing: border-box;}.w-e-toolbar *,.w-e-text-container *,.w-e-menu-panel * { padding: 0; margin: 0; box-sizing: border-box;}.w-e-clear-fix:after { content: ""; display: table; clear: both;}.w-e-toolbar .w-e-droplist { position: absolute; left: 0; top: 0; background-color: #fff; border: 1px solid #f1f1f1; border-right-color: #ccc; border-bottom-color: #ccc;}.w-e-toolbar .w-e-droplist .w-e-dp-title { text-align: center; color: #999; line-height: 2; border-bottom: 1px solid #f1f1f1; font-size: 13px;}.w-e-toolbar .w-e-droplist ul.w-e-list { list-style: none; line-height: 1;}.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item { color: #333; padding: 5px 0;}.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item:hover { background-color: #f1f1f1;}.w-e-toolbar .w-e-droplist ul.w-e-block { list-style: none; text-align: left; padding: 5px;}.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item { display: inline-block; *display: inline; *zoom: 1; padding: 3px 5px;}.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item:hover { background-color: #f1f1f1;}@font-face { font-family: \'w-e-icon\'; src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABhQAAsAAAAAGAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIPBGNtYXAAAAFoAAABBAAAAQQrSf4BZ2FzcAAAAmwAAAAIAAAACAAAABBnbHlmAAACdAAAEvAAABLwfpUWUWhlYWQAABVkAAAANgAAADYQp00kaGhlYQAAFZwAAAAkAAAAJAfEA+FobXR4AAAVwAAAAIQAAACEeAcD7GxvY2EAABZEAAAARAAAAERBSEX+bWF4cAAAFogAAAAgAAAAIAAsALZuYW1lAAAWqAAAAYYAAAGGmUoJ+3Bvc3QAABgwAAAAIAAAACAAAwAAAAMD3gGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8fwDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAOgAAAA2ACAABAAWAAEAIOkG6Q3pEulH6Wbpd+m56bvpxunL6d/qDepc6l/qZepo6nHqefAN8BTxIPHc8fz//f//AAAAAAAg6QbpDekS6UfpZel36bnpu+nG6cvp3+oN6lzqX+pi6mjqcep38A3wFPEg8dzx/P/9//8AAf/jFv4W+Bb0FsAWoxaTFlIWURZHFkMWMBYDFbUVsxWxFa8VpxWiEA8QCQ7+DkMOJAADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACAAD/wAQAA8AABAATAAABNwEnAQMuAScTNwEjAQMlATUBBwGAgAHAQP5Anxc7MmOAAYDA/oDAAoABgP6ATgFAQAHAQP5A/p0yOxcBEU4BgP6A/YDAAYDA/oCAAAQAAAAABAADgAAQACEALQA0AAABOAExETgBMSE4ATEROAExITUhIgYVERQWMyEyNjURNCYjBxQGIyImNTQ2MzIWEyE1EwEzNwPA/IADgPyAGiYmGgOAGiYmGoA4KCg4OCgoOED9AOABAEDgA0D9AAMAQCYa/QAaJiYaAwAaJuAoODgoKDg4/biAAYD+wMAAAAIAAABABAADQAA4ADwAAAEmJy4BJyYjIgcOAQcGBwYHDgEHBhUUFx4BFxYXFhceARcWMzI3PgE3Njc2Nz4BNzY1NCcuAScmJwERDQED1TY4OXY8PT8/PTx2OTg2CwcICwMDAwMLCAcLNjg5djw9Pz89PHY5ODYLBwgLAwMDAwsIBwv9qwFA/sADIAgGBggCAgICCAYGCCkqKlktLi8vLi1ZKiopCAYGCAICAgIIBgYIKSoqWS0uLy8uLVkqKin94AGAwMAAAAAAAgDA/8ADQAPAABsAJwAAASIHDgEHBhUUFx4BFxYxMDc+ATc2NTQnLgEnJgMiJjU0NjMyFhUUBgIAQjs6VxkZMjJ4MjIyMngyMhkZVzo7QlBwcFBQcHADwBkZVzo7Qnh9fcxBQUFBzH19eEI7OlcZGf4AcFBQcHBQUHAAAAEAAAAABAADgAArAAABIgcOAQcGBycRISc+ATMyFx4BFxYVFAcOAQcGBxc2Nz4BNzY1NCcuAScmIwIANTIyXCkpI5YBgJA1i1BQRUZpHh4JCSIYGB5VKCAgLQwMKCiLXl1qA4AKCycbHCOW/oCQNDweHmlGRVArKClJICEaYCMrK2I2NjlqXV6LKCgAAQAAAAAEAAOAACoAABMUFx4BFxYXNyYnLgEnJjU0Nz4BNzYzMhYXByERByYnLgEnJiMiBw4BBwYADAwtICAoVR4YGCIJCR4eaUZFUFCLNZABgJYjKSlcMjI1al1eiygoAYA5NjZiKysjYBohIEkpKCtQRUZpHh48NJABgJYjHBsnCwooKIteXQAAAAACAAAAQAQBAwAAJgBNAAATMhceARcWFRQHDgEHBiMiJy4BJyY1JzQ3PgE3NjMVIgYHDgEHPgEhMhceARcWFRQHDgEHBiMiJy4BJyY1JzQ3PgE3NjMVIgYHDgEHPgHhLikpPRESEhE9KSkuLikpPRESASMjelJRXUB1LQkQBwgSAkkuKSk9ERISET0pKS4uKSk9ERIBIyN6UlFdQHUtCRAHCBICABIRPSkpLi4pKT0REhIRPSkpLiBdUVJ6IyOAMC4IEwoCARIRPSkpLi4pKT0REhIRPSkpLiBdUVJ6IyOAMC4IEwoCAQAABgBA/8AEAAPAAAMABwALABEAHQApAAAlIRUhESEVIREhFSEnESM1IzUTFTMVIzU3NSM1MxUVESM1MzUjNTM1IzUBgAKA/YACgP2AAoD9gMBAQECAwICAwMCAgICAgIACAIACAIDA/wDAQP3yMkCSPDJAku7+wEBAQEBAAAYAAP/ABAADwAADAAcACwAXACMALwAAASEVIREhFSERIRUhATQ2MzIWFRQGIyImETQ2MzIWFRQGIyImETQ2MzIWFRQGIyImAYACgP2AAoD9gAKA/YD+gEs1NUtLNTVLSzU1S0s1NUtLNTVLSzU1SwOAgP8AgP8AgANANUtLNTVLS/61NUtLNTVLS/61NUtLNTVLSwADAAAAAAQAA6AAAwANABQAADchFSElFSE1EyEVITUhJQkBIxEjEQAEAPwABAD8AIABAAEAAQD9YAEgASDggEBAwEBAAQCAgMABIP7g/wABAAAAAAACAB7/zAPiA7QAMwBkAAABIiYnJicmNDc2PwE+ATMyFhcWFxYUBwYPAQYiJyY0PwE2NCcuASMiBg8BBhQXFhQHDgEjAyImJyYnJjQ3Nj8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFxYUBwYPAQ4BIwG4ChMIIxISEhIjwCNZMTFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PCBMKuDFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PDysQIxISEhIjwCNZMQFECAckLS1eLS0kwCIlJSIkLS1eLS0kVxAQDysPWCl0KRQVFRTAKXQpDysQBwj+iCUiJC0tXi0tJFcQEA8rD1gpdCkUFRUUwCl0KQ8rEA8PJC0tXi0tJMAiJQAAAAAFAAD/wAQAA8AAGwA3AFMAXwBrAAAFMjc+ATc2NTQnLgEnJiMiBw4BBwYVFBceARcWEzIXHgEXFhUUBw4BBwYjIicuAScmNTQ3PgE3NhMyNz4BNzY3BgcOAQcGIyInLgEnJicWFx4BFxYnNDYzMhYVFAYjIiYlNDYzMhYVFAYjIiYCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMVisrKlEmJiMFHBtWODc/Pzc4VhscBSMmJlEqK9UlGxslJRsbJQGAJRsbJSUbGyVAKCiLXl1qal1eiygoKCiLXl1qal1eiygoA6AhIHFMTFZWTExxICEhIHFMTFZWTExxICH+CQYGFRAQFEM6OlYYGRkYVjo6QxQQEBUGBvcoODgoKDg4KCg4OCgoODgAAAMAAP/ABAADwAAbADcAQwAAASIHDgEHBhUUFx4BFxYzMjc+ATc2NTQnLgEnJgMiJy4BJyY1NDc+ATc2MzIXHgEXFhUUBw4BBwYTBycHFwcXNxc3JzcCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMSqCgYKCgYKCgYKCgA8AoKIteXWpqXV6LKCgoKIteXWpqXV6LKCj8YCEgcUxMVlZMTHEgISEgcUxMVlZMTHEgIQKgoKBgoKBgoKBgoKAAAQBl/8ADmwPAACkAAAEiJiMiBw4BBwYVFBYzLgE1NDY3MAcGAgcGBxUhEzM3IzceATMyNjcOAQMgRGhGcVNUbRobSUgGDWVKEBBLPDxZAT1sxizXNC1VJi5QGB09A7AQHh1hPj9BTTsLJjeZbwN9fv7Fj5AjGQIAgPYJDzdrCQcAAAAAAgAAAAAEAAOAAAkAFwAAJTMHJzMRIzcXIyURJyMRMxUhNTMRIwcRA4CAoKCAgKCggP8AQMCA/oCAwEDAwMACAMDAwP8AgP1AQEACwIABAAADAMAAAANAA4AAFgAfACgAAAE+ATU0Jy4BJyYjIREhMjc+ATc2NTQmATMyFhUUBisBEyMRMzIWFRQGAsQcIBQURi4vNf7AAYA1Ly5GFBRE/oRlKjw8KWafn58sPj4B2yJULzUvLkYUFPyAFBRGLi81RnQBRks1NUv+gAEASzU1SwAAAAACAMAAAANAA4AAHwAjAAABMxEUBw4BBwYjIicuAScmNREzERQWFx4BMzI2Nz4BNQEhFSECwIAZGVc6O0JCOzpXGRmAGxgcSSgoSRwYG/4AAoD9gAOA/mA8NDVOFhcXFk41NDwBoP5gHjgXGBsbGBc4Hv6ggAAAAAABAIAAAAOAA4AACwAAARUjATMVITUzASM1A4CA/sCA/kCAAUCAA4BA/QBAQAMAQAABAAAAAAQAA4AAPQAAARUjHgEVFAYHDgEjIiYnLgE1MxQWMzI2NTQmIyE1IS4BJy4BNTQ2Nz4BMzIWFx4BFSM0JiMiBhUUFjMyFhcEAOsVFjUwLHE+PnEsMDWAck5OcnJO/gABLAIEATA1NTAscT4+cSwwNYByTk5yck47bisBwEAdQSI1YiQhJCQhJGI1NExMNDRMQAEDASRiNTViJCEkJCEkYjU0TEw0NEwhHwAAAAcAAP/ABAADwAADAAcACwAPABMAGwAjAAATMxUjNzMVIyUzFSM3MxUjJTMVIwMTIRMzEyETAQMhAyMDIQMAgIDAwMABAICAwMDAAQCAgBAQ/QAQIBACgBD9QBADABAgEP2AEAHAQEBAQEBAQEBAAkD+QAHA/oABgPwAAYD+gAFA/sAAAAoAAAAABAADgAADAAcACwAPABMAFwAbAB8AIwAnAAATESERATUhFR0BITUBFSE1IxUhNREhFSElIRUhETUhFQEhFSEhNSEVAAQA/YABAP8AAQD/AED/AAEA/wACgAEA/wABAPyAAQD/AAKAAQADgPyAA4D9wMDAQMDAAgDAwMDA/wDAwMABAMDA/sDAwMAAAAUAAAAABAADgAADAAcACwAPABMAABMhFSEVIRUhESEVIREhFSERIRUhAAQA/AACgP2AAoD9gAQA/AAEAPwAA4CAQID/AIABQID/AIAAAAAABQAAAAAEAAOAAAMABwALAA8AEwAAEyEVIRchFSERIRUhAyEVIREhFSEABAD8AMACgP2AAoD9gMAEAPwABAD8AAOAgECA/wCAAUCA/wCAAAAFAAAAAAQAA4AAAwAHAAsADwATAAATIRUhBSEVIREhFSEBIRUhESEVIQAEAPwAAYACgP2AAoD9gP6ABAD8AAQA/AADgIBAgP8AgAFAgP8AgAAAAAABAD8APwLmAuYALAAAJRQPAQYjIi8BBwYjIi8BJjU0PwEnJjU0PwE2MzIfATc2MzIfARYVFA8BFxYVAuYQThAXFxCoqBAXFhBOEBCoqBAQThAWFxCoqBAXFxBOEBCoqBDDFhBOEBCoqBAQThAWFxCoqBAXFxBOEBCoqBAQThAXFxCoqBAXAAAABgAAAAADJQNuABQAKAA8AE0AVQCCAAABERQHBisBIicmNRE0NzY7ATIXFhUzERQHBisBIicmNRE0NzY7ATIXFhcRFAcGKwEiJyY1ETQ3NjsBMhcWExEhERQXFhcWMyEyNzY3NjUBIScmJyMGBwUVFAcGKwERFAcGIyEiJyY1ESMiJyY9ATQ3NjsBNzY3NjsBMhcWHwEzMhcWFQElBgUIJAgFBgYFCCQIBQaSBQUIJQgFBQUFCCUIBQWSBQUIJQgFBQUFCCUIBQVJ/gAEBAUEAgHbAgQEBAT+gAEAGwQGtQYEAfcGBQg3Ghsm/iUmGxs3CAUFBQUIsSgIFxYXtxcWFgkosAgFBgIS/rcIBQUFBQgBSQgFBgYFCP63CAUFBQUIAUkIBQYGBQj+twgFBQUFCAFJCAUGBgX+WwId/eMNCwoFBQUFCgsNAmZDBQICBVUkCAYF/eMwIiMhIi8CIAUGCCQIBQVgFQ8PDw8VYAUFCAACAAcASQO3Aq8AGgAuAAAJAQYjIi8BJjU0PwEnJjU0PwE2MzIXARYVFAcBFRQHBiMhIicmPQE0NzYzITIXFgFO/vYGBwgFHQYG4eEGBh0FCAcGAQoGBgJpBQUI/dsIBQUFBQgCJQgFBQGF/vYGBhwGCAcG4OEGBwcGHQUF/vUFCAcG/vslCAUFBQUIJQgFBQUFAAAAAQAjAAAD3QNuALMAACUiJyYjIgcGIyInJjU0NzY3Njc2NzY9ATQnJiMhIgcGHQEUFxYXFjMWFxYVFAcGIyInJiMiBwYjIicmNTQ3Njc2NzY3Nj0BETQ1NDU0JzQnJicmJyYnJicmIyInJjU0NzYzMhcWMzI3NjMyFxYVFAcGIwYHBgcGHQEUFxYzITI3Nj0BNCcmJyYnJjU0NzYzMhcWMzI3NjMyFxYVFAcGByIHBgcGFREUFxYXFhcyFxYVFAcGIwPBGTMyGhkyMxkNCAcJCg0MERAKEgEHFf5+FgcBFQkSEw4ODAsHBw4bNTUaGDExGA0HBwkJCwwQDwkSAQIBAgMEBAUIEhENDQoLBwcOGjU1GhgwMRgOBwcJCgwNEBAIFAEHDwGQDgcBFAoXFw8OBwcOGTMyGRkxMRkOBwcKCg0NEBEIFBQJEREODQoLBwcOAAICAgIMCw8RCQkBAQMDBQxE4AwFAwMFDNRRDQYBAgEICBIPDA0CAgICDAwOEQgJAQIDAwUNRSEB0AINDQgIDg4KCgsLBwcDBgEBCAgSDwwNAgICAg0MDxEICAECAQYMULYMBwEBBwy2UAwGAQEGBxYPDA0CAgICDQwPEQgIAQECBg1P/eZEDAYCAgEJCBEPDA0AAAIAAP+3A/8DtwATADkAAAEyFxYVFAcCBwYjIicmNTQ3ATYzARYXFh8BFgcGIyInJicmJyY1FhcWFxYXFjMyNzY3Njc2NzY3NjcDmygeHhq+TDdFSDQ0NQFtISn9+BcmJy8BAkxMe0c2NiEhEBEEExQQEBIRCRcIDxITFRUdHR4eKQO3GxooJDP+mUY0NTRJSTABSx/9sSsfHw0oek1MGhsuLzo6RAMPDgsLCgoWJRsaEREKCwQEAgABAAAAAAAA9evv618PPPUACwQAAAAAANbEBFgAAAAA1sQEWAAA/7cEAQPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAD//wQBAAEAAAAAAAAAAAAAAAAAAAAhBAAAAAAAAAAAAAAAAgAAAAQAAAAEAAAABAAAAAQAAMAEAAAABAAAAAQAAAAEAABABAAAAAQAAAAEAAAeBAAAAAQAAAAEAABlBAAAAAQAAMAEAADABAAAgAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAMlAD8DJQAAA74ABwQAACMD/wAAAAAAAAAKABQAHgBMAJQA+AE2AXwBwgI2AnQCvgLoA34EHgSIBMoE8gU0BXAFiAXgBiIGagaSBroG5AcoB+AIKgkcCXgAAQAAACEAtAAKAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format(\'truetype\'); font-weight: normal; font-style: normal;}[class^="w-e-icon-"],[class*=" w-e-icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: \'w-e-icon\' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}.w-e-icon-close:before { content: "\\f00d";}.w-e-icon-upload2:before { content: "\\e9c6";}.w-e-icon-trash-o:before { content: "\\f014";}.w-e-icon-header:before { content: "\\f1dc";}.w-e-icon-pencil2:before { content: "\\e906";}.w-e-icon-paint-brush:before { content: "\\f1fc";}.w-e-icon-image:before { content: "\\e90d";}.w-e-icon-play:before { content: "\\e912";}.w-e-icon-location:before { content: "\\e947";}.w-e-icon-undo:before { content: "\\e965";}.w-e-icon-redo:before { content: "\\e966";}.w-e-icon-quotes-left:before { content: "\\e977";}.w-e-icon-list-numbered:before { content: "\\e9b9";}.w-e-icon-list2:before { content: "\\e9bb";}.w-e-icon-link:before { content: "\\e9cb";}.w-e-icon-happy:before { content: "\\e9df";}.w-e-icon-bold:before { content: "\\ea62";}.w-e-icon-underline:before { content: "\\ea63";}.w-e-icon-italic:before { content: "\\ea64";}.w-e-icon-strikethrough:before { content: "\\ea65";}.w-e-icon-table2:before { content: "\\ea71";}.w-e-icon-paragraph-left:before { content: "\\ea77";}.w-e-icon-paragraph-center:before { content: "\\ea78";}.w-e-icon-paragraph-right:before { content: "\\ea79";}.w-e-icon-terminal:before { content: "\\f120";}.w-e-icon-page-break:before { content: "\\ea68";}.w-e-icon-cancel-circle:before { content: "\\ea0d";}.w-e-icon-font:before { content: "\\ea5c";}.w-e-icon-text-heigh:before { content: "\\ea5f";}.w-e-toolbar { display: -webkit-box; display: -ms-flexbox; display: flex; padding: 0 5px; /* flex-wrap: wrap; */ /* 单个菜单 */}.w-e-toolbar .w-e-menu { position: relative; text-align: center; padding: 5px 10px; cursor: pointer;}.w-e-toolbar .w-e-menu i { color: #999;}.w-e-toolbar .w-e-menu:hover i { color: #333;}.w-e-toolbar .w-e-active i { color: #1e88e5;}.w-e-toolbar .w-e-active:hover i { color: #1e88e5;}.w-e-text-container .w-e-panel-container { position: absolute; top: 0; left: 50%; border: 1px solid #ccc; border-top: 0; box-shadow: 1px 1px 2px #ccc; color: #333; background-color: #fff; /* 为 emotion panel 定制的样式 */ /* 上传图片的 panel 定制样式 */}.w-e-text-container .w-e-panel-container .w-e-panel-close { position: absolute; right: 0; top: 0; padding: 5px; margin: 2px 5px 0 0; cursor: pointer; color: #999;}.w-e-text-container .w-e-panel-container .w-e-panel-close:hover { color: #333;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title { list-style: none; display: -webkit-box; display: -ms-flexbox; display: flex; font-size: 14px; margin: 2px 10px 0 10px; border-bottom: 1px solid #f1f1f1;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title .w-e-item { padding: 3px 5px; color: #999; cursor: pointer; margin: 0 3px; position: relative; top: 1px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title .w-e-active { color: #333; border-bottom: 1px solid #333; cursor: default; font-weight: 700;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content { padding: 10px 15px 10px 15px; font-size: 16px; /* 输入框的样式 */ /* 按钮的样式 */}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input:focus,.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea:focus,.w-e-text-container .w-e-panel-container .w-e-panel-tab-content button:focus { outline: none;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea { width: 100%; border: 1px solid #ccc; padding: 5px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea:focus { border-color: #1e88e5;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text] { border: none; border-bottom: 1px solid #ccc; font-size: 14px; height: 20px; color: #333; text-align: left;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text].small { width: 30px; text-align: center;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text].block { display: block; width: 100%; margin: 10px 0;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text]:focus { border-bottom: 2px solid #1e88e5;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button { font-size: 14px; color: #1e88e5; border: none; padding: 5px 10px; background-color: #fff; cursor: pointer; border-radius: 3px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.left { float: left; margin-right: 10px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.right { float: right; margin-left: 10px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.gray { color: #999;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.red { color: #c24f4a;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button:hover { background-color: #f1f1f1;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container:after { content: ""; display: table; clear: both;}.w-e-text-container .w-e-panel-container .w-e-emoticon-container .w-e-item { cursor: pointer; font-size: 18px; padding: 0 3px; display: inline-block; *display: inline; *zoom: 1;}.w-e-text-container .w-e-panel-container .w-e-up-img-container { text-align: center;}.w-e-text-container .w-e-panel-container .w-e-up-img-container .w-e-up-btn { display: inline-block; *display: inline; *zoom: 1; color: #999; cursor: pointer; font-size: 60px; line-height: 1;}.w-e-text-container .w-e-panel-container .w-e-up-img-container .w-e-up-btn:hover { color: #333;}.w-e-text-container { position: relative;}.w-e-text-container .w-e-progress { position: absolute; background-color: #1e88e5; bottom: 0; left: 0; height: 1px;}.w-e-text { padding: 0 10px; overflow-y: scroll;}.w-e-text p,.w-e-text h1,.w-e-text h2,.w-e-text h3,.w-e-text h4,.w-e-text h5,.w-e-text table,.w-e-text pre { margin: 10px 0; line-height: 1.5;}.w-e-text ul,.w-e-text ol { margin: 10px 0 10px 20px;}.w-e-text blockquote { display: block; border-left: 8px solid #d0e5f2; padding: 5px 10px; margin: 10px 0; line-height: 1.4; font-size: 100%; background-color: #f1f1f1;}.w-e-text code { display: inline-block; *display: inline; *zoom: 1; background-color: #f1f1f1; border-radius: 3px; padding: 3px 5px; margin: 0 3px;}.w-e-text pre code { display: block;}.w-e-text table { border-top: 1px solid #ccc; border-left: 1px solid #ccc;}.w-e-text table td,.w-e-text table th { border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; padding: 3px 5px;}.w-e-text table th { border-bottom: 2px solid #ccc; text-align: center;}.w-e-text:focus { outline: none;}.w-e-text img { cursor: pointer;}.w-e-text img:hover { box-shadow: 0 0 5px #333;}',document.getElementsByTagName("HEAD").item(0).appendChild(Z),window.wangEditor||j}); +//# sourceMappingURL=wangEditor.min.js.map diff --git a/lib/wangEditor/moxie.js b/lib/wangEditor/moxie.js new file mode 100644 index 0000000..2281834 --- /dev/null +++ b/lib/wangEditor/moxie.js @@ -0,0 +1,11158 @@ +;var MXI_DEBUG = true; +/** + * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill + * v1.3.5 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2016-05-15 + */ +/** + * Compiled inline version. (Library mode) + */ + +/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ +/*globals $code */ + +(function(exports, undefined) { + "use strict"; + + var modules = {}; + + function require(ids, callback) { + var module, defs = []; + + for (var i = 0; i < ids.length; ++i) { + module = modules[ids[i]] || resolve(ids[i]); + if (!module) { + throw 'module definition dependecy not found: ' + ids[i]; + } + + defs.push(module); + } + + callback.apply(null, defs); + } + + function define(id, dependencies, definition) { + if (typeof id !== 'string') { + throw 'invalid module definition, module id must be defined and be a string'; + } + + if (dependencies === undefined) { + throw 'invalid module definition, dependencies must be specified'; + } + + if (definition === undefined) { + throw 'invalid module definition, definition function must be specified'; + } + + require(dependencies, function() { + modules[id] = definition.apply(null, arguments); + }); + } + + function defined(id) { + return !!modules[id]; + } + + function resolve(id) { + var target = exports; + var fragments = id.split(/[.\/]/); + + for (var fi = 0; fi < fragments.length; ++fi) { + if (!target[fragments[fi]]) { + return; + } + + target = target[fragments[fi]]; + } + + return target; + } + + function expose(ids) { + for (var i = 0; i < ids.length; i++) { + var target = exports; + var id = ids[i]; + var fragments = id.split(/[.\/]/); + + for (var fi = 0; fi < fragments.length - 1; ++fi) { + if (target[fragments[fi]] === undefined) { + target[fragments[fi]] = {}; + } + + target = target[fragments[fi]]; + } + + target[fragments[fragments.length - 1]] = modules[id]; + } + } + +// Included from: src/javascript/core/utils/Basic.js + +/** + * Basic.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Basic', [], function() { + /** + Gets the true type of the built-in object (better version of typeof). + @author Angus Croll (http://javascriptweblog.wordpress.com/) + + @method typeOf + @for Utils + @static + @param {Object} o Object to check. + @return {String} Object [[Class]] + */ + var typeOf = function(o) { + var undef; + + if (o === undef) { + return 'undefined'; + } else if (o === null) { + return 'null'; + } else if (o.nodeType) { + return 'node'; + } + + // the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8 + return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); + }; + + /** + Extends the specified object with another object. + + @method extend + @static + @param {Object} target Object to extend. + @param {Object} [obj]* Multiple objects to extend with. + @return {Object} Same as target, the extended object. + */ + var extend = function(target) { + var undef; + + each(arguments, function(arg, i) { + if (i > 0) { + each(arg, function(value, key) { + if (value !== undef) { + if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) { + extend(target[key], value); + } else { + target[key] = value; + } + } + }); + } + }); + return target; + }; + + /** + Executes the callback function for each item in array/object. If you return false in the + callback it will break the loop. + + @method each + @static + @param {Object} obj Object to iterate. + @param {function} callback Callback function to execute for each item. + */ + var each = function(obj, callback) { + var length, key, i, undef; + + if (obj) { + if (typeOf(obj.length) === 'number') { // it might be Array, FileList or even arguments object + // Loop array items + for (i = 0, length = obj.length; i < length; i++) { + if (callback(obj[i], i) === false) { + return; + } + } + } else if (typeOf(obj) === 'object') { + // Loop object items + for (key in obj) { + if (obj.hasOwnProperty(key)) { + if (callback(obj[key], key) === false) { + return; + } + } + } + } + } + }; + + /** + Checks if object is empty. + + @method isEmptyObj + @static + @param {Object} o Object to check. + @return {Boolean} + */ + var isEmptyObj = function(obj) { + var prop; + + if (!obj || typeOf(obj) !== 'object') { + return true; + } + + for (prop in obj) { + return false; + } + + return true; + }; + + /** + Recieve an array of functions (usually async) to call in sequence, each function + receives a callback as first argument that it should call, when it completes. Finally, + after everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the sequence and invoke main callback + immediately. + + @method inSeries + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + var inSeries = function(queue, cb) { + var i = 0, length = queue.length; + + if (typeOf(cb) !== 'function') { + cb = function() {}; + } + + if (!queue || !queue.length) { + cb(); + } + + function callNext(i) { + if (typeOf(queue[i]) === 'function') { + queue[i](function(error) { + /*jshint expr:true */ + ++i < length && !error ? callNext(i) : cb(error); + }); + } + } + callNext(i); + }; + + + /** + Recieve an array of functions (usually async) to call in parallel, each function + receives a callback as first argument that it should call, when it completes. After + everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the process and invoke main callback + immediately. + + @method inParallel + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + var inParallel = function(queue, cb) { + var count = 0, num = queue.length, cbArgs = new Array(num); + + each(queue, function(fn, i) { + fn(function(error) { + if (error) { + return cb(error); + } + + var args = [].slice.call(arguments); + args.shift(); // strip error - undefined or not + + cbArgs[i] = args; + count++; + + if (count === num) { + cbArgs.unshift(null); + cb.apply(this, cbArgs); + } + }); + }); + }; + + + /** + Find an element in array and return it's index if present, otherwise return -1. + + @method inArray + @static + @param {Mixed} needle Element to find + @param {Array} array + @return {Int} Index of the element, or -1 if not found + */ + var inArray = function(needle, array) { + if (array) { + if (Array.prototype.indexOf) { + return Array.prototype.indexOf.call(array, needle); + } + + for (var i = 0, length = array.length; i < length; i++) { + if (array[i] === needle) { + return i; + } + } + } + return -1; + }; + + + /** + Returns elements of first array if they are not present in second. And false - otherwise. + + @private + @method arrayDiff + @param {Array} needles + @param {Array} array + @return {Array|Boolean} + */ + var arrayDiff = function(needles, array) { + var diff = []; + + if (typeOf(needles) !== 'array') { + needles = [needles]; + } + + if (typeOf(array) !== 'array') { + array = [array]; + } + + for (var i in needles) { + if (inArray(needles[i], array) === -1) { + diff.push(needles[i]); + } + } + return diff.length ? diff : false; + }; + + + /** + Find intersection of two arrays. + + @private + @method arrayIntersect + @param {Array} array1 + @param {Array} array2 + @return {Array} Intersection of two arrays or null if there is none + */ + var arrayIntersect = function(array1, array2) { + var result = []; + each(array1, function(item) { + if (inArray(item, array2) !== -1) { + result.push(item); + } + }); + return result.length ? result : null; + }; + + + /** + Forces anything into an array. + + @method toArray + @static + @param {Object} obj Object with length field. + @return {Array} Array object containing all items. + */ + var toArray = function(obj) { + var i, arr = []; + + for (i = 0; i < obj.length; i++) { + arr[i] = obj[i]; + } + + return arr; + }; + + + /** + Generates an unique ID. The only way a user would be able to get the same ID is if the two persons + at the same exact millisecond manage to get the same 5 random numbers between 0-65535; it also uses + a counter so each ID is guaranteed to be unique for the given page. It is more probable for the earth + to be hit with an asteroid. + + @method guid + @static + @param {String} prefix to prepend (by default 'o' will be prepended). + @method guid + @return {String} Virtually unique id. + */ + var guid = (function() { + var counter = 0; + + return function(prefix) { + var guid = new Date().getTime().toString(32), i; + + for (i = 0; i < 5; i++) { + guid += Math.floor(Math.random() * 65535).toString(32); + } + + return (prefix || 'o_') + guid + (counter++).toString(32); + }; + }()); + + + /** + Trims white spaces around the string + + @method trim + @static + @param {String} str + @return {String} + */ + var trim = function(str) { + if (!str) { + return str; + } + return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); + }; + + + /** + Parses the specified size string into a byte value. For example 10kb becomes 10240. + + @method parseSizeStr + @static + @param {String/Number} size String to parse or number to just pass through. + @return {Number} Size in bytes. + */ + var parseSizeStr = function(size) { + if (typeof(size) !== 'string') { + return size; + } + + var muls = { + t: 1099511627776, + g: 1073741824, + m: 1048576, + k: 1024 + }, + mul; + + + size = /^([0-9\.]+)([tmgk]?)$/.exec(size.toLowerCase().replace(/[^0-9\.tmkg]/g, '')); + mul = size[2]; + size = +size[1]; + + if (muls.hasOwnProperty(mul)) { + size *= muls[mul]; + } + return Math.floor(size); + }; + + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + var sprintf = function(str) { + var args = [].slice.call(arguments, 1); + + return str.replace(/%[a-z]/g, function() { + var value = args.shift(); + return typeOf(value) !== 'undefined' ? value : ''; + }); + }; + + + return { + guid: guid, + typeOf: typeOf, + extend: extend, + each: each, + isEmptyObj: isEmptyObj, + inSeries: inSeries, + inParallel: inParallel, + inArray: inArray, + arrayDiff: arrayDiff, + arrayIntersect: arrayIntersect, + toArray: toArray, + trim: trim, + sprintf: sprintf, + parseSizeStr: parseSizeStr + }; +}); + +// Included from: src/javascript/core/utils/Env.js + +/** + * Env.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/core/utils/Env", [ + "moxie/core/utils/Basic" +], function(Basic) { + + /** + * UAParser.js v0.7.7 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2015 Faisal Salman + * Dual licensed under GPLv2 & MIT + */ + var UAParser = (function (undefined) { + + ////////////// + // Constants + ///////////// + + + var EMPTY = '', + UNKNOWN = '?', + FUNC_TYPE = 'function', + UNDEF_TYPE = 'undefined', + OBJ_TYPE = 'object', + MAJOR = 'major', + MODEL = 'model', + NAME = 'name', + TYPE = 'type', + VENDOR = 'vendor', + VERSION = 'version', + ARCHITECTURE= 'architecture', + CONSOLE = 'console', + MOBILE = 'mobile', + TABLET = 'tablet'; + + + /////////// + // Helper + ////////// + + + var util = { + has : function (str1, str2) { + return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; + }, + lowerize : function (str) { + return str.toLowerCase(); + } + }; + + + /////////////// + // Map helper + ////////////// + + + var mapper = { + + rgx : function () { + + // loop through all regexes maps + for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) { + + var regex = args[i], // even sequence (0,2,4,..) + props = args[i + 1]; // odd sequence (1,3,5,..) + + // construct object barebones + if (typeof(result) === UNDEF_TYPE) { + result = {}; + for (p in props) { + q = props[p]; + if (typeof(q) === OBJ_TYPE) { + result[q[0]] = undefined; + } else { + result[q] = undefined; + } + } + } + + // try matching uastring with regexes + for (j = k = 0; j < regex.length; j++) { + matches = regex[j].exec(this.getUA()); + if (!!matches) { + for (p = 0; p < props.length; p++) { + match = matches[++k]; + q = props[p]; + // check if given property is actually array + if (typeof(q) === OBJ_TYPE && q.length > 0) { + if (q.length == 2) { + if (typeof(q[1]) == FUNC_TYPE) { + // assign modified match + result[q[0]] = q[1].call(this, match); + } else { + // assign given value, ignore regex match + result[q[0]] = q[1]; + } + } else if (q.length == 3) { + // check whether function or regex + if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) { + // call function (usually string mapper) + result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; + } else { + // sanitize match using given regex + result[q[0]] = match ? match.replace(q[1], q[2]) : undefined; + } + } else if (q.length == 4) { + result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; + } + } else { + result[q] = match ? match : undefined; + } + } + break; + } + } + + if(!!matches) break; // break the loop immediately if match found + } + return result; + }, + + str : function (str, map) { + + for (var i in map) { + // check if array + if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) { + for (var j = 0; j < map[i].length; j++) { + if (util.has(map[i][j], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + } else if (util.has(map[i], str)) { + return (i === UNKNOWN) ? undefined : i; + } + } + return str; + } + }; + + + /////////////// + // String map + ////////////// + + + var maps = { + + browser : { + oldsafari : { + major : { + '1' : ['/8', '/1', '/3'], + '2' : '/4', + '?' : '/' + }, + version : { + '1.0' : '/8', + '1.2' : '/1', + '1.3' : '/3', + '2.0' : '/412', + '2.0.2' : '/416', + '2.0.3' : '/417', + '2.0.4' : '/419', + '?' : '/' + } + } + }, + + device : { + sprint : { + model : { + 'Evo Shift 4G' : '7373KT' + }, + vendor : { + 'HTC' : 'APA', + 'Sprint' : 'Sprint' + } + } + }, + + os : { + windows : { + version : { + 'ME' : '4.90', + 'NT 3.11' : 'NT3.51', + 'NT 4.0' : 'NT4.0', + '2000' : 'NT 5.0', + 'XP' : ['NT 5.1', 'NT 5.2'], + 'Vista' : 'NT 6.0', + '7' : 'NT 6.1', + '8' : 'NT 6.2', + '8.1' : 'NT 6.3', + 'RT' : 'ARM' + } + } + } + }; + + + ////////////// + // Regex map + ///////////// + + + var regexes = { + + browser : [[ + + // Presto based + /(opera\smini)\/([\w\.-]+)/i, // Opera Mini + /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet + /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 + /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 + + ], [NAME, VERSION], [ + + /\s(opr)\/([\w\.]+)/i // Opera Webkit + ], [[NAME, 'Opera'], VERSION], [ + + // Mixed + /(kindle)\/([\w\.]+)/i, // Kindle + /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, + // Lunascape/Maxthon/Netfront/Jasmine/Blazer + + // Trident based + /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, + // Avant/IEMobile/SlimBrowser/Baidu + /(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer + + // Webkit/KHTML based + /(rekonq)\/([\w\.]+)*/i, // Rekonq + /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i + // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron + ], [NAME, VERSION], [ + + /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11 + ], [[NAME, 'IE'], VERSION], [ + + /(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge + ], [NAME, VERSION], [ + + /(yabrowser)\/([\w\.]+)/i // Yandex + ], [[NAME, 'Yandex'], VERSION], [ + + /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon + ], [[NAME, /_/g, ' '], VERSION], [ + + /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i, + // Chrome/OmniWeb/Arora/Tizen/Nokia + /(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i + // UCBrowser/QQBrowser + ], [NAME, VERSION], [ + + /(dolfin)\/([\w\.]+)/i // Dolphin + ], [[NAME, 'Dolphin'], VERSION], [ + + /((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS + ], [[NAME, 'Chrome'], VERSION], [ + + /XiaoMi\/MiuiBrowser\/([\w\.]+)/i // MIUI Browser + ], [VERSION, [NAME, 'MIUI Browser']], [ + + /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i // Android Browser + ], [VERSION, [NAME, 'Android Browser']], [ + + /FBAV\/([\w\.]+);/i // Facebook App for iOS + ], [VERSION, [NAME, 'Facebook']], [ + + /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari + ], [VERSION, [NAME, 'Mobile Safari']], [ + + /version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile + ], [VERSION, NAME], [ + + /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 + ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [ + + /(konqueror)\/([\w\.]+)/i, // Konqueror + /(webkit|khtml)\/([\w\.]+)/i + ], [NAME, VERSION], [ + + // Gecko based + /(navigator|netscape)\/([\w\.-]+)/i // Netscape + ], [[NAME, 'Netscape'], VERSION], [ + /(swiftfox)/i, // Swiftfox + /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, + // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror + /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, + // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix + /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla + + // Other + /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i, + // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf + /(links)\s\(([\w\.]+)/i, // Links + /(gobrowser)\/?([\w\.]+)*/i, // GoBrowser + /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser + /(mosaic)[\/\s]([\w\.]+)/i // Mosaic + ], [NAME, VERSION] + ], + + engine : [[ + + /windows.+\sedge\/([\w\.]+)/i // EdgeHTML + ], [VERSION, [NAME, 'EdgeHTML']], [ + + /(presto)\/([\w\.]+)/i, // Presto + /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m + /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links + /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab + ], [NAME, VERSION], [ + + /rv\:([\w\.]+).*(gecko)/i // Gecko + ], [VERSION, NAME] + ], + + os : [[ + + // Windows based + /microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes) + ], [NAME, VERSION], [ + /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT + /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i + ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ + /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i + ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ + + // Mobile/Embedded OS + /\((bb)(10);/i // BlackBerry 10 + ], [[NAME, 'BlackBerry'], VERSION], [ + /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry + /(tizen)[\/\s]([\w\.]+)/i, // Tizen + /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, + // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki + /linux;.+(sailfish);/i // Sailfish OS + ], [NAME, VERSION], [ + /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian + ], [[NAME, 'Symbian'], VERSION], [ + /\((series40);/i // Series 40 + ], [NAME], [ + /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS + ], [[NAME, 'Firefox OS'], VERSION], [ + + // Console + /(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation + + // GNU/Linux based + /(mint)[\/\s\(]?(\w+)*/i, // Mint + /(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux + /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i, + // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware + // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus + /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux + /(gnu)\s?([\w\.]+)*/i // GNU + ], [NAME, VERSION], [ + + /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS + ], [[NAME, 'Chromium OS'], VERSION],[ + + // Solaris + /(sunos)\s?([\w\.]+\d)*/i // Solaris + ], [[NAME, 'Solaris'], VERSION], [ + + // BSD based + /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly + ], [NAME, VERSION],[ + + /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS + ], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [ + + /(mac\sos\sx)\s?([\w\s\.]+\w)*/i, + /(macintosh|mac(?=_powerpc)\s)/i // Mac OS + ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ + + // Other + /((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris + /(haiku)\s(\w+)/i, // Haiku + /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX + /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, + // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS + /(unix)\s?([\w\.]+)*/i // UNIX + ], [NAME, VERSION] + ] + }; + + + ///////////////// + // Constructor + //////////////// + + + var UAParser = function (uastring) { + + var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); + + this.getBrowser = function () { + return mapper.rgx.apply(this, regexes.browser); + }; + this.getEngine = function () { + return mapper.rgx.apply(this, regexes.engine); + }; + this.getOS = function () { + return mapper.rgx.apply(this, regexes.os); + }; + this.getResult = function() { + return { + ua : this.getUA(), + browser : this.getBrowser(), + engine : this.getEngine(), + os : this.getOS() + }; + }; + this.getUA = function () { + return ua; + }; + this.setUA = function (uastring) { + ua = uastring; + return this; + }; + this.setUA(ua); + }; + + return UAParser; + })(); + + + function version_compare(v1, v2, operator) { + // From: http://phpjs.org/functions + // + original by: Philippe Jausions (http://pear.php.net/user/jausions) + // + original by: Aidan Lister (http://aidanlister.com/) + // + reimplemented by: Kankrelune (http://www.webfaktory.info/) + // + improved by: Brett Zamir (http://brett-zamir.me) + // + improved by: Scott Baker + // + improved by: Theriault + // * example 1: version_compare('8.2.5rc', '8.2.5a'); + // * returns 1: 1 + // * example 2: version_compare('8.2.50', '8.2.52', '<'); + // * returns 2: true + // * example 3: version_compare('5.3.0-dev', '5.3.0'); + // * returns 3: -1 + // * example 4: version_compare('4.1.0.52','4.01.0.51'); + // * returns 4: 1 + + // Important: compare must be initialized at 0. + var i = 0, + x = 0, + compare = 0, + // vm maps textual PHP versions to negatives so they're less than 0. + // PHP currently defines these as CASE-SENSITIVE. It is important to + // leave these as negatives so that they can come before numerical versions + // and as if no letters were there to begin with. + // (1alpha is < 1 and < 1.1 but > 1dev1) + // If a non-numerical value can't be mapped to this table, it receives + // -7 as its value. + vm = { + 'dev': -6, + 'alpha': -5, + 'a': -5, + 'beta': -4, + 'b': -4, + 'RC': -3, + 'rc': -3, + '#': -2, + 'p': 1, + 'pl': 1 + }, + // This function will be called to prepare each version argument. + // It replaces every _, -, and + with a dot. + // It surrounds any nonsequence of numbers/dots with dots. + // It replaces sequences of dots with a single dot. + // version_compare('4..0', '4.0') == 0 + // Important: A string of 0 length needs to be converted into a value + // even less than an unexisting value in vm (-7), hence [-8]. + // It's also important to not strip spaces because of this. + // version_compare('', ' ') == 1 + prepVersion = function (v) { + v = ('' + v).replace(/[_\-+]/g, '.'); + v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); + return (!v.length ? [-8] : v.split('.')); + }, + // This converts a version component to a number. + // Empty component becomes 0. + // Non-numerical component becomes a negative number. + // Numerical component becomes itself as an integer. + numVersion = function (v) { + return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10)); + }; + + v1 = prepVersion(v1); + v2 = prepVersion(v2); + x = Math.max(v1.length, v2.length); + for (i = 0; i < x; i++) { + if (v1[i] == v2[i]) { + continue; + } + v1[i] = numVersion(v1[i]); + v2[i] = numVersion(v2[i]); + if (v1[i] < v2[i]) { + compare = -1; + break; + } else if (v1[i] > v2[i]) { + compare = 1; + break; + } + } + if (!operator) { + return compare; + } + + // Important: operator is CASE-SENSITIVE. + // "No operator" seems to be treated as "<." + // Any other values seem to make the function return null. + switch (operator) { + case '>': + case 'gt': + return (compare > 0); + case '>=': + case 'ge': + return (compare >= 0); + case '<=': + case 'le': + return (compare <= 0); + case '==': + case '=': + case 'eq': + return (compare === 0); + case '<>': + case '!=': + case 'ne': + return (compare !== 0); + case '': + case '<': + case 'lt': + return (compare < 0); + default: + return null; + } + } + + + var can = (function() { + var caps = { + define_property: (function() { + /* // currently too much extra code required, not exactly worth it + try { // as of IE8, getters/setters are supported only on DOM elements + var obj = {}; + if (Object.defineProperty) { + Object.defineProperty(obj, 'prop', { + enumerable: true, + configurable: true + }); + return true; + } + } catch(ex) {} + + if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) { + return true; + }*/ + return false; + }()), + + create_canvas: (function() { + // On the S60 and BB Storm, getContext exists, but always returns undefined + // so we actually have to call getContext() to verify + // github.com/Modernizr/Modernizr/issues/issue/97/ + var el = document.createElement('canvas'); + return !!(el.getContext && el.getContext('2d')); + }()), + + return_response_type: function(responseType) { + try { + if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) { + return true; + } else if (window.XMLHttpRequest) { + var xhr = new XMLHttpRequest(); + xhr.open('get', '/'); // otherwise Gecko throws an exception + if ('responseType' in xhr) { + xhr.responseType = responseType; + // as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?) + if (xhr.responseType !== responseType) { + return false; + } + return true; + } + } + } catch (ex) {} + return false; + }, + + // ideas for this heavily come from Modernizr (http://modernizr.com/) + use_data_uri: (function() { + var du = new Image(); + + du.onload = function() { + caps.use_data_uri = (du.width === 1 && du.height === 1); + }; + + setTimeout(function() { + du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="; + }, 1); + return false; + }()), + + use_data_uri_over32kb: function() { // IE8 + return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9); + }, + + use_data_uri_of: function(bytes) { + return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb()); + }, + + use_fileinput: function() { + if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) { + return false; + } + + var el = document.createElement('input'); + el.setAttribute('type', 'file'); + return !el.disabled; + } + }; + + return function(cap) { + var args = [].slice.call(arguments); + args.shift(); // shift of cap + return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap]; + }; + }()); + + + var uaResult = new UAParser().getResult(); + + + var Env = { + can: can, + + uaParser: UAParser, + + browser: uaResult.browser.name, + version: uaResult.browser.version, + os: uaResult.os.name, // everybody intuitively types it in a lowercase for some reason + osVersion: uaResult.os.version, + + verComp: version_compare, + + swf_url: "../flash/Moxie.swf", + xap_url: "../silverlight/Moxie.xap", + global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent" + }; + + // for backward compatibility + // @deprecated Use `Env.os` instead + Env.OS = Env.os; + + if (MXI_DEBUG) { + Env.debug = { + runtime: true, + events: false + }; + + Env.log = function() { + + function logObj(data) { + // TODO: this should recursively print out the object in a pretty way + console.appendChild(document.createTextNode(data + "\n")); + } + + var data = arguments[0]; + + if (Basic.typeOf(data) === 'string') { + data = Basic.sprintf.apply(this, arguments); + } + + if (window && window.console && window.console.log) { + window.console.log(data); + } else if (document) { + var console = document.getElementById('moxie-console'); + if (!console) { + console = document.createElement('pre'); + console.id = 'moxie-console'; + //console.style.display = 'none'; + document.body.appendChild(console); + } + + if (Basic.inArray(Basic.typeOf(data), ['object', 'array']) !== -1) { + logObj(data); + } else { + console.appendChild(document.createTextNode(data + "\n")); + } + } + }; + } + + return Env; +}); + +// Included from: src/javascript/core/I18n.js + +/** + * I18n.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/core/I18n", [ + "moxie/core/utils/Basic" +], function(Basic) { + var i18n = {}; + + return { + /** + * Extends the language pack object with new items. + * + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + addI18n: function(pack) { + return Basic.extend(i18n, pack); + }, + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + translate: function(str) { + return i18n[str] || str; + }, + + /** + * Shortcut for translate function + * + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + _: function(str) { + return this.translate(str); + }, + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + sprintf: function(str) { + var args = [].slice.call(arguments, 1); + + return str.replace(/%[a-z]/g, function() { + var value = args.shift(); + return Basic.typeOf(value) !== 'undefined' ? value : ''; + }); + } + }; +}); + +// Included from: src/javascript/core/utils/Mime.js + +/** + * Mime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/core/utils/Mime", [ + "moxie/core/utils/Basic", + "moxie/core/I18n" +], function(Basic, I18n) { + + var mimeData = "" + + "application/msword,doc dot," + + "application/pdf,pdf," + + "application/pgp-signature,pgp," + + "application/postscript,ps ai eps," + + "application/rtf,rtf," + + "application/vnd.ms-excel,xls xlb," + + "application/vnd.ms-powerpoint,ppt pps pot," + + "application/zip,zip," + + "application/x-shockwave-flash,swf swfl," + + "application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," + + "application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," + + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," + + "application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," + + "application/vnd.openxmlformats-officedocument.presentationml.template,potx," + + "application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," + + "application/x-javascript,js," + + "application/json,json," + + "audio/mpeg,mp3 mpga mpega mp2," + + "audio/x-wav,wav," + + "audio/x-m4a,m4a," + + "audio/ogg,oga ogg," + + "audio/aiff,aiff aif," + + "audio/flac,flac," + + "audio/aac,aac," + + "audio/ac3,ac3," + + "audio/x-ms-wma,wma," + + "image/bmp,bmp," + + "image/gif,gif," + + "image/jpeg,jpg jpeg jpe," + + "image/photoshop,psd," + + "image/png,png," + + "image/svg+xml,svg svgz," + + "image/tiff,tiff tif," + + "text/plain,asc txt text diff log," + + "text/html,htm html xhtml," + + "text/css,css," + + "text/csv,csv," + + "text/rtf,rtf," + + "video/mpeg,mpeg mpg mpe m2v," + + "video/quicktime,qt mov," + + "video/mp4,mp4," + + "video/x-m4v,m4v," + + "video/x-flv,flv," + + "video/x-ms-wmv,wmv," + + "video/avi,avi," + + "video/webm,webm," + + "video/3gpp,3gpp 3gp," + + "video/3gpp2,3g2," + + "video/vnd.rn-realvideo,rv," + + "video/ogg,ogv," + + "video/x-matroska,mkv," + + "application/vnd.oasis.opendocument.formula-template,otf," + + "application/octet-stream,exe"; + + + var Mime = { + + mimes: {}, + + extensions: {}, + + // Parses the default mime types string into a mimes and extensions lookup maps + addMimeType: function (mimeData) { + var items = mimeData.split(/,/), i, ii, ext; + + for (i = 0; i < items.length; i += 2) { + ext = items[i + 1].split(/ /); + + // extension to mime lookup + for (ii = 0; ii < ext.length; ii++) { + this.mimes[ext[ii]] = items[i]; + } + // mime to extension lookup + this.extensions[items[i]] = ext; + } + }, + + + extList2mimes: function (filters, addMissingExtensions) { + var self = this, ext, i, ii, type, mimes = []; + + // convert extensions to mime types list + for (i = 0; i < filters.length; i++) { + ext = filters[i].extensions.split(/\s*,\s*/); + + for (ii = 0; ii < ext.length; ii++) { + + // if there's an asterisk in the list, then accept attribute is not required + if (ext[ii] === '*') { + return []; + } + + type = self.mimes[ext[ii]]; + if (type && Basic.inArray(type, mimes) === -1) { + mimes.push(type); + } + + // future browsers should filter by extension, finally + if (addMissingExtensions && /^\w+$/.test(ext[ii])) { + mimes.push('.' + ext[ii]); + } else if (!type) { + // if we have no type in our map, then accept all + return []; + } + } + } + return mimes; + }, + + + mimes2exts: function(mimes) { + var self = this, exts = []; + + Basic.each(mimes, function(mime) { + if (mime === '*') { + exts = []; + return false; + } + + // check if this thing looks like mime type + var m = mime.match(/^(\w+)\/(\*|\w+)$/); + if (m) { + if (m[2] === '*') { + // wildcard mime type detected + Basic.each(self.extensions, function(arr, mime) { + if ((new RegExp('^' + m[1] + '/')).test(mime)) { + [].push.apply(exts, self.extensions[mime]); + } + }); + } else if (self.extensions[mime]) { + [].push.apply(exts, self.extensions[mime]); + } + } + }); + return exts; + }, + + + mimes2extList: function(mimes) { + var accept = [], exts = []; + + if (Basic.typeOf(mimes) === 'string') { + mimes = Basic.trim(mimes).split(/\s*,\s*/); + } + + exts = this.mimes2exts(mimes); + + accept.push({ + title: I18n.translate('Files'), + extensions: exts.length ? exts.join(',') : '*' + }); + + // save original mimes string + accept.mimes = mimes; + + return accept; + }, + + + getFileExtension: function(fileName) { + var matches = fileName && fileName.match(/\.([^.]+)$/); + if (matches) { + return matches[1].toLowerCase(); + } + return ''; + }, + + getFileMime: function(fileName) { + return this.mimes[this.getFileExtension(fileName)] || ''; + } + }; + + Mime.addMimeType(mimeData); + + return Mime; +}); + +// Included from: src/javascript/core/utils/Dom.js + +/** + * Dom.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) { + + /** + Get DOM Element by it's id. + + @method get + @for Utils + @param {String} id Identifier of the DOM Element + @return {DOMElement} + */ + var get = function(id) { + if (typeof id !== 'string') { + return id; + } + return document.getElementById(id); + }; + + /** + Checks if specified DOM element has specified class. + + @method hasClass + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Class name + */ + var hasClass = function(obj, name) { + if (!obj.className) { + return false; + } + + var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); + return regExp.test(obj.className); + }; + + /** + Adds specified className to specified DOM element. + + @method addClass + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Class name + */ + var addClass = function(obj, name) { + if (!hasClass(obj, name)) { + obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name; + } + }; + + /** + Removes specified className from specified DOM element. + + @method removeClass + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Class name + */ + var removeClass = function(obj, name) { + if (obj.className) { + var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); + obj.className = obj.className.replace(regExp, function($0, $1, $2) { + return $1 === ' ' && $2 === ' ' ? ' ' : ''; + }); + } + }; + + /** + Returns a given computed style of a DOM element. + + @method getStyle + @static + @param {Object} obj DOM element like object. + @param {String} name Style you want to get from the DOM element + */ + var getStyle = function(obj, name) { + if (obj.currentStyle) { + return obj.currentStyle[name]; + } else if (window.getComputedStyle) { + return window.getComputedStyle(obj, null)[name]; + } + }; + + + /** + Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + + @method getPos + @static + @param {Element} node HTML element or element id to get x, y position from. + @param {Element} root Optional root element to stop calculations at. + @return {object} Absolute position of the specified element object with x, y fields. + */ + var getPos = function(node, root) { + var x = 0, y = 0, parent, doc = document, nodeRect, rootRect; + + node = node; + root = root || doc.body; + + // Returns the x, y cordinate for an element on IE 6 and IE 7 + function getIEPos(node) { + var bodyElm, rect, x = 0, y = 0; + + if (node) { + rect = node.getBoundingClientRect(); + bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body; + x = rect.left + bodyElm.scrollLeft; + y = rect.top + bodyElm.scrollTop; + } + + return { + x : x, + y : y + }; + } + + // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode + if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) { + nodeRect = getIEPos(node); + rootRect = getIEPos(root); + + return { + x : nodeRect.x - rootRect.x, + y : nodeRect.y - rootRect.y + }; + } + + parent = node; + while (parent && parent != root && parent.nodeType) { + x += parent.offsetLeft || 0; + y += parent.offsetTop || 0; + parent = parent.offsetParent; + } + + parent = node.parentNode; + while (parent && parent != root && parent.nodeType) { + x -= parent.scrollLeft || 0; + y -= parent.scrollTop || 0; + parent = parent.parentNode; + } + + return { + x : x, + y : y + }; + }; + + /** + Returns the size of the specified node in pixels. + + @method getSize + @static + @param {Node} node Node to get the size of. + @return {Object} Object with a w and h property. + */ + var getSize = function(node) { + return { + w : node.offsetWidth || node.clientWidth, + h : node.offsetHeight || node.clientHeight + }; + }; + + return { + get: get, + hasClass: hasClass, + addClass: addClass, + removeClass: removeClass, + getStyle: getStyle, + getPos: getPos, + getSize: getSize + }; +}); + +// Included from: src/javascript/core/Exceptions.js + +/** + * Exceptions.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/Exceptions', [ + 'moxie/core/utils/Basic' +], function(Basic) { + function _findKey(obj, value) { + var key; + for (key in obj) { + if (obj[key] === value) { + return key; + } + } + return null; + } + + return { + RuntimeError: (function() { + var namecodes = { + NOT_INIT_ERR: 1, + NOT_SUPPORTED_ERR: 9, + JS_ERR: 4 + }; + + function RuntimeError(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": RuntimeError " + this.code; + } + + Basic.extend(RuntimeError, namecodes); + RuntimeError.prototype = Error.prototype; + return RuntimeError; + }()), + + OperationNotAllowedException: (function() { + + function OperationNotAllowedException(code) { + this.code = code; + this.name = 'OperationNotAllowedException'; + } + + Basic.extend(OperationNotAllowedException, { + NOT_ALLOWED_ERR: 1 + }); + + OperationNotAllowedException.prototype = Error.prototype; + + return OperationNotAllowedException; + }()), + + ImageError: (function() { + var namecodes = { + WRONG_FORMAT: 1, + MAX_RESOLUTION_ERR: 2, + INVALID_META_ERR: 3 + }; + + function ImageError(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": ImageError " + this.code; + } + + Basic.extend(ImageError, namecodes); + ImageError.prototype = Error.prototype; + + return ImageError; + }()), + + FileException: (function() { + var namecodes = { + NOT_FOUND_ERR: 1, + SECURITY_ERR: 2, + ABORT_ERR: 3, + NOT_READABLE_ERR: 4, + ENCODING_ERR: 5, + NO_MODIFICATION_ALLOWED_ERR: 6, + INVALID_STATE_ERR: 7, + SYNTAX_ERR: 8 + }; + + function FileException(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": FileException " + this.code; + } + + Basic.extend(FileException, namecodes); + FileException.prototype = Error.prototype; + return FileException; + }()), + + DOMException: (function() { + var namecodes = { + INDEX_SIZE_ERR: 1, + DOMSTRING_SIZE_ERR: 2, + HIERARCHY_REQUEST_ERR: 3, + WRONG_DOCUMENT_ERR: 4, + INVALID_CHARACTER_ERR: 5, + NO_DATA_ALLOWED_ERR: 6, + NO_MODIFICATION_ALLOWED_ERR: 7, + NOT_FOUND_ERR: 8, + NOT_SUPPORTED_ERR: 9, + INUSE_ATTRIBUTE_ERR: 10, + INVALID_STATE_ERR: 11, + SYNTAX_ERR: 12, + INVALID_MODIFICATION_ERR: 13, + NAMESPACE_ERR: 14, + INVALID_ACCESS_ERR: 15, + VALIDATION_ERR: 16, + TYPE_MISMATCH_ERR: 17, + SECURITY_ERR: 18, + NETWORK_ERR: 19, + ABORT_ERR: 20, + URL_MISMATCH_ERR: 21, + QUOTA_EXCEEDED_ERR: 22, + TIMEOUT_ERR: 23, + INVALID_NODE_TYPE_ERR: 24, + DATA_CLONE_ERR: 25 + }; + + function DOMException(code) { + this.code = code; + this.name = _findKey(namecodes, code); + this.message = this.name + ": DOMException " + this.code; + } + + Basic.extend(DOMException, namecodes); + DOMException.prototype = Error.prototype; + return DOMException; + }()), + + EventException: (function() { + function EventException(code) { + this.code = code; + this.name = 'EventException'; + } + + Basic.extend(EventException, { + UNSPECIFIED_EVENT_TYPE_ERR: 0 + }); + + EventException.prototype = Error.prototype; + + return EventException; + }()) + }; +}); + +// Included from: src/javascript/core/EventTarget.js + +/** + * EventTarget.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/EventTarget', [ + 'moxie/core/utils/Env', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic' +], function(Env, x, Basic) { + /** + Parent object for all event dispatching components and objects + + @class EventTarget + @constructor EventTarget + */ + function EventTarget() { + // hash of event listeners by object uid + var eventpool = {}; + + Basic.extend(this, { + + /** + Unique id of the event dispatcher, usually overriden by children + + @property uid + @type String + */ + uid: null, + + /** + Can be called from within a child in order to acquire uniqie id in automated manner + + @method init + */ + init: function() { + if (!this.uid) { + this.uid = Basic.guid('uid_'); + } + }, + + /** + Register a handler to a specific event dispatched by the object + + @method addEventListener + @param {String} type Type or basically a name of the event to subscribe to + @param {Function} fn Callback function that will be called when event happens + @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first + @param {Object} [scope=this] A scope to invoke event handler in + */ + addEventListener: function(type, fn, priority, scope) { + var self = this, list; + + // without uid no event handlers can be added, so make sure we got one + if (!this.hasOwnProperty('uid')) { + this.uid = Basic.guid('uid_'); + } + + type = Basic.trim(type); + + if (/\s/.test(type)) { + // multiple event types were passed for one handler + Basic.each(type.split(/\s+/), function(type) { + self.addEventListener(type, fn, priority, scope); + }); + return; + } + + type = type.toLowerCase(); + priority = parseInt(priority, 10) || 0; + + list = eventpool[this.uid] && eventpool[this.uid][type] || []; + list.push({fn : fn, priority : priority, scope : scope || this}); + + if (!eventpool[this.uid]) { + eventpool[this.uid] = {}; + } + eventpool[this.uid][type] = list; + }, + + /** + Check if any handlers were registered to the specified event + + @method hasEventListener + @param {String} type Type or basically a name of the event to check + @return {Mixed} Returns a handler if it was found and false, if - not + */ + hasEventListener: function(type) { + var list = type ? eventpool[this.uid] && eventpool[this.uid][type] : eventpool[this.uid]; + return list ? list : false; + }, + + /** + Unregister the handler from the event, or if former was not specified - unregister all handlers + + @method removeEventListener + @param {String} type Type or basically a name of the event + @param {Function} [fn] Handler to unregister + */ + removeEventListener: function(type, fn) { + type = type.toLowerCase(); + + var list = eventpool[this.uid] && eventpool[this.uid][type], i; + + if (list) { + if (fn) { + for (i = list.length - 1; i >= 0; i--) { + if (list[i].fn === fn) { + list.splice(i, 1); + break; + } + } + } else { + list = []; + } + + // delete event list if it has become empty + if (!list.length) { + delete eventpool[this.uid][type]; + + // and object specific entry in a hash if it has no more listeners attached + if (Basic.isEmptyObj(eventpool[this.uid])) { + delete eventpool[this.uid]; + } + } + } + }, + + /** + Remove all event handlers from the object + + @method removeAllEventListeners + */ + removeAllEventListeners: function() { + if (eventpool[this.uid]) { + delete eventpool[this.uid]; + } + }, + + /** + Dispatch the event + + @method dispatchEvent + @param {String/Object} Type of event or event object to dispatch + @param {Mixed} [...] Variable number of arguments to be passed to a handlers + @return {Boolean} true by default and false if any handler returned false + */ + dispatchEvent: function(type) { + var uid, list, args, tmpEvt, evt = {}, result = true, undef; + + if (Basic.typeOf(type) !== 'string') { + // we can't use original object directly (because of Silverlight) + tmpEvt = type; + + if (Basic.typeOf(tmpEvt.type) === 'string') { + type = tmpEvt.type; + + if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event + evt.total = tmpEvt.total; + evt.loaded = tmpEvt.loaded; + } + evt.async = tmpEvt.async || false; + } else { + throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR); + } + } + + // check if event is meant to be dispatched on an object having specific uid + if (type.indexOf('::') !== -1) { + (function(arr) { + uid = arr[0]; + type = arr[1]; + }(type.split('::'))); + } else { + uid = this.uid; + } + + type = type.toLowerCase(); + + list = eventpool[uid] && eventpool[uid][type]; + + if (list) { + // sort event list by prority + list.sort(function(a, b) { return b.priority - a.priority; }); + + args = [].slice.call(arguments); + + // first argument will be pseudo-event object + args.shift(); + evt.type = type; + args.unshift(evt); + + if (MXI_DEBUG && Env.debug.events) { + Env.log("Event '%s' fired on %u", evt.type, uid); + } + + // Dispatch event to all listeners + var queue = []; + Basic.each(list, function(handler) { + // explicitly set the target, otherwise events fired from shims do not get it + args[0].target = handler.scope; + // if event is marked as async, detach the handler + if (evt.async) { + queue.push(function(cb) { + setTimeout(function() { + cb(handler.fn.apply(handler.scope, args) === false); + }, 1); + }); + } else { + queue.push(function(cb) { + cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation + }); + } + }); + if (queue.length) { + Basic.inSeries(queue, function(err) { + result = !err; + }); + } + } + return result; + }, + + /** + Alias for addEventListener + + @method bind + @protected + */ + bind: function() { + this.addEventListener.apply(this, arguments); + }, + + /** + Alias for removeEventListener + + @method unbind + @protected + */ + unbind: function() { + this.removeEventListener.apply(this, arguments); + }, + + /** + Alias for removeAllEventListeners + + @method unbindAll + @protected + */ + unbindAll: function() { + this.removeAllEventListeners.apply(this, arguments); + }, + + /** + Alias for dispatchEvent + + @method trigger + @protected + */ + trigger: function() { + return this.dispatchEvent.apply(this, arguments); + }, + + + /** + Handle properties of on[event] type. + + @method handleEventProps + @private + */ + handleEventProps: function(dispatches) { + var self = this; + + this.bind(dispatches.join(' '), function(e) { + var prop = 'on' + e.type.toLowerCase(); + if (Basic.typeOf(this[prop]) === 'function') { + this[prop].apply(this, arguments); + } + }); + + // object must have defined event properties, even if it doesn't make use of them + Basic.each(dispatches, function(prop) { + prop = 'on' + prop.toLowerCase(prop); + if (Basic.typeOf(self[prop]) === 'undefined') { + self[prop] = null; + } + }); + } + + }); + } + + EventTarget.instance = new EventTarget(); + + return EventTarget; +}); + +// Included from: src/javascript/runtime/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/Runtime', [ + "moxie/core/utils/Env", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/EventTarget" +], function(Env, Basic, Dom, EventTarget) { + var runtimeConstructors = {}, runtimes = {}; + + /** + Common set of methods and properties for every runtime instance + + @class Runtime + + @param {Object} options + @param {String} type Sanitized name of the runtime + @param {Object} [caps] Set of capabilities that differentiate specified runtime + @param {Object} [modeCaps] Set of capabilities that do require specific operational mode + @param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested + */ + function Runtime(options, type, caps, modeCaps, preferredMode) { + /** + Dispatched when runtime is initialized and ready. + Results in RuntimeInit on a connected component. + + @event Init + */ + + /** + Dispatched when runtime fails to initialize. + Results in RuntimeError on a connected component. + + @event Error + */ + + var self = this + , _shim + , _uid = Basic.guid(type + '_') + , defaultMode = preferredMode || 'browser' + ; + + options = options || {}; + + // register runtime in private hash + runtimes[_uid] = this; + + /** + Default set of capabilities, which can be redifined later by specific runtime + + @private + @property caps + @type Object + */ + caps = Basic.extend({ + // Runtime can: + // provide access to raw binary data of the file + access_binary: false, + // provide access to raw binary data of the image (image extension is optional) + access_image_binary: false, + // display binary data as thumbs for example + display_media: false, + // make cross-domain requests + do_cors: false, + // accept files dragged and dropped from the desktop + drag_and_drop: false, + // filter files in selection dialog by their extensions + filter_by_extension: true, + // resize image (and manipulate it raw data of any file in general) + resize_image: false, + // periodically report how many bytes of total in the file were uploaded (loaded) + report_upload_progress: false, + // provide access to the headers of http response + return_response_headers: false, + // support response of specific type, which should be passed as an argument + // e.g. runtime.can('return_response_type', 'blob') + return_response_type: false, + // return http status code of the response + return_status_code: true, + // send custom http header with the request + send_custom_headers: false, + // pick up the files from a dialog + select_file: false, + // select whole folder in file browse dialog + select_folder: false, + // select multiple files at once in file browse dialog + select_multiple: true, + // send raw binary data, that is generated after image resizing or manipulation of other kind + send_binary_string: false, + // send cookies with http request and therefore retain session + send_browser_cookies: true, + // send data formatted as multipart/form-data + send_multipart: true, + // slice the file or blob to smaller parts + slice_blob: false, + // upload file without preloading it to memory, stream it out directly from disk + stream_upload: false, + // programmatically trigger file browse dialog + summon_file_dialog: false, + // upload file of specific size, size should be passed as argument + // e.g. runtime.can('upload_filesize', '500mb') + upload_filesize: true, + // initiate http request with specific http method, method should be passed as argument + // e.g. runtime.can('use_http_method', 'put') + use_http_method: true + }, caps); + + + // default to the mode that is compatible with preferred caps + if (options.preferred_caps) { + defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode); + } + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tdefault mode: %s", defaultMode); + } + + // small extension factory here (is meant to be extended with actual extensions constructors) + _shim = (function() { + var objpool = {}; + return { + exec: function(uid, comp, fn, args) { + if (_shim[comp]) { + if (!objpool[uid]) { + objpool[uid] = { + context: this, + instance: new _shim[comp]() + }; + } + if (objpool[uid].instance[fn]) { + return objpool[uid].instance[fn].apply(this, args); + } + } + }, + + removeInstance: function(uid) { + delete objpool[uid]; + }, + + removeAllInstances: function() { + var self = this; + Basic.each(objpool, function(obj, uid) { + if (Basic.typeOf(obj.instance.destroy) === 'function') { + obj.instance.destroy.call(obj.context); + } + self.removeInstance(uid); + }); + } + }; + }()); + + + // public methods + Basic.extend(this, { + /** + Specifies whether runtime instance was initialized or not + + @property initialized + @type {Boolean} + @default false + */ + initialized: false, // shims require this flag to stop initialization retries + + /** + Unique ID of the runtime + + @property uid + @type {String} + */ + uid: _uid, + + /** + Runtime type (e.g. flash, html5, etc) + + @property type + @type {String} + */ + type: type, + + /** + Runtime (not native one) may operate in browser or client mode. + + @property mode + @private + @type {String|Boolean} current mode or false, if none possible + */ + mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode), + + /** + id of the DOM container for the runtime (if available) + + @property shimid + @type {String} + */ + shimid: _uid + '_container', + + /** + Number of connected clients. If equal to zero, runtime can be destroyed + + @property clients + @type {Number} + */ + clients: 0, + + /** + Runtime initialization options + + @property options + @type {Object} + */ + options: options, + + /** + Checks if the runtime has specific capability + + @method can + @param {String} cap Name of capability to check + @param {Mixed} [value] If passed, capability should somehow correlate to the value + @param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set) + @return {Boolean} true if runtime has such capability and false, if - not + */ + can: function(cap, value) { + var refCaps = arguments[2] || caps; + + // if cap var is a comma-separated list of caps, convert it to object (key/value) + if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') { + cap = Runtime.parseCaps(cap); + } + + if (Basic.typeOf(cap) === 'object') { + for (var key in cap) { + if (!this.can(key, cap[key], refCaps)) { + return false; + } + } + return true; + } + + // check the individual cap + if (Basic.typeOf(refCaps[cap]) === 'function') { + return refCaps[cap].call(this, value); + } else { + return (value === refCaps[cap]); + } + }, + + /** + Returns container for the runtime as DOM element + + @method getShimContainer + @return {DOMElement} + */ + getShimContainer: function() { + var container, shimContainer = Dom.get(this.shimid); + + // if no container for shim, create one + if (!shimContainer) { + container = this.options.container ? Dom.get(this.options.container) : document.body; + + // create shim container and insert it at an absolute position into the outer container + shimContainer = document.createElement('div'); + shimContainer.id = this.shimid; + shimContainer.className = 'moxie-shim moxie-shim-' + this.type; + + Basic.extend(shimContainer.style, { + position: 'absolute', + top: '0px', + left: '0px', + width: '1px', + height: '1px', + overflow: 'hidden' + }); + + container.appendChild(shimContainer); + container = null; + } + + return shimContainer; + }, + + /** + Returns runtime as DOM element (if appropriate) + + @method getShim + @return {DOMElement} + */ + getShim: function() { + return _shim; + }, + + /** + Invokes a method within the runtime itself (might differ across the runtimes) + + @method shimExec + @param {Mixed} [] + @protected + @return {Mixed} Depends on the action and component + */ + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return self.getShim().exec.call(this, this.uid, component, action, args); + }, + + /** + Operaional interface that is used by components to invoke specific actions on the runtime + (is invoked in the scope of component) + + @method exec + @param {Mixed} []* + @protected + @return {Mixed} Depends on the action and component + */ + exec: function(component, action) { // this is called in the context of component, not runtime + var args = [].slice.call(arguments, 2); + + if (self[component] && self[component][action]) { + return self[component][action].apply(this, args); + } + return self.shimExec.apply(this, arguments); + }, + + /** + Destroys the runtime (removes all events and deletes DOM structures) + + @method destroy + */ + destroy: function() { + if (!self) { + return; // obviously already destroyed + } + + var shimContainer = Dom.get(this.shimid); + if (shimContainer) { + shimContainer.parentNode.removeChild(shimContainer); + } + + if (_shim) { + _shim.removeAllInstances(); + } + + this.unbindAll(); + delete runtimes[this.uid]; + this.uid = null; // mark this runtime as destroyed + _uid = self = _shim = shimContainer = null; + } + }); + + // once we got the mode, test against all caps + if (this.mode && options.required_caps && !this.can(options.required_caps)) { + this.mode = false; + } + } + + + /** + Default order to try different runtime types + + @property order + @type String + @static + */ + Runtime.order = 'html5,flash,silverlight,html4'; + + + /** + Retrieves runtime from private hash by it's uid + + @method getRuntime + @private + @static + @param {String} uid Unique identifier of the runtime + @return {Runtime|Boolean} Returns runtime, if it exists and false, if - not + */ + Runtime.getRuntime = function(uid) { + return runtimes[uid] ? runtimes[uid] : false; + }; + + + /** + Register constructor for the Runtime of new (or perhaps modified) type + + @method addConstructor + @static + @param {String} type Runtime type (e.g. flash, html5, etc) + @param {Function} construct Constructor for the Runtime type + */ + Runtime.addConstructor = function(type, constructor) { + constructor.prototype = EventTarget.instance; + runtimeConstructors[type] = constructor; + }; + + + /** + Get the constructor for the specified type. + + method getConstructor + @static + @param {String} type Runtime type (e.g. flash, html5, etc) + @return {Function} Constructor for the Runtime type + */ + Runtime.getConstructor = function(type) { + return runtimeConstructors[type] || null; + }; + + + /** + Get info about the runtime (uid, type, capabilities) + + @method getInfo + @static + @param {String} uid Unique identifier of the runtime + @return {Mixed} Info object or null if runtime doesn't exist + */ + Runtime.getInfo = function(uid) { + var runtime = Runtime.getRuntime(uid); + + if (runtime) { + return { + uid: runtime.uid, + type: runtime.type, + mode: runtime.mode, + can: function() { + return runtime.can.apply(runtime, arguments); + } + }; + } + return null; + }; + + + /** + Convert caps represented by a comma-separated string to the object representation. + + @method parseCaps + @static + @param {String} capStr Comma-separated list of capabilities + @return {Object} + */ + Runtime.parseCaps = function(capStr) { + var capObj = {}; + + if (Basic.typeOf(capStr) !== 'string') { + return capStr || {}; + } + + Basic.each(capStr.split(','), function(key) { + capObj[key] = true; // we assume it to be - true + }); + + return capObj; + }; + + /** + Test the specified runtime for specific capabilities. + + @method can + @static + @param {String} type Runtime type (e.g. flash, html5, etc) + @param {String|Object} caps Set of capabilities to check + @return {Boolean} Result of the test + */ + Runtime.can = function(type, caps) { + var runtime + , constructor = Runtime.getConstructor(type) + , mode + ; + if (constructor) { + runtime = new constructor({ + required_caps: caps + }); + mode = runtime.mode; + runtime.destroy(); + return !!mode; + } + return false; + }; + + + /** + Figure out a runtime that supports specified capabilities. + + @method thatCan + @static + @param {String|Object} caps Set of capabilities to check + @param {String} [runtimeOrder] Comma-separated list of runtimes to check against + @return {String} Usable runtime identifier or null + */ + Runtime.thatCan = function(caps, runtimeOrder) { + var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/); + for (var i in types) { + if (Runtime.can(types[i], caps)) { + return types[i]; + } + } + return null; + }; + + + /** + Figure out an operational mode for the specified set of capabilities. + + @method getMode + @static + @param {Object} modeCaps Set of capabilities that depend on particular runtime mode + @param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for + @param {String|Boolean} [defaultMode='browser'] Default mode to use + @return {String|Boolean} Compatible operational mode + */ + Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) { + var mode = null; + + if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified + defaultMode = 'browser'; + } + + if (requiredCaps && !Basic.isEmptyObj(modeCaps)) { + // loop over required caps and check if they do require the same mode + Basic.each(requiredCaps, function(value, cap) { + if (modeCaps.hasOwnProperty(cap)) { + var capMode = modeCaps[cap](value); + + // make sure we always have an array + if (typeof(capMode) === 'string') { + capMode = [capMode]; + } + + if (!mode) { + mode = capMode; + } else if (!(mode = Basic.arrayIntersect(mode, capMode))) { + // if cap requires conflicting mode - runtime cannot fulfill required caps + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\t\t%c: %v (conflicting mode requested: %s)", cap, value, capMode); + } + + return (mode = false); + } + } + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\t\t%c: %v (compatible modes: %s)", cap, value, mode); + } + }); + + if (mode) { + return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0]; + } else if (mode === false) { + return false; + } + } + return defaultMode; + }; + + + /** + Capability check that always returns true + + @private + @static + @return {True} + */ + Runtime.capTrue = function() { + return true; + }; + + /** + Capability check that always returns false + + @private + @static + @return {False} + */ + Runtime.capFalse = function() { + return false; + }; + + /** + Evaluate the expression to boolean value and create a function that always returns it. + + @private + @static + @param {Mixed} expr Expression to evaluate + @return {Function} Function returning the result of evaluation + */ + Runtime.capTest = function(expr) { + return function() { + return !!expr; + }; + }; + + return Runtime; +}); + +// Included from: src/javascript/runtime/RuntimeClient.js + +/** + * RuntimeClient.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/RuntimeClient', [ + 'moxie/core/utils/Env', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic', + 'moxie/runtime/Runtime' +], function(Env, x, Basic, Runtime) { + /** + Set of methods and properties, required by a component to acquire ability to connect to a runtime + + @class RuntimeClient + */ + return function RuntimeClient() { + var runtime; + + Basic.extend(this, { + /** + Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one. + Increments number of clients connected to the specified runtime. + + @private + @method connectRuntime + @param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites + */ + connectRuntime: function(options) { + var comp = this, ruid; + + function initialize(items) { + var type, constructor; + + // if we ran out of runtimes + if (!items.length) { + comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + runtime = null; + return; + } + + type = items.shift().toLowerCase(); + constructor = Runtime.getConstructor(type); + if (!constructor) { + initialize(items); + return; + } + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Trying runtime: %s", type); + Env.log(options); + } + + // try initializing the runtime + runtime = new constructor(options); + + runtime.bind('Init', function() { + // mark runtime as initialized + runtime.initialized = true; + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Runtime '%s' initialized", runtime.type); + } + + // jailbreak ... + setTimeout(function() { + runtime.clients++; + // this will be triggered on component + comp.trigger('RuntimeInit', runtime); + }, 1); + }); + + runtime.bind('Error', function() { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("Runtime '%s' failed to initialize", runtime.type); + } + + runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here + initialize(items); + }); + + /*runtime.bind('Exception', function() { });*/ + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tselected mode: %s", runtime.mode); + } + + // check if runtime managed to pick-up operational mode + if (!runtime.mode) { + runtime.trigger('Error'); + return; + } + + runtime.init(); + } + + // check if a particular runtime was requested + if (Basic.typeOf(options) === 'string') { + ruid = options; + } else if (Basic.typeOf(options.ruid) === 'string') { + ruid = options.ruid; + } + + if (ruid) { + runtime = Runtime.getRuntime(ruid); + if (runtime) { + runtime.clients++; + return runtime; + } else { + // there should be a runtime and there's none - weird case + throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR); + } + } + + // initialize a fresh one, that fits runtime list and required features best + initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/)); + }, + + + /** + Disconnects from the runtime. Decrements number of clients connected to the specified runtime. + + @private + @method disconnectRuntime + */ + disconnectRuntime: function() { + if (runtime && --runtime.clients <= 0) { + runtime.destroy(); + } + + // once the component is disconnected, it shouldn't have access to the runtime + runtime = null; + }, + + + /** + Returns the runtime to which the client is currently connected. + + @method getRuntime + @return {Runtime} Runtime or null if client is not connected + */ + getRuntime: function() { + if (runtime && runtime.uid) { + return runtime; + } + return runtime = null; // make sure we do not leave zombies rambling around + }, + + + /** + Handy shortcut to safely invoke runtime extension methods. + + @private + @method exec + @return {Mixed} Whatever runtime extension method returns + */ + exec: function() { + if (runtime) { + return runtime.exec.apply(this, arguments); + } + return null; + } + + }); + }; + + +}); + +// Included from: src/javascript/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileInput', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Env', + 'moxie/core/utils/Mime', + 'moxie/core/utils/Dom', + 'moxie/core/Exceptions', + 'moxie/core/EventTarget', + 'moxie/core/I18n', + 'moxie/runtime/Runtime', + 'moxie/runtime/RuntimeClient' +], function(Basic, Env, Mime, Dom, x, EventTarget, I18n, Runtime, RuntimeClient) { + /** + Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click, + converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory + with _FileReader_ or uploaded to a server through _XMLHttpRequest_. + + @class FileInput + @constructor + @extends EventTarget + @uses RuntimeClient + @param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_. + @param {String|DOMElement} options.browse_button DOM Element to turn into file picker. + @param {Array} [options.accept] Array of mime types to accept. By default accepts all. + @param {String} [options.file='file'] Name of the file field (not the filename). + @param {Boolean} [options.multiple=false] Enable selection of multiple files. + @param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time). + @param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode + for _browse\_button_. + @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support. + + @example +
          + Browse... +
          + + + */ + var dispatches = [ + /** + Dispatched when runtime is connected and file-picker is ready to be used. + + @event ready + @param {Object} event + */ + 'ready', + + /** + Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. + Check [corresponding documentation entry](#method_refresh) for more info. + + @event refresh + @param {Object} event + */ + + /** + Dispatched when selection of files in the dialog is complete. + + @event change + @param {Object} event + */ + 'change', + + 'cancel', // TODO: might be useful + + /** + Dispatched when mouse cursor enters file-picker area. Can be used to style element + accordingly. + + @event mouseenter + @param {Object} event + */ + 'mouseenter', + + /** + Dispatched when mouse cursor leaves file-picker area. Can be used to style element + accordingly. + + @event mouseleave + @param {Object} event + */ + 'mouseleave', + + /** + Dispatched when functional mouse button is pressed on top of file-picker area. + + @event mousedown + @param {Object} event + */ + 'mousedown', + + /** + Dispatched when functional mouse button is released on top of file-picker area. + + @event mouseup + @param {Object} event + */ + 'mouseup' + ]; + + function FileInput(options) { + if (MXI_DEBUG) { + Env.log("Instantiating FileInput..."); + } + + var self = this, + container, browseButton, defaults; + + // if flat argument passed it should be browse_button id + if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { + options = { browse_button : options }; + } + + // this will help us to find proper default container + browseButton = Dom.get(options.browse_button); + if (!browseButton) { + // browse button is required + throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); + } + + // figure out the options + defaults = { + accept: [{ + title: I18n.translate('All Files'), + extensions: '*' + }], + name: 'file', + multiple: false, + required_caps: false, + container: browseButton.parentNode || document.body + }; + + options = Basic.extend({}, defaults, options); + + // convert to object representation + if (typeof(options.required_caps) === 'string') { + options.required_caps = Runtime.parseCaps(options.required_caps); + } + + // normalize accept option (could be list of mime types or array of title/extensions pairs) + if (typeof(options.accept) === 'string') { + options.accept = Mime.mimes2extList(options.accept); + } + + container = Dom.get(options.container); + // make sure we have container + if (!container) { + container = document.body; + } + + // make container relative, if it's not + if (Dom.getStyle(container, 'position') === 'static') { + container.style.position = 'relative'; + } + + container = browseButton = null; // IE + + RuntimeClient.call(self); + + Basic.extend(self, { + /** + Unique id of the component + + @property uid + @protected + @readOnly + @type {String} + @default UID + */ + uid: Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if any. + + @property ruid + @protected + @type {String} + */ + ruid: null, + + /** + Unique id of the runtime container. Useful to get hold of it for various manipulations. + + @property shimid + @protected + @type {String} + */ + shimid: null, + + /** + Array of selected mOxie.File objects + + @property files + @type {Array} + @default null + */ + files: null, + + /** + Initializes the file-picker, connects it to runtime and dispatches event ready when done. + + @method init + */ + init: function() { + self.bind('RuntimeInit', function(e, runtime) { + self.ruid = runtime.uid; + self.shimid = runtime.shimid; + + self.bind("Ready", function() { + self.trigger("Refresh"); + }, 999); + + // re-position and resize shim container + self.bind('Refresh', function() { + var pos, size, browseButton, shimContainer; + + browseButton = Dom.get(options.browse_button); + shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist + + if (browseButton) { + pos = Dom.getPos(browseButton, Dom.get(options.container)); + size = Dom.getSize(browseButton); + + if (shimContainer) { + Basic.extend(shimContainer.style, { + top : pos.y + 'px', + left : pos.x + 'px', + width : size.w + 'px', + height : size.h + 'px' + }); + } + } + shimContainer = browseButton = null; + }); + + runtime.exec.call(self, 'FileInput', 'init', options); + }); + + // runtime needs: options.required_features, options.runtime_order and options.container + self.connectRuntime(Basic.extend({}, options, { + required_caps: { + select_file: true + } + })); + }, + + /** + Disables file-picker element, so that it doesn't react to mouse clicks. + + @method disable + @param {Boolean} [state=true] Disable component if - true, enable if - false + */ + disable: function(state) { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); + } + }, + + + /** + Reposition and resize dialog trigger to match the position and size of browse_button element. + + @method refresh + */ + refresh: function() { + self.trigger("Refresh"); + }, + + + /** + Destroy component. + + @method destroy + */ + destroy: function() { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileInput', 'destroy'); + this.disconnectRuntime(); + } + + if (Basic.typeOf(this.files) === 'array') { + // no sense in leaving associated files behind + Basic.each(this.files, function(file) { + file.destroy(); + }); + } + this.files = null; + + this.unbindAll(); + } + }); + + this.handleEventProps(dispatches); + } + + FileInput.prototype = EventTarget.instance; + + return FileInput; +}); + +// Included from: src/javascript/core/utils/Encode.js + +/** + * Encode.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Encode', [], function() { + + /** + Encode string with UTF-8 + + @method utf8_encode + @for Utils + @static + @param {String} str String to encode + @return {String} UTF-8 encoded string + */ + var utf8_encode = function(str) { + return unescape(encodeURIComponent(str)); + }; + + /** + Decode UTF-8 encoded string + + @method utf8_decode + @static + @param {String} str String to decode + @return {String} Decoded string + */ + var utf8_decode = function(str_data) { + return decodeURIComponent(escape(str_data)); + }; + + /** + Decode Base64 encoded string (uses browser's default method if available), + from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js + + @method atob + @static + @param {String} data String to decode + @return {String} Decoded string + */ + var atob = function(data, utf8) { + if (typeof(window.atob) === 'function') { + return utf8 ? utf8_decode(window.atob(data)) : window.atob(data); + } + + // http://kevin.vanzonneveld.net + // + original by: Tyler Akins (http://rumkin.com) + // + improved by: Thunder.m + // + input by: Aman Gupta + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Onno Marsman + // + bugfixed by: Pellentesque Malesuada + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + input by: Brett Zamir (http://brett-zamir.me) + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); + // * returns 1: 'Kevin van Zonneveld' + // mozilla has this native + // - but breaks in 2.0.0.12! + //if (typeof this.window.atob == 'function') { + // return atob(data); + //} + var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + dec = "", + tmp_arr = []; + + if (!data) { + return data; + } + + data += ''; + + do { // unpack four hexets into three octets using index points in b64 + h1 = b64.indexOf(data.charAt(i++)); + h2 = b64.indexOf(data.charAt(i++)); + h3 = b64.indexOf(data.charAt(i++)); + h4 = b64.indexOf(data.charAt(i++)); + + bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; + + o1 = bits >> 16 & 0xff; + o2 = bits >> 8 & 0xff; + o3 = bits & 0xff; + + if (h3 == 64) { + tmp_arr[ac++] = String.fromCharCode(o1); + } else if (h4 == 64) { + tmp_arr[ac++] = String.fromCharCode(o1, o2); + } else { + tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); + } + } while (i < data.length); + + dec = tmp_arr.join(''); + + return utf8 ? utf8_decode(dec) : dec; + }; + + /** + Base64 encode string (uses browser's default method if available), + from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js + + @method btoa + @static + @param {String} data String to encode + @return {String} Base64 encoded string + */ + var btoa = function(data, utf8) { + if (utf8) { + data = utf8_encode(data); + } + + if (typeof(window.btoa) === 'function') { + return window.btoa(data); + } + + // http://kevin.vanzonneveld.net + // + original by: Tyler Akins (http://rumkin.com) + // + improved by: Bayron Guevara + // + improved by: Thunder.m + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Pellentesque Malesuada + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + improved by: Rafał Kukawski (http://kukawski.pl) + // * example 1: base64_encode('Kevin van Zonneveld'); + // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' + // mozilla has this native + // - but breaks in 2.0.0.12! + var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + enc = "", + tmp_arr = []; + + if (!data) { + return data; + } + + do { // pack three octets into four hexets + o1 = data.charCodeAt(i++); + o2 = data.charCodeAt(i++); + o3 = data.charCodeAt(i++); + + bits = o1 << 16 | o2 << 8 | o3; + + h1 = bits >> 18 & 0x3f; + h2 = bits >> 12 & 0x3f; + h3 = bits >> 6 & 0x3f; + h4 = bits & 0x3f; + + // use hexets to index into b64, and append result to encoded string + tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); + } while (i < data.length); + + enc = tmp_arr.join(''); + + var r = data.length % 3; + + return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); + }; + + + return { + utf8_encode: utf8_encode, + utf8_decode: utf8_decode, + atob: atob, + btoa: btoa + }; +}); + +// Included from: src/javascript/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/Blob', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Encode', + 'moxie/runtime/RuntimeClient' +], function(Basic, Encode, RuntimeClient) { + + var blobpool = {}; + + /** + @class Blob + @constructor + @param {String} ruid Unique id of the runtime, to which this blob belongs to + @param {Object} blob Object "Native" blob object, as it is represented in the runtime + */ + function Blob(ruid, blob) { + + function _sliceDetached(start, end, type) { + var blob, data = blobpool[this.uid]; + + if (Basic.typeOf(data) !== 'string' || !data.length) { + return null; // or throw exception + } + + blob = new Blob(null, { + type: type, + size: end - start + }); + blob.detach(data.substr(start, blob.size)); + + return blob; + } + + RuntimeClient.call(this); + + if (ruid) { + this.connectRuntime(ruid); + } + + if (!blob) { + blob = {}; + } else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string + blob = { data: blob }; + } + + Basic.extend(this, { + + /** + Unique id of the component + + @property uid + @type {String} + */ + uid: blob.uid || Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if falsy, then runtime will have to be initialized + before this Blob can be used, modified or sent + + @property ruid + @type {String} + */ + ruid: ruid, + + /** + Size of blob + + @property size + @type {Number} + @default 0 + */ + size: blob.size || 0, + + /** + Mime type of blob + + @property type + @type {String} + @default '' + */ + type: blob.type || '', + + /** + @method slice + @param {Number} [start=0] + */ + slice: function(start, end, type) { + if (this.isDetached()) { + return _sliceDetached.apply(this, arguments); + } + return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type); + }, + + /** + Returns "native" blob object (as it is represented in connected runtime) or null if not found + + @method getSource + @return {Blob} Returns "native" blob object or null if not found + */ + getSource: function() { + if (!blobpool[this.uid]) { + return null; + } + return blobpool[this.uid]; + }, + + /** + Detaches blob from any runtime that it depends on and initialize with standalone value + + @method detach + @protected + @param {DOMString} [data=''] Standalone value + */ + detach: function(data) { + if (this.ruid) { + this.getRuntime().exec.call(this, 'Blob', 'destroy'); + this.disconnectRuntime(); + this.ruid = null; + } + + data = data || ''; + + // if dataUrl, convert to binary string + if (data.substr(0, 5) == 'data:') { + var base64Offset = data.indexOf(';base64,'); + this.type = data.substring(5, base64Offset); + data = Encode.atob(data.substring(base64Offset + 8)); + } + + this.size = data.length; + + blobpool[this.uid] = data; + }, + + /** + Checks if blob is standalone (detached of any runtime) + + @method isDetached + @protected + @return {Boolean} + */ + isDetached: function() { + return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string'; + }, + + /** + Destroy Blob and free any resources it was using + + @method destroy + */ + destroy: function() { + this.detach(); + delete blobpool[this.uid]; + } + }); + + + if (blob.data) { + this.detach(blob.data); // auto-detach if payload has been passed + } else { + blobpool[this.uid] = blob; + } + } + + return Blob; +}); + +// Included from: src/javascript/file/File.js + +/** + * File.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/File', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Mime', + 'moxie/file/Blob' +], function(Basic, Mime, Blob) { + /** + @class File + @extends Blob + @constructor + @param {String} ruid Unique id of the runtime, to which this blob belongs to + @param {Object} file Object "Native" file object, as it is represented in the runtime + */ + function File(ruid, file) { + if (!file) { // avoid extra errors in case we overlooked something + file = {}; + } + + Blob.apply(this, arguments); + + if (!this.type) { + this.type = Mime.getFileMime(file.name); + } + + // sanitize file name or generate new one + var name; + if (file.name) { + name = file.name.replace(/\\/g, '/'); + name = name.substr(name.lastIndexOf('/') + 1); + } else if (this.type) { + var prefix = this.type.split('/')[0]; + name = Basic.guid((prefix !== '' ? prefix : 'file') + '_'); + + if (Mime.extensions[this.type]) { + name += '.' + Mime.extensions[this.type][0]; // append proper extension if possible + } + } + + + Basic.extend(this, { + /** + File name + + @property name + @type {String} + @default UID + */ + name: name || Basic.guid('file_'), + + /** + Relative path to the file inside a directory + + @property relativePath + @type {String} + @default '' + */ + relativePath: '', + + /** + Date of last modification + + @property lastModifiedDate + @type {String} + @default now + */ + lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) + }); + } + + File.prototype = Blob.prototype; + + return File; +}); + +// Included from: src/javascript/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileDrop', [ + 'moxie/core/I18n', + 'moxie/core/utils/Dom', + 'moxie/core/Exceptions', + 'moxie/core/utils/Basic', + 'moxie/core/utils/Env', + 'moxie/file/File', + 'moxie/runtime/RuntimeClient', + 'moxie/core/EventTarget', + 'moxie/core/utils/Mime' +], function(I18n, Dom, x, Basic, Env, File, RuntimeClient, EventTarget, Mime) { + /** + Turn arbitrary DOM element to a drop zone accepting files. Converts selected files to _File_ objects, to be used + in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through + _XMLHttpRequest_. + + @example +
          + Drop files here +
          +
          +
          + + + + @class FileDrop + @constructor + @extends EventTarget + @uses RuntimeClient + @param {Object|String} options If options has typeof string, argument is considered as options.drop_zone + @param {String|DOMElement} options.drop_zone DOM Element to turn into a drop zone + @param {Array} [options.accept] Array of mime types to accept. By default accepts all + @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support + */ + var dispatches = [ + /** + Dispatched when runtime is connected and drop zone is ready to accept files. + + @event ready + @param {Object} event + */ + 'ready', + + /** + Dispatched when dragging cursor enters the drop zone. + + @event dragenter + @param {Object} event + */ + 'dragenter', + + /** + Dispatched when dragging cursor leaves the drop zone. + + @event dragleave + @param {Object} event + */ + 'dragleave', + + /** + Dispatched when file is dropped onto the drop zone. + + @event drop + @param {Object} event + */ + 'drop', + + /** + Dispatched if error occurs. + + @event error + @param {Object} event + */ + 'error' + ]; + + function FileDrop(options) { + if (MXI_DEBUG) { + Env.log("Instantiating FileDrop..."); + } + + var self = this, defaults; + + // if flat argument passed it should be drop_zone id + if (typeof(options) === 'string') { + options = { drop_zone : options }; + } + + // figure out the options + defaults = { + accept: [{ + title: I18n.translate('All Files'), + extensions: '*' + }], + required_caps: { + drag_and_drop: true + } + }; + + options = typeof(options) === 'object' ? Basic.extend({}, defaults, options) : defaults; + + // this will help us to find proper default container + options.container = Dom.get(options.drop_zone) || document.body; + + // make container relative, if it is not + if (Dom.getStyle(options.container, 'position') === 'static') { + options.container.style.position = 'relative'; + } + + // normalize accept option (could be list of mime types or array of title/extensions pairs) + if (typeof(options.accept) === 'string') { + options.accept = Mime.mimes2extList(options.accept); + } + + RuntimeClient.call(self); + + Basic.extend(self, { + uid: Basic.guid('uid_'), + + ruid: null, + + files: null, + + init: function() { + self.bind('RuntimeInit', function(e, runtime) { + self.ruid = runtime.uid; + runtime.exec.call(self, 'FileDrop', 'init', options); + self.dispatchEvent('ready'); + }); + + // runtime needs: options.required_features, options.runtime_order and options.container + self.connectRuntime(options); // throws RuntimeError + }, + + destroy: function() { + var runtime = this.getRuntime(); + if (runtime) { + runtime.exec.call(this, 'FileDrop', 'destroy'); + this.disconnectRuntime(); + } + this.files = null; + + this.unbindAll(); + } + }); + + this.handleEventProps(dispatches); + } + + FileDrop.prototype = EventTarget.instance; + + return FileDrop; +}); + +// Included from: src/javascript/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileReader', [ + 'moxie/core/utils/Basic', + 'moxie/core/utils/Encode', + 'moxie/core/Exceptions', + 'moxie/core/EventTarget', + 'moxie/file/Blob', + 'moxie/runtime/RuntimeClient' +], function(Basic, Encode, x, EventTarget, Blob, RuntimeClient) { + /** + Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) + interface. Where possible uses native FileReader, where - not falls back to shims. + + @class FileReader + @constructor FileReader + @extends EventTarget + @uses RuntimeClient + */ + var dispatches = [ + + /** + Dispatched when the read starts. + + @event loadstart + @param {Object} event + */ + 'loadstart', + + /** + Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). + + @event progress + @param {Object} event + */ + 'progress', + + /** + Dispatched when the read has successfully completed. + + @event load + @param {Object} event + */ + 'load', + + /** + Dispatched when the read has been aborted. For instance, by invoking the abort() method. + + @event abort + @param {Object} event + */ + 'abort', + + /** + Dispatched when the read has failed. + + @event error + @param {Object} event + */ + 'error', + + /** + Dispatched when the request has completed (either in success or failure). + + @event loadend + @param {Object} event + */ + 'loadend' + ]; + + function FileReader() { + + RuntimeClient.call(this); + + Basic.extend(this, { + /** + UID of the component instance. + + @property uid + @type {String} + */ + uid: Basic.guid('uid_'), + + /** + Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING + and FileReader.DONE. + + @property readyState + @type {Number} + @default FileReader.EMPTY + */ + readyState: FileReader.EMPTY, + + /** + Result of the successful read operation. + + @property result + @type {String} + */ + result: null, + + /** + Stores the error of failed asynchronous read operation. + + @property error + @type {DOMError} + */ + error: null, + + /** + Initiates reading of File/Blob object contents to binary string. + + @method readAsBinaryString + @param {Blob|File} blob Object to preload + */ + readAsBinaryString: function(blob) { + _read.call(this, 'readAsBinaryString', blob); + }, + + /** + Initiates reading of File/Blob object contents to dataURL string. + + @method readAsDataURL + @param {Blob|File} blob Object to preload + */ + readAsDataURL: function(blob) { + _read.call(this, 'readAsDataURL', blob); + }, + + /** + Initiates reading of File/Blob object contents to string. + + @method readAsText + @param {Blob|File} blob Object to preload + */ + readAsText: function(blob) { + _read.call(this, 'readAsText', blob); + }, + + /** + Aborts preloading process. + + @method abort + */ + abort: function() { + this.result = null; + + if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { + return; + } else if (this.readyState === FileReader.LOADING) { + this.readyState = FileReader.DONE; + } + + this.exec('FileReader', 'abort'); + + this.trigger('abort'); + this.trigger('loadend'); + }, + + /** + Destroy component and release resources. + + @method destroy + */ + destroy: function() { + this.abort(); + this.exec('FileReader', 'destroy'); + this.disconnectRuntime(); + this.unbindAll(); + } + }); + + // uid must already be assigned + this.handleEventProps(dispatches); + + this.bind('Error', function(e, err) { + this.readyState = FileReader.DONE; + this.error = err; + }, 999); + + this.bind('Load', function(e) { + this.readyState = FileReader.DONE; + }, 999); + + + function _read(op, blob) { + var self = this; + + this.trigger('loadstart'); + + if (this.readyState === FileReader.LOADING) { + this.trigger('error', new x.DOMException(x.DOMException.INVALID_STATE_ERR)); + this.trigger('loadend'); + return; + } + + // if source is not o.Blob/o.File + if (!(blob instanceof Blob)) { + this.trigger('error', new x.DOMException(x.DOMException.NOT_FOUND_ERR)); + this.trigger('loadend'); + return; + } + + this.result = null; + this.readyState = FileReader.LOADING; + + if (blob.isDetached()) { + var src = blob.getSource(); + switch (op) { + case 'readAsText': + case 'readAsBinaryString': + this.result = src; + break; + case 'readAsDataURL': + this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); + break; + } + this.readyState = FileReader.DONE; + this.trigger('load'); + this.trigger('loadend'); + } else { + this.connectRuntime(blob.ruid); + this.exec('FileReader', 'read', op, blob); + } + } + } + + /** + Initial FileReader state + + @property EMPTY + @type {Number} + @final + @static + @default 0 + */ + FileReader.EMPTY = 0; + + /** + FileReader switches to this state when it is preloading the source + + @property LOADING + @type {Number} + @final + @static + @default 1 + */ + FileReader.LOADING = 1; + + /** + Preloading is complete, this is a final state + + @property DONE + @type {Number} + @final + @static + @default 2 + */ + FileReader.DONE = 2; + + FileReader.prototype = EventTarget.instance; + + return FileReader; +}); + +// Included from: src/javascript/core/utils/Url.js + +/** + * Url.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Url', [], function() { + /** + Parse url into separate components and fill in absent parts with parts from current url, + based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js + + @method parseUrl + @for Utils + @static + @param {String} url Url to parse (defaults to empty string if undefined) + @return {Object} Hash containing extracted uri components + */ + var parseUrl = function(url, currentUrl) { + var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] + , i = key.length + , ports = { + http: 80, + https: 443 + } + , uri = {} + , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ + , m = regex.exec(url || '') + ; + + while (i--) { + if (m[i]) { + uri[key[i]] = m[i]; + } + } + + // when url is relative, we set the origin and the path ourselves + if (!uri.scheme) { + // come up with defaults + if (!currentUrl || typeof(currentUrl) === 'string') { + currentUrl = parseUrl(currentUrl || document.location.href); + } + + uri.scheme = currentUrl.scheme; + uri.host = currentUrl.host; + uri.port = currentUrl.port; + + var path = ''; + // for urls without trailing slash we need to figure out the path + if (/^[^\/]/.test(uri.path)) { + path = currentUrl.path; + // if path ends with a filename, strip it + if (/\/[^\/]*\.[^\/]*$/.test(path)) { + path = path.replace(/\/[^\/]+$/, '/'); + } else { + // avoid double slash at the end (see #127) + path = path.replace(/\/?$/, '/'); + } + } + uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir + } + + if (!uri.port) { + uri.port = ports[uri.scheme] || 80; + } + + uri.port = parseInt(uri.port, 10); + + if (!uri.path) { + uri.path = "/"; + } + + delete uri.source; + + return uri; + }; + + /** + Resolve url - among other things will turn relative url to absolute + + @method resolveUrl + @static + @param {String|Object} url Either absolute or relative, or a result of parseUrl call + @return {String} Resolved, absolute url + */ + var resolveUrl = function(url) { + var ports = { // we ignore default ports + http: 80, + https: 443 + } + , urlp = typeof(url) === 'object' ? url : parseUrl(url); + ; + + return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); + }; + + /** + Check if specified url has the same origin as the current document + + @method hasSameOrigin + @param {String|Object} url + @return {Boolean} + */ + var hasSameOrigin = function(url) { + function origin(url) { + return [url.scheme, url.host, url.port].join('/'); + } + + if (typeof url === 'string') { + url = parseUrl(url); + } + + return origin(parseUrl()) === origin(url); + }; + + return { + parseUrl: parseUrl, + resolveUrl: resolveUrl, + hasSameOrigin: hasSameOrigin + }; +}); + +// Included from: src/javascript/runtime/RuntimeTarget.js + +/** + * RuntimeTarget.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/runtime/RuntimeTarget', [ + 'moxie/core/utils/Basic', + 'moxie/runtime/RuntimeClient', + "moxie/core/EventTarget" +], function(Basic, RuntimeClient, EventTarget) { + /** + Instance of this class can be used as a target for the events dispatched by shims, + when allowing them onto components is for either reason inappropriate + + @class RuntimeTarget + @constructor + @protected + @extends EventTarget + */ + function RuntimeTarget() { + this.uid = Basic.guid('uid_'); + + RuntimeClient.call(this); + + this.destroy = function() { + this.disconnectRuntime(); + this.unbindAll(); + }; + } + + RuntimeTarget.prototype = EventTarget.instance; + + return RuntimeTarget; +}); + +// Included from: src/javascript/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/file/FileReaderSync', [ + 'moxie/core/utils/Basic', + 'moxie/runtime/RuntimeClient', + 'moxie/core/utils/Encode' +], function(Basic, RuntimeClient, Encode) { + /** + Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here + it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, + but probably < 1mb). Not meant to be used directly by user. + + @class FileReaderSync + @private + @constructor + */ + return function() { + RuntimeClient.call(this); + + Basic.extend(this, { + uid: Basic.guid('uid_'), + + readAsBinaryString: function(blob) { + return _read.call(this, 'readAsBinaryString', blob); + }, + + readAsDataURL: function(blob) { + return _read.call(this, 'readAsDataURL', blob); + }, + + /*readAsArrayBuffer: function(blob) { + return _read.call(this, 'readAsArrayBuffer', blob); + },*/ + + readAsText: function(blob) { + return _read.call(this, 'readAsText', blob); + } + }); + + function _read(op, blob) { + if (blob.isDetached()) { + var src = blob.getSource(); + switch (op) { + case 'readAsBinaryString': + return src; + case 'readAsDataURL': + return 'data:' + blob.type + ';base64,' + Encode.btoa(src); + case 'readAsText': + var txt = ''; + for (var i = 0, length = src.length; i < length; i++) { + txt += String.fromCharCode(src[i]); + } + return txt; + } + } else { + var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); + this.disconnectRuntime(); + return result; + } + } + }; +}); + +// Included from: src/javascript/xhr/FormData.js + +/** + * FormData.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/xhr/FormData", [ + "moxie/core/Exceptions", + "moxie/core/utils/Basic", + "moxie/file/Blob" +], function(x, Basic, Blob) { + /** + FormData + + @class FormData + @constructor + */ + function FormData() { + var _blob, _fields = []; + + Basic.extend(this, { + /** + Append another key-value pair to the FormData object + + @method append + @param {String} name Name for the new field + @param {String|Blob|Array|Object} value Value for the field + */ + append: function(name, value) { + var self = this, valueType = Basic.typeOf(value); + + // according to specs value might be either Blob or String + if (value instanceof Blob) { + _blob = { + name: name, + value: value // unfortunately we can only send single Blob in one FormData + }; + } else if ('array' === valueType) { + name += '[]'; + + Basic.each(value, function(value) { + self.append(name, value); + }); + } else if ('object' === valueType) { + Basic.each(value, function(value, key) { + self.append(name + '[' + key + ']', value); + }); + } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { + self.append(name, "false"); + } else { + _fields.push({ + name: name, + value: value.toString() + }); + } + }, + + /** + Checks if FormData contains Blob. + + @method hasBlob + @return {Boolean} + */ + hasBlob: function() { + return !!this.getBlob(); + }, + + /** + Retrieves blob. + + @method getBlob + @return {Object} Either Blob if found or null + */ + getBlob: function() { + return _blob && _blob.value || null; + }, + + /** + Retrieves blob field name. + + @method getBlobName + @return {String} Either Blob field name or null + */ + getBlobName: function() { + return _blob && _blob.name || null; + }, + + /** + Loop over the fields in FormData and invoke the callback for each of them. + + @method each + @param {Function} cb Callback to call for each field + */ + each: function(cb) { + Basic.each(_fields, function(field) { + cb(field.value, field.name); + }); + + if (_blob) { + cb(_blob.value, _blob.name); + } + }, + + destroy: function() { + _blob = null; + _fields = []; + } + }); + } + + return FormData; +}); + +// Included from: src/javascript/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/xhr/XMLHttpRequest", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/core/EventTarget", + "moxie/core/utils/Encode", + "moxie/core/utils/Url", + "moxie/runtime/Runtime", + "moxie/runtime/RuntimeTarget", + "moxie/file/Blob", + "moxie/file/FileReaderSync", + "moxie/xhr/FormData", + "moxie/core/utils/Env", + "moxie/core/utils/Mime" +], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { + + var httpCode = { + 100: 'Continue', + 101: 'Switching Protocols', + 102: 'Processing', + + 200: 'OK', + 201: 'Created', + 202: 'Accepted', + 203: 'Non-Authoritative Information', + 204: 'No Content', + 205: 'Reset Content', + 206: 'Partial Content', + 207: 'Multi-Status', + 226: 'IM Used', + + 300: 'Multiple Choices', + 301: 'Moved Permanently', + 302: 'Found', + 303: 'See Other', + 304: 'Not Modified', + 305: 'Use Proxy', + 306: 'Reserved', + 307: 'Temporary Redirect', + + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Request Entity Too Large', + 414: 'Request-URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Requested Range Not Satisfiable', + 417: 'Expectation Failed', + 422: 'Unprocessable Entity', + 423: 'Locked', + 424: 'Failed Dependency', + 426: 'Upgrade Required', + + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 510: 'Not Extended' + }; + + function XMLHttpRequestUpload() { + this.uid = Basic.guid('uid_'); + } + + XMLHttpRequestUpload.prototype = EventTarget.instance; + + /** + Implementation of XMLHttpRequest + + @class XMLHttpRequest + @constructor + @uses RuntimeClient + @extends EventTarget + */ + var dispatches = [ + 'loadstart', + + 'progress', + + 'abort', + + 'error', + + 'load', + + 'timeout', + + 'loadend' + + // readystatechange (for historical reasons) + ]; + + var NATIVE = 1, RUNTIME = 2; + + function XMLHttpRequest() { + var self = this, + // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible + props = { + /** + The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. + + @property timeout + @type Number + @default 0 + */ + timeout: 0, + + /** + Current state, can take following values: + UNSENT (numeric value 0) + The object has been constructed. + + OPENED (numeric value 1) + The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. + + HEADERS_RECEIVED (numeric value 2) + All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. + + LOADING (numeric value 3) + The response entity body is being received. + + DONE (numeric value 4) + + @property readyState + @type Number + @default 0 (UNSENT) + */ + readyState: XMLHttpRequest.UNSENT, + + /** + True when user credentials are to be included in a cross-origin request. False when they are to be excluded + in a cross-origin request and when cookies are to be ignored in its response. Initially false. + + @property withCredentials + @type Boolean + @default false + */ + withCredentials: false, + + /** + Returns the HTTP status code. + + @property status + @type Number + @default 0 + */ + status: 0, + + /** + Returns the HTTP status text. + + @property statusText + @type String + */ + statusText: "", + + /** + Returns the response type. Can be set to change the response type. Values are: + the empty string (default), "arraybuffer", "blob", "document", "json", and "text". + + @property responseType + @type String + */ + responseType: "", + + /** + Returns the document response entity body. + + Throws an "InvalidStateError" exception if responseType is not the empty string or "document". + + @property responseXML + @type Document + */ + responseXML: null, + + /** + Returns the text response entity body. + + Throws an "InvalidStateError" exception if responseType is not the empty string or "text". + + @property responseText + @type String + */ + responseText: null, + + /** + Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). + Can become: ArrayBuffer, Blob, Document, JSON, Text + + @property response + @type Mixed + */ + response: null + }, + + _async = true, + _url, + _method, + _headers = {}, + _user, + _password, + _encoding = null, + _mimeType = null, + + // flags + _sync_flag = false, + _send_flag = false, + _upload_events_flag = false, + _upload_complete_flag = false, + _error_flag = false, + _same_origin_flag = false, + + // times + _start_time, + _timeoutset_time, + + _finalMime = null, + _finalCharset = null, + + _options = {}, + _xhr, + _responseHeaders = '', + _responseHeadersBag + ; + + + Basic.extend(this, props, { + /** + Unique id of the component + + @property uid + @type String + */ + uid: Basic.guid('uid_'), + + /** + Target for Upload events + + @property upload + @type XMLHttpRequestUpload + */ + upload: new XMLHttpRequestUpload(), + + + /** + Sets the request method, request URL, synchronous flag, request username, and request password. + + Throws a "SyntaxError" exception if one of the following is true: + + method is not a valid HTTP method. + url cannot be resolved. + url contains the "user:password" format in the userinfo production. + Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. + + Throws an "InvalidAccessError" exception if one of the following is true: + + Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. + There is an associated XMLHttpRequest document and either the timeout attribute is not zero, + the withCredentials attribute is true, or the responseType attribute is not the empty string. + + + @method open + @param {String} method HTTP method to use on request + @param {String} url URL to request + @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. + @param {String} [user] Username to use in HTTP authentication process on server-side + @param {String} [password] Password to use in HTTP authentication process on server-side + */ + open: function(method, url, async, user, password) { + var urlp; + + // first two arguments are required + if (!method || !url) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method + if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 3 + if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { + _method = method.toUpperCase(); + } + + + // 4 - allowing these methods poses a security risk + if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { + throw new x.DOMException(x.DOMException.SECURITY_ERR); + } + + // 5 + url = Encode.utf8_encode(url); + + // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". + urlp = Url.parseUrl(url); + + _same_origin_flag = Url.hasSameOrigin(urlp); + + // 7 - manually build up absolute url + _url = Url.resolveUrl(url); + + // 9-10, 12-13 + if ((user || password) && !_same_origin_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + _user = user || urlp.user; + _password = password || urlp.pass; + + // 11 + _async = async || true; + + if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 14 - terminate abort() + + // 15 - terminate send() + + // 18 + _sync_flag = !_async; + _send_flag = false; + _headers = {}; + _reset.call(this); + + // 19 + _p('readyState', XMLHttpRequest.OPENED); + + // 20 + this.dispatchEvent('readystatechange'); + }, + + /** + Appends an header to the list of author request headers, or if header is already + in the list of author request headers, combines its value with value. + + Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. + Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value + is not a valid HTTP header field value. + + @method setRequestHeader + @param {String} header + @param {String|Number} value + */ + setRequestHeader: function(header, value) { + var uaHeaders = [ // these headers are controlled by the user agent + "accept-charset", + "accept-encoding", + "access-control-request-headers", + "access-control-request-method", + "connection", + "content-length", + "cookie", + "cookie2", + "content-transfer-encoding", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "user-agent", + "via" + ]; + + // 1-2 + if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3 + if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 4 + /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values + if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + }*/ + + header = Basic.trim(header).toLowerCase(); + + // setting of proxy-* and sec-* headers is prohibited by spec + if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { + return false; + } + + // camelize + // browsers lowercase header names (at least for custom ones) + // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); + + if (!_headers[header]) { + _headers[header] = value; + } else { + // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) + _headers[header] += ', ' + value; + } + return true; + }, + + /** + Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. + + @method getAllResponseHeaders + @return {String} reponse headers or empty string + */ + getAllResponseHeaders: function() { + return _responseHeaders || ''; + }, + + /** + Returns the header field value from the response of which the field name matches header, + unless the field name is Set-Cookie or Set-Cookie2. + + @method getResponseHeader + @param {String} header + @return {String} value(s) for the specified header or null + */ + getResponseHeader: function(header) { + header = header.toLowerCase(); + + if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { + return null; + } + + if (_responseHeaders && _responseHeaders !== '') { + // if we didn't parse response headers until now, do it and keep for later + if (!_responseHeadersBag) { + _responseHeadersBag = {}; + Basic.each(_responseHeaders.split(/\r\n/), function(line) { + var pair = line.split(/:\s+/); + if (pair.length === 2) { // last line might be empty, omit + pair[0] = Basic.trim(pair[0]); // just in case + _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form + header: pair[0], + value: Basic.trim(pair[1]) + }; + } + }); + } + if (_responseHeadersBag.hasOwnProperty(header)) { + return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; + } + } + return null; + }, + + /** + Sets the Content-Type header for the response to mime. + Throws an "InvalidStateError" exception if the state is LOADING or DONE. + Throws a "SyntaxError" exception if mime is not a valid media type. + + @method overrideMimeType + @param String mime Mime type to set + */ + overrideMimeType: function(mime) { + var matches, charset; + + // 1 + if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2 + mime = Basic.trim(mime.toLowerCase()); + + if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { + mime = matches[1]; + if (matches[2]) { + charset = matches[2]; + } + } + + if (!Mime.mimes[mime]) { + throw new x.DOMException(x.DOMException.SYNTAX_ERR); + } + + // 3-4 + _finalMime = mime; + _finalCharset = charset; + }, + + /** + Initiates the request. The optional argument provides the request entity body. + The argument is ignored if request method is GET or HEAD. + + Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. + + @method send + @param {Blob|Document|String|FormData} [data] Request entity body + @param {Object} [options] Set of requirements and pre-requisities for runtime initialization + */ + send: function(data, options) { + if (Basic.typeOf(options) === 'string') { + _options = { ruid: options }; + } else if (!options) { + _options = {}; + } else { + _options = options; + } + + // 1-2 + if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3 + // sending Blob + if (data instanceof Blob) { + _options.ruid = data.ruid; + _mimeType = data.type || 'application/octet-stream'; + } + + // FormData + else if (data instanceof FormData) { + if (data.hasBlob()) { + var blob = data.getBlob(); + _options.ruid = blob.ruid; + _mimeType = blob.type || 'application/octet-stream'; + } + } + + // DOMString + else if (typeof data === 'string') { + _encoding = 'UTF-8'; + _mimeType = 'text/plain;charset=UTF-8'; + + // data should be converted to Unicode and encoded as UTF-8 + data = Encode.utf8_encode(data); + } + + // if withCredentials not set, but requested, set it automatically + if (!this.withCredentials) { + this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; + } + + // 4 - storage mutex + // 5 + _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP + // 6 + _error_flag = false; + // 7 + _upload_complete_flag = !data; + // 8 - Asynchronous steps + if (!_sync_flag) { + // 8.1 + _send_flag = true; + // 8.2 + // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr + // 8.3 + //if (!_upload_complete_flag) { + // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr + //} + } + // 8.5 - Return the send() method call, but continue running the steps in this algorithm. + _doXHR.call(this, data); + }, + + /** + Cancels any network activity. + + @method abort + */ + abort: function() { + _error_flag = true; + _sync_flag = false; + + if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { + _p('readyState', XMLHttpRequest.DONE); + _send_flag = false; + + if (_xhr) { + _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); + } else { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + _upload_complete_flag = true; + } else { + _p('readyState', XMLHttpRequest.UNSENT); + } + }, + + destroy: function() { + if (_xhr) { + if (Basic.typeOf(_xhr.destroy) === 'function') { + _xhr.destroy(); + } + _xhr = null; + } + + this.unbindAll(); + + if (this.upload) { + this.upload.unbindAll(); + this.upload = null; + } + } + }); + + this.handleEventProps(dispatches.concat(['readystatechange'])); // for historical reasons + this.upload.handleEventProps(dispatches); + + /* this is nice, but maybe too lengthy + + // if supported by JS version, set getters/setters for specific properties + o.defineProperty(this, 'readyState', { + configurable: false, + + get: function() { + return _p('readyState'); + } + }); + + o.defineProperty(this, 'timeout', { + configurable: false, + + get: function() { + return _p('timeout'); + }, + + set: function(value) { + + if (_sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // timeout still should be measured relative to the start time of request + _timeoutset_time = (new Date).getTime(); + + _p('timeout', value); + } + }); + + // the withCredentials attribute has no effect when fetching same-origin resources + o.defineProperty(this, 'withCredentials', { + configurable: false, + + get: function() { + return _p('withCredentials'); + }, + + set: function(value) { + // 1-2 + if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 3-4 + if (_anonymous_flag || _sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 5 + _p('withCredentials', value); + } + }); + + o.defineProperty(this, 'status', { + configurable: false, + + get: function() { + return _p('status'); + } + }); + + o.defineProperty(this, 'statusText', { + configurable: false, + + get: function() { + return _p('statusText'); + } + }); + + o.defineProperty(this, 'responseType', { + configurable: false, + + get: function() { + return _p('responseType'); + }, + + set: function(value) { + // 1 + if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2 + if (_sync_flag) { + throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); + } + + // 3 + _p('responseType', value.toLowerCase()); + } + }); + + o.defineProperty(this, 'responseText', { + configurable: false, + + get: function() { + // 1 + if (!~o.inArray(_p('responseType'), ['', 'text'])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2-3 + if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + return _p('responseText'); + } + }); + + o.defineProperty(this, 'responseXML', { + configurable: false, + + get: function() { + // 1 + if (!~o.inArray(_p('responseType'), ['', 'document'])) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // 2-3 + if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + return _p('responseXML'); + } + }); + + o.defineProperty(this, 'response', { + configurable: false, + + get: function() { + if (!!~o.inArray(_p('responseType'), ['', 'text'])) { + if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { + return ''; + } + } + + if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { + return null; + } + + return _p('response'); + } + }); + + */ + + function _p(prop, value) { + if (!props.hasOwnProperty(prop)) { + return; + } + if (arguments.length === 1) { // get + return Env.can('define_property') ? props[prop] : self[prop]; + } else { // set + if (Env.can('define_property')) { + props[prop] = value; + } else { + self[prop] = value; + } + } + } + + /* + function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { + // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 + return str.toLowerCase(); + } + */ + + + function _doXHR(data) { + var self = this; + + _start_time = new Date().getTime(); + + _xhr = new RuntimeTarget(); + + function loadEnd() { + if (_xhr) { // it could have been destroyed by now + _xhr.destroy(); + _xhr = null; + } + self.dispatchEvent('loadend'); + self = null; + } + + function exec(runtime) { + _xhr.bind('LoadStart', function(e) { + _p('readyState', XMLHttpRequest.LOADING); + self.dispatchEvent('readystatechange'); + + self.dispatchEvent(e); + + if (_upload_events_flag) { + self.upload.dispatchEvent(e); + } + }); + + _xhr.bind('Progress', function(e) { + if (_p('readyState') !== XMLHttpRequest.LOADING) { + _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) + self.dispatchEvent('readystatechange'); + } + self.dispatchEvent(e); + }); + + _xhr.bind('UploadProgress', function(e) { + if (_upload_events_flag) { + self.upload.dispatchEvent({ + type: 'progress', + lengthComputable: false, + total: e.total, + loaded: e.loaded + }); + } + }); + + _xhr.bind('Load', function(e) { + _p('readyState', XMLHttpRequest.DONE); + _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); + _p('statusText', httpCode[_p('status')] || ""); + + _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); + + if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { + _p('responseText', _p('response')); + } else if (_p('responseType') === 'document') { + _p('responseXML', _p('response')); + } + + _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); + + self.dispatchEvent('readystatechange'); + + if (_p('status') > 0) { // status 0 usually means that server is unreachable + if (_upload_events_flag) { + self.upload.dispatchEvent(e); + } + self.dispatchEvent(e); + } else { + _error_flag = true; + self.dispatchEvent('error'); + } + loadEnd(); + }); + + _xhr.bind('Abort', function(e) { + self.dispatchEvent(e); + loadEnd(); + }); + + _xhr.bind('Error', function(e) { + _error_flag = true; + _p('readyState', XMLHttpRequest.DONE); + self.dispatchEvent('readystatechange'); + _upload_complete_flag = true; + self.dispatchEvent(e); + loadEnd(); + }); + + runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { + url: _url, + method: _method, + async: _async, + user: _user, + password: _password, + headers: _headers, + mimeType: _mimeType, + encoding: _encoding, + responseType: self.responseType, + withCredentials: self.withCredentials, + options: _options + }, data); + } + + // clarify our requirements + if (typeof(_options.required_caps) === 'string') { + _options.required_caps = Runtime.parseCaps(_options.required_caps); + } + + _options.required_caps = Basic.extend({}, _options.required_caps, { + return_response_type: self.responseType + }); + + if (data instanceof FormData) { + _options.required_caps.send_multipart = true; + } + + if (!Basic.isEmptyObj(_headers)) { + _options.required_caps.send_custom_headers = true; + } + + if (!_same_origin_flag) { + _options.required_caps.do_cors = true; + } + + + if (_options.ruid) { // we do not need to wait if we can connect directly + exec(_xhr.connectRuntime(_options)); + } else { + _xhr.bind('RuntimeInit', function(e, runtime) { + exec(runtime); + }); + _xhr.bind('RuntimeError', function(e, err) { + self.dispatchEvent('RuntimeError', err); + }); + _xhr.connectRuntime(_options); + } + } + + + function _reset() { + _p('responseText', ""); + _p('responseXML', null); + _p('response', null); + _p('status', 0); + _p('statusText', ""); + _start_time = _timeoutset_time = null; + } + } + + XMLHttpRequest.UNSENT = 0; + XMLHttpRequest.OPENED = 1; + XMLHttpRequest.HEADERS_RECEIVED = 2; + XMLHttpRequest.LOADING = 3; + XMLHttpRequest.DONE = 4; + + XMLHttpRequest.prototype = EventTarget.instance; + + return XMLHttpRequest; +}); + +// Included from: src/javascript/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/runtime/Transporter", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Encode", + "moxie/runtime/RuntimeClient", + "moxie/core/EventTarget" +], function(Basic, Encode, RuntimeClient, EventTarget) { + function Transporter() { + var mod, _runtime, _data, _size, _pos, _chunk_size; + + RuntimeClient.call(this); + + Basic.extend(this, { + uid: Basic.guid('uid_'), + + state: Transporter.IDLE, + + result: null, + + transport: function(data, type, options) { + var self = this; + + options = Basic.extend({ + chunk_size: 204798 + }, options); + + // should divide by three, base64 requires this + if ((mod = options.chunk_size % 3)) { + options.chunk_size += 3 - mod; + } + + _chunk_size = options.chunk_size; + + _reset.call(this); + _data = data; + _size = data.length; + + if (Basic.typeOf(options) === 'string' || options.ruid) { + _run.call(self, type, this.connectRuntime(options)); + } else { + // we require this to run only once + var cb = function(e, runtime) { + self.unbind("RuntimeInit", cb); + _run.call(self, type, runtime); + }; + this.bind("RuntimeInit", cb); + this.connectRuntime(options); + } + }, + + abort: function() { + var self = this; + + self.state = Transporter.IDLE; + if (_runtime) { + _runtime.exec.call(self, 'Transporter', 'clear'); + self.trigger("TransportingAborted"); + } + + _reset.call(self); + }, + + + destroy: function() { + this.unbindAll(); + _runtime = null; + this.disconnectRuntime(); + _reset.call(this); + } + }); + + function _reset() { + _size = _pos = 0; + _data = this.result = null; + } + + function _run(type, runtime) { + var self = this; + + _runtime = runtime; + + //self.unbind("RuntimeInit"); + + self.bind("TransportingProgress", function(e) { + _pos = e.loaded; + + if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { + _transport.call(self); + } + }, 999); + + self.bind("TransportingComplete", function() { + _pos = _size; + self.state = Transporter.DONE; + _data = null; // clean a bit + self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); + }, 999); + + self.state = Transporter.BUSY; + self.trigger("TransportingStarted"); + _transport.call(self); + } + + function _transport() { + var self = this, + chunk, + bytesLeft = _size - _pos; + + if (_chunk_size > bytesLeft) { + _chunk_size = bytesLeft; + } + + chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); + _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); + } + } + + Transporter.IDLE = 0; + Transporter.BUSY = 1; + Transporter.DONE = 2; + + Transporter.prototype = EventTarget.instance; + + return Transporter; +}); + +// Included from: src/javascript/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define("moxie/image/Image", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/file/FileReaderSync", + "moxie/xhr/XMLHttpRequest", + "moxie/runtime/Runtime", + "moxie/runtime/RuntimeClient", + "moxie/runtime/Transporter", + "moxie/core/utils/Env", + "moxie/core/EventTarget", + "moxie/file/Blob", + "moxie/file/File", + "moxie/core/utils/Encode" +], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) { + /** + Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data. + + @class Image + @constructor + @extends EventTarget + */ + var dispatches = [ + 'progress', + + /** + Dispatched when loading is complete. + + @event load + @param {Object} event + */ + 'load', + + 'error', + + /** + Dispatched when resize operation is complete. + + @event resize + @param {Object} event + */ + 'resize', + + /** + Dispatched when visual representation of the image is successfully embedded + into the corresponsing container. + + @event embedded + @param {Object} event + */ + 'embedded' + ]; + + function Image() { + + RuntimeClient.call(this); + + Basic.extend(this, { + /** + Unique id of the component + + @property uid + @type {String} + */ + uid: Basic.guid('uid_'), + + /** + Unique id of the connected runtime, if any. + + @property ruid + @type {String} + */ + ruid: null, + + /** + Name of the file, that was used to create an image, if available. If not equals to empty string. + + @property name + @type {String} + @default "" + */ + name: "", + + /** + Size of the image in bytes. Actual value is set only after image is preloaded. + + @property size + @type {Number} + @default 0 + */ + size: 0, + + /** + Width of the image. Actual value is set only after image is preloaded. + + @property width + @type {Number} + @default 0 + */ + width: 0, + + /** + Height of the image. Actual value is set only after image is preloaded. + + @property height + @type {Number} + @default 0 + */ + height: 0, + + /** + Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded. + + @property type + @type {String} + @default "" + */ + type: "", + + /** + Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded. + + @property meta + @type {Object} + @default {} + */ + meta: {}, + + /** + Alias for load method, that takes another mOxie.Image object as a source (see load). + + @method clone + @param {Image} src Source for the image + @param {Boolean} [exact=false] Whether to activate in-depth clone mode + */ + clone: function() { + this.load.apply(this, arguments); + }, + + /** + Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File, + native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL, + Image will be downloaded from remote destination and loaded in memory. + + @example + var img = new mOxie.Image(); + img.onload = function() { + var blob = img.getAsBlob(); + + var formData = new mOxie.FormData(); + formData.append('file', blob); + + var xhr = new mOxie.XMLHttpRequest(); + xhr.onload = function() { + // upload complete + }; + xhr.open('post', 'upload.php'); + xhr.send(formData); + }; + img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg) + + + @method load + @param {Image|Blob|File|String} src Source for the image + @param {Boolean|Object} [mixed] + */ + load: function() { + _load.apply(this, arguments); + }, + + /** + Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions. + + @method downsize + @param {Object} opts + @param {Number} opts.width Resulting width + @param {Number} [opts.height=width] Resulting height (optional, if not supplied will default to width) + @param {Boolean} [opts.crop=false] Whether to crop the image to exact dimensions + @param {Boolean} [opts.preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) + @param {String} [opts.resample=false] Resampling algorithm to use for resizing + */ + downsize: function(opts) { + var defaults = { + width: this.width, + height: this.height, + type: this.type || 'image/jpeg', + quality: 90, + crop: false, + preserveHeaders: true, + resample: false + }; + + if (typeof(opts) === 'object') { + opts = Basic.extend(defaults, opts); + } else { + // for backward compatibility + opts = Basic.extend(defaults, { + width: arguments[0], + height: arguments[1], + crop: arguments[2], + preserveHeaders: arguments[3] + }); + } + + try { + if (!this.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // no way to reliably intercept the crash due to high resolution, so we simply avoid it + if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { + throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); + } + + this.exec('Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders); + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + }, + + /** + Alias for downsize(width, height, true). (see downsize) + + @method crop + @param {Number} width Resulting width + @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) + @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) + */ + crop: function(width, height, preserveHeaders) { + this.downsize(width, height, true, preserveHeaders); + }, + + getAsCanvas: function() { + if (!Env.can('create_canvas')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + var runtime = this.connectRuntime(this.ruid); + return runtime.exec.call(this, 'Image', 'getAsCanvas'); + }, + + /** + Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsBlob + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {Blob} Image as Blob + */ + getAsBlob: function(type, quality) { + if (!this.size) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + return this.exec('Image', 'getAsBlob', type || 'image/jpeg', quality || 90); + }, + + /** + Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsDataURL + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {String} Image as dataURL string + */ + getAsDataURL: function(type, quality) { + if (!this.size) { + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + return this.exec('Image', 'getAsDataURL', type || 'image/jpeg', quality || 90); + }, + + /** + Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws + DOMException.INVALID_STATE_ERR). + + @method getAsBinaryString + @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png + @param {Number} [quality=90] Applicable only together with mime type image/jpeg + @return {String} Image as binary string + */ + getAsBinaryString: function(type, quality) { + var dataUrl = this.getAsDataURL(type, quality); + return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)); + }, + + /** + Embeds a visual representation of the image into the specified node. Depending on the runtime, + it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare, + can be used in legacy browsers that do not have canvas or proper dataURI support). + + @method embed + @param {DOMElement} el DOM element to insert the image object into + @param {Object} [opts] + @param {Number} [opts.width] The width of an embed (defaults to the image width) + @param {Number} [opts.height] The height of an embed (defaults to the image height) + @param {String} [type="image/jpeg"] Mime type + @param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg + @param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions + */ + embed: function(el, opts) { + var self = this + , runtime // this has to be outside of all the closures to contain proper runtime + ; + + opts = Basic.extend({ + width: this.width, + height: this.height, + type: this.type || 'image/jpeg', + quality: 90 + }, opts || {}); + + + function render(type, quality) { + var img = this; + + // if possible, embed a canvas element directly + if (Env.can('create_canvas')) { + var canvas = img.getAsCanvas(); + if (canvas) { + el.appendChild(canvas); + canvas = null; + img.destroy(); + self.trigger('embedded'); + return; + } + } + + var dataUrl = img.getAsDataURL(type, quality); + if (!dataUrl) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + if (Env.can('use_data_uri_of', dataUrl.length)) { + el.innerHTML = ''; + img.destroy(); + self.trigger('embedded'); + } else { + var tr = new Transporter(); + + tr.bind("TransportingComplete", function() { + runtime = self.connectRuntime(this.result.ruid); + + self.bind("Embedded", function() { + // position and size properly + Basic.extend(runtime.getShimContainer().style, { + //position: 'relative', + top: '0px', + left: '0px', + width: img.width + 'px', + height: img.height + 'px' + }); + + // some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's + // position type changes (in Gecko), but since we basically need this only in IEs 6/7 and + // sometimes 8 and they do not have this problem, we can comment this for now + /*tr.bind("RuntimeInit", function(e, runtime) { + tr.destroy(); + runtime.destroy(); + onResize.call(self); // re-feed our image data + });*/ + + runtime = null; // release + }, 999); + + runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height); + img.destroy(); + }); + + tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, { + required_caps: { + display_media: true + }, + runtime_order: 'flash,silverlight', + container: el + }); + } + } + + try { + if (!(el = Dom.get(el))) { + throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR); + } + + if (!this.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + + // high-resolution images cannot be consistently handled across the runtimes + if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { + //throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); + } + + var imgCopy = new Image(); + + imgCopy.bind("Resize", function() { + render.call(this, opts.type, opts.quality); + }); + + imgCopy.bind("Load", function() { + imgCopy.downsize(opts); + }); + + // if embedded thumb data is available and dimensions are big enough, use it + if (this.meta.thumb && this.meta.thumb.width >= opts.width && this.meta.thumb.height >= opts.height) { + imgCopy.load(this.meta.thumb.data); + } else { + imgCopy.clone(this, false); + } + + return imgCopy; + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + }, + + /** + Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object. + + @method destroy + */ + destroy: function() { + if (this.ruid) { + this.getRuntime().exec.call(this, 'Image', 'destroy'); + this.disconnectRuntime(); + } + this.unbindAll(); + } + }); + + + // this is here, because in order to bind properly, we need uid, which is created above + this.handleEventProps(dispatches); + + this.bind('Load Resize', function() { + _updateInfo.call(this); + }, 999); + + + function _updateInfo(info) { + if (!info) { + info = this.exec('Image', 'getInfo'); + } + + this.size = info.size; + this.width = info.width; + this.height = info.height; + this.type = info.type; + this.meta = info.meta; + + // update file name, only if empty + if (this.name === '') { + this.name = info.name; + } + } + + + function _load(src) { + var srcType = Basic.typeOf(src); + + try { + // if source is Image + if (src instanceof Image) { + if (!src.size) { // only preloaded image objects can be used as source + throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); + } + _loadFromImage.apply(this, arguments); + } + // if source is o.Blob/o.File + else if (src instanceof Blob) { + if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + _loadFromBlob.apply(this, arguments); + } + // if native blob/file + else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) { + _load.call(this, new File(null, src), arguments[1]); + } + // if String + else if (srcType === 'string') { + // if dataUrl String + if (src.substr(0, 5) === 'data:') { + _load.call(this, new Blob(null, { data: src }), arguments[1]); + } + // else assume Url, either relative or absolute + else { + _loadFromUrl.apply(this, arguments); + } + } + // if source seems to be an img node + else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') { + _load.call(this, src.src, arguments[1]); + } + else { + throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR); + } + } catch(ex) { + // for now simply trigger error event + this.trigger('error', ex.code); + } + } + + + function _loadFromImage(img, exact) { + var runtime = this.connectRuntime(img.ruid); + this.ruid = runtime.uid; + runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact)); + } + + + function _loadFromBlob(blob, options) { + var self = this; + + self.name = blob.name || ''; + + function exec(runtime) { + self.ruid = runtime.uid; + runtime.exec.call(self, 'Image', 'loadFromBlob', blob); + } + + if (blob.isDetached()) { + this.bind('RuntimeInit', function(e, runtime) { + exec(runtime); + }); + + // convert to object representation + if (options && typeof(options.required_caps) === 'string') { + options.required_caps = Runtime.parseCaps(options.required_caps); + } + + this.connectRuntime(Basic.extend({ + required_caps: { + access_image_binary: true, + resize_image: true + } + }, options)); + } else { + exec(this.connectRuntime(blob.ruid)); + } + } + + + function _loadFromUrl(url, options) { + var self = this, xhr; + + xhr = new XMLHttpRequest(); + + xhr.open('get', url); + xhr.responseType = 'blob'; + + xhr.onprogress = function(e) { + self.trigger(e); + }; + + xhr.onload = function() { + _loadFromBlob.call(self, xhr.response, true); + }; + + xhr.onerror = function(e) { + self.trigger(e); + }; + + xhr.onloadend = function() { + xhr.destroy(); + }; + + xhr.bind('RuntimeError', function(e, err) { + self.trigger('RuntimeError', err); + }); + + xhr.send(null, options); + } + } + + // virtual world will crash on you if image has a resolution higher than this: + Image.MAX_RESIZE_WIDTH = 8192; + Image.MAX_RESIZE_HEIGHT = 8192; + + Image.prototype = EventTarget.instance; + + return Image; +}); + +// Included from: src/javascript/runtime/html5/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global File:true */ + +/** +Defines constructor for HTML5 runtime. + +@class moxie/runtime/html5/Runtime +@private +*/ +define("moxie/runtime/html5/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/Runtime", + "moxie/core/utils/Env" +], function(Basic, x, Runtime, Env) { + + var type = "html5", extensions = {}; + + function Html5Runtime(options) { + var I = this + , Test = Runtime.capTest + , True = Runtime.capTrue + ; + + var caps = Basic.extend({ + access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL), + access_image_binary: function() { + return I.can('access_binary') && !!extensions.Image; + }, + display_media: Test(Env.can('create_canvas') || Env.can('use_data_uri_over32kb')), + do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), + drag_and_drop: Test(function() { + // this comes directly from Modernizr: http://www.modernizr.com/ + var div = document.createElement('div'); + // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop + return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && + (Env.browser !== 'IE' || Env.verComp(Env.version, 9, '>')); + }()), + filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest + return (Env.browser === 'Chrome' && Env.verComp(Env.version, 28, '>=')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || + (Env.browser === 'Safari' && Env.verComp(Env.version, 7, '>=')); + }()), + return_response_headers: True, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported + return true; + } + return Env.can('return_response_type', responseType); + }, + return_status_code: True, + report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload), + resize_image: function() { + return I.can('access_binary') && Env.can('create_canvas'); + }, + select_file: function() { + return Env.can('use_fileinput') && window.File; + }, + select_folder: function() { + return I.can('select_file') && Env.browser === 'Chrome' && Env.verComp(Env.version, 21, '>='); + }, + select_multiple: function() { + // it is buggy on Safari Windows and iOS + return I.can('select_file') && + !(Env.browser === 'Safari' && Env.os === 'Windows') && + !(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.0", '>') && Env.verComp(Env.osVersion, "8.0.0", '<')); + }, + send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))), + send_custom_headers: Test(window.XMLHttpRequest), + send_multipart: function() { + return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string'); + }, + slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)), + stream_upload: function(){ + return I.can('slice_blob') && I.can('send_multipart'); + }, + summon_file_dialog: function() { // yeah... some dirty sniffing here... + return I.can('select_file') && ( + (Env.browser === 'Firefox' && Env.verComp(Env.version, 4, '>=')) || + (Env.browser === 'Opera' && Env.verComp(Env.version, 12, '>=')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || + !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']) + ); + }, + upload_filesize: True + }, + arguments[2] + ); + + Runtime.call(this, options, (arguments[1] || type), caps); + + + Basic.extend(this, { + + init : function() { + this.trigger("Init"); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + destroy = I = null; + }; + }(this.destroy)) + }); + + Basic.extend(this.getShim(), extensions); + } + + Runtime.addConstructor(type, Html5Runtime); + + return extensions; +}); + +// Included from: src/javascript/core/utils/Events.js + +/** + * Events.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +define('moxie/core/utils/Events', [ + 'moxie/core/utils/Basic' +], function(Basic) { + var eventhash = {}, uid = 'moxie_' + Basic.guid(); + + // IE W3C like event funcs + function preventDefault() { + this.returnValue = false; + } + + function stopPropagation() { + this.cancelBubble = true; + } + + /** + Adds an event handler to the specified object and store reference to the handler + in objects internal Plupload registry (@see removeEvent). + + @method addEvent + @for Utils + @static + @param {Object} obj DOM element like object to add handler to. + @param {String} name Name to add event listener to. + @param {Function} callback Function to call when event occurs. + @param {String} [key] that might be used to add specifity to the event record. + */ + var addEvent = function(obj, name, callback, key) { + var func, events; + + name = name.toLowerCase(); + + // Add event listener + if (obj.addEventListener) { + func = callback; + + obj.addEventListener(name, func, false); + } else if (obj.attachEvent) { + func = function() { + var evt = window.event; + + if (!evt.target) { + evt.target = evt.srcElement; + } + + evt.preventDefault = preventDefault; + evt.stopPropagation = stopPropagation; + + callback(evt); + }; + + obj.attachEvent('on' + name, func); + } + + // Log event handler to objects internal mOxie registry + if (!obj[uid]) { + obj[uid] = Basic.guid(); + } + + if (!eventhash.hasOwnProperty(obj[uid])) { + eventhash[obj[uid]] = {}; + } + + events = eventhash[obj[uid]]; + + if (!events.hasOwnProperty(name)) { + events[name] = []; + } + + events[name].push({ + func: func, + orig: callback, // store original callback for IE + key: key + }); + }; + + + /** + Remove event handler from the specified object. If third argument (callback) + is not specified remove all events with the specified name. + + @method removeEvent + @static + @param {Object} obj DOM element to remove event listener(s) from. + @param {String} name Name of event listener to remove. + @param {Function|String} [callback] might be a callback or unique key to match. + */ + var removeEvent = function(obj, name, callback) { + var type, undef; + + name = name.toLowerCase(); + + if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) { + type = eventhash[obj[uid]][name]; + } else { + return; + } + + for (var i = type.length - 1; i >= 0; i--) { + // undefined or not, key should match + if (type[i].orig === callback || type[i].key === callback) { + if (obj.removeEventListener) { + obj.removeEventListener(name, type[i].func, false); + } else if (obj.detachEvent) { + obj.detachEvent('on'+name, type[i].func); + } + + type[i].orig = null; + type[i].func = null; + type.splice(i, 1); + + // If callback was passed we are done here, otherwise proceed + if (callback !== undef) { + break; + } + } + } + + // If event array got empty, remove it + if (!type.length) { + delete eventhash[obj[uid]][name]; + } + + // If mOxie registry has become empty, remove it + if (Basic.isEmptyObj(eventhash[obj[uid]])) { + delete eventhash[obj[uid]]; + + // IE doesn't let you remove DOM object property with - delete + try { + delete obj[uid]; + } catch(e) { + obj[uid] = undef; + } + } + }; + + + /** + Remove all kind of events from the specified object + + @method removeAllEvents + @static + @param {Object} obj DOM element to remove event listeners from. + @param {String} [key] unique key to match, when removing events. + */ + var removeAllEvents = function(obj, key) { + if (!obj || !obj[uid]) { + return; + } + + Basic.each(eventhash[obj[uid]], function(events, name) { + removeEvent(obj, name, key); + }); + }; + + return { + addEvent: addEvent, + removeEvent: removeEvent, + removeAllEvents: removeAllEvents + }; +}); + +// Included from: src/javascript/runtime/html5/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileInput +@private +*/ +define("moxie/runtime/html5/file/FileInput", [ + "moxie/runtime/html5/Runtime", + "moxie/file/File", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, File, Basic, Dom, Events, Mime, Env) { + + function FileInput() { + var _options; + + Basic.extend(this, { + init: function(options) { + var comp = this, I = comp.getRuntime(), input, shimContainer, mimes, browseButton, zIndex, top; + + _options = options; + + // figure out accept string + mimes = _options.accept.mimes || Mime.extList2mimes(_options.accept, I.can('filter_by_extension')); + + shimContainer = I.getShimContainer(); + + shimContainer.innerHTML = ''; + + input = Dom.get(I.uid); + + // prepare file input to be placed underneath the browse_button element + Basic.extend(input.style, { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + + browseButton = Dom.get(_options.browse_button); + + // Route click event to the input[type=file] element for browsers that support such behavior + if (I.can('summon_file_dialog')) { + if (Dom.getStyle(browseButton, 'position') === 'static') { + browseButton.style.position = 'relative'; + } + + zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; + + browseButton.style.zIndex = zIndex; + shimContainer.style.zIndex = zIndex - 1; + + Events.addEvent(browseButton, 'click', function(e) { + var input = Dom.get(I.uid); + if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] + input.click(); + } + e.preventDefault(); + }, comp.uid); + } + + /* Since we have to place input[type=file] on top of the browse_button for some browsers, + browse_button loses interactivity, so we restore it here */ + top = I.can('summon_file_dialog') ? browseButton : shimContainer; + + Events.addEvent(top, 'mouseover', function() { + comp.trigger('mouseenter'); + }, comp.uid); + + Events.addEvent(top, 'mouseout', function() { + comp.trigger('mouseleave'); + }, comp.uid); + + Events.addEvent(top, 'mousedown', function() { + comp.trigger('mousedown'); + }, comp.uid); + + Events.addEvent(Dom.get(_options.container), 'mouseup', function() { + comp.trigger('mouseup'); + }, comp.uid); + + + input.onchange = function onChange(e) { // there should be only one handler for this + comp.files = []; + + Basic.each(this.files, function(file) { + var relativePath = ''; + + if (_options.directory) { + // folders are represented by dots, filter them out (Chrome 11+) + if (file.name == ".") { + // if it looks like a folder... + return true; + } + } + + if (file.webkitRelativePath) { + relativePath = '/' + file.webkitRelativePath.replace(/^\//, ''); + } + + file = new File(I.uid, file); + file.relativePath = relativePath; + + comp.files.push(file); + }); + + // clearing the value enables the user to select the same file again if they want to + if (Env.browser !== 'IE' && Env.browser !== 'IEMobile') { + this.value = ''; + } else { + // in IE input[type="file"] is read-only so the only way to reset it is to re-insert it + var clone = this.cloneNode(true); + this.parentNode.replaceChild(clone, this); + clone.onchange = onChange; + } + + if (comp.files.length) { + comp.trigger('change'); + } + }; + + // ready event is perfectly asynchronous + comp.trigger({ + type: 'ready', + async: true + }); + + shimContainer = null; + }, + + + disable: function(state) { + var I = this.getRuntime(), input; + + if ((input = Dom.get(I.uid))) { + input.disabled = !!state; + } + }, + + destroy: function() { + var I = this.getRuntime() + , shim = I.getShim() + , shimContainer = I.getShimContainer() + ; + + Events.removeAllEvents(shimContainer, this.uid); + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); + + if (shimContainer) { + shimContainer.innerHTML = ''; + } + + shim.removeInstance(this.uid); + + _options = shimContainer = shim = null; + } + }); + } + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/html5/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/Blob +@private +*/ +define("moxie/runtime/html5/file/Blob", [ + "moxie/runtime/html5/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + function HTML5Blob() { + function w3cBlobSlice(blob, start, end) { + var blobSlice; + + if (window.File.prototype.slice) { + try { + blob.slice(); // depricated version will throw WRONG_ARGUMENTS_ERR exception + return blob.slice(start, end); + } catch (e) { + // depricated slice method + return blob.slice(start, end - start); + } + // slice method got prefixed: https://bugzilla.mozilla.org/show_bug.cgi?id=649672 + } else if ((blobSlice = window.File.prototype.webkitSlice || window.File.prototype.mozSlice)) { + return blobSlice.call(blob, start, end); + } else { + return null; // or throw some exception + } + } + + this.slice = function() { + return new Blob(this.getRuntime().uid, w3cBlobSlice.apply(this, arguments)); + }; + } + + return (extensions.Blob = HTML5Blob); +}); + +// Included from: src/javascript/runtime/html5/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileDrop +@private +*/ +define("moxie/runtime/html5/file/FileDrop", [ + "moxie/runtime/html5/Runtime", + 'moxie/file/File', + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime" +], function(extensions, File, Basic, Dom, Events, Mime) { + + function FileDrop() { + var _files = [], _allowedExts = [], _options, _ruid; + + Basic.extend(this, { + init: function(options) { + var comp = this, dropZone; + + _options = options; + _ruid = comp.ruid; // every dropped-in file should have a reference to the runtime + _allowedExts = _extractExts(_options.accept); + dropZone = _options.container; + + Events.addEvent(dropZone, 'dragover', function(e) { + if (!_hasFiles(e)) { + return; + } + e.preventDefault(); + e.dataTransfer.dropEffect = 'copy'; + }, comp.uid); + + Events.addEvent(dropZone, 'drop', function(e) { + if (!_hasFiles(e)) { + return; + } + e.preventDefault(); + + _files = []; + + // Chrome 21+ accepts folders via Drag'n'Drop + if (e.dataTransfer.items && e.dataTransfer.items[0].webkitGetAsEntry) { + _readItems(e.dataTransfer.items, function() { + comp.files = _files; + comp.trigger("drop"); + }); + } else { + Basic.each(e.dataTransfer.files, function(file) { + _addFile(file); + }); + comp.files = _files; + comp.trigger("drop"); + } + }, comp.uid); + + Events.addEvent(dropZone, 'dragenter', function(e) { + comp.trigger("dragenter"); + }, comp.uid); + + Events.addEvent(dropZone, 'dragleave', function(e) { + comp.trigger("dragleave"); + }, comp.uid); + }, + + destroy: function() { + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + _ruid = _files = _allowedExts = _options = null; + } + }); + + + function _hasFiles(e) { + if (!e.dataTransfer || !e.dataTransfer.types) { // e.dataTransfer.files is not available in Gecko during dragover + return false; + } + + var types = Basic.toArray(e.dataTransfer.types || []); + + return Basic.inArray("Files", types) !== -1 || + Basic.inArray("public.file-url", types) !== -1 || // Safari < 5 + Basic.inArray("application/x-moz-file", types) !== -1 // Gecko < 1.9.2 (< Firefox 3.6) + ; + } + + + function _addFile(file, relativePath) { + if (_isAcceptable(file)) { + var fileObj = new File(_ruid, file); + fileObj.relativePath = relativePath || ''; + _files.push(fileObj); + } + } + + + function _extractExts(accept) { + var exts = []; + for (var i = 0; i < accept.length; i++) { + [].push.apply(exts, accept[i].extensions.split(/\s*,\s*/)); + } + return Basic.inArray('*', exts) === -1 ? exts : []; + } + + + function _isAcceptable(file) { + if (!_allowedExts.length) { + return true; + } + var ext = Mime.getFileExtension(file.name); + return !ext || Basic.inArray(ext, _allowedExts) !== -1; + } + + + function _readItems(items, cb) { + var entries = []; + Basic.each(items, function(item) { + var entry = item.webkitGetAsEntry(); + // Address #998 (https://code.google.com/p/chromium/issues/detail?id=332579) + if (entry) { + // file() fails on OSX when the filename contains a special character (e.g. umlaut): see #61 + if (entry.isFile) { + _addFile(item.getAsFile(), entry.fullPath); + } else { + entries.push(entry); + } + } + }); + + if (entries.length) { + _readEntries(entries, cb); + } else { + cb(); + } + } + + + function _readEntries(entries, cb) { + var queue = []; + Basic.each(entries, function(entry) { + queue.push(function(cbcb) { + _readEntry(entry, cbcb); + }); + }); + Basic.inSeries(queue, function() { + cb(); + }); + } + + + function _readEntry(entry, cb) { + if (entry.isFile) { + entry.file(function(file) { + _addFile(file, entry.fullPath); + cb(); + }, function() { + // fire an error event maybe + cb(); + }); + } else if (entry.isDirectory) { + _readDirEntry(entry, cb); + } else { + cb(); // not file, not directory? what then?.. + } + } + + + function _readDirEntry(dirEntry, cb) { + var entries = [], dirReader = dirEntry.createReader(); + + // keep quering recursively till no more entries + function getEntries(cbcb) { + dirReader.readEntries(function(moreEntries) { + if (moreEntries.length) { + [].push.apply(entries, moreEntries); + getEntries(cbcb); + } else { + cbcb(); + } + }, cbcb); + } + + // ...and you thought FileReader was crazy... + getEntries(function() { + _readEntries(entries, cb); + }); + } + } + + return (extensions.FileDrop = FileDrop); +}); + +// Included from: src/javascript/runtime/html5/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/file/FileReader +@private +*/ +define("moxie/runtime/html5/file/FileReader", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Encode", + "moxie/core/utils/Basic" +], function(extensions, Encode, Basic) { + + function FileReader() { + var _fr, _convertToBinary = false; + + Basic.extend(this, { + + read: function(op, blob) { + var comp = this; + + comp.result = ''; + + _fr = new window.FileReader(); + + _fr.addEventListener('progress', function(e) { + comp.trigger(e); + }); + + _fr.addEventListener('load', function(e) { + comp.result = _convertToBinary ? _toBinary(_fr.result) : _fr.result; + comp.trigger(e); + }); + + _fr.addEventListener('error', function(e) { + comp.trigger(e, _fr.error); + }); + + _fr.addEventListener('loadend', function(e) { + _fr = null; + comp.trigger(e); + }); + + if (Basic.typeOf(_fr[op]) === 'function') { + _convertToBinary = false; + _fr[op](blob.getSource()); + } else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+ + _convertToBinary = true; + _fr.readAsDataURL(blob.getSource()); + } + }, + + abort: function() { + if (_fr) { + _fr.abort(); + } + }, + + destroy: function() { + _fr = null; + } + }); + + function _toBinary(str) { + return Encode.atob(str.substring(str.indexOf('base64,') + 7)); + } + } + + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/html5/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +@class moxie/runtime/html5/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/html5/xhr/XMLHttpRequest", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Mime", + "moxie/core/utils/Url", + "moxie/file/File", + "moxie/file/Blob", + "moxie/xhr/FormData", + "moxie/core/Exceptions", + "moxie/core/utils/Env" +], function(extensions, Basic, Mime, Url, File, Blob, FormData, x, Env) { + + function XMLHttpRequest() { + var self = this + , _xhr + , _filename + ; + + Basic.extend(this, { + send: function(meta, data) { + var target = this + , isGecko2_5_6 = (Env.browser === 'Mozilla' && Env.verComp(Env.version, 4, '>=') && Env.verComp(Env.version, 7, '<')) + , isAndroidBrowser = Env.browser === 'Android Browser' + , mustSendAsBinary = false + ; + + // extract file name + _filename = meta.url.replace(/^.+?\/([\w\-\.]+)$/, '$1').toLowerCase(); + + _xhr = _getNativeXHR(); + _xhr.open(meta.method, meta.url, meta.async, meta.user, meta.password); + + + // prepare data to be sent + if (data instanceof Blob) { + if (data.isDetached()) { + mustSendAsBinary = true; + } + data = data.getSource(); + } else if (data instanceof FormData) { + + if (data.hasBlob()) { + if (data.getBlob().isDetached()) { + data = _prepareMultipart.call(target, data); // _xhr must be instantiated and be in OPENED state + mustSendAsBinary = true; + } else if ((isGecko2_5_6 || isAndroidBrowser) && Basic.typeOf(data.getBlob().getSource()) === 'blob' && window.FileReader) { + // Gecko 2/5/6 can't send blob in FormData: https://bugzilla.mozilla.org/show_bug.cgi?id=649150 + // Android browsers (default one and Dolphin) seem to have the same issue, see: #613 + _preloadAndSend.call(target, meta, data); + return; // _preloadAndSend will reinvoke send() with transmutated FormData =%D + } + } + + // transfer fields to real FormData + if (data instanceof FormData) { // if still a FormData, e.g. not mangled by _prepareMultipart() + var fd = new window.FormData(); + data.each(function(value, name) { + if (value instanceof Blob) { + fd.append(name, value.getSource()); + } else { + fd.append(name, value); + } + }); + data = fd; + } + } + + + // if XHR L2 + if (_xhr.upload) { + if (meta.withCredentials) { + _xhr.withCredentials = true; + } + + _xhr.addEventListener('load', function(e) { + target.trigger(e); + }); + + _xhr.addEventListener('error', function(e) { + target.trigger(e); + }); + + // additionally listen to progress events + _xhr.addEventListener('progress', function(e) { + target.trigger(e); + }); + + _xhr.upload.addEventListener('progress', function(e) { + target.trigger({ + type: 'UploadProgress', + loaded: e.loaded, + total: e.total + }); + }); + // ... otherwise simulate XHR L2 + } else { + _xhr.onreadystatechange = function onReadyStateChange() { + + // fake Level 2 events + switch (_xhr.readyState) { + + case 1: // XMLHttpRequest.OPENED + // readystatechanged is fired twice for OPENED state (in IE and Mozilla) - neu + break; + + // looks like HEADERS_RECEIVED (state 2) is not reported in Opera (or it's old versions) - neu + case 2: // XMLHttpRequest.HEADERS_RECEIVED + break; + + case 3: // XMLHttpRequest.LOADING + // try to fire progress event for not XHR L2 + var total, loaded; + + try { + if (Url.hasSameOrigin(meta.url)) { // Content-Length not accessible for cross-domain on some browsers + total = _xhr.getResponseHeader('Content-Length') || 0; // old Safari throws an exception here + } + + if (_xhr.responseText) { // responseText was introduced in IE7 + loaded = _xhr.responseText.length; + } + } catch(ex) { + total = loaded = 0; + } + + target.trigger({ + type: 'progress', + lengthComputable: !!total, + total: parseInt(total, 10), + loaded: loaded + }); + break; + + case 4: // XMLHttpRequest.DONE + // release readystatechange handler (mostly for IE) + _xhr.onreadystatechange = function() {}; + + // usually status 0 is returned when server is unreachable, but FF also fails to status 0 for 408 timeout + if (_xhr.status === 0) { + target.trigger('error'); + } else { + target.trigger('load'); + } + break; + } + }; + } + + + // set request headers + if (!Basic.isEmptyObj(meta.headers)) { + Basic.each(meta.headers, function(value, header) { + _xhr.setRequestHeader(header, value); + }); + } + + // request response type + if ("" !== meta.responseType && 'responseType' in _xhr) { + if ('json' === meta.responseType && !Env.can('return_response_type', 'json')) { // we can fake this one + _xhr.responseType = 'text'; + } else { + _xhr.responseType = meta.responseType; + } + } + + // send ... + if (!mustSendAsBinary) { + _xhr.send(data); + } else { + if (_xhr.sendAsBinary) { // Gecko + _xhr.sendAsBinary(data); + } else { // other browsers having support for typed arrays + (function() { + // mimic Gecko's sendAsBinary + var ui8a = new Uint8Array(data.length); + for (var i = 0; i < data.length; i++) { + ui8a[i] = (data.charCodeAt(i) & 0xff); + } + _xhr.send(ui8a.buffer); + }()); + } + } + + target.trigger('loadstart'); + }, + + getStatus: function() { + // according to W3C spec it should return 0 for readyState < 3, but instead it throws an exception + try { + if (_xhr) { + return _xhr.status; + } + } catch(ex) {} + return 0; + }, + + getResponse: function(responseType) { + var I = this.getRuntime(); + + try { + switch (responseType) { + case 'blob': + var file = new File(I.uid, _xhr.response); + + // try to extract file name from content-disposition if possible (might be - not, if CORS for example) + var disposition = _xhr.getResponseHeader('Content-Disposition'); + if (disposition) { + // extract filename from response header if available + var match = disposition.match(/filename=([\'\"'])([^\1]+)\1/); + if (match) { + _filename = match[2]; + } + } + file.name = _filename; + + // pre-webkit Opera doesn't set type property on the blob response + if (!file.type) { + file.type = Mime.getFileMime(_filename); + } + return file; + + case 'json': + if (!Env.can('return_response_type', 'json')) { + return _xhr.status === 200 && !!window.JSON ? JSON.parse(_xhr.responseText) : null; + } + return _xhr.response; + + case 'document': + return _getDocument(_xhr); + + default: + return _xhr.responseText !== '' ? _xhr.responseText : null; // against the specs, but for consistency across the runtimes + } + } catch(ex) { + return null; + } + }, + + getAllResponseHeaders: function() { + try { + return _xhr.getAllResponseHeaders(); + } catch(ex) {} + return ''; + }, + + abort: function() { + if (_xhr) { + _xhr.abort(); + } + }, + + destroy: function() { + self = _filename = null; + } + }); + + + // here we go... ugly fix for ugly bug + function _preloadAndSend(meta, data) { + var target = this, blob, fr; + + // get original blob + blob = data.getBlob().getSource(); + + // preload blob in memory to be sent as binary string + fr = new window.FileReader(); + fr.onload = function() { + // overwrite original blob + data.append(data.getBlobName(), new Blob(null, { + type: blob.type, + data: fr.result + })); + // invoke send operation again + self.send.call(target, meta, data); + }; + fr.readAsBinaryString(blob); + } + + + function _getNativeXHR() { + if (window.XMLHttpRequest && !(Env.browser === 'IE' && Env.verComp(Env.version, 8, '<'))) { // IE7 has native XHR but it's buggy + return new window.XMLHttpRequest(); + } else { + return (function() { + var progIDs = ['Msxml2.XMLHTTP.6.0', 'Microsoft.XMLHTTP']; // if 6.0 available, use it, otherwise failback to default 3.0 + for (var i = 0; i < progIDs.length; i++) { + try { + return new ActiveXObject(progIDs[i]); + } catch (ex) {} + } + })(); + } + } + + // @credits Sergey Ilinsky (http://www.ilinsky.com/) + function _getDocument(xhr) { + var rXML = xhr.responseXML; + var rText = xhr.responseText; + + // Try parsing responseText (@see: http://www.ilinsky.com/articles/XMLHttpRequest/#bugs-ie-responseXML-content-type) + if (Env.browser === 'IE' && rText && rXML && !rXML.documentElement && /[^\/]+\/[^\+]+\+xml/.test(xhr.getResponseHeader("Content-Type"))) { + rXML = new window.ActiveXObject("Microsoft.XMLDOM"); + rXML.async = false; + rXML.validateOnParse = false; + rXML.loadXML(rText); + } + + // Check if there is no error in document + if (rXML) { + if ((Env.browser === 'IE' && rXML.parseError !== 0) || !rXML.documentElement || rXML.documentElement.tagName === "parsererror") { + return null; + } + } + return rXML; + } + + + function _prepareMultipart(fd) { + var boundary = '----moxieboundary' + new Date().getTime() + , dashdash = '--' + , crlf = '\r\n' + , multipart = '' + , I = this.getRuntime() + ; + + if (!I.can('send_binary_string')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + _xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); + + // append multipart parameters + fd.each(function(value, name) { + // Firefox 3.6 failed to convert multibyte characters to UTF-8 in sendAsBinary(), + // so we try it here ourselves with: unescape(encodeURIComponent(value)) + if (value instanceof Blob) { + // Build RFC2388 blob + multipart += dashdash + boundary + crlf + + 'Content-Disposition: form-data; name="' + name + '"; filename="' + unescape(encodeURIComponent(value.name || 'blob')) + '"' + crlf + + 'Content-Type: ' + (value.type || 'application/octet-stream') + crlf + crlf + + value.getSource() + crlf; + } else { + multipart += dashdash + boundary + crlf + + 'Content-Disposition: form-data; name="' + name + '"' + crlf + crlf + + unescape(encodeURIComponent(value)) + crlf; + } + }); + + multipart += dashdash + boundary + dashdash + crlf; + + return multipart; + } + } + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/html5/utils/BinaryReader.js + +/** + * BinaryReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/utils/BinaryReader +@private +*/ +define("moxie/runtime/html5/utils/BinaryReader", [ + "moxie/core/utils/Basic" +], function(Basic) { + + + function BinaryReader(data) { + if (data instanceof ArrayBuffer) { + ArrayBufferReader.apply(this, arguments); + } else { + UTF16StringReader.apply(this, arguments); + } + } + + + Basic.extend(BinaryReader.prototype, { + + littleEndian: false, + + + read: function(idx, size) { + var sum, mv, i; + + if (idx + size > this.length()) { + throw new Error("You are trying to read outside the source boundaries."); + } + + mv = this.littleEndian + ? 0 + : -8 * (size - 1) + ; + + for (i = 0, sum = 0; i < size; i++) { + sum |= (this.readByteAt(idx + i) << Math.abs(mv + i*8)); + } + return sum; + }, + + + write: function(idx, num, size) { + var mv, i, str = ''; + + if (idx > this.length()) { + throw new Error("You are trying to write outside the source boundaries."); + } + + mv = this.littleEndian + ? 0 + : -8 * (size - 1) + ; + + for (i = 0; i < size; i++) { + this.writeByteAt(idx + i, (num >> Math.abs(mv + i*8)) & 255); + } + }, + + + BYTE: function(idx) { + return this.read(idx, 1); + }, + + + SHORT: function(idx) { + return this.read(idx, 2); + }, + + + LONG: function(idx) { + return this.read(idx, 4); + }, + + + SLONG: function(idx) { // 2's complement notation + var num = this.read(idx, 4); + return (num > 2147483647 ? num - 4294967296 : num); + }, + + + CHAR: function(idx) { + return String.fromCharCode(this.read(idx, 1)); + }, + + + STRING: function(idx, count) { + return this.asArray('CHAR', idx, count).join(''); + }, + + + asArray: function(type, idx, count) { + var values = []; + + for (var i = 0; i < count; i++) { + values[i] = this[type](idx + i); + } + return values; + } + }); + + + function ArrayBufferReader(data) { + var _dv = new DataView(data); + + Basic.extend(this, { + + readByteAt: function(idx) { + return _dv.getUint8(idx); + }, + + + writeByteAt: function(idx, value) { + _dv.setUint8(idx, value); + }, + + + SEGMENT: function(idx, size, value) { + switch (arguments.length) { + case 2: + return data.slice(idx, idx + size); + + case 1: + return data.slice(idx); + + case 3: + if (value === null) { + value = new ArrayBuffer(); + } + + if (value instanceof ArrayBuffer) { + var arr = new Uint8Array(this.length() - size + value.byteLength); + if (idx > 0) { + arr.set(new Uint8Array(data.slice(0, idx)), 0); + } + arr.set(new Uint8Array(value), idx); + arr.set(new Uint8Array(data.slice(idx + size)), idx + value.byteLength); + + this.clear(); + data = arr.buffer; + _dv = new DataView(data); + break; + } + + default: return data; + } + }, + + + length: function() { + return data ? data.byteLength : 0; + }, + + + clear: function() { + _dv = data = null; + } + }); + } + + + function UTF16StringReader(data) { + Basic.extend(this, { + + readByteAt: function(idx) { + return data.charCodeAt(idx); + }, + + + writeByteAt: function(idx, value) { + putstr(String.fromCharCode(value), idx, 1); + }, + + + SEGMENT: function(idx, length, segment) { + switch (arguments.length) { + case 1: + return data.substr(idx); + case 2: + return data.substr(idx, length); + case 3: + putstr(segment !== null ? segment : '', idx, length); + break; + default: return data; + } + }, + + + length: function() { + return data ? data.length : 0; + }, + + clear: function() { + data = null; + } + }); + + + function putstr(segment, idx, length) { + length = arguments.length === 3 ? length : data.length - idx - 1; + data = data.substr(0, idx) + segment + data.substr(length + idx); + } + } + + + return BinaryReader; +}); + +// Included from: src/javascript/runtime/html5/image/JPEGHeaders.js + +/** + * JPEGHeaders.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/JPEGHeaders +@private +*/ +define("moxie/runtime/html5/image/JPEGHeaders", [ + "moxie/runtime/html5/utils/BinaryReader", + "moxie/core/Exceptions" +], function(BinaryReader, x) { + + return function JPEGHeaders(data) { + var headers = [], _br, idx, marker, length = 0; + + _br = new BinaryReader(data); + + // Check if data is jpeg + if (_br.SHORT(0) !== 0xFFD8) { + _br.clear(); + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + idx = 2; + + while (idx <= _br.length()) { + marker = _br.SHORT(idx); + + // omit RST (restart) markers + if (marker >= 0xFFD0 && marker <= 0xFFD7) { + idx += 2; + continue; + } + + // no headers allowed after SOS marker + if (marker === 0xFFDA || marker === 0xFFD9) { + break; + } + + length = _br.SHORT(idx + 2) + 2; + + // APPn marker detected + if (marker >= 0xFFE1 && marker <= 0xFFEF) { + headers.push({ + hex: marker, + name: 'APP' + (marker & 0x000F), + start: idx, + length: length, + segment: _br.SEGMENT(idx, length) + }); + } + + idx += length; + } + + _br.clear(); + + return { + headers: headers, + + restore: function(data) { + var max, i, br; + + br = new BinaryReader(data); + + idx = br.SHORT(2) == 0xFFE0 ? 4 + br.SHORT(4) : 2; + + for (i = 0, max = headers.length; i < max; i++) { + br.SEGMENT(idx, 0, headers[i].segment); + idx += headers[i].length; + } + + data = br.SEGMENT(); + br.clear(); + return data; + }, + + strip: function(data) { + var br, headers, jpegHeaders, i; + + jpegHeaders = new JPEGHeaders(data); + headers = jpegHeaders.headers; + jpegHeaders.purge(); + + br = new BinaryReader(data); + + i = headers.length; + while (i--) { + br.SEGMENT(headers[i].start, headers[i].length, ''); + } + + data = br.SEGMENT(); + br.clear(); + return data; + }, + + get: function(name) { + var array = []; + + for (var i = 0, max = headers.length; i < max; i++) { + if (headers[i].name === name.toUpperCase()) { + array.push(headers[i].segment); + } + } + return array; + }, + + set: function(name, segment) { + var array = [], i, ii, max; + + if (typeof(segment) === 'string') { + array.push(segment); + } else { + array = segment; + } + + for (i = ii = 0, max = headers.length; i < max; i++) { + if (headers[i].name === name.toUpperCase()) { + headers[i].segment = array[ii]; + headers[i].length = array[ii].length; + ii++; + } + if (ii >= array.length) { + break; + } + } + }, + + purge: function() { + this.headers = headers = []; + } + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/ExifParser.js + +/** + * ExifParser.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/ExifParser +@private +*/ +define("moxie/runtime/html5/image/ExifParser", [ + "moxie/core/utils/Basic", + "moxie/runtime/html5/utils/BinaryReader", + "moxie/core/Exceptions" +], function(Basic, BinaryReader, x) { + + function ExifParser(data) { + var __super__, tags, tagDescs, offsets, idx, Tiff; + + BinaryReader.call(this, data); + + tags = { + tiff: { + /* + The image orientation viewed in terms of rows and columns. + + 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. + 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. + 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. + 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. + 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. + 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. + 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. + 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. + */ + 0x0112: 'Orientation', + 0x010E: 'ImageDescription', + 0x010F: 'Make', + 0x0110: 'Model', + 0x0131: 'Software', + 0x8769: 'ExifIFDPointer', + 0x8825: 'GPSInfoIFDPointer' + }, + exif: { + 0x9000: 'ExifVersion', + 0xA001: 'ColorSpace', + 0xA002: 'PixelXDimension', + 0xA003: 'PixelYDimension', + 0x9003: 'DateTimeOriginal', + 0x829A: 'ExposureTime', + 0x829D: 'FNumber', + 0x8827: 'ISOSpeedRatings', + 0x9201: 'ShutterSpeedValue', + 0x9202: 'ApertureValue' , + 0x9207: 'MeteringMode', + 0x9208: 'LightSource', + 0x9209: 'Flash', + 0x920A: 'FocalLength', + 0xA402: 'ExposureMode', + 0xA403: 'WhiteBalance', + 0xA406: 'SceneCaptureType', + 0xA404: 'DigitalZoomRatio', + 0xA408: 'Contrast', + 0xA409: 'Saturation', + 0xA40A: 'Sharpness' + }, + gps: { + 0x0000: 'GPSVersionID', + 0x0001: 'GPSLatitudeRef', + 0x0002: 'GPSLatitude', + 0x0003: 'GPSLongitudeRef', + 0x0004: 'GPSLongitude' + }, + + thumb: { + 0x0201: 'JPEGInterchangeFormat', + 0x0202: 'JPEGInterchangeFormatLength' + } + }; + + tagDescs = { + 'ColorSpace': { + 1: 'sRGB', + 0: 'Uncalibrated' + }, + + 'MeteringMode': { + 0: 'Unknown', + 1: 'Average', + 2: 'CenterWeightedAverage', + 3: 'Spot', + 4: 'MultiSpot', + 5: 'Pattern', + 6: 'Partial', + 255: 'Other' + }, + + 'LightSource': { + 1: 'Daylight', + 2: 'Fliorescent', + 3: 'Tungsten', + 4: 'Flash', + 9: 'Fine weather', + 10: 'Cloudy weather', + 11: 'Shade', + 12: 'Daylight fluorescent (D 5700 - 7100K)', + 13: 'Day white fluorescent (N 4600 -5400K)', + 14: 'Cool white fluorescent (W 3900 - 4500K)', + 15: 'White fluorescent (WW 3200 - 3700K)', + 17: 'Standard light A', + 18: 'Standard light B', + 19: 'Standard light C', + 20: 'D55', + 21: 'D65', + 22: 'D75', + 23: 'D50', + 24: 'ISO studio tungsten', + 255: 'Other' + }, + + 'Flash': { + 0x0000: 'Flash did not fire', + 0x0001: 'Flash fired', + 0x0005: 'Strobe return light not detected', + 0x0007: 'Strobe return light detected', + 0x0009: 'Flash fired, compulsory flash mode', + 0x000D: 'Flash fired, compulsory flash mode, return light not detected', + 0x000F: 'Flash fired, compulsory flash mode, return light detected', + 0x0010: 'Flash did not fire, compulsory flash mode', + 0x0018: 'Flash did not fire, auto mode', + 0x0019: 'Flash fired, auto mode', + 0x001D: 'Flash fired, auto mode, return light not detected', + 0x001F: 'Flash fired, auto mode, return light detected', + 0x0020: 'No flash function', + 0x0041: 'Flash fired, red-eye reduction mode', + 0x0045: 'Flash fired, red-eye reduction mode, return light not detected', + 0x0047: 'Flash fired, red-eye reduction mode, return light detected', + 0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode', + 0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected', + 0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected', + 0x0059: 'Flash fired, auto mode, red-eye reduction mode', + 0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode', + 0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode' + }, + + 'ExposureMode': { + 0: 'Auto exposure', + 1: 'Manual exposure', + 2: 'Auto bracket' + }, + + 'WhiteBalance': { + 0: 'Auto white balance', + 1: 'Manual white balance' + }, + + 'SceneCaptureType': { + 0: 'Standard', + 1: 'Landscape', + 2: 'Portrait', + 3: 'Night scene' + }, + + 'Contrast': { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard' + }, + + 'Saturation': { + 0: 'Normal', + 1: 'Low saturation', + 2: 'High saturation' + }, + + 'Sharpness': { + 0: 'Normal', + 1: 'Soft', + 2: 'Hard' + }, + + // GPS related + 'GPSLatitudeRef': { + N: 'North latitude', + S: 'South latitude' + }, + + 'GPSLongitudeRef': { + E: 'East longitude', + W: 'West longitude' + } + }; + + offsets = { + tiffHeader: 10 + }; + + idx = offsets.tiffHeader; + + __super__ = { + clear: this.clear + }; + + // Public functions + Basic.extend(this, { + + read: function() { + try { + return ExifParser.prototype.read.apply(this, arguments); + } catch (ex) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + }, + + + write: function() { + try { + return ExifParser.prototype.write.apply(this, arguments); + } catch (ex) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + }, + + + UNDEFINED: function() { + return this.BYTE.apply(this, arguments); + }, + + + RATIONAL: function(idx) { + return this.LONG(idx) / this.LONG(idx + 4) + }, + + + SRATIONAL: function(idx) { + return this.SLONG(idx) / this.SLONG(idx + 4) + }, + + ASCII: function(idx) { + return this.CHAR(idx); + }, + + TIFF: function() { + return Tiff || null; + }, + + + EXIF: function() { + var Exif = null; + + if (offsets.exifIFD) { + try { + Exif = extractTags.call(this, offsets.exifIFD, tags.exif); + } catch(ex) { + return null; + } + + // Fix formatting of some tags + if (Exif.ExifVersion && Basic.typeOf(Exif.ExifVersion) === 'array') { + for (var i = 0, exifVersion = ''; i < Exif.ExifVersion.length; i++) { + exifVersion += String.fromCharCode(Exif.ExifVersion[i]); + } + Exif.ExifVersion = exifVersion; + } + } + + return Exif; + }, + + + GPS: function() { + var GPS = null; + + if (offsets.gpsIFD) { + try { + GPS = extractTags.call(this, offsets.gpsIFD, tags.gps); + } catch (ex) { + return null; + } + + // iOS devices (and probably some others) do not put in GPSVersionID tag (why?..) + if (GPS.GPSVersionID && Basic.typeOf(GPS.GPSVersionID) === 'array') { + GPS.GPSVersionID = GPS.GPSVersionID.join('.'); + } + } + + return GPS; + }, + + + thumb: function() { + if (offsets.IFD1) { + try { + var IFD1Tags = extractTags.call(this, offsets.IFD1, tags.thumb); + + if ('JPEGInterchangeFormat' in IFD1Tags) { + return this.SEGMENT(offsets.tiffHeader + IFD1Tags.JPEGInterchangeFormat, IFD1Tags.JPEGInterchangeFormatLength); + } + } catch (ex) {} + } + return null; + }, + + + setExif: function(tag, value) { + // Right now only setting of width/height is possible + if (tag !== 'PixelXDimension' && tag !== 'PixelYDimension') { return false; } + + return setTag.call(this, 'exif', tag, value); + }, + + + clear: function() { + __super__.clear(); + data = tags = tagDescs = Tiff = offsets = __super__ = null; + } + }); + + + // Check if that's APP1 and that it has EXIF + if (this.SHORT(0) !== 0xFFE1 || this.STRING(4, 5).toUpperCase() !== "EXIF\0") { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + // Set read order of multi-byte data + this.littleEndian = (this.SHORT(idx) == 0x4949); + + // Check if always present bytes are indeed present + if (this.SHORT(idx+=2) !== 0x002A) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + offsets.IFD0 = offsets.tiffHeader + this.LONG(idx += 2); + Tiff = extractTags.call(this, offsets.IFD0, tags.tiff); + + if ('ExifIFDPointer' in Tiff) { + offsets.exifIFD = offsets.tiffHeader + Tiff.ExifIFDPointer; + delete Tiff.ExifIFDPointer; + } + + if ('GPSInfoIFDPointer' in Tiff) { + offsets.gpsIFD = offsets.tiffHeader + Tiff.GPSInfoIFDPointer; + delete Tiff.GPSInfoIFDPointer; + } + + if (Basic.isEmptyObj(Tiff)) { + Tiff = null; + } + + // check if we have a thumb as well + var IFD1Offset = this.LONG(offsets.IFD0 + this.SHORT(offsets.IFD0) * 12 + 2); + if (IFD1Offset) { + offsets.IFD1 = offsets.tiffHeader + IFD1Offset; + } + + + function extractTags(IFD_offset, tags2extract) { + var data = this; + var length, i, tag, type, count, size, offset, value, values = [], hash = {}; + + var types = { + 1 : 'BYTE', + 7 : 'UNDEFINED', + 2 : 'ASCII', + 3 : 'SHORT', + 4 : 'LONG', + 5 : 'RATIONAL', + 9 : 'SLONG', + 10: 'SRATIONAL' + }; + + var sizes = { + 'BYTE' : 1, + 'UNDEFINED' : 1, + 'ASCII' : 1, + 'SHORT' : 2, + 'LONG' : 4, + 'RATIONAL' : 8, + 'SLONG' : 4, + 'SRATIONAL' : 8 + }; + + length = data.SHORT(IFD_offset); + + // The size of APP1 including all these elements shall not exceed the 64 Kbytes specified in the JPEG standard. + + for (i = 0; i < length; i++) { + values = []; + + // Set binary reader pointer to beginning of the next tag + offset = IFD_offset + 2 + i*12; + + tag = tags2extract[data.SHORT(offset)]; + + if (tag === undefined) { + continue; // Not the tag we requested + } + + type = types[data.SHORT(offset+=2)]; + count = data.LONG(offset+=2); + size = sizes[type]; + + if (!size) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + offset += 4; + + // tag can only fit 4 bytes of data, if data is larger we should look outside + if (size * count > 4) { + // instead of data tag contains an offset of the data + offset = data.LONG(offset) + offsets.tiffHeader; + } + + // in case we left the boundaries of data throw an early exception + if (offset + size * count >= this.length()) { + throw new x.ImageError(x.ImageError.INVALID_META_ERR); + } + + // special care for the string + if (type === 'ASCII') { + hash[tag] = Basic.trim(data.STRING(offset, count).replace(/\0$/, '')); // strip trailing NULL + continue; + } else { + values = data.asArray(type, offset, count); + value = (count == 1 ? values[0] : values); + + if (tagDescs.hasOwnProperty(tag) && typeof value != 'object') { + hash[tag] = tagDescs[tag][value]; + } else { + hash[tag] = value; + } + } + } + + return hash; + } + + // At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported + function setTag(ifd, tag, value) { + var offset, length, tagOffset, valueOffset = 0; + + // If tag name passed translate into hex key + if (typeof(tag) === 'string') { + var tmpTags = tags[ifd.toLowerCase()]; + for (var hex in tmpTags) { + if (tmpTags[hex] === tag) { + tag = hex; + break; + } + } + } + offset = offsets[ifd.toLowerCase() + 'IFD']; + length = this.SHORT(offset); + + for (var i = 0; i < length; i++) { + tagOffset = offset + 12 * i + 2; + + if (this.SHORT(tagOffset) == tag) { + valueOffset = tagOffset + 8; + break; + } + } + + if (!valueOffset) { + return false; + } + + try { + this.write(valueOffset, value, 4); + } catch(ex) { + return false; + } + + return true; + } + } + + ExifParser.prototype = BinaryReader.prototype; + + return ExifParser; +}); + +// Included from: src/javascript/runtime/html5/image/JPEG.js + +/** + * JPEG.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/JPEG +@private +*/ +define("moxie/runtime/html5/image/JPEG", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/html5/image/JPEGHeaders", + "moxie/runtime/html5/utils/BinaryReader", + "moxie/runtime/html5/image/ExifParser" +], function(Basic, x, JPEGHeaders, BinaryReader, ExifParser) { + + function JPEG(data) { + var _br, _hm, _ep, _info; + + _br = new BinaryReader(data); + + // check if it is jpeg + if (_br.SHORT(0) !== 0xFFD8) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + + // backup headers + _hm = new JPEGHeaders(data); + + // extract exif info + try { + _ep = new ExifParser(_hm.get('app1')[0]); + } catch(ex) {} + + // get dimensions + _info = _getDimensions.call(this); + + Basic.extend(this, { + type: 'image/jpeg', + + size: _br.length(), + + width: _info && _info.width || 0, + + height: _info && _info.height || 0, + + setExif: function(tag, value) { + if (!_ep) { + return false; // or throw an exception + } + + if (Basic.typeOf(tag) === 'object') { + Basic.each(tag, function(value, tag) { + _ep.setExif(tag, value); + }); + } else { + _ep.setExif(tag, value); + } + + // update internal headers + _hm.set('app1', _ep.SEGMENT()); + }, + + writeHeaders: function() { + if (!arguments.length) { + // if no arguments passed, update headers internally + return _hm.restore(data); + } + return _hm.restore(arguments[0]); + }, + + stripHeaders: function(data) { + return _hm.strip(data); + }, + + purge: function() { + _purge.call(this); + } + }); + + if (_ep) { + this.meta = { + tiff: _ep.TIFF(), + exif: _ep.EXIF(), + gps: _ep.GPS(), + thumb: _getThumb() + }; + } + + + function _getDimensions(br) { + var idx = 0 + , marker + , length + ; + + if (!br) { + br = _br; + } + + // examine all through the end, since some images might have very large APP segments + while (idx <= br.length()) { + marker = br.SHORT(idx += 2); + + if (marker >= 0xFFC0 && marker <= 0xFFC3) { // SOFn + idx += 5; // marker (2 bytes) + length (2 bytes) + Sample precision (1 byte) + return { + height: br.SHORT(idx), + width: br.SHORT(idx += 2) + }; + } + length = br.SHORT(idx += 2); + idx += length - 2; + } + return null; + } + + + function _getThumb() { + var data = _ep.thumb() + , br + , info + ; + + if (data) { + br = new BinaryReader(data); + info = _getDimensions(br); + br.clear(); + + if (info) { + info.data = data; + return info; + } + } + return null; + } + + + function _purge() { + if (!_ep || !_hm || !_br) { + return; // ignore any repeating purge requests + } + _ep.clear(); + _hm.purge(); + _br.clear(); + _info = _hm = _ep = _br = null; + } + } + + return JPEG; +}); + +// Included from: src/javascript/runtime/html5/image/PNG.js + +/** + * PNG.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/PNG +@private +*/ +define("moxie/runtime/html5/image/PNG", [ + "moxie/core/Exceptions", + "moxie/core/utils/Basic", + "moxie/runtime/html5/utils/BinaryReader" +], function(x, Basic, BinaryReader) { + + function PNG(data) { + var _br, _hm, _ep, _info; + + _br = new BinaryReader(data); + + // check if it's png + (function() { + var idx = 0, i = 0 + , signature = [0x8950, 0x4E47, 0x0D0A, 0x1A0A] + ; + + for (i = 0; i < signature.length; i++, idx += 2) { + if (signature[i] != _br.SHORT(idx)) { + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + } + } + }()); + + function _getDimensions() { + var chunk, idx; + + chunk = _getChunkAt.call(this, 8); + + if (chunk.type == 'IHDR') { + idx = chunk.start; + return { + width: _br.LONG(idx), + height: _br.LONG(idx += 4) + }; + } + return null; + } + + function _purge() { + if (!_br) { + return; // ignore any repeating purge requests + } + _br.clear(); + data = _info = _hm = _ep = _br = null; + } + + _info = _getDimensions.call(this); + + Basic.extend(this, { + type: 'image/png', + + size: _br.length(), + + width: _info.width, + + height: _info.height, + + purge: function() { + _purge.call(this); + } + }); + + // for PNG we can safely trigger purge automatically, as we do not keep any data for later + _purge.call(this); + + function _getChunkAt(idx) { + var length, type, start, CRC; + + length = _br.LONG(idx); + type = _br.STRING(idx += 4, 4); + start = idx += 4; + CRC = _br.LONG(idx + length); + + return { + length: length, + type: type, + start: start, + CRC: CRC + }; + } + } + + return PNG; +}); + +// Included from: src/javascript/runtime/html5/image/ImageInfo.js + +/** + * ImageInfo.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/ImageInfo +@private +*/ +define("moxie/runtime/html5/image/ImageInfo", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/html5/image/JPEG", + "moxie/runtime/html5/image/PNG" +], function(Basic, x, JPEG, PNG) { + /** + Optional image investigation tool for HTML5 runtime. Provides the following features: + - ability to distinguish image type (JPEG or PNG) by signature + - ability to extract image width/height directly from it's internals, without preloading in memory (fast) + - ability to extract APP headers from JPEGs (Exif, GPS, etc) + - ability to replace width/height tags in extracted JPEG headers + - ability to restore APP headers, that were for example stripped during image manipulation + + @class ImageInfo + @constructor + @param {String} data Image source as binary string + */ + return function(data) { + var _cs = [JPEG, PNG], _img; + + // figure out the format, throw: ImageError.WRONG_FORMAT if not supported + _img = (function() { + for (var i = 0; i < _cs.length; i++) { + try { + return new _cs[i](data); + } catch (ex) { + // console.info(ex); + } + } + throw new x.ImageError(x.ImageError.WRONG_FORMAT); + }()); + + Basic.extend(this, { + /** + Image Mime Type extracted from it's depths + + @property type + @type {String} + @default '' + */ + type: '', + + /** + Image size in bytes + + @property size + @type {Number} + @default 0 + */ + size: 0, + + /** + Image width extracted from image source + + @property width + @type {Number} + @default 0 + */ + width: 0, + + /** + Image height extracted from image source + + @property height + @type {Number} + @default 0 + */ + height: 0, + + /** + Sets Exif tag. Currently applicable only for width and height tags. Obviously works only with JPEGs. + + @method setExif + @param {String} tag Tag to set + @param {Mixed} value Value to assign to the tag + */ + setExif: function() {}, + + /** + Restores headers to the source. + + @method writeHeaders + @param {String} data Image source as binary string + @return {String} Updated binary string + */ + writeHeaders: function(data) { + return data; + }, + + /** + Strip all headers from the source. + + @method stripHeaders + @param {String} data Image source as binary string + @return {String} Updated binary string + */ + stripHeaders: function(data) { + return data; + }, + + /** + Dispose resources. + + @method purge + */ + purge: function() { + data = null; + } + }); + + Basic.extend(this, _img); + + this.purge = function() { + _img.purge(); + _img = null; + }; + }; +}); + +// Included from: src/javascript/runtime/html5/image/MegaPixel.js + +/** +(The MIT License) + +Copyright (c) 2012 Shinichi Tomita ; + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * Mega pixel image rendering library for iOS6 Safari + * + * Fixes iOS6 Safari's image file rendering issue for large size image (over mega-pixel), + * which causes unexpected subsampling when drawing it in canvas. + * By using this library, you can safely render the image with proper stretching. + * + * Copyright (c) 2012 Shinichi Tomita + * Released under the MIT license + */ + +/** +@class moxie/runtime/html5/image/MegaPixel +@private +*/ +define("moxie/runtime/html5/image/MegaPixel", [], function() { + + /** + * Rendering image element (with resizing) into the canvas element + */ + function renderImageToCanvas(img, canvas, options) { + var iw = img.naturalWidth, ih = img.naturalHeight; + var width = options.width, height = options.height; + var x = options.x || 0, y = options.y || 0; + var ctx = canvas.getContext('2d'); + if (detectSubsampling(img)) { + iw /= 2; + ih /= 2; + } + var d = 1024; // size of tiling canvas + var tmpCanvas = document.createElement('canvas'); + tmpCanvas.width = tmpCanvas.height = d; + var tmpCtx = tmpCanvas.getContext('2d'); + var vertSquashRatio = detectVerticalSquash(img, iw, ih); + var sy = 0; + while (sy < ih) { + var sh = sy + d > ih ? ih - sy : d; + var sx = 0; + while (sx < iw) { + var sw = sx + d > iw ? iw - sx : d; + tmpCtx.clearRect(0, 0, d, d); + tmpCtx.drawImage(img, -sx, -sy); + var dx = (sx * width / iw + x) << 0; + var dw = Math.ceil(sw * width / iw); + var dy = (sy * height / ih / vertSquashRatio + y) << 0; + var dh = Math.ceil(sh * height / ih / vertSquashRatio); + ctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh); + sx += d; + } + sy += d; + } + tmpCanvas = tmpCtx = null; + } + + /** + * Detect subsampling in loaded image. + * In iOS, larger images than 2M pixels may be subsampled in rendering. + */ + function detectSubsampling(img) { + var iw = img.naturalWidth, ih = img.naturalHeight; + if (iw * ih > 1024 * 1024) { // subsampling may happen over megapixel image + var canvas = document.createElement('canvas'); + canvas.width = canvas.height = 1; + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, -iw + 1, 0); + // subsampled image becomes half smaller in rendering size. + // check alpha channel value to confirm image is covering edge pixel or not. + // if alpha value is 0 image is not covering, hence subsampled. + return ctx.getImageData(0, 0, 1, 1).data[3] === 0; + } else { + return false; + } + } + + + /** + * Detecting vertical squash in loaded image. + * Fixes a bug which squash image vertically while drawing into canvas for some images. + */ + function detectVerticalSquash(img, iw, ih) { + var canvas = document.createElement('canvas'); + canvas.width = 1; + canvas.height = ih; + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0); + var data = ctx.getImageData(0, 0, 1, ih).data; + // search image edge pixel position in case it is squashed vertically. + var sy = 0; + var ey = ih; + var py = ih; + while (py > sy) { + var alpha = data[(py - 1) * 4 + 3]; + if (alpha === 0) { + ey = py; + } else { + sy = py; + } + py = (ey + sy) >> 1; + } + canvas = null; + var ratio = (py / ih); + return (ratio === 0) ? 1 : ratio; + } + + return { + isSubsampled: detectSubsampling, + renderTo: renderImageToCanvas + }; +}); + +// Included from: src/javascript/runtime/html5/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html5/image/Image +@private +*/ +define("moxie/runtime/html5/image/Image", [ + "moxie/runtime/html5/Runtime", + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/core/utils/Encode", + "moxie/file/Blob", + "moxie/file/File", + "moxie/runtime/html5/image/ImageInfo", + "moxie/runtime/html5/image/MegaPixel", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, Basic, x, Encode, Blob, File, ImageInfo, MegaPixel, Mime, Env) { + + function HTML5Image() { + var me = this + , _img, _imgInfo, _canvas, _binStr, _blob + , _modified = false // is set true whenever image is modified + , _preserveHeaders = true + ; + + Basic.extend(this, { + loadFromBlob: function(blob) { + var comp = this, I = comp.getRuntime() + , asBinary = arguments.length > 1 ? arguments[1] : true + ; + + if (!I.can('access_binary')) { + throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); + } + + _blob = blob; + + if (blob.isDetached()) { + _binStr = blob.getSource(); + _preload.call(this, _binStr); + return; + } else { + _readAsDataUrl.call(this, blob.getSource(), function(dataUrl) { + if (asBinary) { + _binStr = _toBinary(dataUrl); + } + _preload.call(comp, dataUrl); + }); + } + }, + + loadFromImage: function(img, exact) { + this.meta = img.meta; + + _blob = new File(null, { + name: img.name, + size: img.size, + type: img.type + }); + + _preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL()); + }, + + getInfo: function() { + var I = this.getRuntime(), info; + + if (!_imgInfo && _binStr && I.can('access_image_binary')) { + _imgInfo = new ImageInfo(_binStr); + } + + info = { + width: _getImg().width || 0, + height: _getImg().height || 0, + type: _blob.type || Mime.getFileMime(_blob.name), + size: _binStr && _binStr.length || _blob.size || 0, + name: _blob.name || '', + meta: _imgInfo && _imgInfo.meta || this.meta || {} + }; + + // store thumbnail data as blob + if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) { + info.meta.thumb.data = new Blob(null, { + type: 'image/jpeg', + data: info.meta.thumb.data + }); + } + + return info; + }, + + downsize: function() { + _downsize.apply(this, arguments); + }, + + getAsCanvas: function() { + if (_canvas) { + _canvas.id = this.uid + '_canvas'; + } + return _canvas; + }, + + getAsBlob: function(type, quality) { + if (type !== this.type) { + // if different mime type requested prepare image for conversion + _downsize.call(this, this.width, this.height, false); + } + return new File(null, { + name: _blob.name || '', + type: type, + data: me.getAsBinaryString.call(this, type, quality) + }); + }, + + getAsDataURL: function(type) { + var quality = arguments[1] || 90; + + // if image has not been modified, return the source right away + if (!_modified) { + return _img.src; + } + + if ('image/jpeg' !== type) { + return _canvas.toDataURL('image/png'); + } else { + try { + // older Geckos used to result in an exception on quality argument + return _canvas.toDataURL('image/jpeg', quality/100); + } catch (ex) { + return _canvas.toDataURL('image/jpeg'); + } + } + }, + + getAsBinaryString: function(type, quality) { + // if image has not been modified, return the source right away + if (!_modified) { + // if image was not loaded from binary string + if (!_binStr) { + _binStr = _toBinary(me.getAsDataURL(type, quality)); + } + return _binStr; + } + + if ('image/jpeg' !== type) { + _binStr = _toBinary(me.getAsDataURL(type, quality)); + } else { + var dataUrl; + + // if jpeg + if (!quality) { + quality = 90; + } + + try { + // older Geckos used to result in an exception on quality argument + dataUrl = _canvas.toDataURL('image/jpeg', quality/100); + } catch (ex) { + dataUrl = _canvas.toDataURL('image/jpeg'); + } + + _binStr = _toBinary(dataUrl); + + if (_imgInfo) { + _binStr = _imgInfo.stripHeaders(_binStr); + + if (_preserveHeaders) { + // update dimensions info in exif + if (_imgInfo.meta && _imgInfo.meta.exif) { + _imgInfo.setExif({ + PixelXDimension: this.width, + PixelYDimension: this.height + }); + } + + // re-inject the headers + _binStr = _imgInfo.writeHeaders(_binStr); + } + + // will be re-created from fresh on next getInfo call + _imgInfo.purge(); + _imgInfo = null; + } + } + + _modified = false; + + return _binStr; + }, + + destroy: function() { + me = null; + _purge.call(this); + this.getRuntime().getShim().removeInstance(this.uid); + } + }); + + + function _getImg() { + if (!_canvas && !_img) { + throw new x.ImageError(x.DOMException.INVALID_STATE_ERR); + } + return _canvas || _img; + } + + + function _toBinary(str) { + return Encode.atob(str.substring(str.indexOf('base64,') + 7)); + } + + + function _toDataUrl(str, type) { + return 'data:' + (type || '') + ';base64,' + Encode.btoa(str); + } + + + function _preload(str) { + var comp = this; + + _img = new Image(); + _img.onerror = function() { + _purge.call(this); + comp.trigger('error', x.ImageError.WRONG_FORMAT); + }; + _img.onload = function() { + comp.trigger('load'); + }; + + _img.src = str.substr(0, 5) == 'data:' ? str : _toDataUrl(str, _blob.type); + } + + + function _readAsDataUrl(file, callback) { + var comp = this, fr; + + // use FileReader if it's available + if (window.FileReader) { + fr = new FileReader(); + fr.onload = function() { + callback(this.result); + }; + fr.onerror = function() { + comp.trigger('error', x.ImageError.WRONG_FORMAT); + }; + fr.readAsDataURL(file); + } else { + return callback(file.getAsDataURL()); + } + } + + function _downsize(width, height, crop, preserveHeaders) { + var self = this + , scale + , mathFn + , x = 0 + , y = 0 + , img + , destWidth + , destHeight + , orientation + ; + + _preserveHeaders = preserveHeaders; // we will need to check this on export (see getAsBinaryString()) + + // take into account orientation tag + orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1; + + if (Basic.inArray(orientation, [5,6,7,8]) !== -1) { // values that require 90 degree rotation + // swap dimensions + var tmp = width; + width = height; + height = tmp; + } + + img = _getImg(); + + // unify dimensions + if (!crop) { + scale = Math.min(width/img.width, height/img.height); + } else { + // one of the dimensions may exceed the actual image dimensions - we need to take the smallest value + width = Math.min(width, img.width); + height = Math.min(height, img.height); + + scale = Math.max(width/img.width, height/img.height); + } + + // we only downsize here + if (scale > 1 && !crop && preserveHeaders) { + this.trigger('Resize'); + return; + } + + // prepare canvas if necessary + if (!_canvas) { + _canvas = document.createElement("canvas"); + } + + // calculate dimensions of proportionally resized image + destWidth = Math.round(img.width * scale); + destHeight = Math.round(img.height * scale); + + // scale image and canvas + if (crop) { + _canvas.width = width; + _canvas.height = height; + + // if dimensions of the resulting image still larger than canvas, center it + if (destWidth > width) { + x = Math.round((destWidth - width) / 2); + } + + if (destHeight > height) { + y = Math.round((destHeight - height) / 2); + } + } else { + _canvas.width = destWidth; + _canvas.height = destHeight; + } + + // rotate if required, according to orientation tag + if (!_preserveHeaders) { + _rotateToOrientaion(_canvas.width, _canvas.height, orientation); + } + + _drawToCanvas.call(this, img, _canvas, -x, -y, destWidth, destHeight); + + this.width = _canvas.width; + this.height = _canvas.height; + + _modified = true; + self.trigger('Resize'); + } + + + function _drawToCanvas(img, canvas, x, y, w, h) { + if (Env.OS === 'iOS') { + // avoid squish bug in iOS6 + MegaPixel.renderTo(img, canvas, { width: w, height: h, x: x, y: y }); + } else { + var ctx = canvas.getContext('2d'); + ctx.drawImage(img, x, y, w, h); + } + } + + + /** + * Transform canvas coordination according to specified frame size and orientation + * Orientation value is from EXIF tag + * @author Shinichi Tomita + */ + function _rotateToOrientaion(width, height, orientation) { + switch (orientation) { + case 5: + case 6: + case 7: + case 8: + _canvas.width = height; + _canvas.height = width; + break; + default: + _canvas.width = width; + _canvas.height = height; + } + + /** + 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. + 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. + 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. + 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. + 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. + 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. + 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. + 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. + */ + + var ctx = _canvas.getContext('2d'); + switch (orientation) { + case 2: + // horizontal flip + ctx.translate(width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180 rotate left + ctx.translate(width, height); + ctx.rotate(Math.PI); + break; + case 4: + // vertical flip + ctx.translate(0, height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + case 6: + // 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -height); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(width, -height); + ctx.scale(-1, 1); + break; + case 8: + // 90 rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-width, 0); + break; + } + } + + + function _purge() { + if (_imgInfo) { + _imgInfo.purge(); + _imgInfo = null; + } + _binStr = _img = _canvas = _blob = null; + _modified = false; + } + } + + return (extensions.Image = HTML5Image); +}); + +// Included from: src/javascript/runtime/flash/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +Defines constructor for Flash runtime. + +@class moxie/runtime/flash/Runtime +@private +*/ +define("moxie/runtime/flash/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Env", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/runtime/Runtime" +], function(Basic, Env, Dom, x, Runtime) { + + var type = 'flash', extensions = {}; + + /** + Get the version of the Flash Player + + @method getShimVersion + @private + @return {Number} Flash Player version + */ + function getShimVersion() { + var version; + + try { + version = navigator.plugins['Shockwave Flash']; + version = version.description; + } catch (e1) { + try { + version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); + } catch (e2) { + version = '0.0'; + } + } + version = version.match(/\d+/g); + return parseFloat(version[0] + '.' + version[1]); + } + + + /** + Cross-browser SWF removal + - Especially needed to safely and completely remove a SWF in Internet Explorer + + Originated from SWFObject v2.2 + */ + function removeSWF(id) { + var obj = Dom.get(id); + if (obj && obj.nodeName == "OBJECT") { + if (Env.browser === 'IE') { + obj.style.display = "none"; + (function onInit(){ + // http://msdn.microsoft.com/en-us/library/ie/ms534360(v=vs.85).aspx + if (obj.readyState == 4) { + removeObjectInIE(id); + } + else { + setTimeout(onInit, 10); + } + })(); + } + else { + obj.parentNode.removeChild(obj); + } + } + } + + + function removeObjectInIE(id) { + var obj = Dom.get(id); + if (obj) { + for (var i in obj) { + if (typeof obj[i] == "function") { + obj[i] = null; + } + } + obj.parentNode.removeChild(obj); + } + } + + /** + Constructor for the Flash Runtime + + @class FlashRuntime + @extends Runtime + */ + function FlashRuntime(options) { + var I = this, initTimer; + + options = Basic.extend({ swf_url: Env.swf_url }, options); + + Runtime.call(this, options, type, { + access_binary: function(value) { + return value && I.mode === 'browser'; + }, + access_image_binary: function(value) { + return value && I.mode === 'browser'; + }, + display_media: Runtime.capTrue, + do_cors: Runtime.capTrue, + drag_and_drop: false, + report_upload_progress: function() { + return I.mode === 'client'; + }, + resize_image: Runtime.capTrue, + return_response_headers: false, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { + return true; + } + return !Basic.arrayDiff(responseType, ['', 'text', 'document']) || I.mode === 'browser'; + }, + return_status_code: function(code) { + return I.mode === 'browser' || !Basic.arrayDiff(code, [200, 404]); + }, + select_file: Runtime.capTrue, + select_multiple: Runtime.capTrue, + send_binary_string: function(value) { + return value && I.mode === 'browser'; + }, + send_browser_cookies: function(value) { + return value && I.mode === 'browser'; + }, + send_custom_headers: function(value) { + return value && I.mode === 'browser'; + }, + send_multipart: Runtime.capTrue, + slice_blob: function(value) { + return value && I.mode === 'browser'; + }, + stream_upload: function(value) { + return value && I.mode === 'browser'; + }, + summon_file_dialog: false, + upload_filesize: function(size) { + return Basic.parseSizeStr(size) <= 2097152 || I.mode === 'client'; + }, + use_http_method: function(methods) { + return !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }, { + // capabilities that require specific mode + access_binary: function(value) { + return value ? 'browser' : 'client'; + }, + access_image_binary: function(value) { + return value ? 'browser' : 'client'; + }, + report_upload_progress: function(value) { + return value ? 'browser' : 'client'; + }, + return_response_type: function(responseType) { + return Basic.arrayDiff(responseType, ['', 'text', 'json', 'document']) ? 'browser' : ['client', 'browser']; + }, + return_status_code: function(code) { + return Basic.arrayDiff(code, [200, 404]) ? 'browser' : ['client', 'browser']; + }, + send_binary_string: function(value) { + return value ? 'browser' : 'client'; + }, + send_browser_cookies: function(value) { + return value ? 'browser' : 'client'; + }, + send_custom_headers: function(value) { + return value ? 'browser' : 'client'; + }, + stream_upload: function(value) { + return value ? 'client' : 'browser'; + }, + upload_filesize: function(size) { + return Basic.parseSizeStr(size) >= 2097152 ? 'client' : 'browser'; + } + }, 'client'); + + + // minimal requirement for Flash Player version + if (getShimVersion() < 10) { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tFlash didn't meet minimal version requirement (10)."); + } + + this.mode = false; // with falsy mode, runtime won't operable, no matter what the mode was before + } + + + Basic.extend(this, { + + getShim: function() { + return Dom.get(this.uid); + }, + + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return I.getShim().exec(this.uid, component, action, args); + }, + + init: function() { + var html, el, container; + + container = this.getShimContainer(); + + // if not the minimal height, shims are not initialized in older browsers (e.g FF3.6, IE6,7,8, Safari 4.0,5.0, etc) + Basic.extend(container.style, { + position: 'absolute', + top: '-8px', + left: '-8px', + width: '9px', + height: '9px', + overflow: 'hidden' + }); + + // insert flash object + html = '' + + '' + + '' + + '' + + ''; + + if (Env.browser === 'IE') { + el = document.createElement('div'); + container.appendChild(el); + el.outerHTML = html; + el = container = null; // just in case + } else { + container.innerHTML = html; + } + + // Init is dispatched by the shim + initTimer = setTimeout(function() { + if (I && !I.initialized) { // runtime might be already destroyed by this moment + I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tFlash failed to initialize within a specified period of time (typically 5s)."); + } + } + }, 5000); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + removeSWF(I.uid); // SWF removal requires special care in IE + + destroy.call(I); + clearTimeout(initTimer); // initialization check might be still onwait + options = initTimer = destroy = I = null; + }; + }(this.destroy)) + + }, extensions); + } + + Runtime.addConstructor(type, FlashRuntime); + + return extensions; +}); + +// Included from: src/javascript/runtime/flash/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileInput +@private +*/ +define("moxie/runtime/flash/file/FileInput", [ + "moxie/runtime/flash/Runtime", + "moxie/file/File", + "moxie/core/utils/Basic" +], function(extensions, File, Basic) { + + var FileInput = { + init: function(options) { + var comp = this, I = this.getRuntime(); + + this.bind("Change", function() { + var files = I.shimExec.call(comp, 'FileInput', 'getFiles'); + comp.files = []; + Basic.each(files, function(file) { + comp.files.push(new File(I.uid, file)); + }); + }, 999); + + this.getRuntime().shimExec.call(this, 'FileInput', 'init', { + name: options.name, + accept: options.accept, + multiple: options.multiple + }); + + this.trigger('ready'); + } + }; + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/flash/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/Blob +@private +*/ +define("moxie/runtime/flash/file/Blob", [ + "moxie/runtime/flash/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + var FlashBlob = { + slice: function(blob, start, end, type) { + var self = this.getRuntime(); + + if (start < 0) { + start = Math.max(blob.size + start, 0); + } else if (start > 0) { + start = Math.min(start, blob.size); + } + + if (end < 0) { + end = Math.max(blob.size + end, 0); + } else if (end > 0) { + end = Math.min(end, blob.size); + } + + blob = self.shimExec.call(this, 'Blob', 'slice', start, end, type || ''); + + if (blob) { + blob = new Blob(self.uid, blob); + } + return blob; + } + }; + + return (extensions.Blob = FlashBlob); +}); + +// Included from: src/javascript/runtime/flash/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileReader +@private +*/ +define("moxie/runtime/flash/file/FileReader", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Encode" +], function(extensions, Encode) { + + function _formatData(data, op) { + switch (op) { + case 'readAsText': + return Encode.atob(data, 'utf8'); + case 'readAsBinaryString': + return Encode.atob(data); + case 'readAsDataURL': + return data; + } + return null; + } + + var FileReader = { + read: function(op, blob) { + var comp = this; + + comp.result = ''; + + // special prefix for DataURL read mode + if (op === 'readAsDataURL') { + comp.result = 'data:' + (blob.type || '') + ';base64,'; + } + + comp.bind('Progress', function(e, data) { + if (data) { + comp.result += _formatData(data, op); + } + }, 999); + + return comp.getRuntime().shimExec.call(this, 'FileReader', 'readAsBase64', blob.uid); + } + }; + + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/flash/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/file/FileReaderSync +@private +*/ +define("moxie/runtime/flash/file/FileReaderSync", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Encode" +], function(extensions, Encode) { + + function _formatData(data, op) { + switch (op) { + case 'readAsText': + return Encode.atob(data, 'utf8'); + case 'readAsBinaryString': + return Encode.atob(data); + case 'readAsDataURL': + return data; + } + return null; + } + + var FileReaderSync = { + read: function(op, blob) { + var result, self = this.getRuntime(); + + result = self.shimExec.call(this, 'FileReaderSync', 'readAsBase64', blob.uid); + if (!result) { + return null; // or throw ex + } + + // special prefix for DataURL read mode + if (op === 'readAsDataURL') { + result = 'data:' + (blob.type || '') + ';base64,' + result; + } + + return _formatData(result, op, blob.type); + } + }; + + return (extensions.FileReaderSync = FileReaderSync); +}); + +// Included from: src/javascript/runtime/flash/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/flash/xhr/XMLHttpRequest", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Basic", + "moxie/file/Blob", + "moxie/file/File", + "moxie/file/FileReaderSync", + "moxie/xhr/FormData", + "moxie/runtime/Transporter" +], function(extensions, Basic, Blob, File, FileReaderSync, FormData, Transporter) { + + var XMLHttpRequest = { + + send: function(meta, data) { + var target = this, self = target.getRuntime(); + + function send() { + meta.transport = self.mode; + self.shimExec.call(target, 'XMLHttpRequest', 'send', meta, data); + } + + + function appendBlob(name, blob) { + self.shimExec.call(target, 'XMLHttpRequest', 'appendBlob', name, blob.uid); + data = null; + send(); + } + + + function attachBlob(blob, cb) { + var tr = new Transporter(); + + tr.bind("TransportingComplete", function() { + cb(this.result); + }); + + tr.transport(blob.getSource(), blob.type, { + ruid: self.uid + }); + } + + // copy over the headers if any + if (!Basic.isEmptyObj(meta.headers)) { + Basic.each(meta.headers, function(value, header) { + self.shimExec.call(target, 'XMLHttpRequest', 'setRequestHeader', header, value.toString()); // Silverlight doesn't accept integers into the arguments of type object + }); + } + + // transfer over multipart params and blob itself + if (data instanceof FormData) { + var blobField; + data.each(function(value, name) { + if (value instanceof Blob) { + blobField = name; + } else { + self.shimExec.call(target, 'XMLHttpRequest', 'append', name, value); + } + }); + + if (!data.hasBlob()) { + data = null; + send(); + } else { + var blob = data.getBlob(); + if (blob.isDetached()) { + attachBlob(blob, function(attachedBlob) { + blob.destroy(); + appendBlob(blobField, attachedBlob); + }); + } else { + appendBlob(blobField, blob); + } + } + } else if (data instanceof Blob) { + if (data.isDetached()) { + attachBlob(data, function(attachedBlob) { + data.destroy(); + data = attachedBlob.uid; + send(); + }); + } else { + data = data.uid; + send(); + } + } else { + send(); + } + }, + + getResponse: function(responseType) { + var frs, blob, self = this.getRuntime(); + + blob = self.shimExec.call(this, 'XMLHttpRequest', 'getResponseAsBlob'); + + if (blob) { + blob = new File(self.uid, blob); + + if ('blob' === responseType) { + return blob; + } + + try { + frs = new FileReaderSync(); + + if (!!~Basic.inArray(responseType, ["", "text"])) { + return frs.readAsText(blob); + } else if ('json' === responseType && !!window.JSON) { + return JSON.parse(frs.readAsText(blob)); + } + } finally { + blob.destroy(); + } + } + return null; + }, + + abort: function(upload_complete_flag) { + var self = this.getRuntime(); + + self.shimExec.call(this, 'XMLHttpRequest', 'abort'); + + this.dispatchEvent('readystatechange'); + // this.dispatchEvent('progress'); + this.dispatchEvent('abort'); + + //if (!upload_complete_flag) { + // this.dispatchEvent('uploadprogress'); + //} + } + }; + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/flash/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/runtime/Transporter +@private +*/ +define("moxie/runtime/flash/runtime/Transporter", [ + "moxie/runtime/flash/Runtime", + "moxie/file/Blob" +], function(extensions, Blob) { + + var Transporter = { + getAsBlob: function(type) { + var self = this.getRuntime() + , blob = self.shimExec.call(this, 'Transporter', 'getAsBlob', type) + ; + if (blob) { + return new Blob(self.uid, blob); + } + return null; + } + }; + + return (extensions.Transporter = Transporter); +}); + +// Included from: src/javascript/runtime/flash/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/flash/image/Image +@private +*/ +define("moxie/runtime/flash/image/Image", [ + "moxie/runtime/flash/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/Transporter", + "moxie/file/Blob", + "moxie/file/FileReaderSync" +], function(extensions, Basic, Transporter, Blob, FileReaderSync) { + + var Image = { + loadFromBlob: function(blob) { + var comp = this, self = comp.getRuntime(); + + function exec(srcBlob) { + self.shimExec.call(comp, 'Image', 'loadFromBlob', srcBlob.uid); + comp = self = null; + } + + if (blob.isDetached()) { // binary string + var tr = new Transporter(); + tr.bind("TransportingComplete", function() { + exec(tr.result.getSource()); + }); + tr.transport(blob.getSource(), blob.type, { ruid: self.uid }); + } else { + exec(blob.getSource()); + } + }, + + loadFromImage: function(img) { + var self = this.getRuntime(); + return self.shimExec.call(this, 'Image', 'loadFromImage', img.uid); + }, + + getInfo: function() { + var self = this.getRuntime() + , info = self.shimExec.call(this, 'Image', 'getInfo') + ; + + if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) { + info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data); + } + return info; + }, + + getAsBlob: function(type, quality) { + var self = this.getRuntime() + , blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality) + ; + if (blob) { + return new Blob(self.uid, blob); + } + return null; + }, + + getAsDataURL: function() { + var self = this.getRuntime() + , blob = self.Image.getAsBlob.apply(this, arguments) + , frs + ; + if (!blob) { + return null; + } + frs = new FileReaderSync(); + return frs.readAsDataURL(blob); + } + }; + + return (extensions.Image = Image); +}); + +// Included from: src/javascript/runtime/silverlight/Runtime.js + +/** + * RunTime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global ActiveXObject:true */ + +/** +Defines constructor for Silverlight runtime. + +@class moxie/runtime/silverlight/Runtime +@private +*/ +define("moxie/runtime/silverlight/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/utils/Env", + "moxie/core/utils/Dom", + "moxie/core/Exceptions", + "moxie/runtime/Runtime" +], function(Basic, Env, Dom, x, Runtime) { + + var type = "silverlight", extensions = {}; + + function isInstalled(version) { + var isVersionSupported = false, control = null, actualVer, + actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0; + + try { + try { + control = new ActiveXObject('AgControl.AgControl'); + + if (control.IsVersionSupported(version)) { + isVersionSupported = true; + } + + control = null; + } catch (e) { + var plugin = navigator.plugins["Silverlight Plug-In"]; + + if (plugin) { + actualVer = plugin.description; + + if (actualVer === "1.0.30226.2") { + actualVer = "2.0.30226.2"; + } + + actualVerArray = actualVer.split("."); + + while (actualVerArray.length > 3) { + actualVerArray.pop(); + } + + while ( actualVerArray.length < 4) { + actualVerArray.push(0); + } + + reqVerArray = version.split("."); + + while (reqVerArray.length > 4) { + reqVerArray.pop(); + } + + do { + requiredVersionPart = parseInt(reqVerArray[index], 10); + actualVersionPart = parseInt(actualVerArray[index], 10); + index++; + } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart); + + if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) { + isVersionSupported = true; + } + } + } + } catch (e2) { + isVersionSupported = false; + } + + return isVersionSupported; + } + + /** + Constructor for the Silverlight Runtime + + @class SilverlightRuntime + @extends Runtime + */ + function SilverlightRuntime(options) { + var I = this, initTimer; + + options = Basic.extend({ xap_url: Env.xap_url }, options); + + Runtime.call(this, options, type, { + access_binary: Runtime.capTrue, + access_image_binary: Runtime.capTrue, + display_media: Runtime.capTrue, + do_cors: Runtime.capTrue, + drag_and_drop: false, + report_upload_progress: Runtime.capTrue, + resize_image: Runtime.capTrue, + return_response_headers: function(value) { + return value && I.mode === 'client'; + }, + return_response_type: function(responseType) { + if (responseType !== 'json') { + return true; + } else { + return !!window.JSON; + } + }, + return_status_code: function(code) { + return I.mode === 'client' || !Basic.arrayDiff(code, [200, 404]); + }, + select_file: Runtime.capTrue, + select_multiple: Runtime.capTrue, + send_binary_string: Runtime.capTrue, + send_browser_cookies: function(value) { + return value && I.mode === 'browser'; + }, + send_custom_headers: function(value) { + return value && I.mode === 'client'; + }, + send_multipart: Runtime.capTrue, + slice_blob: Runtime.capTrue, + stream_upload: true, + summon_file_dialog: false, + upload_filesize: Runtime.capTrue, + use_http_method: function(methods) { + return I.mode === 'client' || !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }, { + // capabilities that require specific mode + return_response_headers: function(value) { + return value ? 'client' : 'browser'; + }, + return_status_code: function(code) { + return Basic.arrayDiff(code, [200, 404]) ? 'client' : ['client', 'browser']; + }, + send_browser_cookies: function(value) { + return value ? 'browser' : 'client'; + }, + send_custom_headers: function(value) { + return value ? 'client' : 'browser'; + }, + use_http_method: function(methods) { + return Basic.arrayDiff(methods, ['GET', 'POST']) ? 'client' : ['client', 'browser']; + } + }); + + + // minimal requirement + if (!isInstalled('2.0.31005.0') || Env.browser === 'Opera') { + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\tSilverlight is not installed or minimal version (2.0.31005.0) requirement not met (not likely)."); + } + + this.mode = false; + } + + + Basic.extend(this, { + getShim: function() { + return Dom.get(this.uid).content.Moxie; + }, + + shimExec: function(component, action) { + var args = [].slice.call(arguments, 2); + return I.getShim().exec(this.uid, component, action, args); + }, + + init : function() { + var container; + + container = this.getShimContainer(); + + container.innerHTML = '' + + '' + + '' + + '' + + '' + + '' + + ''; + + // Init is dispatched by the shim + initTimer = setTimeout(function() { + if (I && !I.initialized) { // runtime might be already destroyed by this moment + I.trigger("Error", new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); + + if (MXI_DEBUG && Env.debug.runtime) { + Env.log("\Silverlight failed to initialize within a specified period of time (5-10s)."); + } + } + }, Env.OS !== 'Windows'? 10000 : 5000); // give it more time to initialize in non Windows OS (like Mac) + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + clearTimeout(initTimer); // initialization check might be still onwait + options = initTimer = destroy = I = null; + }; + }(this.destroy)) + + }, extensions); + } + + Runtime.addConstructor(type, SilverlightRuntime); + + return extensions; +}); + +// Included from: src/javascript/runtime/silverlight/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileInput +@private +*/ +define("moxie/runtime/silverlight/file/FileInput", [ + "moxie/runtime/silverlight/Runtime", + "moxie/file/File", + "moxie/core/utils/Basic" +], function(extensions, File, Basic) { + + var FileInput = { + init: function(options) { + var comp = this, I = this.getRuntime(); + + function toFilters(accept) { + var filter = ''; + for (var i = 0; i < accept.length; i++) { + filter += (filter !== '' ? '|' : '') + accept[i].title + " | *." + accept[i].extensions.replace(/,/g, ';*.'); + } + return filter; + } + + this.bind("Change", function() { + var files = I.shimExec.call(comp, 'FileInput', 'getFiles'); + comp.files = []; + Basic.each(files, function(file) { + comp.files.push(new File(I.uid, file)); + }); + }, 999); + + this.getRuntime().shimExec.call(this, 'FileInput', 'init', toFilters(options.accept), options.name, options.multiple); + this.trigger('ready'); + } + }; + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/silverlight/file/Blob.js + +/** + * Blob.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/Blob +@private +*/ +define("moxie/runtime/silverlight/file/Blob", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/Blob" +], function(extensions, Basic, Blob) { + return (extensions.Blob = Basic.extend({}, Blob)); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileDrop.js + +/** + * FileDrop.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileDrop +@private +*/ +define("moxie/runtime/silverlight/file/FileDrop", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Dom", + "moxie/core/utils/Events" +], function(extensions, Dom, Events) { + + // not exactly useful, since works only in safari (...crickets...) + var FileDrop = { + init: function() { + var comp = this, self = comp.getRuntime(), dropZone; + + dropZone = self.getShimContainer(); + + Events.addEvent(dropZone, 'dragover', function(e) { + e.preventDefault(); + e.stopPropagation(); + e.dataTransfer.dropEffect = 'copy'; + }, comp.uid); + + Events.addEvent(dropZone, 'dragenter', function(e) { + e.preventDefault(); + var flag = Dom.get(self.uid).dragEnter(e); + // If handled, then stop propagation of event in DOM + if (flag) { + e.stopPropagation(); + } + }, comp.uid); + + Events.addEvent(dropZone, 'drop', function(e) { + e.preventDefault(); + var flag = Dom.get(self.uid).dragDrop(e); + // If handled, then stop propagation of event in DOM + if (flag) { + e.stopPropagation(); + } + }, comp.uid); + + return self.shimExec.call(this, 'FileDrop', 'init'); + } + }; + + return (extensions.FileDrop = FileDrop); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileReader +@private +*/ +define("moxie/runtime/silverlight/file/FileReader", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/FileReader" +], function(extensions, Basic, FileReader) { + return (extensions.FileReader = Basic.extend({}, FileReader)); +}); + +// Included from: src/javascript/runtime/silverlight/file/FileReaderSync.js + +/** + * FileReaderSync.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/file/FileReaderSync +@private +*/ +define("moxie/runtime/silverlight/file/FileReaderSync", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/file/FileReaderSync" +], function(extensions, Basic, FileReaderSync) { + return (extensions.FileReaderSync = Basic.extend({}, FileReaderSync)); +}); + +// Included from: src/javascript/runtime/silverlight/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/silverlight/xhr/XMLHttpRequest", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/xhr/XMLHttpRequest" +], function(extensions, Basic, XMLHttpRequest) { + return (extensions.XMLHttpRequest = Basic.extend({}, XMLHttpRequest)); +}); + +// Included from: src/javascript/runtime/silverlight/runtime/Transporter.js + +/** + * Transporter.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/runtime/Transporter +@private +*/ +define("moxie/runtime/silverlight/runtime/Transporter", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/runtime/flash/runtime/Transporter" +], function(extensions, Basic, Transporter) { + return (extensions.Transporter = Basic.extend({}, Transporter)); +}); + +// Included from: src/javascript/runtime/silverlight/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/silverlight/image/Image +@private +*/ +define("moxie/runtime/silverlight/image/Image", [ + "moxie/runtime/silverlight/Runtime", + "moxie/core/utils/Basic", + "moxie/file/Blob", + "moxie/runtime/flash/image/Image" +], function(extensions, Basic, Blob, Image) { + return (extensions.Image = Basic.extend({}, Image, { + + getInfo: function() { + var self = this.getRuntime() + , grps = ['tiff', 'exif', 'gps', 'thumb'] + , info = { meta: {} } + , rawInfo = self.shimExec.call(this, 'Image', 'getInfo') + ; + + if (rawInfo.meta) { + Basic.each(grps, function(grp) { + var meta = rawInfo.meta[grp] + , tag + , i + , length + , value + ; + if (meta && meta.keys) { + info.meta[grp] = {}; + for (i = 0, length = meta.keys.length; i < length; i++) { + tag = meta.keys[i]; + value = meta[tag]; + if (value) { + // convert numbers + if (/^(\d|[1-9]\d+)$/.test(value)) { // integer (make sure doesn't start with zero) + value = parseInt(value, 10); + } else if (/^\d*\.\d+$/.test(value)) { // double + value = parseFloat(value); + } + info.meta[grp][tag] = value; + } + } + } + }); + + // save thumb data as blob + if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) { + info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data); + } + } + + info.width = parseInt(rawInfo.width, 10); + info.height = parseInt(rawInfo.height, 10); + info.size = parseInt(rawInfo.size, 10); + info.type = rawInfo.type; + info.name = rawInfo.name; + + return info; + } + })); +}); + +// Included from: src/javascript/runtime/html4/Runtime.js + +/** + * Runtime.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global File:true */ + +/** +Defines constructor for HTML4 runtime. + +@class moxie/runtime/html4/Runtime +@private +*/ +define("moxie/runtime/html4/Runtime", [ + "moxie/core/utils/Basic", + "moxie/core/Exceptions", + "moxie/runtime/Runtime", + "moxie/core/utils/Env" +], function(Basic, x, Runtime, Env) { + + var type = 'html4', extensions = {}; + + function Html4Runtime(options) { + var I = this + , Test = Runtime.capTest + , True = Runtime.capTrue + ; + + Runtime.call(this, options, type, { + access_binary: Test(window.FileReader || window.File && File.getAsDataURL), + access_image_binary: false, + display_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))), + do_cors: false, + drag_and_drop: false, + filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest + return (Env.browser === 'Chrome' && Env.verComp(Env.version, 28, '>=')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || + (Env.browser === 'Safari' && Env.verComp(Env.version, 7, '>=')); + }()), + resize_image: function() { + return extensions.Image && I.can('access_binary') && Env.can('create_canvas'); + }, + report_upload_progress: false, + return_response_headers: false, + return_response_type: function(responseType) { + if (responseType === 'json' && !!window.JSON) { + return true; + } + return !!~Basic.inArray(responseType, ['text', 'document', '']); + }, + return_status_code: function(code) { + return !Basic.arrayDiff(code, [200, 404]); + }, + select_file: function() { + return Env.can('use_fileinput'); + }, + select_multiple: false, + send_binary_string: false, + send_custom_headers: false, + send_multipart: true, + slice_blob: false, + stream_upload: function() { + return I.can('select_file'); + }, + summon_file_dialog: function() { // yeah... some dirty sniffing here... + return I.can('select_file') && ( + (Env.browser === 'Firefox' && Env.verComp(Env.version, 4, '>=')) || + (Env.browser === 'Opera' && Env.verComp(Env.version, 12, '>=')) || + (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || + !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']) + ); + }, + upload_filesize: True, + use_http_method: function(methods) { + return !Basic.arrayDiff(methods, ['GET', 'POST']); + } + }); + + + Basic.extend(this, { + init : function() { + this.trigger("Init"); + }, + + destroy: (function(destroy) { // extend default destroy method + return function() { + destroy.call(I); + destroy = I = null; + }; + }(this.destroy)) + }); + + Basic.extend(this.getShim(), extensions); + } + + Runtime.addConstructor(type, Html4Runtime); + + return extensions; +}); + +// Included from: src/javascript/runtime/html4/file/FileInput.js + +/** + * FileInput.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/file/FileInput +@private +*/ +define("moxie/runtime/html4/file/FileInput", [ + "moxie/runtime/html4/Runtime", + "moxie/file/File", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Events", + "moxie/core/utils/Mime", + "moxie/core/utils/Env" +], function(extensions, File, Basic, Dom, Events, Mime, Env) { + + function FileInput() { + var _uid, _mimes = [], _options; + + function addInput() { + var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid; + + uid = Basic.guid('uid_'); + + shimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE + + if (_uid) { // move previous form out of the view + currForm = Dom.get(_uid + '_form'); + if (currForm) { + Basic.extend(currForm.style, { top: '100%' }); + } + } + + // build form in DOM, since innerHTML version not able to submit file for some reason + form = document.createElement('form'); + form.setAttribute('id', uid + '_form'); + form.setAttribute('method', 'post'); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('encoding', 'multipart/form-data'); + + Basic.extend(form.style, { + overflow: 'hidden', + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + input = document.createElement('input'); + input.setAttribute('id', uid); + input.setAttribute('type', 'file'); + input.setAttribute('name', _options.name || 'Filedata'); + input.setAttribute('accept', _mimes.join(',')); + + Basic.extend(input.style, { + fontSize: '999px', + opacity: 0 + }); + + form.appendChild(input); + shimContainer.appendChild(form); + + // prepare file input to be placed underneath the browse_button element + Basic.extend(input.style, { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%' + }); + + if (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) { + Basic.extend(input.style, { + filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)" + }); + } + + input.onchange = function() { // there should be only one handler for this + var file; + + if (!this.value) { + return; + } + + if (this.files) { // check if browser is fresh enough + file = this.files[0]; + + // ignore empty files (IE10 for example hangs if you try to send them via XHR) + if (file.size === 0) { + form.parentNode.removeChild(form); + return; + } + } else { + file = { + name: this.value + }; + } + + file = new File(I.uid, file); + + // clear event handler + this.onchange = function() {}; + addInput.call(comp); + + comp.files = [file]; + + // substitute all ids with file uids (consider file.uid read-only - we cannot do it the other way around) + input.setAttribute('id', file.uid); + form.setAttribute('id', file.uid + '_form'); + + comp.trigger('change'); + + input = form = null; + }; + + + // route click event to the input + if (I.can('summon_file_dialog')) { + browseButton = Dom.get(_options.browse_button); + Events.removeEvent(browseButton, 'click', comp.uid); + Events.addEvent(browseButton, 'click', function(e) { + if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] + input.click(); + } + e.preventDefault(); + }, comp.uid); + } + + _uid = uid; + + shimContainer = currForm = browseButton = null; + } + + Basic.extend(this, { + init: function(options) { + var comp = this, I = comp.getRuntime(), shimContainer; + + // figure out accept string + _options = options; + _mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension')); + + shimContainer = I.getShimContainer(); + + (function() { + var browseButton, zIndex, top; + + browseButton = Dom.get(options.browse_button); + + // Route click event to the input[type=file] element for browsers that support such behavior + if (I.can('summon_file_dialog')) { + if (Dom.getStyle(browseButton, 'position') === 'static') { + browseButton.style.position = 'relative'; + } + + zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; + + browseButton.style.zIndex = zIndex; + shimContainer.style.zIndex = zIndex - 1; + } + + /* Since we have to place input[type=file] on top of the browse_button for some browsers, + browse_button loses interactivity, so we restore it here */ + top = I.can('summon_file_dialog') ? browseButton : shimContainer; + + Events.addEvent(top, 'mouseover', function() { + comp.trigger('mouseenter'); + }, comp.uid); + + Events.addEvent(top, 'mouseout', function() { + comp.trigger('mouseleave'); + }, comp.uid); + + Events.addEvent(top, 'mousedown', function() { + comp.trigger('mousedown'); + }, comp.uid); + + Events.addEvent(Dom.get(options.container), 'mouseup', function() { + comp.trigger('mouseup'); + }, comp.uid); + + browseButton = null; + }()); + + addInput.call(this); + + shimContainer = null; + + // trigger ready event asynchronously + comp.trigger({ + type: 'ready', + async: true + }); + }, + + + disable: function(state) { + var input; + + if ((input = Dom.get(_uid))) { + input.disabled = !!state; + } + }, + + destroy: function() { + var I = this.getRuntime() + , shim = I.getShim() + , shimContainer = I.getShimContainer() + ; + + Events.removeAllEvents(shimContainer, this.uid); + Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); + Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); + + if (shimContainer) { + shimContainer.innerHTML = ''; + } + + shim.removeInstance(this.uid); + + _uid = _mimes = _options = shimContainer = shim = null; + } + }); + } + + return (extensions.FileInput = FileInput); +}); + +// Included from: src/javascript/runtime/html4/file/FileReader.js + +/** + * FileReader.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/file/FileReader +@private +*/ +define("moxie/runtime/html4/file/FileReader", [ + "moxie/runtime/html4/Runtime", + "moxie/runtime/html5/file/FileReader" +], function(extensions, FileReader) { + return (extensions.FileReader = FileReader); +}); + +// Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js + +/** + * XMLHttpRequest.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/xhr/XMLHttpRequest +@private +*/ +define("moxie/runtime/html4/xhr/XMLHttpRequest", [ + "moxie/runtime/html4/Runtime", + "moxie/core/utils/Basic", + "moxie/core/utils/Dom", + "moxie/core/utils/Url", + "moxie/core/Exceptions", + "moxie/core/utils/Events", + "moxie/file/Blob", + "moxie/xhr/FormData" +], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) { + + function XMLHttpRequest() { + var _status, _response, _iframe; + + function cleanup(cb) { + var target = this, uid, form, inputs, i, hasFile = false; + + if (!_iframe) { + return; + } + + uid = _iframe.id.replace(/_iframe$/, ''); + + form = Dom.get(uid + '_form'); + if (form) { + inputs = form.getElementsByTagName('input'); + i = inputs.length; + + while (i--) { + switch (inputs[i].getAttribute('type')) { + case 'hidden': + inputs[i].parentNode.removeChild(inputs[i]); + break; + case 'file': + hasFile = true; // flag the case for later + break; + } + } + inputs = []; + + if (!hasFile) { // we need to keep the form for sake of possible retries + form.parentNode.removeChild(form); + } + form = null; + } + + // without timeout, request is marked as canceled (in console) + setTimeout(function() { + Events.removeEvent(_iframe, 'load', target.uid); + if (_iframe.parentNode) { // #382 + _iframe.parentNode.removeChild(_iframe); + } + + // check if shim container has any other children, if - not, remove it as well + var shimContainer = target.getRuntime().getShimContainer(); + if (!shimContainer.children.length) { + shimContainer.parentNode.removeChild(shimContainer); + } + + shimContainer = _iframe = null; + cb(); + }, 1); + } + + Basic.extend(this, { + send: function(meta, data) { + var target = this, I = target.getRuntime(), uid, form, input, blob; + + _status = _response = null; + + function createIframe() { + var container = I.getShimContainer() || document.body + , temp = document.createElement('div') + ; + + // IE 6 won't be able to set the name using setAttribute or iframe.name + temp.innerHTML = ''; + _iframe = temp.firstChild; + container.appendChild(_iframe); + + /* _iframe.onreadystatechange = function() { + console.info(_iframe.readyState); + };*/ + + Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8 + var el; + + try { + el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document; + + // try to detect some standard error pages + if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error + _status = el.title.replace(/^(\d+).*$/, '$1'); + } else { + _status = 200; + // get result + _response = Basic.trim(el.body.innerHTML); + + // we need to fire these at least once + target.trigger({ + type: 'progress', + loaded: _response.length, + total: _response.length + }); + + if (blob) { // if we were uploading a file + target.trigger({ + type: 'uploadprogress', + loaded: blob.size || 1025, + total: blob.size || 1025 + }); + } + } + } catch (ex) { + if (Url.hasSameOrigin(meta.url)) { + // if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm + // which obviously results to cross domain error (wtf?) + _status = 404; + } else { + cleanup.call(target, function() { + target.trigger('error'); + }); + return; + } + } + + cleanup.call(target, function() { + target.trigger('load'); + }); + }, target.uid); + } // end createIframe + + // prepare data to be sent and convert if required + if (data instanceof FormData && data.hasBlob()) { + blob = data.getBlob(); + uid = blob.uid; + input = Dom.get(uid); + form = Dom.get(uid + '_form'); + if (!form) { + throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); + } + } else { + uid = Basic.guid('uid_'); + + form = document.createElement('form'); + form.setAttribute('id', uid + '_form'); + form.setAttribute('method', meta.method); + form.setAttribute('enctype', 'multipart/form-data'); + form.setAttribute('encoding', 'multipart/form-data'); + + I.getShimContainer().appendChild(form); + } + + // set upload target + form.setAttribute('target', uid + '_iframe'); + + if (data instanceof FormData) { + data.each(function(value, name) { + if (value instanceof Blob) { + if (input) { + input.setAttribute('name', name); + } + } else { + var hidden = document.createElement('input'); + + Basic.extend(hidden, { + type : 'hidden', + name : name, + value : value + }); + + // make sure that input[type="file"], if it's there, comes last + if (input) { + form.insertBefore(hidden, input); + } else { + form.appendChild(hidden); + } + } + }); + } + + // set destination url + form.setAttribute("action", meta.url); + + createIframe(); + form.submit(); + target.trigger('loadstart'); + }, + + getStatus: function() { + return _status; + }, + + getResponse: function(responseType) { + if ('json' === responseType) { + // strip off
          ..
          tags that might be enclosing the response + if (Basic.typeOf(_response) === 'string' && !!window.JSON) { + try { + return JSON.parse(_response.replace(/^\s*]*>/, '').replace(/<\/pre>\s*$/, '')); + } catch (ex) { + return null; + } + } + } else if ('document' === responseType) { + + } + return _response; + }, + + abort: function() { + var target = this; + + if (_iframe && _iframe.contentWindow) { + if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome + _iframe.contentWindow.stop(); + } else if (_iframe.contentWindow.document.execCommand) { // IE + _iframe.contentWindow.document.execCommand('Stop'); + } else { + _iframe.src = "about:blank"; + } + } + + cleanup.call(this, function() { + // target.dispatchEvent('readystatechange'); + target.dispatchEvent('abort'); + }); + } + }); + } + + return (extensions.XMLHttpRequest = XMLHttpRequest); +}); + +// Included from: src/javascript/runtime/html4/image/Image.js + +/** + * Image.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/** +@class moxie/runtime/html4/image/Image +@private +*/ +define("moxie/runtime/html4/image/Image", [ + "moxie/runtime/html4/Runtime", + "moxie/runtime/html5/image/Image" +], function(extensions, Image) { + return (extensions.Image = Image); +}); + +expose(["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"]); +})(this); +/** + * o.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global moxie:true */ + +/** +Globally exposed namespace with the most frequently used public classes and handy methods. + +@class o +@static +@private +*/ +(function(exports) { + "use strict"; + + var o = {}, inArray = exports.moxie.core.utils.Basic.inArray; + + // directly add some public classes + // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included) + (function addAlias(ns) { + var name, itemType; + for (name in ns) { + itemType = typeof(ns[name]); + if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) { + addAlias(ns[name]); + } else if (itemType === 'function') { + o[name] = ns[name]; + } + } + })(exports.moxie); + + // add some manually + o.Env = exports.moxie.core.utils.Env; + o.Mime = exports.moxie.core.utils.Mime; + o.Exceptions = exports.moxie.core.Exceptions; + + // expose globally + exports.mOxie = o; + if (!exports.o) { + exports.o = o; + } + return o; +})(this); \ No newline at end of file diff --git a/lib/wangEditor/plupload.dev.js b/lib/wangEditor/plupload.dev.js new file mode 100644 index 0000000..40268a4 --- /dev/null +++ b/lib/wangEditor/plupload.dev.js @@ -0,0 +1,2381 @@ +/** + * Plupload - multi-runtime File Uploader + * v2.1.9 + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + * + * Date: 2016-05-15 + */ +/** + * Plupload.js + * + * Copyright 2013, Moxiecode Systems AB + * Released under GPL License. + * + * License: http://www.plupload.com/license + * Contributing: http://www.plupload.com/contributing + */ + +/*global mOxie:true */ + +;(function(window, o, undef) { + +var delay = window.setTimeout +, fileFilters = {} +; + +// convert plupload features to caps acceptable by mOxie +function normalizeCaps(settings) { + var features = settings.required_features, caps = {}; + + function resolve(feature, value, strict) { + // Feature notation is deprecated, use caps (this thing here is required for backward compatibility) + var map = { + chunks: 'slice_blob', + jpgresize: 'send_binary_string', + pngresize: 'send_binary_string', + progress: 'report_upload_progress', + multi_selection: 'select_multiple', + dragdrop: 'drag_and_drop', + drop_element: 'drag_and_drop', + headers: 'send_custom_headers', + urlstream_upload: 'send_binary_string', + canSendBinary: 'send_binary', + triggerDialog: 'summon_file_dialog' + }; + + if (map[feature]) { + caps[map[feature]] = value; + } else if (!strict) { + caps[feature] = value; + } + } + + if (typeof(features) === 'string') { + plupload.each(features.split(/\s*,\s*/), function(feature) { + resolve(feature, true); + }); + } else if (typeof(features) === 'object') { + plupload.each(features, function(value, feature) { + resolve(feature, value); + }); + } else if (features === true) { + // check settings for required features + if (settings.chunk_size > 0) { + caps.slice_blob = true; + } + + if (settings.resize.enabled || !settings.multipart) { + caps.send_binary_string = true; + } + + plupload.each(settings, function(value, feature) { + resolve(feature, !!value, true); // strict check + }); + } + + return caps; +} + +/** + * @module plupload + * @static + */ +var plupload = { + /** + * Plupload version will be replaced on build. + * + * @property VERSION + * @for Plupload + * @static + * @final + */ + VERSION : '2.1.9', + + /** + * The state of the queue before it has started and after it has finished + * + * @property STOPPED + * @static + * @final + */ + STOPPED : 1, + + /** + * Upload process is running + * + * @property STARTED + * @static + * @final + */ + STARTED : 2, + + /** + * File is queued for upload + * + * @property QUEUED + * @static + * @final + */ + QUEUED : 1, + + /** + * File is being uploaded + * + * @property UPLOADING + * @static + * @final + */ + UPLOADING : 2, + + /** + * File has failed to be uploaded + * + * @property FAILED + * @static + * @final + */ + FAILED : 4, + + /** + * File has been uploaded successfully + * + * @property DONE + * @static + * @final + */ + DONE : 5, + + // Error constants used by the Error event + + /** + * Generic error for example if an exception is thrown inside Silverlight. + * + * @property GENERIC_ERROR + * @static + * @final + */ + GENERIC_ERROR : -100, + + /** + * HTTP transport error. For example if the server produces a HTTP status other than 200. + * + * @property HTTP_ERROR + * @static + * @final + */ + HTTP_ERROR : -200, + + /** + * Generic I/O error. For example if it wasn't possible to open the file stream on local machine. + * + * @property IO_ERROR + * @static + * @final + */ + IO_ERROR : -300, + + /** + * @property SECURITY_ERROR + * @static + * @final + */ + SECURITY_ERROR : -400, + + /** + * Initialization error. Will be triggered if no runtime was initialized. + * + * @property INIT_ERROR + * @static + * @final + */ + INIT_ERROR : -500, + + /** + * File size error. If the user selects a file that is too large it will be blocked and an error of this type will be triggered. + * + * @property FILE_SIZE_ERROR + * @static + * @final + */ + FILE_SIZE_ERROR : -600, + + /** + * File extension error. If the user selects a file that isn't valid according to the filters setting. + * + * @property FILE_EXTENSION_ERROR + * @static + * @final + */ + FILE_EXTENSION_ERROR : -601, + + /** + * Duplicate file error. If prevent_duplicates is set to true and user selects the same file again. + * + * @property FILE_DUPLICATE_ERROR + * @static + * @final + */ + FILE_DUPLICATE_ERROR : -602, + + /** + * Runtime will try to detect if image is proper one. Otherwise will throw this error. + * + * @property IMAGE_FORMAT_ERROR + * @static + * @final + */ + IMAGE_FORMAT_ERROR : -700, + + /** + * While working on files runtime may run out of memory and will throw this error. + * + * @since 2.1.2 + * @property MEMORY_ERROR + * @static + * @final + */ + MEMORY_ERROR : -701, + + /** + * Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error. + * + * @property IMAGE_DIMENSIONS_ERROR + * @static + * @final + */ + IMAGE_DIMENSIONS_ERROR : -702, + + /** + * Mime type lookup table. + * + * @property mimeTypes + * @type Object + * @final + */ + mimeTypes : o.mimes, + + /** + * In some cases sniffing is the only way around :( + */ + ua: o.ua, + + /** + * Gets the true type of the built-in object (better version of typeof). + * @credits Angus Croll (http://javascriptweblog.wordpress.com/) + * + * @method typeOf + * @static + * @param {Object} o Object to check. + * @return {String} Object [[Class]] + */ + typeOf: o.typeOf, + + /** + * Extends the specified object with another object. + * + * @method extend + * @static + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + extend : o.extend, + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property + * to an user unique key. + * + * @method guid + * @static + * @return {String} Virtually unique id. + */ + guid : o.guid, + + /** + * Get array of DOM Elements by their ids. + * + * @method get + * @param {String} id Identifier of the DOM Element + * @return {Array} + */ + getAll : function get(ids) { + var els = [], el; + + if (plupload.typeOf(ids) !== 'array') { + ids = [ids]; + } + + var i = ids.length; + while (i--) { + el = plupload.get(ids[i]); + if (el) { + els.push(el); + } + } + + return els.length ? els : null; + }, + + /** + Get DOM element by id + + @method get + @param {String} id Identifier of the DOM Element + @return {Node} + */ + get: o.get, + + /** + * Executes the callback function for each item in array/object. If you return false in the + * callback it will break the loop. + * + * @method each + * @static + * @param {Object} obj Object to iterate. + * @param {function} callback Callback function to execute for each item. + */ + each : o.each, + + /** + * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + * + * @method getPos + * @static + * @param {Element} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + getPos : o.getPos, + + /** + * Returns the size of the specified node in pixels. + * + * @method getSize + * @static + * @param {Node} node Node to get the size of. + * @return {Object} Object with a w and h property. + */ + getSize : o.getSize, + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @static + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + xmlEncode : function(str) { + var xmlEncodeChars = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'}, xmlEncodeRegExp = /[<>&\"\']/g; + + return str ? ('' + str).replace(xmlEncodeRegExp, function(chr) { + return xmlEncodeChars[chr] ? '&' + xmlEncodeChars[chr] + ';' : chr; + }) : str; + }, + + /** + * Forces anything into an array. + * + * @method toArray + * @static + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + toArray : o.toArray, + + /** + * Find an element in array and return its index if present, otherwise return -1. + * + * @method inArray + * @static + * @param {mixed} needle Element to find + * @param {Array} array + * @return {Int} Index of the element, or -1 if not found + */ + inArray : o.inArray, + + /** + * Extends the language pack object with new items. + * + * @method addI18n + * @static + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + addI18n : o.addI18n, + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @method translate + * @static + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + translate : o.translate, + + /** + * Checks if object is empty. + * + * @method isEmptyObj + * @static + * @param {Object} obj Object to check. + * @return {Boolean} + */ + isEmptyObj : o.isEmptyObj, + + /** + * Checks if specified DOM element has specified class. + * + * @method hasClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + hasClass : o.hasClass, + + /** + * Adds specified className to specified DOM element. + * + * @method addClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + addClass : o.addClass, + + /** + * Removes specified className from specified DOM element. + * + * @method removeClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + removeClass : o.removeClass, + + /** + * Returns a given computed style of a DOM element. + * + * @method getStyle + * @static + * @param {Object} obj DOM element like object. + * @param {String} name Style you want to get from the DOM element + */ + getStyle : o.getStyle, + + /** + * Adds an event handler to the specified object and store reference to the handler + * in objects internal Plupload registry (@see removeEvent). + * + * @method addEvent + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Name to add event listener to. + * @param {Function} callback Function to call when event occurs. + * @param {String} (optional) key that might be used to add specifity to the event record. + */ + addEvent : o.addEvent, + + /** + * Remove event handler from the specified object. If third argument (callback) + * is not specified remove all events with the specified name. + * + * @method removeEvent + * @static + * @param {Object} obj DOM element to remove event listener(s) from. + * @param {String} name Name of event listener to remove. + * @param {Function|String} (optional) might be a callback or unique key to match. + */ + removeEvent: o.removeEvent, + + /** + * Remove all kind of events from the specified object + * + * @method removeAllEvents + * @static + * @param {Object} obj DOM element to remove event listeners from. + * @param {String} (optional) unique key to match, when removing events. + */ + removeAllEvents: o.removeAllEvents, + + /** + * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @static + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + cleanName : function(name) { + var i, lookup; + + // Replace diacritics + lookup = [ + /[\300-\306]/g, 'A', /[\340-\346]/g, 'a', + /\307/g, 'C', /\347/g, 'c', + /[\310-\313]/g, 'E', /[\350-\353]/g, 'e', + /[\314-\317]/g, 'I', /[\354-\357]/g, 'i', + /\321/g, 'N', /\361/g, 'n', + /[\322-\330]/g, 'O', /[\362-\370]/g, 'o', + /[\331-\334]/g, 'U', /[\371-\374]/g, 'u' + ]; + + for (i = 0; i < lookup.length; i += 2) { + name = name.replace(lookup[i], lookup[i + 1]); + } + + // Replace whitespace + name = name.replace(/\s+/g, '_'); + + // Remove anything else + name = name.replace(/[^a-z0-9_\-\.]+/gi, ''); + + return name; + }, + + /** + * Builds a full url out of a base URL and an object with items to append as query string items. + * + * @method buildUrl + * @static + * @param {String} url Base URL to append query string items to. + * @param {Object} items Name/value object to serialize as a querystring. + * @return {String} String with url + serialized query string items. + */ + buildUrl : function(url, items) { + var query = ''; + + plupload.each(items, function(value, name) { + query += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value); + }); + + if (query) { + url += (url.indexOf('?') > 0 ? '&' : '?') + query; + } + + return url; + }, + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @static + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + formatSize : function(size) { + + if (size === undef || /\D/.test(size)) { + return plupload.translate('N/A'); + } + + function round(num, precision) { + return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision); + } + + var boundary = Math.pow(1024, 4); + + // TB + if (size > boundary) { + return round(size / boundary, 1) + " " + plupload.translate('tb'); + } + + // GB + if (size > (boundary/=1024)) { + return round(size / boundary, 1) + " " + plupload.translate('gb'); + } + + // MB + if (size > (boundary/=1024)) { + return round(size / boundary, 1) + " " + plupload.translate('mb'); + } + + // KB + if (size > 1024) { + return Math.round(size / 1024) + " " + plupload.translate('kb'); + } + + return size + " " + plupload.translate('b'); + }, + + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @static + * @param {String|Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + parseSize : o.parseSizeStr, + + + /** + * A way to predict what runtime will be choosen in the current environment with the + * specified settings. + * + * @method predictRuntime + * @static + * @param {Object|String} config Plupload settings to check + * @param {String} [runtimes] Comma-separated list of runtimes to check against + * @return {String} Type of compatible runtime + */ + predictRuntime : function(config, runtimes) { + var up, runtime; + + up = new plupload.Uploader(config); + runtime = o.Runtime.thatCan(up.getOption().required_features, runtimes || config.runtimes); + up.destroy(); + return runtime; + }, + + /** + * Registers a filter that will be executed for each file added to the queue. + * If callback returns false, file will not be added. + * + * Callback receives two arguments: a value for the filter as it was specified in settings.filters + * and a file to be filtered. Callback is executed in the context of uploader instance. + * + * @method addFileFilter + * @static + * @param {String} name Name of the filter by which it can be referenced in settings.filters + * @param {String} cb Callback - the actual routine that every added file must pass + */ + addFileFilter: function(name, cb) { + fileFilters[name] = cb; + } +}; + + +plupload.addFileFilter('mime_types', function(filters, file, cb) { + if (filters.length && !filters.regexp.test(file.name)) { + this.trigger('Error', { + code : plupload.FILE_EXTENSION_ERROR, + message : plupload.translate('File extension error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +plupload.addFileFilter('max_file_size', function(maxSize, file, cb) { + var undef; + + maxSize = plupload.parseSize(maxSize); + + // Invalid file size + if (file.size !== undef && maxSize && file.size > maxSize) { + this.trigger('Error', { + code : plupload.FILE_SIZE_ERROR, + message : plupload.translate('File size error.'), + file : file + }); + cb(false); + } else { + cb(true); + } +}); + + +plupload.addFileFilter('prevent_duplicates', function(value, file, cb) { + if (value) { + var ii = this.files.length; + while (ii--) { + // Compare by name and size (size might be 0 or undefined, but still equivalent for both) + if (file.name === this.files[ii].name && file.size === this.files[ii].size) { + this.trigger('Error', { + code : plupload.FILE_DUPLICATE_ERROR, + message : plupload.translate('Duplicate file error.'), + file : file + }); + cb(false); + return; + } + } + } + cb(true); +}); + + +/** +@class Uploader +@constructor + +@param {Object} settings For detailed information about each option check documentation. + @param {String|DOMElement} settings.browse_button id of the DOM element or DOM element itself to use as file dialog trigger. + @param {String} settings.url URL of the server-side upload handler. + @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled. + @param {Boolean} [settings.send_chunk_number=true] Whether to send chunks and chunk numbers, or total and offset bytes. + @param {String|DOMElement} [settings.container] id of the DOM element or DOM element itself that will be used to wrap uploader structures. Defaults to immediate parent of the `browse_button` element. + @param {String|DOMElement} [settings.drop_element] id of the DOM element or DOM element itself to use as a drop zone for Drag-n-Drop. + @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message. + @param {Object} [settings.filters={}] Set of file type filters. + @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR` + @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. + @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. + @param {String} [settings.flash_swf_url] URL of the Flash swf. + @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs. + @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event. + @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message. + @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload. + @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog. + @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess. + @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}` + @param {Number} [settings.resize.width] If image is bigger, it will be resized. + @param {Number} [settings.resize.height] If image is bigger, it will be resized. + @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100). + @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally. + @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. + @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap. + @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files. + @param {Boolean} [settings.send_file_name=true] Whether to send file name as additional argument - 'name' (required for chunked uploads and some other cases where file name cannot be sent via normal ways). +*/ +plupload.Uploader = function(options) { + /** + Fires when the current RunTime has been initialized. + + @event Init + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires after the init event incase you need to perform actions there. + + @event PostInit + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires when the option is changed in via uploader.setOption(). + + @event OptionChanged + @since 2.1 + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {String} name Name of the option that was changed + @param {Mixed} value New value for the specified option + @param {Mixed} oldValue Previous value of the option + */ + + /** + Fires when the silverlight/flash or other shim needs to move. + + @event Refresh + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires when the overall state is being changed for the upload queue. + + @event StateChanged + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires when browse_button is clicked and browse dialog shows. + + @event Browse + @since 2.1.2 + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires for every filtered file before it is added to the queue. + + @event FileFiltered + @since 2.1 + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file Another file that has to be added to the queue. + */ + + /** + Fires when the file queue is changed. In other words when files are added/removed to the files array of the uploader instance. + + @event QueueChanged + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + + /** + Fires after files were filtered and added to the queue. + + @event FilesAdded + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Array} files Array of file objects that were added to queue by the user. + */ + + /** + Fires when file is removed from the queue. + + @event FilesRemoved + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Array} files Array of files that got removed. + */ + + /** + Fires just before a file is uploaded. Can be used to cancel the upload for the specified file + by returning false from the handler. + + @event BeforeUpload + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File to be uploaded. + */ + + /** + Fires when a file is to be uploaded by the runtime. + + @event UploadFile + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File to be uploaded. + */ + + /** + Fires while a file is being uploaded. Use this event to update the current file upload progress. + + @event UploadProgress + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File that is currently being uploaded. + */ + + /** + Fires when file chunk is uploaded. + + @event ChunkUploaded + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File that the chunk was uploaded for. + @param {Object} result Object with response properties. + @param {Number} result.offset The amount of bytes the server has received so far, including this chunk. + @param {Number} result.total The size of the file. + @param {String} result.response The response body sent by the server. + @param {Number} result.status The HTTP status code sent by the server. + @param {String} result.responseHeaders All the response headers as a single string. + */ + + /** + Fires when a file is successfully uploaded. + + @event FileUploaded + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {plupload.File} file File that was uploaded. + @param {Object} result Object with response properties. + @param {String} result.response The response body sent by the server. + @param {Number} result.status The HTTP status code sent by the server. + @param {String} result.responseHeaders All the response headers as a single string. + */ + + /** + Fires when all files in a queue are uploaded. + + @event UploadComplete + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Array} files Array of file objects that was added to queue/selected by the user. + */ + + /** + Fires when a error occurs. + + @event Error + @param {plupload.Uploader} uploader Uploader instance sending the event. + @param {Object} error Contains code, message and sometimes file and other details. + @param {Number} error.code The plupload error code. + @param {String} error.message Description of the error (uses i18n). + */ + + /** + Fires when destroy method is called. + + @event Destroy + @param {plupload.Uploader} uploader Uploader instance sending the event. + */ + var uid = plupload.guid() + , settings + , files = [] + , preferred_caps = {} + , fileInputs = [] + , fileDrops = [] + , startTime + , total + , disabled = false + , xhr + ; + + + // Private methods + function uploadNext() { + var file, count = 0, i; + + if (this.state == plupload.STARTED) { + // Find first QUEUED file + for (i = 0; i < files.length; i++) { + if (!file && files[i].status == plupload.QUEUED) { + file = files[i]; + if (this.trigger("BeforeUpload", file)) { + file.status = plupload.UPLOADING; + this.trigger("UploadFile", file); + } + } else { + count++; + } + } + + // All files are DONE or FAILED + if (count == files.length) { + if (this.state !== plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger("StateChanged"); + } + this.trigger("UploadComplete", files); + } + } + } + + + function calcFile(file) { + file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 100; + calc(); + } + + + function calc() { + var i, file; + + // Reset stats + total.reset(); + + // Check status, size, loaded etc on all files + for (i = 0; i < files.length; i++) { + file = files[i]; + + if (file.size !== undef) { + // We calculate totals based on original file size + total.size += file.origSize; + + // Since we cannot predict file size after resize, we do opposite and + // interpolate loaded amount to match magnitude of total + total.loaded += file.loaded * file.origSize / file.size; + } else { + total.size = undef; + } + + if (file.status == plupload.DONE) { + total.uploaded++; + } else if (file.status == plupload.FAILED) { + total.failed++; + } else { + total.queued++; + } + } + + // If we couldn't calculate a total file size then use the number of files to calc percent + if (total.size === undef) { + total.percent = files.length > 0 ? Math.ceil(total.uploaded / files.length * 100) : 0; + } else { + total.bytesPerSec = Math.ceil(total.loaded / ((+new Date() - startTime || 1) / 1000.0)); + total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0; + } + } + + + function getRUID() { + var ctrl = fileInputs[0] || fileDrops[0]; + if (ctrl) { + return ctrl.getRuntime().uid; + } + return false; + } + + + function runtimeCan(file, cap) { + if (file.ruid) { + var info = o.Runtime.getInfo(file.ruid); + if (info) { + return info.can(cap); + } + } + return false; + } + + + function bindEventListeners() { + this.bind('FilesAdded FilesRemoved', function(up) { + up.trigger('QueueChanged'); + up.refresh(); + }); + + this.bind('CancelUpload', onCancelUpload); + + this.bind('BeforeUpload', onBeforeUpload); + + this.bind('UploadFile', onUploadFile); + + this.bind('UploadProgress', onUploadProgress); + + this.bind('StateChanged', onStateChanged); + + this.bind('QueueChanged', calc); + + this.bind('Error', onError); + + this.bind('FileUploaded', onFileUploaded); + + this.bind('Destroy', onDestroy); + } + + + function initControls(settings, cb) { + var self = this, inited = 0, queue = []; + + // common settings + var options = { + runtime_order: settings.runtimes, + required_caps: settings.required_features, + preferred_caps: preferred_caps, + swf_url: settings.flash_swf_url, + xap_url: settings.silverlight_xap_url + }; + + // add runtime specific options if any + plupload.each(settings.runtimes.split(/\s*,\s*/), function(runtime) { + if (settings[runtime]) { + options[runtime] = settings[runtime]; + } + }); + + // initialize file pickers - there can be many + if (settings.browse_button) { + plupload.each(settings.browse_button, function(el) { + queue.push(function(cb) { + var fileInput = new o.FileInput(plupload.extend({}, options, { + accept: settings.filters.mime_types, + name: settings.file_data_name, + multiple: settings.multi_selection, + container: settings.container, + browse_button: el + })); + + fileInput.onready = function() { + var info = o.Runtime.getInfo(this.ruid); + + // for backward compatibility + o.extend(self.features, { + chunks: info.can('slice_blob'), + multipart: info.can('send_multipart'), + multi_selection: info.can('select_multiple') + }); + + inited++; + fileInputs.push(this); + cb(); + }; + + fileInput.onchange = function() { + self.addFile(this.files); + }; + + fileInput.bind('mouseenter mouseleave mousedown mouseup', function(e) { + if (!disabled) { + if (settings.browse_button_hover) { + if ('mouseenter' === e.type) { + o.addClass(el, settings.browse_button_hover); + } else if ('mouseleave' === e.type) { + o.removeClass(el, settings.browse_button_hover); + } + } + + if (settings.browse_button_active) { + if ('mousedown' === e.type) { + o.addClass(el, settings.browse_button_active); + } else if ('mouseup' === e.type) { + o.removeClass(el, settings.browse_button_active); + } + } + } + }); + + fileInput.bind('mousedown', function() { + self.trigger('Browse'); + }); + + fileInput.bind('error runtimeerror', function() { + fileInput = null; + cb(); + }); + + fileInput.init(); + }); + }); + } + + // initialize drop zones + if (settings.drop_element) { + plupload.each(settings.drop_element, function(el) { + queue.push(function(cb) { + var fileDrop = new o.FileDrop(plupload.extend({}, options, { + drop_zone: el + })); + + fileDrop.onready = function() { + var info = o.Runtime.getInfo(this.ruid); + + // for backward compatibility + o.extend(self.features, { + chunks: info.can('slice_blob'), + multipart: info.can('send_multipart'), + dragdrop: info.can('drag_and_drop') + }); + + inited++; + fileDrops.push(this); + cb(); + }; + + fileDrop.ondrop = function() { + self.addFile(this.files); + }; + + fileDrop.bind('error runtimeerror', function() { + fileDrop = null; + cb(); + }); + + fileDrop.init(); + }); + }); + } + + + o.inSeries(queue, function() { + if (typeof(cb) === 'function') { + cb(inited); + } + }); + } + + + function resizeImage(blob, params, cb) { + var img = new o.Image(); + + try { + img.onload = function() { + // no manipulation required if... + if (params.width > this.width && + params.height > this.height && + params.quality === undef && + params.preserve_headers && + !params.crop + ) { + this.destroy(); + return cb(blob); + } + // otherwise downsize + img.downsize(params.width, params.height, params.crop, params.preserve_headers); + }; + + img.onresize = function() { + cb(this.getAsBlob(blob.type, params.quality)); + this.destroy(); + }; + + img.onerror = function() { + cb(blob); + }; + + img.load(blob); + } catch(ex) { + cb(blob); + } + } + + + function setOption(option, value, init) { + var self = this, reinitRequired = false; + + function _setOption(option, value, init) { + var oldValue = settings[option]; + + switch (option) { + case 'max_file_size': + if (option === 'max_file_size') { + settings.max_file_size = settings.filters.max_file_size = value; + } + break; + + case 'chunk_size': + if (value = plupload.parseSize(value)) { + settings[option] = value; + settings.send_file_name = true; + } + break; + + case 'multipart': + settings[option] = value; + if (!value) { + settings.send_file_name = true; + } + break; + + case 'unique_names': + settings[option] = value; + if (value) { + settings.send_file_name = true; + } + break; + + case 'filters': + // for sake of backward compatibility + if (plupload.typeOf(value) === 'array') { + value = { + mime_types: value + }; + } + + if (init) { + plupload.extend(settings.filters, value); + } else { + settings.filters = value; + } + + // if file format filters are being updated, regenerate the matching expressions + if (value.mime_types) { + settings.filters.mime_types.regexp = (function(filters) { + var extensionsRegExp = []; + + plupload.each(filters, function(filter) { + plupload.each(filter.extensions.split(/,/), function(ext) { + if (/^\s*\*\s*$/.test(ext)) { + extensionsRegExp.push('\\.*'); + } else { + extensionsRegExp.push('\\.' + ext.replace(new RegExp('[' + ('/^$.*+?|()[]{}\\'.replace(/./g, '\\$&')) + ']', 'g'), '\\$&')); + } + }); + }); + + return new RegExp('(' + extensionsRegExp.join('|') + ')$', 'i'); + }(settings.filters.mime_types)); + } + break; + + case 'resize': + if (init) { + plupload.extend(settings.resize, value, { + enabled: true + }); + } else { + settings.resize = value; + } + break; + + case 'prevent_duplicates': + settings.prevent_duplicates = settings.filters.prevent_duplicates = !!value; + break; + + // options that require reinitialisation + case 'container': + case 'browse_button': + case 'drop_element': + value = 'container' === option + ? plupload.get(value) + : plupload.getAll(value) + ; + + case 'runtimes': + case 'multi_selection': + case 'flash_swf_url': + case 'silverlight_xap_url': + settings[option] = value; + if (!init) { + reinitRequired = true; + } + break; + + default: + settings[option] = value; + } + + if (!init) { + self.trigger('OptionChanged', option, value, oldValue); + } + } + + if (typeof(option) === 'object') { + plupload.each(option, function(value, option) { + _setOption(option, value, init); + }); + } else { + _setOption(option, value, init); + } + + if (init) { + // Normalize the list of required capabilities + settings.required_features = normalizeCaps(plupload.extend({}, settings)); + + // Come up with the list of capabilities that can affect default mode in a multi-mode runtimes + preferred_caps = normalizeCaps(plupload.extend({}, settings, { + required_features: true + })); + } else if (reinitRequired) { + self.trigger('Destroy'); + + initControls.call(self, settings, function(inited) { + if (inited) { + self.runtime = o.Runtime.getInfo(getRUID()).type; + self.trigger('Init', { runtime: self.runtime }); + self.trigger('PostInit'); + } else { + self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + } + }); + } + } + + + // Internal event handlers + function onBeforeUpload(up, file) { + // Generate unique target filenames + if (up.settings.unique_names) { + var matches = file.name.match(/\.([^.]+)$/), ext = "part"; + if (matches) { + ext = matches[1]; + } + file.target_name = file.id + '.' + ext; + } + } + + + function onUploadFile(up, file) { + var url = up.settings.url + , chunkSize = up.settings.chunk_size + , retries = up.settings.max_retries + , features = up.features + , offset = 0 + , blob + ; + + // make sure we start at a predictable offset + if (file.loaded) { + offset = file.loaded = chunkSize ? chunkSize * Math.floor(file.loaded / chunkSize) : 0; + } + + function handleError() { + if (retries-- > 0) { + delay(uploadNextChunk, 1000); + } else { + file.loaded = offset; // reset all progress + + up.trigger('Error', { + code : plupload.HTTP_ERROR, + message : plupload.translate('HTTP Error.'), + file : file, + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + } + } + + function uploadNextChunk() { + var chunkBlob, formData, args = {}, curChunkSize; + + // make sure that file wasn't cancelled and upload is not stopped in general + if (file.status !== plupload.UPLOADING || up.state === plupload.STOPPED) { + return; + } + + // send additional 'name' parameter only if required + if (up.settings.send_file_name) { + args.name = file.target_name || file.name; + } + + if (chunkSize && features.chunks && blob.size > chunkSize) { // blob will be of type string if it was loaded in memory + curChunkSize = Math.min(chunkSize, blob.size - offset); + chunkBlob = blob.slice(offset, offset + curChunkSize); + } else { + curChunkSize = blob.size; + chunkBlob = blob; + } + + // If chunking is enabled add corresponding args, no matter if file is bigger than chunk or smaller + if (chunkSize && features.chunks) { + // Setup query string arguments + if (up.settings.send_chunk_number) { + args.chunk = Math.ceil(offset / chunkSize); + args.chunks = Math.ceil(blob.size / chunkSize); + } else { // keep support for experimental chunk format, just in case + args.offset = offset; + args.total = blob.size; + } + } + + xhr = new o.XMLHttpRequest(); + + // Do we have upload progress support + if (xhr.upload) { + xhr.upload.onprogress = function(e) { + file.loaded = Math.min(file.size, offset + e.loaded); + up.trigger('UploadProgress', file); + }; + } + + xhr.onload = function() { + // check if upload made itself through + if (xhr.status >= 400) { + handleError(); + return; + } + + retries = up.settings.max_retries; // reset the counter + + // Handle chunk response + if (curChunkSize < blob.size) { + chunkBlob.destroy(); + + offset += curChunkSize; + file.loaded = Math.min(offset, blob.size); + + up.trigger('ChunkUploaded', file, { + offset : file.loaded, + total : blob.size, + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + + // stock Android browser doesn't fire upload progress events, but in chunking mode we can fake them + if (o.Env.browser === 'Android Browser') { + // doesn't harm in general, but is not required anywhere else + up.trigger('UploadProgress', file); + } + } else { + file.loaded = file.size; + } + + chunkBlob = formData = null; // Free memory + + // Check if file is uploaded + if (!offset || offset >= blob.size) { + // If file was modified, destory the copy + if (file.size != file.origSize) { + blob.destroy(); + blob = null; + } + + up.trigger('UploadProgress', file); + + file.status = plupload.DONE; + + up.trigger('FileUploaded', file, { + response : xhr.responseText, + status : xhr.status, + responseHeaders: xhr.getAllResponseHeaders() + }); + } else { + // Still chunks left + delay(uploadNextChunk, 1); // run detached, otherwise event handlers interfere + } + }; + + xhr.onerror = function() { + handleError(); + }; + + xhr.onloadend = function() { + this.destroy(); + xhr = null; + }; + + // Build multipart request + if (up.settings.multipart && features.multipart) { + xhr.open("post", url, true); + + // Set custom headers + plupload.each(up.settings.headers, function(value, name) { + xhr.setRequestHeader(name, value); + }); + + formData = new o.FormData(); + + // Add multipart params + plupload.each(plupload.extend(args, up.settings.multipart_params), function(value, name) { + formData.append(name, value); + }); + + // Add file and send it + formData.append(up.settings.file_data_name, chunkBlob); + xhr.send(formData, { + runtime_order: up.settings.runtimes, + required_caps: up.settings.required_features, + preferred_caps: preferred_caps, + swf_url: up.settings.flash_swf_url, + xap_url: up.settings.silverlight_xap_url + }); + } else { + // if no multipart, send as binary stream + url = plupload.buildUrl(up.settings.url, plupload.extend(args, up.settings.multipart_params)); + + xhr.open("post", url, true); + + xhr.setRequestHeader('Content-Type', 'application/octet-stream'); // Binary stream header + + // Set custom headers + plupload.each(up.settings.headers, function(value, name) { + xhr.setRequestHeader(name, value); + }); + + xhr.send(chunkBlob, { + runtime_order: up.settings.runtimes, + required_caps: up.settings.required_features, + preferred_caps: preferred_caps, + swf_url: up.settings.flash_swf_url, + xap_url: up.settings.silverlight_xap_url + }); + } + } + + blob = file.getSource(); + + // Start uploading chunks + if (up.settings.resize.enabled && runtimeCan(blob, 'send_binary_string') && !!~o.inArray(blob.type, ['image/jpeg', 'image/png'])) { + // Resize if required + resizeImage.call(this, blob, up.settings.resize, function(resizedBlob) { + blob = resizedBlob; + file.size = resizedBlob.size; + uploadNextChunk(); + }); + } else { + uploadNextChunk(); + } + } + + + function onUploadProgress(up, file) { + calcFile(file); + } + + + function onStateChanged(up) { + if (up.state == plupload.STARTED) { + // Get start time to calculate bps + startTime = (+new Date()); + } else if (up.state == plupload.STOPPED) { + // Reset currently uploading files + for (var i = up.files.length - 1; i >= 0; i--) { + if (up.files[i].status == plupload.UPLOADING) { + up.files[i].status = plupload.QUEUED; + calc(); + } + } + } + } + + + function onCancelUpload() { + if (xhr) { + xhr.abort(); + } + } + + + function onFileUploaded(up) { + calc(); + + // Upload next file but detach it from the error event + // since other custom listeners might want to stop the queue + delay(function() { + uploadNext.call(up); + }, 1); + } + + + function onError(up, err) { + if (err.code === plupload.INIT_ERROR) { + up.destroy(); + } + // Set failed status if an error occured on a file + else if (err.code === plupload.HTTP_ERROR) { + err.file.status = plupload.FAILED; + calcFile(err.file); + + // Upload next file but detach it from the error event + // since other custom listeners might want to stop the queue + if (up.state == plupload.STARTED) { // upload in progress + up.trigger('CancelUpload'); + delay(function() { + uploadNext.call(up); + }, 1); + } + } + } + + + function onDestroy(up) { + up.stop(); + + // Purge the queue + plupload.each(files, function(file) { + file.destroy(); + }); + files = []; + + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.destroy(); + }); + fileInputs = []; + } + + if (fileDrops.length) { + plupload.each(fileDrops, function(fileDrop) { + fileDrop.destroy(); + }); + fileDrops = []; + } + + preferred_caps = {}; + disabled = false; + startTime = xhr = null; + total.reset(); + } + + + // Default settings + settings = { + runtimes: o.Runtime.order, + max_retries: 0, + chunk_size: 0, + multipart: true, + multi_selection: true, + file_data_name: 'file', + flash_swf_url: 'js/Moxie.swf', + silverlight_xap_url: 'js/Moxie.xap', + filters: { + mime_types: [], + prevent_duplicates: false, + max_file_size: 0 + }, + resize: { + enabled: false, + preserve_headers: true, + crop: false + }, + send_file_name: true, + send_chunk_number: true + }; + + + setOption.call(this, options, null, true); + + // Inital total state + total = new plupload.QueueProgress(); + + // Add public methods + plupload.extend(this, { + + /** + * Unique id for the Uploader instance. + * + * @property id + * @type String + */ + id : uid, + uid : uid, // mOxie uses this to differentiate between event targets + + /** + * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. + * These states are controlled by the stop/start methods. The default value is STOPPED. + * + * @property state + * @type Number + */ + state : plupload.STOPPED, + + /** + * Map of features that are available for the uploader runtime. Features will be filled + * before the init event is called, these features can then be used to alter the UI for the end user. + * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize. + * + * @property features + * @type Object + */ + features : {}, + + /** + * Current runtime name. + * + * @property runtime + * @type String + */ + runtime : null, + + /** + * Current upload queue, an array of File instances. + * + * @property files + * @type Array + * @see plupload.File + */ + files : files, + + /** + * Object with name/value settings. + * + * @property settings + * @type Object + */ + settings : settings, + + /** + * Total progess information. How many files has been uploaded, total percent etc. + * + * @property total + * @type plupload.QueueProgress + */ + total : total, + + + /** + * Initializes the Uploader instance and adds internal event listeners. + * + * @method init + */ + init : function() { + var self = this, opt, preinitOpt, err; + + preinitOpt = self.getOption('preinit'); + if (typeof(preinitOpt) == "function") { + preinitOpt(self); + } else { + plupload.each(preinitOpt, function(func, name) { + self.bind(name, func); + }); + } + + bindEventListeners.call(self); + + // Check for required options + plupload.each(['container', 'browse_button', 'drop_element'], function(el) { + if (self.getOption(el) === null) { + err = { + code : plupload.INIT_ERROR, + message : plupload.translate("'%' specified, but cannot be found.") + } + return false; + } + }); + + if (err) { + return self.trigger('Error', err); + } + + + if (!settings.browse_button && !settings.drop_element) { + return self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate("You must specify either 'browse_button' or 'drop_element'.") + }); + } + + + initControls.call(self, settings, function(inited) { + var initOpt = self.getOption('init'); + if (typeof(initOpt) == "function") { + initOpt(self); + } else { + plupload.each(initOpt, function(func, name) { + self.bind(name, func); + }); + } + + if (inited) { + self.runtime = o.Runtime.getInfo(getRUID()).type; + self.trigger('Init', { runtime: self.runtime }); + self.trigger('PostInit'); + } else { + self.trigger('Error', { + code : plupload.INIT_ERROR, + message : plupload.translate('Init error.') + }); + } + }); + }, + + /** + * Set the value for the specified option(s). + * + * @method setOption + * @since 2.1 + * @param {String|Object} option Name of the option to change or the set of key/value pairs + * @param {Mixed} [value] Value for the option (is ignored, if first argument is object) + */ + setOption: function(option, value) { + setOption.call(this, option, value, !this.runtime); // until runtime not set we do not need to reinitialize + }, + + /** + * Get the value for the specified option or the whole configuration, if not specified. + * + * @method getOption + * @since 2.1 + * @param {String} [option] Name of the option to get + * @return {Mixed} Value for the option or the whole set + */ + getOption: function(option) { + if (!option) { + return settings; + } + return settings[option]; + }, + + /** + * Refreshes the upload instance by dispatching out a refresh event to all runtimes. + * This would for example reposition flash/silverlight shims on the page. + * + * @method refresh + */ + refresh : function() { + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.trigger('Refresh'); + }); + } + this.trigger('Refresh'); + }, + + /** + * Starts uploading the queued files. + * + * @method start + */ + start : function() { + if (this.state != plupload.STARTED) { + this.state = plupload.STARTED; + this.trigger('StateChanged'); + + uploadNext.call(this); + } + }, + + /** + * Stops the upload of the queued files. + * + * @method stop + */ + stop : function() { + if (this.state != plupload.STOPPED) { + this.state = plupload.STOPPED; + this.trigger('StateChanged'); + this.trigger('CancelUpload'); + } + }, + + + /** + * Disables/enables browse button on request. + * + * @method disableBrowse + * @param {Boolean} disable Whether to disable or enable (default: true) + */ + disableBrowse : function() { + disabled = arguments[0] !== undef ? arguments[0] : true; + + if (fileInputs.length) { + plupload.each(fileInputs, function(fileInput) { + fileInput.disable(disabled); + }); + } + + this.trigger('DisableBrowse', disabled); + }, + + /** + * Returns the specified file object by id. + * + * @method getFile + * @param {String} id File id to look for. + * @return {plupload.File} File object or undefined if it wasn't found; + */ + getFile : function(id) { + var i; + for (i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return files[i]; + } + } + }, + + /** + * Adds file to the queue programmatically. Can be native file, instance of Plupload.File, + * instance of mOxie.File, input[type="file"] element, or array of these. Fires FilesAdded, + * if any files were added to the queue. Otherwise nothing happens. + * + * @method addFile + * @since 2.0 + * @param {plupload.File|mOxie.File|File|Node|Array} file File or files to add to the queue. + * @param {String} [fileName] If specified, will be used as a name for the file + */ + addFile : function(file, fileName) { + var self = this + , queue = [] + , filesAdded = [] + , ruid + ; + + function filterFile(file, cb) { + var queue = []; + o.each(self.settings.filters, function(rule, name) { + if (fileFilters[name]) { + queue.push(function(cb) { + fileFilters[name].call(self, rule, file, function(res) { + cb(!res); + }); + }); + } + }); + o.inSeries(queue, cb); + } + + /** + * @method resolveFile + * @private + * @param {o.File|o.Blob|plupload.File|File|Blob|input[type="file"]} file + */ + function resolveFile(file) { + var type = o.typeOf(file); + + // o.File + if (file instanceof o.File) { + if (!file.ruid && !file.isDetached()) { + if (!ruid) { // weird case + return false; + } + file.ruid = ruid; + file.connectRuntime(ruid); + } + resolveFile(new plupload.File(file)); + } + // o.Blob + else if (file instanceof o.Blob) { + resolveFile(file.getSource()); + file.destroy(); + } + // plupload.File - final step for other branches + else if (file instanceof plupload.File) { + if (fileName) { + file.name = fileName; + } + + queue.push(function(cb) { + // run through the internal and user-defined filters, if any + filterFile(file, function(err) { + if (!err) { + // make files available for the filters by updating the main queue directly + files.push(file); + // collect the files that will be passed to FilesAdded event + filesAdded.push(file); + + self.trigger("FileFiltered", file); + } + delay(cb, 1); // do not build up recursions or eventually we might hit the limits + }); + }); + } + // native File or blob + else if (o.inArray(type, ['file', 'blob']) !== -1) { + resolveFile(new o.File(null, file)); + } + // input[type="file"] + else if (type === 'node' && o.typeOf(file.files) === 'filelist') { + // if we are dealing with input[type="file"] + o.each(file.files, resolveFile); + } + // mixed array of any supported types (see above) + else if (type === 'array') { + fileName = null; // should never happen, but unset anyway to avoid funny situations + o.each(file, resolveFile); + } + } + + ruid = getRUID(); + + resolveFile(file); + + if (queue.length) { + o.inSeries(queue, function() { + // if any files left after filtration, trigger FilesAdded + if (filesAdded.length) { + self.trigger("FilesAdded", filesAdded); + } + }); + } + }, + + /** + * Removes a specific file. + * + * @method removeFile + * @param {plupload.File|String} file File to remove from queue. + */ + removeFile : function(file) { + var id = typeof(file) === 'string' ? file : file.id; + + for (var i = files.length - 1; i >= 0; i--) { + if (files[i].id === id) { + return this.splice(i, 1)[0]; + } + } + }, + + /** + * Removes part of the queue and returns the files removed. This will also trigger the FilesRemoved and QueueChanged events. + * + * @method splice + * @param {Number} start (Optional) Start index to remove from. + * @param {Number} length (Optional) Lengh of items to remove. + * @return {Array} Array of files that was removed. + */ + splice : function(start, length) { + // Splice and trigger events + var removed = files.splice(start === undef ? 0 : start, length === undef ? files.length : length); + + // if upload is in progress we need to stop it and restart after files are removed + var restartRequired = false; + if (this.state == plupload.STARTED) { // upload in progress + plupload.each(removed, function(file) { + if (file.status === plupload.UPLOADING) { + restartRequired = true; // do not restart, unless file that is being removed is uploading + return false; + } + }); + + if (restartRequired) { + this.stop(); + } + } + + this.trigger("FilesRemoved", removed); + + // Dispose any resources allocated by those files + plupload.each(removed, function(file) { + file.destroy(); + }); + + if (restartRequired) { + this.start(); + } + + return removed; + }, + + /** + Dispatches the specified event name and its arguments to all listeners. + + @method trigger + @param {String} name Event name to fire. + @param {Object..} Multiple arguments to pass along to the listener functions. + */ + + // override the parent method to match Plupload-like event logic + dispatchEvent: function(type) { + var list, args, result; + + type = type.toLowerCase(); + + list = this.hasEventListener(type); + + if (list) { + // sort event list by priority + list.sort(function(a, b) { return b.priority - a.priority; }); + + // first argument should be current plupload.Uploader instance + args = [].slice.call(arguments); + args.shift(); + args.unshift(this); + + for (var i = 0; i < list.length; i++) { + // Fire event, break chain if false is returned + if (list[i].fn.apply(list[i].scope, args) === false) { + return false; + } + } + } + return true; + }, + + /** + Check whether uploader has any listeners to the specified event. + + @method hasEventListener + @param {String} name Event name to check for. + */ + + + /** + Adds an event listener by name. + + @method bind + @param {String} name Event name to listen for. + @param {function} fn Function to call ones the event gets fired. + @param {Object} [scope] Optional scope to execute the specified function in. + @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first + */ + bind: function(name, fn, scope, priority) { + // adapt moxie EventTarget style to Plupload-like + plupload.Uploader.prototype.bind.call(this, name, fn, priority, scope); + }, + + /** + Removes the specified event listener. + + @method unbind + @param {String} name Name of event to remove. + @param {function} fn Function to remove from listener. + */ + + /** + Removes all event listeners. + + @method unbindAll + */ + + + /** + * Destroys Plupload instance and cleans after itself. + * + * @method destroy + */ + destroy : function() { + this.trigger('Destroy'); + settings = total = null; // purge these exclusively + this.unbindAll(); + } + }); +}; + +plupload.Uploader.prototype = o.EventTarget.instance; + +/** + * Constructs a new file instance. + * + * @class File + * @constructor + * + * @param {Object} file Object containing file properties + * @param {String} file.name Name of the file. + * @param {Number} file.size File size. + */ +plupload.File = (function() { + var filepool = {}; + + function PluploadFile(file) { + + plupload.extend(this, { + + /** + * File id this is a globally unique id for the specific file. + * + * @property id + * @type String + */ + id: plupload.guid(), + + /** + * File name for example "myfile.gif". + * + * @property name + * @type String + */ + name: file.name || file.fileName, + + /** + * File type, `e.g image/jpeg` + * + * @property type + * @type String + */ + type: file.type || '', + + /** + * File size in bytes (may change after client-side manupilation). + * + * @property size + * @type Number + */ + size: file.size || file.fileSize, + + /** + * Original file size in bytes. + * + * @property origSize + * @type Number + */ + origSize: file.size || file.fileSize, + + /** + * Number of bytes uploaded of the files total size. + * + * @property loaded + * @type Number + */ + loaded: 0, + + /** + * Number of percentage uploaded of the file. + * + * @property percent + * @type Number + */ + percent: 0, + + /** + * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. + * + * @property status + * @type Number + * @see plupload + */ + status: plupload.QUEUED, + + /** + * Date of last modification. + * + * @property lastModifiedDate + * @type {String} + */ + lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString(), // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) + + /** + * Returns native window.File object, when it's available. + * + * @method getNative + * @return {window.File} or null, if plupload.File is of different origin + */ + getNative: function() { + var file = this.getSource().getSource(); + return o.inArray(o.typeOf(file), ['blob', 'file']) !== -1 ? file : null; + }, + + /** + * Returns mOxie.File - unified wrapper object that can be used across runtimes. + * + * @method getSource + * @return {mOxie.File} or null + */ + getSource: function() { + if (!filepool[this.id]) { + return null; + } + return filepool[this.id]; + }, + + /** + * Destroys plupload.File object. + * + * @method destroy + */ + destroy: function() { + var src = this.getSource(); + if (src) { + src.destroy(); + delete filepool[this.id]; + } + } + }); + + filepool[this.id] = file; + } + + return PluploadFile; +}()); + + +/** + * Constructs a queue progress. + * + * @class QueueProgress + * @constructor + */ + plupload.QueueProgress = function() { + var self = this; // Setup alias for self to reduce code size when it's compressed + + /** + * Total queue file size. + * + * @property size + * @type Number + */ + self.size = 0; + + /** + * Total bytes uploaded. + * + * @property loaded + * @type Number + */ + self.loaded = 0; + + /** + * Number of files uploaded. + * + * @property uploaded + * @type Number + */ + self.uploaded = 0; + + /** + * Number of files failed to upload. + * + * @property failed + * @type Number + */ + self.failed = 0; + + /** + * Number of files yet to be uploaded. + * + * @property queued + * @type Number + */ + self.queued = 0; + + /** + * Total percent of the uploaded bytes. + * + * @property percent + * @type Number + */ + self.percent = 0; + + /** + * Bytes uploaded per second. + * + * @property bytesPerSec + * @type Number + */ + self.bytesPerSec = 0; + + /** + * Resets the progress to its initial values. + * + * @method reset + */ + self.reset = function() { + self.size = self.loaded = self.uploaded = self.failed = self.queued = self.percent = self.bytesPerSec = 0; + }; +}; + +window.plupload = plupload; + +}(window, mOxie)); \ No newline at end of file diff --git a/lib/wangEditor/qiniu.js b/lib/wangEditor/qiniu.js new file mode 100644 index 0000000..b222ed9 --- /dev/null +++ b/lib/wangEditor/qiniu.js @@ -0,0 +1,1398 @@ +/*! + * qiniu-js-sdk v1.0.14-beta + * + * Copyright 2015 by Qiniu + * Released under GPL V2 License. + * + * GitHub: http://github.com/qiniu/js-sdk + * + * Date: 2016-3-22 +*/ + +/*global plupload ,mOxie*/ +/*global ActiveXObject */ +/*exported Qiniu */ +/*exported QiniuJsSDK */ + +;(function( global ){ + +/** + * Creates new cookie or removes cookie with negative expiration + * @param key The key or identifier for the store + * @param value Contents of the store + * @param exp Expiration - creation defaults to 30 days + */ +function createCookie(key, value, exp) { + var date = new Date(); + date.setTime(date.getTime() + (exp * 24 * 60 * 60 * 1000)); + var expires = "; expires=" + date.toGMTString(); + document.cookie = key + "=" + value + expires + "; path=/"; +} + +/** + * Returns contents of cookie + * @param key The key or identifier for the store + */ +function readCookie(key) { + var nameEQ = key + "="; + var ca = document.cookie.split(';'); + for (var i = 0, max = ca.length; i < max; i++) { + var c = ca[i]; + while (c.charAt(0) === ' ') { + c = c.substring(1, c.length); + } + if (c.indexOf(nameEQ) === 0) { + return c.substring(nameEQ.length, c.length); + } + } + return null; +} + +// if current browser is not support localStorage +// use cookie to make a polyfill +if ( !window.localStorage ) { + window.localStorage = { + setItem: function (key, value) { + createCookie(key, value, 30); + }, + getItem: function (key) { + return readCookie(key); + }, + removeItem: function (key) { + createCookie(key, '', -1); + } + }; +} + +function QiniuJsSDK() { + + var that = this; + + /** + * detect IE version + * if current browser is not IE + * it will return false + * else + * it will return version of current IE browser + * @return {Number|Boolean} IE version or false + */ + this.detectIEVersion = function() { + var v = 4, + div = document.createElement('div'), + all = div.getElementsByTagName('i'); + while ( + div.innerHTML = '', + all[0] + ) { + v++; + } + return v > 4 ? v : false; + }; + + var logger = { + MUTE: 0, + FATA: 1, + ERROR: 2, + WARN: 3, + INFO: 4, + DEBUG: 5, + TRACE: 6, + level: 0 + }; + + function log(type, args){ + var header = "[qiniu-js-sdk]["+type+"]"; + if (that.detectIEVersion()) { + // http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9 + //var log = Function.prototype.bind.call(console.log, console); + //log.apply(console, args); + var msg = header; + for (var i = 0; i < args.length; i++) { + msg+=that.stringifyJSON(args[i]); + } + console.log(msg); + }else{ + args.unshift(header); + console.log.apply(console, args); + } + if (document.getElementById('qiniu-js-sdk-log')) { + var msg1 = header; + for (var j = 0; j < args.length; j++) { + msg1+=that.stringifyJSON(args[j]); + } + document.getElementById('qiniu-js-sdk-log').innerHTML += '

          '+msg1+'

          '; + } + } + + function makeLogFunc(code){ + var func = code.toLowerCase(); + logger[func] = function(){ + // logger[func].history = logger[func].history || []; + // logger[func].history.push(arguments); + if(window.console && window.console.log && logger.level>=logger[code]){ + var args = Array.prototype.slice.call(arguments); + log(func,args); + } + }; + } + + for (var property in logger){ + if (logger.hasOwnProperty(property) && (typeof logger[property]) === "number" && !logger.hasOwnProperty(property.toLowerCase())) { + makeLogFunc(property); + } + } + + + var qiniuUploadUrl; + if (window.location.protocol === 'https:') { + qiniuUploadUrl = 'https://up.qbox.me'; + } else { + qiniuUploadUrl = 'http://up-z1.qiniup.com'; + } + + /** + * qiniu upload urls + * 'qiniuUploadUrls' is used to change target when current url is not avaliable + * @type {Array} + */ + var qiniuUploadUrls = [ + "http://up-z1.qiniup.com", + "http://up.qiniu.com", + ]; + + var changeUrlTimes = 0; + + /** + * reset upload url + * if current page protocal is https + * it will always return 'https://up.qbox.me' + * else + * it will set 'qiniuUploadUrl' value with 'qiniuUploadUrls' looply + */ + this.resetUploadUrl = function(){ + if (window.location.protocol === 'https:') { + qiniuUploadUrl = 'https://up.qbox.me'; + } else { + var i = changeUrlTimes % qiniuUploadUrls.length; + qiniuUploadUrl = qiniuUploadUrls[i]; + changeUrlTimes++; + } + logger.debug('resetUploadUrl: '+qiniuUploadUrl); + }; + + this.resetUploadUrl(); + + + /** + * is image + * @param {String} url of a file + * @return {Boolean} file is a image or not + */ + this.isImage = function(url) { + url = url.split(/[?#]/)[0]; + return (/\.(png|jpg|jpeg|gif|bmp)$/i).test(url); + }; + + /** + * get file extension + * @param {String} filename + * @return {String} file extension + * @example + * input: test.txt + * output: txt + */ + this.getFileExtension = function(filename) { + var tempArr = filename.split("."); + var ext; + if (tempArr.length === 1 || (tempArr[0] === "" && tempArr.length === 2)) { + ext = ""; + } else { + ext = tempArr.pop().toLowerCase(); //get the extension and make it lower-case + } + return ext; + }; + + /** + * encode string by utf8 + * @param {String} string to encode + * @return {String} encoded string + */ + this.utf8_encode = function(argString) { + // http://kevin.vanzonneveld.net + // + original by: Webtoolkit.info (http://www.webtoolkit.info/) + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + improved by: sowberry + // + tweaked by: Jack + // + bugfixed by: Onno Marsman + // + improved by: Yves Sucaet + // + bugfixed by: Onno Marsman + // + bugfixed by: Ulrich + // + bugfixed by: Rafal Kukawski + // + improved by: kirilloid + // + bugfixed by: kirilloid + // * example 1: this.utf8_encode('Kevin van Zonneveld'); + // * returns 1: 'Kevin van Zonneveld' + + if (argString === null || typeof argString === 'undefined') { + return ''; + } + + var string = (argString + ''); // .replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + var utftext = '', + start, end, stringl = 0; + + start = end = 0; + stringl = string.length; + for (var n = 0; n < stringl; n++) { + var c1 = string.charCodeAt(n); + var enc = null; + + if (c1 < 128) { + end++; + } else if (c1 > 127 && c1 < 2048) { + enc = String.fromCharCode( + (c1 >> 6) | 192, (c1 & 63) | 128 + ); + } else if (c1 & 0xF800 ^ 0xD800 > 0) { + enc = String.fromCharCode( + (c1 >> 12) | 224, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128 + ); + } else { // surrogate pairs + if (c1 & 0xFC00 ^ 0xD800 > 0) { + throw new RangeError('Unmatched trail surrogate at ' + n); + } + var c2 = string.charCodeAt(++n); + if (c2 & 0xFC00 ^ 0xDC00 > 0) { + throw new RangeError('Unmatched lead surrogate at ' + (n - 1)); + } + c1 = ((c1 & 0x3FF) << 10) + (c2 & 0x3FF) + 0x10000; + enc = String.fromCharCode( + (c1 >> 18) | 240, ((c1 >> 12) & 63) | 128, ((c1 >> 6) & 63) | 128, (c1 & 63) | 128 + ); + } + if (enc !== null) { + if (end > start) { + utftext += string.slice(start, end); + } + utftext += enc; + start = end = n + 1; + } + } + + if (end > start) { + utftext += string.slice(start, stringl); + } + + return utftext; + }; + + /** + * encode data by base64 + * @param {String} data to encode + * @return {String} encoded data + */ + this.base64_encode = function(data) { + // http://kevin.vanzonneveld.net + // + original by: Tyler Akins (http://rumkin.com) + // + improved by: Bayron Guevara + // + improved by: Thunder.m + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Pellentesque Malesuada + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // - depends on: this.utf8_encode + // * example 1: this.base64_encode('Kevin van Zonneveld'); + // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' + // mozilla has this native + // - but breaks in 2.0.0.12! + //if (typeof this.window['atob'] == 'function') { + // return atob(data); + //} + var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + enc = '', + tmp_arr = []; + + if (!data) { + return data; + } + + data = this.utf8_encode(data + ''); + + do { // pack three octets into four hexets + o1 = data.charCodeAt(i++); + o2 = data.charCodeAt(i++); + o3 = data.charCodeAt(i++); + + bits = o1 << 16 | o2 << 8 | o3; + + h1 = bits >> 18 & 0x3f; + h2 = bits >> 12 & 0x3f; + h3 = bits >> 6 & 0x3f; + h4 = bits & 0x3f; + + // use hexets to index into b64, and append result to encoded string + tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); + } while (i < data.length); + + enc = tmp_arr.join(''); + + switch (data.length % 3) { + case 1: + enc = enc.slice(0, -2) + '=='; + break; + case 2: + enc = enc.slice(0, -1) + '='; + break; + } + + return enc; + }; + + /** + * encode string in url by base64 + * @param {String} string in url + * @return {String} encoded string + */ + this.URLSafeBase64Encode = function(v) { + v = this.base64_encode(v); + return v.replace(/\//g, '_').replace(/\+/g, '-'); + }; + + // TODO: use mOxie + /** + * craete object used to AJAX + * @return {Object} + */ + this.createAjax = function(argument) { + var xmlhttp = {}; + if (window.XMLHttpRequest) { + xmlhttp = new XMLHttpRequest(); + } else { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + return xmlhttp; + }; + + // TODO: enhance IE compatibility + /** + * parse json string to javascript object + * @param {String} json string + * @return {Object} object + */ + this.parseJSON = function(data) { + // Attempt to parse using the native JSON parser first + if (window.JSON && window.JSON.parse) { + return window.JSON.parse(data); + } + + //var rx_one = /^[\],:{}\s]*$/, + // rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + // rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + // rx_four = /(?:^|:|,)(?:\s*\[)+/g, + var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + + //var json; + + var text = String(data); + rx_dangerous.lastIndex = 0; + if(rx_dangerous.test(text)){ + text = text.replace(rx_dangerous, function(a){ + return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + + // todo 浣跨敤涓€涓嬪垽鏂�,澧炲姞瀹夊叏鎬� + //if ( + // rx_one.test( + // text + // .replace(rx_two, '@') + // .replace(rx_three, ']') + // .replace(rx_four, '') + // ) + //) { + // return eval('(' + text + ')'); + //} + + return eval('('+text+')'); + }; + + /** + * parse javascript object to json string + * @param {Object} object + * @return {String} json string + */ + this.stringifyJSON = function(obj) { + // Attempt to parse using the native JSON parser first + if (window.JSON && window.JSON.stringify) { + return window.JSON.stringify(obj); + } + switch (typeof (obj)) { + case 'string': + return '"' + obj.replace(/(["\\])/g, '\\$1') + '"'; + case 'array': + return '[' + obj.map(that.stringifyJSON).join(',') + ']'; + case 'object': + if (obj instanceof Array) { + var strArr = []; + var len = obj.length; + for (var i = 0; i < len; i++) { + strArr.push(that.stringifyJSON(obj[i])); + } + return '[' + strArr.join(',') + ']'; + } else if (obj === null) { + return 'null'; + } else { + var string = []; + for (var property in obj) { + if (obj.hasOwnProperty(property)) { + string.push(that.stringifyJSON(property) + ':' + that.stringifyJSON(obj[property])); + } + } + return '{' + string.join(',') + '}'; + } + break; + case 'number': + return obj; + case false: + return obj; + case 'boolean': + return obj; + } + }; + + /** + * trim space beside text + * @param {String} untrimed string + * @return {String} trimed string + */ + this.trim = function(text) { + return text === null ? "" : text.replace(/^\s+|\s+$/g, ''); + }; + + /** + * create a uploader by QiniuJsSDK + * @param {object} options to create a new uploader + * @return {object} uploader + */ + this.uploader = function(op) { + + /********** inner function define start **********/ + + // according the different condition to reset chunk size + // and the upload strategy according with the chunk size + // when chunk size is zero will cause to direct upload + // see the statement binded on 'BeforeUpload' event + var reset_chunk_size = function() { + var ie = that.detectIEVersion(); + var BLOCK_BITS, MAX_CHUNK_SIZE, chunk_size; + // case Safari 5銆乄indows 7銆乮OS 7 set isSpecialSafari to true + var isSpecialSafari = (mOxie.Env.browser === "Safari" && mOxie.Env.version <= 5 && mOxie.Env.os === "Windows" && mOxie.Env.osVersion === "7") || (mOxie.Env.browser === "Safari" && mOxie.Env.os === "iOS" && mOxie.Env.osVersion === "7"); + // case IE 9-锛宑hunk_size is not empty and flash is included in runtimes + // set op.chunk_size to zero + //if (ie && ie <= 9 && op.chunk_size && op.runtimes.indexOf('flash') >= 0) { + if (ie && ie <= 9 && op.chunk_size && op.runtimes.indexOf('flash') < 0) { + // link: http://www.plupload.com/docs/Frequently-Asked-Questions#when-to-use-chunking-and-when-not + // when plupload chunk_size setting is't null ,it cause bug in ie8/9 which runs flash runtimes (not support html5) . + op.chunk_size = 0; + } else if (isSpecialSafari) { + // win7 safari / iOS7 safari have bug when in chunk upload mode + // reset chunk_size to 0 + // disable chunk in special version safari + op.chunk_size = 0; + } else { + BLOCK_BITS = 20; + MAX_CHUNK_SIZE = 4 << BLOCK_BITS; //4M + + chunk_size = plupload.parseSize(op.chunk_size); + if (chunk_size > MAX_CHUNK_SIZE) { + op.chunk_size = MAX_CHUNK_SIZE; + } + // qiniu service max_chunk_size is 4m + // reset chunk_size to max_chunk_size(4m) when chunk_size > 4m + } + // if op.chunk_size set 0 will be cause to direct upload + }; + + // getUptoken maybe called at Init Event or BeforeUpload Event + // case Init Event, the file param of getUptken will be set null value + // if op.uptoken has value, set uptoken with op.uptoken + // else if op.uptoken_url has value, set uptoken from op.uptoken_url + // else if op.uptoken_func has value, set uptoken by result of op.uptoken_func + var getUpToken = function(file) { + if (op.uptoken) { + that.token = op.uptoken; + return; + } else if (op.uptoken_url) { + logger.debug("get uptoken from: ", that.uptoken_url); + // TODO: use mOxie + var ajax = that.createAjax(); + ajax.open('GET', that.uptoken_url, false); + ajax.setRequestHeader("If-Modified-Since", "0"); + // ajax.onreadystatechange = function() { + // if (ajax.readyState === 4 && ajax.status === 200) { + // var res = that.parseJSON(ajax.responseText); + // that.token = res.uptoken; + // } + // }; + ajax.send(); + if (ajax.status === 200) { + var res = that.parseJSON(ajax.responseText); + that.token = res.uptoken; + logger.debug("get new uptoken: ", res.uptoken); + } else { + logger.error("get uptoken error: ", ajax.responseText); + } + return; + } else if (op.uptoken_func) { + logger.debug("get uptoken from uptoken_func"); + that.token = op.uptoken_func(file); + logger.debug("get new uptoken: ", that.token); + return; + } else { + logger.error("one of [uptoken, uptoken_url, uptoken_func] settings in options is required!"); + } + }; + + // get file key according with the user passed options + var getFileKey = function(up, file, func) { + // TODO: save_key can read from scope of token + var key = '', + unique_names = false; + if (!op.save_key) { + unique_names = up.getOption && up.getOption('unique_names'); + unique_names = unique_names || (up.settings && up.settings.unique_names); + if (unique_names) { + var ext = that.getFileExtension(file.name); + key = ext ? file.id + '.' + ext : file.id; + } else if (typeof func === 'function') { + key = func(up, file); + } else { + key = file.name; + } + } + return key; + }; + + /********** inner function define end **********/ + + if (op.log_level) { + logger.level = op.log_level; + } + + if (!op.domain) { + throw 'domain setting in options is required!'; + } + + if (!op.browse_button) { + throw 'browse_button setting in options is required!'; + } + + if (!op.uptoken && !op.uptoken_url && !op.uptoken_func) { + throw 'one of [uptoken, uptoken_url, uptoken_func] settings in options is required!'; + } + + logger.debug("init uploader start"); + + logger.debug("environment: ", mOxie.Env); + + logger.debug("userAgent: ", navigator.userAgent); + + var option = {}; + + // hold the handler from user passed options + var _Error_Handler = op.init && op.init.Error; + var _FileUploaded_Handler = op.init && op.init.FileUploaded; + + // replace the handler for intercept + op.init.Error = function() {}; + op.init.FileUploaded = function() {}; + + that.uptoken_url = op.uptoken_url; + that.token = ''; + that.key_handler = typeof op.init.Key === 'function' ? op.init.Key : ''; + this.domain = op.domain; + // TODO: ctx is global in scope of a uploader instance + // this maybe cause error + var ctx = ''; + var speedCalInfo = { + isResumeUpload: false, + resumeFilesize: 0, + startTime: '', + currentTime: '' + }; + + reset_chunk_size(); + logger.debug("invoke reset_chunk_size()"); + logger.debug("op.chunk_size: ", op.chunk_size); + + // compose options with user passed options and default setting + plupload.extend(option, op, { + url: qiniuUploadUrl, + multipart_params: { + token: '' + } + }); + + logger.debug("option: ", option); + + // create a new uploader with composed options + var uploader = new plupload.Uploader(option); + + logger.debug("new plupload.Uploader(option)"); + + // bind getUpToken to 'Init' event + uploader.bind('Init', function(up, params) { + logger.debug("Init event activated"); + // if op.get_new_uptoken is not true + // invoke getUptoken when uploader init + // else + // getUptoken everytime before a new file upload + if(!op.get_new_uptoken){ + getUpToken(null); + } + //getUpToken(null); + }); + + logger.debug("bind Init event"); + + // bind 'FilesAdded' event + // when file be added and auto_start has set value + // uploader will auto start upload the file + uploader.bind('FilesAdded', function(up, files) { + logger.debug("FilesAdded event activated"); + var auto_start = up.getOption && up.getOption('auto_start'); + auto_start = auto_start || (up.settings && up.settings.auto_start); + logger.debug("auto_start: ", auto_start); + logger.debug("files: ", files); + if (auto_start) { + setTimeout(function(){ + up.start(); + logger.debug("invoke up.start()"); + }, 0); + // up.start(); + // plupload.each(files, function(i, file) { + // up.start(); + // logger.debug("invoke up.start()") + // logger.debug("file: ", file); + // }); + } + up.refresh(); // Reposition Flash/Silverlight + }); + + logger.debug("bind FilesAdded event"); + + // bind 'BeforeUpload' event + // intercept the process of upload + // - prepare uptoken + // - according the chunk size to make differnt upload strategy + // - resume upload with the last breakpoint of file + uploader.bind('BeforeUpload', function(up, file) { + logger.debug("BeforeUpload event activated"); + // add a key named speed for file object + file.speed = file.speed || 0; + ctx = ''; + + if(op.get_new_uptoken){ + getUpToken(file); + } + + var directUpload = function(up, file, func) { + speedCalInfo.startTime = new Date().getTime(); + var multipart_params_obj; + if (op.save_key) { + multipart_params_obj = { + 'token': that.token + }; + } else { + multipart_params_obj = { + 'key': getFileKey(up, file, func), + 'token': that.token + }; + } + + logger.debug("directUpload multipart_params_obj: ", multipart_params_obj); + + var x_vars = op.x_vars; + if (x_vars !== undefined && typeof x_vars === 'object') { + for (var x_key in x_vars) { + if (x_vars.hasOwnProperty(x_key)) { + if (typeof x_vars[x_key] === 'function') { + multipart_params_obj['x:' + x_key] = x_vars[x_key](up, file); + } else if (typeof x_vars[x_key] !== 'object') { + multipart_params_obj['x:' + x_key] = x_vars[x_key]; + } + } + } + } + + + up.setOption({ + 'url': qiniuUploadUrl, + 'multipart': true, + 'chunk_size': is_android_weixin_or_qq() ? op.max_file_size : undefined, + 'multipart_params': multipart_params_obj + }); + }; + + // detect is weixin or qq inner browser + var is_android_weixin_or_qq = function (){ + var ua = navigator.userAgent.toLowerCase(); + if((ua.match(/MicroMessenger/i) || mOxie.Env.browser === "QQBrowser" || ua.match(/V1_AND_SQ/i)) && mOxie.Env.OS.toLowerCase()==="android") { + return true; + } else { + return false; + } + }; + + var chunk_size = up.getOption && up.getOption('chunk_size'); + chunk_size = chunk_size || (up.settings && up.settings.chunk_size); + + logger.debug("uploader.runtime: ",uploader.runtime); + logger.debug("chunk_size: ",chunk_size); + + // TODO: flash support chunk upload + if ((uploader.runtime === 'html5' || uploader.runtime === 'flash') && chunk_size) { + if (file.size < chunk_size || is_android_weixin_or_qq()) { + logger.debug("directUpload because file.size < chunk_size || is_android_weixin_or_qq()"); + // direct upload if file size is less then the chunk size + directUpload(up, file, that.key_handler); + } else { + // TODO: need a polifill to make it work in IE 9- + // ISSUE: if file.name is existed in localStorage + // but not the same file maybe cause error + var localFileInfo = localStorage.getItem(file.name); + var blockSize = chunk_size; + if (localFileInfo) { + // TODO: although only the html5 runtime will enter this statement + // but need uniform way to make convertion between string and json + localFileInfo = that.parseJSON(localFileInfo); + var now = (new Date()).getTime(); + var before = localFileInfo.time || 0; + var aDay = 24 * 60 * 60 * 1000; // milliseconds of one day + // if the last upload time is within one day + // will upload continuously follow the last breakpoint + // else + // will reupload entire file + if (now - before < aDay) { + + if (localFileInfo.percent !== 100) { + if (file.size === localFileInfo.total) { + // TODO: if file.name and file.size is the same + // but not the same file will cause error + file.percent = localFileInfo.percent; + file.loaded = localFileInfo.offset; + ctx = localFileInfo.ctx; + + // set speed info + speedCalInfo.isResumeUpload = true; + speedCalInfo.resumeFilesize = localFileInfo.offset; + + // set block size + if (localFileInfo.offset + blockSize > file.size) { + blockSize = file.size - localFileInfo.offset; + } + } else { + // remove file info when file.size is conflict with file info + localStorage.removeItem(file.name); + } + + } else { + // remove file info when upload percent is 100% + // avoid 499 bug + localStorage.removeItem(file.name); + } + } else { + // remove file info when last upload time is over one day + localStorage.removeItem(file.name); + } + } + speedCalInfo.startTime = new Date().getTime(); + // TODO: to support bput + // http://developer.qiniu.com/docs/v6/api/reference/up/bput.html + up.setOption({ + 'url': qiniuUploadUrl + '/mkblk/' + blockSize, + 'multipart': false, + 'chunk_size': chunk_size, + 'required_features': "chunks", + 'headers': { + 'Authorization': 'UpToken ' + that.token + }, + 'multipart_params': {} + }); + } + } else { + logger.debug("directUpload because uploader.runtime !== 'html5' || uploader.runtime !== 'flash' || !chunk_size"); + // direct upload if runtime is not html5 + directUpload(up, file, that.key_handler); + } + }); + + logger.debug("bind BeforeUpload event"); + + // bind 'UploadProgress' event + // calculate upload speed + uploader.bind('UploadProgress', function(up, file) { + logger.trace("UploadProgress event activated"); + speedCalInfo.currentTime = new Date().getTime(); + var timeUsed = speedCalInfo.currentTime - speedCalInfo.startTime; // ms + var fileUploaded = file.loaded || 0; + if (speedCalInfo.isResumeUpload) { + fileUploaded = file.loaded - speedCalInfo.resumeFilesize; + } + file.speed = (fileUploaded / timeUsed * 1000).toFixed(0) || 0; // unit: byte/s + }); + + logger.debug("bind UploadProgress event"); + + // bind 'ChunkUploaded' event + // store the chunk upload info and set next chunk upload url + uploader.bind('ChunkUploaded', function(up, file, info) { + logger.debug("ChunkUploaded event activated"); + logger.debug("file: ", file); + logger.debug("info: ", info); + var res = that.parseJSON(info.response); + logger.debug("res: ", res); + // ctx should look like '[chunk01_ctx],[chunk02_ctx],[chunk03_ctx],...' + ctx = ctx ? ctx + ',' + res.ctx : res.ctx; + var leftSize = info.total - info.offset; + var chunk_size = up.getOption && up.getOption('chunk_size'); + chunk_size = chunk_size || (up.settings && up.settings.chunk_size); + if (leftSize < chunk_size) { + up.setOption({ + 'url': qiniuUploadUrl + '/mkblk/' + leftSize + }); + logger.debug("up.setOption url: ", qiniuUploadUrl + '/mkblk/' + leftSize); + } + localStorage.setItem(file.name, that.stringifyJSON({ + ctx: ctx, + percent: file.percent, + total: info.total, + offset: info.offset, + time: (new Date()).getTime() + })); + }); + + logger.debug("bind ChunkUploaded event"); + + var retries = qiniuUploadUrls.length; + + // if error is unkown switch upload url and retry + var unknow_error_retry = function(file){ + if (retries-- > 0) { + setTimeout(function(){ + that.resetUploadUrl(); + file.status = plupload.QUEUED; + uploader.stop(); + uploader.start(); + }, 0); + return true; + }else{ + retries = qiniuUploadUrls.length; + return false; + } + }; + + // bind 'Error' event + // check the err.code and return the errTip + uploader.bind('Error', (function(_Error_Handler) { + return function(up, err) { + logger.error("Error event activated"); + logger.error("err: ", err); + var errTip = ''; + var file = err.file; + if (file) { + switch (err.code) { + case plupload.FAILED: + errTip = '涓婁紶澶辫触銆傝绋嶅悗鍐嶈瘯銆�'; + break; + case plupload.FILE_SIZE_ERROR: + var max_file_size = up.getOption && up.getOption('max_file_size'); + max_file_size = max_file_size || (up.settings && up.settings.max_file_size); + errTip = '娴忚鍣ㄦ渶澶у彲涓婁紶' + max_file_size + '銆傛洿澶ф枃浠惰浣跨敤鍛戒护琛屽伐鍏枫€�'; + break; + case plupload.FILE_EXTENSION_ERROR: + errTip = '鏂囦欢楠岃瘉澶辫触銆傝绋嶅悗閲嶈瘯銆�'; + break; + case plupload.HTTP_ERROR: + if (err.response === '') { + // Fix parseJSON error ,when http error is like net::ERR_ADDRESS_UNREACHABLE + errTip = err.message || '鏈煡缃戠粶閿欒銆�'; + if (!unknow_error_retry(file)) { + return; + } + break; + } + var errorObj = that.parseJSON(err.response); + var errorText = errorObj.error; + switch (err.status) { + case 400: + errTip = "璇锋眰鎶ユ枃鏍煎紡閿欒銆�"; + break; + case 401: + errTip = "瀹㈡埛绔璇佹巿鏉冨け璐ャ€傝閲嶈瘯鎴栨彁浜ゅ弽棣堛€�"; + break; + case 405: + errTip = "瀹㈡埛绔姹傞敊璇€傝閲嶈瘯鎴栨彁浜ゅ弽棣堛€�"; + break; + case 579: + errTip = "璧勬簮涓婁紶鎴愬姛锛屼絾鍥炶皟澶辫触銆�"; + break; + case 599: + errTip = "缃戠粶杩炴帴寮傚父銆傝閲嶈瘯鎴栨彁浜ゅ弽棣堛€�"; + if (!unknow_error_retry(file)) { + return; + } + break; + case 614: + errTip = "鏂囦欢宸插瓨鍦ㄣ€�"; + try { + errorObj = that.parseJSON(errorObj.error); + errorText = errorObj.error || 'file exists'; + } catch (e) { + errorText = errorObj.error || 'file exists'; + } + break; + case 631: + errTip = "鎸囧畾绌洪棿涓嶅瓨鍦ㄣ€�"; + break; + case 701: + errTip = "涓婁紶鏁版嵁鍧楁牎楠屽嚭閿欍€傝閲嶈瘯鎴栨彁浜ゅ弽棣堛€�"; + break; + default: + errTip = "鏈煡閿欒銆�"; + if (!unknow_error_retry(file)) { + return; + } + break; + } + errTip = errTip + '(' + err.status + '锛�' + errorText + ')'; + break; + case plupload.SECURITY_ERROR: + errTip = '瀹夊叏閰嶇疆閿欒銆傝鑱旂郴缃戠珯绠$悊鍛樸€�'; + break; + case plupload.GENERIC_ERROR: + errTip = '涓婁紶澶辫触銆傝绋嶅悗鍐嶈瘯銆�'; + break; + case plupload.IO_ERROR: + errTip = '涓婁紶澶辫触銆傝绋嶅悗鍐嶈瘯銆�'; + break; + case plupload.INIT_ERROR: + errTip = '缃戠珯閰嶇疆閿欒銆傝鑱旂郴缃戠珯绠$悊鍛樸€�'; + uploader.destroy(); + break; + default: + errTip = err.message + err.details; + if (!unknow_error_retry(file)) { + return; + } + break; + } + if (_Error_Handler) { + _Error_Handler(up, err, errTip); + } + } + up.refresh(); // Reposition Flash/Silverlight + }; + })(_Error_Handler)); + + logger.debug("bind Error event"); + + // bind 'FileUploaded' event + // intercept the complete of upload + // - get downtoken from downtoken_url if bucket is private + // - invoke mkfile api to compose chunks if upload strategy is chunk upload + uploader.bind('FileUploaded', (function(_FileUploaded_Handler) { + return function(up, file, info) { + logger.debug("FileUploaded event activated"); + logger.debug("file: ", file); + logger.debug("info: ", info); + var last_step = function(up, file, info) { + if (op.downtoken_url) { + // if op.dowontoken_url is not empty + // need get downtoken before invoke the _FileUploaded_Handler + var ajax_downtoken = that.createAjax(); + ajax_downtoken.open('POST', op.downtoken_url, true); + ajax_downtoken.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + ajax_downtoken.onreadystatechange = function() { + if (ajax_downtoken.readyState === 4) { + if (ajax_downtoken.status === 200) { + var res_downtoken; + try { + res_downtoken = that.parseJSON(ajax_downtoken.responseText); + } catch (e) { + throw ('invalid json format'); + } + var info_extended = {}; + plupload.extend(info_extended, that.parseJSON(info), res_downtoken); + if (_FileUploaded_Handler) { + _FileUploaded_Handler(up, file, that.stringifyJSON(info_extended)); + } + } else { + uploader.trigger('Error', { + status: ajax_downtoken.status, + response: ajax_downtoken.responseText, + file: file, + code: plupload.HTTP_ERROR + }); + } + } + }; + ajax_downtoken.send('key=' + that.parseJSON(info).key + '&domain=' + op.domain); + } else if (_FileUploaded_Handler) { + _FileUploaded_Handler(up, file, info); + } + }; + + var res = that.parseJSON(info.response); + ctx = ctx ? ctx : res.ctx; + // if ctx is not empty + // that means the upload strategy is chunk upload + // befroe the invoke the last_step + // we need request the mkfile to compose all uploaded chunks + // else + // invalke the last_step + logger.debug("ctx: ", ctx); + if (ctx) { + var key = ''; + logger.debug("save_key: ", op.save_key); + if (!op.save_key) { + key = getFileKey(up, file, that.key_handler); + key = key ? '/key/' + that.URLSafeBase64Encode(key) : ''; + } + + var fname = '/fname/' + that.URLSafeBase64Encode(file.name); + + logger.debug("op.x_vars: ", op.x_vars); + var x_vars = op.x_vars, + x_val = '', + x_vars_url = ''; + if (x_vars !== undefined && typeof x_vars === 'object') { + for (var x_key in x_vars) { + if (x_vars.hasOwnProperty(x_key)) { + if (typeof x_vars[x_key] === 'function') { + x_val = that.URLSafeBase64Encode(x_vars[x_key](up, file)); + } else if (typeof x_vars[x_key] !== 'object') { + x_val = that.URLSafeBase64Encode(x_vars[x_key]); + } + x_vars_url += '/x:' + x_key + '/' + x_val; + } + } + } + + var url = qiniuUploadUrl + '/mkfile/' + file.size + key + fname + x_vars_url; + + var ie = that.detectIEVersion(); + var ajax; + if (ie && ie <= 9) { + ajax = new mOxie.XMLHttpRequest(); + mOxie.Env.swf_url = op.flash_swf_url; + }else{ + ajax = that.createAjax(); + } + ajax.open('POST', url, true); + ajax.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8'); + ajax.setRequestHeader('Authorization', 'UpToken ' + that.token); + var onreadystatechange = function(){ + logger.debug("ajax.readyState: ", ajax.readyState); + if (ajax.readyState === 4) { + localStorage.removeItem(file.name); + var info; + if (ajax.status === 200) { + info = ajax.responseText; + logger.debug("mkfile is success: ", info); + last_step(up, file, info); + } else { + info = { + status: ajax.status, + response: ajax.responseText, + file: file, + code: -200 + }; + logger.debug("mkfile is error: ", info); + uploader.trigger('Error', info); + } + } + }; + if (ie && ie <= 9) { + ajax.bind('readystatechange', onreadystatechange); + }else{ + ajax.onreadystatechange = onreadystatechange; + } + ajax.send(ctx); + logger.debug("mkfile: ", url); + } else { + last_step(up, file, info.response); + } + + }; + })(_FileUploaded_Handler)); + + logger.debug("bind FileUploaded event"); + + // init uploader + uploader.init(); + + logger.debug("invoke uploader.init()"); + + logger.debug("init uploader end"); + + return uploader; + }; + + /** + * get url by key + * @param {String} key of file + * @return {String} url of file + */ + this.getUrl = function(key) { + if (!key) { + return false; + } + key = encodeURI(key); + var domain = this.domain; + if (domain.slice(domain.length - 1) !== '/') { + domain = domain + '/'; + } + return domain + key; + }; + + /** + * invoke the imageView2 api of Qiniu + * @param {Object} api params + * @param {String} key of file + * @return {String} url of processed image + */ + this.imageView2 = function(op, key) { + var mode = op.mode || '', + w = op.w || '', + h = op.h || '', + q = op.q || '', + format = op.format || ''; + if (!mode) { + return false; + } + if (!w && !h) { + return false; + } + + var imageUrl = 'imageView2/' + mode; + imageUrl += w ? '/w/' + w : ''; + imageUrl += h ? '/h/' + h : ''; + imageUrl += q ? '/q/' + q : ''; + imageUrl += format ? '/format/' + format : ''; + if (key) { + imageUrl = this.getUrl(key) + '?' + imageUrl; + } + return imageUrl; + }; + + /** + * invoke the imageMogr2 api of Qiniu + * @param {Object} api params + * @param {String} key of file + * @return {String} url of processed image + */ + this.imageMogr2 = function(op, key) { + var auto_orient = op['auto-orient'] || '', + thumbnail = op.thumbnail || '', + strip = op.strip || '', + gravity = op.gravity || '', + crop = op.crop || '', + quality = op.quality || '', + rotate = op.rotate || '', + format = op.format || '', + blur = op.blur || ''; + //Todo check option + + var imageUrl = 'imageMogr2'; + + imageUrl += auto_orient ? '/auto-orient' : ''; + imageUrl += thumbnail ? '/thumbnail/' + thumbnail : ''; + imageUrl += strip ? '/strip' : ''; + imageUrl += gravity ? '/gravity/' + gravity : ''; + imageUrl += quality ? '/quality/' + quality : ''; + imageUrl += crop ? '/crop/' + crop : ''; + imageUrl += rotate ? '/rotate/' + rotate : ''; + imageUrl += format ? '/format/' + format : ''; + imageUrl += blur ? '/blur/' + blur : ''; + + if (key) { + imageUrl = this.getUrl(key) + '?' + imageUrl; + } + return imageUrl; + }; + + /** + * invoke the watermark api of Qiniu + * @param {Object} api params + * @param {String} key of file + * @return {String} url of processed image + */ + this.watermark = function(op, key) { + var mode = op.mode; + if (!mode) { + return false; + } + + var imageUrl = 'watermark/' + mode; + + if (mode === 1) { + var image = op.image || ''; + if (!image) { + return false; + } + imageUrl += image ? '/image/' + this.URLSafeBase64Encode(image) : ''; + } else if (mode === 2) { + var text = op.text ? op.text : '', + font = op.font ? op.font : '', + fontsize = op.fontsize ? op.fontsize : '', + fill = op.fill ? op.fill : ''; + if (!text) { + return false; + } + imageUrl += text ? '/text/' + this.URLSafeBase64Encode(text) : ''; + imageUrl += font ? '/font/' + this.URLSafeBase64Encode(font) : ''; + imageUrl += fontsize ? '/fontsize/' + fontsize : ''; + imageUrl += fill ? '/fill/' + this.URLSafeBase64Encode(fill) : ''; + } else { + // Todo mode3 + return false; + } + + var dissolve = op.dissolve || '', + gravity = op.gravity || '', + dx = op.dx || '', + dy = op.dy || ''; + + imageUrl += dissolve ? '/dissolve/' + dissolve : ''; + imageUrl += gravity ? '/gravity/' + gravity : ''; + imageUrl += dx ? '/dx/' + dx : ''; + imageUrl += dy ? '/dy/' + dy : ''; + + if (key) { + imageUrl = this.getUrl(key) + '?' + imageUrl; + } + return imageUrl; + }; + + /** + * invoke the imageInfo api of Qiniu + * @param {String} key of file + * @return {Object} image info + */ + this.imageInfo = function(key) { + if (!key) { + return false; + } + var url = this.getUrl(key) + '?imageInfo'; + var xhr = this.createAjax(); + var info; + var that = this; + xhr.open('GET', url, false); + xhr.onreadystatechange = function() { + if (xhr.readyState === 4 && xhr.status === 200) { + info = that.parseJSON(xhr.responseText); + } + }; + xhr.send(); + return info; + }; + + /** + * invoke the exif api of Qiniu + * @param {String} key of file + * @return {Object} image exif + */ + this.exif = function(key) { + if (!key) { + return false; + } + var url = this.getUrl(key) + '?exif'; + var xhr = this.createAjax(); + var info; + var that = this; + xhr.open('GET', url, false); + xhr.onreadystatechange = function() { + if (xhr.readyState === 4 && xhr.status === 200) { + info = that.parseJSON(xhr.responseText); + } + }; + xhr.send(); + return info; + }; + + /** + * invoke the exif or imageInfo api of Qiniu + * according with type param + * @param {String} ['exif'|'imageInfo']type of info + * @param {String} key of file + * @return {Object} image exif or info + */ + this.get = function(type, key) { + if (!key || !type) { + return false; + } + if (type === 'exif') { + return this.exif(key); + } else if (type === 'imageInfo') { + return this.imageInfo(key); + } + return false; + }; + + /** + * invoke api of Qiniu like a pipeline + * @param {Array of Object} params of a series api call + * each object in array is options of api which name is set as 'fop' property + * each api's output will be next api's input + * @param {String} key of file + * @return {String|Boolean} url of processed image + */ + this.pipeline = function(arr, key) { + var isArray = Object.prototype.toString.call(arr) === '[object Array]'; + var option, errOp, imageUrl = ''; + if (isArray) { + for (var i = 0, len = arr.length; i < len; i++) { + option = arr[i]; + if (!option.fop) { + return false; + } + switch (option.fop) { + case 'watermark': + imageUrl += this.watermark(option) + '|'; + break; + case 'imageView2': + imageUrl += this.imageView2(option) + '|'; + break; + case 'imageMogr2': + imageUrl += this.imageMogr2(option) + '|'; + break; + default: + errOp = true; + break; + } + if (errOp) { + return false; + } + } + if (key) { + imageUrl = this.getUrl(key) + '?' + imageUrl; + var length = imageUrl.length; + if (imageUrl.slice(length - 1) === '|') { + imageUrl = imageUrl.slice(0, length - 1); + } + } + return imageUrl; + } + return false; + }; +} + +var Qiniu = new QiniuJsSDK(); + +global.Qiniu = Qiniu; + +global.QiniuJsSDK = QiniuJsSDK; + +})( window ); \ No newline at end of file diff --git a/lib/wangEditor/wangEditor.min.js b/lib/wangEditor/wangEditor.min.js new file mode 100644 index 0000000..dd2ede2 --- /dev/null +++ b/lib/wangEditor/wangEditor.min.js @@ -0,0 +1,4 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.wangEditor=t()}(this,function(){"use strict";function e(e){var t=void 0;return t=document.createElement("div"),t.innerHTML=e,t.children}function t(e){return!!e&&(e instanceof HTMLCollection||e instanceof NodeList)}function n(e){var n=document.querySelectorAll(e);return t(n)?n:[n]}function i(o){if(o){if(o instanceof i)return o;this.selector=o;var A=o.nodeType,r=[];9===A?r=[o]:1===A?r=[o]:t(o)||o instanceof Array?r=o:"string"==typeof o&&(o=o.replace("/\n/mg","").trim(),r=0===o.indexOf("<")?e(o):n(o));var c=r.length;if(!c)return this;var a=void 0;for(a=0;a/gm,">").replace(/"/gm,""").replace(/(\r\n|\r|\n)/g,"
          ")}function s(e){return"function"==typeof e}function l(e){this.editor=e,this.$elem=o('
          \n \n
          '),this.type="click",this._active=!1}function d(e,t){var n=this,i=e.editor;this.menu=e,this.opt=t;var A=o('
          '),r=t.$title,c=void 0;r&&(c=r.html(),c=O(i,c),r.html(c),r.addClass("w-e-dp-title"),A.append(r));var a=t.list||[],s=t.type||"list",l=t.onClick||$,d=o('
            ');A.append(d),a.forEach(function(e){var t=e.$elem,A=t.html();A=O(i,A),t.html(A);var r=e.value,c=o('
          • ');t&&(c.append(t),d.append(c),c.on("click",function(e){l(r),n.hideTimeoutId=setTimeout(function(){n.hide()},0)}))}),A.on("mouseleave",function(e){n.hideTimeoutId=setTimeout(function(){n.hide()},0)}),this.$container=A,this._rendered=!1,this._show=!1}function u(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:100,$title:o("

            设置标题

            "),type:"list",list:[{$elem:o("

            H1

            "),value:"

            "},{$elem:o("

            H2

            "),value:"

            "},{$elem:o("

            H3

            "),value:"

            "},{$elem:o("

            H4

            "),value:"

            "},{$elem:o("

            H5
            "),value:"
            "},{$elem:o("

            正文

            "),value:"

            "}],onClick:function(e){t._command(e)}})}function h(e){var t=this;this.editor=e,this.$elem=o('

            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:160,$title:o("

            字号

            "),type:"list",list:[{$elem:o('x-small'),value:"1"},{$elem:o('small'),value:"2"},{$elem:o("normal"),value:"3"},{$elem:o('large'),value:"4"},{$elem:o('x-large'),value:"5"},{$elem:o('xx-large'),value:"6"}],onClick:function(e){t._command(e)}})}function p(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1;var n=e.config,i=n.fontNames||[];this.droplist=new d(this,{width:100,$title:o("

            字体

            "),type:"list",list:i.map(function(e){return{$elem:o(''+e+""),value:e}}),onClick:function(e){t._command(e)}})}function f(e,t){this.menu=e,this.opt=t}function m(e){this.editor=e,this.$elem=o('
            '),this.type="panel",this._active=!1}function g(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function w(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function v(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function E(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function b(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function B(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:120,$title:o("

            设置列表

            "),type:"list",list:[{$elem:o(' 有序列表'),value:"insertOrderedList"},{$elem:o(' 无序列表'),value:"insertUnorderedList"}],onClick:function(e){t._command(e)}})}function y(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist",this._active=!1,this.droplist=new d(this,{width:100,$title:o("

            对齐方式

            "),type:"list",list:[{$elem:o(' 靠左'),value:"justifyLeft"},{$elem:o(' 居中'),value:"justifyCenter"},{$elem:o(' 靠右'),value:"justifyRight"}],onClick:function(e){t._command(e)}})}function C(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist";var n=e.config,i=n.colors||[];this._active=!1,this.droplist=new d(this,{width:120,$title:o("

            文字颜色

            "),type:"inline-block",list:i.map(function(e){return{$elem:o(''),value:e}}),onClick:function(e){t._command(e)}})}function x(e){var t=this;this.editor=e,this.$elem=o('
            '),this.type="droplist";var n=e.config,i=n.colors||[];this._active=!1,this.droplist=new d(this,{width:120,$title:o("

            背景色

            "),type:"inline-block",list:i.map(function(e){return{$elem:o(''),value:e}}),onClick:function(e){t._command(e)}})}function I(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="click",this._active=!1}function Q(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="panel",this._active=!1}function M(e){this.editor=e,this.$elem=o('
            \n \n
            '),this.type="panel",this._active=!1}function S(e){this.editor=e,this.$elem=o('
            '),this.type="panel",this._active=!1}function k(e){this.editor=e,this.$elem=o('
            '),this.type="panel",this._active=!1}function D(e){this.editor=e;var t=c("w-e-img");this.$elem=o('
            '),e.imgMenuId=t,this.type="panel",this._active=!1}function _(e){this.editor=e,this.menus={}}function N(e){var t=e.clipboardData||e.originalEvent&&e.originalEvent.clipboardData,n=void 0;return n=null==t?window.clipboardData&&window.clipboardData.getData("text"):t.getData("text/plain"),a(n)}function F(e,t,n){var i=e.clipboardData||e.originalEvent&&e.originalEvent.clipboardData,o=void 0,A=void 0;if(null==i?o=window.clipboardData&&window.clipboardData.getData("text"):(o=i.getData("text/plain"),A=i.getData("text/html")),!A&&o&&(A="

            "+a(o)+"

            "),A){var r=A.split("");return 2===r.length&&(A=r[0]),A=A.replace(/<(meta|script|link).+?>/gim,""),A=A.replace(//gm,""),A=A.replace(/\s?data-.+?=('|").+?('|")/gim,""),n&&(A=A.replace(//gim,"")),A=t?A.replace(/\s?(class|style)=('|").*?('|")/gim,""):A.replace(/\s?class=('|").*?('|")/gim,"")}}function T(e){var t=[];if(N(e))return t;var n=e.clipboardData||e.originalEvent&&e.originalEvent.clipboardData||{},i=n.items;return i?(A(i,function(e,n){var i=n.type;/image/i.test(i)&&t.push(n.getAsFile())}),t):t}function R(e){var t=[];return(e.childNodes()||[]).forEach(function(e){var n=void 0,i=e.nodeType;if(3===i&&(n=e.textContent,n=a(n)),1===i){n={},n.tag=e.nodeName.toLowerCase();for(var A=[],r=e.attributes||{},c=r.length||0,s=0;s
            ')}function L(e){this.editor=e}function j(e,t){if(null==e)throw new Error("错误:初始化编辑器时候未传入任何参数,请查阅文档");this.id="wangEditor-"+W++,this.toolbarSelector=e,this.textSelector=t,this.customConfig={}}var G=[];i.prototype={constructor:i,forEach:function(e){var t=void 0;for(t=0;t=t&&(e%=t),o(this[e])},first:function(){return this.get(0)},last:function(){var e=this.length;return this.get(e-1)},on:function(e,t,n){n||(n=t,t=null);var i=[];return i=e.split(/\s+/),this.forEach(function(e){i.forEach(function(i){if(i){if(G.push({elem:e,type:i,fn:n}),!t)return void e.addEventListener(i,n);e.addEventListener(i,function(e){var i=e.target;i.matches(t)&&n.call(i,e)})}})})},off:function(e,t){return this.forEach(function(n){n.removeEventListener(e,t)})},attr:function(e,t){return null==t?this[0].getAttribute(e):this.forEach(function(n){n.setAttribute(e,t)})},addClass:function(e){return e?this.forEach(function(t){var n=void 0;t.className?(n=t.className.split(/\s/),n=n.filter(function(e){return!!e.trim()}),n.indexOf(e)<0&&n.push(e),t.className=n.join(" ")):t.className=e}):this},removeClass:function(e){return e?this.forEach(function(t){var n=void 0;t.className&&(n=t.className.split(/\s/),n=n.filter(function(t){return!(!(t=t.trim())||t===e)}),t.className=n.join(" "))}):this},css:function(e,t){var n=e+":"+t+";";return this.forEach(function(t){var i=(t.getAttribute("style")||"").trim(),o=void 0,A=[];i?(o=i.split(";"),o.forEach(function(e){var t=e.split(":").map(function(e){return e.trim()});2===t.length&&A.push(t[0]+":"+t[1])}),A=A.map(function(t){return 0===t.indexOf(e)?n:t}),A.indexOf(n)<0&&A.push(n),t.setAttribute("style",A.join("; "))):t.setAttribute("style",n)})},show:function(){return this.css("display","block")},hide:function(){return this.css("display","none")},children:function(){var e=this[0];return e?o(e.children):null},childNodes:function(){var e=this[0];return e?o(e.childNodes):null},append:function(e){return this.forEach(function(t){e.forEach(function(e){t.appendChild(e)})})},remove:function(){return this.forEach(function(e){if(e.remove)e.remove();else{var t=e.parentElement;t&&t.removeChild(e)}})},isContain:function(e){var t=this[0],n=e[0];return t.contains(n)},getSizeData:function(){return this[0].getBoundingClientRect()},getNodeName:function(){return this[0].nodeName},find:function(e){return o(this[0].querySelectorAll(e))},text:function(e){return e?this.forEach(function(t){t.innerHTML=e}):this[0].innerHTML.replace(/<.*?>/g,function(){return""})},html:function(e){var t=this[0];return null==e?t.innerHTML:(t.innerHTML=e,this)},val:function(){return this[0].value.trim()},focus:function(){return this.forEach(function(e){e.focus()})},parent:function(){return o(this[0].parentElement)},parentUntil:function(e,t){var n=document.querySelectorAll(e),i=n.length;if(!i)return null;var A=t||this[0];if("BODY"===A.nodeName)return null;var r=A.parentElement,c=void 0;for(c=0;c=0)){var n=t.editor,i=o("body"),A=n.$textContainerElem,r=this.opt,c=o('
            '),a=r.width||300;c.css("width",a+"px").css("margin-left",(0-a)/2+"px");var s=o('');c.append(s),s.on("click",function(){e.hide()});var l=o('
              '),d=o('
              ');c.append(l).append(d);var u=r.height;u&&d.css("height",u+"px").css("overflow-y","auto");var h=r.tabs||[],p=[],f=[];h.forEach(function(e,t){if(e){var i=e.title||"",A=e.tpl||"";i=O(n,i),A=O(n,A);var r=o('
            • '+i+"
            • ");l.append(r);var c=o(A);d.append(c),r._index=t,p.push(r),f.push(c),0===t?(r._active=!0,r.addClass("w-e-active")):c.hide(),r.on("click",function(e){r._active||(p.forEach(function(e){e._active=!1,e.removeClass("w-e-active")}),f.forEach(function(e){e.hide()}),r._active=!0,r.addClass("w-e-active"),c.show())})}}),c.on("click",function(e){e.stopPropagation()}),i.on("click",function(t){e.hide()}),A.append(c),h.forEach(function(t,n){if(t){(t.events||[]).forEach(function(t){var i=t.selector,o=t.type,A=t.fn||V;f[n].find(i).on(o,function(t){t.stopPropagation(),A(t)&&e.hide()})})}});var m=c.find("input[type=text],textarea");m.length&&m.get(0).focus(),this.$container=c,this._hideOtherPanels(),K.push(t)}},hide:function(){var e=this.menu,t=this.$container;t&&t.remove(),K=K.filter(function(t){return t!==e})},_hideOtherPanels:function(){K.length&&K.forEach(function(e){var t=e.panel||{};t.hide&&t.hide()})}},m.prototype={constructor:m,onClick:function(e){var t=this.editor,n=void 0;if(this._active){if(!(n=t.selection.getSelectionContainerElem()))return;t.selection.createRangeByElem(n),t.selection.restoreSelection(),this._createPanel(n.text(),n.attr("href"))}else t.selection.isSelectionEmpty()?this._createPanel("",""):this._createPanel(t.selection.getSelectionText(),"")},_createPanel:function(e,t){var n=this,i=c("input-link"),A=c("input-text"),r=c("btn-ok"),a=c("btn-del"),s=this._active?"inline-block":"none",l=new f(this,{width:300,tabs:[{title:"链接",tpl:'
              \n \n \n
              \n \n \n
              \n
              ',events:[{selector:"#"+r,type:"click",fn:function(){var e=o("#"+i),t=o("#"+A),r=e.val(),c=t.val();return n._insertLink(c,r),!0}},{selector:"#"+a,type:"click",fn:function(){return n._delLink(),!0}}]}]});l.show(),this.panel=l},_delLink:function(){if(this._active){var e=this.editor;if(e.selection.getSelectionContainerElem()){var t=e.selection.getSelectionText();e.cmd.do("insertHTML",""+t+"")}}},_insertLink:function(e,t){var n=this.editor,i=n.config,o=i.linkCheck,A=!0;o&&"function"==typeof o&&(A=o(e,t)),!0===A?n.cmd.do("insertHTML",''+e+""):alert(A)},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=t.selection.getSelectionContainerElem();i&&("A"===i.getNodeName()?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active")))}},g.prototype={constructor:g,onClick:function(e){var t=this.editor,n=t.selection.isSelectionEmpty();n&&t.selection.createEmptyRange(),t.cmd.do("italic"),n&&(t.selection.collapseRange(),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("italic")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},w.prototype={constructor:w,onClick:function(e){this.editor.cmd.do("redo")}},v.prototype={constructor:v,onClick:function(e){var t=this.editor,n=t.selection.isSelectionEmpty();n&&t.selection.createEmptyRange(),t.cmd.do("strikeThrough"),n&&(t.selection.collapseRange(),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("strikeThrough")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},E.prototype={constructor:E,onClick:function(e){var t=this.editor,n=t.selection.isSelectionEmpty();n&&t.selection.createEmptyRange(),t.cmd.do("underline"),n&&(t.selection.collapseRange(),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("underline")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},b.prototype={constructor:b,onClick:function(e){this.editor.cmd.do("undo")}},B.prototype={constructor:B,_command:function(e){var t=this.editor,n=t.$textElem;if(t.selection.restoreSelection(),!t.cmd.queryCommandState(e)){t.cmd.do(e);var i=t.selection.getSelectionContainerElem();if("LI"===i.getNodeName()&&(i=i.parent()),!1!==/^ol|ul$/i.test(i.getNodeName())&&!i.equal(n)){var o=i.parent();o.equal(n)||(i.insertAfter(o),o.remove())}}},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t.cmd.queryCommandState("insertUnOrderedList")||t.cmd.queryCommandState("insertOrderedList")?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},y.prototype={constructor:y,_command:function(e){this.editor.cmd.do(e)}},C.prototype={constructor:C,_command:function(e){this.editor.cmd.do("foreColor",e)}},x.prototype={constructor:x,_command:function(e){this.editor.cmd.do("backColor",e)}},I.prototype={constructor:I,onClick:function(e){var t=this.editor,n=t.selection.getSelectionContainerElem(),i=n.getNodeName();if(!J.isIE())return void("BLOCKQUOTE"===i?t.cmd.do("formatBlock","

              "):t.cmd.do("formatBlock","

              "));var A=void 0,r=void 0;if("P"===i)return A=n.text(),r=o("
              "+A+"
              "),r.insertAfter(n),void n.remove();"BLOCKQUOTE"===i&&(A=n.text(),r=o("

              "+A+"

              "),r.insertAfter(n),n.remove())},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=/^BLOCKQUOTE$/i,o=t.cmd.queryCommandValue("formatBlock");i.test(o)?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}},Q.prototype={constructor:Q,onClick:function(e){var t=this.editor,n=t.selection.getSelectionStartElem(),i=t.selection.getSelectionEndElem(),A=t.selection.isSelectionEmpty(),r=t.selection.getSelectionText(),c=void 0;return n.equal(i)?A?void(this._active?this._createPanel(n.html()):this._createPanel()):(c=o(""+r+""),t.cmd.do("insertElem",c),t.selection.createRangeByElem(c,!1),void t.selection.restoreSelection()):void t.selection.restoreSelection()},_createPanel:function(e){var t=this;e=e||"";var n=e?"edit":"new",i=c("texxt"),A=c("btn"),r=new f(this,{width:500,tabs:[{title:"插入代码",tpl:'
              \n \n
              \n \n
              \n
              ',events:[{selector:"#"+A,type:"click",fn:function(){var e=o("#"+i),A=e.val()||e.html();return A=a(A),"new"===n?t._insertCode(A):t._updateCode(A),!0}}]}]});r.show(),this.panel=r},_insertCode:function(e){this.editor.cmd.do("insertHTML","
              "+e+"


              ")},_updateCode:function(e){var t=this.editor,n=t.selection.getSelectionContainerElem();n&&(n.html(e),t.selection.restoreSelection())},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=t.selection.getSelectionContainerElem();if(i){var o=i.parent();"CODE"===i.getNodeName()&&"PRE"===o.getNodeName()?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}}},M.prototype={constructor:M,onClick:function(){this._createPanel()},_createPanel:function(){var e=this,t=this.editor,n=t.config,i=n.emotions||[],A=[];i.forEach(function(t){var n=t.type,i=t.content||[],r="";"emoji"===n&&i.forEach(function(e){e&&(r+=''+e+"")}),"image"===n&&i.forEach(function(e){var t=e.src,n=e.alt;t&&(r+=''+n+'')}),A.push({title:t.title,tpl:'
              '+r+"
              ",events:[{selector:"span.w-e-item",type:"click",fn:function(t){var n=t.target,i=o(n),A=i.getNodeName(),r=void 0;return r="IMG"===A?i.parent().html():""+i.html()+"",e._insert(r),!0}}]})});var r=new f(this,{width:300,height:200,tabs:A});r.show(),this.panel=r},_insert:function(e){this.editor.cmd.do("insertHTML",e)}},S.prototype={constructor:S,onClick:function(){this._active?this._createEditPanel():this._createInsertPanel()},_createInsertPanel:function(){var e=this,t=c("btn"),n=c("row"),i=c("col"),A=new f(this,{width:250,tabs:[{title:"插入表格",tpl:'
              \n

              \n 创建\n \n 行\n \n 列的表格\n

              \n
              \n \n
              \n
              ',events:[{selector:"#"+t,type:"click",fn:function(){var t=parseInt(o("#"+n).val()),A=parseInt(o("#"+i).val());return t&&A&&t>0&&A>0&&e._insert(t,A),!0}}]}]});A.show(),this.panel=A},_insert:function(e,t){var n=void 0,i=void 0,o='';for(n=0;n",0===n)for(i=0;i ";else for(i=0;i ";o+=""}o+="


              ";var A=this.editor;A.cmd.do("insertHTML",o),A.cmd.do("enableObjectResizing",!1),A.cmd.do("enableInlineTableEditing",!1)},_createEditPanel:function(){var e=this,t=c("add-row"),n=c("add-col"),i=c("del-row"),o=c("del-col"),A=c("del-table");new f(this,{width:320,tabs:[{title:"编辑表格",tpl:'
              \n
              \n \n \n \n \n
              \n
              \n \n \n
              ',events:[{selector:"#"+t,type:"click",fn:function(){return e._addRow(),!0}},{selector:"#"+n,type:"click",fn:function(){return e._addCol(),!0}},{selector:"#"+i,type:"click",fn:function(){return e._delRow(),!0}},{selector:"#"+o,type:"click",fn:function(){return e._delCol(),!0}},{selector:"#"+A,type:"click",fn:function(){return e._delTable(),!0}}]}]}).show()},_getLocationData:function(){var e={},t=this.editor,n=t.selection.getSelectionContainerElem();if(n){var i=n.getNodeName();if("TD"===i||"TH"===i){var o=n.parent(),A=o.children(),r=A.length;A.forEach(function(t,i){if(t===n[0])return e.td={index:i,elem:t,length:r},!1});var c=o.parent(),a=c.children(),s=a.length;return a.forEach(function(t,n){if(t===o[0])return e.tr={index:n,elem:t,length:s},!1}),e}}},_addRow:function(){var e=this._getLocationData();if(e){var t=e.tr,n=o(t.elem),i=e.td,A=i.length,r=document.createElement("tr"),c="",a=void 0;for(a=0;a ";r.innerHTML=c,o(r).insertAfter(n)}},_addCol:function(){var e=this._getLocationData();if(e){var t=e.tr,n=e.td,i=n.index;o(t.elem).parent().children().forEach(function(e){var t=o(e),n=t.children(),A=n.get(i),r=A.getNodeName().toLowerCase();o(document.createElement(r)).insertAfter(A)})}},_delRow:function(){var e=this._getLocationData();if(e){o(e.tr.elem).remove()}},_delCol:function(){var e=this._getLocationData();if(e){var t=e.tr,n=e.td,i=n.index;o(t.elem).parent().children().forEach(function(e){o(e).children().get(i).remove()})}},_delTable:function(){var e=this.editor,t=e.selection.getSelectionContainerElem();if(t){var n=t.parentUntil("table");n&&n.remove()}},tryChangeActive:function(e){var t=this.editor,n=this.$elem,i=t.selection.getSelectionContainerElem();if(i){var o=i.getNodeName();"TD"===o||"TH"===o?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}}},k.prototype={constructor:k,onClick:function(){this._createPanel()},_createPanel:function(){var e=this,t=c("text-val"),n=c("btn"),i=new f(this,{width:350,tabs:[{title:"插入视频",tpl:'
              \n \n
              \n \n
              \n
              ',events:[{selector:"#"+n,type:"click",fn:function(){var n=o("#"+t),i=n.val().trim();return i&&e._insert(i),!0}}]}]});i.show(),this.panel=i},_insert:function(e){this.editor.cmd.do("insertHTML",e+"


              ")}},D.prototype={constructor:D,onClick:function(){this.editor.config.qiniu||(this._active?this._createEditPanel():this._createInsertPanel())},_createEditPanel:function(){var e=this.editor,t=c("width-30"),n=c("width-50"),i=c("width-100"),o=c("del-btn"),A=[{title:"编辑图片",tpl:'
              \n
              \n 最大宽度:\n \n \n \n
              \n
              \n \n \n
              ',events:[{selector:"#"+t,type:"click",fn:function(){var t=e._selectedImg;return t&&t.css("max-width","30%"),!0}},{selector:"#"+n,type:"click",fn:function(){var t=e._selectedImg;return t&&t.css("max-width","50%"),!0}},{selector:"#"+i,type:"click",fn:function(){var t=e._selectedImg;return t&&t.css("max-width","100%"),!0}},{selector:"#"+o,type:"click",fn:function(){var t=e._selectedImg;return t&&t.remove(),!0}}]}],r=new f(this,{width:300,tabs:A});r.show(),this.panel=r},_createInsertPanel:function(){var e=this.editor,t=e.uploadImg,n=e.config,i=c("up-trigger"),A=c("up-file"),r=c("link-url"),a=c("link-btn"),s=[{title:"上传图片",tpl:'
              \n
              \n \n
              \n
              \n \n
              \n
              ',events:[{selector:"#"+i,type:"click",fn:function(){var e=o("#"+A),t=e[0];if(!t)return!0;t.click()}},{selector:"#"+A,type:"change",fn:function(){var e=o("#"+A),n=e[0];if(!n)return!0;var i=n.files;return i.length&&t.uploadImg(i),!0}}]},{title:"网络图片", +tpl:'
              \n \n
              \n \n
              \n
              ',events:[{selector:"#"+a,type:"click",fn:function(){var e=o("#"+r),n=e.val().trim();return n&&t.insertLinkImg(n),!0}}]}],l=[];(n.uploadImgShowBase64||n.uploadImgServer||n.customUploadImg)&&window.FileReader&&l.push(s[0]),n.showLinkImg&&l.push(s[1]);var d=new f(this,{width:300,tabs:l});d.show(),this.panel=d},tryChangeActive:function(e){var t=this.editor,n=this.$elem;t._selectedImg?(this._active=!0,n.addClass("w-e-active")):(this._active=!1,n.removeClass("w-e-active"))}};var q={};q.bold=l,q.head=u,q.fontSize=h,q.fontName=p,q.link=m,q.italic=g,q.redo=w,q.strikeThrough=v,q.underline=E,q.undo=b,q.list=B,q.justify=y,q.foreColor=C,q.backColor=x,q.quote=I,q.code=Q,q.emoticon=M,q.table=S,q.video=k,q.image=D,_.prototype={constructor:_,init:function(){var e=this,t=this.editor;((t.config||{}).menus||[]).forEach(function(n){var i=q[n];i&&"function"==typeof i&&(e.menus[n]=new i(t))}),this._addToToolbar(),this._bindEvent()},_addToToolbar:function(){var e=this.editor,t=e.$toolbarElem,n=this.menus,i=e.config,o=i.zIndex+1;A(n,function(e,n){var i=n.$elem;i&&(i.css("z-index",o),t.append(i))})},_bindEvent:function(){var e=this.menus,t=this.editor;A(e,function(e,n){var i=n.type;if(i){var o=n.$elem,A=n.droplist;n.panel;"click"===i&&n.onClick&&o.on("click",function(e){null!=t.selection.getRange()&&n.onClick(e)}),"droplist"===i&&A&&o.on("mouseenter",function(e){null!=t.selection.getRange()&&(A.showTimeoutId=setTimeout(function(){A.show()},200))}).on("mouseleave",function(e){A.hideTimeoutId=setTimeout(function(){A.hide()},0)}),"panel"===i&&n.onClick&&o.on("click",function(e){e.stopPropagation(),null!=t.selection.getRange()&&n.onClick(e)})}})},changeActive:function(){A(this.menus,function(e,t){t.tryChangeActive&&setTimeout(function(){t.tryChangeActive()},100)})}},U.prototype={constructor:U,init:function(){this._bindEvent()},clear:function(){this.html("


              ")},html:function(e){var t=this.editor,n=t.$textElem,i=void 0;if(null==e)return i=n.html(),i=i.replace(/\u200b/gm,""),i;n.html(e),t.initSelection()},getJSON:function(){return R(this.editor.$textElem)},text:function(e){var t=this.editor,n=t.$textElem,i=void 0;if(null==e)return i=n.text(),i=i.replace(/\u200b/gm,""),i;n.text("

              "+e+"

              "),t.initSelection()},append:function(e){var t=this.editor;t.$textElem.append(o(e)),t.initSelection()},_bindEvent:function(){this._saveRangeRealTime(),this._enterKeyHandle(),this._clearHandle(),this._pasteHandle(),this._tabHandle(),this._imgHandle(),this._dragHandle()},_saveRangeRealTime:function(){function e(e){t.selection.saveRange(),t.menus.changeActive()}var t=this.editor,n=t.$textElem;n.on("keyup",e),n.on("mousedown",function(t){n.on("mouseleave",e)}),n.on("mouseup",function(t){e(),n.off("mouseleave",e)})},_enterKeyHandle:function(){function e(e){var t=o("


              ");t.insertBefore(e),i.selection.createRangeByElem(t,!0),i.selection.restoreSelection(),e.remove()}function t(t){var n=i.selection.getSelectionContainerElem(),o=n.parent();if("
              "===o.html())return void e(n);if(o.equal(A)){"P"!==n.getNodeName()&&(n.text()||e(n))}}function n(e){var t=i.selection.getSelectionContainerElem();if(t){var n=t.parent(),A=t.getNodeName(),r=n.getNodeName();if("CODE"===A&&"PRE"===r&&i.cmd.queryCommandSupported("insertHTML")){if(!0===i._willBreakCode){var c=o("


              ");return c.insertAfter(n),i.selection.createRangeByElem(c,!0),i.selection.restoreSelection(),i._willBreakCode=!1,void e.preventDefault()}var a=i.selection.getRange().startOffset;i.cmd.do("insertHTML","\n"),i.selection.saveRange(),i.selection.getRange().startOffset===a&&i.cmd.do("insertHTML","\n");var s=t.html().length;i.selection.getRange().startOffset+1===s&&(i._willBreakCode=!0),e.preventDefault()}}}var i=this.editor,A=i.$textElem;A.on("keyup",function(e){13===e.keyCode&&t(e)}),A.on("keydown",function(e){if(13!==e.keyCode)return void(i._willBreakCode=!1);n(e)})},_clearHandle:function(){var e=this.editor,t=e.$textElem;t.on("keydown",function(e){if(8===e.keyCode){return"


              "===t.html().toLowerCase().trim()?void e.preventDefault():void 0}}),t.on("keyup",function(n){if(8===n.keyCode){var i=void 0,A=t.html().toLowerCase().trim();A&&"
              "!==A||(i=o("


              "),t.html(""),t.append(i),e.selection.createRangeByElem(i,!1,!0),e.selection.restoreSelection())}})},_pasteHandle:function(){function e(){var e=Date.now(),t=!1;return e-a>=100&&(t=!0),a=e,t}function t(){a=0}var n=this.editor,i=n.config,o=i.pasteFilterStyle,A=i.pasteTextHandle,r=i.pasteIgnoreImg,c=n.$textElem,a=0;c.on("paste",function(i){if(!J.isIE()&&(i.preventDefault(),e())){var c=F(i,o,r),a=N(i);a=a.replace(/\n/gm,"
              ");var l=n.selection.getSelectionContainerElem();if(l){var d=l.getNodeName();if("CODE"===d||"PRE"===d)return A&&s(A)&&(a=""+(A(a)||"")),void n.cmd.do("insertHTML","

              "+a+"

              ");if(!c)return void t();try{A&&s(A)&&(c=""+(A(c)||"")),n.cmd.do("insertHTML",c)}catch(e){A&&s(A)&&(a=""+(A(a)||"")),n.cmd.do("insertHTML","

              "+a+"

              ")}}}}),c.on("paste",function(t){if(!J.isIE()&&(t.preventDefault(),e())){var i=T(t);if(i&&i.length){var o=n.selection.getSelectionContainerElem();if(o){var A=o.getNodeName();if("CODE"!==A&&"PRE"!==A){n.uploadImg.uploadImg(i)}}}}})},_tabHandle:function(){var e=this.editor;e.$textElem.on("keydown",function(t){if(9===t.keyCode&&e.cmd.queryCommandSupported("insertHTML")){var n=e.selection.getSelectionContainerElem();if(n){var i=n.parent(),o=n.getNodeName(),A=i.getNodeName();"CODE"===o&&"PRE"===A?e.cmd.do("insertHTML"," "):e.cmd.do("insertHTML","    "),t.preventDefault()}}})},_imgHandle:function(){var e=this.editor,t=e.$textElem;t.on("click","img",function(t){var n=this,i=o(n);"1"!==i.attr("data-w-e")&&(e._selectedImg=i,e.selection.createRangeByElem(i),e.selection.restoreSelection())}),t.on("click keyup",function(t){t.target.matches("img")||(e._selectedImg=null)})},_dragHandle:function(){var e=this.editor;o(document).on("dragleave drop dragenter dragover",function(e){e.preventDefault()}),e.$textElem.on("drop",function(t){t.preventDefault();var n=t.dataTransfer&&t.dataTransfer.files;n&&n.length&&e.uploadImg.uploadImg(n)})}},Y.prototype={constructor:Y,do:function(e,t){var n=this.editor;if(n._useStyleWithCSS||(document.execCommand("styleWithCSS",null,!0),n._useStyleWithCSS=!0),n.selection.getRange()){n.selection.restoreSelection();var i="_"+e;this[i]?this[i](t):this._execCommand(e,t),n.menus.changeActive(),n.selection.saveRange(),n.selection.restoreSelection(),n.change&&n.change()}},_insertHTML:function(e){var t=this.editor,n=t.selection.getRange();this.queryCommandSupported("insertHTML")?this._execCommand("insertHTML",e):n.insertNode?(n.deleteContents(),n.insertNode(o(e)[0])):n.pasteHTML&&n.pasteHTML(e)},_insertElem:function(e){var t=this.editor,n=t.selection.getRange();n.insertNode&&(n.deleteContents(),n.insertNode(e[0]))},_execCommand:function(e,t){document.execCommand(e,!1,t)},queryCommandValue:function(e){return document.queryCommandValue(e)},queryCommandState:function(e){return document.queryCommandState(e)},queryCommandSupported:function(e){return document.queryCommandSupported(e)}},P.prototype={constructor:P,getRange:function(){return this._currentRange},saveRange:function(e){if(e)return void(this._currentRange=e);var t=window.getSelection();if(0!==t.rangeCount){var n=t.getRangeAt(0),i=this.getSelectionContainerElem(n);if(i&&"false"!==i.attr("contenteditable")&&!i.parentUntil("[contenteditable=false]")){this.editor.$textElem.isContain(i)&&(this._currentRange=n)}}},collapseRange:function(e){null==e&&(e=!1);var t=this._currentRange;t&&t.collapse(e)},getSelectionText:function(){return this._currentRange?this._currentRange.toString():""},getSelectionContainerElem:function(e){e=e||this._currentRange;var t=void 0;if(e)return t=e.commonAncestorContainer,o(1===t.nodeType?t:t.parentNode)},getSelectionStartElem:function(e){e=e||this._currentRange;var t=void 0;if(e)return t=e.startContainer,o(1===t.nodeType?t:t.parentNode)},getSelectionEndElem:function(e){e=e||this._currentRange;var t=void 0;if(e)return t=e.endContainer,o(1===t.nodeType?t:t.parentNode)},isSelectionEmpty:function(){var e=this._currentRange;return!(!e||!e.startContainer||e.startContainer!==e.endContainer||e.startOffset!==e.endOffset)},restoreSelection:function(){var e=window.getSelection();e.removeAllRanges(),e.addRange(this._currentRange)},createEmptyRange:function(){var e=this.editor,t=this.getRange(),n=void 0;if(t&&this.isSelectionEmpty())try{J.isWebkit()?(e.cmd.do("insertHTML","​"),t.setEnd(t.endContainer,t.endOffset+1),this.saveRange(t)):(n=o(""),e.cmd.do("insertElem",n),this.createRangeByElem(n,!0))}catch(e){}},createRangeByElem:function(e,t,n){if(e.length){var i=e[0],o=document.createRange();n?o.selectNodeContents(i):o.selectNode(i),"boolean"==typeof t&&o.collapse(t),this.saveRange(o)}}},H.prototype={constructor:H,show:function(e){var t=this;if(!this._isShow){this._isShow=!0;var n=this.$bar;if(this._isRender)this._isRender=!0;else{this.$textContainer.append(n)}Date.now()-this._time>100&&e<=1&&(n.css("width",100*e+"%"),this._time=Date.now());var i=this._timeoutId;i&&clearTimeout(i),i=setTimeout(function(){t._hide()},500)}},_hide:function(){this.$bar.remove(),this._time=0,this._isShow=!1,this._isRender=!1}};var X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};L.prototype={constructor:L,_alert:function(e,t){var n=this.editor,i=n.config.debug,o=n.config.customAlert;if(i)throw new Error("wangEditor: "+(t||e));o&&"function"==typeof o?o(e):alert(e)},insertLinkImg:function(e){var t=this;if(e){var n=this.editor,i=n.config,o=i.linkImgCheck,A=void 0;if(o&&"function"==typeof o&&"string"==typeof(A=o(e)))return void alert(A);n.cmd.do("insertHTML",'');var r=document.createElement("img");r.onload=function(){var t=i.linkImgCallback;t&&"function"==typeof t&&t(e),r=null},r.onerror=function(){r=null,t._alert("插入图片错误",'wangEditor: 插入图片出错,图片链接是 "'+e+'",下载该链接失败')},r.onabort=function(){r=null},r.src=e}},uploadImg:function(e){var t=this;if(e&&e.length){var n=this.editor,i=n.config,o=i.uploadImgServer,c=i.uploadImgShowBase64,a=i.uploadImgMaxSize,s=a/1024/1024,l=i.uploadImgMaxLength||1e4,d=i.uploadFileName||"",u=i.uploadImgParams||{},h=i.uploadImgParamsWithUrl,p=i.uploadImgHeaders||{},f=i.uploadImgHooks||{},m=i.uploadImgTimeout||3e3,g=i.withCredentials;null==g&&(g=!1);var w=i.customUploadImg;if(w||o||c){var v=[],E=[];if(r(e,function(e){var t=e.name,n=e.size;if(t&&n)return!1===/\.(jpg|jpeg|png|bmp|gif|webp)$/i.test(t)?void E.push("【"+t+"】不是图片"):al)return void this._alert("一次最多上传"+l+"张图片");if(w&&"function"==typeof w)return void w(v,this.insertLinkImg.bind(this));var b=new FormData;if(r(v,function(e){var t=d||e.name;b.append(t,e)}),o&&"string"==typeof o){var B=o.split("#");o=B[0];var y=B[1]||"";A(u,function(e,t){h&&(o.indexOf("?")>0?o+="&":o+="?",o=o+e+"="+t),b.append(e,t)}),y&&(o+="#"+y);var C=new XMLHttpRequest;if(C.open("POST",o),C.timeout=m,C.ontimeout=function(){f.timeout&&"function"==typeof f.timeout&&f.timeout(C,n),t._alert("上传图片超时")},C.upload&&(C.upload.onprogress=function(e){var t=void 0,i=new H(n);e.lengthComputable&&(t=e.loaded/e.total,i.show(t))}),C.onreadystatechange=function(){var e=void 0;if(4===C.readyState){if(C.status<200||C.status>=300)return f.error&&"function"==typeof f.error&&f.error(C,n),void t._alert("上传图片发生错误","上传图片发生错误,服务器返回状态是 "+C.status);if(e=C.responseText,"object"!==(void 0===e?"undefined":X(e)))try{e=JSON.parse(e)}catch(i){return f.fail&&"function"==typeof f.fail&&f.fail(C,n,e),void t._alert("上传图片失败","上传图片返回结果错误,返回结果是: "+e)}if(f.customInsert||"0"==e.errno){if(f.customInsert&&"function"==typeof f.customInsert)f.customInsert(t.insertLinkImg.bind(t),e,n);else{(e.data||[]).forEach(function(e){t.insertLinkImg(e)})}f.success&&"function"==typeof f.success&&f.success(C,n,e)}else f.fail&&"function"==typeof f.fail&&f.fail(C,n,e),t._alert("上传图片失败","上传图片返回结果错误,返回结果 errno="+e.errno)}},f.before&&"function"==typeof f.before){var x=f.before(C,n,v);if(x&&"object"===(void 0===x?"undefined":X(x))&&x.prevent)return void this._alert(x.msg)}return A(p,function(e,t){C.setRequestHeader(e,t)}),C.withCredentials=g,void C.send(b)}c&&r(e,function(e){var n=t,i=new FileReader;i.readAsDataURL(e),i.onload=function(){n.insertLinkImg(this.result)}})}}}};var W=1;j.prototype={constructor:j,_initConfig:function(){var e={};this.config=Object.assign(e,z,this.customConfig);var t=this.config.lang||{},n=[];A(t,function(e,t){n.push({reg:new RegExp(e,"img"),val:t})}),this.config.langArgs=n},_initDom:function(){var e=this,t=this.toolbarSelector,n=o(t),i=this.textSelector,A=this.config,r=A.zIndex,a=void 0,s=void 0,l=void 0,d=void 0;null==i?(a=o("
              "),s=o("
              "),d=n.children(),n.append(a).append(s),a.css("background-color","#f1f1f1").css("border","1px solid #ccc"),s.css("border","1px solid #ccc").css("border-top","none").css("height","300px")):(a=n,s=o(i),d=s.children()),l=o("
              "),l.attr("contenteditable","true").css("width","100%").css("height","100%"),d&&d.length?l.append(d):l.append(o("


              ")),s.append(l),a.addClass("w-e-toolbar"),s.addClass("w-e-text-container"),s.css("z-index",r),l.addClass("w-e-text");var u=c("toolbar-elem");a.attr("id",u);var h=c("text-elem");l.attr("id",h),this.$toolbarElem=a,this.$textContainerElem=s,this.$textElem=l,this.toolbarElemId=u,this.textElemId=h;var p=!0;s.on("compositionstart",function(){p=!1}),s.on("compositionend",function(){p=!0}),s.on("click keyup",function(){p&&e.change&&e.change()}),a.on("click",function(){this.change&&this.change()}),(A.onfocus||A.onblur)&&(this.isFocus=!1,o(document).on("click",function(t){var n=l.isContain(o(t.target)),i=a.isContain(o(t.target)),A=a[0]==t.target;if(n)e.isFocus||e.onfocus&&e.onfocus(),e.isFocus=!0;else{if(i&&!A)return;e.isFocus&&e.onblur&&e.onblur(),e.isFocus=!1}}))},_initCommand:function(){this.cmd=new Y(this)},_initSelectionAPI:function(){this.selection=new P(this)},_initUploadImg:function(){this.uploadImg=new L(this)},_initMenus:function(){this.menus=new _(this),this.menus.init()},_initText:function(){this.txt=new U(this),this.txt.init()},initSelection:function(e){var t=this.$textElem,n=t.children();if(!n.length)return t.append(o("


              ")),void this.initSelection();var i=n.last();if(e){var A=i.html().toLowerCase(),r=i.getNodeName();if("
              "!==A&&"
              "!==A||"P"!==r)return t.append(o("


              ")),void this.initSelection()}this.selection.createRangeByElem(i,!1,!0),this.selection.restoreSelection()},_bindEvent:function(){var e=0,t=this.txt.html(),n=this.config,i=n.onchangeTimeout;(!(i=parseInt(i,10))||i<=0)&&(i=200);var o=n.onchange;o&&"function"==typeof o&&(this.change=function(){var n=this.txt.html();n.length===t.length&&n===t||(e&&clearTimeout(e),e=setTimeout(function(){o(n),t=n},i))});var A=n.onblur;A&&"function"==typeof A&&(this.onblur=function(){var e=this.txt.html();A(e)});var r=n.onfocus;r&&"function"==typeof r&&(this.onfocus=function(){r()})},create:function(){this._initConfig(),this._initDom(),this._initCommand(),this._initSelectionAPI(),this._initText(),this._initMenus(),this._initUploadImg(),this.initSelection(!0),this._bindEvent()},_offAllEvent:function(){o.offAll()}};try{document}catch(e){throw new Error("请在浏览器环境下运行")}!function(){"function"!=typeof Object.assign&&(Object.assign=function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),i=1;i=0&&t.item(n)!==this;);return n>-1})}();var Z=document.createElement("style");return Z.type="text/css", +Z.innerHTML='.w-e-toolbar,.w-e-text-container,.w-e-menu-panel { padding: 0; margin: 0; box-sizing: border-box;}.w-e-toolbar *,.w-e-text-container *,.w-e-menu-panel * { padding: 0; margin: 0; box-sizing: border-box;}.w-e-clear-fix:after { content: ""; display: table; clear: both;}.w-e-toolbar .w-e-droplist { position: absolute; left: 0; top: 0; background-color: #fff; border: 1px solid #f1f1f1; border-right-color: #ccc; border-bottom-color: #ccc;}.w-e-toolbar .w-e-droplist .w-e-dp-title { text-align: center; color: #999; line-height: 2; border-bottom: 1px solid #f1f1f1; font-size: 13px;}.w-e-toolbar .w-e-droplist ul.w-e-list { list-style: none; line-height: 1;}.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item { color: #333; padding: 5px 0;}.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item:hover { background-color: #f1f1f1;}.w-e-toolbar .w-e-droplist ul.w-e-block { list-style: none; text-align: left; padding: 5px;}.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item { display: inline-block; *display: inline; *zoom: 1; padding: 3px 5px;}.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item:hover { background-color: #f1f1f1;}@font-face { font-family: \'w-e-icon\'; src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABhQAAsAAAAAGAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIPBGNtYXAAAAFoAAABBAAAAQQrSf4BZ2FzcAAAAmwAAAAIAAAACAAAABBnbHlmAAACdAAAEvAAABLwfpUWUWhlYWQAABVkAAAANgAAADYQp00kaGhlYQAAFZwAAAAkAAAAJAfEA+FobXR4AAAVwAAAAIQAAACEeAcD7GxvY2EAABZEAAAARAAAAERBSEX+bWF4cAAAFogAAAAgAAAAIAAsALZuYW1lAAAWqAAAAYYAAAGGmUoJ+3Bvc3QAABgwAAAAIAAAACAAAwAAAAMD3gGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8fwDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAOgAAAA2ACAABAAWAAEAIOkG6Q3pEulH6Wbpd+m56bvpxunL6d/qDepc6l/qZepo6nHqefAN8BTxIPHc8fz//f//AAAAAAAg6QbpDekS6UfpZel36bnpu+nG6cvp3+oN6lzqX+pi6mjqcep38A3wFPEg8dzx/P/9//8AAf/jFv4W+Bb0FsAWoxaTFlIWURZHFkMWMBYDFbUVsxWxFa8VpxWiEA8QCQ7+DkMOJAADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACAAD/wAQAA8AABAATAAABNwEnAQMuAScTNwEjAQMlATUBBwGAgAHAQP5Anxc7MmOAAYDA/oDAAoABgP6ATgFAQAHAQP5A/p0yOxcBEU4BgP6A/YDAAYDA/oCAAAQAAAAABAADgAAQACEALQA0AAABOAExETgBMSE4ATEROAExITUhIgYVERQWMyEyNjURNCYjBxQGIyImNTQ2MzIWEyE1EwEzNwPA/IADgPyAGiYmGgOAGiYmGoA4KCg4OCgoOED9AOABAEDgA0D9AAMAQCYa/QAaJiYaAwAaJuAoODgoKDg4/biAAYD+wMAAAAIAAABABAADQAA4ADwAAAEmJy4BJyYjIgcOAQcGBwYHDgEHBhUUFx4BFxYXFhceARcWMzI3PgE3Njc2Nz4BNzY1NCcuAScmJwERDQED1TY4OXY8PT8/PTx2OTg2CwcICwMDAwMLCAcLNjg5djw9Pz89PHY5ODYLBwgLAwMDAwsIBwv9qwFA/sADIAgGBggCAgICCAYGCCkqKlktLi8vLi1ZKiopCAYGCAICAgIIBgYIKSoqWS0uLy8uLVkqKin94AGAwMAAAAAAAgDA/8ADQAPAABsAJwAAASIHDgEHBhUUFx4BFxYxMDc+ATc2NTQnLgEnJgMiJjU0NjMyFhUUBgIAQjs6VxkZMjJ4MjIyMngyMhkZVzo7QlBwcFBQcHADwBkZVzo7Qnh9fcxBQUFBzH19eEI7OlcZGf4AcFBQcHBQUHAAAAEAAAAABAADgAArAAABIgcOAQcGBycRISc+ATMyFx4BFxYVFAcOAQcGBxc2Nz4BNzY1NCcuAScmIwIANTIyXCkpI5YBgJA1i1BQRUZpHh4JCSIYGB5VKCAgLQwMKCiLXl1qA4AKCycbHCOW/oCQNDweHmlGRVArKClJICEaYCMrK2I2NjlqXV6LKCgAAQAAAAAEAAOAACoAABMUFx4BFxYXNyYnLgEnJjU0Nz4BNzYzMhYXByERByYnLgEnJiMiBw4BBwYADAwtICAoVR4YGCIJCR4eaUZFUFCLNZABgJYjKSlcMjI1al1eiygoAYA5NjZiKysjYBohIEkpKCtQRUZpHh48NJABgJYjHBsnCwooKIteXQAAAAACAAAAQAQBAwAAJgBNAAATMhceARcWFRQHDgEHBiMiJy4BJyY1JzQ3PgE3NjMVIgYHDgEHPgEhMhceARcWFRQHDgEHBiMiJy4BJyY1JzQ3PgE3NjMVIgYHDgEHPgHhLikpPRESEhE9KSkuLikpPRESASMjelJRXUB1LQkQBwgSAkkuKSk9ERISET0pKS4uKSk9ERIBIyN6UlFdQHUtCRAHCBICABIRPSkpLi4pKT0REhIRPSkpLiBdUVJ6IyOAMC4IEwoCARIRPSkpLi4pKT0REhIRPSkpLiBdUVJ6IyOAMC4IEwoCAQAABgBA/8AEAAPAAAMABwALABEAHQApAAAlIRUhESEVIREhFSEnESM1IzUTFTMVIzU3NSM1MxUVESM1MzUjNTM1IzUBgAKA/YACgP2AAoD9gMBAQECAwICAwMCAgICAgIACAIACAIDA/wDAQP3yMkCSPDJAku7+wEBAQEBAAAYAAP/ABAADwAADAAcACwAXACMALwAAASEVIREhFSERIRUhATQ2MzIWFRQGIyImETQ2MzIWFRQGIyImETQ2MzIWFRQGIyImAYACgP2AAoD9gAKA/YD+gEs1NUtLNTVLSzU1S0s1NUtLNTVLSzU1SwOAgP8AgP8AgANANUtLNTVLS/61NUtLNTVLS/61NUtLNTVLSwADAAAAAAQAA6AAAwANABQAADchFSElFSE1EyEVITUhJQkBIxEjEQAEAPwABAD8AIABAAEAAQD9YAEgASDggEBAwEBAAQCAgMABIP7g/wABAAAAAAACAB7/zAPiA7QAMwBkAAABIiYnJicmNDc2PwE+ATMyFhcWFxYUBwYPAQYiJyY0PwE2NCcuASMiBg8BBhQXFhQHDgEjAyImJyYnJjQ3Nj8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFxYUBwYPAQ4BIwG4ChMIIxISEhIjwCNZMTFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PCBMKuDFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PDysQIxISEhIjwCNZMQFECAckLS1eLS0kwCIlJSIkLS1eLS0kVxAQDysPWCl0KRQVFRTAKXQpDysQBwj+iCUiJC0tXi0tJFcQEA8rD1gpdCkUFRUUwCl0KQ8rEA8PJC0tXi0tJMAiJQAAAAAFAAD/wAQAA8AAGwA3AFMAXwBrAAAFMjc+ATc2NTQnLgEnJiMiBw4BBwYVFBceARcWEzIXHgEXFhUUBw4BBwYjIicuAScmNTQ3PgE3NhMyNz4BNzY3BgcOAQcGIyInLgEnJicWFx4BFxYnNDYzMhYVFAYjIiYlNDYzMhYVFAYjIiYCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMVisrKlEmJiMFHBtWODc/Pzc4VhscBSMmJlEqK9UlGxslJRsbJQGAJRsbJSUbGyVAKCiLXl1qal1eiygoKCiLXl1qal1eiygoA6AhIHFMTFZWTExxICEhIHFMTFZWTExxICH+CQYGFRAQFEM6OlYYGRkYVjo6QxQQEBUGBvcoODgoKDg4KCg4OCgoODgAAAMAAP/ABAADwAAbADcAQwAAASIHDgEHBhUUFx4BFxYzMjc+ATc2NTQnLgEnJgMiJy4BJyY1NDc+ATc2MzIXHgEXFhUUBw4BBwYTBycHFwcXNxc3JzcCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMSqCgYKCgYKCgYKCgA8AoKIteXWpqXV6LKCgoKIteXWpqXV6LKCj8YCEgcUxMVlZMTHEgISEgcUxMVlZMTHEgIQKgoKBgoKBgoKBgoKAAAQBl/8ADmwPAACkAAAEiJiMiBw4BBwYVFBYzLgE1NDY3MAcGAgcGBxUhEzM3IzceATMyNjcOAQMgRGhGcVNUbRobSUgGDWVKEBBLPDxZAT1sxizXNC1VJi5QGB09A7AQHh1hPj9BTTsLJjeZbwN9fv7Fj5AjGQIAgPYJDzdrCQcAAAAAAgAAAAAEAAOAAAkAFwAAJTMHJzMRIzcXIyURJyMRMxUhNTMRIwcRA4CAoKCAgKCggP8AQMCA/oCAwEDAwMACAMDAwP8AgP1AQEACwIABAAADAMAAAANAA4AAFgAfACgAAAE+ATU0Jy4BJyYjIREhMjc+ATc2NTQmATMyFhUUBisBEyMRMzIWFRQGAsQcIBQURi4vNf7AAYA1Ly5GFBRE/oRlKjw8KWafn58sPj4B2yJULzUvLkYUFPyAFBRGLi81RnQBRks1NUv+gAEASzU1SwAAAAACAMAAAANAA4AAHwAjAAABMxEUBw4BBwYjIicuAScmNREzERQWFx4BMzI2Nz4BNQEhFSECwIAZGVc6O0JCOzpXGRmAGxgcSSgoSRwYG/4AAoD9gAOA/mA8NDVOFhcXFk41NDwBoP5gHjgXGBsbGBc4Hv6ggAAAAAABAIAAAAOAA4AACwAAARUjATMVITUzASM1A4CA/sCA/kCAAUCAA4BA/QBAQAMAQAABAAAAAAQAA4AAPQAAARUjHgEVFAYHDgEjIiYnLgE1MxQWMzI2NTQmIyE1IS4BJy4BNTQ2Nz4BMzIWFx4BFSM0JiMiBhUUFjMyFhcEAOsVFjUwLHE+PnEsMDWAck5OcnJO/gABLAIEATA1NTAscT4+cSwwNYByTk5yck47bisBwEAdQSI1YiQhJCQhJGI1NExMNDRMQAEDASRiNTViJCEkJCEkYjU0TEw0NEwhHwAAAAcAAP/ABAADwAADAAcACwAPABMAGwAjAAATMxUjNzMVIyUzFSM3MxUjJTMVIwMTIRMzEyETAQMhAyMDIQMAgIDAwMABAICAwMDAAQCAgBAQ/QAQIBACgBD9QBADABAgEP2AEAHAQEBAQEBAQEBAAkD+QAHA/oABgPwAAYD+gAFA/sAAAAoAAAAABAADgAADAAcACwAPABMAFwAbAB8AIwAnAAATESERATUhFR0BITUBFSE1IxUhNREhFSElIRUhETUhFQEhFSEhNSEVAAQA/YABAP8AAQD/AED/AAEA/wACgAEA/wABAPyAAQD/AAKAAQADgPyAA4D9wMDAQMDAAgDAwMDA/wDAwMABAMDA/sDAwMAAAAUAAAAABAADgAADAAcACwAPABMAABMhFSEVIRUhESEVIREhFSERIRUhAAQA/AACgP2AAoD9gAQA/AAEAPwAA4CAQID/AIABQID/AIAAAAAABQAAAAAEAAOAAAMABwALAA8AEwAAEyEVIRchFSERIRUhAyEVIREhFSEABAD8AMACgP2AAoD9gMAEAPwABAD8AAOAgECA/wCAAUCA/wCAAAAFAAAAAAQAA4AAAwAHAAsADwATAAATIRUhBSEVIREhFSEBIRUhESEVIQAEAPwAAYACgP2AAoD9gP6ABAD8AAQA/AADgIBAgP8AgAFAgP8AgAAAAAABAD8APwLmAuYALAAAJRQPAQYjIi8BBwYjIi8BJjU0PwEnJjU0PwE2MzIfATc2MzIfARYVFA8BFxYVAuYQThAXFxCoqBAXFhBOEBCoqBAQThAWFxCoqBAXFxBOEBCoqBDDFhBOEBCoqBAQThAWFxCoqBAXFxBOEBCoqBAQThAXFxCoqBAXAAAABgAAAAADJQNuABQAKAA8AE0AVQCCAAABERQHBisBIicmNRE0NzY7ATIXFhUzERQHBisBIicmNRE0NzY7ATIXFhcRFAcGKwEiJyY1ETQ3NjsBMhcWExEhERQXFhcWMyEyNzY3NjUBIScmJyMGBwUVFAcGKwERFAcGIyEiJyY1ESMiJyY9ATQ3NjsBNzY3NjsBMhcWHwEzMhcWFQElBgUIJAgFBgYFCCQIBQaSBQUIJQgFBQUFCCUIBQWSBQUIJQgFBQUFCCUIBQVJ/gAEBAUEAgHbAgQEBAT+gAEAGwQGtQYEAfcGBQg3Ghsm/iUmGxs3CAUFBQUIsSgIFxYXtxcWFgkosAgFBgIS/rcIBQUFBQgBSQgFBgYFCP63CAUFBQUIAUkIBQYGBQj+twgFBQUFCAFJCAUGBgX+WwId/eMNCwoFBQUFCgsNAmZDBQICBVUkCAYF/eMwIiMhIi8CIAUGCCQIBQVgFQ8PDw8VYAUFCAACAAcASQO3Aq8AGgAuAAAJAQYjIi8BJjU0PwEnJjU0PwE2MzIXARYVFAcBFRQHBiMhIicmPQE0NzYzITIXFgFO/vYGBwgFHQYG4eEGBh0FCAcGAQoGBgJpBQUI/dsIBQUFBQgCJQgFBQGF/vYGBhwGCAcG4OEGBwcGHQUF/vUFCAcG/vslCAUFBQUIJQgFBQUFAAAAAQAjAAAD3QNuALMAACUiJyYjIgcGIyInJjU0NzY3Njc2NzY9ATQnJiMhIgcGHQEUFxYXFjMWFxYVFAcGIyInJiMiBwYjIicmNTQ3Njc2NzY3Nj0BETQ1NDU0JzQnJicmJyYnJicmIyInJjU0NzYzMhcWMzI3NjMyFxYVFAcGIwYHBgcGHQEUFxYzITI3Nj0BNCcmJyYnJjU0NzYzMhcWMzI3NjMyFxYVFAcGByIHBgcGFREUFxYXFhcyFxYVFAcGIwPBGTMyGhkyMxkNCAcJCg0MERAKEgEHFf5+FgcBFQkSEw4ODAsHBw4bNTUaGDExGA0HBwkJCwwQDwkSAQIBAgMEBAUIEhENDQoLBwcOGjU1GhgwMRgOBwcJCgwNEBAIFAEHDwGQDgcBFAoXFw8OBwcOGTMyGRkxMRkOBwcKCg0NEBEIFBQJEREODQoLBwcOAAICAgIMCw8RCQkBAQMDBQxE4AwFAwMFDNRRDQYBAgEICBIPDA0CAgICDAwOEQgJAQIDAwUNRSEB0AINDQgIDg4KCgsLBwcDBgEBCAgSDwwNAgICAg0MDxEICAECAQYMULYMBwEBBwy2UAwGAQEGBxYPDA0CAgICDQwPEQgIAQECBg1P/eZEDAYCAgEJCBEPDA0AAAIAAP+3A/8DtwATADkAAAEyFxYVFAcCBwYjIicmNTQ3ATYzARYXFh8BFgcGIyInJicmJyY1FhcWFxYXFjMyNzY3Njc2NzY3NjcDmygeHhq+TDdFSDQ0NQFtISn9+BcmJy8BAkxMe0c2NiEhEBEEExQQEBIRCRcIDxITFRUdHR4eKQO3GxooJDP+mUY0NTRJSTABSx/9sSsfHw0oek1MGhsuLzo6RAMPDgsLCgoWJRsaEREKCwQEAgABAAAAAAAA9evv618PPPUACwQAAAAAANbEBFgAAAAA1sQEWAAA/7cEAQPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAD//wQBAAEAAAAAAAAAAAAAAAAAAAAhBAAAAAAAAAAAAAAAAgAAAAQAAAAEAAAABAAAAAQAAMAEAAAABAAAAAQAAAAEAABABAAAAAQAAAAEAAAeBAAAAAQAAAAEAABlBAAAAAQAAMAEAADABAAAgAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAMlAD8DJQAAA74ABwQAACMD/wAAAAAAAAAKABQAHgBMAJQA+AE2AXwBwgI2AnQCvgLoA34EHgSIBMoE8gU0BXAFiAXgBiIGagaSBroG5AcoB+AIKgkcCXgAAQAAACEAtAAKAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format(\'truetype\'); font-weight: normal; font-style: normal;}[class^="w-e-icon-"],[class*=" w-e-icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: \'w-e-icon\' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}.w-e-icon-close:before { content: "\\f00d";}.w-e-icon-upload2:before { content: "\\e9c6";}.w-e-icon-trash-o:before { content: "\\f014";}.w-e-icon-header:before { content: "\\f1dc";}.w-e-icon-pencil2:before { content: "\\e906";}.w-e-icon-paint-brush:before { content: "\\f1fc";}.w-e-icon-image:before { content: "\\e90d";}.w-e-icon-play:before { content: "\\e912";}.w-e-icon-location:before { content: "\\e947";}.w-e-icon-undo:before { content: "\\e965";}.w-e-icon-redo:before { content: "\\e966";}.w-e-icon-quotes-left:before { content: "\\e977";}.w-e-icon-list-numbered:before { content: "\\e9b9";}.w-e-icon-list2:before { content: "\\e9bb";}.w-e-icon-link:before { content: "\\e9cb";}.w-e-icon-happy:before { content: "\\e9df";}.w-e-icon-bold:before { content: "\\ea62";}.w-e-icon-underline:before { content: "\\ea63";}.w-e-icon-italic:before { content: "\\ea64";}.w-e-icon-strikethrough:before { content: "\\ea65";}.w-e-icon-table2:before { content: "\\ea71";}.w-e-icon-paragraph-left:before { content: "\\ea77";}.w-e-icon-paragraph-center:before { content: "\\ea78";}.w-e-icon-paragraph-right:before { content: "\\ea79";}.w-e-icon-terminal:before { content: "\\f120";}.w-e-icon-page-break:before { content: "\\ea68";}.w-e-icon-cancel-circle:before { content: "\\ea0d";}.w-e-icon-font:before { content: "\\ea5c";}.w-e-icon-text-heigh:before { content: "\\ea5f";}.w-e-toolbar { display: -webkit-box; display: -ms-flexbox; display: flex; padding: 0 5px; /* flex-wrap: wrap; */ /* 单个菜单 */}.w-e-toolbar .w-e-menu { position: relative; text-align: center; padding: 5px 10px; cursor: pointer;}.w-e-toolbar .w-e-menu i { color: #999;}.w-e-toolbar .w-e-menu:hover i { color: #333;}.w-e-toolbar .w-e-active i { color: #1e88e5;}.w-e-toolbar .w-e-active:hover i { color: #1e88e5;}.w-e-text-container .w-e-panel-container { position: absolute; top: 0; left: 50%; border: 1px solid #ccc; border-top: 0; box-shadow: 1px 1px 2px #ccc; color: #333; background-color: #fff; /* 为 emotion panel 定制的样式 */ /* 上传图片的 panel 定制样式 */}.w-e-text-container .w-e-panel-container .w-e-panel-close { position: absolute; right: 0; top: 0; padding: 5px; margin: 2px 5px 0 0; cursor: pointer; color: #999;}.w-e-text-container .w-e-panel-container .w-e-panel-close:hover { color: #333;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title { list-style: none; display: -webkit-box; display: -ms-flexbox; display: flex; font-size: 14px; margin: 2px 10px 0 10px; border-bottom: 1px solid #f1f1f1;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title .w-e-item { padding: 3px 5px; color: #999; cursor: pointer; margin: 0 3px; position: relative; top: 1px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title .w-e-active { color: #333; border-bottom: 1px solid #333; cursor: default; font-weight: 700;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content { padding: 10px 15px 10px 15px; font-size: 16px; /* 输入框的样式 */ /* 按钮的样式 */}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input:focus,.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea:focus,.w-e-text-container .w-e-panel-container .w-e-panel-tab-content button:focus { outline: none;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea { width: 100%; border: 1px solid #ccc; padding: 5px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea:focus { border-color: #1e88e5;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text] { border: none; border-bottom: 1px solid #ccc; font-size: 14px; height: 20px; color: #333; text-align: left;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text].small { width: 30px; text-align: center;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text].block { display: block; width: 100%; margin: 10px 0;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text]:focus { border-bottom: 2px solid #1e88e5;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button { font-size: 14px; color: #1e88e5; border: none; padding: 5px 10px; background-color: #fff; cursor: pointer; border-radius: 3px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.left { float: left; margin-right: 10px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.right { float: right; margin-left: 10px;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.gray { color: #999;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.red { color: #c24f4a;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button:hover { background-color: #f1f1f1;}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container:after { content: ""; display: table; clear: both;}.w-e-text-container .w-e-panel-container .w-e-emoticon-container .w-e-item { cursor: pointer; font-size: 18px; padding: 0 3px; display: inline-block; *display: inline; *zoom: 1;}.w-e-text-container .w-e-panel-container .w-e-up-img-container { text-align: center;}.w-e-text-container .w-e-panel-container .w-e-up-img-container .w-e-up-btn { display: inline-block; *display: inline; *zoom: 1; color: #999; cursor: pointer; font-size: 60px; line-height: 1;}.w-e-text-container .w-e-panel-container .w-e-up-img-container .w-e-up-btn:hover { color: #333;}.w-e-text-container { position: relative;}.w-e-text-container .w-e-progress { position: absolute; background-color: #1e88e5; bottom: 0; left: 0; height: 1px;}.w-e-text { padding: 0 10px; overflow-y: scroll;}.w-e-text p,.w-e-text h1,.w-e-text h2,.w-e-text h3,.w-e-text h4,.w-e-text h5,.w-e-text table,.w-e-text pre { margin: 10px 0; line-height: 1.5;}.w-e-text ul,.w-e-text ol { margin: 10px 0 10px 20px;}.w-e-text blockquote { display: block; border-left: 8px solid #d0e5f2; padding: 5px 10px; margin: 10px 0; line-height: 1.4; font-size: 100%; background-color: #f1f1f1;}.w-e-text code { display: inline-block; *display: inline; *zoom: 1; background-color: #f1f1f1; border-radius: 3px; padding: 3px 5px; margin: 0 3px;}.w-e-text pre code { display: block;}.w-e-text table { border-top: 1px solid #ccc; border-left: 1px solid #ccc;}.w-e-text table td,.w-e-text table th { border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; padding: 3px 5px;}.w-e-text table th { border-bottom: 2px solid #ccc; text-align: center;}.w-e-text:focus { outline: none;}.w-e-text img { cursor: pointer;}.w-e-text img:hover { box-shadow: 0 0 5px #333;}',document.getElementsByTagName("HEAD").item(0).appendChild(Z),window.wangEditor||j}); +//# sourceMappingURL=wangEditor.min.js.map diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..35697a8 --- /dev/null +++ b/manifest.json @@ -0,0 +1,852 @@ +{ + "@platforms" : [ "android", "iPhone", "iPad" ], + "id" : "H5B854518", /*应用的标识,创建应用时自动生成,勿手动修改*/ + "name" : "全亮共商城", /*应用名称,程序桌面图标名称*/ + "version" : { + "name" : "2.0.6", /*应用版本名称*/ + "code" : "83" + }, + "description" : "", /*应用描述信息*/ + "icons" : { + "72" : "icon.png" + }, + "launch_path" : "index.html", /*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/ + "developer" : { + "name" : "", /*开发者名称*/ + "email" : "", /*开发者邮箱地址*/ + "url" : "http://www.dcloud.io" + }, + "permissions" : { + "Accelerometer" : { + "description" : "访问加速度感应器" + }, + "Audio" : { + "description" : "访问麦克风" + }, + "Cache" : { + "description" : "管理应用缓存" + }, + "Camera" : { + "description" : "访问摄像头" + }, + "Console" : { + "description" : "跟踪调试输出日志" + }, + "Device" : { + "description" : "访问设备信息" + }, + "Downloader" : { + "description" : "文件下载管理" + }, + "Events" : { + "description" : "应用扩展事件" + }, + "File" : { + "description" : "访问本地文件系统" + }, + "Gallery" : { + "description" : "访问系统相册" + }, + "Geolocation" : { + "description" : "访问位置信息" + }, + "Invocation" : { + "description" : "使用Native.js能力" + }, + "Orientation" : { + "description" : "访问方向感应器" + }, + "Payment" : {}, + "Proximity" : { + "description" : "访问距离感应器" + }, + "Storage" : { + "description" : "管理应用本地数据" + }, + "Uploader" : { + "description" : "管理文件上传任务" + }, + "Runtime" : { + "description" : "访问运行期环境" + }, + "XMLHttpRequest" : { + "description" : "跨域网络访问" + }, + "Zip" : { + "description" : "文件压缩与解压缩" + }, + "Barcode" : { + "description" : "管理二维码扫描插件" + }, + "Webview" : { + "description" : "窗口管理" + }, + "NativeUI" : { + "description" : "原生UI控件" + }, + "Navigator" : { + "description" : "浏览器信息" + }, + "NativeObj" : { + "description" : "原生对象" + }, + "Share" : {}, + "Maps" : {} + }, + "plus" : { + "statusbar" : { + "immersed" : true, + "color" : "#000" + }, + "splashscreen" : { + "autoclose" : false, /*是否自动关闭程序启动界面,true表示应用加载应用入口页面后自动关闭;false则需调plus.navigator.closeSplashscreen()关闭*/ + "waiting" : false, + "delay" : "0" + }, + "runmode" : "liberate", /*应用的首次启动运行模式,可取liberate或normal,liberate模式在第一次启动时将解压应用资源(Android平台File API才可正常访问_www目录)*/ + "signature" : "Sk9JTiBVUyBtYWlsdG86aHIyMDEzQGRjbG91ZC5pbw==", /*可选,保留给应用签名,暂不使用*/ + "distribute" : { + "plugins" : { + "share" : { + "weixin" : { + "appid" : "wxb937171ecaba6464", + "appsecret" : "d81035bfe284557cf6ae9ed9dd2f56ec", + "description" : "可选,微信分享" + } + }, + "payment" : { + "alipay" : { + "description" : "阿里支付", + "scheme" : "" + }, + "weixin" : { + "description" : "微信支付", + "appid" : "wxb937171ecaba6464" + } + }, + "maps" : { + "baidu" : { + "appkey_ios" : "ziVSASroyP6sQHwLdmOFFQE1mYvs7SS0", + "appkey_android" : "ziVSASroyP6sQHwLdmOFFQE1mYvs7SS0" + } + } + }, + "apple" : { + "appid" : "1355322179", /*iOS应用标识,苹果开发网站申请的appid,如io.dcloud.HelloH5*/ + "mobileprovision" : "", /*iOS应用打包配置文件*/ + "password" : "", /*iOS应用打包个人证书导入密码*/ + "p12" : "", /*iOS应用打包个人证书,打包配置文件关联的个人证书*/ + "devices" : "iphone", /*iOS应用支持的设备类型,可取值iphone/ipad/universal*/ + "frameworks" : [], + "UIReserveStatusbarOffset" : "false", + "urlType" : [ + { + "urlidentifier" : "cn.com.zgqlg.app", + "urlschemes" : [ "quanglianggong" ] + } + ] + }, + "google" : { + "packagename" : "cn.com.zgqlg.app", /*Android应用包名,如io.dcloud.HelloH5*/ + "keystore" : "", /*Android应用打包使用的密钥库文件*/ + "password" : "", /*Android应用打包使用密钥库中证书的密码*/ + "aliasname" : "", /*Android应用打包使用密钥库中证书的别名*/ + "ImmersedStatusbar" : "true", + "schemes" : [ "quanglianggong" ], + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "orientation" : [ "portrait-primary" ], /*应用支持的方向,portrait-primary:竖屏正方向;portrait-secondary:竖屏反方向;landscape-primary:横屏正方向;landscape-secondary:横屏反方向*/ + "icons" : { + "ios" : { + "prerendered" : true, /*应用图标是否已经高亮处理,在iOS6及以下设备上有效*/ + + /*应用图标,分辨率:512x512,用于自动生成各种尺寸程序图标*/ + "iphone" : { + "normal" : "", /*iPhone普通屏幕程序图标,分辨率:57x57*/ + "retina" : "", /*iPhone高分屏程序图标,分辨率:114x114*/ + + /*iPhone iOS7高分屏程序图标,分辨率:120x120*/ + "spotlight-normal" : "", /*iPhone Spotlight搜索程序图标,分辨率:29x29*/ + "spotlight-retina" : "", /*iPhone高分屏Spotlight搜索程序图标,分辨率:58x58*/ + + /*iPhone iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/ + "settings-normal" : "", /*iPhone设置页面程序图标,分辨率:29x29*/ + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "notification@2x" : "unpackage/res/icons/40x40.png" + }, + "ipad" : { + "normal" : "", /*iPad普通屏幕程序图标,分辨率:72x72*/ + "retina" : "", /*iPad高分屏程序图标,分辨率:144x144*/ + + /*iPad iOS7程序图标,分辨率:76x76*//*iPad iOS7高分屏程序图标,分辨率:152x152*/ + "spotlight-normal" : "", /*iPad Spotlight搜索程序图标,分辨率:50x50*/ + "spotlight-retina" : "", /*iPad高分屏Spotlight搜索程序图标,分辨率:100x100*/ + + /*iPad iOS7 Spotlight搜索程序图标,分辨率:40x40*//*iPad iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*//*iPad设置页面程序图标,分辨率:29x29*/ + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "settings" : "unpackage/res/icons/29x29.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png" + }, + "appstore" : "unpackage/res/icons/logo.png" + }, + "android" : { + "mdpi" : "unpackage/res/icons/48x48.png", /*普通屏程序图标,分辨率:48x48*/ + "ldpi" : "unpackage/res/icons/48x48.png", /*大屏程序图标,分辨率:48x48*/ + "hdpi" : "unpackage/res/icons/72x72.png", /*高分屏程序图标,分辨率:72x72*/ + "xhdpi" : "unpackage/res/icons/96x96.png", /*720P高分屏程序图标,分辨率:96x96*/ + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + } + }, + "splashscreen" : { + "ios" : { + "iphone" : { + "default" : "", + "iphonex" : "", + "retina47" : "", + "retina55" : "", + "retina35" : "", + "retina40" : "" + }, + "ipad" : { + "portrait" : "", /*iPad竖屏启动图片,分辨率:768x1004*/ + "portrait-retina" : "", /*iPad高分屏竖屏图片,分辨率:1536x2008*/ + "landscape" : "", /*iPad横屏启动图片,分辨率:1024x748*/ + "landscape-retina" : "", /*iPad高分屏横屏启动图片,分辨率:2048x1496*/ + "portrait7" : "", /*iPad iOS7竖屏启动图片,分辨率:768x1024*/ + "portrait-retina7" : "", /*iPad iOS7高分屏竖屏图片,分辨率:1536x2048*/ + "landscape7" : "", /*iPad iOS7横屏启动图片,分辨率:1024x768*/ + "landscape-retina7" : "" + } + }, + "android" : { + "mdpi" : "", /*普通屏启动图片,分辨率:240x282*/ + "ldpi" : "", + "hdpi" : "unpackage/res/480x762.png", + "xhdpi" : "unpackage/res/720x1242.png", + "xxhdpi" : "unpackage/res/1080x1882.png" + } + } + }, + "ads" : { + "rp" : false, + "splash" : false, + "spot" : false + }, + "adid" : "124273120411" + }, + "dependencies" : { + "pages" : { + "index.html" : { + "resources" : [ + "js/mui.min.js", + "fonts/mui.ttf", + "css/mui.min.css", + "templete/home1.html", + "css/icons-extra.css", + "fonts/mui-icons-extra.ttf", + "img/home.png", + "img/me.png", + "img/imail.png", + "img/hot.png", + "img/shop.png", + "css/index.css", + "img/home2.png", + "img/imail2.png", + "img/shop2.png", + "img/me2.png", + "img/hot2.png", + "templete/home.html", + "css/global.css", + "js/mui.js", + "img/sousuo.png", + "css/header.css", + "img/saoyisao.png", + "templete/bb.html" + ], + "refer" : [ + "templete/home3.html", + "templete/home4.html", + "templete/home2.html", + "templete/msg.html", + "templete/discounts.html", + "templete/shoppingcart.html", + "templete/my.html", + "templete/login.html", + "templete/discount.html", + "templete/ect_prefecture_.html", + "templete/guide.html", + "templete/self_shop.html" + ], + "priority" : 0 + }, + "templete/home1.html" : { + "resources" : [ + "js/mui.js", + "css/mui.css", + "img/shuijiao.jpg", + "img/muwu.jpg", + "img/yuantiao.jpg", + "img/cbd.jpg", + "templete/search.html", + "fonts/mui.ttf" + ], + "refer" : [], + "priority" : 0 + }, + "templete/home3.html" : { + "resources" : [ "css/mui.css", "js/mui.js" ], + "refer" : [], + "priority" : 0 + }, + "templete/home4.html" : { + "resources" : [ "css/mui.css", "js/mui.js" ], + "refer" : [], + "priority" : 0 + }, + "templete/home2.html" : { + "resources" : [ "css/mui.css", "js/mui.js" ], + "refer" : [], + "priority" : 0 + }, + "templete/search.html" : { + "resources" : [ "css/mui.min.css", "js/mui.min.js" ], + "refer" : [], + "priority" : 0 + }, + "templete/msg.html" : { + "resources" : [ + "js/mui.js", + "css/mui.css", + "css/global.css", + "img/QQ20170814092939.jpg", + "css/msg.css", + "css/header.css" + ], + "refer" : [ "templete/msg_con.html", "templete/login.html" ], + "priority" : 0 + }, + "templete/home.html" : { + "resources" : [ + "img/shuijiao.jpg", + "fonts/mui.ttf", + "img/muwu.jpg", + "img/yuantiao.jpg", + "js/mui.js", + "img/cbd.jpg", + "css/mui.css", + "css/global.css", + "css/home.css", + "img/saoyisao.png", + "img/sousuo.png", + "img/QQ20170814092939.jpg", + "img/time_limit.png", + "img/youhaohuo.png", + "img/aiguangjie.png", + "img/bimaiqingdan.png", + "img/feichangdapai.png", + "img/chaoshihui.png", + "css/swiper.min.css", + "js/swiper.min.js", + "img/chaoshihui2.png", + "img/xianshitehui.png", + "img/QQ20170914152503.jpg", + "img/QQ20170914154124.png", + "js/jquery-3.2.1.min.js", + "css/header.css", + "img/search1.png", + "img/meirigengxin.png", + "img/fenlei.png", + "img/xianshiqianggou.png", + "img/pingpaijie.png", + "img/jingpintuijian.png", + "img/huiyuankuaibao.png", + "img/jxyh.png", + "img/huiyuanmiaosha.png", + "img/miaoshabg.png", + "img/huiyuanzhuanhui1.png", + "img/faxianhaohuo1.png", + "img/paihangbang.png", + "img/huigou.png", + "img/xinpinshoufa.png", + "img/shangxin.png", + "img/banner1.png", + "img/pinzhishishang.png", + "img/banner2.png", + "img/guangshangchang.png", + "img/guangshangchang1.png", + "img/cainixihuan.png" + ], + "refer" : [ + "templete/search.html", + "templete/details.html", + "templete/detailsout.html", + "templete/activity1.html", + "templete/activity2.html", + "templete/activity3.html", + "templete/classify.html", + "templete/activity4.html", + "templete/goodsList.html", + "templete/journalism.html", + "templete/activity6.html", + "templete/upload.html", + "templete/orSupermarket.html", + "templete/activity1111.html", + "templete/self_shop.html" + ], + "priority" : 0 + }, + "templete/discounts.html" : { + "resources" : [ + "js/mui.js", + "css/mui.css", + "css/global.css", + "css/header.css", + "templete/dynamic.html", + "css/discounts.css", + "templete/choiceness.html" + ], + "refer" : [ "templete/new_product.html" ], + "priority" : 0 + }, + "templete/shoppingcart.html" : { + "resources" : [ + "js/mui.js", + "css/mui.css", + "js/mui.min.js", + "js/jquery-3.2.1.min.js", + "css/shoppingcart.css", + "img/icon_select.png", + "img/icon_shop.png", + "img/icon_s.png", + "img/icon_down.png", + "img/icon_right.png", + "img/icon_select1.png", + "css/global.css", + "img/QQ图片20170814092939.jpg", + "img/QQ20170814092939.jpg", + "img/jia.png", + "img/jian.png", + "css/header.css" + ], + "refer" : [ + "templete/login.html", + "templete/confirmOrder.html", + "templete/storeout.html", + "templete/details.html" + ], + "priority" : 0 + }, + "templete/my.html" : { + "resources" : [ + "js/mui.js", + "css/mui.css", + "css/global.css", + "css/header.css", + "img/my_bg.png", + "css/my.css", + "img/hyz_bg.png", + "img/QQ20170814092939.jpg", + "js/jquery-3.2.1.min.js", + "img/3.png", + "img/2.png", + "img/5.png", + "img/1.png", + "img/4.png", + "img/yuan.png", + "img/hui.png" + ], + "refer" : [ + "templete/collect.html", + "templete/indent.html", + "templete/login.html", + "templete/setting.html", + "templete/11112.html", + "templete/share.html", + "templete/juan_index.html", + "templete/individual.html" + ], + "priority" : 0 + }, + "templete/details.html" : { + "resources" : [ + "css/details.css", + "css/mui.min.css", + "css/swiper.min.css", + "img/QQ20170811094637.jpg", + "img/QQ20170811094651.jpg", + "img/QQ20170811094647.jpg", + "img/QQ20170811094641.jpg", + "img/jifen.png", + "img/menu.png", + "img/gouwuquan.png", + "css/global.css", + "img/close.png", + "js/swiper.min.js", + "js/mui.min.js", + "img/QQ20170814092939.jpg", + "js/jquery-3.2.1.min.js", + "img/haitunlogo.png", + "img/shoplogo.png", + "img/likelogo.png", + "img/icon_back.png", + "img/icon_menu.png", + "fonts/mui.ttf", + "img/muwu.jpg", + "js/mui.js" + ], + "refer" : [ + "templete/detailscon.html", + "templete/appraise.html", + "templete/storeout.html", + "templete/confirmOrder.html", + "templete/login.html" + ], + "priority" : 0 + }, + "templete/detailscon.html" : { + "resources" : [ + "css/global.css", + "css/mui.min.css", + "js/mui.min.js", + "js/jquery-3.2.1.min.js", + "fonts/mui.ttf", + "css/header.css", + "css/detailscon.css", + "img/muwu.jpg" + ], + "refer" : [], + "priority" : 0 + }, + "templete/appraise.html" : { + "resources" : [ + "css/global.css", + "css/mui.min.css", + "css/header.css", + "js/mui.min.js", + "js/jquery-3.2.1.min.js", + "fonts/mui.ttf", + "css/photoswipe.css", + "css/appraise.css", + "js/photoswipe.js", + "js/photoswipe-ui-default.min.js", + "css/default-skin/default-skin.css", + "css/default-skin/default-skin.svg", + "img/shuijiao.jpg", + "img/QQ20170814092939.jpg", + "img/muwu.jpg", + "img/yuantiao.jpg", + "img/cbd.jpg", + "js/mui.js" + ], + "refer" : [], + "priority" : 0 + }, + "templete/detailsout.html" : { + "resources" : [ + "img/haitunlogo.png", + "img/shoplogo.png", + "img/likelogo.png", + "img/gouwuquan.png", + "img/QQ20170811094637.jpg", + "img/QQ20170811094651.jpg", + "img/jifen.png", + "css/details.css", + "img/close.png", + "img/QQ20170811094647.jpg", + "css/mui.min.css", + "css/swiper.min.css", + "img/QQ20170811094641.jpg", + "img/menu.png", + "fonts/mui.ttf", + "js/swiper.min.js", + "img/QQ20170814092939.jpg", + "css/global.css", + "img/muwu.jpg", + "js/jquery-3.2.1.min.js", + "js/mui.js" + ], + "refer" : [ "templete/appraise.html" ], + "priority" : 0 + }, + "templete/collect.html" : { + "resources" : [ + "css/collect.css", + "js/mui.min.js", + "css/mui.min.css", + "fonts/mui.ttf", + "js/jquery-3.2.1.min.js", + "templete/collect_commodity.html", + "css/global.css" + ], + "refer" : [ "templete/collect_store.html" ], + "priority" : 0 + }, + "templete/collect_commodity.html" : { + "resources" : [ + "css/mui.min.css", + "css/collect_commodity.css", + "img/QQ20170914154124.png", + "js/mui.min.js", + "css/global.css" + ], + "refer" : [ "templete/details.html" ], + "priority" : 0 + }, + "templete/collect_store.html" : { + "resources" : [ + "css/mui.min.css", + "img/sanjiaoxia.png", + "css/collect_store.css", + "css/swiper.min.css", + "js/swiper.min.js", + "img/QQ20170914154124.png", + "img/sanjiaoshang.png", + "js/mui.min.js", + "css/global.css", + "js/jquery-3.2.1.min.js" + ], + "refer" : [ "templete/details.html", "templete/storeout.html" ], + "priority" : 0 + }, + "templete/indent.html" : { + "resources" : [ + "css/indent.css", + "js/mui.min.js", + "css/global.css", + "fonts/mui.ttf", + "css/mui.min.css", + "js/jquery-3.2.1.min.js", + "templete/indentcon.html" + ], + "refer" : [], + "priority" : 0 + }, + "templete/indentcon.html" : { + "resources" : [ + "css/indentcon.css", + "css/mui.min.css", + "css/global.css", + "img/youjiantou.png", + "img/QQ20170914154124.png" + ], + "refer" : [ + "templete/order_out.html", + "templete/logisticscon.html", + "templete/logistics.html", + "templete/setting_fogetPayPwd.html", + "templete/login.html", + "templete/pj.html", + "templete/complain.html" + ], + "priority" : 0 + }, + "templete/choiceness.html" : { + "resources" : [ + "js/mui.min.js", + "css/mui.min.css", + "css/dynamic.css", + "css/global.css", + "img/QQ20170914154124.png" + ], + "refer" : [ + "templete/storeout.html", + "templete/details.html", + "templete/login.html" + ], + "priority" : 0 + }, + "templete/new_product.html" : { + "resources" : [ + "js/mui.min.js", + "css/mui.min.css", + "css/dynamic.css", + "css/global.css" + ], + "refer" : [ + "templete/login.html", + "templete/storeout.html", + "templete/details.html" + ], + "priority" : 0 + }, + "templete/dynamic.html" : { + "resources" : [ + "js/mui.min.js", + "css/mui.min.css", + "css/dynamic.css", + "css/global.css", + "img/QQ20170914154124.png" + ], + "refer" : [ "templete/login.html", "templete/storeout.html" ], + "priority" : 0 + }, + "templete/storeout.html" : { + "resources" : [ "templete/store_home.html" ], + "refer" : [ + "templete/store_activity.html", + "templete/store_new.html", + "templete/store_commodity.html", + "templete/store_class.html", + "templete/store_info.html", + "templete/goodsList.html" + ], + "priority" : 0 + }, + "templete/store_commodity.html" : { + "resources" : [], + "refer" : [ "templete/storeout.html", "templete/details.html" ], + "priority" : 0 + }, + "templete/store_new.html" : { + "resources" : [], + "refer" : [ "templete/storeout.html", "templete/details.html" ], + "priority" : 0 + }, + "templete/store_home.html" : { + "resources" : [], + "refer" : [ "templete/storeout.html", "templete/details.html" ], + "priority" : 0 + }, + "templete/login.html" : { + "resources" : [], + "refer" : [ "templete/register.html", "templete/setting_fogetPwd.html" ], + "priority" : 0 + }, + "templete/order_out.html" : { + "resources" : [ "templete/order_con.html" ], + "refer" : [ "templete/logistics.html" ], + "priority" : 0 + }, + "templete/logistics.html" : { + "resources" : [ "templete/logisticscon.html" ], + "refer" : [], + "priority" : 0 + }, + "templete/store_activity.html" : { + "resources" : [], + "refer" : [ "templete/details.html" ], + "priority" : 0 + }, + "templete/setting.html" : { + "resources" : [], + "refer" : [ "templete/setting_user.html", "templete/setting_loginInfo.html" ], + "priority" : 0 + }, + "templete/setting_user.html" : { + "resources" : [], + "refer" : [ "templete/seeting_address.html", "templete/setting_address.html" ], + "priority" : 0 + }, + "templete/seeting_address.html" : { + "resources" : [], + "refer" : [ "templete/editAddress.html" ], + "priority" : 0 + }, + "templete/classify.html" : { + "resources" : [], + "refer" : [ "templete/goodsList.html" ], + "priority" : 0 + }, + "templete/goodsList.html" : { + "resources" : [], + "refer" : [ "templete/details.html" ], + "priority" : 0 + }, + "templete/confirmOrder.html" : { + "resources" : [], + "refer" : [ + "templete/seeting_address.html", + "templete/setting_fogetPayPwd.html", + "templete/setting_address.html", + "templete/indent.html" + ], + "priority" : 0 + }, + "templete/setting_address.html" : { + "resources" : [], + "refer" : [ "templete/editAddress.html" ], + "priority" : 0 + }, + "templete/setting_loginInfo.html" : { + "resources" : [], + "refer" : [ + "templete/setting_phone.html", + "templete/setting_fogetPayPwd.html", + "templete/setting_pwd.html", + "templete/setting_payPwd.html" + ], + "priority" : 0 + }, + "templete/activity4.html" : { + "resources" : [], + "refer" : [ "templete/storeout.html", "templete/details.html" ], + "priority" : 0 + }, + "templete/activity1.html" : { + "resources" : [], + "refer" : [ "templete/details.html" ], + "priority" : 0 + }, + "templete/activity2.html" : { + "resources" : [], + "refer" : [ "templete/details.html" ], + "priority" : 0 + }, + "templete/activity3.html" : { + "resources" : [], + "refer" : [ "templete/details.html", "templete/login.html" ], + "priority" : 0 + }, + "templete/journalism.html" : { + "resources" : [], + "refer" : [ "templete/journalism_con.html" ], + "priority" : 0 + }, + "templete/activity6.html" : { + "resources" : [], + "refer" : [ "templete/details.html" ], + "priority" : 0 + }, + "templete/shopsList.html" : { + "resources" : [], + "refer" : [ "templete/storeout.html", "templete/details.html" ], + "priority" : 0 + }, + "templete/activity1111.html" : { + "resources" : [], + "refer" : [ "templete/details.html" ], + "priority" : 0 + } + }, + "idle" : { + "resources" : [] + } + } +} diff --git a/templete/ac1.html b/templete/ac1.html new file mode 100644 index 0000000..81770dc --- /dev/null +++ b/templete/ac1.html @@ -0,0 +1,52 @@ + + + + + + + + + +
              +
              + +
              + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + + + + + + + + diff --git a/templete/ac2.html b/templete/ac2.html new file mode 100644 index 0000000..674a0b2 --- /dev/null +++ b/templete/ac2.html @@ -0,0 +1,52 @@ + + + + + + + + + +
              +
              + +
              + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + + + + + + + + diff --git a/templete/ac3.html b/templete/ac3.html new file mode 100644 index 0000000..e842c83 --- /dev/null +++ b/templete/ac3.html @@ -0,0 +1,52 @@ + + + + + + + + + +
              +
              + +
              + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + + + + + + + + diff --git a/templete/ac4.html b/templete/ac4.html new file mode 100644 index 0000000..9532291 --- /dev/null +++ b/templete/ac4.html @@ -0,0 +1,53 @@ + + + + + + + + + +
              +
              + +
              + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + + + + + + + + + diff --git a/templete/ac5.html b/templete/ac5.html new file mode 100644 index 0000000..1bc6851 --- /dev/null +++ b/templete/ac5.html @@ -0,0 +1,52 @@ + + + + + + + + + +
              +
              + +
              + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + + + + + + + + diff --git a/templete/ac6.html b/templete/ac6.html new file mode 100644 index 0000000..3d75717 --- /dev/null +++ b/templete/ac6.html @@ -0,0 +1,52 @@ + + + + + + + + + +
              +
              + +
              + +
              +
              +
              +
              +
              + + + +
              +
              +
              + + + + + + + + + diff --git a/templete/addessay.html b/templete/addessay.html new file mode 100644 index 0000000..e9eec47 --- /dev/null +++ b/templete/addessay.html @@ -0,0 +1,72 @@ + + + + + + + + + + + +
              +
              + + +

              添加日志

              +
              +
              +
              +
              +
              +
              +
              + 身份证号: + + +
              +
              + 编辑密码: + +
              +
              + 操作密码: + +
              +
              +
              +
              确认添加
              +
              + +
              +
              + + + + + + + + diff --git a/templete/addgoods.html b/templete/addgoods.html new file mode 100644 index 0000000..857838c --- /dev/null +++ b/templete/addgoods.html @@ -0,0 +1,208 @@ + + + + + + + + + + + + + +
              +
              + + +

              添加商品

              +
              +
              +
              +
              +
              +
              + + +
              + + +
              +
              + +
              +
              + +
              + + + + + + + + + + +
              +
              +
              + + + + + % + +
              + +
              + + + +
              +
              + + + +
              +
              + +
              + + +
              + +
              +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              + + +
              + +
              +
              + + + + + +
              + + + +
              + +
              +
              + +
              + +
              +
              + + +
              +
              + + +
              + +
              + + + +
              +
              +
              + + + + + + + +
              +
              + +
              +
              + +
              下一步
              +
              + +
              +
              +
              + + + + + + + + + + + + diff --git a/templete/addhhrrz.html b/templete/addhhrrz.html new file mode 100644 index 0000000..628c82d --- /dev/null +++ b/templete/addhhrrz.html @@ -0,0 +1,162 @@ + + + + + + + + + + + +
              +
              + + +

              添加合伙人

              +
              +
              +
              +
                +
              • +
              • +
              • +
                确定
                +
              • +
              +
              +
              +
              +
              +
              + + +
              +
              + + + +
              +
              + + + +
              + +
              + + +
              + +
              + + +
              + +
              +
              + + + + 手持营业执照照 +
              +
              + + + + 身份证正面照 +
              +
              + + + + 身份证反面照 +
              + + +
              + +
              +
              + + + + + + + + +
              + + +
              保存
              +
              +
              + + + + + + + diff --git a/templete/addmemorandum.html b/templete/addmemorandum.html new file mode 100644 index 0000000..f7813d8 --- /dev/null +++ b/templete/addmemorandum.html @@ -0,0 +1,65 @@ + + + + + + + + + + +
              +
              + + +

              添加备忘录

              +

              保存

              +
              +
              +
              +
              +
              +
              + 主题: + +
              +
              + + +
              +
              +
              你的浏览器不支持flash,Silverlight或者HTML5!
              + 选择图片 +
              + 上传文件名字是随机文件名, 后缀保留 +
              +
              +
              +
              +
              +
              + + + + + + + diff --git a/templete/addproperties.html b/templete/addproperties.html new file mode 100644 index 0000000..1e1b50b --- /dev/null +++ b/templete/addproperties.html @@ -0,0 +1,91 @@ + + + + + + + + + + + +
              +
              + + +

              添加产品规格属性

              +
              +
              + +
              +
              +
              + +
              +
              +
              + + +
              + +
              + + +
              +
              + + +
              +
              + +
              保存
              + + + + + + + + +
              +
              +
              + + + + + diff --git a/templete/addqrbb.html b/templete/addqrbb.html new file mode 100644 index 0000000..a7c8f74 --- /dev/null +++ b/templete/addqrbb.html @@ -0,0 +1,83 @@ + + + + + + + + + + + +
              +
              + + +

              亲人报备

              +
              +
              + +
              +
              +
              +
              + + +
              +
              + + + +
              +
              + + + +
              +
              + + +
              + 手持户口簿主页照 +
              +
              + + +
              +
              +
              +
              + + + +
              保存
              +
              + +
              +
              + + + + + + + diff --git a/templete/addqrrz.html b/templete/addqrrz.html new file mode 100644 index 0000000..23cb350 --- /dev/null +++ b/templete/addqrrz.html @@ -0,0 +1,131 @@ + + + + + + + + + + + +
              +
              + + +

              亲人认证

              +
              +
              +
              +
                +
              • +
              • +
              • +
                确定
                +
              • +
              +
              +
              +
              +
              +
              + + +
              +
              + + +
              +
              + + + +
              +
              + + + +
              + + +
              + +
              + +
              + + +
              +
              + 身份证正面照 + +
              + +
              +
              + 身份证反面照 + + +
              +
              +
              + 与户主关系照 + + +
              +
              +
              + + + + +
              +
              + + +
              保存
              +
              +
              + + + + + + + diff --git a/templete/addshopping.1.html b/templete/addshopping.1.html new file mode 100644 index 0000000..3316341 --- /dev/null +++ b/templete/addshopping.1.html @@ -0,0 +1,69 @@ + + + + + + + + + + +
              +
              + + +

              添加商品

              +
              +
              + + +
              +
              +
              +
              + +
              + +
              + +
              +
              + + +
              +
              + + + +
              +
              +
              +
              + + + + + + + diff --git a/templete/addshopping.html b/templete/addshopping.html new file mode 100644 index 0000000..6aead29 --- /dev/null +++ b/templete/addshopping.html @@ -0,0 +1,150 @@ + + + + + + + + + + + + +
              +
              + + +

              添加商品

              +
              +
              + + +
              +
              +
              +
              + +
              + +
              +
              + + +
              +
              + + + +
              +
              + + + +
              +
              + + +
              +
              + + + +
              +
              + + + +
              +
              + + + +
              +
              + +
              + + +
              + +
              + + +
              + +
              +
              + + +
              +
              + + + +
              +
              +
              + + + + + + +
              + +
              + + + + + + +
              下一步
              +
              + + + + +
              +
              +
              +
              +
              + + + + + diff --git a/templete/addyhk.html b/templete/addyhk.html new file mode 100644 index 0000000..fd62eaf --- /dev/null +++ b/templete/addyhk.html @@ -0,0 +1,71 @@ + + + + + + + + + + + +
              +
              + + +

              添加银行卡

              +
              +
              + +
              +
              +
              +
              + + + +
              +
              + + + +
              +
              + + +
              + +
              保存
              + +
              +
              +
              + + + + + diff --git a/templete/applicationopen.html b/templete/applicationopen.html new file mode 100644 index 0000000..40d5a8e --- /dev/null +++ b/templete/applicationopen.html @@ -0,0 +1,262 @@ + + + + + + + + + + + + +
              +
              + + +

              申请开店

              +
              +
              +
              +
              +
              +
              +
                +
              • ①基本信息
              • +
              • ②直营人收款方式
              • +
              • ③认证信息
              • +
              • ④注册协议
              • +
              +
              + +
              + +
              +
              + +
              + +
              +
              +
              + +
              + +
              +
              +
              + +
              +
              +
              +
              + +
              + + + + + + +
              + +
              +
              + +
              + + +
              +
              + + + +
              + + + + +
              + +
              + + +
              + +
              + + + + + + +
              +
              +
              + + + + +
              + +
              + +
              +
              + + + + + + + + + diff --git a/templete/appraise.html b/templete/appraise.html new file mode 100644 index 0000000..17efc3a --- /dev/null +++ b/templete/appraise.html @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + +
              +
              + + +

              评价

              +
              +
              +
              +
              +
              +
              +
              + + +
              + + +
              +
              + +
              +
              +
              + + + + + + + + + + \ No newline at end of file diff --git a/templete/bill.html b/templete/bill.html new file mode 100644 index 0000000..ee46fad --- /dev/null +++ b/templete/bill.html @@ -0,0 +1,66 @@ + + + + + + + + + + + + +
              +
              + +

              账单

              +
              + +
              +
              +
              +
              +
              +
              +
              +
              +

              消费

              +

              time

              +
              +
              -9.09
              +
              +
              +
              +
              消费
              +
              -9.09
              +
              + +
              +
              +
              + + + + + + + + diff --git a/templete/cash-out.html b/templete/cash-out.html new file mode 100644 index 0000000..c1f7744 --- /dev/null +++ b/templete/cash-out.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + +
              +
              + + +

              申请提现

              +
              +
              +
              +
              +
              +
              + +
              +

              提现金额

              + + + + +
              +
              +
              +
              +
              +
              +
              + +

              确认提现

              +
              +
              + + + +
              +
              + + + + + +
              +
              + + +
              +
              + 确认提现 +
              +
              + + + + + + + + diff --git a/templete/choiceness.html b/templete/choiceness.html new file mode 100644 index 0000000..ba068d7 --- /dev/null +++ b/templete/choiceness.html @@ -0,0 +1,113 @@ + + + + + + + + + + + + +
              +
              + + + + + + + + + + + + +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + + +
              +
              + + + + + + + + + \ No newline at end of file diff --git a/templete/commercial.html b/templete/commercial.html new file mode 100644 index 0000000..5fb31b6 --- /dev/null +++ b/templete/commercial.html @@ -0,0 +1,99 @@ + + + + + + + + + + + + +
              +
              + + +

              申请商厦

              +
              +
              +
              +
              +
              + +
              +
              + + + + +
              + +
              + +
              +
              +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              + + +
              + +
              +
              + + + + +
              +
              +
              +
              +
              +
              +
              提交等待审核
              +
              +
              +
              +
              + + + + + + + diff --git a/templete/complain.html b/templete/complain.html new file mode 100644 index 0000000..c395a99 --- /dev/null +++ b/templete/complain.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + +
              +
              + + +

              订单投诉

              +
              +
              +
              + 上传文件名字是随机文件名, 后缀保留 +
              +
              +
              +
              + + +
              你的浏览器不支持flash,Silverlight或者HTML5!
              + 选择图片 +
              + +
              +
              + + + + + + + + \ No newline at end of file diff --git a/templete/confirmOrder.html b/templete/confirmOrder.html new file mode 100644 index 0000000..de4bd96 --- /dev/null +++ b/templete/confirmOrder.html @@ -0,0 +1,293 @@ + + + + + + + + + + + + +
              +
              + + +

              确认订单

              +
              +
              + + +
              +
              +
              +
              +
              + + + + + + +
              + +
              +
              +
              + + + + + + + + + + diff --git a/templete/cooperative.html b/templete/cooperative.html new file mode 100644 index 0000000..495f32a --- /dev/null +++ b/templete/cooperative.html @@ -0,0 +1,137 @@ + + + + + + + + + + + +
              +
              + + +

              合作认证

              +

              保存

              +
              +
              +
              +
              +
              +
                +
              • + + 头像 + + +
              • + +
              • + + +
              • +
              • + + +
              • +
              • + + + +
              • +
              • + +

                + 请添加银行卡 +

                + +
              • +
              • + +

                + 请认证 +

                + +
              • + +
              • + + +
              • +
              • + + +
              • +
              • + + + +
              • + + + +
              + + + + + + + + +
              提交等待审核
              +
              +
              +
              + + + + + + + diff --git a/templete/details.html b/templete/details.html new file mode 100644 index 0000000..1748b06 --- /dev/null +++ b/templete/details.html @@ -0,0 +1,120 @@ + + + + + + + + + + + + + +
              +
              + + + +
              +
              + + +
              +
              + +
              +
              + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templete/discounts.html b/templete/discounts.html new file mode 100644 index 0000000..db64b6b --- /dev/null +++ b/templete/discounts.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + +
              + 巨惠 +
              + + + + + + + + \ No newline at end of file diff --git a/templete/distribution.html b/templete/distribution.html new file mode 100644 index 0000000..4811c2b --- /dev/null +++ b/templete/distribution.html @@ -0,0 +1,81 @@ + + + + + + + + + +
              +
              + + +

              分配券值

              +
              +
              +
              +
              + +
              + +
              + +
              +
              +
              总券值:00000
              +
              + + +
              +
              + + +
              +
              + +
              +
              +
              确认分配
              +
              +
              +
              +
              +
              + + + + + diff --git a/templete/editAddress.html b/templete/editAddress.html new file mode 100644 index 0000000..9db4a9d --- /dev/null +++ b/templete/editAddress.html @@ -0,0 +1,77 @@ + + + + + + + + + + + +
              +
              + + +

              编辑地址

              +
              +
              + +
              +
              +
              +
              + +
              +
              + +
              +
              + + + +
              + +
              是 + 否 + +
              + + +
              + +
              +
              + + + + + + diff --git a/templete/essay.html b/templete/essay.html new file mode 100644 index 0000000..80039b2 --- /dev/null +++ b/templete/essay.html @@ -0,0 +1,106 @@ + + + + + + + + + + + +
              +
              + + +

              烂笔头

              +
              +
              +
              +
              +
              +
              +
              +
              张三
              +
              +
              +
              +
              +
              +
              +
              +
              备忘录
              +
              +
              +
              +
              电话簿
              +
              +
              +
              +
              信用卡簿
              +
              +
              +
              +
              悦读悦懂
              +
              +
              + + + +
              +
              +
              +
              张三
              +
              +
              +
              +
              +
              +
              +
              +
              备忘录
              +
              +
              +
              +
              电话簿
              +
              +
              +
              +
              信用卡簿
              +
              +
              +
              +
              悦读悦懂
              +
              +
              + + + +
              +
              +
              +
              +
              + + + + + diff --git a/templete/essaylist.html b/templete/essaylist.html new file mode 100644 index 0000000..e5a812b --- /dev/null +++ b/templete/essaylist.html @@ -0,0 +1,116 @@ + + + + + + + + + + +
              +
              + + +

              烂笔头

              +
              +
              +
              +
              + +
              +
              +
              +
              张三
              +
              +
              +
              +
              +
              + +
              + +
              +
              +
              +
              +
              +
              +
              备忘录
              +
              +
              +
              +
              电话簿
              +
              +
              +
              +
              信用卡簿
              +
              + +
              +
              +
              +
              +
              张三
              +
              +
              +
              +
              +
              +
              +
              +
              +
              备忘录
              +
              +
              +
              +
              电话簿
              +
              +
              +
              +
              信用卡簿
              +
              + +
              + + + +
              +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + diff --git a/templete/friends.html b/templete/friends.html new file mode 100644 index 0000000..0e4abde --- /dev/null +++ b/templete/friends.html @@ -0,0 +1,101 @@ + + + + + + + + + + + +
              +
              + + +

              朋友

              +
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              + +
              +
              + + + +
              +
              + + + +
              +
              + + + +
              +
              + + + +
              +
              + + + +
              +
              + + + +
              + +
              +
              +
              + +
              +

              我家专属ID号

              +

              邀请好友安装APP释放爱全亮共赢

              +
              + + +
              +
              +
              + + + + + + + + diff --git a/templete/friendsList.html b/templete/friendsList.html new file mode 100644 index 0000000..0f3742f --- /dev/null +++ b/templete/friendsList.html @@ -0,0 +1,100 @@ + + + + + + + + + + + +
              +
              + + +

              朋友列表

              +
              +
              +
              +
              +
              +
              + + + + + + + + + +
              + + + + +
              +
              +
              + + + + + diff --git a/templete/goodsList.html b/templete/goodsList.html new file mode 100644 index 0000000..279ad21 --- /dev/null +++ b/templete/goodsList.html @@ -0,0 +1,120 @@ + + + + + + + + + + + + +
              +
              + + +

              商品列表

              +
              +
              +
              +
              +
              +
              +
              + + + + +
              + +
              + +
              +
              + +
              +
              + + + + + + + \ No newline at end of file diff --git a/templete/hhrrz.html b/templete/hhrrz.html new file mode 100644 index 0000000..4e44431 --- /dev/null +++ b/templete/hhrrz.html @@ -0,0 +1,56 @@ + + + + + + + + + + + +
              +
              + + +

              合伙人认证

              +
              +
              +
              +
              + +
              +
              +
              +
              + +
              +
              +
              + +
              + + + + + + diff --git a/templete/home.html b/templete/home.html new file mode 100644 index 0000000..6e6fa5e --- /dev/null +++ b/templete/home.html @@ -0,0 +1,104 @@ + + + + + + + + + + + +
              +
              + + + + +
              + +
              +
              +
              +
              刷新
              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              + + + +
              +
              + + +
              +
              + +
              +
              + + + + + + + + diff --git a/templete/income-details.html b/templete/income-details.html new file mode 100644 index 0000000..749a245 --- /dev/null +++ b/templete/income-details.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + +
              +
              + + +

              收入明细

              +
              +
              +
              +
              +
              +
              + +
              +
              可提现收入 ¥1200000
              + +
              +
              + +
              +
              韩版小小清新韩版小小清新韩版小小清新韩版小小清新韩版小小清新
              + +
              张三
              +
              2018-12-11 18:18
              +
              +
              +300元
              +
              +
              +
              +300元
              +
              +
              韩版小小清新韩版小小清新韩版小小清新韩版小小清新韩版小小清新
              + +
              张三
              +
              2018-12-11 18:18
              +
              +
              +
              +
              +300元
              +
              +
              韩版小小清新韩版小小清新韩版小小清新韩版小小清新韩版小小清新
              + +
              张三
              +
              2018-12-11 18:18
              +
              +
              +
              +
              +
              +
              + + + + + + + diff --git a/templete/indent.html b/templete/indent.html new file mode 100644 index 0000000..a579292 --- /dev/null +++ b/templete/indent.html @@ -0,0 +1,47 @@ + + + + + + + + + + + + +
              +
              + + +

              全部订单

              +
              +
              + + + + + + \ No newline at end of file diff --git a/templete/indentcon.html b/templete/indentcon.html new file mode 100644 index 0000000..ceb6b95 --- /dev/null +++ b/templete/indentcon.html @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + +
              +
              +
              +
              + +
              + + + + + + + + + + + + + diff --git a/templete/my.html b/templete/my.html new file mode 100644 index 0000000..eb4a468 --- /dev/null +++ b/templete/my.html @@ -0,0 +1,231 @@ + + + + + + + + + + + +
              +
              + +
              + + + +
              + +
              +
              + +
              +
              + + +
              + +
              +
              +

              ¥0.00

              +

              预获产品券

              +
              +
              +

              ¥0.00

              +

              预获优惠券

              +
              +
              +

              ¥0.00

              +

              预获旺旺券

              +
              +
              +

              ¥0.00

              +

              已获产品券

              +
              +
              +

              ¥0.00

              +

              已获优惠券

              +
              +
              +

              ¥0.00

              +

              已获旺旺券

              +
              + + +
              + +
              +
              +
              +

              我的订单

              +

              查看全部订单

              +
              +
              + +
              +
              + + + + + +
              +
              + + + + + + diff --git a/templete/myshop.html b/templete/myshop.html new file mode 100644 index 0000000..28c0734 --- /dev/null +++ b/templete/myshop.html @@ -0,0 +1,239 @@ + + + + + + + + + + +
              +
              + + + + + +
              +
              + +
              +
              +
              +
              +
              + +
              +
              + +
              +
              +
              + +
              +
              +
              +

              ¥000000.00

              +

              待收款

              +
              +
              +

              ¥00.00

              +

              已收款

              +
              +
              +
              +
              +

              线上订单

              +

              全部订单

              +
              +
              + +
              +
              +
              +
              +

              快捷操作

              + +
              +
              +
              +
              +

              凭证管理

              + +
              +
              +
              +

              申请提现

              + +
              +
              +
              +

              设置

              + +
              + +
              +
              + + + +
              +
              +

              店铺商品

              +
              +
              + + + + +
              +
              +
              +
              +
              + + + + + + diff --git a/templete/myshops.html b/templete/myshops.html new file mode 100644 index 0000000..bf74dd4 --- /dev/null +++ b/templete/myshops.html @@ -0,0 +1,111 @@ + + + + + + + + + + + +
              +
              + +

              店铺列表

              +
              +
              +
              +
              +
              + + + + + + +
              +
              +
              + +
              +
              +
              +
              + + + + + diff --git a/templete/order_con.html b/templete/order_con.html new file mode 100644 index 0000000..85cfcf9 --- /dev/null +++ b/templete/order_con.html @@ -0,0 +1,133 @@ + + + + + + + + + + + + +
              +
              + +
              + + + + + + + \ No newline at end of file diff --git a/templete/order_out.html b/templete/order_out.html new file mode 100644 index 0000000..6b0c61f --- /dev/null +++ b/templete/order_out.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + +
              +
              + + +

              订单详情

              +
              +
              + + + + + + + + + \ No newline at end of file diff --git a/templete/paymentVoucher.html b/templete/paymentVoucher.html new file mode 100644 index 0000000..484019a --- /dev/null +++ b/templete/paymentVoucher.html @@ -0,0 +1,249 @@ + + + + + + + + + + + +
              +
              + + +

              付款凭证

              +
              +
              +
              +
              +
              +
              +
              收款方信息
              +
              + + + +
              +
              + + + +
              +
              + + + +
              +
              +
              + + +
              +
              + + + +
              + + +
              +
              +
              + +
              +
              + + + + + diff --git a/templete/pj.html b/templete/pj.html new file mode 100644 index 0000000..6422d5e --- /dev/null +++ b/templete/pj.html @@ -0,0 +1,91 @@ + + + + + + + + + + + + +
              +
              + + +

              评价

              +
              +
              +
              + 上传文件名字是随机文件名, 后缀保留 +
              +
              +
              +
              + + +
              +
              +
              + + + + + + + + \ No newline at end of file diff --git a/templete/properties.html b/templete/properties.html new file mode 100644 index 0000000..0e9d75c --- /dev/null +++ b/templete/properties.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + +
              +
              + + +

              产品规格属性

              +
              +
              +
              +
              +
              +
              + + +
              +
              +
              + +
              +
              +
              +
              + + + + + diff --git a/templete/qrbb.html b/templete/qrbb.html new file mode 100644 index 0000000..07c1c08 --- /dev/null +++ b/templete/qrbb.html @@ -0,0 +1,58 @@ + + + + + + + + + + + +
              +
              + +

              亲人报备

              +
              +
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + +
              + + + + + + diff --git a/templete/qrrz.html b/templete/qrrz.html new file mode 100644 index 0000000..696cefa --- /dev/null +++ b/templete/qrrz.html @@ -0,0 +1,53 @@ + + + + + + + + + + + +
              +
              + + +

              亲人认证

              +
              +
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + + + + + diff --git a/templete/reg.html b/templete/reg.html new file mode 100644 index 0000000..73bfcdb --- /dev/null +++ b/templete/reg.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + +
              +
              + + +

              全亮共赢扫码注册

              +
              +
              +
              注册
              +
              +
              + + 用户名: + +
              + +
              + + 密码: + +
              +
              + + 确认密码: + +
              +
              + + 操作密码: + +
              +
              + + 确认操作密码: + +
              +
              + + 推荐人: + +
              +
              + + 验证码: + + +
              +
              + +
              +
              + +
              +
              +
              +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              +
              注册
              +
              +
              + + + + + + + + diff --git a/templete/register.html b/templete/register.html new file mode 100644 index 0000000..2cc8855 --- /dev/null +++ b/templete/register.html @@ -0,0 +1,116 @@ + + + + + + + + + + + + +
              +
              + + +

              注册

              +
              +
              + + +
              +
              +
              + + 用户名: + +
              + +
              + + 登录密码: + +
              +
              + + 确认登录密码: + +
              +
              + + 操作密码: + +
              +
              + + 确认操作密码: + +
              +
              + + 推荐人: + +
              +
              + + 验证码: + + +
              +
              + +
              +
              + +
              +
              +
              +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              +
              注册
              +
              + + + +
              + + + + + + + + diff --git a/templete/register1.html b/templete/register1.html new file mode 100644 index 0000000..44a87fa --- /dev/null +++ b/templete/register1.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + +
              +
              + + +

              全亮共赢扫码注册

              +
              +
              +
              注册
              +
              +
              + + 用户名: + +
              + +
              + + 密码: + +
              +
              + + 确认密码: + +
              +
              + + 操作密码: + +
              +
              + + 确认操作密码: + +
              +
              + + 推荐人: + +
              +
              + + 验证码: + + +
              +
              + +
              +
              + +
              +
              +
              +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              +
              注册
              +
              +
              + + + + + + + + diff --git a/templete/reviewsmanage.html b/templete/reviewsmanage.html new file mode 100644 index 0000000..6b8cf8f --- /dev/null +++ b/templete/reviewsmanage.html @@ -0,0 +1,156 @@ + + + + + + + + + + + + +
              +
              + + +

              评论管理

              +
              +
              +
              +
              +
              +
              +
              +
              5.0
              + +
              +
              +
              + +
              + +
              +
              + +
              + +
              +
              + +
              + +
              +
              + +
              + +
              +
              + +
              + +
              +
              +
              +
              +
              +
              +
              张三
              +
              2018-1-1
              +
              +
              +
              +
              + + + + +
              +
              很好
              +
              + +
              +
              删除
              +
              +
              +
              + +
              +
              +
              +
              +
              + + +
              + +
              +
              +
              +
              张三
              +
              2018-1-1
              +
              +
              +
              +
              + + + + +
              +
              很好
              +
              + +
              +
              删除
              +
              +
              +
              + +
              +
              +
              +
              +
              + + +
              + +
              +
              + +
              + +
              +
              + + + + + + diff --git a/templete/saoyisao.html b/templete/saoyisao.html new file mode 100644 index 0000000..0d6ae03 --- /dev/null +++ b/templete/saoyisao.html @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + +
              + +
              + + + + + + + \ No newline at end of file diff --git a/templete/self_shop.html b/templete/self_shop.html new file mode 100644 index 0000000..f159a6b --- /dev/null +++ b/templete/self_shop.html @@ -0,0 +1,86 @@ + + + + + + + + + + +
              +
              + + + +
              +
              +
              +
              +
              刷新
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + + + + + + + + diff --git a/templete/self_shop_remend.html b/templete/self_shop_remend.html new file mode 100644 index 0000000..f38e302 --- /dev/null +++ b/templete/self_shop_remend.html @@ -0,0 +1,88 @@ + + + + + + + + + + +
              +
              + + + +
              + +
              +
              +
              +
              刷新
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + + + + + + diff --git a/templete/setting.html b/templete/setting.html new file mode 100644 index 0000000..7cfb3a9 --- /dev/null +++ b/templete/setting.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + +
              +
              + + +

              +
              +
              +
              +
              +
              关于我们
              +
              联系我们
              +
              个人信息收货地址管理
              +
              账户安全
              +
              + + +
              退出登录
              + + + + + diff --git a/templete/setting_address.html b/templete/setting_address.html new file mode 100644 index 0000000..96d5988 --- /dev/null +++ b/templete/setting_address.html @@ -0,0 +1,68 @@ + + + + + + + + + + + + +
              +
              + + +

              +
              +
              + + + +
              +
              + + +
              + + + + + + + + \ No newline at end of file diff --git a/templete/setting_fogetPayPwd.html b/templete/setting_fogetPayPwd.html new file mode 100644 index 0000000..d8c063e --- /dev/null +++ b/templete/setting_fogetPayPwd.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + +
              +
              + + +

              设置操作密码

              +
              +
              + +
              +
              +
              + + 手机号: + + +
              +
              + + 验证码: + + +
              +
              +
              +
              下一步
              +
              + + + + + + + + \ No newline at end of file diff --git a/templete/setting_fogetPwd.html b/templete/setting_fogetPwd.html new file mode 100644 index 0000000..5dec924 --- /dev/null +++ b/templete/setting_fogetPwd.html @@ -0,0 +1,97 @@ + + + + + + + + + + + + + +
              +
              + + +

              找回密码

              +
              +
              +
              + +
              +
              + + 用户名: + + +
              +
              +
              +
              下一步
              +
              + + + + + + + + + + \ No newline at end of file diff --git a/templete/setting_loginInfo.html b/templete/setting_loginInfo.html new file mode 100644 index 0000000..8d52144 --- /dev/null +++ b/templete/setting_loginInfo.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + +
              +
              + + +

              账户安全

              +
              +
              +
              +
              +
              修改登录密码
              +
              修改/绑定手机
              +
              修改操作密码
              +
              找回操作密码
              +
              + + + + + + + \ No newline at end of file diff --git a/templete/setting_payPwd.html b/templete/setting_payPwd.html new file mode 100644 index 0000000..d2260cb --- /dev/null +++ b/templete/setting_payPwd.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + +
              +
              + + +

              修改操作密码

              +
              +
              +
              +
              +
              + + 密码: + + +
              +
              + + 新   密   码 : + +
              +
              + + 确认新密码: + +
              + +
              +
              +
              确定
              +
              + +
              + + + + + + \ No newline at end of file diff --git a/templete/setting_phone.html b/templete/setting_phone.html new file mode 100644 index 0000000..f8ae816 --- /dev/null +++ b/templete/setting_phone.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + +
              +
              + + +

              绑定手机

              +
              +
              +
              +
              +
              + + 手机号: + + +
              +
              + + 验  证  码: + + + +
              + +
              +
              + + + +
              + +
              + + + + + + \ No newline at end of file diff --git a/templete/setting_pwd.html b/templete/setting_pwd.html new file mode 100644 index 0000000..b278ea7 --- /dev/null +++ b/templete/setting_pwd.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + +
              +
              + + +

              修改密码

              +
              +
              +
              +
              +
              + + 密码: + + +
              +
              + + 新   密   码 : + +
              +
              + + 确认新密码: + +
              + +
              +
              +
              确定
              +
              + +
              +
              + + + + + + \ No newline at end of file diff --git a/templete/setting_user.html b/templete/setting_user.html new file mode 100644 index 0000000..399eb28 --- /dev/null +++ b/templete/setting_user.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + + +
              +
              + + +

              我的分享

              +
              +
              +
              +
              + +
              +
              +
              编辑收货地址
              +
              +
              + +
              +
              + + + + + + diff --git a/templete/shangdu.html b/templete/shangdu.html new file mode 100644 index 0000000..54d269d --- /dev/null +++ b/templete/shangdu.html @@ -0,0 +1,97 @@ + + + + + + + + + + + + +
              +
              + + +

              申请商都

              +
              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              + +
              +
              +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              + + +
              + +
              +
              + + + + +
              +
              +
              +
              +
              +
              +
              提交等待审核
              +
              +
              +
              +
              + + + + + + diff --git a/templete/shop-decoration.html b/templete/shop-decoration.html new file mode 100644 index 0000000..2d111fe --- /dev/null +++ b/templete/shop-decoration.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + +
              +
              + + +

              店铺装修

              +
              +
              + +
              +
              +
              + +
              + + +
              + + +
              +
              + +
              +
              +
              +
              +
              + + +
              + + +
              +
              + +
              +
              +
              +
              +
              +
              +
              +
              保存
              + + + + + + + + diff --git a/templete/shopGoodsList.html b/templete/shopGoodsList.html new file mode 100644 index 0000000..6bdc634 --- /dev/null +++ b/templete/shopGoodsList.html @@ -0,0 +1,72 @@ + + + + + + + + + + + +
              +
              + + +

              产品管理

              +
              +
              +
              +
              + +
              +
              +
              + +
              +
              + + +
              + +
              + +
              + + + + + diff --git a/templete/shop_decorate.html b/templete/shop_decorate.html new file mode 100644 index 0000000..5b3829c --- /dev/null +++ b/templete/shop_decorate.html @@ -0,0 +1,83 @@ + + + + + + + + + + + +
              +
              + + +

              店铺装修

              +
              +
              +
              +
              + +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              + + +
              + +
              +
              + + + + + +
              +
              +
              +
              +
              确认提交
              +
              + +
              + +
              + + + + + + diff --git a/templete/shop_indent.html b/templete/shop_indent.html new file mode 100644 index 0000000..c6b18b8 --- /dev/null +++ b/templete/shop_indent.html @@ -0,0 +1,47 @@ + + + + + + + + + + + +
              +
              + + +

              全部订单

              +
              +
              + + + + + + diff --git a/templete/shop_indentcon.html b/templete/shop_indentcon.html new file mode 100644 index 0000000..bcd737f --- /dev/null +++ b/templete/shop_indentcon.html @@ -0,0 +1,285 @@ + + + + + + + + + + + + + + +
              + +
              + +
              + + +
              + + + + + + + + + + diff --git a/templete/shoperUploadVoucher.html b/templete/shoperUploadVoucher.html new file mode 100644 index 0000000..4fcfbea --- /dev/null +++ b/templete/shoperUploadVoucher.html @@ -0,0 +1,75 @@ + + + + + + + + + + + +
              +
              + + +

              上传付款凭证

              +
              +
              +
              +
              +
              + +
              +
              + + +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              + + + +
              确认上传
              +
              + +
              +
              +
              + + + + + + diff --git a/templete/shopgoodList.html b/templete/shopgoodList.html new file mode 100644 index 0000000..6bdc634 --- /dev/null +++ b/templete/shopgoodList.html @@ -0,0 +1,72 @@ + + + + + + + + + + + +
              +
              + + +

              产品管理

              +
              +
              +
              +
              + +
              +
              +
              + +
              +
              + + +
              + +
              + +
              + + + + + diff --git a/templete/shoppingcart.html b/templete/shoppingcart.html new file mode 100644 index 0000000..8ac650a --- /dev/null +++ b/templete/shoppingcart.html @@ -0,0 +1,72 @@ + + + + + + + + + + + +
              +
              + +

              购物车

              +
              +
              +
              +
              +
              +
              +
              + +
              + +
              +
              + +
              + +
              +
              +
              +
              +
              + +
              +
              +
              +
              + 全选 +
              + 合计:¥0  不含运费 +
              结算(0)
              +
              +
              + + + + + + + \ No newline at end of file diff --git a/templete/shops.html b/templete/shops.html new file mode 100644 index 0000000..e746360 --- /dev/null +++ b/templete/shops.html @@ -0,0 +1,87 @@ + + + + + + + + + + +
              +
              + + + +
              + +
              +
              + +
              +
              刷新
              +
              +
              +
              +
              +
              +
              +
              +
              + + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + + + + + + + + diff --git a/templete/shopsList.html b/templete/shopsList.html new file mode 100644 index 0000000..8d50abd --- /dev/null +++ b/templete/shopsList.html @@ -0,0 +1,65 @@ + + + + + + + + + + + + +
              +
              + + +

              商店列表

              +
              +
              +
              +
              +
              +
              + + +
              + +
              +
              + + + + + + \ No newline at end of file diff --git a/templete/shopsetting.html b/templete/shopsetting.html new file mode 100644 index 0000000..136dd6b --- /dev/null +++ b/templete/shopsetting.html @@ -0,0 +1,70 @@ + + + + + + + + + + + +
              +
              + + +

              店铺管理

              +
              +
              +
              +
              +
              +
              + + +
              +
              + + +
              + +
              + + +
              +
              + + +
              + + +
              +
              +
              + + + + + + diff --git a/templete/store_commodity.html b/templete/store_commodity.html new file mode 100644 index 0000000..da4a478 --- /dev/null +++ b/templete/store_commodity.html @@ -0,0 +1,102 @@ + + + + + + + + + + + + + +
              + +
              +
              + +
              +
              +
              + + + + + + + + \ No newline at end of file diff --git a/templete/store_home.html b/templete/store_home.html new file mode 100644 index 0000000..8f10fb3 --- /dev/null +++ b/templete/store_home.html @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + +
              + +
              +
              + +
              + + +
              +
              +
              去这里
              +
              +
              +
              + +
              + +
              +
              + +
              +
              + + + + + + + + + + + diff --git a/templete/store_info.html b/templete/store_info.html new file mode 100644 index 0000000..f49cf81 --- /dev/null +++ b/templete/store_info.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + +
              +
              + + + + +
              +
              +
              + + + + + + + + + diff --git a/templete/storeout.html b/templete/storeout.html new file mode 100644 index 0000000..f2dc02b --- /dev/null +++ b/templete/storeout.html @@ -0,0 +1,110 @@ + + + + + + + + + + + + + +
              +
              + + +

              +
              关注
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + +
              +
              +
              + +
              + + + + + +
              + +
              +
              + +
              + + + + + + + + + + + + diff --git a/templete/supermarket.html b/templete/supermarket.html new file mode 100644 index 0000000..892fa0b --- /dev/null +++ b/templete/supermarket.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + +
              +
              + + +

              申请商超

              +
              +
              +
              +
              +
              + +
              +
              + + + + +
              +
              + +
              + + +
              +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              +
              + + +
              + +
              +
              + + + + + +
              +
              +
              +
              +
              +
              +
              提交等待审核
              +
              +
              +
              +
              + + + + + + + diff --git a/templete/test.html b/templete/test.html new file mode 100644 index 0000000..5a57465 --- /dev/null +++ b/templete/test.html @@ -0,0 +1,48 @@ + + + + + + + + + + + +
              + 上传文件名字是随机文件名, 后缀保留 +
              +
              +
              + +
              +
              你的浏览器不支持flash,Silverlight或者HTML5!
              + 选择文件 +
              +
              +
              + + + + + + + + diff --git a/templete/uploadVoucher.html b/templete/uploadVoucher.html new file mode 100644 index 0000000..d5256af --- /dev/null +++ b/templete/uploadVoucher.html @@ -0,0 +1,74 @@ + + + + + + + + + + + +
              +
              + + +

              上传付款凭证

              +
              +
              +
              +
              +
              +
              +
              + + +
              + +
              + + +
              + +
              +
              + + +
              +
              +
              +
              + + + +
              确认上传
              +
              + +
              +
              +
              + + + + + + diff --git a/templete/vouchers.html b/templete/vouchers.html new file mode 100644 index 0000000..c5da404 --- /dev/null +++ b/templete/vouchers.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + +
              +
              + +

              优惠券

              +
              + +
              +
              +
              +
              + +
              +
              +
              +
              +
              + + + + + + + diff --git a/templete/yhk.html b/templete/yhk.html new file mode 100644 index 0000000..a697cf4 --- /dev/null +++ b/templete/yhk.html @@ -0,0 +1,57 @@ + + + + + + + + + + + +
              +
              + + +

              银行卡管理

              +
              +
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + + + + + + + diff --git a/templete/zhuweiba.html b/templete/zhuweiba.html new file mode 100644 index 0000000..b718120 --- /dev/null +++ b/templete/zhuweiba.html @@ -0,0 +1,85 @@ + + + + + + + + + + +
              +
              + + + +
              + +
              +
              + +
              +
              刷新
              +
              +
              +
              +
              +
              +
              +
              +
              + + +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + + + + + + + + diff --git a/templete/zhuweiba_remend.html b/templete/zhuweiba_remend.html new file mode 100644 index 0000000..f9d5db1 --- /dev/null +++ b/templete/zhuweiba_remend.html @@ -0,0 +1,88 @@ + + + + + + + + + + +
              +
              + + + +
              + +
              +
              +
              +
              刷新
              +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + +
              +
              +
              +
              + +
              +
              +
              +
              +
              +
              +
              +
              +
              +
              + + + + + + +