@ -1,723 +0,0 @@ |
|||||
@charset "UTF-8"; |
|
||||
.row-content .widget { |
|
||||
min-width: 1130px; } |
|
||||
.row-content .widget-body { |
|
||||
padding: 0; } |
|
||||
.row-content .iconfont { |
|
||||
font-size: inherit; } |
|
||||
.row-content p { |
|
||||
margin: 0; } |
|
||||
.row-content .btn-resetColor { |
|
||||
padding: .4em 1em; |
|
||||
color: #444; |
|
||||
background: #fdfdfd; |
|
||||
border-color: #efefef; |
|
||||
outline: none; |
|
||||
margin-left: -4px; } |
|
||||
.row-content .btn-resetColor:focus, .row-content .btn-resetColor:hover { |
|
||||
background: #f9f9f9; } |
|
||||
|
|
||||
.work-diy { |
|
||||
padding: 20px 0; |
|
||||
align-items: flex-start; } |
|
||||
.work-diy .diy-menu { |
|
||||
width: 285px; |
|
||||
height: auto; |
|
||||
background: #fdfdfd; |
|
||||
border: 1px solid #ddd; |
|
||||
padding: 15px 10px; |
|
||||
-webkit-transition: all 0.3s; |
|
||||
transition: all 0.3s; |
|
||||
user-select: none; } |
|
||||
.work-diy .diy-menu .navs, |
|
||||
.work-diy .diy-menu .action { |
|
||||
height: auto; } |
|
||||
.work-diy .diy-menu .menu-title { |
|
||||
position: relative; |
|
||||
padding: 0 22px; |
|
||||
height: 30px; |
|
||||
border-bottom: 1px solid #eef1f5; } |
|
||||
.work-diy .diy-menu .menu-title span { |
|
||||
font-size: 1.3rem; } |
|
||||
.work-diy .diy-menu .menu-title::before { |
|
||||
content: ''; |
|
||||
position: absolute; |
|
||||
width: 4px; |
|
||||
height: 13px; |
|
||||
background: #00aeff; |
|
||||
top: 8px; |
|
||||
left: 9px; } |
|
||||
.work-diy .diy-menu .navs { |
|
||||
padding: 10px 5px; |
|
||||
border-bottom: 1px dotted #ddd; |
|
||||
position: relative; |
|
||||
display: -webkit-box; |
|
||||
display: -webkit-flex; |
|
||||
display: -ms-flexbox; |
|
||||
display: flex; } |
|
||||
.work-diy .diy-menu .navs .title { |
|
||||
font-size: 1.24rem; |
|
||||
color: #999; |
|
||||
margin: 10px 0; } |
|
||||
.work-diy .diy-menu .navs .btns-global { |
|
||||
width: 96px; } |
|
||||
.work-diy .diy-menu .navs .btns-global nav { |
|
||||
height: 40px; |
|
||||
line-height: 38px; } |
|
||||
.work-diy .diy-menu .navs nav { |
|
||||
width: 74px; |
|
||||
float: left; |
|
||||
padding: 3px 0; |
|
||||
margin: 5px; |
|
||||
border: 1px solid #dddddd; |
|
||||
text-align: center; |
|
||||
font-size: 12px; |
|
||||
cursor: pointer; |
|
||||
-webkit-transition: All 0.3s ease-in-out; |
|
||||
-moz-transition: All 0.3s ease-in-out; |
|
||||
-o-transition: All 0.3s ease-in-out; |
|
||||
transition: All 0.3s ease-in-out; } |
|
||||
.work-diy .diy-menu .navs nav p { |
|
||||
color: #424242; } |
|
||||
.work-diy .diy-menu .navs nav p.item-icon .iconfont { |
|
||||
font-size: 1.8rem; } |
|
||||
.work-diy .diy-menu .navs nav.page-setup { |
|
||||
width: auto; |
|
||||
padding: 0; |
|
||||
margin: 0; |
|
||||
position: absolute; |
|
||||
top: 12px; |
|
||||
right: 12px; |
|
||||
border-color: #fff; |
|
||||
line-height: 12px; } |
|
||||
.work-diy .diy-menu .navs nav.page-setup:hover { |
|
||||
border-color: #fff; } |
|
||||
.work-diy .diy-menu .navs nav.special { |
|
||||
background: #f4f4f4; } |
|
||||
.work-diy .diy-menu .navs nav:hover { |
|
||||
background: #fff; |
|
||||
border: 1px solid #00aeff; |
|
||||
color: #00aeff; |
|
||||
-webkit-transition: All 0.4s; |
|
||||
-moz-transition: All 0.4s; |
|
||||
-o-transition: All 0.4s; |
|
||||
transition: All 0.4s; } |
|
||||
.work-diy .diy-menu .navs nav:active { |
|
||||
-webkit-box-shadow: inset 1px 3px 5px rgba(0, 0, 0, 0.2); |
|
||||
box-shadow: inset 1px 3px 5px rgba(0, 0, 0, 0.2); } |
|
||||
.work-diy .diy-menu .action { |
|
||||
margin-top: 15px; |
|
||||
text-align: right; |
|
||||
position: relative; } |
|
||||
.work-diy .diy-menu .action:before { |
|
||||
content: ""; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 0; |
|
||||
height: 0; |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-menu .action nav { |
|
||||
margin-right: 5px; } |
|
||||
.work-diy .diy-phone { |
|
||||
width: 377px; |
|
||||
border-radius: 3px; |
|
||||
box-shadow: 0 3px 10px #dcdcdc; |
|
||||
border: 1px solid #ddd; } |
|
||||
.work-diy .diy-phone .phone-top { |
|
||||
width: 100%; |
|
||||
height: 66px; |
|
||||
text-align: center; } |
|
||||
.work-diy .diy-phone .phone-top h4 { |
|
||||
margin: 0; |
|
||||
font-size: 1.4rem; |
|
||||
font-weight: normal; |
|
||||
white-space: nowrap; |
|
||||
line-height: 88px; } |
|
||||
.work-diy .diy-phone .phone-main { |
|
||||
position: relative; |
|
||||
border-top: 0; |
|
||||
user-select: none; } |
|
||||
.work-diy .diy-phone .phone-main .dragArea { |
|
||||
overflow-y: auto; |
|
||||
height: 580px; } |
|
||||
.work-diy .diy-phone .phone-main .drag { |
|
||||
display: block; |
|
||||
overflow: hidden; |
|
||||
font-size: 1.3rem; } |
|
||||
.work-diy .diy-phone .phone-main .drag .btn-edit-del { |
|
||||
height: 16px; |
|
||||
position: absolute; |
|
||||
right: 2px; |
|
||||
bottom: 2px; |
|
||||
display: none; |
|
||||
z-index: 90; } |
|
||||
.work-diy .diy-phone .phone-main .drag .btn-edit-del > div { |
|
||||
width: 32px; |
|
||||
height: 16px; |
|
||||
line-height: 16px; |
|
||||
display: inline-block; |
|
||||
text-align: center; |
|
||||
font-size: 10px; |
|
||||
color: #fff; |
|
||||
background: rgba(0, 0, 0, 0.4); |
|
||||
margin-left: 2px; |
|
||||
cursor: pointer; |
|
||||
position: relative; |
|
||||
z-index: 11; } |
|
||||
.work-diy .diy-phone .phone-main .drag.selected .btn-edit-del, .work-diy .diy-phone .phone-main .drag:hover .btn-edit-del { |
|
||||
display: block; } |
|
||||
.work-diy .diy-phone .phone-main a { |
|
||||
color: #337ab7; } |
|
||||
.work-diy .diy-phone .phone-main .diy-search { |
|
||||
background: #f1f1f2; |
|
||||
padding: 10px 10px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-search .inner { |
|
||||
height: 30px; |
|
||||
background: #fff; |
|
||||
overflow: hidden; } |
|
||||
.work-diy .diy-phone .phone-main .diy-search .inner.radius { |
|
||||
border-radius: 5px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-search .inner.round { |
|
||||
border-radius: 30px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-search .inner .search-input { |
|
||||
height: 30px; |
|
||||
width: 100%; |
|
||||
line-height: 30px; |
|
||||
color: #999999; |
|
||||
padding: 0 10px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner { |
|
||||
display: block; |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
height: auto; |
|
||||
overflow: hidden; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner img { |
|
||||
display: none; |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner img:first-child { |
|
||||
display: block; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner .dots { |
|
||||
height: 14px; |
|
||||
padding: 0 10px; |
|
||||
position: absolute; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
bottom: 10px; |
|
||||
opacity: 0.8; |
|
||||
text-align: center; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner .dots span { |
|
||||
display: inline-block; |
|
||||
margin-left: 3px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner .dots.rectangle span { |
|
||||
height: 10px; |
|
||||
width: 16px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner .dots.square span { |
|
||||
height: 10px; |
|
||||
width: 10px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-banner .dots.round span { |
|
||||
height: 10px; |
|
||||
width: 10px; |
|
||||
border-radius: 10px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-imageSingle { |
|
||||
display: block; |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
height: auto; |
|
||||
overflow: hidden; } |
|
||||
.work-diy .diy-phone .phone-main .diy-imageSingle img { |
|
||||
display: block; |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-navBar li { |
|
||||
margin: 10px 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-navBar li .item-image { |
|
||||
text-align: center; |
|
||||
margin-bottom: 4px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-navBar li .item-image img { |
|
||||
height: 44px; |
|
||||
width: 44px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-navBar li .item-text { |
|
||||
text-align: center; } |
|
||||
.work-diy .diy-phone .phone-main .diy-guide .line { |
|
||||
height: 0; |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-video video { |
|
||||
display: block; |
|
||||
width: 100%; |
|
||||
height: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article { |
|
||||
background: #f7f7f7; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item { |
|
||||
margin-bottom: 10px; |
|
||||
padding: 15px; |
|
||||
background: #fff; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item:last-child { |
|
||||
margin-bottom: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item .article-item__image image { |
|
||||
display: block; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item .article-item__footer { |
|
||||
margin-top: 5px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item .article-item__footer .article-views { |
|
||||
font-size: 12px; |
|
||||
color: #888; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item.show-type__10 { |
|
||||
display: flex; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item.show-type__10 .article-item__left { |
|
||||
padding-right: 10px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item.show-type__10 .article-item__title { |
|
||||
min-height: 36px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item.show-type__10 .article-item__image img { |
|
||||
display: block; |
|
||||
width: 120px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item.show-type__20 .article-item__image { |
|
||||
margin-top: 12.5px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-article .article-item.show-type__20 .article-item__image img { |
|
||||
display: block; |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special { |
|
||||
line-height: normal; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-left { |
|
||||
padding: 5px 10px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-left img { |
|
||||
display: block; |
|
||||
width: 70px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-content { |
|
||||
overflow: hidden; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-content .content-item { |
|
||||
padding: 2px 0; |
|
||||
font-size: 13px; |
|
||||
color: #141414; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-content.display_1 { |
|
||||
height: 22px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-content.display_2 { |
|
||||
height: 44px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-special .special-more { |
|
||||
padding: 12px 10px; |
|
||||
font-size: 12px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .item-image img { |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display { |
|
||||
height: 0; |
|
||||
width: 100%; |
|
||||
margin: 0; |
|
||||
padding-bottom: 50%; |
|
||||
position: relative; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display img { |
|
||||
width: 100%; |
|
||||
height: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display .display-left { |
|
||||
width: 50%; |
|
||||
height: 100%; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display .display-right { |
|
||||
width: 50%; |
|
||||
height: 100%; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 50%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display .display-right1 { |
|
||||
width: 100%; |
|
||||
height: 50%; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display .display-right2 { |
|
||||
width: 100%; |
|
||||
height: 50%; |
|
||||
position: absolute; |
|
||||
top: 50%; |
|
||||
left: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display .display-right2 .left { |
|
||||
width: 50%; |
|
||||
height: 100%; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-window .display .display-right2 .right { |
|
||||
width: 50%; |
|
||||
height: 100%; |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 50%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list { |
|
||||
padding: 2px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.display__slide { |
|
||||
overflow-x: hidden; |
|
||||
white-space: nowrap; |
|
||||
font-size: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.display__slide::-webkit-scrollbar { |
|
||||
display: none; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.display__slide .goods-item { |
|
||||
display: inline-block; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.display__list .goods-item { |
|
||||
float: left; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.column__1 .goods-item { |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.column__1 .goods-item .goods-name { |
|
||||
height: auto !important; |
|
||||
min-height: 25px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.column__2 .goods-item { |
|
||||
width: 50%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list.column__3 .goods-item { |
|
||||
width: 33.33333%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item { |
|
||||
padding: 3px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .goods-image { |
|
||||
position: relative; |
|
||||
width: 100%; |
|
||||
height: 0; |
|
||||
padding-bottom: 100%; |
|
||||
overflow: hidden; |
|
||||
background: #fff; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .goods-image:after { |
|
||||
content: ''; |
|
||||
display: block; |
|
||||
margin-top: 100%; |
|
||||
/* margin 百分比相对父元素宽度计算 */ } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .goods-image img { |
|
||||
position: absolute; |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
top: 0; |
|
||||
left: 0; |
|
||||
-o-object-fit: cover; |
|
||||
object-fit: cover; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .detail { |
|
||||
padding: 4px; |
|
||||
background: #fff; |
|
||||
font-size: 1.3rem; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .detail .goods-name { |
|
||||
height: 40px; |
|
||||
overflow: hidden; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .detail .goods-price { |
|
||||
font-size: 15px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .detail .line-price { |
|
||||
font-size: 12px; |
|
||||
text-decoration: line-through; |
|
||||
color: #999; } |
|
||||
.work-diy .diy-phone .phone-main .diy-goods .goods-list .goods-item .detail .selling-point { |
|
||||
font-size: 12px; |
|
||||
color: #f20c59; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon { |
|
||||
padding: 10px 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item { |
|
||||
width: 150px; |
|
||||
height: 60px; |
|
||||
position: relative; |
|
||||
color: #fff; |
|
||||
overflow: hidden; |
|
||||
box-sizing: border-box; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item i.before { |
|
||||
content: ""; |
|
||||
position: absolute; |
|
||||
z-index: 1; |
|
||||
width: 1.6rem; |
|
||||
height: 1.6rem; |
|
||||
top: 50%; |
|
||||
left: -.8rem; |
|
||||
-webkit-transform: translateY(-50%); |
|
||||
transform: translateY(-50%); |
|
||||
-webkit-border-radius: 80%; |
|
||||
border-radius: 80%; |
|
||||
background-color: #fff; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .left-content { |
|
||||
position: relative; |
|
||||
float: left; |
|
||||
width: 70%; |
|
||||
height: 100%; |
|
||||
background-color: #E5004F; |
|
||||
font-size: 12px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .left-content .content-top .price { |
|
||||
font-size: 2rem; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .left-content.color__blue { |
|
||||
background: linear-gradient(-125deg, #57bdbf, #2f9de2); } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .left-content.color__red { |
|
||||
background: linear-gradient(-128deg, #ff6d6d, #ff3636); } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .left-content.color__violet { |
|
||||
background: linear-gradient(-113deg, #ef86ff, #b66ff5); } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .left-content.color__yellow { |
|
||||
background: linear-gradient(-141deg, #f7d059, #fdb054); } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .right-receive { |
|
||||
float: right; |
|
||||
width: 30%; |
|
||||
height: 100%; |
|
||||
background-color: #4e4e4e; |
|
||||
text-align: center; } |
|
||||
.work-diy .diy-phone .phone-main .diy-coupon .coupon-item .right-receive span { |
|
||||
font-size: 1.3rem; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods { |
|
||||
padding: 10px; |
|
||||
/* 商品图片 */ |
|
||||
/* 商品名称 */ |
|
||||
/* 商品卖点 */ |
|
||||
/* 拼团信息 */ |
|
||||
/* 商品价格 */ |
|
||||
/* 去拼团按钮 */ } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item { |
|
||||
height: 160px; |
|
||||
margin-bottom: 10px; |
|
||||
padding: 10px; |
|
||||
box-sizing: border-box; |
|
||||
background: #fff; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item:last-child { |
|
||||
margin-bottom: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item_left { |
|
||||
display: flex; |
|
||||
width: 40%; |
|
||||
background: #fff; |
|
||||
align-items: center; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item_left img { |
|
||||
display: block; |
|
||||
width: 120px; |
|
||||
height: 120px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item_right { |
|
||||
position: relative; |
|
||||
width: 60%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item_right .goods-item_title { |
|
||||
height: 36px; |
|
||||
margin-top: 10px; |
|
||||
font-size: 14px; |
|
||||
line-height: 1.3; |
|
||||
color: #333; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item_desc { |
|
||||
margin-top: 8px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .desc-selling_point { |
|
||||
width: 200px; |
|
||||
height: 16px; |
|
||||
font-size: 12px; |
|
||||
line-height: 1.4; |
|
||||
color: #ff495e; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .desc-situation { |
|
||||
margin-top: 6px; |
|
||||
font-size: 12px; |
|
||||
line-height: 1.3; |
|
||||
color: #f03c3c; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .desc-situation .people { |
|
||||
margin: 0 3px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .desc_footer { |
|
||||
margin-top: 6px; |
|
||||
font-size: 12px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .desc_footer .price_x { |
|
||||
margin-right: 10px; |
|
||||
color: #f03c3c; |
|
||||
font-size: 14px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .desc_footer .price_y { |
|
||||
text-decoration: line-through; } |
|
||||
.work-diy .diy-phone .phone-main .diy-sharingGoods .goods-item .btn-settlement { |
|
||||
position: absolute; |
|
||||
right: 0; |
|
||||
bottom: 0; |
|
||||
padding: 0 14px; |
|
||||
border-radius: 20px; |
|
||||
background: linear-gradient(to right, #eb356b 0%, #f03c3c 100%); |
|
||||
box-shadow: 0 2px 10px -2px #eb356b; |
|
||||
font-size: 14px; |
|
||||
line-height: 27px; |
|
||||
text-align: center; |
|
||||
color: #fff; } |
|
||||
.work-diy .diy-phone .phone-main .diy-notice { |
|
||||
padding: 4px 10px; |
|
||||
line-height: 26px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-notice .notice__icon { |
|
||||
font-size: 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-notice .notice__icon img { |
|
||||
width: 16px; |
|
||||
height: 16px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-notice .notice__text { |
|
||||
padding-left: 5px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-richText { |
|
||||
font-size: 14px; |
|
||||
line-height: normal; } |
|
||||
.work-diy .diy-phone .phone-main .diy-richText p { |
|
||||
padding: 0 4px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-richText img { |
|
||||
display: block; |
|
||||
width: 375px; |
|
||||
margin-left: -4px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-richText video { |
|
||||
width: 100%; } |
|
||||
.work-diy .diy-phone .phone-main .diy-richText hr { |
|
||||
margin: 5px 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-richText * + h1, .work-diy .diy-phone .phone-main .diy-richText * + h2, .work-diy .diy-phone .phone-main .diy-richText * + h3, .work-diy .diy-phone .phone-main .diy-richText * + h4, .work-diy .diy-phone .phone-main .diy-richText * + h5, .work-diy .diy-phone .phone-main .diy-richText * + h6 { |
|
||||
margin: 1.6rem 0; } |
|
||||
.work-diy .diy-phone .phone-main .diy-service { |
|
||||
position: absolute; |
|
||||
z-index: 999; } |
|
||||
.work-diy .diy-phone .phone-main .diy-service .service-icon { |
|
||||
padding: 5px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-service .service-icon img { |
|
||||
display: block; |
|
||||
width: 45px; |
|
||||
height: 45px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item { |
|
||||
padding: 8px 15px; |
|
||||
min-height: 90px; |
|
||||
font-size: 13px; |
|
||||
line-height: 1.5; |
|
||||
border-bottom: 1px solid #eee; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__logo { |
|
||||
margin-right: 15px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__logo img { |
|
||||
display: block; |
|
||||
width: 65px; |
|
||||
height: 65px; |
|
||||
border-radius: 50%; |
|
||||
border: 1px solid #ececec; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__title { |
|
||||
font-size: 14px; |
|
||||
color: #fd4a5f; |
|
||||
margin-bottom: 5px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__address, .work-diy .diy-phone .phone-main .diy-shop .shop-item__phone { |
|
||||
color: #919396; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__address { |
|
||||
width: 260px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__distance { |
|
||||
margin-top: 5px; |
|
||||
color: #c1c1c1; |
|
||||
height: 20px; } |
|
||||
.work-diy .diy-phone .phone-main .diy-shop .shop-item__distance .iconfont { |
|
||||
color: #81838e; |
|
||||
margin-right: 3px; } |
|
||||
.work-diy .diy-phone .optional { |
|
||||
position: relative; } |
|
||||
.work-diy .diy-phone .optional:before { |
|
||||
content: ""; } |
|
||||
.work-diy .diy-phone .optional.__z10:before { |
|
||||
z-index: 10; } |
|
||||
.work-diy .diy-phone .optional.__no-move:before { |
|
||||
cursor: pointer !important; } |
|
||||
.work-diy .diy-phone .optional.selected:before, .work-diy .diy-phone .optional:hover:before { |
|
||||
position: absolute; |
|
||||
top: 0; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
bottom: 0; |
|
||||
border: 2px dashed #00a0e9; |
|
||||
cursor: move; } |
|
||||
.work-diy .diy-editor { |
|
||||
width: 400px; |
|
||||
height: auto; |
|
||||
min-height: 100px; |
|
||||
padding: 15px 10px; |
|
||||
border: 1px solid #ddd; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form { |
|
||||
font-size: 1.3rem !important; |
|
||||
color: #656565; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form .am-form-group { |
|
||||
margin: 1rem 0; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form .am-form-label { |
|
||||
padding-top: 0; |
|
||||
line-height: 28px; |
|
||||
font-size: 1.3rem; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form .am-radio-inline, .work-diy .diy-editor .tpl-form-line-form .am-checkbox-inline { |
|
||||
padding-top: 0; |
|
||||
font-size: 1.3rem; |
|
||||
line-height: 28px; |
|
||||
margin: 0 10px 0 0; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form .am-radio-inline .am-ucheck-icons, .work-diy .diy-editor .tpl-form-line-form .am-checkbox-inline .am-ucheck-icons { |
|
||||
line-height: 28px; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form input[type=text] { |
|
||||
line-height: 28px; |
|
||||
font-size: 1.3rem; |
|
||||
padding: 0 5px; |
|
||||
color: #656565; } |
|
||||
.work-diy .diy-editor .tpl-form-line-form input[type=color] { |
|
||||
display: inline-block; |
|
||||
-webkit-appearance: square-button; |
|
||||
width: 65px; |
|
||||
height: 26px; |
|
||||
background-color: #ffffff; |
|
||||
border: 1px solid #efefef; |
|
||||
padding: 0 4px; |
|
||||
margin: 1px 0; |
|
||||
cursor: pointer; } |
|
||||
.work-diy .diy-editor .data-image { |
|
||||
display: inline-block; |
|
||||
width: auto; |
|
||||
min-width: 40px; |
|
||||
max-width: 220px; |
|
||||
text-align: center; |
|
||||
cursor: pointer; } |
|
||||
.work-diy .diy-editor .data-image img { |
|
||||
display: block; |
|
||||
max-width: 100%; |
|
||||
height: 50px; } |
|
||||
.work-diy .diy-editor .editor-title { |
|
||||
position: relative; |
|
||||
padding: 0 22px; |
|
||||
height: 34px; |
|
||||
border-bottom: 1px solid #eef1f5; |
|
||||
margin-bottom: 20px; } |
|
||||
.work-diy .diy-editor .editor-title::before { |
|
||||
content: ''; |
|
||||
position: absolute; |
|
||||
width: 4px; |
|
||||
height: 13px; |
|
||||
background: #00aeff; |
|
||||
top: 8px; |
|
||||
left: 9px; } |
|
||||
.work-diy .diy-editor .editor-title span { |
|
||||
font-size: 1.3rem; } |
|
||||
.work-diy .diy-editor .form-items { |
|
||||
height: auto; |
|
||||
padding: 5px 6px; } |
|
||||
.work-diy .diy-editor .form-items .form-item { |
|
||||
background: #f7fafc; |
|
||||
margin-bottom: .6rem; |
|
||||
position: relative; |
|
||||
border-radius: 3px; |
|
||||
cursor: move; } |
|
||||
.work-diy .diy-editor .form-items .form-item input { |
|
||||
background: #f7fafc; } |
|
||||
.work-diy .diy-editor .form-items .form-item .item-delete { |
|
||||
position: absolute; |
|
||||
top: -6px; |
|
||||
right: -6px; |
|
||||
height: 16px; |
|
||||
width: 16px; |
|
||||
line-height: 16px; |
|
||||
background: rgba(153, 153, 153, 0.7); |
|
||||
color: #fff; |
|
||||
border-radius: 50%; |
|
||||
text-align: center; |
|
||||
cursor: pointer; |
|
||||
font-size: 12px; |
|
||||
-webkit-transition: background-color .3s ease-out, border-color .3s ease-out; |
|
||||
transition: background-color .3s ease-out, border-color .3s ease-out; } |
|
||||
.work-diy .diy-editor .form-items .form-item .item-delete:hover { |
|
||||
background: #000; } |
|
||||
.work-diy .diy-editor .form-items .form-item .item-inner { |
|
||||
padding: 10px; |
|
||||
background: #f7fafc; } |
|
||||
.work-diy .diy-editor .form-items .form-item .item-inner .help-block { |
|
||||
margin-top: 10px; } |
|
||||
.work-diy .diy-editor .form-items.__goods .form-item { |
|
||||
float: left; |
|
||||
margin: 10px; |
|
||||
height: 70px; |
|
||||
width: 70px; } |
|
||||
.work-diy .diy-editor .form-items.__goods .data-image { |
|
||||
cursor: unset; } |
|
||||
.work-diy .diy-editor .form-item-add { |
|
||||
width: 100%; |
|
||||
background: #fdfdfd; |
|
||||
color: #6b6b6b; |
|
||||
border: 1px solid #efefef; |
|
||||
outline: none; |
|
||||
padding: 10px 16px; |
|
||||
border-radius: 2px; |
|
||||
font-size: 12px; |
|
||||
line-height: 1; |
|
||||
text-align: center; |
|
||||
vertical-align: middle; |
|
||||
cursor: pointer; |
|
||||
user-select: none; |
|
||||
-webkit-transition: All 0.2s ease-in-out; |
|
||||
-moz-transition: All 0.2s ease-in-out; |
|
||||
-o-transition: All 0.2s ease-in-out; |
|
||||
transition: All 0.2s ease-in-out; } |
|
||||
.work-diy .diy-editor .form-item-add:hover { |
|
||||
background: #f9f9f9; } |
|
||||
|
|
||||
/*# sourceMappingURL=diy.css.map */ |
|
||||
@ -1,208 +0,0 @@ |
|||||
/*! |
|
||||
* FullCalendar v0.0.0 Print Stylesheet |
|
||||
* Docs & License: http://fullcalendar.io/ |
|
||||
* (c) 2016 Adam Shaw |
|
||||
*/ |
|
||||
|
|
||||
/* |
|
||||
* Include this stylesheet on your page to get a more printer-friendly calendar. |
|
||||
* When including this stylesheet, use the media='print' attribute of the <link> tag. |
|
||||
* Make sure to include this stylesheet IN ADDITION to the regular fullcalendar.css. |
|
||||
*/ |
|
||||
|
|
||||
.fc { |
|
||||
max-width: 100% !important; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Global Event Restyling |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
.fc-event { |
|
||||
background: #fff !important; |
|
||||
color: #000 !important; |
|
||||
page-break-inside: avoid; |
|
||||
} |
|
||||
|
|
||||
.fc-event .fc-resizer { |
|
||||
display: none; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Table & Day-Row Restyling |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
.fc th, |
|
||||
.fc td, |
|
||||
.fc hr, |
|
||||
.fc thead, |
|
||||
.fc tbody, |
|
||||
.fc-row { |
|
||||
border-color: #ccc !important; |
|
||||
background: #fff !important; |
|
||||
} |
|
||||
|
|
||||
/* kill the overlaid, absolutely-positioned components */ |
|
||||
/* common... */ |
|
||||
.fc-bg, |
|
||||
.fc-bgevent-skeleton, |
|
||||
.fc-highlight-skeleton, |
|
||||
.fc-helper-skeleton, |
|
||||
/* for timegrid. within cells within table skeletons... */ |
|
||||
.fc-bgevent-container, |
|
||||
.fc-business-container, |
|
||||
.fc-highlight-container, |
|
||||
.fc-helper-container { |
|
||||
display: none; |
|
||||
} |
|
||||
|
|
||||
/* don't force a min-height on rows (for DayGrid) */ |
|
||||
.fc tbody .fc-row { |
|
||||
height: auto !important; /* undo height that JS set in distributeHeight */ |
|
||||
min-height: 0 !important; /* undo the min-height from each view's specific stylesheet */ |
|
||||
} |
|
||||
|
|
||||
.fc tbody .fc-row .fc-content-skeleton { |
|
||||
position: static; /* undo .fc-rigid */ |
|
||||
padding-bottom: 0 !important; /* use a more border-friendly method for this... */ |
|
||||
} |
|
||||
|
|
||||
.fc tbody .fc-row .fc-content-skeleton tbody tr:last-child td { /* only works in newer browsers */ |
|
||||
padding-bottom: 1em; /* ...gives space within the skeleton. also ensures min height in a way */ |
|
||||
} |
|
||||
|
|
||||
.fc tbody .fc-row .fc-content-skeleton table { |
|
||||
/* provides a min-height for the row, but only effective for IE, which exaggerates this value, |
|
||||
making it look more like 3em. for other browers, it will already be this tall */ |
|
||||
height: 1em; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Undo month-view event limiting. Display all events and hide the "more" links |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
.fc-more-cell, |
|
||||
.fc-more { |
|
||||
display: none !important; |
|
||||
} |
|
||||
|
|
||||
.fc tr.fc-limited { |
|
||||
display: table-row !important; |
|
||||
} |
|
||||
|
|
||||
.fc td.fc-limited { |
|
||||
display: table-cell !important; |
|
||||
} |
|
||||
|
|
||||
.fc-popover { |
|
||||
display: none; /* never display the "more.." popover in print mode */ |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* TimeGrid Restyling |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
/* undo the min-height 100% trick used to fill the container's height */ |
|
||||
.fc-time-grid { |
|
||||
min-height: 0 !important; |
|
||||
} |
|
||||
|
|
||||
/* don't display the side axis at all ("all-day" and time cells) */ |
|
||||
.fc-agenda-view .fc-axis { |
|
||||
display: none; |
|
||||
} |
|
||||
|
|
||||
/* don't display the horizontal lines */ |
|
||||
.fc-slats, |
|
||||
.fc-time-grid hr { /* this hr is used when height is underused and needs to be filled */ |
|
||||
display: none !important; /* important overrides inline declaration */ |
|
||||
} |
|
||||
|
|
||||
/* let the container that holds the events be naturally positioned and create real height */ |
|
||||
.fc-time-grid .fc-content-skeleton { |
|
||||
position: static; |
|
||||
} |
|
||||
|
|
||||
/* in case there are no events, we still want some height */ |
|
||||
.fc-time-grid .fc-content-skeleton table { |
|
||||
height: 4em; |
|
||||
} |
|
||||
|
|
||||
/* kill the horizontal spacing made by the event container. event margins will be done below */ |
|
||||
.fc-time-grid .fc-event-container { |
|
||||
margin: 0 !important; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* TimeGrid *Event* Restyling |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
/* naturally position events, vertically stacking them */ |
|
||||
.fc-time-grid .fc-event { |
|
||||
position: static !important; |
|
||||
margin: 3px 2px !important; |
|
||||
} |
|
||||
|
|
||||
/* for events that continue to a future day, give the bottom border back */ |
|
||||
.fc-time-grid .fc-event.fc-not-end { |
|
||||
border-bottom-width: 1px !important; |
|
||||
} |
|
||||
|
|
||||
/* indicate the event continues via "..." text */ |
|
||||
.fc-time-grid .fc-event.fc-not-end:after { |
|
||||
content: "..."; |
|
||||
} |
|
||||
|
|
||||
/* for events that are continuations from previous days, give the top border back */ |
|
||||
.fc-time-grid .fc-event.fc-not-start { |
|
||||
border-top-width: 1px !important; |
|
||||
} |
|
||||
|
|
||||
/* indicate the event is a continuation via "..." text */ |
|
||||
.fc-time-grid .fc-event.fc-not-start:before { |
|
||||
content: "..."; |
|
||||
} |
|
||||
|
|
||||
/* time */ |
|
||||
|
|
||||
/* undo a previous declaration and let the time text span to a second line */ |
|
||||
.fc-time-grid .fc-event .fc-time { |
|
||||
white-space: normal !important; |
|
||||
} |
|
||||
|
|
||||
/* hide the the time that is normally displayed... */ |
|
||||
.fc-time-grid .fc-event .fc-time span { |
|
||||
display: none; |
|
||||
} |
|
||||
|
|
||||
/* ...replace it with a more verbose version (includes AM/PM) stored in an html attribute */ |
|
||||
.fc-time-grid .fc-event .fc-time:after { |
|
||||
content: attr(data-full); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Vertical Scroller & Containers |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
/* kill the scrollbars and allow natural height */ |
|
||||
.fc-scroller, |
|
||||
.fc-day-grid-container, /* these divs might be assigned height, which we need to cleared */ |
|
||||
.fc-time-grid-container { /* */ |
|
||||
overflow: visible !important; |
|
||||
height: auto !important; |
|
||||
} |
|
||||
|
|
||||
/* kill the horizontal border/padding used to compensate for scrollbars */ |
|
||||
.fc-row { |
|
||||
border: 0 !important; |
|
||||
margin: 0 !important; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* Button Controls |
|
||||
--------------------------------------------------------------------------------------------------*/ |
|
||||
|
|
||||
.fc-button-group, |
|
||||
.fc button { |
|
||||
display: none; /* don't display any button-related controls */ |
|
||||
} |
|
||||
@ -1,152 +0,0 @@ |
|||||
@charset "UTF-8"; |
|
||||
.uploader-list .file-item img { |
|
||||
width: 110px; } |
|
||||
|
|
||||
/* 多规格 */ |
|
||||
.goods-spec-many { |
|
||||
display: none; } |
|
||||
.goods-spec-many .goods-spec-box { |
|
||||
margin-top: 15px; |
|
||||
border: 1px solid #e4e4e4; |
|
||||
padding: 20px; |
|
||||
border-radius: 4px; } |
|
||||
.goods-spec-many input { |
|
||||
font-size: 1.3rem !important; |
|
||||
padding-left: 10px !important; |
|
||||
border: 1px solid #e3e2e5 !important; } |
|
||||
.goods-spec-many input.am-field-error { |
|
||||
border-color: #dd514c !important; } |
|
||||
.goods-spec-many .spec-group-item { |
|
||||
margin-bottom: 25px; } |
|
||||
.goods-spec-many .spec-group-item .spec-group-name { |
|
||||
margin-bottom: 15px; } |
|
||||
.goods-spec-many .spec-group-item .spec-group-name span { |
|
||||
font-size: 1.5rem; } |
|
||||
.goods-spec-many .spec-group-item .spec-group-name .icon-shanchu1 { |
|
||||
display: inline-block; } |
|
||||
.goods-spec-many .spec-group-item .spec-list .spec-item { |
|
||||
position: relative; |
|
||||
margin-right: 12px; |
|
||||
margin-bottom: 12px; } |
|
||||
.goods-spec-many .spec-group-item .spec-list .spec-item span { |
|
||||
min-width: 50px; |
|
||||
display: inline-block; |
|
||||
border: 1px solid #ddd; |
|
||||
text-align: center; |
|
||||
padding: 0 15px; |
|
||||
border-radius: 2px; |
|
||||
font-size: 1.3rem; |
|
||||
line-height: 30px; } |
|
||||
.goods-spec-many .spec-group-item .spec-list .spec-item:hover .icon-shanchu1 { |
|
||||
visibility: visible; } |
|
||||
.goods-spec-many .spec-group-item .spec-list .spec-item .icon-shanchu1 { |
|
||||
position: absolute; |
|
||||
width: 20px; |
|
||||
top: -9px; |
|
||||
right: -9px; |
|
||||
visibility: hidden; } |
|
||||
.goods-spec-many .spec-group-item .spec-item-add input { |
|
||||
width: 110px; |
|
||||
border-top-left-radius: 4px; |
|
||||
border-bottom-left-radius: 4px; } |
|
||||
.goods-spec-many .spec-group-item .spec-item-add button { |
|
||||
display: table-cell; |
|
||||
height: 32px; |
|
||||
font-size: 1.3rem; |
|
||||
border-color: #e3e2e5; |
|
||||
border-left: none; |
|
||||
border-top-right-radius: 4px; |
|
||||
border-bottom-right-radius: 4px; |
|
||||
outline: none; } |
|
||||
.goods-spec-many .icon-shanchu1 { |
|
||||
cursor: pointer; |
|
||||
text-align: center; |
|
||||
color: #ababab; |
|
||||
font-size: 1.3rem; } |
|
||||
.goods-spec-many .icon-shanchu1:hover { |
|
||||
color: #6b6b6b; } |
|
||||
.goods-spec-many .spec-group-button button { |
|
||||
color: #2589ff; |
|
||||
background-color: #fff; |
|
||||
border-color: #2589ff; |
|
||||
font-size: 12px; |
|
||||
border-radius: 4px; |
|
||||
outline: 0; |
|
||||
font-weight: 400; |
|
||||
padding: .6em 1em; |
|
||||
outline: none !important; } |
|
||||
.goods-spec-many .spec-group-add .spec-group-add-item { |
|
||||
margin-bottom: 10px; } |
|
||||
.goods-spec-many .spec-group-add .spec-group-add-item input { |
|
||||
width: 160px; |
|
||||
border-radius: 4px; |
|
||||
display: inline-block; |
|
||||
margin-left: 12px; } |
|
||||
.goods-spec-many .goods-sku .goods-spec-line { |
|
||||
border: 1px dashed #e3e2e5; } |
|
||||
.goods-spec-many .goods-sku .spec-batch { |
|
||||
margin-bottom: 1.5rem; } |
|
||||
.goods-spec-many .goods-sku .spec-batch .am-form-label { |
|
||||
padding-top: 0; } |
|
||||
.goods-spec-many .goods-sku .spec-batch .am-form-group { |
|
||||
margin-left: .6rem; |
|
||||
margin-bottom: .8rem; } |
|
||||
.goods-spec-many .goods-sku .spec-batch .am-form-group input { |
|
||||
width: 140px; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.td-spec-value { |
|
||||
padding: .7rem 1.3rem !important; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image { |
|
||||
font-size: 0; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .upload-image { |
|
||||
display: inline-block; |
|
||||
width: 32px; |
|
||||
height: 32px; |
|
||||
border: 1px dashed #E3E2E5; |
|
||||
border-radius: 4px; |
|
||||
text-align: center; |
|
||||
cursor: pointer; |
|
||||
color: #B2AEBC; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .upload-image .iconfont { |
|
||||
line-height: 32px; |
|
||||
font-size: 1.2rem; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .upload-image:hover { |
|
||||
border: 1px dashed #2589ff; |
|
||||
color: #2589ff; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .data-image { |
|
||||
position: relative; |
|
||||
display: inline-block; |
|
||||
width: 32px; |
|
||||
height: 32px; |
|
||||
cursor: pointer; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .data-image img { |
|
||||
width: 100%; |
|
||||
height: 100%; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .data-image .image-delete { |
|
||||
display: none; |
|
||||
position: absolute; |
|
||||
top: -8px; |
|
||||
right: -8px; |
|
||||
cursor: pointer; |
|
||||
height: 15px; |
|
||||
width: 15px; |
|
||||
line-height: 15px; |
|
||||
background: rgba(153, 153, 153, 0.7); |
|
||||
border-radius: 50%; |
|
||||
text-align: center; |
|
||||
color: #fff !important; |
|
||||
font-size: 1rem; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .data-image .image-delete:hover { |
|
||||
background: #000; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel td.spec-image .data-image:hover .image-delete { |
|
||||
display: block; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel input { |
|
||||
display: inline-block !important; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel input.ipt-goods-no { |
|
||||
width: 140px; } |
|
||||
.goods-spec-many .goods-sku .spec-sku-tabel input.ipt-w80 { |
|
||||
width: 80px; } |
|
||||
.goods-spec-many .spec-group-button button:hover, .goods-spec-many .spec-group-button button:focus { |
|
||||
color: #fbfbfb; |
|
||||
background-color: #19a7f0; } |
|
||||
|
|
||||
/*# sourceMappingURL=goods.css.map */ |
|
||||
@ -1,232 +0,0 @@ |
|||||
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
border: 0; |
|
||||
outline: 0; |
|
||||
font-size: 100%; |
|
||||
vertical-align: baseline; |
|
||||
background: transparent; |
|
||||
outline-style: none |
|
||||
} |
|
||||
|
|
||||
@keyframes fade-in { |
|
||||
0% { |
|
||||
opacity: 0; |
|
||||
} |
|
||||
|
|
||||
/*初始状态 透明度为0*/ |
|
||||
40% { |
|
||||
opacity: 0; |
|
||||
} |
|
||||
|
|
||||
/*过渡状态 透明度为0*/ |
|
||||
100% { |
|
||||
opacity: 1; |
|
||||
} |
|
||||
|
|
||||
/*结束状态 透明度为1*/ |
|
||||
} |
|
||||
|
|
||||
@-webkit-keyframes fade-in { |
|
||||
|
|
||||
/*针对webkit内核*/ |
|
||||
0% { |
|
||||
opacity: 0; |
|
||||
} |
|
||||
40% { |
|
||||
opacity: 0; |
|
||||
} |
|
||||
100% { |
|
||||
opacity: 1; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
#wrapper { |
|
||||
animation: fade-in; /*动画名称*/ |
|
||||
animation-duration: .6s; /*动画持续时间*/ |
|
||||
-webkit-animation: fade-in .6s; /*针对webkit内核*/ |
|
||||
} |
|
||||
|
|
||||
body { |
|
||||
line-height: 1; |
|
||||
font: 14px/1.5 "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", Roboto, Arial, sans-serif; |
|
||||
} |
|
||||
|
|
||||
a { |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
border: 0; |
|
||||
font-size: 100%; |
|
||||
vertical-align: baseline; |
|
||||
background: transparent |
|
||||
} |
|
||||
|
|
||||
a:hover, a:focus { |
|
||||
text-decoration: none; |
|
||||
bblr: expression(this.onFocus=this.blur()); |
|
||||
outline-style: none |
|
||||
} |
|
||||
|
|
||||
table { |
|
||||
border-collapse: collapse; |
|
||||
border-spacing: 0 |
|
||||
} |
|
||||
|
|
||||
input, select { |
|
||||
vertical-align: middle |
|
||||
} |
|
||||
|
|
||||
* { |
|
||||
-webkit-box-sizing: border-box; |
|
||||
-moz-box-sizing: border-box; |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
|
|
||||
.clearfix::before, .clearfix::after { |
|
||||
content: ""; |
|
||||
height: 0; |
|
||||
line-height: 0; |
|
||||
display: block; |
|
||||
visibility: hidden; |
|
||||
clear: both |
|
||||
} |
|
||||
|
|
||||
.clearfix:after { |
|
||||
clear: both |
|
||||
} |
|
||||
|
|
||||
.clearfix { |
|
||||
*zoom: 1 |
|
||||
} |
|
||||
|
|
||||
/* login */ |
|
||||
html, body { |
|
||||
height: 100%; |
|
||||
} |
|
||||
|
|
||||
.page-login-v3:before { |
|
||||
position: fixed; |
|
||||
top: 0; |
|
||||
left: 0; |
|
||||
z-index: -1; |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
content: ''; |
|
||||
background: #62a8ea; |
|
||||
background: url(../../img/login_bg.jpg) center center/cover no-repeat !important; |
|
||||
} |
|
||||
|
|
||||
.container { |
|
||||
text-align: center; |
|
||||
height: 100%; |
|
||||
} |
|
||||
|
|
||||
.container:before { |
|
||||
display: inline-block; |
|
||||
height: 100%; |
|
||||
vertical-align: middle; |
|
||||
content: ""; |
|
||||
} |
|
||||
|
|
||||
.login-body { |
|
||||
display: inline-block; |
|
||||
vertical-align: middle; |
|
||||
width: 400px; |
|
||||
margin: 75px 0; |
|
||||
background: #fff; |
|
||||
border-radius: 4px; |
|
||||
padding: 50px 40px 40px; |
|
||||
-webkit-box-sizing: border-box; |
|
||||
-moz-box-sizing: border-box; |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
|
|
||||
.login-content { |
|
||||
} |
|
||||
|
|
||||
.login-content .brand .brand-img { |
|
||||
width: 50px; |
|
||||
} |
|
||||
|
|
||||
.login-content .brand .brand-text { |
|
||||
margin-top: 20px; |
|
||||
margin-bottom: 11px; |
|
||||
font-size: 20px !important; |
|
||||
font-family: "Microsoft YaHei"; |
|
||||
text-shadow: rgba(0, 0, 0, .15) 0 0 1px; |
|
||||
font-weight: 400; |
|
||||
color: #37474f; |
|
||||
} |
|
||||
|
|
||||
.login-form { |
|
||||
margin: 45px 0 30px; |
|
||||
} |
|
||||
|
|
||||
.login-form .form-group { |
|
||||
margin: 30px 0; |
|
||||
} |
|
||||
|
|
||||
.login-form input { |
|
||||
display: block; |
|
||||
border: 0; |
|
||||
border-radius: 0; |
|
||||
-webkit-box-shadow: none; |
|
||||
box-shadow: none; |
|
||||
width: 100%; |
|
||||
border-bottom: 1px solid #E4EAEC; |
|
||||
font-size: 14px; |
|
||||
height: 42px; |
|
||||
line-height: 1.5; |
|
||||
outline: none; |
|
||||
padding: 0 5px; |
|
||||
color: #a3afb7; |
|
||||
font: 14px/1.5 "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", Roboto, Arial, sans-serif; |
|
||||
transition: all 0.3s ease-in-out; |
|
||||
-moz-transition: all 0.3s ease-in-out; |
|
||||
-webkit-transition: all 0.3s ease-in-out; |
|
||||
-o-transition: all 0.3s ease-in-out; |
|
||||
} |
|
||||
|
|
||||
.login-form input:focus { |
|
||||
border-bottom: 1px solid #ff5060; |
|
||||
} |
|
||||
|
|
||||
.login-form button { |
|
||||
width: 100%; |
|
||||
margin-top: 20px; |
|
||||
padding: 10px 18px; |
|
||||
font-size: 18px; |
|
||||
line-height: 1.3333333; |
|
||||
border-radius: 4px; |
|
||||
white-space: normal; |
|
||||
-webkit-transition: border .2s linear, color .2s linear, width .2s linear, background-color .2s linear; |
|
||||
-o-transition: border .2s linear, color .2s linear, width .2s linear, background-color .2s linear; |
|
||||
transition: border .2s linear, color .2s linear, width .2s linear, background-color .2s linear; |
|
||||
-webkit-font-smoothing: subpixel-antialiased; |
|
||||
color: #fff; |
|
||||
background-color: #ff5060; |
|
||||
/*border-color: #ff5060;*/ |
|
||||
border: 1px solid transparent; |
|
||||
cursor: pointer; |
|
||||
outline: none; |
|
||||
} |
|
||||
|
|
||||
.login-form button[disabled], .login-form button[disabled]:hover { |
|
||||
color: #fff; |
|
||||
background-color: #a2caee; |
|
||||
border-color: #a2caee; |
|
||||
cursor: not-allowed; |
|
||||
opacity: .65; |
|
||||
} |
|
||||
|
|
||||
.login-form button:hover { |
|
||||
background-color: #fd717e; |
|
||||
border-color: #fd717e; |
|
||||
} |
|
||||
|
|
||||
@media screen and (max-width: 404px) { |
|
||||
.login-body { |
|
||||
width: 310px; |
|
||||
padding: 50px 30px 40px; |
|
||||
} |
|
||||
} |
|
||||
|
Before Width: | Height: | Size: 318 B |
|
Before Width: | Height: | Size: 502 KiB |
|
Before Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 205 KiB |
|
Before Width: | Height: | Size: 674 B |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 554 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 82 KiB |
@ -1,740 +0,0 @@ |
|||||
/** |
|
||||
* jquery全局函数封装 |
|
||||
*/ |
|
||||
(function ($) { |
|
||||
/** |
|
||||
* Jquery类方法 |
|
||||
*/ |
|
||||
$.fn.extend({ |
|
||||
|
|
||||
superForm: function (option) { |
|
||||
// 默认选项
|
|
||||
var defaultOption = { |
|
||||
buildData: function () { |
|
||||
return {}; |
|
||||
}, |
|
||||
validation: function () { |
|
||||
return true; |
|
||||
} |
|
||||
}; |
|
||||
option = $.extend(true, {}, defaultOption, option); |
|
||||
|
|
||||
var $form = $(this) |
|
||||
, btn_submit = $('.j-submit'); |
|
||||
$form.validator({ |
|
||||
onValid: function (validity) { |
|
||||
$(validity.field).next('.am-alert').hide(); |
|
||||
}, |
|
||||
/** |
|
||||
* 显示错误信息 |
|
||||
* @param validity |
|
||||
*/ |
|
||||
onInValid: function (validity) { |
|
||||
var $field = $(validity.field) |
|
||||
, $group = $field.parent() |
|
||||
, $alert = $group.find('.am-alert'); |
|
||||
|
|
||||
if ($field.data('validationMessage') !== undefined) { |
|
||||
// 使用自定义的提示信息 或 插件内置的提示信息
|
|
||||
var msg = $field.data('validationMessage') || this.getValidationMessage(validity); |
|
||||
if (!$alert.length) { |
|
||||
$alert = $('<div class="am-alert am-alert-danger"></div>').hide().appendTo($group); |
|
||||
} |
|
||||
$alert.html(msg).show(); |
|
||||
} |
|
||||
}, |
|
||||
submit: function () { |
|
||||
if (this.isFormValid() === true) { |
|
||||
// 自定义验证
|
|
||||
if (!option.validation()) |
|
||||
return false; |
|
||||
// 禁用按钮, 防止二次提交
|
|
||||
btn_submit.attr('disabled', true); |
|
||||
// 表单提交
|
|
||||
$form.ajaxSubmit({ |
|
||||
type: "post", |
|
||||
dataType: "json", |
|
||||
data: option.buildData(), |
|
||||
success: function (result) { |
|
||||
result.code === 1 ? $.show_success(result.msg, result.url) |
|
||||
: $.show_error(result.msg); |
|
||||
btn_submit.attr('disabled', false); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除元素 |
|
||||
*/ |
|
||||
delete: function (index, url, msg) { |
|
||||
$(this).click(function () { |
|
||||
var param = {}; |
|
||||
param[index] = $(this).attr('data-id'); |
|
||||
layer.confirm(msg ? msg : '确定要删除吗?', {title: '友情提示'} |
|
||||
, function (index) { |
|
||||
$.post(url, param, function (result) { |
|
||||
result.code === 1 ? $.show_success(result.msg, result.url) |
|
||||
: $.show_error(result.msg); |
|
||||
}); |
|
||||
layer.close(index); |
|
||||
} |
|
||||
); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 选择图片文件 |
|
||||
* @param option |
|
||||
*/ |
|
||||
selectImages: function (option) { |
|
||||
var $this = this |
|
||||
// 配置项
|
|
||||
, defaults = { |
|
||||
name: 'iFile' // input name
|
|
||||
, imagesList: '.uploader-list' // 图片列表容器
|
|
||||
, imagesItem: '.file-item' // 图片元素容器
|
|
||||
, imageDelete: '.file-item-delete' // 删除按钮元素
|
|
||||
, multiple: false // 是否多选
|
|
||||
, limit: null // 图片数量 (如果存在done回调函数则无效)
|
|
||||
, done: null // 选择完成后的回调函数
|
|
||||
} |
|
||||
, options = $.extend({}, defaults, option); |
|
||||
// 显示文件库 选择文件
|
|
||||
$this.fileLibrary({ |
|
||||
type: 'image' |
|
||||
, done: function (data, $touch) { |
|
||||
// 判断回调参数是否存在, 否则执行默认
|
|
||||
if (typeof options.done === 'function') { |
|
||||
return options.done(data, $touch); |
|
||||
} |
|
||||
// 新增图片列表
|
|
||||
var list = options.multiple ? data : [data[0]]; |
|
||||
var $html = $(template('tpl-file-item', {list: list, name: options.name})) |
|
||||
, $imagesList = $this.next(options.imagesList); |
|
||||
if ( |
|
||||
options.limit > 0 |
|
||||
&& $imagesList.find(options.imagesItem).length + list.length > options.limit |
|
||||
) { |
|
||||
layer.msg('图片数量不能大于' + options.limit + '张', {anim: 6}); |
|
||||
return false; |
|
||||
} |
|
||||
// 注册删除事件
|
|
||||
$html.find(options.imageDelete).click(function () { |
|
||||
$(this).parent().remove(); |
|
||||
}); |
|
||||
// 渲染html
|
|
||||
options.multiple ? $imagesList.append($html) : $imagesList.html($html); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 封装:ajaxSubmit |
|
||||
* @param option |
|
||||
*/ |
|
||||
myAjaxSubmit: function (option) { |
|
||||
var $this = this; |
|
||||
var options = $.extend({}, { |
|
||||
type: 'post' |
|
||||
, dataType: 'json' |
|
||||
, url: '' |
|
||||
, data: {} |
|
||||
, success: $.noop |
|
||||
}, option); |
|
||||
$this.ajaxSubmit({ |
|
||||
type: options.type, |
|
||||
dataType: options.dataType, |
|
||||
url: options.url, |
|
||||
data: options.data, |
|
||||
success: function (result) { |
|
||||
result.code === 1 ? $.show_success(result.msg, result.url) |
|
||||
: $.show_error(result.msg); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
/** |
|
||||
* Jquery全局函数 |
|
||||
*/ |
|
||||
$.extend({ |
|
||||
|
|
||||
/** |
|
||||
* 对象转URL |
|
||||
*/ |
|
||||
urlEncode: function (data) { |
|
||||
var _result = []; |
|
||||
for (var key in data) { |
|
||||
var value = null; |
|
||||
if (data.hasOwnProperty(key)) value = data[key]; |
|
||||
if (value.constructor === Array) { |
|
||||
value.forEach(function (_value) { |
|
||||
_result.push(key + "=" + _value); |
|
||||
}); |
|
||||
} else { |
|
||||
_result.push(key + '=' + value); |
|
||||
} |
|
||||
} |
|
||||
return _result.join('&'); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 操作成功弹框提示 |
|
||||
* @param msg |
|
||||
* @param url |
|
||||
*/ |
|
||||
show_success: function (msg, url) { |
|
||||
layer.msg(msg, { |
|
||||
icon: 1 |
|
||||
, time: 1200 |
|
||||
// , anim: 1
|
|
||||
, shade: 0.5 |
|
||||
, end: function () { |
|
||||
(url !== undefined && url.length > 0) ? window.location = url : window.location.reload(); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 操作失败弹框提示 |
|
||||
* @param msg |
|
||||
* @param reload |
|
||||
*/ |
|
||||
show_error: function (msg, reload) { |
|
||||
var time = reload ? 1200 : 0; |
|
||||
layer.alert(msg, { |
|
||||
title: '提示' |
|
||||
, icon: 2 |
|
||||
, time: time |
|
||||
, anim: 6 |
|
||||
, end: function () { |
|
||||
reload && window.location.reload(); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 文件上传 (单文件) |
|
||||
* 支持同一页面多个上传元素 |
|
||||
* $.uploadImage({ |
|
||||
* pick: '.upload-file', // 上传按钮
|
|
||||
* list: '.uploader-list' // 缩略图容器
|
|
||||
* }); |
|
||||
*/ |
|
||||
uploadImage: function (option) { |
|
||||
// 文件大小
|
|
||||
var maxSize = option.maxSize !== undefined ? option.maxSize : 2 |
|
||||
// 初始化Web Uploader
|
|
||||
, uploader = WebUploader.create({ |
|
||||
// 选完文件后,是否自动上传。
|
|
||||
auto: true, |
|
||||
// 允许重复上传
|
|
||||
duplicate: true, |
|
||||
// 文件接收服务端。
|
|
||||
server: STORE_URL + '/upload/image', |
|
||||
// 选择文件的按钮。可选。
|
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
|
||||
pick: { |
|
||||
id: option.pick, |
|
||||
multiple: false |
|
||||
}, |
|
||||
// 文件上传域的name
|
|
||||
fileVal: 'iFile', |
|
||||
// 图片上传前不进行压缩
|
|
||||
compress: false, |
|
||||
// 文件总数量
|
|
||||
// fileNumLimit: 1,
|
|
||||
// 文件大小2m => 2097152
|
|
||||
fileSingleSizeLimit: maxSize * 1024 * 1024, |
|
||||
// 只允许选择图片文件。
|
|
||||
accept: { |
|
||||
title: 'Images', |
|
||||
extensions: 'gif,jpg,jpeg,bmp,png', |
|
||||
mimeTypes: 'image/*' |
|
||||
}, |
|
||||
// 缩略图配置
|
|
||||
thumb: { |
|
||||
quality: 100, |
|
||||
crop: false, |
|
||||
allowMagnify: false |
|
||||
}, |
|
||||
// 文件上传header扩展
|
|
||||
headers: { |
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01', |
|
||||
'X-Requested-With': 'XMLHttpRequest' |
|
||||
} |
|
||||
}); |
|
||||
// 验证大小
|
|
||||
uploader.on('error', function (type) { |
|
||||
// console.log(type);
|
|
||||
if (type === "F_DUPLICATE") { |
|
||||
// console.log("请不要重复选择文件!");
|
|
||||
} else if (type === "F_EXCEED_SIZE") { |
|
||||
alert("文件大小不可超过" + maxSize + "m 哦!换个小点的文件吧!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
// 当有文件添加进来的时候
|
|
||||
uploader.on('fileQueued', function (file) { |
|
||||
var $uploadFile = $('#rt_' + file.source.ruid).parent() |
|
||||
, $list = $uploadFile.next(option.list) |
|
||||
, $li = $( |
|
||||
'<div id="' + file.id + '" class="file-item thumbnail">' + |
|
||||
'<img>' + |
|
||||
'<input type="hidden" name="' + $uploadFile.data('name') + '" value="">' + |
|
||||
'<i class="iconfont icon-shanchu file-item-delete"></i>' + |
|
||||
'</div>' |
|
||||
), |
|
||||
$img = $li.find('img'), |
|
||||
$delete = $li.find('.file-item-delete'); |
|
||||
// 删除文件
|
|
||||
$delete.on('click', function () { |
|
||||
uploader.removeFile(file); |
|
||||
$delete.parent().remove(); |
|
||||
}); |
|
||||
// $list为容器jQuery实例
|
|
||||
$list.empty().append($li); |
|
||||
// 创建缩略图
|
|
||||
// 如果为非图片文件,可以不用调用此方法。
|
|
||||
// thumbnailWidth x thumbnailHeight 为 100 x 100
|
|
||||
uploader.makeThumb(file, function (error, src) { |
|
||||
if (error) { |
|
||||
$img.replaceWith('<span>不能预览</span>'); |
|
||||
return; |
|
||||
} |
|
||||
$img.attr('src', src); |
|
||||
}, 1, 1); |
|
||||
}); |
|
||||
// 文件上传成功,给item添加成功class, 用样式标记上传成功。
|
|
||||
uploader.on('uploadSuccess', function (file, response) { |
|
||||
if (response.code === 1) { |
|
||||
var $item = $('#' + file.id); |
|
||||
$item.addClass('upload-state-done') |
|
||||
.children('input[type=hidden]').val(response.data.path); |
|
||||
} else |
|
||||
uploader.uploadError(file); |
|
||||
}); |
|
||||
// 文件上传失败
|
|
||||
uploader.on('uploadError', function (file) { |
|
||||
uploader.uploadError(file); |
|
||||
}); |
|
||||
// 显示上传出错信息
|
|
||||
uploader.uploadError = function (file) { |
|
||||
var $li = $('#' + file.id), |
|
||||
$error = $li.find('div.error'); |
|
||||
// 避免重复创建
|
|
||||
if (!$error.length) { |
|
||||
$error = $('<div class="error"></div>').appendTo($li); |
|
||||
} |
|
||||
$error.text('上传失败'); |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 显示模态对话框 |
|
||||
* @param option |
|
||||
*/ |
|
||||
showModal: function (option) { |
|
||||
var options = $.extend({}, { |
|
||||
title: '' |
|
||||
, area: '340px' |
|
||||
, content: '' |
|
||||
, success: $.noop |
|
||||
, yes: $.noop |
|
||||
, uCheck: false |
|
||||
}, option); |
|
||||
|
|
||||
var $content; |
|
||||
layer.open({ |
|
||||
type: 1 |
|
||||
, title: options.title |
|
||||
, area: options.area |
|
||||
, offset: 'auto' |
|
||||
, anim: 1 |
|
||||
, closeBtn: 1 |
|
||||
, shade: 0.3 |
|
||||
, btn: ['确定', '取消'] |
|
||||
, content: options.content |
|
||||
, success: function (layero) { |
|
||||
$content = layero.find('.layui-layer-content'); |
|
||||
if (options.uCheck) { |
|
||||
$content.find("input[type='checkbox'],input[type='radio']").uCheck(); |
|
||||
} |
|
||||
options.success.call(true, $content); |
|
||||
} |
|
||||
, yes: function (index) { |
|
||||
if (options.yes.call(true, $content)) { |
|
||||
layer.close(index); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
})(jQuery); |
|
||||
|
|
||||
/** |
|
||||
* app.js |
|
||||
*/ |
|
||||
$(function () { |
|
||||
|
|
||||
/** |
|
||||
* 点击侧边开关 (一级) |
|
||||
*/ |
|
||||
$('.switch-button').on('click', function () { |
|
||||
var header = $('.tpl-header'), wrapper = $('.tpl-content-wrapper'), leftSidebar = $('.left-sidebar'); |
|
||||
if (leftSidebar.css('left') !== "0px") { |
|
||||
header.removeClass('active') && wrapper.removeClass('active') && leftSidebar.css('left', 0); |
|
||||
} else { |
|
||||
header.addClass('active') && wrapper.addClass('active') && leftSidebar.css('left', -280); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
/** |
|
||||
* 侧边栏开关 (二级) |
|
||||
*/ |
|
||||
$('.sidebar-nav-sub-title').click(function () { |
|
||||
$(this).toggleClass('active'); |
|
||||
}); |
|
||||
|
|
||||
// 刷新按钮
|
|
||||
$('.refresh-button').click(function () { |
|
||||
window.location.reload(); |
|
||||
}); |
|
||||
|
|
||||
// 删除图片 (数据库已有的)
|
|
||||
$('.file-item-delete').click(function () { |
|
||||
var $this = $(this) |
|
||||
, noClick = $this.data('noClick') |
|
||||
, name = $this.data('name'); |
|
||||
|
|
||||
if (noClick) { |
|
||||
return false; |
|
||||
} |
|
||||
layer.confirm('您确定要删除该' + (name ? name : '图片') + '吗?', { |
|
||||
title: '友情提示' |
|
||||
}, function (index) { |
|
||||
$this.parent().remove(); |
|
||||
layer.close(index); |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
//******* 地区选择插件 *******//
|
|
||||
(function () { |
|
||||
|
|
||||
/*** |
|
||||
* 地区选择插件 |
|
||||
* @param container |
|
||||
* @param datas |
|
||||
* @constructor |
|
||||
*/ |
|
||||
function RegionalChoice(container, datas) { |
|
||||
this.container = container; |
|
||||
this.datas = datas; |
|
||||
this.initInterface(); // 初始化地域界面
|
|
||||
} |
|
||||
|
|
||||
RegionalChoice.prototype = { |
|
||||
|
|
||||
/** |
|
||||
* 条件渲染 |
|
||||
* @param alreadyIds 已存在的区域ID: 用于新增 |
|
||||
* @param checkedIds 已选中的区域ID: 用于编辑 |
|
||||
* @param |
|
||||
*/ |
|
||||
render: function (alreadyIds, checkedIds) { |
|
||||
alreadyIds = alreadyIds || []; |
|
||||
alreadyIds.length > 0 && this.setAlready(alreadyIds); |
|
||||
checkedIds = checkedIds || []; |
|
||||
checkedIds.length > 0 && this.setChecked(checkedIds); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 初始化地域界面 |
|
||||
*/ |
|
||||
initInterface: function () { |
|
||||
var _this = this; |
|
||||
$(_this.container).append( |
|
||||
$('<div/>', { |
|
||||
class: 'place-div' |
|
||||
}).append( |
|
||||
$('<div/>', {}).append( |
|
||||
$('<div/>', { |
|
||||
class: 'checkbtn' |
|
||||
}) |
|
||||
.append( |
|
||||
$('<label/>', {}) |
|
||||
// 全选框
|
|
||||
.append( |
|
||||
$('<input/>', { |
|
||||
type: 'checkbox', |
|
||||
change: function () { |
|
||||
var checked = $(this).is(':checked'), |
|
||||
$allCheckbox = $('.place').find('input[type=checkbox]'); |
|
||||
$('.ratio').html(''); |
|
||||
$allCheckbox.prop('checked', checked); |
|
||||
} |
|
||||
}) |
|
||||
) |
|
||||
.append(' 全国') |
|
||||
) |
|
||||
.append( |
|
||||
$('<a/>', { |
|
||||
class: 'clearCheck', |
|
||||
text: '清空', |
|
||||
click: function () { |
|
||||
_this.destroy(); |
|
||||
} |
|
||||
}) |
|
||||
) |
|
||||
).append( |
|
||||
// 省份
|
|
||||
$('<div/>', { |
|
||||
class: 'place clearfloat' |
|
||||
}).append(function () { |
|
||||
return _this.getSmallPlace(); |
|
||||
}()) |
|
||||
) |
|
||||
) |
|
||||
); |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 遍历省份 |
|
||||
* @returns {jQuery} |
|
||||
* @constructor |
|
||||
*/ |
|
||||
getSmallPlace: function () { |
|
||||
var _this = this; |
|
||||
return $('<div/>', { |
|
||||
class: 'smallplace clearfloat' |
|
||||
}).append( |
|
||||
$.map(_this.datas, function (item) { |
|
||||
return $('<div/>', { |
|
||||
class: 'place-tooltips' |
|
||||
}) |
|
||||
.append( |
|
||||
$('<label/>', {}) |
|
||||
.append( |
|
||||
$('<input/>', { |
|
||||
id: item.id, |
|
||||
type: 'checkbox', |
|
||||
class: 'province', |
|
||||
change: function () { |
|
||||
var $this = $(this) |
|
||||
, small = $this.parent().next('.citys').find('input') |
|
||||
, $placeTooltips = $this.parents('.place-tooltips'); |
|
||||
if ($this.prop('checked')) { |
|
||||
small.prop('checked', true); |
|
||||
$placeTooltips.find('.ratio').html('(' + small.length + '/' + small.length + ')'); |
|
||||
} else { |
|
||||
small.prop('checked', false); |
|
||||
$placeTooltips.find('.ratio').html(''); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
}) |
|
||||
) |
|
||||
.append( |
|
||||
// 省份名称
|
|
||||
$('<span/>', { |
|
||||
class: 'province_name', |
|
||||
text: item.name |
|
||||
}) |
|
||||
) |
|
||||
.append(function () { |
|
||||
// 城市数量
|
|
||||
if (item.city) { |
|
||||
return $('<span/>', { |
|
||||
class: 'ratio' |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
).append(function () { |
|
||||
// 城市列表
|
|
||||
if (item.city) { |
|
||||
return $('<div/>', { |
|
||||
class: 'citys' |
|
||||
}).append( |
|
||||
$('<i/>', { |
|
||||
class: 'jt' |
|
||||
}).append($('<i/>', {})) |
|
||||
).append( |
|
||||
_this.getSmallCitys(item.city) |
|
||||
) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
) |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 遍历城市 |
|
||||
* @param datas |
|
||||
* @returns {jQuery} |
|
||||
* @constructor |
|
||||
*/ |
|
||||
getSmallCitys: function (datas) { |
|
||||
return $('<div/>', { |
|
||||
class: 'row-div clearfloat' |
|
||||
}).append( |
|
||||
$.map(datas, function (item) { |
|
||||
return $('<p/>', {}).append( |
|
||||
$('<label/>', {}).append( |
|
||||
$('<input/>', { |
|
||||
id: item.id, |
|
||||
type: 'checkbox', |
|
||||
name: 'city[]', |
|
||||
class: 'city', |
|
||||
change: function () { |
|
||||
var $citys = $(this).parents('.citys') |
|
||||
, $placeTooltips = $(this).parents('.place-tooltips') |
|
||||
, tf = $citys.find('input:checked').length |
|
||||
, $province = $placeTooltips.find('.province') |
|
||||
, $ratio = $placeTooltips.find('.ratio'); |
|
||||
if (tf > 0) { |
|
||||
$province.prop('checked', true); |
|
||||
$ratio.html('(' + tf + '/' + $citys.find('input').length + ')'); |
|
||||
} else if (tf === 0) { |
|
||||
$province.prop('checked', false); |
|
||||
$ratio.html(''); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
).append( |
|
||||
$('<span/>', { |
|
||||
text: item.name |
|
||||
}) |
|
||||
) |
|
||||
) |
|
||||
}) |
|
||||
) |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取已选中的省市id |
|
||||
* @returns {array} |
|
||||
* @constructor |
|
||||
*/ |
|
||||
getCheckedIds: function () { |
|
||||
var checkedIds = []; |
|
||||
$('input[type=checkbox][name="city[]"]:checked').each(function (index, item) { |
|
||||
checkedIds.push(item.id); |
|
||||
}); |
|
||||
return checkedIds; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取已选中的省市id (树状) |
|
||||
* @returns {Array} |
|
||||
*/ |
|
||||
getCheckedTree: function () { |
|
||||
var _this = this; |
|
||||
// 遍历省份
|
|
||||
var data = []; |
|
||||
$('input.province:checked').each(function (index, province) { |
|
||||
var $this = $(this) |
|
||||
, $citys = $this.parent().next() |
|
||||
, $cityInputChecked = $citys.find('input.city:checked') |
|
||||
, cityData = [] |
|
||||
, cityTotal = Object.keys(_this.datas[province.id].city).length; |
|
||||
// 遍历城市
|
|
||||
if (cityTotal !== $cityInputChecked.length) { |
|
||||
$cityInputChecked.each(function (index, item) { |
|
||||
cityData.push({id: item.id, name: $(this).next().text()}); |
|
||||
}); |
|
||||
} |
|
||||
data.push({ |
|
||||
id: province.id, |
|
||||
name: $this.next().text(), |
|
||||
city: cityData |
|
||||
}); |
|
||||
}); |
|
||||
return data; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取已选中地区内容 |
|
||||
* @returns {{content: string, checkedIds: *|Array}} |
|
||||
*/ |
|
||||
getCheckedContent: function () { |
|
||||
// 获取已选中的省市id
|
|
||||
var dataTree = this.getCheckedTree() |
|
||||
, checkedIds = this.getCheckedIds() |
|
||||
, content = ''; |
|
||||
if (checkedIds.length === 373) { |
|
||||
content = '全国'; |
|
||||
} else { |
|
||||
var str = ''; |
|
||||
dataTree.forEach(function (item) { |
|
||||
str += item.name; |
|
||||
if (item.city.length > 0) { |
|
||||
var cityStr = ''; |
|
||||
item.city.forEach(function (city) { |
|
||||
cityStr += city.name + '、'; |
|
||||
}); |
|
||||
str += ' (<span class="am-link-muted">' |
|
||||
+ cityStr.substring(0, cityStr.length - 1) + '</span>)'; |
|
||||
} |
|
||||
str += '、'; |
|
||||
}); |
|
||||
content = str.substring(0, str.length - 1); |
|
||||
} |
|
||||
return { |
|
||||
content: content, |
|
||||
ids: checkedIds |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 批量选中 |
|
||||
* @param checkedIds 已选中的区域ID: 用于编辑 |
|
||||
* @constructor |
|
||||
*/ |
|
||||
setChecked: function (checkedIds) { |
|
||||
var $place = $('.place-div'); |
|
||||
$.each(checkedIds, function (i, id) { |
|
||||
$place.find('#' + id).trigger('click'); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 批量删除已存在的区域 |
|
||||
* @param alreadyIds 已存在的区域ID: 用于新增 |
|
||||
* @constructor |
|
||||
*/ |
|
||||
setAlready: function (alreadyIds) { |
|
||||
var $place = $('.place-div'); |
|
||||
$.each(alreadyIds, function (i, id) { |
|
||||
var $p = $place.find('#' + id).parent().parent() |
|
||||
, $siblings = $p.siblings(); |
|
||||
$siblings.length > 0 ? $p.remove() : $p.closest('.place-tooltips').remove(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 清空 |
|
||||
*/ |
|
||||
destroy: function () { |
|
||||
var $place = $('.place-div'); |
|
||||
$place.find('input[type=checkbox]').prop('checked', false); |
|
||||
$place.find('.ratio').html(''); |
|
||||
} |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
window.RegionalChoice = RegionalChoice; |
|
||||
|
|
||||
})(window); |
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,263 +0,0 @@ |
|||||
/** |
|
||||
* DDSort: drag and drop sorting. |
|
||||
* Documentation: https://github.com/Barrior/DDSort
|
|
||||
*/ |
|
||||
+function ($) { |
|
||||
var defaultOptions = { |
|
||||
down: $.noop, |
|
||||
move: $.noop, |
|
||||
up: $.noop, |
|
||||
target: 'li', |
|
||||
delay: 100, |
|
||||
cloneStyle: { |
|
||||
'background-color': '#eee' |
|
||||
}, |
|
||||
floatStyle: { |
|
||||
// 用固定定位可以防止定位父级不是Body的情况的兼容处理,表示不兼容IE6,无妨
|
|
||||
'position': 'fixed', |
|
||||
// 'border': '1px solid #ccc',
|
|
||||
'background-color': '#fff' |
|
||||
// 'box-shadow': '10px 10px 20px 0 #eee',
|
|
||||
// 'webkitTransform': 'rotate(4deg)',
|
|
||||
// 'mozTransform': 'rotate(4deg)',
|
|
||||
// 'msTransform': 'rotate(4deg)',
|
|
||||
// 'transform': 'rotate(4deg)'
|
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
$.fn.DDSort = function (options) { |
|
||||
var $doc = $(document); |
|
||||
var settings = $.extend(true, {}, defaultOptions, options); |
|
||||
|
|
||||
return this.each(function () { |
|
||||
|
|
||||
var that = $(this); |
|
||||
var height = 'height'; |
|
||||
var width = 'width'; |
|
||||
|
|
||||
if (that.css('box-sizing') == 'border-box') { |
|
||||
height = 'outerHeight'; |
|
||||
width = 'outerWidth'; |
|
||||
} |
|
||||
|
|
||||
that.on('mousedown.DDSort touchstart.DDSort', settings.target, function (e) { |
|
||||
|
|
||||
var startTime = new Date().getTime(); |
|
||||
|
|
||||
// 桌面端只允许鼠标左键拖动
|
|
||||
if (e.type == 'mousedown' && e.which != 1) return; |
|
||||
|
|
||||
// 防止表单元素,a 链接,可编辑元素失效
|
|
||||
var tagName = e.target.tagName.toLowerCase(); |
|
||||
if (tagName == 'input' || tagName == 'textarea' || tagName == 'select' || |
|
||||
tagName == 'a' || $(e.target).prop('contenteditable') == 'true') { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
var self = this; |
|
||||
var $this = $(self); |
|
||||
// 鼠标按下时的元素偏移
|
|
||||
var offset = $this.offset(); |
|
||||
|
|
||||
// 鼠标按下时的光标坐标
|
|
||||
// 桌面端
|
|
||||
var pageX = e.pageX; |
|
||||
var pageY = e.pageY; |
|
||||
|
|
||||
// 移动端
|
|
||||
var targetTouches = e.originalEvent.targetTouches; |
|
||||
if (e.type == 'touchstart' && targetTouches) { |
|
||||
pageX = targetTouches[0].pageX; |
|
||||
pageY = targetTouches[0].pageY; |
|
||||
} |
|
||||
|
|
||||
var clone = $this.clone() |
|
||||
.css(settings.cloneStyle) |
|
||||
.css('height', $this[height]()) |
|
||||
.empty(); |
|
||||
|
|
||||
var hasClone = 1; |
|
||||
|
|
||||
// 缓存计算
|
|
||||
var thisOuterHeight = $this.outerHeight(), |
|
||||
thisOuterWidth = $this.outerWidth(), |
|
||||
thatOuterHeight = that.outerHeight(), |
|
||||
thatOuterWidth = that.outerWidth(); |
|
||||
|
|
||||
// 滚动速度
|
|
||||
var upSpeed = thisOuterHeight, |
|
||||
downSpeed = thisOuterHeight, |
|
||||
leftSpeed = thisOuterWidth, |
|
||||
rightSpeed = thisOuterWidth, |
|
||||
maxSpeed = thisOuterHeight * 3; |
|
||||
|
|
||||
settings.down.call(self); |
|
||||
|
|
||||
$doc.on('mousemove.DDSort touchmove.DDSort', function (e) { |
|
||||
|
|
||||
// 鼠标移动时的光标坐标
|
|
||||
// 桌面端
|
|
||||
var _pageX = e.pageX; |
|
||||
var _pageY = e.pageY; |
|
||||
|
|
||||
// 移动端
|
|
||||
var targetTouches = e.originalEvent.targetTouches; |
|
||||
if (e.type == 'touchmove' && targetTouches) { |
|
||||
_pageX = targetTouches[0].pageX; |
|
||||
_pageY = targetTouches[0].pageY; |
|
||||
} |
|
||||
|
|
||||
if (new Date().getTime() - startTime < settings.delay) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
if (hasClone) { |
|
||||
$this.before(clone) |
|
||||
.css('width', $this[width]()) |
|
||||
.css(settings.floatStyle) |
|
||||
.appendTo($this.parent()); |
|
||||
|
|
||||
hasClone = 0; |
|
||||
} |
|
||||
|
|
||||
var disX = pageX - _pageX; |
|
||||
var disY = pageY - _pageY; |
|
||||
var left = offset.left - disX; |
|
||||
var top = offset.top - disY; |
|
||||
|
|
||||
$this.offset({ |
|
||||
left: left, |
|
||||
top: top |
|
||||
}); |
|
||||
|
|
||||
var $left = getLeft(clone), |
|
||||
$right = getRight(clone, $this), |
|
||||
$top = getTop(clone), |
|
||||
$under = getUnder(clone, $this); |
|
||||
|
|
||||
|
|
||||
if ($top && $top.length && top < $top.offset().top + $top.outerHeight(true) / 2) { |
|
||||
// 向上排序
|
|
||||
$top.before(clone); |
|
||||
|
|
||||
} else if ($under && $under.length && top + thisOuterHeight > $under.offset().top + $under.outerHeight(true) / 2) { |
|
||||
// 向下排序
|
|
||||
$under.after(clone); |
|
||||
|
|
||||
} else if($left && $left.length && left < $left.offset().left + $left.outerWidth(true) / 2) { |
|
||||
//向左排序
|
|
||||
$left.before(clone); |
|
||||
|
|
||||
} else if($right && $right.length && left + thisOuterWidth > $right.offset().left + $right.outerWidth(true) / 2) { |
|
||||
//向右排序
|
|
||||
$right.after(clone); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
// 处理滚动条,that 是带着滚动条的元素,这里默认以为 that 元素是这样的元素(正常情况就是这样),
|
|
||||
// 如果使用者事件委托的元素不是这样的元素,那么需要提供接口出来
|
|
||||
var thatScrollTop = that.scrollTop(); |
|
||||
var thatOffsetTop = that.offset().top; |
|
||||
if (top < thatOffsetTop) { |
|
||||
// 向上滚动
|
|
||||
downSpeed = thisOuterHeight; |
|
||||
upSpeed = ++upSpeed > maxSpeed ? maxSpeed : upSpeed; |
|
||||
var scrollVal = thatScrollTop - upSpeed; |
|
||||
that.scrollTop(scrollVal); |
|
||||
} else if (top + thisOuterHeight - thatOffsetTop > thatOuterHeight) { |
|
||||
// 向下滚动
|
|
||||
upSpeed = thisOuterHeight; |
|
||||
downSpeed = ++downSpeed > maxSpeed ? maxSpeed : downSpeed; |
|
||||
var scrollVal = thatScrollTop + downSpeed; |
|
||||
that.scrollTop(scrollVal); |
|
||||
} |
|
||||
|
|
||||
var thatScrollLeft = that.scrollLeft(); |
|
||||
var thatOffsetLeft = that.offset().left; |
|
||||
if (left < that.offset().left) { |
|
||||
// 向左滚动
|
|
||||
rightSpeed = thisOuterWidth; |
|
||||
leftSpeed = ++leftSpeed > maxSpeed ? maxSpeed : leftSpeed; |
|
||||
var scrollVal = thatScrollLeft - leftSpeed; |
|
||||
that.scrollLeft(scrollVal); |
|
||||
} else if (left + thisOuterWidth - thatOffsetLeft > thatOuterWidth) { |
|
||||
// 向右滚动
|
|
||||
leftSpeed = thisOuterWidth; |
|
||||
rightSpeed = ++rightSpeed > maxSpeed ? maxSpeed : rightSpeed; |
|
||||
var scrollVal = thatScrollLeft + rightSpeed; |
|
||||
that.scrollLeft(scrollVal); |
|
||||
} |
|
||||
|
|
||||
settings.move.call(self, left, top); |
|
||||
}) |
|
||||
.on('mouseup.DDSort touchend.DDSort', function () { |
|
||||
|
|
||||
$doc.off('mousemove.DDSort mouseup.DDSort touchmove.DDSort touchend.DDSort'); |
|
||||
|
|
||||
// click 的时候也会触发 mouseup 事件,加上判断阻止这种情况
|
|
||||
if (!hasClone) { |
|
||||
clone.before($this.removeAttr('style')).remove(); |
|
||||
settings.up.call(self); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
return false; |
|
||||
}); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
//允许计算误差
|
|
||||
var deviation = 5; |
|
||||
|
|
||||
var getLeft = function (clone) { |
|
||||
var left = clone.prev(); |
|
||||
if(left.length && clone.offset().top==left.offset().top) { |
|
||||
var _dev = Math.abs(clone.offset().left - (left.offset().left + left.outerWidth(true))); |
|
||||
if(_dev <= deviation) { |
|
||||
return left; |
|
||||
} |
|
||||
} |
|
||||
return undefined; |
|
||||
} |
|
||||
var getTop = function (clone, prev) { |
|
||||
if(!prev){ |
|
||||
prev = clone.prev(); |
|
||||
} |
|
||||
if(!prev.length) { |
|
||||
return undefined; |
|
||||
} |
|
||||
if(clone.offset().left==prev.offset().left) { |
|
||||
var _dev = Math.abs(clone.offset().top - (prev.offset().top+prev.outerHeight(true))); |
|
||||
if(_dev <= deviation) { |
|
||||
return prev; |
|
||||
} |
|
||||
} |
|
||||
return getTop(clone, prev.prev()); |
|
||||
} |
|
||||
var getRight = function (clone, $this) { |
|
||||
var rigth = clone.next().not($this); |
|
||||
if(rigth.length && clone.offset().top==rigth.offset().top) { |
|
||||
var _dev = Math.abs(clone.offset().left - (rigth.offset().left-clone.outerWidth(true))); |
|
||||
if(_dev <= deviation) { |
|
||||
return rigth; |
|
||||
} |
|
||||
} |
|
||||
return undefined; |
|
||||
} |
|
||||
var getUnder = function (clone, $this, next) { |
|
||||
if(!next){ |
|
||||
next = clone.next().not($this); |
|
||||
} |
|
||||
if(!next.length) { |
|
||||
return undefined; |
|
||||
} |
|
||||
if(clone.offset().left==next.offset().left) { |
|
||||
var _dev = Math.abs(clone.offset().top - (next.offset().top-clone.outerHeight(true))); |
|
||||
if(_dev <= deviation) { |
|
||||
return next; |
|
||||
} |
|
||||
} |
|
||||
return getUnder(clone, $this, next.next().not($this)); |
|
||||
} |
|
||||
}(jQuery); |
|
||||
@ -1,312 +0,0 @@ |
|||||
(function () { |
|
||||
|
|
||||
/*** |
|
||||
* 配送区域设置 |
|
||||
* @param options |
|
||||
* @constructor |
|
||||
*/ |
|
||||
function delivery(options) { |
|
||||
var option = $.extend(true, { |
|
||||
el: '#app', |
|
||||
name: '', |
|
||||
method: 10, |
|
||||
regions: {}, |
|
||||
formData: [] |
|
||||
}, options); |
|
||||
var app = this.createVueApp(option); |
|
||||
app.initializeForms(); |
|
||||
} |
|
||||
|
|
||||
delivery.prototype = { |
|
||||
|
|
||||
createVueApp: function (option) { |
|
||||
return new Vue({ |
|
||||
el: option.el, |
|
||||
data: { |
|
||||
// 模板名称
|
|
||||
name: option.name, |
|
||||
// 计费方式
|
|
||||
method: option.method, |
|
||||
// 所有地区
|
|
||||
regions: option.regions, |
|
||||
// 全选状态
|
|
||||
checkAll: false, |
|
||||
// 当前选择的地区id集
|
|
||||
checked: { |
|
||||
province: [], |
|
||||
citys: [] |
|
||||
}, |
|
||||
// 禁止选择的地区id集
|
|
||||
disable: { |
|
||||
province: [], |
|
||||
citys: [], |
|
||||
treeData: {} |
|
||||
}, |
|
||||
// 已选择的区域和运费form项
|
|
||||
forms: [] |
|
||||
}, |
|
||||
methods: { |
|
||||
|
|
||||
// 初始化forms
|
|
||||
initializeForms: function () { |
|
||||
var app = this; |
|
||||
if (!option.formData.length) return false; |
|
||||
option.formData.forEach(function (form) { |
|
||||
// 转换为整数型
|
|
||||
for (var key in form.citys) { |
|
||||
if (form.citys.hasOwnProperty(key)) { |
|
||||
form.citys[key] = parseInt(form.citys[key]); |
|
||||
} |
|
||||
} |
|
||||
form['treeData'] = app.getTreeData({ |
|
||||
province: form.province, |
|
||||
citys: form.citys |
|
||||
}); |
|
||||
app.forms.push(form); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 添加配送区域
|
|
||||
onAddRegionEvent: function () { |
|
||||
var app = this; |
|
||||
// 判断是否选择了全国
|
|
||||
var total = 0; |
|
||||
app.forms.forEach(function (item) { |
|
||||
total += item.citys.length; |
|
||||
}); |
|
||||
if (total >= 373) { |
|
||||
layer.msg('已经选择了所有区域~'); |
|
||||
return false; |
|
||||
} |
|
||||
// 显示选择可配送区域弹窗
|
|
||||
app.onShowCheckBox({ |
|
||||
complete: function (checked) { |
|
||||
// 选择完成后新增form项
|
|
||||
app.forms.push({ |
|
||||
province: checked.province, |
|
||||
citys: checked.citys, |
|
||||
treeData: app.getTreeData(checked) |
|
||||
}); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 全选
|
|
||||
onCheckAll: function (checked) { |
|
||||
var app = this; |
|
||||
app.checkAll = checked; |
|
||||
// 遍历能选择的地区
|
|
||||
for (var key in app.regions) { |
|
||||
if (app.regions.hasOwnProperty(key)) { |
|
||||
var item = app.regions[key]; |
|
||||
if (!app.isPropertyExist(item.id, app.disable.treeData) |
|
||||
|| !app.disable.treeData[item.id].isAllCitys) { |
|
||||
var provinceId = parseInt(item.id); |
|
||||
this.checkedProvince(provinceId, app.checkAll); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
// 标记不可选的地区
|
|
||||
onDisableRegion: function (ignoreFormIndex) { |
|
||||
var app = this; |
|
||||
// 清空禁选地区
|
|
||||
var disable = {province: [], citys: []}; |
|
||||
for (var key in app.forms) { |
|
||||
if (app.forms.hasOwnProperty(key)) { |
|
||||
if (ignoreFormIndex > -1 && ignoreFormIndex === parseInt(key)) continue; |
|
||||
var item = app.forms[key]; |
|
||||
disable.province = app.arrayMerge(disable.province, item.province); |
|
||||
disable.citys = app.arrayMerge(disable.citys, item.citys); |
|
||||
} |
|
||||
} |
|
||||
app.disable = { |
|
||||
province: disable.province, |
|
||||
citys: disable.citys, |
|
||||
treeData: app.getTreeData(disable) |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
// 将选中的区域id集格式化为树状格式
|
|
||||
getTreeData: function (checkedData) { |
|
||||
var app = this; |
|
||||
var treeData = {}; |
|
||||
checkedData.province.forEach(function (provinceId) { |
|
||||
var province = app.regions[provinceId] |
|
||||
, citys = [] |
|
||||
, cityCount = 0; |
|
||||
for (var cityIndex in province.city) { |
|
||||
if (province.city.hasOwnProperty(cityIndex)) { |
|
||||
var cityItem = province.city[cityIndex]; |
|
||||
if (app.inArray(cityItem.id, checkedData.citys)) { |
|
||||
citys.push({id: cityItem.id, name: cityItem.name}); |
|
||||
} |
|
||||
cityCount++; |
|
||||
} |
|
||||
} |
|
||||
treeData[province.id] = { |
|
||||
id: province.id, |
|
||||
name: province.name, |
|
||||
citys: citys, |
|
||||
isAllCitys: citys.length === cityCount |
|
||||
}; |
|
||||
}); |
|
||||
return treeData; |
|
||||
}, |
|
||||
|
|
||||
// 编辑配送区域
|
|
||||
onEditerForm: function (formIndex, formItem) { |
|
||||
var app = this; |
|
||||
// 显示选择可配送区域弹窗
|
|
||||
app.onShowCheckBox({ |
|
||||
editerFormIndex: formIndex, |
|
||||
checkedData: { |
|
||||
province: formItem.province, |
|
||||
citys: formItem.citys |
|
||||
}, |
|
||||
complete: function (data) { |
|
||||
// var formItem = app.forms[formIndex];
|
|
||||
formItem.province = data.province; |
|
||||
formItem.citys = data.citys; |
|
||||
formItem.treeData = app.getTreeData(data); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 删除配送区域
|
|
||||
onDeleteForm: function (formIndex) { |
|
||||
var app = this; |
|
||||
layer.confirm('确定要删除吗?' |
|
||||
, {title: '友情提示'} |
|
||||
, function (index) { |
|
||||
app.forms.splice(formIndex, 1); |
|
||||
layer.close(index); |
|
||||
} |
|
||||
); |
|
||||
}, |
|
||||
|
|
||||
// 显示选择可配送区域弹窗
|
|
||||
onShowCheckBox: function (option) { |
|
||||
var app = this; |
|
||||
var options = $.extend(true, { |
|
||||
editerFormIndex: -1, |
|
||||
checkedData: null, |
|
||||
complete: $.noop() |
|
||||
}, option); |
|
||||
// 已选中的数据
|
|
||||
app.checked = options.checkedData ? options.checkedData : { |
|
||||
province: [], |
|
||||
citys: [] |
|
||||
}; |
|
||||
// 标记不可选的地区
|
|
||||
app.onDisableRegion(options.editerFormIndex); |
|
||||
// 取消全选按钮
|
|
||||
app.checkAll = false; |
|
||||
// 开启弹窗
|
|
||||
layer.open({ |
|
||||
type: 1, |
|
||||
shade: false, |
|
||||
title: '选择可配送区域', |
|
||||
btn: ['确定', '取消'], |
|
||||
area: ['820px', '520px'], //宽高
|
|
||||
content: $(this.$refs['choice']), |
|
||||
yes: function (index) { |
|
||||
if (app.checked.citys.length <= 0) { |
|
||||
layer.msg('请选择区域~'); |
|
||||
return false; |
|
||||
} |
|
||||
options.complete(app.checked); |
|
||||
layer.close(index); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 选择省份
|
|
||||
onCheckedProvince: function (e) { |
|
||||
var provinceId = parseInt(e.target.value); |
|
||||
this.checkedProvince(provinceId, e.target.checked); |
|
||||
}, |
|
||||
|
|
||||
checkedProvince: function (provinceId, checked) { |
|
||||
var app = this; |
|
||||
// 更新省份选择
|
|
||||
var index = app.checked.province.indexOf(provinceId); |
|
||||
if (!checked) { |
|
||||
index > -1 && app.checked.province.splice(index, 1); |
|
||||
} else { |
|
||||
index === -1 && app.checked.province.push(provinceId); |
|
||||
} |
|
||||
// 更新城市选择
|
|
||||
var cityIds = app.regions[provinceId].city; |
|
||||
for (var cityIndex in cityIds) { |
|
||||
if (cityIds.hasOwnProperty(cityIndex)) { |
|
||||
var cityId = parseInt(cityIndex); |
|
||||
var checkedIndex = app.checked.citys.indexOf(cityId); |
|
||||
if (!checked) { |
|
||||
checkedIndex > -1 && app.checked.citys.splice(checkedIndex, 1) |
|
||||
} else { |
|
||||
checkedIndex === -1 && app.checked.citys.push(cityId); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
// 选择城市
|
|
||||
onCheckedCity: function (e, provinceId) { |
|
||||
var cityId = parseInt(e.target.value); |
|
||||
if (!e.target.checked) { |
|
||||
var index = this.checked.citys.indexOf(cityId); |
|
||||
index > -1 && this.checked.citys.splice(index, 1) |
|
||||
} else { |
|
||||
this.checked.citys.push(cityId); |
|
||||
} |
|
||||
// 更新省份选中状态
|
|
||||
this.onUpdateProvinceChecked(parseInt(provinceId)); |
|
||||
}, |
|
||||
|
|
||||
// 更新省份选中状态
|
|
||||
onUpdateProvinceChecked: function (provinceId) { |
|
||||
var provinceIndex = this.checked.province.indexOf(provinceId); |
|
||||
var isExist = provinceIndex > -1; |
|
||||
if (!this.onHasCityChecked(provinceId)) { |
|
||||
isExist && this.checked.province.splice(provinceIndex, 1); |
|
||||
} else { |
|
||||
!isExist && this.checked.province.push(provinceId); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
// 是否存在城市被选中
|
|
||||
onHasCityChecked: function (provinceId) { |
|
||||
var app = this; |
|
||||
var cityIds = this.regions[provinceId].city; |
|
||||
for (var cityId in cityIds) { |
|
||||
if (cityIds.hasOwnProperty(cityId) |
|
||||
&& app.inArray(parseInt(cityId), app.checked.citys)) |
|
||||
return true; |
|
||||
} |
|
||||
return false; |
|
||||
}, |
|
||||
|
|
||||
// 数组中是否存在指定的值
|
|
||||
inArray: function (val, array) { |
|
||||
return array.indexOf(val) > -1; |
|
||||
}, |
|
||||
|
|
||||
// 对象的属性是否存在
|
|
||||
isPropertyExist: function (key, obj) { |
|
||||
return obj.hasOwnProperty(key); |
|
||||
}, |
|
||||
|
|
||||
// 数组合并
|
|
||||
arrayMerge: function (arr1, arr2) { |
|
||||
return arr1.concat(arr2); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
window.delivery = delivery; |
|
||||
|
|
||||
})(window); |
|
||||
@ -1,296 +0,0 @@ |
|||||
(function () { |
|
||||
|
|
||||
// 解决火狐浏览器拖动新增tab
|
|
||||
document.body.ondrop = function (event) { |
|
||||
event.preventDefault(); |
|
||||
event.stopPropagation(); |
|
||||
}; |
|
||||
|
|
||||
// 默认数据
|
|
||||
var defaultData = {}; |
|
||||
|
|
||||
// umeditor 实例
|
|
||||
var $umeditor = {}; |
|
||||
|
|
||||
/*** |
|
||||
* 前端可视化diy |
|
||||
* @constructor |
|
||||
*/ |
|
||||
function diyPhone(initalData, diyData, opts) { |
|
||||
defaultData = initalData; |
|
||||
this.init(diyData, opts); |
|
||||
} |
|
||||
|
|
||||
diyPhone.prototype = { |
|
||||
|
|
||||
init: function (data, opts) { |
|
||||
// 实例化Vue
|
|
||||
new Vue({ |
|
||||
el: '#app', |
|
||||
data: { |
|
||||
// diy数据
|
|
||||
diyData: data, |
|
||||
// 当前选中的元素(下标)
|
|
||||
selectedIndex: -1, |
|
||||
// 当前选中的diy元素
|
|
||||
curItem: {}, |
|
||||
// 外部数据
|
|
||||
opts: opts |
|
||||
}, |
|
||||
|
|
||||
error: '', |
|
||||
|
|
||||
methods: { |
|
||||
|
|
||||
/** |
|
||||
* 新增Diy组件 |
|
||||
* @param key |
|
||||
*/ |
|
||||
onAddItem: function (key) { |
|
||||
// 验证新增Diy组件
|
|
||||
if (!this.onCheckAddItem(key)) { |
|
||||
return false; |
|
||||
} |
|
||||
// 复制默认diy组件数据
|
|
||||
var data = $.extend(true, {}, defaultData[key]); |
|
||||
// 新增到diy列表数据
|
|
||||
this.diyData.items.push(data); |
|
||||
// 编辑当前选中的元素
|
|
||||
this.onEditer(this.diyData.items.length - 1); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 验证新增Diy组件 |
|
||||
* @param key |
|
||||
*/ |
|
||||
onCheckAddItem: function (key) { |
|
||||
// 验证关注公众号组件只能存在一个
|
|
||||
if (key === 'officialAccount') { |
|
||||
for (var index in this.diyData.items) { |
|
||||
if (this.diyData.items.hasOwnProperty(index)) { |
|
||||
var item = this.diyData.items[index]; |
|
||||
if (item.type === 'officialAccount') { |
|
||||
layer.msg('该组件最多存在一个', {anim: 6}); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
return true; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 拖动diy元素更新当前索引 |
|
||||
* @param e |
|
||||
*/ |
|
||||
onDragItemEnd: function (e) { |
|
||||
this.onEditer(e.newIndex); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑当前选中的Diy元素 |
|
||||
* @param index |
|
||||
*/ |
|
||||
onEditer: function (index) { |
|
||||
// 记录当前选中元素的索引
|
|
||||
this.selectedIndex = index; |
|
||||
// 当前选中的元素数据
|
|
||||
this.curItem = this.selectedIndex === 'page' ? this.diyData.page |
|
||||
: this.diyData.items[this.selectedIndex]; |
|
||||
// 注册编辑器事件
|
|
||||
this.initEditor(); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除diy元素 |
|
||||
* @param index |
|
||||
*/ |
|
||||
onDeleleItem: function (index) { |
|
||||
var _this = this; |
|
||||
layer.confirm('确定要删除吗?', function (layIdx) { |
|
||||
_this.diyData.items.splice(index, 1); |
|
||||
_this.selectedIndex = -1; |
|
||||
layer.close(layIdx); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器:选择图片 |
|
||||
* @param source |
|
||||
* @param index |
|
||||
*/ |
|
||||
onEditorSelectImage: function (source, index) { |
|
||||
$.fileLibrary({ |
|
||||
type: 'image', |
|
||||
done: function (images) { |
|
||||
source[index] = images[0]['file_path']; |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器:重置颜色 |
|
||||
* @param holder |
|
||||
* @param attribute |
|
||||
* @param color |
|
||||
*/ |
|
||||
onEditorResetColor: function (holder, attribute, color) { |
|
||||
holder[attribute] = color; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器:删除data元素 |
|
||||
* @param index |
|
||||
* @param selectedIndex |
|
||||
*/ |
|
||||
onEditorDeleleData: function (index, selectedIndex) { |
|
||||
if (this.diyData.items[selectedIndex].data.length <= 1) { |
|
||||
layer.msg('至少保留一个', {anim: 6}); |
|
||||
return false; |
|
||||
} |
|
||||
this.diyData.items[selectedIndex].data.splice(index, 1); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器:添加data元素 |
|
||||
*/ |
|
||||
onEditorAddData: function () { |
|
||||
// 新增data数据
|
|
||||
var newDataItem = $.extend(true, {}, defaultData[this.curItem.type].data[0]); |
|
||||
this.curItem.data.push(newDataItem); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 注册编辑器事件 |
|
||||
*/ |
|
||||
initEditor: function () { |
|
||||
// 注册dom事件
|
|
||||
this.$nextTick(function () { |
|
||||
// 销毁 umeditor 组件
|
|
||||
if ($umeditor.hasOwnProperty('key')) { |
|
||||
$umeditor.destroy(); |
|
||||
} |
|
||||
// 注册html组件
|
|
||||
this.editorHtmlComponent(); |
|
||||
// 富文本事件
|
|
||||
if (this.curItem.type === 'richText') { |
|
||||
this.onRichText(this.curItem); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器事件:html组件 |
|
||||
*/ |
|
||||
editorHtmlComponent: function () { |
|
||||
var $editor = $(this.$refs['diy-editor']); |
|
||||
// 单/多选框
|
|
||||
$editor.find('input[type=checkbox], input[type=radio]').uCheck(); |
|
||||
// select组件
|
|
||||
// $editor.find('select').selected();
|
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器事件:拼团商品选择 |
|
||||
* @param item |
|
||||
*/ |
|
||||
onSelectGoods: function (item) { |
|
||||
var uris = { |
|
||||
goods: 'goods/lists&status=10', |
|
||||
sharingGoods: 'sharing.goods/lists&status=10', |
|
||||
bargainGoods: 'bargain.goods/lists&status=10', |
|
||||
sharpGoods: 'sharp.goods/lists&status=10' |
|
||||
}; |
|
||||
$.selectData({ |
|
||||
title: '选择商品', |
|
||||
uri: uris[item.type], |
|
||||
duplicate: false, |
|
||||
dataIndex: 'goods_id', |
|
||||
done: function (data) { |
|
||||
data.forEach(function (itm) { |
|
||||
item.data.push(itm) |
|
||||
}); |
|
||||
}, |
|
||||
getExistData: function () { |
|
||||
var existData = []; |
|
||||
item.data.forEach(function (goods) { |
|
||||
if (goods.hasOwnProperty('goods_id')) { |
|
||||
existData.push(goods.goods_id); |
|
||||
} |
|
||||
}); |
|
||||
return existData; |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 选择线下门店 |
|
||||
* @param item |
|
||||
*/ |
|
||||
onSelectShop: function (item) { |
|
||||
$.selectData({ |
|
||||
title: '选择门店', |
|
||||
uri: 'shop/lists', |
|
||||
duplicate: false, |
|
||||
dataIndex: 'shop_id', |
|
||||
done: function (data) { |
|
||||
data.forEach(function (itm) { |
|
||||
item.data.push(itm) |
|
||||
}); |
|
||||
}, |
|
||||
getExistData: function () { |
|
||||
var existData = []; |
|
||||
item.data.forEach(function (shop) { |
|
||||
if (shop.hasOwnProperty('shop_id')) { |
|
||||
existData.push(shop.shop_id); |
|
||||
} |
|
||||
}); |
|
||||
return existData; |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑器事件:富文本 |
|
||||
*/ |
|
||||
onRichText: function (item) { |
|
||||
$umeditor = UM.getEditor('ume-editor', { |
|
||||
initialFrameWidth: 375, |
|
||||
initialFrameHeight: 400 |
|
||||
}); |
|
||||
$umeditor.ready(function () { |
|
||||
// 写入编辑器内容
|
|
||||
$umeditor.setContent(item.params.content); |
|
||||
$umeditor.addListener('contentChange', function () { |
|
||||
item.params.content = $umeditor.getContent(); |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 提交后端保存 |
|
||||
* @returns {boolean} |
|
||||
*/ |
|
||||
onSubmit: function () { |
|
||||
if (this.diyData.items.length <= 0) { |
|
||||
layer.msg('至少存在一个组件', {anim: 6}); |
|
||||
return false; |
|
||||
} |
|
||||
var data = JSON.stringify(this.diyData); |
|
||||
var timeStamp = parseInt(new Date().getTime() / 1000); |
|
||||
localStorage.setItem("diy_" + timeStamp, data); |
|
||||
$.post('', {data: data}, function (result) { |
|
||||
result.code === 1 ? $.show_success(result.msg, result.url) |
|
||||
: $.show_error(result.msg); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
window.diyPhone = diyPhone; |
|
||||
|
|
||||
})(window); |
|
||||
@ -1,511 +0,0 @@ |
|||||
(function (root, factory) { |
|
||||
if (typeof define === 'function' && define.amd) { |
|
||||
// AMD. Register as an anonymous module.
|
|
||||
define(['exports', 'echarts'], factory); |
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { |
|
||||
// CommonJS
|
|
||||
factory(exports, require('echarts')); |
|
||||
} else { |
|
||||
// Browser globals
|
|
||||
factory({}, root.echarts); |
|
||||
} |
|
||||
}(this, function (exports, echarts) { |
|
||||
var log = function (msg) { |
|
||||
if (typeof console !== 'undefined') { |
|
||||
console && console.error && console.error(msg); |
|
||||
} |
|
||||
}; |
|
||||
if (!echarts) { |
|
||||
log('ECharts is not Loaded'); |
|
||||
return; |
|
||||
} |
|
||||
echarts.registerTheme('walden', { |
|
||||
"color": [ |
|
||||
"#3fb1e3", |
|
||||
"#6be6c1", |
|
||||
"#626c91", |
|
||||
"#a0a7e6", |
|
||||
"#c4ebad", |
|
||||
"#96dee8" |
|
||||
], |
|
||||
"backgroundColor": "rgba(252,252,252,0)", |
|
||||
"textStyle": {}, |
|
||||
"title": { |
|
||||
"textStyle": { |
|
||||
"color": "#666666" |
|
||||
}, |
|
||||
"subtextStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"line": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": "2" |
|
||||
} |
|
||||
}, |
|
||||
"lineStyle": { |
|
||||
"normal": { |
|
||||
"width": "3" |
|
||||
} |
|
||||
}, |
|
||||
"symbolSize": "8", |
|
||||
"symbol": "emptyCircle", |
|
||||
"smooth": false |
|
||||
}, |
|
||||
"radar": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": "2" |
|
||||
} |
|
||||
}, |
|
||||
"lineStyle": { |
|
||||
"normal": { |
|
||||
"width": "3" |
|
||||
} |
|
||||
}, |
|
||||
"symbolSize": "8", |
|
||||
"symbol": "emptyCircle", |
|
||||
"smooth": false |
|
||||
}, |
|
||||
"bar": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"barBorderWidth": 0, |
|
||||
"barBorderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"barBorderWidth": 0, |
|
||||
"barBorderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"pie": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"scatter": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"boxplot": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"parallel": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"sankey": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"funnel": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"gauge": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"candlestick": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"color": "#e6a0d2", |
|
||||
"color0": "transparent", |
|
||||
"borderColor": "#e6a0d2", |
|
||||
"borderColor0": "#3fb1e3", |
|
||||
"borderWidth": "2" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"graph": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"borderWidth": 0, |
|
||||
"borderColor": "#ccc" |
|
||||
} |
|
||||
}, |
|
||||
"lineStyle": { |
|
||||
"normal": { |
|
||||
"width": "1", |
|
||||
"color": "#cccccc" |
|
||||
} |
|
||||
}, |
|
||||
"symbolSize": "8", |
|
||||
"symbol": "emptyCircle", |
|
||||
"smooth": false, |
|
||||
"color": [ |
|
||||
"#3fb1e3", |
|
||||
"#6be6c1", |
|
||||
"#626c91", |
|
||||
"#a0a7e6", |
|
||||
"#c4ebad", |
|
||||
"#96dee8" |
|
||||
], |
|
||||
"label": { |
|
||||
"normal": { |
|
||||
"textStyle": { |
|
||||
"color": "#ffffff" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"map": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"areaColor": "#eeeeee", |
|
||||
"borderColor": "#aaaaaa", |
|
||||
"borderWidth": 0.5 |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"areaColor": "rgba(63,177,227,0.25)", |
|
||||
"borderColor": "#3fb1e3", |
|
||||
"borderWidth": 1 |
|
||||
} |
|
||||
}, |
|
||||
"label": { |
|
||||
"normal": { |
|
||||
"textStyle": { |
|
||||
"color": "#ffffff" |
|
||||
} |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"textStyle": { |
|
||||
"color": "rgb(63,177,227)" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"geo": { |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"areaColor": "#eeeeee", |
|
||||
"borderColor": "#aaaaaa", |
|
||||
"borderWidth": 0.5 |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"areaColor": "rgba(63,177,227,0.25)", |
|
||||
"borderColor": "#3fb1e3", |
|
||||
"borderWidth": 1 |
|
||||
} |
|
||||
}, |
|
||||
"label": { |
|
||||
"normal": { |
|
||||
"textStyle": { |
|
||||
"color": "#ffffff" |
|
||||
} |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"textStyle": { |
|
||||
"color": "rgb(63,177,227)" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"categoryAxis": { |
|
||||
"axisLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": "#cccccc" |
|
||||
} |
|
||||
}, |
|
||||
"axisTick": { |
|
||||
"show": false, |
|
||||
"lineStyle": { |
|
||||
"color": "#333" |
|
||||
} |
|
||||
}, |
|
||||
"axisLabel": { |
|
||||
"show": true, |
|
||||
"textStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"splitLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": [ |
|
||||
"#eeeeee" |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"splitArea": { |
|
||||
"show": false, |
|
||||
"areaStyle": { |
|
||||
"color": [ |
|
||||
"rgba(250,250,250,0.05)", |
|
||||
"rgba(200,200,200,0.02)" |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"valueAxis": { |
|
||||
"axisLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": "#cccccc" |
|
||||
} |
|
||||
}, |
|
||||
"axisTick": { |
|
||||
"show": false, |
|
||||
"lineStyle": { |
|
||||
"color": "#333" |
|
||||
} |
|
||||
}, |
|
||||
"axisLabel": { |
|
||||
"show": true, |
|
||||
"textStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"splitLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": [ |
|
||||
"#eeeeee" |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"splitArea": { |
|
||||
"show": false, |
|
||||
"areaStyle": { |
|
||||
"color": [ |
|
||||
"rgba(250,250,250,0.05)", |
|
||||
"rgba(200,200,200,0.02)" |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"logAxis": { |
|
||||
"axisLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": "#cccccc" |
|
||||
} |
|
||||
}, |
|
||||
"axisTick": { |
|
||||
"show": false, |
|
||||
"lineStyle": { |
|
||||
"color": "#333" |
|
||||
} |
|
||||
}, |
|
||||
"axisLabel": { |
|
||||
"show": true, |
|
||||
"textStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"splitLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": [ |
|
||||
"#eeeeee" |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"splitArea": { |
|
||||
"show": false, |
|
||||
"areaStyle": { |
|
||||
"color": [ |
|
||||
"rgba(250,250,250,0.05)", |
|
||||
"rgba(200,200,200,0.02)" |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"timeAxis": { |
|
||||
"axisLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": "#cccccc" |
|
||||
} |
|
||||
}, |
|
||||
"axisTick": { |
|
||||
"show": false, |
|
||||
"lineStyle": { |
|
||||
"color": "#333" |
|
||||
} |
|
||||
}, |
|
||||
"axisLabel": { |
|
||||
"show": true, |
|
||||
"textStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"splitLine": { |
|
||||
"show": true, |
|
||||
"lineStyle": { |
|
||||
"color": [ |
|
||||
"#eeeeee" |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
"splitArea": { |
|
||||
"show": false, |
|
||||
"areaStyle": { |
|
||||
"color": [ |
|
||||
"rgba(250,250,250,0.05)", |
|
||||
"rgba(200,200,200,0.02)" |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"toolbox": { |
|
||||
"iconStyle": { |
|
||||
"normal": { |
|
||||
"borderColor": "#999999" |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"borderColor": "#666666" |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"legend": { |
|
||||
"textStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"tooltip": { |
|
||||
"axisPointer": { |
|
||||
"lineStyle": { |
|
||||
"color": "#cccccc", |
|
||||
"width": 1 |
|
||||
}, |
|
||||
"crossStyle": { |
|
||||
"color": "#cccccc", |
|
||||
"width": 1 |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"timeline": { |
|
||||
"lineStyle": { |
|
||||
"color": "#626c91", |
|
||||
"width": 1 |
|
||||
}, |
|
||||
"itemStyle": { |
|
||||
"normal": { |
|
||||
"color": "#626c91", |
|
||||
"borderWidth": 1 |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"color": "#626c91" |
|
||||
} |
|
||||
}, |
|
||||
"controlStyle": { |
|
||||
"normal": { |
|
||||
"color": "#626c91", |
|
||||
"borderColor": "#626c91", |
|
||||
"borderWidth": 0.5 |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"color": "#626c91", |
|
||||
"borderColor": "#626c91", |
|
||||
"borderWidth": 0.5 |
|
||||
} |
|
||||
}, |
|
||||
"checkpointStyle": { |
|
||||
"color": "#3fb1e3", |
|
||||
"borderColor": "rgba(63,177,227,0.15)" |
|
||||
}, |
|
||||
"label": { |
|
||||
"normal": { |
|
||||
"textStyle": { |
|
||||
"color": "#626c91" |
|
||||
} |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"textStyle": { |
|
||||
"color": "#626c91" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
"visualMap": { |
|
||||
"color": [ |
|
||||
"#2a99c9", |
|
||||
"#afe8ff" |
|
||||
] |
|
||||
}, |
|
||||
"dataZoom": { |
|
||||
"backgroundColor": "rgba(255,255,255,0)", |
|
||||
"dataBackgroundColor": "rgba(222,222,222,1)", |
|
||||
"fillerColor": "rgba(114,230,212,0.25)", |
|
||||
"handleColor": "#cccccc", |
|
||||
"handleSize": "100%", |
|
||||
"textStyle": { |
|
||||
"color": "#999999" |
|
||||
} |
|
||||
}, |
|
||||
"markPoint": { |
|
||||
"label": { |
|
||||
"normal": { |
|
||||
"textStyle": { |
|
||||
"color": "#ffffff" |
|
||||
} |
|
||||
}, |
|
||||
"emphasis": { |
|
||||
"textStyle": { |
|
||||
"color": "#ffffff" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
})); |
|
||||
@ -1,472 +0,0 @@ |
|||||
;(function ($, window, document, undefined) { |
|
||||
|
|
||||
/** |
|
||||
* 文件库模块 |
|
||||
* @param trigger |
|
||||
* @param options |
|
||||
* @constructor |
|
||||
*/ |
|
||||
function FileLibrary(trigger, options) { |
|
||||
// 配置项
|
|
||||
var defaults = { |
|
||||
type: 'image', |
|
||||
layerId: 'file-library' |
|
||||
, layerSkin: 'file-library' |
|
||||
}; |
|
||||
this.options = $.extend({}, defaults, options); |
|
||||
// 触发对象
|
|
||||
this.$trigger = trigger; |
|
||||
this.$touch = null; // 当前触发元素
|
|
||||
// 容器元素
|
|
||||
this.$element = null; |
|
||||
// 初始化对象事件
|
|
||||
this.init(); |
|
||||
} |
|
||||
|
|
||||
FileLibrary.prototype = { |
|
||||
|
|
||||
/** |
|
||||
* 初始化 |
|
||||
*/ |
|
||||
init: function () { |
|
||||
var _this = this; |
|
||||
// 打开文件库事件
|
|
||||
_this.triggerEvent(); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 打开文件库事件 |
|
||||
*/ |
|
||||
triggerEvent: function () { |
|
||||
var _this = this; |
|
||||
if (_this.$trigger !== false) { |
|
||||
// 点击开启文件库弹窗
|
|
||||
_this.$trigger.unbind().click(function () { |
|
||||
_this.$touch = $(this); |
|
||||
_this.showLibraryModal(); |
|
||||
}); |
|
||||
} else { |
|
||||
_this.showLibraryModal(); |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 显示文件库弹窗 |
|
||||
*/ |
|
||||
showLibraryModal: function () { |
|
||||
var _this = this; |
|
||||
_this.getJsonData({group_id: -1}, function (data) { |
|
||||
data.is_default = true; |
|
||||
// 捕获页
|
|
||||
layer.open({ |
|
||||
type: 1 |
|
||||
, id: _this.options.layerId |
|
||||
, title: '图片库' |
|
||||
, skin: _this.options.layerSkin |
|
||||
, area: '840px' |
|
||||
, offset: 'auto' |
|
||||
, anim: 1 |
|
||||
, closeBtn: 1 |
|
||||
, shade: 0.3 |
|
||||
, btn: ['确定', '取消'] |
|
||||
, content: template('tpl-file-library', data) |
|
||||
, success: function (layero) { |
|
||||
// 初始化文件库弹窗
|
|
||||
_this.initModal(layero); |
|
||||
} |
|
||||
, yes: function (index) { |
|
||||
// 确认回调
|
|
||||
_this.done(); |
|
||||
layer.close(index); |
|
||||
} |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 初始化文件库弹窗 |
|
||||
*/ |
|
||||
initModal: function (element) { |
|
||||
var _this = this; |
|
||||
_this.$element = element; |
|
||||
// 注册分组下拉选择组件
|
|
||||
_this.selectDropdown(); |
|
||||
// 注册分类切换事件
|
|
||||
_this.switchClassEvent(); |
|
||||
// 注册文件点击选中事件
|
|
||||
_this.selectFilesEvent(); |
|
||||
// 新增分组事件
|
|
||||
_this.addGroupEvent(); |
|
||||
// 编辑分组事件
|
|
||||
_this.editGroupEvent(); |
|
||||
// 删除分组事件
|
|
||||
_this.deleteGroupEvent(); |
|
||||
// 注册文件上传事件
|
|
||||
_this.uploadImagesEvent(); |
|
||||
// 注册文件删除事件
|
|
||||
_this.deleteFilesEvent(); |
|
||||
// 注册文件移动事件
|
|
||||
_this.moveFilesEvent(); |
|
||||
// 注册文件列表分页事件
|
|
||||
_this.fileListPage(); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 注册文件列表分页事件 |
|
||||
*/ |
|
||||
fileListPage: function () { |
|
||||
var _this = this; |
|
||||
_this.$element.find('#file-list-body').on('click', '.switch-page', function () { |
|
||||
var page = $(this).data('page'); |
|
||||
_this.renderFileList(page); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 文件移动事件 |
|
||||
*/ |
|
||||
moveFilesEvent: function () { |
|
||||
var _this = this |
|
||||
, $groupSelect = _this.$element.find('.group-select'); |
|
||||
// 绑定文件选中事件
|
|
||||
$groupSelect.on('click', '.move-file-group', function () { |
|
||||
$groupSelect.dropdown('close'); |
|
||||
var groupId = $(this).data('group-id') |
|
||||
, fileIds = _this.getSelectedFileIds(); |
|
||||
if (fileIds.length === 0) { |
|
||||
layer.msg('您还没有选择任何文件~', {offset: 't', anim: 6}); |
|
||||
return false; |
|
||||
} |
|
||||
layer.confirm('确定移动选中的文件吗?', {title: '友情提示'}, function (index) { |
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/upload.library/moveFiles', { |
|
||||
group_id: groupId |
|
||||
, fileIds: fileIds |
|
||||
}, function (result) { |
|
||||
layer.msg(result.msg); |
|
||||
if (result.code === 1) { |
|
||||
_this.renderFileList(); |
|
||||
} |
|
||||
layer.close(load); |
|
||||
}); |
|
||||
layer.close(index); |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除选中的文件 |
|
||||
*/ |
|
||||
deleteFilesEvent: function () { |
|
||||
var _this = this; |
|
||||
_this.$element.on('click', '.file-delete', function () { |
|
||||
var fileIds = _this.getSelectedFileIds(); |
|
||||
if (fileIds.length === 0) { |
|
||||
layer.msg('您还没有选择任何文件~', {offset: 't', anim: 6}); |
|
||||
return; |
|
||||
} |
|
||||
layer.confirm('确定删除选中的文件吗?', {title: '友情提示'}, function (index) { |
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/upload.library/deleteFiles', { |
|
||||
fileIds: fileIds |
|
||||
}, function (result) { |
|
||||
layer.close(load); |
|
||||
if (result.code === 1) { |
|
||||
_this.renderFileList(); |
|
||||
} |
|
||||
}); |
|
||||
layer.close(index); |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 文件上传 (多文件) |
|
||||
*/ |
|
||||
uploadImagesEvent: function () { |
|
||||
var _this = this; |
|
||||
var loadIndex = null; |
|
||||
// 文件大小
|
|
||||
var maxSize = 2; |
|
||||
// 初始化Web Uploader
|
|
||||
var uploader = WebUploader.create({ |
|
||||
// 选完文件后,是否自动上传。
|
|
||||
auto: true, |
|
||||
// 文件接收服务端。
|
|
||||
server: STORE_URL + '/upload/image', |
|
||||
// 选择文件的按钮。可选。
|
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
|
||||
pick: { |
|
||||
id: '.j-upload', |
|
||||
multiple: true |
|
||||
}, |
|
||||
// 文件上传域的name
|
|
||||
fileVal: 'iFile', |
|
||||
// 图片上传前不进行压缩
|
|
||||
compress: false, |
|
||||
// 允许重复
|
|
||||
duplicate: true, |
|
||||
// 文件总数量
|
|
||||
// fileNumLimit: 10,
|
|
||||
// 文件大小2m => 2097152
|
|
||||
fileSingleSizeLimit: maxSize * 1024 * 1024, |
|
||||
// 只允许选择图片文件。
|
|
||||
accept: { |
|
||||
title: 'Images', |
|
||||
extensions: 'gif,jpg,jpeg,bmp,png', |
|
||||
mimeTypes: 'image/*' |
|
||||
}, |
|
||||
// 文件上传header扩展
|
|
||||
headers: { |
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01', |
|
||||
'X-Requested-With': 'XMLHttpRequest' |
|
||||
} |
|
||||
}); |
|
||||
// 验证大小
|
|
||||
uploader.on('error', function (type) { |
|
||||
if (type === 'F_DUPLICATE') { |
|
||||
console.log('请不要重复选择文件!'); |
|
||||
} else if (type === 'F_EXCEED_SIZE') { |
|
||||
alert('文件大小不可超过' + maxSize + 'm 哦!换个小点的文件吧!'); |
|
||||
} |
|
||||
}); |
|
||||
// 文件上传前触发,添加附带参数
|
|
||||
uploader.on('uploadBeforeSend', function (obj, data) { |
|
||||
data.group_id = _this.getCurrentGroupId(); |
|
||||
}); |
|
||||
// 文件上传成功,给item添加成功class, 用样式标记上传成功。
|
|
||||
uploader.on('uploadSuccess', function (file, response) { |
|
||||
if (response.code === 1) { |
|
||||
var $list = _this.$element.find('ul.file-list-item'); |
|
||||
$list.prepend(template('tpl-file-list-item', [response.data])); |
|
||||
} else { |
|
||||
uploader.uploadError(file, response); |
|
||||
} |
|
||||
}); |
|
||||
// 监听文件上传失败
|
|
||||
uploader.on('uploadError', function (file, reason) { |
|
||||
uploader.uploadError(file, reason); |
|
||||
}); |
|
||||
// 文件上传失败回调函数
|
|
||||
uploader.uploadError = function (file, reason) { |
|
||||
layer.msg(reason.msg, {anim: 6}); |
|
||||
}; |
|
||||
// 文件开始上传
|
|
||||
uploader.on('startUpload', function () { |
|
||||
loadIndex = layer.load(); |
|
||||
}); |
|
||||
// 文件上传结束
|
|
||||
uploader.on('uploadFinished', function () { |
|
||||
layer.close(loadIndex); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 新增分组事件 |
|
||||
*/ |
|
||||
addGroupEvent: function () { |
|
||||
var _this = this |
|
||||
, $groupList = _this.$element.find('.file-group > ul'); |
|
||||
_this.$element.on('click', '.group-add', function () { |
|
||||
layer.prompt({title: '请输入新分组名称'}, function (value, index) { |
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/upload.library/addGroup', { |
|
||||
group_name: value, |
|
||||
group_type: _this.options.type |
|
||||
}, function (result) { |
|
||||
layer.msg(result.msg); |
|
||||
if (result.code === 1) { |
|
||||
$groupList.append(template('tpl-group-item', result.data)); |
|
||||
var $groupSelectList = _this.$element.find('.group-select > .group-list'); |
|
||||
$groupSelectList.append( |
|
||||
'<li>' + |
|
||||
' <a class="move-file-group" data-group-id="' + result.data.group_id + '"' + |
|
||||
' href="javascript:void(0);">' + result.data.group_name + '</a>' + |
|
||||
'</li>' |
|
||||
); |
|
||||
} |
|
||||
layer.close(load); |
|
||||
}); |
|
||||
layer.close(index); |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 编辑分组事件 |
|
||||
*/ |
|
||||
editGroupEvent: function () { |
|
||||
var _this = this; |
|
||||
_this.$element.find('.file-group').on('click', '.group-edit', function () { |
|
||||
var $li = $(this).parent() |
|
||||
, group_id = $li.data('group-id'); |
|
||||
layer.prompt({title: '修改分组名称', value: $li.attr('title')}, function (value, index) { |
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/upload.library/editGroup', { |
|
||||
group_id: group_id |
|
||||
, group_name: value |
|
||||
}, function (result) { |
|
||||
layer.msg(result.msg); |
|
||||
if (result.code === 1) { |
|
||||
$li.attr('title', value).find('.group-name').text(value); |
|
||||
var $groupSelectList = _this.$element.find('.group-select > .group-list'); |
|
||||
$groupSelectList.find('[data-group-id="' + group_id + '"]').text(value); |
|
||||
} |
|
||||
layer.close(load); |
|
||||
}); |
|
||||
layer.close(index); |
|
||||
}); |
|
||||
return false; |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除分组事件 |
|
||||
*/ |
|
||||
deleteGroupEvent: function () { |
|
||||
var _this = this; |
|
||||
_this.$element.find('.file-group').on('click', '.group-delete', function () { |
|
||||
var $li = $(this).parent() |
|
||||
, group_id = $li.data('group-id'); |
|
||||
layer.confirm('确定删除该分组吗?', {title: '友情提示'}, function (index) { |
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/upload.library/deleteGroup', { |
|
||||
group_id: group_id |
|
||||
}, function (result) { |
|
||||
layer.msg(result.msg); |
|
||||
if (result.code === 1) { |
|
||||
$li.remove(); |
|
||||
var $groupSelectList = _this.$element.find('.group-select > .group-list'); |
|
||||
$groupSelectList.find('[data-group-id="' + group_id + '"]').remove(); |
|
||||
} |
|
||||
layer.close(load); |
|
||||
}); |
|
||||
layer.close(index); |
|
||||
}); |
|
||||
return false; |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 注册文件选中事件 |
|
||||
*/ |
|
||||
selectFilesEvent: function () { |
|
||||
// 绑定文件选中事件
|
|
||||
this.$element.find('#file-list-body').on('click', '.file-list-item li', function () { |
|
||||
$(this).toggleClass('active'); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 分类切换事件 |
|
||||
*/ |
|
||||
switchClassEvent: function () { |
|
||||
var _this = this; |
|
||||
// 注册分类切换事件
|
|
||||
_this.$element.find('.file-group').on('click', 'li', function () { |
|
||||
var $this = $(this); |
|
||||
// 切换选中状态
|
|
||||
$this.addClass('active').siblings('.active').removeClass('active'); |
|
||||
// 重新渲染文件列表
|
|
||||
_this.renderFileList(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 注册分组下拉选择组件 |
|
||||
*/ |
|
||||
selectDropdown: function () { |
|
||||
this.$element.find('.group-select').dropdown(); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取文件库列表数据 |
|
||||
* @param params |
|
||||
* @param success |
|
||||
*/ |
|
||||
getJsonData: function (params, success) { |
|
||||
var loadIndex = layer.load(); |
|
||||
typeof params === 'function' && (success = params); |
|
||||
// 获取文件库列表
|
|
||||
$.getJSON(STORE_URL + '/upload.library/fileList', params, function (result) { |
|
||||
layer.close(loadIndex); |
|
||||
if (result.code === 1) { |
|
||||
typeof success === 'function' && success(result.data); |
|
||||
} else { |
|
||||
layer.msg(result.msg, {anim: 6}); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 重新渲染文件列表 |
|
||||
* @param page |
|
||||
*/ |
|
||||
renderFileList: function (page) { |
|
||||
var _this = this |
|
||||
, groupId = this.getCurrentGroupId(); |
|
||||
// 重新渲染文件列表
|
|
||||
_this.getJsonData({group_id: groupId, page: page || 1}, function (data) { |
|
||||
_this.$element.find('#file-list-body').html(template('tpl-file-list', data.file_list)); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取选中的文件列表 |
|
||||
* @returns {Array} |
|
||||
*/ |
|
||||
getSelectedFiles: function () { |
|
||||
var selectedList = []; |
|
||||
this.$element.find('.file-list-item > li.active').each(function (index) { |
|
||||
var $this = $(this); |
|
||||
selectedList[index] = { |
|
||||
file_id: $this.data('file-id') |
|
||||
, file_path: $this.data('file-path') |
|
||||
}; |
|
||||
}); |
|
||||
return selectedList; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取选中的文件的ID集 |
|
||||
* @returns {Array} |
|
||||
*/ |
|
||||
getSelectedFileIds: function () { |
|
||||
var fileList = this.getSelectedFiles(); |
|
||||
var data = []; |
|
||||
fileList.forEach(function (item) { |
|
||||
data.push(item.file_id); |
|
||||
}); |
|
||||
return data; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取当前分组id |
|
||||
* @returns {*} |
|
||||
*/ |
|
||||
getCurrentGroupId: function () { |
|
||||
return this.$element.find('.file-group > ul > li.active').data('group-id'); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 确认回调 |
|
||||
*/ |
|
||||
done: function () { |
|
||||
var selectedList = this.getSelectedFiles(); |
|
||||
selectedList.length > 0 && typeof this.options.done === 'function' |
|
||||
&& this.options.done(selectedList, this.$touch); |
|
||||
} |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
// 在Jquery插件中使用FileLibrary对象
|
|
||||
$.fn.fileLibrary = function (options) { |
|
||||
new FileLibrary(this, options); |
|
||||
}; |
|
||||
|
|
||||
// 在Jquery插件中使用FileLibrary对象
|
|
||||
$.fileLibrary = function (options) { |
|
||||
new FileLibrary(false, options); |
|
||||
}; |
|
||||
|
|
||||
})(jQuery, window, document); |
|
||||
@ -1,310 +0,0 @@ |
|||||
(function () { |
|
||||
|
|
||||
// 配置信息
|
|
||||
var setting = { |
|
||||
el: 'many-app', |
|
||||
baseData: null |
|
||||
}; |
|
||||
|
|
||||
/** |
|
||||
* 构造方法 |
|
||||
* @param options |
|
||||
* @param baseData |
|
||||
* @constructor |
|
||||
*/ |
|
||||
function GoodsSpec(options, baseData) { |
|
||||
// 配置信息
|
|
||||
setting = $.extend(true, {}, setting, options); |
|
||||
// 初始化
|
|
||||
this.initialize(); |
|
||||
} |
|
||||
|
|
||||
GoodsSpec.prototype = { |
|
||||
|
|
||||
// vue组件句柄
|
|
||||
appVue: null, |
|
||||
|
|
||||
/** |
|
||||
* 初始化 |
|
||||
*/ |
|
||||
initialize: function () { |
|
||||
// 已存在的规格数据
|
|
||||
var spec_attr = [], spec_list = []; |
|
||||
if (typeof setting.baseData !== 'undefined' && setting.baseData !== null) { |
|
||||
spec_attr = setting.baseData['spec_attr']; |
|
||||
spec_list = setting.baseData['spec_list']; |
|
||||
} |
|
||||
|
|
||||
// 实例化vue对象
|
|
||||
this.appVue = new Vue({ |
|
||||
el: setting.el, |
|
||||
data: { |
|
||||
spec_attr: spec_attr, |
|
||||
spec_list: spec_list, |
|
||||
// 显示添加规格组按钮
|
|
||||
showAddGroupBtn: true, |
|
||||
// 显示添加规格组表单
|
|
||||
showAddGroupForm: false, |
|
||||
// 新增规格组值
|
|
||||
addGroupFrom: { |
|
||||
specName: '', |
|
||||
specValue: '' |
|
||||
}, |
|
||||
// 批量设置sku属性
|
|
||||
batchData: { |
|
||||
goods_no: '', |
|
||||
goods_price: '', |
|
||||
sharing_price: '', |
|
||||
line_price: '', |
|
||||
stock_num: '', |
|
||||
goods_weight: '' |
|
||||
} |
|
||||
}, |
|
||||
methods: { |
|
||||
/** |
|
||||
* 显示/隐藏添加规则组 |
|
||||
*/ |
|
||||
onToggleAddGroupForm: function () { |
|
||||
this.showAddGroupBtn = !this.showAddGroupBtn; |
|
||||
this.showAddGroupForm = !this.showAddGroupForm; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 表单提交:新增规格组 |
|
||||
* @returns {boolean} |
|
||||
*/ |
|
||||
onSubmitAddGroup: function () { |
|
||||
var _this = this; |
|
||||
if (_this.addGroupFrom.specName === '' || _this.addGroupFrom.specValue === '') { |
|
||||
layer.msg('请填写规则名或规则值'); |
|
||||
return false; |
|
||||
} |
|
||||
// 添加到数据库
|
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/goods.spec/addSpec', { |
|
||||
spec_name: _this.addGroupFrom.specName, |
|
||||
spec_value: _this.addGroupFrom.specValue |
|
||||
}, function (result) { |
|
||||
layer.close(load); |
|
||||
if (result.code !== 1) { |
|
||||
layer.msg(result.msg); |
|
||||
return false; |
|
||||
} |
|
||||
// 记录规格数据
|
|
||||
_this.spec_attr.push({ |
|
||||
group_id: result.data['spec_id'], |
|
||||
group_name: _this.addGroupFrom.specName, |
|
||||
spec_items: [{ |
|
||||
item_id: result.data['spec_value_id'], |
|
||||
spec_value: _this.addGroupFrom.specValue |
|
||||
}], |
|
||||
tempValue: '' |
|
||||
}); |
|
||||
// 清空输入内容
|
|
||||
_this.addGroupFrom.specName = ''; |
|
||||
_this.addGroupFrom.specValue = ''; |
|
||||
// 隐藏添加规则组
|
|
||||
_this.onToggleAddGroupForm(); |
|
||||
// 构建规格组合列表
|
|
||||
_this.buildSkulist(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 新增规格值 |
|
||||
* @param index |
|
||||
*/ |
|
||||
onSubmitAddValue: function (index) { |
|
||||
var _this = this |
|
||||
, specAttr = _this.spec_attr[index]; |
|
||||
if (specAttr.tempValue === '') { |
|
||||
layer.msg('规格值不能为空'); |
|
||||
return false; |
|
||||
} |
|
||||
// 添加到数据库
|
|
||||
var load = layer.load(); |
|
||||
$.post(STORE_URL + '/goods.spec/addSpecValue', { |
|
||||
spec_id: specAttr.group_id, |
|
||||
spec_value: specAttr.tempValue |
|
||||
}, function (result) { |
|
||||
layer.close(load); |
|
||||
if (result.code !== 1) { |
|
||||
layer.msg(result.msg); |
|
||||
return false; |
|
||||
} |
|
||||
// 记录规格数据
|
|
||||
specAttr.spec_items.push({ |
|
||||
item_id: result.data['spec_value_id'], |
|
||||
spec_value: specAttr.tempValue |
|
||||
}); |
|
||||
// 清空输入内容
|
|
||||
specAttr.tempValue = ''; |
|
||||
// 构建规格组合列表
|
|
||||
_this.buildSkulist(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 构建规格组合列表 |
|
||||
*/ |
|
||||
buildSkulist: function () { |
|
||||
var _this = this; |
|
||||
// 规格组合总数 (table行数)
|
|
||||
var totalRow = 1; |
|
||||
for (var i = 0; i < _this.spec_attr.length; i++) { |
|
||||
totalRow *= _this.spec_attr[i].spec_items.length; |
|
||||
} |
|
||||
// 遍历tr 行
|
|
||||
var specList = []; |
|
||||
for (i = 0; i < totalRow; i++) { |
|
||||
var rowData = [], rowCount = 1, specSkuIdAttr = []; |
|
||||
// 遍历td 列
|
|
||||
for (var j = 0; j < _this.spec_attr.length; j++) { |
|
||||
var skuValues = _this.spec_attr[j].spec_items; |
|
||||
rowCount *= skuValues.length; |
|
||||
var anInterBankNum = (totalRow / rowCount) |
|
||||
, point = ((i / anInterBankNum) % skuValues.length); |
|
||||
if (0 === (i % anInterBankNum)) { |
|
||||
rowData.push({ |
|
||||
rowspan: anInterBankNum, |
|
||||
item_id: skuValues[point].item_id, |
|
||||
spec_value: skuValues[point].spec_value |
|
||||
}); |
|
||||
} |
|
||||
specSkuIdAttr.push(skuValues[parseInt(point.toString())].item_id); |
|
||||
} |
|
||||
specList.push({ |
|
||||
spec_sku_id: specSkuIdAttr.join('_'), |
|
||||
rows: rowData, |
|
||||
form: {} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
// return false;
|
|
||||
// 合并旧sku数据
|
|
||||
if (_this.spec_list.length > 0 && specList.length > 0) { |
|
||||
for (i = 0; i < specList.length; i++) { |
|
||||
var overlap = _this.spec_list.filter(function (val) { |
|
||||
return val.spec_sku_id === specList[i].spec_sku_id; |
|
||||
}); |
|
||||
if (overlap.length > 0) specList[i].form = overlap[0].form; |
|
||||
} |
|
||||
} |
|
||||
_this.spec_list = specList; |
|
||||
// 注册上传sku图片事件
|
|
||||
_this.onSelectImagesEvent(); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除规则组事件 |
|
||||
* @param index |
|
||||
*/ |
|
||||
onDeleteGroup: function (index) { |
|
||||
var _this = this; |
|
||||
layer.confirm('确定要删除该规则吗?确认后不可恢复请谨慎操作' |
|
||||
, function (layerIndex) { |
|
||||
// 删除指定规则组
|
|
||||
_this.spec_attr.splice(index, 1); |
|
||||
// 构建规格组合列表
|
|
||||
_this.buildSkulist(); |
|
||||
layer.close(layerIndex); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除规则值事件 |
|
||||
* @param index |
|
||||
* @param itemIndex |
|
||||
*/ |
|
||||
onDeleteValue: function (index, itemIndex) { |
|
||||
var _this = this; |
|
||||
layer.confirm('确定要删除该规则吗?确认后不可恢复请谨慎操作' |
|
||||
, function (layerIndex) { |
|
||||
// 删除指定规则组
|
|
||||
_this.spec_attr[index].spec_items.splice(itemIndex, 1); |
|
||||
// 构建规格组合列表
|
|
||||
_this.buildSkulist(); |
|
||||
layer.close(layerIndex); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 批量设置sku属性 |
|
||||
*/ |
|
||||
onSubmitBatchData: function () { |
|
||||
var _this = this; |
|
||||
_this.spec_list.forEach(function (value) { |
|
||||
if (_this.batchData.goods_no) { |
|
||||
_this.$set(value.form, 'goods_no', _this.batchData.goods_no); |
|
||||
} |
|
||||
if (_this.batchData.goods_price) { |
|
||||
_this.$set(value.form, 'goods_price', _this.batchData.goods_price); |
|
||||
} |
|
||||
if (_this.batchData.sharing_price) { |
|
||||
_this.$set(value.form, 'sharing_price', _this.batchData.sharing_price); |
|
||||
} |
|
||||
if (_this.batchData.line_price) { |
|
||||
_this.$set(value.form, 'line_price', _this.batchData.line_price); |
|
||||
} |
|
||||
if (_this.batchData.stock_num) { |
|
||||
_this.$set(value.form, 'stock_num', _this.batchData.stock_num); |
|
||||
} |
|
||||
if (_this.batchData.goods_weight) { |
|
||||
_this.$set(value.form, 'goods_weight', _this.batchData.goods_weight); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 注册上传sku图片事件 |
|
||||
*/ |
|
||||
onSelectImagesEvent: function () { |
|
||||
var _this = this; |
|
||||
// 注册上传sku图片
|
|
||||
_this.$nextTick(function () { |
|
||||
$(_this.$el).find('.j-selectImg').selectImages({ |
|
||||
done: function (data, $addon) { |
|
||||
var index = $addon.data('index'); |
|
||||
_this.$set(_this.spec_list[index].form, 'image_id', data[0]['file_id']); |
|
||||
_this.$set(_this.spec_list[index].form, 'image_path', data[0]['file_path']); |
|
||||
} |
|
||||
}); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 删除sku图片 |
|
||||
*/ |
|
||||
onDeleteSkuImage: function (index) { |
|
||||
this.spec_list[index].form['image_id'] = 0; |
|
||||
this.spec_list[index].form['image_path'] = ''; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 获取当前data |
|
||||
*/ |
|
||||
getData: function () { |
|
||||
return this.$data; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* sku列表是否为空 |
|
||||
* @returns {boolean} |
|
||||
*/ |
|
||||
isEmptySkuList: function () { |
|
||||
return !this.spec_list.length; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
// 初始化生成sku列表
|
|
||||
spec_list.length > 0 && this.appVue.buildSkulist(); |
|
||||
} |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
window.GoodsSpec = GoodsSpec; |
|
||||
|
|
||||
})(); |
|
||||
|
|
||||
@ -1,307 +0,0 @@ |
|||||
/*! |
|
||||
* jquery.dad.js v1 (http://konsolestudio.com/dad)
|
|
||||
* Author William Lima |
|
||||
*/ |
|
||||
|
|
||||
(function ($) { |
|
||||
'use strict'; |
|
||||
var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; |
|
||||
|
|
||||
$.fn.dad = function (opts) { |
|
||||
var _this = this; |
|
||||
|
|
||||
var defaults = { |
|
||||
target: '>div', |
|
||||
draggable: false, |
|
||||
placeholder: '', |
|
||||
callback: false, |
|
||||
containerClass: 'dad-container', |
|
||||
childrenClass: 'dads-children', |
|
||||
cloneClass: 'dads-children-clone', |
|
||||
active: true, |
|
||||
}; |
|
||||
|
|
||||
var options = $.extend({}, defaults, opts); |
|
||||
|
|
||||
$(this).each(function () { |
|
||||
var active = options.active; |
|
||||
var $daddy = $(this); |
|
||||
var childrenClass = options.childrenClass; |
|
||||
var cloneClass = options.cloneClass; |
|
||||
var jQclass = '.' + childrenClass; |
|
||||
var $target = $daddy.find(options.target); |
|
||||
var placeholder = options.placeholder; |
|
||||
var callback = options.callback; |
|
||||
var dragClass = 'dad-draggable-area'; |
|
||||
var holderClass = 'dads-children-placeholder'; |
|
||||
|
|
||||
// HANDLE MOUSE
|
|
||||
var mouse = { |
|
||||
x: 0, |
|
||||
y: 0, |
|
||||
target: false, |
|
||||
clone: false, |
|
||||
placeholder: false, |
|
||||
cloneoffset: { |
|
||||
x: 0, |
|
||||
y: 0, |
|
||||
}, |
|
||||
updatePosition: function (e) { |
|
||||
this.x = e.pageX; |
|
||||
this.y = e.pageY; |
|
||||
}, |
|
||||
|
|
||||
move: function (e) { |
|
||||
this.updatePosition(e); |
|
||||
if (this.clone !== false && _this.target !== false) { |
|
||||
this.clone.css({ |
|
||||
left: this.x - this.cloneoffset.x, |
|
||||
top: this.y - this.cloneoffset.y, |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
}; |
|
||||
|
|
||||
$(window).on('mousemove touchmove', function (e) { |
|
||||
var ev = e; |
|
||||
|
|
||||
if (mouse.clone !== false && mouse.target !== false) e.preventDefault(); |
|
||||
|
|
||||
if (supportsTouch && e.type == 'touchmove') { |
|
||||
ev = e.originalEvent.touches[0]; |
|
||||
var mouseTarget = document.elementFromPoint(ev.clientX, ev.clientY); |
|
||||
|
|
||||
$(mouseTarget).trigger('touchenter'); |
|
||||
} |
|
||||
|
|
||||
mouse.move(ev); |
|
||||
}); |
|
||||
|
|
||||
$daddy.addClass(options.containerClass); |
|
||||
|
|
||||
if (!$daddy.hasClass('dad-active') && active === true) { |
|
||||
$daddy.addClass('dad-active'); |
|
||||
}; |
|
||||
|
|
||||
_this.addDropzone = function (selector, func) { |
|
||||
$(selector).on('mouseenter touchenter', function () { |
|
||||
if (mouse.target !== false) { |
|
||||
mouse.placeholder.css({ display: 'none' }); |
|
||||
mouse.target.css({ display: 'none' }); |
|
||||
$(this).addClass('active'); |
|
||||
} |
|
||||
}).on('mouseup touchend', function () { |
|
||||
if (mouse.target != false) { |
|
||||
mouse.placeholder.css({ display: 'block' }); |
|
||||
mouse.target.css({ display: 'block' }); |
|
||||
func(mouse.target); |
|
||||
dadEnd(); |
|
||||
}; |
|
||||
|
|
||||
$(this).removeClass('active'); |
|
||||
}).on('mouseleave touchleave', function () { |
|
||||
if (mouse.target !== false) { |
|
||||
mouse.placeholder.css({ display: 'block' }); |
|
||||
mouse.target.css({ display: 'block' }); |
|
||||
} |
|
||||
|
|
||||
$(this).removeClass('active'); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
// GET POSITION FUNCTION
|
|
||||
_this.getPosition = function () { |
|
||||
var positionArray = []; |
|
||||
$(this).find(jQclass).each(function () { |
|
||||
positionArray[$(this).attr('data-dad-id')] = parseInt($(this).attr('data-dad-position')); |
|
||||
}); |
|
||||
|
|
||||
return positionArray; |
|
||||
}; |
|
||||
|
|
||||
_this.activate = function () { |
|
||||
active = true; |
|
||||
if (!$daddy.hasClass('dad-active')) { |
|
||||
$daddy.addClass('dad-active'); |
|
||||
} |
|
||||
|
|
||||
return _this; |
|
||||
}; |
|
||||
|
|
||||
// DEACTIVATE FUNCTION
|
|
||||
_this.deactivate = function () { |
|
||||
active = false; |
|
||||
$daddy.removeClass('dad-active'); |
|
||||
return _this; |
|
||||
}; |
|
||||
|
|
||||
// DEFAULT DROPPING
|
|
||||
$daddy.on('DOMNodeInserted', function (e) { |
|
||||
var $thisTarget = $(e.target); |
|
||||
if (!$thisTarget.hasClass(childrenClass) && !$thisTarget.hasClass(holderClass)) { |
|
||||
$thisTarget.addClass(childrenClass); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
$(document).on('mouseup touchend', function () { |
|
||||
dadEnd(); |
|
||||
}); |
|
||||
|
|
||||
// ORDER ELEMENTS
|
|
||||
var order = 1; |
|
||||
$target.addClass(childrenClass).each(function () { |
|
||||
if ($(this).data('dad-id') == undefined) { |
|
||||
$(this).attr('data-dad-id', order); |
|
||||
} |
|
||||
|
|
||||
$(this).attr('data-dad-position', order); |
|
||||
order++; |
|
||||
}); |
|
||||
|
|
||||
// CREATE REORDER FUNCTION
|
|
||||
function updatePosition(e) { |
|
||||
var order = 1; |
|
||||
e.find(jQclass).each(function () { |
|
||||
$(this).attr('data-dad-position', order); |
|
||||
order++; |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
// END EVENT
|
|
||||
function dadEnd() { |
|
||||
if (mouse.target != false && mouse.clone != false) { |
|
||||
if (callback != false) { |
|
||||
callback(mouse.target); |
|
||||
} |
|
||||
|
|
||||
var appear = mouse.target; |
|
||||
var desappear = mouse.clone; |
|
||||
var holder = mouse.placeholder; |
|
||||
var bLeft = 0; |
|
||||
var bTop = 0; |
|
||||
|
|
||||
// Maybe we will use this in the future
|
|
||||
//Math.floor(parseFloat($daddy.css('border-left-width')));
|
|
||||
//Math.floor(parseFloat($daddy.css('border-top-width')));
|
|
||||
if ($.contains($daddy[0], mouse.target[0])) { |
|
||||
mouse.clone.animate({ |
|
||||
top: mouse.target.offset().top - $daddy.offset().top - bTop, |
|
||||
left: mouse.target.offset().left - $daddy.offset().left - bLeft, |
|
||||
}, 300, function () { |
|
||||
appear.css({ |
|
||||
visibility: 'visible', |
|
||||
}).removeClass('active'); |
|
||||
desappear.remove(); |
|
||||
}); |
|
||||
} else { |
|
||||
mouse.clone.fadeOut(300, function () { |
|
||||
desappear.remove(); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
holder.remove(); |
|
||||
mouse.clone = false; |
|
||||
mouse.placeholder = false; |
|
||||
mouse.target = false; |
|
||||
updatePosition($daddy); |
|
||||
} |
|
||||
|
|
||||
$('html, body').removeClass('dad-noSelect'); |
|
||||
} |
|
||||
|
|
||||
// UPDATE EVENT
|
|
||||
function dadUpdate(obj) { |
|
||||
if (mouse.target !== false && mouse.clone !== false) { |
|
||||
var $origin = $('<span style="display:none"></span>'); |
|
||||
var $newplace = $('<span style="display:none"></span>'); |
|
||||
|
|
||||
if (obj.prevAll().hasClass('active')) { |
|
||||
obj.after($newplace); |
|
||||
} else { |
|
||||
obj.before($newplace); |
|
||||
} |
|
||||
|
|
||||
mouse.target.before($origin); |
|
||||
$newplace.before(mouse.target); |
|
||||
|
|
||||
// UPDATE PLACEHOLDER
|
|
||||
mouse.placeholder.css({ |
|
||||
top: mouse.target.offset().top - $daddy.offset().top, |
|
||||
left: mouse.target.offset().left - $daddy.offset().left, |
|
||||
width: mouse.target.outerWidth() - 10, |
|
||||
height: mouse.target.outerHeight() - 10, |
|
||||
}); |
|
||||
|
|
||||
$origin.remove(); |
|
||||
$newplace.remove(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
// GRABBING EVENT
|
|
||||
var jq = (options.draggable !== false) ? options.draggable : jQclass; |
|
||||
$daddy.find(jq).addClass(dragClass); |
|
||||
$daddy.on('mousedown touchstart', jq, function (e) { |
|
||||
// For touchstart we must update "mouse" position
|
|
||||
if (e.type == 'touchstart') { |
|
||||
mouse.updatePosition(e.originalEvent.touches[0]); |
|
||||
} |
|
||||
|
|
||||
if (mouse.target == false && active == true && (e.which == 1 || e.type == 'touchstart')) { |
|
||||
var $self = $(this); |
|
||||
|
|
||||
// GET TARGET
|
|
||||
if (options.draggable !== false) { |
|
||||
mouse.target = $daddy.find(jQclass).has(this); |
|
||||
} else { |
|
||||
mouse.target = $self; |
|
||||
} |
|
||||
|
|
||||
// ADD CLONE
|
|
||||
mouse.clone = mouse.target.clone(); |
|
||||
mouse.target.css({ visibility: 'hidden' }).addClass('active'); |
|
||||
mouse.clone.addClass(cloneClass); |
|
||||
$daddy.append(mouse.clone); |
|
||||
|
|
||||
// ADD PLACEHOLDER
|
|
||||
var $placeholder = $('<div></div>'); |
|
||||
mouse.placeholder = $placeholder; |
|
||||
mouse.placeholder.addClass(holderClass); |
|
||||
mouse.placeholder.css({ |
|
||||
top: mouse.target.offset().top - $daddy.offset().top, |
|
||||
left: mouse.target.offset().left - $daddy.offset().left, |
|
||||
width: mouse.target.outerWidth() - 10, |
|
||||
height: mouse.target.outerHeight() - 10, |
|
||||
lineHeight: mouse.target.height() - 18 + 'px', |
|
||||
textAlign: 'center', |
|
||||
}).text(placeholder); |
|
||||
|
|
||||
$daddy.append(mouse.placeholder); |
|
||||
|
|
||||
// GET OFFSET FOR CLONE
|
|
||||
var bLeft = Math.floor(parseFloat($daddy.css('border-left-width'))); |
|
||||
var bTop = Math.floor(parseFloat($daddy.css('border-top-width'))); |
|
||||
var difx = mouse.x - mouse.target.offset().left + $daddy.offset().left + bLeft; |
|
||||
var dify = mouse.y - mouse.target.offset().top + $daddy.offset().top + bTop; |
|
||||
mouse.cloneoffset.x = difx; |
|
||||
mouse.cloneoffset.y = dify; |
|
||||
|
|
||||
// REMOVE THE CHILDREN DAD CLASS AND SET THE POSITION ON SCREEN
|
|
||||
mouse.clone.removeClass(childrenClass).css({ |
|
||||
position: 'absolute', |
|
||||
top: mouse.y - mouse.cloneoffset.y, |
|
||||
left: mouse.x - mouse.cloneoffset.x, |
|
||||
}); |
|
||||
|
|
||||
// UNABLE THE TEXT SELECTION AND SET THE GRAB CURSOR
|
|
||||
$('html,body').addClass('dad-noSelect'); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
$daddy.on('mouseenter touchenter', jQclass, function () { |
|
||||
dadUpdate($(this)); |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
return this; |
|
||||
}; |
|
||||
})(jQuery); |
|
||||
@ -1,132 +0,0 @@ |
|||||
;(function ($, window, document, undefined) { |
|
||||
|
|
||||
/** |
|
||||
* 数据选择器模块 |
|
||||
* @param $trigger |
|
||||
* @param option |
|
||||
* @constructor |
|
||||
*/ |
|
||||
function selectData($trigger, option) { |
|
||||
var defaults = { |
|
||||
title: '', // 弹窗标题
|
|
||||
uri: '', // api uri
|
|
||||
duplicate: true, // 是否允许重复数据
|
|
||||
dataIndex: '', // 数据索引名称 例如: goods_id, 用于验证数据是否重复
|
|
||||
getExistData: $.noop() // 获取已存在数据接口函数
|
|
||||
}; |
|
||||
this.options = $.extend({}, defaults, option); |
|
||||
// 初始化对象事件
|
|
||||
this.init($trigger); |
|
||||
} |
|
||||
|
|
||||
selectData.prototype = { |
|
||||
|
|
||||
/** |
|
||||
* 初始化 |
|
||||
*/ |
|
||||
init: function ($trigger) { |
|
||||
var _this = this; |
|
||||
if ($trigger === false) { |
|
||||
_this.showModal(); |
|
||||
return false; |
|
||||
} |
|
||||
// 选择器触发事件
|
|
||||
$trigger.unbind().click(function () { |
|
||||
_this.showModal(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 显示数据选择弹窗 |
|
||||
*/ |
|
||||
showModal: function () { |
|
||||
var _this = this; |
|
||||
// 捕获页
|
|
||||
layer.open({ |
|
||||
type: 2 |
|
||||
, id: _this.options.layerId |
|
||||
, title: _this.options.title |
|
||||
, skin: 'modal-select-data' |
|
||||
, area: ['840px', '520px'] |
|
||||
, offset: 'auto' |
|
||||
, anim: 1 |
|
||||
, closeBtn: 1 |
|
||||
, shade: 0.3 |
|
||||
, btn: ['确定', '取消'] |
|
||||
, content: STORE_URL + '/data.' + this.options.uri |
|
||||
, success: function (layero) { |
|
||||
// 初始化文件库弹窗
|
|
||||
_this.initModal(layero); |
|
||||
} |
|
||||
, yes: function (index, layero) { |
|
||||
var iframeWin = window[layero.find('iframe')[0]['name']] |
|
||||
, selectedData = iframeWin.getSelectedData() // 选择的数据
|
|
||||
, newData = _this.duplicateData(selectedData); // 去除重复
|
|
||||
// 执行回调函数
|
|
||||
if (newData && typeof _this.options.done === 'function') { |
|
||||
_this.options.done(JSON.parse(JSON.stringify(newData)), this.$touch); |
|
||||
} |
|
||||
layer.close(index); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 筛选重复数据 |
|
||||
* @param selectedData |
|
||||
*/ |
|
||||
duplicateData: function (selectedData) { |
|
||||
var _this = this; |
|
||||
if (!selectedData.length) { |
|
||||
return false; |
|
||||
} |
|
||||
if (_this.options.duplicate !== false) { |
|
||||
return selectedData; |
|
||||
} |
|
||||
if (_this.options.dataIndex === '') { |
|
||||
console.error('dataIndex is not defined'); |
|
||||
return false; |
|
||||
} |
|
||||
var existData = _this.options.getExistData.call(true); |
|
||||
if (!existData.length) { |
|
||||
return selectedData; |
|
||||
} |
|
||||
var newData = []; |
|
||||
selectedData.forEach(function (item) { |
|
||||
if (existData.indexOf(item[_this.options.dataIndex]) === -1) { |
|
||||
newData.push(item); |
|
||||
existData.push(item[_this.options.dataIndex]); |
|
||||
} |
|
||||
}); |
|
||||
return newData; |
|
||||
}, |
|
||||
|
|
||||
/** |
|
||||
* 初始弹窗 |
|
||||
*/ |
|
||||
initModal: function (element) { |
|
||||
var _this = this; |
|
||||
_this.$element = element; |
|
||||
} |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
/** |
|
||||
* 在Jquery插件中使用selectData对象 |
|
||||
* @param options |
|
||||
* @returns {selectData} |
|
||||
*/ |
|
||||
$.fn.selectData = function (options) { |
|
||||
return new selectData(this, options); |
|
||||
}; |
|
||||
|
|
||||
/** |
|
||||
* 在Jquery插件中使用selectData对象 |
|
||||
* @param options |
|
||||
* @returns {selectData} |
|
||||
*/ |
|
||||
$.selectData = function (options) { |
|
||||
return new selectData(false, options); |
|
||||
}; |
|
||||
|
|
||||
})(jQuery, window, document); |
|
||||
@ -1,87 +0,0 @@ |
|||||
.edui-popup-emotion .edui-emotion-jd img{ |
|
||||
background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:35px;height:35px;display:block; |
|
||||
} |
|
||||
.edui-popup-emotion .edui-emotion-pp img{ |
|
||||
background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:25px;height:25px;display:block; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-ldw img{ |
|
||||
background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:35px;height:35px;display:block; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-tsj img{ |
|
||||
background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:35px;height:35px;display:block; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-cat img{ |
|
||||
background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:35px;height:35px;display:block; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-bb img{ |
|
||||
background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:35px;height:35px;display:block; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-youa img{ |
|
||||
background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; |
|
||||
cursor:pointer;width:35px;height:35px;display:block; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-smileytable { |
|
||||
width: 100%; |
|
||||
border-spacing: 0; |
|
||||
border-collapse: collapse; |
|
||||
table-layout: fixed; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-wrapper { |
|
||||
padding: 15px; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-tab-nav{ |
|
||||
height: auto; |
|
||||
*height: 31px; |
|
||||
} |
|
||||
.edui-popup-emotion .edui-emotion-tabs{ |
|
||||
clear: both; |
|
||||
width: 0; |
|
||||
height: 0; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-tab-content { |
|
||||
padding: 15px 0; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-preview-box { |
|
||||
width:90px; |
|
||||
height:76px; |
|
||||
border:2px solid #9cb945; |
|
||||
background:#FFFFFF; |
|
||||
background-position:center; |
|
||||
background-repeat:no-repeat; |
|
||||
position: absolute; |
|
||||
top: 67px; |
|
||||
left: 494px; |
|
||||
display: none; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-tab-text { |
|
||||
font-size: 12px; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-preview-left { |
|
||||
left: 15px; |
|
||||
} |
|
||||
|
|
||||
.edui-popup-emotion .edui-emotion-preview-img { |
|
||||
width: 100%; |
|
||||
height: 100%; |
|
||||
display: block; |
|
||||
background-repeat: no-repeat; |
|
||||
background-position: center center; |
|
||||
} |
|
||||
@ -1,272 +0,0 @@ |
|||||
(function(){ |
|
||||
|
|
||||
var editor = null; |
|
||||
|
|
||||
UM.registerWidget('emotion',{ |
|
||||
|
|
||||
tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=emotion_url%>emotion.css\">" + |
|
||||
"<div class=\"edui-emotion-tab-Jpanel edui-emotion-wrapper\">" + |
|
||||
"<ul class=\"edui-emotion-Jtabnav edui-tab-nav\">" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab0\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_choice%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab1\" class=\"edui-tab-text\"><%=lang_input_Tuzki%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab2\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_lvdouwa%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab3\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_BOBO%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab4\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_babyCat%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab5\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_bubble%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab6\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_youa%></a></li>" + |
|
||||
"<li class=\"edui-emotion-tabs\"></li>" + |
|
||||
"</ul>" + |
|
||||
"<div class=\"edui-tab-content edui-emotion-JtabBodys\">" + |
|
||||
"<div class=\"edui-emotion-Jtab0 edui-tab-pane\"></div>" + |
|
||||
"<div class=\"edui-emotion-Jtab1 edui-tab-pane\"></div>" + |
|
||||
"<div class=\"edui-emotion-Jtab2 edui-tab-pane\"></div>" + |
|
||||
"<div class=\"edui-emotion-Jtab3 edui-tab-pane\"></div>" + |
|
||||
"<div class=\"edui-emotion-Jtab4 edui-tab-pane\"></div>" + |
|
||||
"<div class=\"edui-emotion-Jtab5 edui-tab-pane\"></div>" + |
|
||||
"<div class=\"edui-emotion-Jtab6 edui-tab-pane\"></div>" + |
|
||||
"</div>" + |
|
||||
"<div class=\"edui-emotion-JtabIconReview edui-emotion-preview-box\">" + |
|
||||
"<img src=\"<%=cover_img%>\" class=\'edui-emotion-JfaceReview edui-emotion-preview-img\'/>" + |
|
||||
"</div>", |
|
||||
|
|
||||
sourceData: { |
|
||||
emotion: { |
|
||||
tabNum:7, //切换面板数量
|
|
||||
SmilmgName:{ 'edui-emotion-Jtab0':['j_00', 84], 'edui-emotion-Jtab1':['t_00', 40], 'edui-emotion-Jtab2':['w_00', 52], 'edui-emotion-Jtab3':['B_00', 63], 'edui-emotion-Jtab4':['C_00', 20], 'edui-emotion-Jtab5':['i_f', 50], 'edui-emotion-Jtab6':['y_00', 40] }, //图片前缀名
|
|
||||
imageFolders:{ 'edui-emotion-Jtab0':'jx2/', 'edui-emotion-Jtab1':'tsj/', 'edui-emotion-Jtab2':'ldw/', 'edui-emotion-Jtab3':'bobo/', 'edui-emotion-Jtab4':'babycat/', 'edui-emotion-Jtab5':'face/', 'edui-emotion-Jtab6':'youa/'}, //图片对应文件夹路径
|
|
||||
imageCss:{'edui-emotion-Jtab0':'jd', 'edui-emotion-Jtab1':'tsj', 'edui-emotion-Jtab2':'ldw', 'edui-emotion-Jtab3':'bb', 'edui-emotion-Jtab4':'cat', 'edui-emotion-Jtab5':'pp', 'edui-emotion-Jtab6':'youa'}, //图片css类名
|
|
||||
imageCssOffset:{'edui-emotion-Jtab0':35, 'edui-emotion-Jtab1':35, 'edui-emotion-Jtab2':35, 'edui-emotion-Jtab3':35, 'edui-emotion-Jtab4':35, 'edui-emotion-Jtab5':25, 'edui-emotion-Jtab6':35}, //图片偏移
|
|
||||
SmileyInfor:{ |
|
||||
'edui-emotion-Jtab0':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'], |
|
||||
'edui-emotion-Jtab1':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'], |
|
||||
'edui-emotion-Jtab2':['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'], |
|
||||
'edui-emotion-Jtab3':['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'], |
|
||||
'edui-emotion-Jtab4':['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'], |
|
||||
'edui-emotion-Jtab5':['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'], |
|
||||
'edui-emotion-Jtab6':['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上'] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
initContent:function( _editor, $widget ){ |
|
||||
|
|
||||
var me = this, |
|
||||
emotion = me.sourceData.emotion, |
|
||||
lang = _editor.getLang( 'emotion' )['static'], |
|
||||
emotionUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/emotion/', |
|
||||
options = $.extend( {}, lang, { |
|
||||
emotion_url: emotionUrl |
|
||||
}), |
|
||||
$root = me.root(); |
|
||||
|
|
||||
if( me.inited ) { |
|
||||
me.preventDefault(); |
|
||||
this.switchToFirst(); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
me.inited = true; |
|
||||
|
|
||||
editor = _editor; |
|
||||
this.widget = $widget; |
|
||||
|
|
||||
emotion.SmileyPath = _editor.options.emotionLocalization === true ? emotionUrl + 'images/' : "http://img.baidu.com/hi/"; |
|
||||
emotion.SmileyBox = me.createTabList( emotion.tabNum ); |
|
||||
emotion.tabExist = me.createArr( emotion.tabNum ); |
|
||||
|
|
||||
options['cover_img'] = emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif' : 'default/0.gif'); |
|
||||
|
|
||||
$root.html( $.parseTmpl( me.tpl, options ) ); |
|
||||
|
|
||||
me.tabs = $.eduitab({selector:".edui-emotion-tab-Jpanel"}); |
|
||||
|
|
||||
//缓存预览对象
|
|
||||
me.previewBox = $root.find(".edui-emotion-JtabIconReview"); |
|
||||
me.previewImg = $root.find(".edui-emotion-JfaceReview"); |
|
||||
|
|
||||
me.initImgName(); |
|
||||
|
|
||||
}, |
|
||||
initEvent:function(){ |
|
||||
|
|
||||
var me = this; |
|
||||
|
|
||||
//防止点击过后关闭popup
|
|
||||
me.root().on('click', function(e){ |
|
||||
return false; |
|
||||
}); |
|
||||
|
|
||||
//移动预览
|
|
||||
me.root().delegate( 'td', 'mouseover mouseout', function( evt ){ |
|
||||
|
|
||||
var $td = $( this), |
|
||||
url = $td.attr('data-surl') || null; |
|
||||
|
|
||||
if( url ) { |
|
||||
me[evt.type]( this, url , $td.attr('data-posflag') ); |
|
||||
} |
|
||||
|
|
||||
return false; |
|
||||
|
|
||||
} ); |
|
||||
|
|
||||
//点击选中
|
|
||||
me.root().delegate( 'td', 'click', function( evt ){ |
|
||||
|
|
||||
var $td = $( this), |
|
||||
realUrl = $td.attr('data-realurl') || null; |
|
||||
|
|
||||
if( realUrl ) { |
|
||||
me.insertSmiley( realUrl.replace( /'/g, "\\'" ), evt ); |
|
||||
} |
|
||||
|
|
||||
return false; |
|
||||
|
|
||||
} ); |
|
||||
|
|
||||
//更新模板
|
|
||||
me.tabs.edui().on("beforeshow", function( evt ){ |
|
||||
|
|
||||
var contentId = $(evt.target).attr('data-context').replace( /^.*\.(?=[^\s]*$)/, '' ); |
|
||||
|
|
||||
evt.stopPropagation(); |
|
||||
|
|
||||
me.updateTab( contentId ); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
this.switchToFirst(); |
|
||||
|
|
||||
}, |
|
||||
initImgName: function() { |
|
||||
|
|
||||
var emotion = this.sourceData.emotion; |
|
||||
|
|
||||
for ( var pro in emotion.SmilmgName ) { |
|
||||
var tempName = emotion.SmilmgName[pro], |
|
||||
tempBox = emotion.SmileyBox[pro], |
|
||||
tempStr = ""; |
|
||||
|
|
||||
if ( tempBox.length ) return; |
|
||||
|
|
||||
for ( var i = 1; i <= tempName[1]; i++ ) { |
|
||||
tempStr = tempName[0]; |
|
||||
if ( i < 10 ) tempStr = tempStr + '0'; |
|
||||
tempStr = tempStr + i + '.gif'; |
|
||||
tempBox.push( tempStr ); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
/** |
|
||||
* 切换到第一个tab |
|
||||
*/ |
|
||||
switchToFirst: function(){ |
|
||||
this.root().find(".edui-emotion-Jtabnav .edui-tab-text:first").trigger('click'); |
|
||||
}, |
|
||||
updateTab: function( contentBoxId ) { |
|
||||
|
|
||||
var me = this, |
|
||||
emotion = me.sourceData.emotion; |
|
||||
|
|
||||
me.autoHeight( contentBoxId ); |
|
||||
|
|
||||
if ( !emotion.tabExist[ contentBoxId ] ) { |
|
||||
|
|
||||
emotion.tabExist[ contentBoxId ] = true; |
|
||||
me.createTab( contentBoxId ); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
autoHeight: function( ) { |
|
||||
this.widget.height(this.root() + 2); |
|
||||
}, |
|
||||
createTabList: function( tabNum ) { |
|
||||
var obj = {}; |
|
||||
for ( var i = 0; i < tabNum; i++ ) { |
|
||||
obj["edui-emotion-Jtab" + i] = []; |
|
||||
} |
|
||||
return obj; |
|
||||
}, |
|
||||
mouseover: function( td, srcPath, posFlag ) { |
|
||||
|
|
||||
posFlag -= 0; |
|
||||
|
|
||||
$(td).css( 'backgroundColor', '#ACCD3C' ); |
|
||||
|
|
||||
this.previewImg.css( "backgroundImage", "url(" + srcPath + ")" ); |
|
||||
posFlag && this.previewBox.addClass('edui-emotion-preview-left'); |
|
||||
this.previewBox.show(); |
|
||||
|
|
||||
}, |
|
||||
mouseout: function( td ) { |
|
||||
$(td).css( 'backgroundColor', 'transparent' ); |
|
||||
this.previewBox.removeClass('edui-emotion-preview-left').hide(); |
|
||||
}, |
|
||||
insertSmiley: function( url, evt ) { |
|
||||
var obj = { |
|
||||
src: url |
|
||||
}; |
|
||||
obj._src = obj.src; |
|
||||
editor.execCommand( 'insertimage', obj ); |
|
||||
if ( !evt.ctrlKey ) { |
|
||||
//关闭预览
|
|
||||
this.previewBox.removeClass('edui-emotion-preview-left').hide(); |
|
||||
this.widget.edui().hide(); |
|
||||
} |
|
||||
}, |
|
||||
createTab: function( contentBoxId ) { |
|
||||
|
|
||||
var faceVersion = "?v=1.1", //版本号
|
|
||||
me = this, |
|
||||
$contentBox = this.root().find("."+contentBoxId), |
|
||||
emotion = me.sourceData.emotion, |
|
||||
imagePath = emotion.SmileyPath + emotion.imageFolders[ contentBoxId ], //获取显示表情和预览表情的路径
|
|
||||
positionLine = 11 / 2, //中间数
|
|
||||
iWidth = iHeight = 35, //图片长宽
|
|
||||
iColWidth = 3, //表格剩余空间的显示比例
|
|
||||
tableCss = emotion.imageCss[ contentBoxId ], |
|
||||
cssOffset = emotion.imageCssOffset[ contentBoxId ], |
|
||||
textHTML = ['<table border="1" class="edui-emotion-smileytable">'], |
|
||||
i = 0, imgNum = emotion.SmileyBox[ contentBoxId ].length, imgColNum = 11, faceImage, |
|
||||
sUrl, realUrl, posflag, offset, infor; |
|
||||
|
|
||||
for ( ; i < imgNum; ) { |
|
||||
textHTML.push( '<tr>' ); |
|
||||
for ( var j = 0; j < imgColNum; j++, i++ ) { |
|
||||
faceImage = emotion.SmileyBox[ contentBoxId ][i]; |
|
||||
if ( faceImage ) { |
|
||||
sUrl = imagePath + faceImage + faceVersion; |
|
||||
realUrl = imagePath + faceImage; |
|
||||
posflag = j < positionLine ? 0 : 1; |
|
||||
offset = cssOffset * i * (-1) - 1; |
|
||||
infor = emotion.SmileyInfor[ contentBoxId ][i]; |
|
||||
|
|
||||
textHTML.push( '<td class="edui-emotion-' + tableCss + '" data-surl="'+ sUrl +'" data-realurl="'+ realUrl +'" data-posflag="'+ posflag +'" align="center">' ); |
|
||||
textHTML.push( '<span>' ); |
|
||||
textHTML.push( '<img style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>' ); |
|
||||
textHTML.push( '</span>' ); |
|
||||
} else { |
|
||||
textHTML.push( '<td bgcolor="#FFFFFF">' ); |
|
||||
} |
|
||||
textHTML.push( '</td>' ); |
|
||||
} |
|
||||
textHTML.push( '</tr>' ); |
|
||||
} |
|
||||
textHTML.push( '</table>' ); |
|
||||
textHTML = textHTML.join( "" ); |
|
||||
$contentBox.html( textHTML ); |
|
||||
}, |
|
||||
createArr: function( tabNum ) { |
|
||||
var arr = []; |
|
||||
for ( var i = 0; i < tabNum; i++ ) { |
|
||||
arr[i] = 0; |
|
||||
} |
|
||||
return arr; |
|
||||
}, |
|
||||
width:603, |
|
||||
height:400 |
|
||||
}); |
|
||||
|
|
||||
})(); |
|
||||
|
|
||||
|
Before Width: | Height: | Size: 43 B |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 28 KiB |
@ -1,32 +0,0 @@ |
|||||
.edui-popup-formula .edui-formula-wrapper { |
|
||||
padding: 15px; |
|
||||
} |
|
||||
.edui-popup-formula .edui-formula-wrapper .edui-tab-nav{ |
|
||||
height: auto; |
|
||||
*height: 31px; |
|
||||
} |
|
||||
.edui-popup-formula .edui-formula-wrapper .edui-tab-text { |
|
||||
font-size: 12px; |
|
||||
} |
|
||||
.edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth { |
|
||||
clear: both; |
|
||||
width: 0; |
|
||||
height: 0; |
|
||||
} |
|
||||
.edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul { |
|
||||
margin: 0px; |
|
||||
padding: 0px; |
|
||||
} |
|
||||
.edui-popup-formula .edui-formula-wrapper .edui-tab-content { |
|
||||
padding: 5px 0px 0px 0px; |
|
||||
} |
|
||||
.edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item { |
|
||||
display: block; |
|
||||
float: left; |
|
||||
margin: 0px 3px 3px 0px; |
|
||||
width: 30px; |
|
||||
height: 30px; |
|
||||
border:1px solid #cccccc; |
|
||||
background-image: url("images/formula.png"); |
|
||||
cursor: pointer; |
|
||||
} |
|
||||
@ -1,212 +0,0 @@ |
|||||
<!doctype html> |
|
||||
<html lang="en"> |
|
||||
<head> |
|
||||
<meta charset="UTF-8"> |
|
||||
<title>Document</title> |
|
||||
<link rel="stylesheet" href="../../third-party/mathquill/mathquill.css"/> |
|
||||
<style> |
|
||||
html, body, .main{ |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
overflow: hidden; |
|
||||
} |
|
||||
.main{ |
|
||||
width:1024px; |
|
||||
height:1024px; |
|
||||
} |
|
||||
.mathquill-editable, |
|
||||
.mathquill-rendered-math{ |
|
||||
border: 0px; |
|
||||
padding: 0px; |
|
||||
margin:4px; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body> |
|
||||
|
|
||||
<div class="main"> |
|
||||
<div class="mathquill-editable"></div> |
|
||||
</div> |
|
||||
|
|
||||
<div> |
|
||||
<input id="blurHelper" /> |
|
||||
</div> |
|
||||
|
|
||||
<script src="../../third-party/jquery.min.js"></script> |
|
||||
<script src="../../third-party/mathquill/mathquill.js"></script> |
|
||||
<script> |
|
||||
$(function(){ |
|
||||
|
|
||||
var UM = parent.UM, |
|
||||
$iframe = $(getSelfIframe()), |
|
||||
editorId = $iframe.parents('.edui-body-container').attr('id'), |
|
||||
editor = UM.getEditor(editorId), |
|
||||
timer; |
|
||||
|
|
||||
/* 获得当前公式所在的iframe节点 */ |
|
||||
function getSelfIframe(){ |
|
||||
var iframes = parent.document.getElementsByTagName('iframe'); |
|
||||
for (var key in iframes) { |
|
||||
if (iframes[key].contentWindow == window) { |
|
||||
return iframes[key]; |
|
||||
} |
|
||||
} |
|
||||
return null; |
|
||||
} |
|
||||
/* 获得当前url上的hash存储的参数值 */ |
|
||||
function getLatex() { |
|
||||
return $iframe.attr('data-latex') || ''; |
|
||||
} |
|
||||
/* 保存场景 */ |
|
||||
function saveScene(){ |
|
||||
timer && clearTimeout(timer); |
|
||||
timer = setTimeout(function(){ |
|
||||
editor.fireEvent('savescene'); |
|
||||
editor.fireEvent('contentchange'); |
|
||||
editor.fireEvent('selectionchange'); |
|
||||
timer = null; |
|
||||
}, 300); |
|
||||
} |
|
||||
/* 设置编辑器可编辑 */ |
|
||||
function enableEditor(){ |
|
||||
if(editor.body.contentEditable == 'false') { |
|
||||
editor.setEnabled(); |
|
||||
} |
|
||||
} |
|
||||
/* 设置编辑器不可编辑 */ |
|
||||
function disableEditor(){ |
|
||||
if(editor.body.contentEditable == 'true') { |
|
||||
editor.setDisabled(['undo', 'redo', 'preview', 'formula'], true); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/* 公式 */ |
|
||||
var Formula = function(){ |
|
||||
var _this = this, |
|
||||
latex = getLatex(); |
|
||||
|
|
||||
this.isFocus = false; |
|
||||
this.isDisabled = false; |
|
||||
|
|
||||
/* 加载公式内容 */ |
|
||||
this.$mathquill = $('.mathquill-editable').mathquill('latex', latex); |
|
||||
|
|
||||
/* 设置活动状态的公式iframe */ |
|
||||
this.$mathquill.on('mousedown', function(){ |
|
||||
/* 编辑器不可用时,公式也不可用 */ |
|
||||
if(_this.disabled) return false; |
|
||||
|
|
||||
/* 第一次点击当前公式,设置公式活动 */ |
|
||||
if(!$iframe.hasClass('edui-formula-active')) { |
|
||||
disableEditor(); |
|
||||
editor.blur(); |
|
||||
editor.$body.find('iframe').not($iframe).each(function(k, v){ |
|
||||
v.contentWindow.formula.blur(); |
|
||||
}); |
|
||||
if(_this.$mathquill.find('.cursor').css('display') == 'none') { |
|
||||
_this.refresh(); |
|
||||
_this.$mathquill.addClass('hasCursor'); |
|
||||
} |
|
||||
} |
|
||||
_this.focus(); |
|
||||
}); |
|
||||
editor.addListener('click', function(){ |
|
||||
_this.blur(); |
|
||||
enableEditor(); |
|
||||
}); |
|
||||
|
|
||||
/* 里面focus,编辑器也判断为focus */ |
|
||||
editor.addListener('isFocus', function(){ |
|
||||
return _this.isFocus; |
|
||||
}); |
|
||||
/* um不可用,公式也不可编辑 */ |
|
||||
editor.addListener('setDisabled', function(type, except){ |
|
||||
if (!(except && except.join(' ').indexOf('formula') != -1) && _this.isDisabled != true ) { |
|
||||
_this.setDisabled(); |
|
||||
} |
|
||||
}); |
|
||||
editor.addListener('setEnabled', function(){ |
|
||||
if (_this.isDisabled != false) { |
|
||||
_this.setEnabled(); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
/* 设置更新外层iframe的大小和属性 */ |
|
||||
$(document.body).on('keydown', function(){ |
|
||||
_this.updateIframe(); |
|
||||
}).on('keyup', function(){ |
|
||||
_this.updateIframe(); |
|
||||
}); |
|
||||
|
|
||||
/* 清除初始化的高亮状态 */ |
|
||||
this.$mathquill.removeClass('hasCursor'); |
|
||||
|
|
||||
/* 初始化后延迟刷新外层iframe大小 */ |
|
||||
setTimeout(function(){ |
|
||||
_this.updateIframe(); |
|
||||
}, 300); |
|
||||
}; |
|
||||
|
|
||||
Formula.prototype = { |
|
||||
focus:function(){ |
|
||||
$iframe.addClass('edui-formula-active'); |
|
||||
this.isFocus = true; |
|
||||
}, |
|
||||
blur:function(){ |
|
||||
$iframe.removeClass('edui-formula-active'); |
|
||||
this.removeCursor(); |
|
||||
this.isFocus = false; |
|
||||
}, |
|
||||
removeCursor: function(){ |
|
||||
this.$mathquill.find('span.cursor').hide(); |
|
||||
this.$mathquill.parent().find('.hasCursor').removeClass('hasCursor'); |
|
||||
}, |
|
||||
updateIframe: function(){ |
|
||||
$iframe.width(this.$mathquill.width()+8).height(this.$mathquill.height()+8); |
|
||||
var latex = $iframe.attr('data-latex'), |
|
||||
newLatex = this.getLatex(); |
|
||||
if(latex != newLatex) { |
|
||||
$iframe.attr('data-latex', this.getLatex()); |
|
||||
saveScene(); |
|
||||
} |
|
||||
}, |
|
||||
insertLatex: function(latex){ |
|
||||
this.$mathquill.mathquill('write', latex); |
|
||||
this.updateIframe(); |
|
||||
this.removeCursor(); |
|
||||
}, |
|
||||
setLatex: function(latex){ |
|
||||
this.$mathquill.mathquill('latex', latex); |
|
||||
this.updateIframe(); |
|
||||
}, |
|
||||
getLatex: function(){ |
|
||||
return this.$mathquill.mathquill('latex'); |
|
||||
}, |
|
||||
redraw: function(){ |
|
||||
this.$mathquill.mathquill('redraw'); |
|
||||
}, |
|
||||
setDisabled: function(){ |
|
||||
this.blur(); |
|
||||
var latex = this.getLatex(); |
|
||||
this.$mathquill.mathquill('revert').text(latex).mathquill(); |
|
||||
this.updateIframe(); |
|
||||
this.isDisabled = true; |
|
||||
}, |
|
||||
setEnabled: function(){ |
|
||||
this.$mathquill.removeClass('mathquill-rendered-math'); |
|
||||
this.refresh(); |
|
||||
this.isDisabled = false; |
|
||||
}, |
|
||||
refresh: function(){ |
|
||||
var latex = this.getLatex(); |
|
||||
this.$mathquill.mathquill('revert').text(latex).mathquill('editable'); |
|
||||
this.updateIframe(); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
/* 绑定到window上,给上级window调用 */ |
|
||||
window.formula = new Formula(); |
|
||||
}); |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
||||
@ -1,124 +0,0 @@ |
|||||
(function () { |
|
||||
|
|
||||
var editor = null; |
|
||||
|
|
||||
UM.registerWidget('formula', { |
|
||||
|
|
||||
tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=formula_url%>formula.css\">" + |
|
||||
"<div class=\"edui-formula-wrapper\">" + |
|
||||
"<ul class=\"edui-tab-nav\"></ul>" + |
|
||||
"<div class=\"edui-tab-content\"></div>" + |
|
||||
"</div>", |
|
||||
|
|
||||
sourceData: { |
|
||||
formula: { |
|
||||
'common': [ |
|
||||
"{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }", |
|
||||
"{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }" |
|
||||
], |
|
||||
'symbol': [ |
|
||||
"+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup", |
|
||||
"=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty", |
|
||||
"{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq", |
|
||||
"{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow", |
|
||||
"{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow" |
|
||||
], |
|
||||
'letter': [ |
|
||||
"{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu", |
|
||||
"{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi", |
|
||||
"{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega" |
|
||||
] |
|
||||
} |
|
||||
}, |
|
||||
initContent: function (_editor, $widget) { |
|
||||
|
|
||||
var me = this, |
|
||||
formula = me.sourceData.formula, |
|
||||
lang = _editor.getLang('formula').static, |
|
||||
formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/', |
|
||||
options = $.extend({}, lang, { 'formula_url': formulaUrl }), |
|
||||
$root = me.root(); |
|
||||
|
|
||||
if (me.inited) { |
|
||||
me.preventDefault(); |
|
||||
return; |
|
||||
} |
|
||||
me.inited = true; |
|
||||
|
|
||||
editor = _editor; |
|
||||
me.$widget = $widget; |
|
||||
|
|
||||
$root.html($.parseTmpl(me.tpl, options)); |
|
||||
me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"}); |
|
||||
|
|
||||
/* 初始化popup的内容 */ |
|
||||
var headHtml = [], xMax = 0, yMax = 0, |
|
||||
$tabContent = me.root().find('.edui-tab-content'); |
|
||||
$.each(formula, function (k, v) { |
|
||||
var contentHtml = []; |
|
||||
$.each(v, function (i, f) { |
|
||||
contentHtml.push('<li class="edui-formula-latex-item" data-latex="' + f + '" style="background-position:-' + (xMax * 30) + 'px -' + (yMax * 30) + 'px"></li>'); |
|
||||
if (++xMax >=8) { |
|
||||
++yMax; xMax = 0; |
|
||||
} |
|
||||
}); |
|
||||
yMax++; xMax = 0; |
|
||||
$tabContent.append('<div class="edui-tab-pane"><ul>' + contentHtml.join('') + '</ul>'); |
|
||||
headHtml.push('<li class="edui-tab-item"><a href="javascript:void(0);" class="edui-tab-text">' + lang['lang_tab_' + k] + '</a></li>'); |
|
||||
}); |
|
||||
headHtml.push('<li class="edui-formula-clearboth"></li>'); |
|
||||
$root.find('.edui-tab-nav').html(headHtml.join('')); |
|
||||
$root.find('.edui-tab-content').append('<div class="edui-formula-clearboth"></div>'); |
|
||||
|
|
||||
/* 选中第一个tab */ |
|
||||
me.switchTab(0); |
|
||||
}, |
|
||||
initEvent: function () { |
|
||||
var me = this; |
|
||||
|
|
||||
//防止点击过后关闭popup
|
|
||||
me.root().on('click', function (e) { |
|
||||
return false; |
|
||||
}); |
|
||||
|
|
||||
//点击tab切换菜单
|
|
||||
me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) { |
|
||||
me.switchTab(this); |
|
||||
return false; |
|
||||
}); |
|
||||
|
|
||||
//点击选中公式
|
|
||||
me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) { |
|
||||
var $item = $(this), |
|
||||
latex = $item.attr('data-latex') || ''; |
|
||||
|
|
||||
if (latex) { |
|
||||
me.insertLatex(latex.replace("{/}", "\\")); |
|
||||
} |
|
||||
me.$widget.edui().hide(); |
|
||||
return false; |
|
||||
}); |
|
||||
}, |
|
||||
switchTab:function(index){ |
|
||||
var me = this, |
|
||||
$root = me.root(), |
|
||||
index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item')); |
|
||||
|
|
||||
$root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active'); |
|
||||
$root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active'); |
|
||||
|
|
||||
/* 自动长高 */ |
|
||||
me.autoHeight(0); |
|
||||
}, |
|
||||
autoHeight: function () { |
|
||||
this.$widget.height(this.root() + 2); |
|
||||
}, |
|
||||
insertLatex: function (latex) { |
|
||||
editor.execCommand('formula', latex ); |
|
||||
}, |
|
||||
width: 350, |
|
||||
height: 400 |
|
||||
}); |
|
||||
|
|
||||
})(); |
|
||||
|
|
||||
|
Before Width: | Height: | Size: 19 KiB |
@ -1,42 +0,0 @@ |
|||||
.edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;} |
|
||||
|
|
||||
/*upload*/ |
|
||||
.edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;} |
|
||||
.edui-dialog-image .edui-image-upload2{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;} |
|
||||
|
|
||||
.edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} |
|
||||
.edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} |
|
||||
|
|
||||
.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')} |
|
||||
.edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} |
|
||||
.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')} |
|
||||
|
|
||||
.edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; |
|
||||
color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} |
|
||||
|
|
||||
.edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;} |
|
||||
|
|
||||
.edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff; |
|
||||
text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);} |
|
||||
.edui-dialog-image .edui-image-mask.edui-active{display: block;} |
|
||||
|
|
||||
/*network*/ |
|
||||
.edui-dialog-image .edui-image-searchBar{margin: 10px;} |
|
||||
.edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;} |
|
||||
.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1; |
|
||||
width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px; |
|
||||
background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer; |
|
||||
} |
|
||||
.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{ |
|
||||
background-color: #d5e1f2; |
|
||||
padding: 0; |
|
||||
border: 1px solid #a3bde3; |
|
||||
} |
|
||||
.edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;} |
|
||||
|
|
||||
|
|
||||
/*common*/ |
|
||||
.edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} |
|
||||
.edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} |
|
||||
.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} |
|
||||
.edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} |
|
||||
@ -1,454 +0,0 @@ |
|||||
(function() { |
|
||||
|
|
||||
var utils = UM.utils, |
|
||||
browser = UM.browser, |
|
||||
Base = { |
|
||||
checkURL: function(url) { |
|
||||
if (!url) return false; |
|
||||
url = utils.trim(url); |
|
||||
if (url.length <= 0) { |
|
||||
return false; |
|
||||
} |
|
||||
if (url.search(/http:\/\/|https:\/\//) !== 0) { |
|
||||
url += 'http://'; |
|
||||
} |
|
||||
|
|
||||
url = url.replace(/\?[\s\S]*$/, ""); |
|
||||
|
|
||||
if (!/(.gif|.jpg|.jpeg|.png)$/i.test(url)) { |
|
||||
return false; |
|
||||
} |
|
||||
return url; |
|
||||
}, |
|
||||
getAllPic: function(sel, $w, editor) { |
|
||||
var me = this, |
|
||||
arr = [], |
|
||||
$imgs = $(sel, $w); |
|
||||
|
|
||||
$.each($imgs, function(index, node) { |
|
||||
$(node).removeAttr("width").removeAttr("height"); |
|
||||
|
|
||||
// if (node.width > editor.options.initialFrameWidth) {
|
|
||||
// me.scale(node, editor.options.initialFrameWidth -
|
|
||||
// parseInt($(editor.body).css("padding-left")) -
|
|
||||
// parseInt($(editor.body).css("padding-right")));
|
|
||||
// }
|
|
||||
|
|
||||
return arr.push({ |
|
||||
_src: node.src, |
|
||||
src: node.src |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
return arr; |
|
||||
}, |
|
||||
scale: function(img, max, oWidth, oHeight) { |
|
||||
var width = 0, |
|
||||
height = 0, |
|
||||
percent, ow = img.width || oWidth, |
|
||||
oh = img.height || oHeight; |
|
||||
if (ow > max || oh > max) { |
|
||||
if (ow >= oh) { |
|
||||
if (width = ow - max) { |
|
||||
percent = (width / ow).toFixed(2); |
|
||||
img.height = oh - oh * percent; |
|
||||
img.width = max; |
|
||||
} |
|
||||
} else { |
|
||||
if (height = oh - max) { |
|
||||
percent = (height / oh).toFixed(2); |
|
||||
img.width = ow - ow * percent; |
|
||||
img.height = max; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
return this; |
|
||||
}, |
|
||||
close: function($img) { |
|
||||
|
|
||||
$img.css({ |
|
||||
top: ($img.parent().height() - $img.height()) / 2, |
|
||||
left: ($img.parent().width() - $img.width()) / 2 |
|
||||
}).prev().on("click", function() { |
|
||||
|
|
||||
if ($(this).parent().remove().hasClass("edui-image-upload-item")) { |
|
||||
//显示图片计数-1
|
|
||||
Upload.showCount--; |
|
||||
Upload.updateView(); |
|
||||
} |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
return this; |
|
||||
}, |
|
||||
createImgBase64: function(img, file, $w) { |
|
||||
if (browser.webkit) { |
|
||||
//Chrome8+
|
|
||||
img.src = window.webkitURL.createObjectURL(file); |
|
||||
} else if (browser.gecko) { |
|
||||
//FF4+
|
|
||||
img.src = window.URL.createObjectURL(file); |
|
||||
} else { |
|
||||
//实例化file reader对象
|
|
||||
var reader = new FileReader(); |
|
||||
reader.onload = function(e) { |
|
||||
img.src = this.result; |
|
||||
$w.append(img); |
|
||||
}; |
|
||||
reader.readAsDataURL(file); |
|
||||
} |
|
||||
}, |
|
||||
callback: function(editor, $w, url, state) { |
|
||||
if (state == "SUCCESS") { |
|
||||
//显示图片计数+1
|
|
||||
Upload.showCount++; |
|
||||
var $img = $("<img src='" + url + "' class='edui-image-pic' />"), |
|
||||
$item = $("<div class='edui-image-item edui-image-upload-item'><div class='edui-image-close'></div></div>").append($img); |
|
||||
|
|
||||
if ($(".edui-image-upload2", $w).length < 1) { |
|
||||
$(".edui-image-content", $w).append($item); |
|
||||
|
|
||||
Upload.render(".edui-image-content", 2) |
|
||||
.config(".edui-image-upload2"); |
|
||||
} else { |
|
||||
$(".edui-image-upload2", $w).before($item).show(); |
|
||||
} |
|
||||
|
|
||||
$img.on("load", function() { |
|
||||
Base.scale(this, 120); |
|
||||
Base.close($(this)); |
|
||||
$(".edui-image-content", $w).focus(); |
|
||||
}); |
|
||||
|
|
||||
} else { |
|
||||
currentDialog.showTip(state); |
|
||||
window.setTimeout(function() { |
|
||||
|
|
||||
currentDialog.hideTip(); |
|
||||
|
|
||||
}, 3000); |
|
||||
} |
|
||||
|
|
||||
Upload.toggleMask(); |
|
||||
|
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
/* |
|
||||
* 本地上传 |
|
||||
* */ |
|
||||
var Upload = { |
|
||||
showCount: 0, |
|
||||
uploadTpl: '<div class="edui-image-upload%%">' + |
|
||||
'<span class="edui-image-icon"></span>' + |
|
||||
'<form class="edui-image-form" method="post" enctype="multipart/form-data" target="up">' + |
|
||||
'<input style=\"filter: alpha(opacity=0);\" class="edui-image-file" type="file" hidefocus name="iFile" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp"/>' + |
|
||||
'</form>' + |
|
||||
|
|
||||
'</div>', |
|
||||
init: function(editor, $w) { |
|
||||
var me = this; |
|
||||
|
|
||||
me.editor = editor; |
|
||||
me.dialog = $w; |
|
||||
me.render(".edui-image-local", 1); |
|
||||
me.config(".edui-image-upload1"); |
|
||||
me.submit(); |
|
||||
me.drag(); |
|
||||
|
|
||||
$(".edui-image-upload1").hover(function() { |
|
||||
$(".edui-image-icon", this).toggleClass("hover"); |
|
||||
}); |
|
||||
|
|
||||
if (!(UM.browser.ie && UM.browser.version <= 9)) { |
|
||||
$(".edui-image-dragTip", me.dialog).css("display", "block"); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
return me; |
|
||||
}, |
|
||||
render: function(sel, t) { |
|
||||
var me = this; |
|
||||
|
|
||||
$(sel, me.dialog).append($(me.uploadTpl.replace(/%%/g, t))); |
|
||||
|
|
||||
return me; |
|
||||
}, |
|
||||
config: function(sel) { |
|
||||
var me = this, |
|
||||
url = me.editor.options.imageUrl; |
|
||||
|
|
||||
url = url + (url.indexOf("?") == -1 ? "?" : "&") + "editorid=" + me.editor.id; //初始form提交地址;
|
|
||||
|
|
||||
$("form", $(sel, me.dialog)).attr("action", url); |
|
||||
|
|
||||
return me; |
|
||||
}, |
|
||||
uploadComplete: function(r) { |
|
||||
console.log('uploadComplete'); |
|
||||
|
|
||||
var me = this; |
|
||||
try { |
|
||||
var json = JSON.parse(r); |
|
||||
var state = json.code === 1 ? 'SUCCESS' : 'Error!'; |
|
||||
Base.callback(me.editor, me.dialog, json.data.file_path, state); |
|
||||
} catch (e) { |
|
||||
var lang = me.editor.getLang('image'); |
|
||||
Base.callback(me.editor, me.dialog, '', (lang && lang.uploadError) || 'Error!'); |
|
||||
} |
|
||||
}, |
|
||||
submit: function(callback) { |
|
||||
console.log('submit'); |
|
||||
|
|
||||
var me = this, |
|
||||
input = $('<input style="filter: alpha(opacity=0);" class="edui-image-file" type="file" hidefocus=""' + |
|
||||
' name="iFile" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp">'), |
|
||||
input = input[0]; |
|
||||
|
|
||||
$(me.dialog).delegate(".edui-image-file", "change", function(e) { |
|
||||
|
|
||||
if (!this.parentNode) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
$('<iframe name="up" style="display: none"></iframe>') |
|
||||
.insertBefore(me.dialog).on('load', function() { |
|
||||
var r = this.contentWindow.document.body.innerText; |
|
||||
if (r == '') return; |
|
||||
me.uploadComplete(r); |
|
||||
$(this).unbind('load'); |
|
||||
$(this).remove(); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
$(this).parent()[0].submit(); |
|
||||
Upload.updateInput(input); |
|
||||
me.toggleMask("Loading...."); |
|
||||
callback && callback(); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
return me; |
|
||||
}, |
|
||||
//更新input
|
|
||||
updateInput: function(inputField) { |
|
||||
|
|
||||
$(".edui-image-file", this.dialog).each(function(index, ele) { |
|
||||
|
|
||||
ele.parentNode.replaceChild(inputField.cloneNode(true), ele); |
|
||||
|
|
||||
}); |
|
||||
|
|
||||
}, |
|
||||
//更新上传框
|
|
||||
updateView: function() { |
|
||||
|
|
||||
if (Upload.showCount !== 0) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
$(".edui-image-upload2", this.dialog).hide(); |
|
||||
$(".edui-image-dragTip", this.dialog).show(); |
|
||||
$(".edui-image-upload1", this.dialog).show(); |
|
||||
|
|
||||
}, |
|
||||
drag: function() { |
|
||||
var me = this; |
|
||||
//做拽上传的支持
|
|
||||
if (!UM.browser.ie9below) { |
|
||||
me.dialog.find('.edui-image-content').on('drop', function(e) { |
|
||||
|
|
||||
//获取文件列表
|
|
||||
var fileList = e.originalEvent.dataTransfer.files; |
|
||||
var img = document.createElement('img'); |
|
||||
var hasImg = false; |
|
||||
$.each(fileList, function(i, f) { |
|
||||
if (/^image/.test(f.type)) { |
|
||||
//创建图片的base64
|
|
||||
Base.createImgBase64(img, f, me.dialog); |
|
||||
|
|
||||
var xhr = new XMLHttpRequest(); |
|
||||
xhr.open("post", me.editor.getOpt('imageUrl') + "?type=ajax", true); |
|
||||
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); |
|
||||
|
|
||||
//模拟数据
|
|
||||
var fd = new FormData(); |
|
||||
fd.append(me.editor.getOpt('imageFieldName'), f); |
|
||||
|
|
||||
xhr.send(fd); |
|
||||
xhr.addEventListener('load', function(e) { |
|
||||
var r = e.target.response, |
|
||||
json; |
|
||||
me.uploadComplete(r); |
|
||||
if (i == fileList.length - 1) { |
|
||||
$(img).remove() |
|
||||
} |
|
||||
}); |
|
||||
hasImg = true; |
|
||||
} |
|
||||
}); |
|
||||
if (hasImg) { |
|
||||
e.preventDefault(); |
|
||||
me.toggleMask("Loading...."); |
|
||||
} |
|
||||
|
|
||||
}).on('dragover', function(e) { |
|
||||
e.preventDefault(); |
|
||||
}); |
|
||||
} |
|
||||
}, |
|
||||
toggleMask: function(html) { |
|
||||
var me = this; |
|
||||
|
|
||||
var $mask = $(".edui-image-mask", me.dialog); |
|
||||
if (html) { |
|
||||
if (!(UM.browser.ie && UM.browser.version <= 9)) { |
|
||||
$(".edui-image-dragTip", me.dialog).css("display", "none"); |
|
||||
} |
|
||||
$(".edui-image-upload1", me.dialog).css("display", "none"); |
|
||||
$mask.addClass("edui-active").html(html); |
|
||||
} else { |
|
||||
|
|
||||
$mask.removeClass("edui-active").html(); |
|
||||
|
|
||||
if (Upload.showCount > 0) { |
|
||||
return me; |
|
||||
} |
|
||||
|
|
||||
if (!(UM.browser.ie && UM.browser.version <= 9)) { |
|
||||
$(".edui-image-dragTip", me.dialog).css("display", "block"); |
|
||||
} |
|
||||
$(".edui-image-upload1", me.dialog).css("display", "block"); |
|
||||
} |
|
||||
|
|
||||
return me; |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
/* |
|
||||
* 网络图片 |
|
||||
* */ |
|
||||
var NetWork = { |
|
||||
init: function(editor, $w) { |
|
||||
var me = this; |
|
||||
|
|
||||
me.editor = editor; |
|
||||
me.dialog = $w; |
|
||||
|
|
||||
me.initEvt(); |
|
||||
}, |
|
||||
initEvt: function() { |
|
||||
var me = this, |
|
||||
url, |
|
||||
$ele = $(".edui-image-searchTxt", me.dialog); |
|
||||
|
|
||||
$(".edui-image-searchAdd", me.dialog).on("click", function() { |
|
||||
url = Base.checkURL($ele.val()); |
|
||||
|
|
||||
if (url) { |
|
||||
|
|
||||
$("<img src='" + url + "' class='edui-image-pic' />").on("load", function() { |
|
||||
|
|
||||
|
|
||||
var $item = $("<div class='edui-image-item'><div class='edui-image-close'></div></div>").append(this); |
|
||||
|
|
||||
$(".edui-image-searchRes", me.dialog).append($item); |
|
||||
|
|
||||
Base.scale(this, 120); |
|
||||
|
|
||||
$item.width($(this).width()); |
|
||||
|
|
||||
Base.close($(this)); |
|
||||
|
|
||||
$ele.val(""); |
|
||||
}); |
|
||||
} |
|
||||
}) |
|
||||
.hover(function() { |
|
||||
$(this).toggleClass("hover"); |
|
||||
}); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
var $tab = null, |
|
||||
currentDialog = null; |
|
||||
|
|
||||
UM.registerWidget('image', { |
|
||||
tpl: "<link rel=\"stylesheet\" type=\"text/css\" href=\"<%=image_url%>image.css\">" + |
|
||||
"<div class=\"edui-image-wrapper\">" + |
|
||||
"<ul class=\"edui-tab-nav\">" + |
|
||||
"<li class=\"edui-tab-item edui-active\"><a data-context=\".edui-image-local\" class=\"edui-tab-text\"><%=lang_tab_local%></a></li>" + |
|
||||
"<li class=\"edui-tab-item\"><a data-context=\".edui-image-JimgSearch\" class=\"edui-tab-text\"><%=lang_tab_imgSearch%></a></li>" + |
|
||||
"</ul>" + |
|
||||
"<div class=\"edui-tab-content\">" + |
|
||||
"<div class=\"edui-image-local edui-tab-pane edui-active\">" + |
|
||||
"<div class=\"edui-image-content\"></div>" + |
|
||||
"<div class=\"edui-image-mask\"></div>" + |
|
||||
"<div class=\"edui-image-dragTip\"><%=lang_input_dragTip%></div>" + |
|
||||
"</div>" + |
|
||||
"<div class=\"edui-image-JimgSearch edui-tab-pane\">" + |
|
||||
"<div class=\"edui-image-searchBar\">" + |
|
||||
"<table><tr><td><input class=\"edui-image-searchTxt\" type=\"text\"></td>" + |
|
||||
"<td><div class=\"edui-image-searchAdd\"><%=lang_btn_add%></div></td></tr></table>" + |
|
||||
"</div>" + |
|
||||
"<div class=\"edui-image-searchRes\"></div>" + |
|
||||
"</div>" + |
|
||||
"</div>" + |
|
||||
"</div>", |
|
||||
initContent: function(editor, $dialog) { |
|
||||
var lang = editor.getLang('image')["static"], |
|
||||
opt = $.extend({}, lang, { |
|
||||
image_url: UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/image/' |
|
||||
}); |
|
||||
|
|
||||
Upload.showCount = 0; |
|
||||
|
|
||||
if (lang) { |
|
||||
var html = $.parseTmpl(this.tpl, opt); |
|
||||
} |
|
||||
|
|
||||
currentDialog = $dialog.edui(); |
|
||||
|
|
||||
this.root().html(html); |
|
||||
|
|
||||
}, |
|
||||
initEvent: function(editor, $w) { |
|
||||
$tab = $.eduitab({ |
|
||||
selector: ".edui-image-wrapper" |
|
||||
}) |
|
||||
.edui().on("beforeshow", function(e) { |
|
||||
e.stopPropagation(); |
|
||||
}); |
|
||||
|
|
||||
Upload.init(editor, $w); |
|
||||
|
|
||||
NetWork.init(editor, $w); |
|
||||
}, |
|
||||
buttons: { |
|
||||
'ok': { |
|
||||
exec: function(editor, $w) { |
|
||||
var sel = "", |
|
||||
index = $tab.activate(); |
|
||||
|
|
||||
if (index == 0) { |
|
||||
sel = ".edui-image-content .edui-image-pic"; |
|
||||
} else if (index == 1) { |
|
||||
sel = ".edui-image-searchRes .edui-image-pic"; |
|
||||
} |
|
||||
|
|
||||
var list = Base.getAllPic(sel, $w, editor); |
|
||||
|
|
||||
if (index != -1) { |
|
||||
editor.execCommand('insertimage', list); |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
'cancel': {} |
|
||||
}, |
|
||||
width: 700, |
|
||||
height: 408 |
|
||||
}, function(editor, $w, url, state) { |
|
||||
Base.callback(editor, $w, url, state) |
|
||||
}) |
|
||||
})(); |
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 848 B |
|
Before Width: | Height: | Size: 1.9 KiB |
@ -1,73 +0,0 @@ |
|||||
(function(){ |
|
||||
var utils = UM.utils; |
|
||||
function hrefStartWith(href, arr) { |
|
||||
href = href.replace(/^\s+|\s+$/g, ''); |
|
||||
for (var i = 0, ai; ai = arr[i++];) { |
|
||||
if (href.indexOf(ai) == 0) { |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
UM.registerWidget('link', { |
|
||||
tpl: "<style type=\"text/css\">" + |
|
||||
".edui-dialog-link .edui-link-table{font-size: 12px;margin: 10px;line-height: 30px}" + |
|
||||
".edui-dialog-link .edui-link-txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}" + |
|
||||
"</style>" + |
|
||||
"<table class=\"edui-link-table\">" + |
|
||||
"<tr>" + |
|
||||
"<td><label for=\"href\"><%=lang_input_url%></label></td>" + |
|
||||
"<td><input class=\"edui-link-txt\" id=\"edui-link-Jhref\" type=\"text\" /></td>" + |
|
||||
"</tr>" + |
|
||||
"<tr>" + |
|
||||
"<td><label for=\"title\"><%=lang_input_title%></label></td>" + |
|
||||
"<td><input class=\"edui-link-txt\" id=\"edui-link-Jtitle\" type=\"text\"/></td>" + |
|
||||
"</tr>" + |
|
||||
"<tr>" + |
|
||||
"<td colspan=\"2\">" + |
|
||||
"<label for=\"target\"><%=lang_input_target%></label>" + |
|
||||
"<input id=\"edui-link-Jtarget\" type=\"checkbox\"/>" + |
|
||||
"</td>" + |
|
||||
"</tr>" + |
|
||||
// "<tr>" +
|
|
||||
// "<td colspan=\"2\" id=\"edui-link-Jmsg\"></td>" +
|
|
||||
// "</tr>" +
|
|
||||
"</table>", |
|
||||
initContent: function (editor) { |
|
||||
var lang = editor.getLang('link'); |
|
||||
if (lang) { |
|
||||
var html = $.parseTmpl(this.tpl, lang.static); |
|
||||
} |
|
||||
this.root().html(html); |
|
||||
}, |
|
||||
initEvent: function (editor, $w) { |
|
||||
var link = editor.queryCommandValue('link'); |
|
||||
if(link){ |
|
||||
$('#edui-link-Jhref',$w).val(utils.html($(link).attr('href'))); |
|
||||
$('#edui-link-Jtitle',$w).val($(link).attr('title')); |
|
||||
$(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true) |
|
||||
} |
|
||||
$('#edui-link-Jhref',$w).focus(); |
|
||||
}, |
|
||||
buttons: { |
|
||||
'ok': { |
|
||||
exec: function (editor, $w) { |
|
||||
var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, ''); |
|
||||
|
|
||||
if (href) { |
|
||||
editor.execCommand('link', { |
|
||||
'href': href, |
|
||||
'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self', |
|
||||
'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''), |
|
||||
'_href': href |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
'cancel':{} |
|
||||
}, |
|
||||
width: 400 |
|
||||
}) |
|
||||
})(); |
|
||||
|
|
||||
@ -1,148 +0,0 @@ |
|||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
||||
<head> |
|
||||
<meta charset="utf-8"/> |
|
||||
<meta name="keywords" content="百度地图,百度地图API,百度地图自定义工具,百度地图所见即所得工具"/> |
|
||||
<meta name="description" content="百度地图API自定义地图,帮助用户在可视化操作下生成百度地图"/> |
|
||||
<title>百度地图API自定义地图</title> |
|
||||
<!--引用百度地图API--> |
|
||||
<style type="text/css"> |
|
||||
html, body { |
|
||||
margin: 0; |
|
||||
padding: 0; |
|
||||
overflow: hidden; |
|
||||
} |
|
||||
</style> |
|
||||
<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=2.0&ak=6b6c1a67eaa7db1ca6d6da28e590e343&services=true"></script> |
|
||||
</head> |
|
||||
|
|
||||
<body onload="initMap();"> |
|
||||
<!--百度地图容器--> |
|
||||
<div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div> |
|
||||
</body> |
|
||||
<script type="text/javascript"> |
|
||||
function getParam(name) { |
|
||||
return location.href.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : ''; |
|
||||
} |
|
||||
var map, marker; |
|
||||
var centerParam = getParam('center'); |
|
||||
var zoomParam = getParam('zoom'); |
|
||||
var widthParam = getParam('width'); |
|
||||
var heightParam = getParam('height'); |
|
||||
var markersParam = getParam('markers'); |
|
||||
var markerStylesParam = getParam('markerStyles'); |
|
||||
var iframe = getSelfIframe(); |
|
||||
var UM = parent.UM; |
|
||||
var editor = getEditor(); |
|
||||
|
|
||||
//创建和初始化地图函数: |
|
||||
function initMap() { |
|
||||
// [FF]切换模式后报错 |
|
||||
if (!window.BMap) { |
|
||||
return; |
|
||||
} |
|
||||
var dituContent = document.getElementById('dituContent'); |
|
||||
dituContent.style.width = widthParam + 'px'; |
|
||||
dituContent.style.height = heightParam + 'px'; |
|
||||
|
|
||||
createMap();//创建地图 |
|
||||
setMapEvent();//设置地图事件 |
|
||||
addMapControl();//向地图添加控件 |
|
||||
|
|
||||
// 创建标注 |
|
||||
var markersArr = markersParam.split(','); |
|
||||
var point = new BMap.Point(markersArr[0], markersArr[1]); |
|
||||
marker = new BMap.Marker(point); |
|
||||
marker.enableDragging(); |
|
||||
map.addOverlay(marker); // 将标注添加到地图中 |
|
||||
|
|
||||
if(iframe && UM && editor) { //在编辑状态下 |
|
||||
setMapListener();//地图改变修改外层的iframe标签src属性 |
|
||||
} else { |
|
||||
document.focus(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//创建地图函数: |
|
||||
function createMap() { |
|
||||
map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图 |
|
||||
var centerArr = centerParam.split(','); |
|
||||
var point = new BMap.Point(parseFloat(centerArr[0]), parseFloat(centerArr[1]));//定义一个中心点坐标 |
|
||||
map.centerAndZoom(point, parseInt(zoomParam));//设定地图的中心点和坐标并将地图显示在地图容器中 |
|
||||
} |
|
||||
|
|
||||
//地图事件设置函数: |
|
||||
function setMapEvent() { |
|
||||
map.enableDragging();//启用地图拖拽事件,默认启用(可不写) |
|
||||
map.enableScrollWheelZoom();//启用地图滚轮放大缩小 |
|
||||
map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写) |
|
||||
map.enableKeyboard();//启用键盘上下左右键移动地图 |
|
||||
} |
|
||||
|
|
||||
//地图控件添加函数: |
|
||||
function addMapControl() { |
|
||||
//向地图中添加缩放控件 |
|
||||
var ctrl_nav = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE}); |
|
||||
map.addControl(ctrl_nav); |
|
||||
//向地图中添加缩略图控件 |
|
||||
var ctrl_ove = new BMap.OverviewMapControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1}); |
|
||||
map.addControl(ctrl_ove); |
|
||||
//向地图中添加比例尺控件 |
|
||||
var ctrl_sca = new BMap.ScaleControl({anchor: BMAP_ANCHOR_BOTTOM_LEFT}); |
|
||||
map.addControl(ctrl_sca); |
|
||||
} |
|
||||
|
|
||||
function setMapListener() { |
|
||||
var timer; |
|
||||
|
|
||||
map.addEventListener('moveend', mapListenerHandler); |
|
||||
map.addEventListener('zoomend', mapListenerHandler); |
|
||||
marker.addEventListener('dragend', mapListenerHandler); |
|
||||
|
|
||||
function mapListenerHandler() { |
|
||||
var zoom = map.getZoom(), |
|
||||
center = map.getCenter(), |
|
||||
marker = window.marker.P; |
|
||||
|
|
||||
iframe.src = iframe.src. |
|
||||
replace(new RegExp('([?#&])center=([^?#&]+)', 'i'), '$1center=' + center.lng + ',' + center.lat). |
|
||||
replace(new RegExp('([?#&])markers=([^?#&]+)', 'i'), '$1markers=' + marker.lng + ',' + marker.lat). |
|
||||
replace(new RegExp('([?#&])zoom=([^?#&]+)', 'i'), '$1zoom=' + zoom); |
|
||||
editor.fireEvent('saveScene'); |
|
||||
saveScene(editor); |
|
||||
} |
|
||||
|
|
||||
function saveScene(){ |
|
||||
if(!timer) { |
|
||||
timer = setTimeout(function(){ |
|
||||
editor.fireEvent('savescene'); |
|
||||
editor.fireEvent('contentchange'); |
|
||||
timer = null; |
|
||||
}, 1000); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
function getSelfIframe(){ |
|
||||
var iframes = parent.document.getElementsByTagName('iframe'); |
|
||||
for (var key in iframes) { |
|
||||
if (iframes[key].contentWindow == window) { |
|
||||
return iframes[key]; |
|
||||
} |
|
||||
} |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
function getEditor(){ |
|
||||
var parentNode = iframe.parentNode; |
|
||||
while (parentNode && parentNode.tagName && parentNode.tagName.toLowerCase() != 'body') { |
|
||||
if (parentNode.className && parentNode.className.indexOf('edui-body-container')!=-1) { |
|
||||
return UM.getEditor(parentNode.id); |
|
||||
} |
|
||||
parentNode = parentNode.parentNode; |
|
||||
} |
|
||||
return null; |
|
||||
} |
|
||||
</script> |
|
||||
</html> |
|
||||
@ -1,263 +0,0 @@ |
|||||
(function () { |
|
||||
|
|
||||
var widgetName = 'map'; |
|
||||
|
|
||||
UM.registerWidget(widgetName, { |
|
||||
|
|
||||
tpl: "<style type=\"text/css\">" + |
|
||||
".edui-dialog-map .edui-map-content{width:530px; height: 350px;margin: 10px auto;}" + |
|
||||
".edui-dialog-map .edui-map-content table{width: 100%}" + |
|
||||
".edui-dialog-map .edui-map-content table td{vertical-align: middle;}" + |
|
||||
".edui-dialog-map .edui-map-button { border: 1px solid #ccc; float: left; cursor: default; height: 23px; width: 70px; cursor: pointer; margin: 0; font-size: 12px; line-height: 24px; text-align: center; }" + |
|
||||
".edui-dialog-map .edui-map-button:hover {background:#eee;}" + |
|
||||
".edui-dialog-map .edui-map-city,.edui-dialog-map .edui-map-address{height:21px;background: #FFF;border:1px solid #d7d7d7; line-height: 21px;}" + |
|
||||
".edui-dialog-map .edui-map-city{width:90px}" + |
|
||||
".edui-dialog-map .edui-map-address{width:150px}" + |
|
||||
".edui-dialog-map .edui-map-dynamic-label span{vertical-align:middle;margin: 3px 0px 3px 3px;}" + |
|
||||
".edui-dialog-map .edui-map-dynamic-label input{vertical-align:middle;margin: 3px;}" + |
|
||||
"</style>" + |
|
||||
"<div class=\"edui-map-content\">" + |
|
||||
"<table>" + |
|
||||
"<tr>" + |
|
||||
"<td><%=lang_city%>:</td>" + |
|
||||
"<td><input class=\"edui-map-city\" type=\"text\" value=\"<%=city.value%>\"/></td>" + |
|
||||
"<td><%=lang_address%>:</td>" + |
|
||||
"<td><input class=\"edui-map-address\" type=\"text\" value=\"\" /></td>" + |
|
||||
"<td><a class=\"edui-map-button\"><%=lang_search%></a></td>" + |
|
||||
"<td><label class=\"edui-map-dynamic-label\"><input class=\"edui-map-dynamic\" type=\"checkbox\" name=\"edui-map-dynamic\" /><span><%=lang_dynamicmap%></span></label></td>"+ |
|
||||
"</tr>" + |
|
||||
"</table>" + |
|
||||
"<div style=\"width:100%;height:340px;margin:5px auto;border:1px solid gray\" class=\"edui-map-container\"></div>" + |
|
||||
"</div>" + |
|
||||
"<script class=\"edui-tpl-container\" type=\"text/plain\">" + |
|
||||
"<!DOCTYPE html>" + |
|
||||
"<html>" + |
|
||||
"<head>" + |
|
||||
"<title></title>" + |
|
||||
"</head>" + |
|
||||
"<body>" + |
|
||||
"<scr_ipt>" + |
|
||||
"window.onload = function(){" + |
|
||||
"var scripts = document.scripts || document.getElementsByTagName(\"script\")," + |
|
||||
"src = [];" + |
|
||||
"for( var i = 1, len = scripts.length; i<len; i++ ) {" + |
|
||||
"src.push( scripts[i].src );" + |
|
||||
"}" + |
|
||||
"parent.UM.getEditor(<<id>>).getWidgetData(\'map\').requestMapApi( src );" + |
|
||||
"};" + |
|
||||
"function mapReadyStateChange ( state ) { " + |
|
||||
" if ( state === 'complete' || state === 'loaded' ) {" + |
|
||||
" document.close(); " + |
|
||||
" } }" + |
|
||||
"</scr_ipt>" + |
|
||||
"<scr_ipt onreadystatechange='mapReadyStateChange(this.readyState);' onload='mapReadyStateChange(\"loaded\");' src=\"http://api.map.baidu.com/api?v=2.0&ak=6b6c1a67eaa7db1ca6d6da28e590e343&services=true\"></scr_ipt>" + |
|
||||
"</body>" + |
|
||||
"</html>" + |
|
||||
"</script>", |
|
||||
initContent: function (editor, $widget) { |
|
||||
|
|
||||
var me = this, |
|
||||
lang = editor.getLang(widgetName), |
|
||||
theme_url = editor.options.themePath + editor.options.theme; |
|
||||
|
|
||||
if( me.inited ) { |
|
||||
me.preventDefault(); |
|
||||
return false; |
|
||||
} |
|
||||
|
|
||||
me.inited = true; |
|
||||
|
|
||||
me.lang = lang; |
|
||||
me.editor = editor; |
|
||||
|
|
||||
me.root().html($.parseTmpl(me.tpl, $.extend({}, lang['static'], { |
|
||||
'theme_url': theme_url |
|
||||
}))); |
|
||||
|
|
||||
me.initRequestApi(); |
|
||||
|
|
||||
}, |
|
||||
/** |
|
||||
* 初始化请求API |
|
||||
*/ |
|
||||
initRequestApi: function () { |
|
||||
|
|
||||
var $ifr = null; |
|
||||
|
|
||||
//已经初始化过, 不用再次初始化
|
|
||||
if (window.BMap && window.BMap.Map) { |
|
||||
this.initBaiduMap(); |
|
||||
} else { |
|
||||
|
|
||||
$ifr = $('<iframe style="display: none;"></iframe>'); |
|
||||
$ifr.appendTo( this.root() ); |
|
||||
|
|
||||
$ifr = $ifr[ 0 ].contentWindow.document; |
|
||||
|
|
||||
$ifr.open(); |
|
||||
$ifr.write( this.root().find(".edui-tpl-container").html().replace( /scr_ipt/g, 'script').replace('<<id>>',"'" + this.editor.id + "'") ); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
requestMapApi: function (src) { |
|
||||
|
|
||||
var me = this; |
|
||||
|
|
||||
if (src.length) { |
|
||||
|
|
||||
var _src = src[0]; |
|
||||
|
|
||||
src = src.slice(1); |
|
||||
|
|
||||
if (_src) { |
|
||||
$.getScript(_src, function () { |
|
||||
me.requestMapApi(src); |
|
||||
}); |
|
||||
} else { |
|
||||
me.requestMapApi(src); |
|
||||
} |
|
||||
|
|
||||
} else { |
|
||||
|
|
||||
me.initBaiduMap(); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
}, |
|
||||
initBaiduMap: function () { |
|
||||
|
|
||||
var $root = this.root(), |
|
||||
map = new BMap.Map($root.find(".edui-map-container")[0]), |
|
||||
me = this, |
|
||||
marker, |
|
||||
point, |
|
||||
imgcss, |
|
||||
img = $(me.editor.selection.getRange().getClosedNode()); |
|
||||
|
|
||||
map.enableInertialDragging(); |
|
||||
map.enableScrollWheelZoom(); |
|
||||
map.enableContinuousZoom(); |
|
||||
|
|
||||
if (img.length && /api[.]map[.]baidu[.]com/ig.test(img.attr("src"))) { |
|
||||
var url = img.attr("src"), |
|
||||
centerPos = me.getPars(url, "center").split(","), |
|
||||
markerPos = me.getPars(url, "markers").split(","); |
|
||||
point = new BMap.Point(Number(centerPos[0]), Number(centerPos[1])); |
|
||||
marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1]))); |
|
||||
map.addControl(new BMap.NavigationControl()); |
|
||||
map.centerAndZoom(point, Number(me.getPars(url, "zoom"))); |
|
||||
imgcss = img.attr('style'); |
|
||||
} else { |
|
||||
point = new BMap.Point(116.404, 39.915); // 创建点坐标
|
|
||||
marker = new BMap.Marker(point); |
|
||||
map.addControl(new BMap.NavigationControl()); |
|
||||
map.centerAndZoom(point, 10); // 初始化地图,设置中心点坐标和地图级别。
|
|
||||
} |
|
||||
marker.enableDragging(); |
|
||||
map.addOverlay(marker); |
|
||||
|
|
||||
me.map = map; |
|
||||
me.marker = marker; |
|
||||
me.imgcss = imgcss; |
|
||||
}, |
|
||||
doSearch: function () { |
|
||||
var me = this, |
|
||||
city = me.root().find('.edui-map-city').val(), |
|
||||
address = me.root().find('.edui-map-address').val(); |
|
||||
|
|
||||
if (!city) { |
|
||||
alert(me.lang.cityMsg); |
|
||||
return; |
|
||||
} |
|
||||
var search = new BMap.LocalSearch(city, { |
|
||||
onSearchComplete: function (results) { |
|
||||
if (results && results.getNumPois()) { |
|
||||
var points = []; |
|
||||
for (var i = 0; i < results.getCurrentNumPois(); i++) { |
|
||||
points.push(results.getPoi(i).point); |
|
||||
} |
|
||||
if (points.length > 1) { |
|
||||
me.map.setViewport(points); |
|
||||
} else { |
|
||||
me.map.centerAndZoom(points[0], 13); |
|
||||
} |
|
||||
point = me.map.getCenter(); |
|
||||
me.marker.setPoint(point); |
|
||||
} else { |
|
||||
alert(me.lang.errorMsg); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
search.search(address || city); |
|
||||
}, |
|
||||
getPars: function (str, par) { |
|
||||
var reg = new RegExp(par + "=((\\d+|[.,])*)", "g"); |
|
||||
return reg.exec(str)[1]; |
|
||||
}, |
|
||||
reset: function(){ |
|
||||
this.map && this.map.reset(); |
|
||||
}, |
|
||||
initEvent: function () { |
|
||||
var me = this, |
|
||||
$root = me.root(); |
|
||||
|
|
||||
$root.find('.edui-map-address').on('keydown', function (evt) { |
|
||||
evt = evt || event; |
|
||||
if (evt.keyCode == 13) { |
|
||||
me.doSearch(); |
|
||||
return false; |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
$root.find(".edui-map-button").on('click', function (evt) { |
|
||||
me.doSearch(); |
|
||||
}); |
|
||||
|
|
||||
$root.find(".edui-map-address").focus(); |
|
||||
|
|
||||
$root.on( "mousewheel DOMMouseScroll", function ( e ) { |
|
||||
return false; |
|
||||
} ); |
|
||||
|
|
||||
}, |
|
||||
width: 580, |
|
||||
height: 408, |
|
||||
buttons: { |
|
||||
ok: { |
|
||||
exec: function (editor) { |
|
||||
var widget = editor.getWidgetData(widgetName), |
|
||||
center = widget.map.getCenter(), |
|
||||
zoom = widget.map.getZoom(), |
|
||||
size = widget.map.getSize(), |
|
||||
point = widget.marker.P; |
|
||||
|
|
||||
if (widget.root().find(".edui-map-dynamic")[0].checked) { |
|
||||
var URL = editor.getOpt('UMEDITOR_HOME_URL'), |
|
||||
url = [URL + (/\/$/.test(URL) ? '':'/') + "dialogs/map/map.html" + |
|
||||
'#center=' + center.lng + ',' + center.lat, |
|
||||
'&zoom=' + zoom, |
|
||||
'&width=' + size.width, |
|
||||
'&height=' + size.height, |
|
||||
'&markers=' + point.lng + ',' + point.lat].join(''); |
|
||||
editor.execCommand('inserthtml', '<iframe class="ueditor_baidumap" src="' + url + '" frameborder="0" width="' + (size.width+4) + '" height="' + (size.height+4) + '"></iframe>'); |
|
||||
} else { |
|
||||
url = "http://api.map.baidu.com/staticimage?center=" + center.lng + ',' + center.lat + |
|
||||
"&zoom=" + zoom + "&width=" + size.width + '&height=' + size.height + "&markers=" + point.lng + ',' + point.lat; |
|
||||
editor.execCommand('inserthtml', '<img width="' + size.width + '"height="' + size.height + '" src="' + url + '"' + (widget.imgcss ? ' style="' + widget.imgcss + '"' : '') + '/>', true); |
|
||||
} |
|
||||
|
|
||||
widget.reset(); |
|
||||
} |
|
||||
}, |
|
||||
cancel: { |
|
||||
exec: function(editor){ |
|
||||
editor.getWidgetData(widgetName).reset(); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
})(); |
|
||||
|
|
||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB |
@ -1,59 +0,0 @@ |
|||||
@charset "utf-8"; |
|
||||
.edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} |
|
||||
.edui-dialog-video .edui-video-tabbody{height:335px;} |
|
||||
.edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;} |
|
||||
.edui-dialog-video .edui-video-panel table td{vertical-align: middle;} |
|
||||
.edui-dialog-video #eduiVideoUrl { |
|
||||
width: 470px; |
|
||||
height: 21px; |
|
||||
line-height: 21px; |
|
||||
margin: 8px 5px; |
|
||||
background: #FFF; |
|
||||
border: 1px solid #d7d7d7; |
|
||||
} |
|
||||
.edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} |
|
||||
.edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} |
|
||||
.edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} |
|
||||
.edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ |
|
||||
.edui-dialog-video #searchList p{margin-left: 10px;} |
|
||||
.edui-dialog-video #eduiVideoType{ |
|
||||
width: 65px; |
|
||||
height: 23px; |
|
||||
line-height: 22px; |
|
||||
border: 1px solid #d7d7d7; |
|
||||
} |
|
||||
.edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{ |
|
||||
/*width: 80px;*/ |
|
||||
height: 25px; |
|
||||
line-height: 25px; |
|
||||
background: #eee; |
|
||||
border: 1px solid #d7d7d7; |
|
||||
cursor: pointer; |
|
||||
padding: 0 5px; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
.edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} |
|
||||
.edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} |
|
||||
.edui-dialog-video .edui-video-wrapper fieldset{ |
|
||||
border: 1px solid #ddd; |
|
||||
padding-left: 5px; |
|
||||
margin-bottom: 20px; |
|
||||
padding-bottom: 5px; |
|
||||
width: 115px; |
|
||||
} |
|
||||
.edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;} |
|
||||
.edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;} |
|
||||
.edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{ |
|
||||
width: 65px; |
|
||||
height: 21px; |
|
||||
line-height: 21px; |
|
||||
margin: 8px 5px; |
|
||||
background: #FFF; |
|
||||
border: 1px solid #d7d7d7; |
|
||||
} |
|
||||
.edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;} |
|
||||
.edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} |
|
||||
.edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)} |
|
||||
.edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} |
|
||||
@ -1,282 +0,0 @@ |
|||||
|
|
||||
(function(){ |
|
||||
var domUtils = UM.dom.domUtils; |
|
||||
var widgetName = 'video'; |
|
||||
|
|
||||
UM.registerWidget( widgetName,{ |
|
||||
|
|
||||
tpl: "<link rel=\"stylesheet\" type=\"text/css\" href=\"<%=video_url%>video.css\" />" + |
|
||||
"<div class=\"edui-video-wrapper\">" + |
|
||||
"<div id=\"eduiVideoTab\">" + |
|
||||
"<div id=\"eduiVideoTabHeads\" class=\"edui-video-tabhead\">" + |
|
||||
"<span tabSrc=\"video\" class=\"edui-video-focus\"><%=lang_tab_insertV%></span>" + |
|
||||
"</div>" + |
|
||||
"<div id=\"eduiVideoTabBodys\" class=\"edui-video-tabbody\">" + |
|
||||
"<div id=\"eduiVideoPanel\" class=\"edui-video-panel\">" + |
|
||||
"<table><tr><td><label for=\"eduiVideoUrl\" class=\"edui-video-url\"><%=lang_video_url%></label></td><td><input id=\"eduiVideoUrl\" type=\"text\"></td></tr></table>" + |
|
||||
"<div id=\"eduiVideoPreview\"></div>" + |
|
||||
"<div id=\"eduiVideoInfo\">" + |
|
||||
"<fieldset>" + |
|
||||
"<legend><%=lang_video_size%></legend>" + |
|
||||
"<table>" + |
|
||||
"<tr><td><label for=\"eduiVideoWidth\"><%=lang_videoW%></label></td><td><input class=\"edui-video-txt\" id=\"eduiVideoWidth\" type=\"text\"/></td></tr>" + |
|
||||
"<tr><td><label for=\"eduiVideoHeight\"><%=lang_videoH%></label></td><td><input class=\"edui-video-txt\" id=\"eduiVideoHeight\" type=\"text\"/></td></tr>" + |
|
||||
"</table>" + |
|
||||
"</fieldset>" + |
|
||||
"<fieldset>" + |
|
||||
"<legend><%=lang_alignment%></legend>" + |
|
||||
"<div id=\"eduiVideoFloat\"></div>" + |
|
||||
"</fieldset>" + |
|
||||
"</div>" + |
|
||||
"</div>" + |
|
||||
"</div>" + |
|
||||
"</div>" + |
|
||||
"</div>", |
|
||||
initContent:function( editor, $widget ){ |
|
||||
|
|
||||
var me = this, |
|
||||
lang = editor.getLang( widgetName), |
|
||||
video_url = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/'; |
|
||||
|
|
||||
me.lang = lang; |
|
||||
me.editor = editor; |
|
||||
me.$widget = $widget; |
|
||||
me.root().html( $.parseTmpl( me.tpl, $.extend( { video_url: video_url }, lang['static'] ) ) ); |
|
||||
|
|
||||
me.initController( lang ); |
|
||||
|
|
||||
}, |
|
||||
initEvent:function(){ |
|
||||
|
|
||||
var me = this, |
|
||||
url = $("#eduiVideoUrl", me.$widget)[0]; |
|
||||
|
|
||||
if( 'oninput' in url ) { |
|
||||
url.oninput = function(){ |
|
||||
me.createPreviewVideo( this.value ); |
|
||||
}; |
|
||||
} else { |
|
||||
url.onpropertychange = function () { |
|
||||
me.createPreviewVideo( this.value ); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
initController: function( lang ){ |
|
||||
|
|
||||
var me = this, |
|
||||
img = me.editor.selection.getRange().getClosedNode(), |
|
||||
url; |
|
||||
|
|
||||
me.createAlignButton( ["eduiVideoFloat"] ); |
|
||||
|
|
||||
//编辑视频时初始化相关信息
|
|
||||
if(img && img.className == "edui-faked-video"){ |
|
||||
$("#eduiVideoUrl", me.$widget)[0].value = url = img.getAttribute("_url"); |
|
||||
$("#eduiVideoWidth", me.$widget)[0].value = img.width; |
|
||||
$("#eduiVideoHeight", me.$widget)[0].value = img.height; |
|
||||
var align = domUtils.getComputedStyle(img,"float"), |
|
||||
parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); |
|
||||
me.updateAlignButton(parentAlign==="center"?"center":align); |
|
||||
} |
|
||||
me.createPreviewVideo(url); |
|
||||
|
|
||||
}, |
|
||||
/** |
|
||||
* 根据url生成视频预览 |
|
||||
*/ |
|
||||
createPreviewVideo: function(url){ |
|
||||
|
|
||||
if ( !url )return; |
|
||||
|
|
||||
var me = this, |
|
||||
lang = me.lang, |
|
||||
conUrl = me.convert_url(url); |
|
||||
|
|
||||
if(!me.endWith(conUrl,[".swf",".flv",".wmv"])){ |
|
||||
$("#eduiVideoPreview", me.$widget).html( lang.urlError ); |
|
||||
return; |
|
||||
} |
|
||||
$("#eduiVideoPreview", me.$widget)[0].innerHTML = '<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' + |
|
||||
' src="' + url + '"' + |
|
||||
' width="' + 420 + '"' + |
|
||||
' height="' + 280 + '"' + |
|
||||
' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" ></embed>'; |
|
||||
|
|
||||
}, |
|
||||
/** |
|
||||
* 将单个视频信息插入编辑器中 |
|
||||
*/ |
|
||||
insertSingle: function(){ |
|
||||
|
|
||||
var me = this, |
|
||||
width = $("#eduiVideoWidth", me.$widget)[0], |
|
||||
height = $("#eduiVideoHeight", me.$widget)[0], |
|
||||
url=$('#eduiVideoUrl', me.$widget)[0].value, |
|
||||
align = this.findFocus("eduiVideoFloat","name"); |
|
||||
|
|
||||
if(!url) return false; |
|
||||
if ( !me.checkNum( [width, height] ) ) return false; |
|
||||
this.editor.execCommand('insertvideo', { |
|
||||
url: me.convert_url(url), |
|
||||
width: width.value, |
|
||||
height: height.value, |
|
||||
align: align |
|
||||
}); |
|
||||
|
|
||||
}, |
|
||||
/** |
|
||||
* URL转换 |
|
||||
*/ |
|
||||
convert_url: function(url){ |
|
||||
if ( !url ) return ''; |
|
||||
var matches = url.match(/youtu.be\/(\w+)$/) || |
|
||||
url.match(/youtube\.com\/watch\?v=(\w+)/) || |
|
||||
url.match(/youtube.com\/v\/(\w+)/), |
|
||||
youku = url.match(/youku\.com\/v_show\/id_(\w+)/), |
|
||||
youkuPlay = /player\.youku\.com/ig.test(url); |
|
||||
|
|
||||
if(youkuPlay){ |
|
||||
url = url.replace(/\?f=.*/, ""); |
|
||||
} else if (matches){ |
|
||||
url = "https://www.youtube.com/v/" + matches[1] + "?version=3&feature=player_embedded"; |
|
||||
}else if(youku){ |
|
||||
url = "http://player.youku.com/player.php/sid/"+youku[1]+"/v.swf" |
|
||||
} else { |
|
||||
url = url.replace(/http:\/\/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "http://www.tudou.com/v/$1") |
|
||||
.replace(/http:\/\/www\.youtube\.com\/watch\?v=([\w\-]+)/i, "http://www.youtube.com/v/$1") |
|
||||
.replace(/http:\/\/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, "http://player.youku.com/player.php/sid/$1") |
|
||||
.replace(/http:\/\/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "http://player.56.com/v_$1.swf") |
|
||||
.replace(/http:\/\/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "http://player.56.com/v_$1.swf") |
|
||||
.replace(/http:\/\/v\.ku6\.com\/.+\/([^.]+)\.html/i, "http://player.ku6.com/refer/$1/v.swf") |
|
||||
.replace(/\?f=.*/, ""); |
|
||||
} |
|
||||
return url; |
|
||||
}, |
|
||||
/** |
|
||||
* 检测传入的所有input框中输入的长宽是否是正数 |
|
||||
*/ |
|
||||
checkNum: function checkNum( nodes ) { |
|
||||
|
|
||||
var me = this; |
|
||||
|
|
||||
for ( var i = 0, ci; ci = nodes[i++]; ) { |
|
||||
var value = ci.value; |
|
||||
if ( !me.isNumber( value ) && value) { |
|
||||
alert( me.lang.numError ); |
|
||||
ci.value = ""; |
|
||||
ci.focus(); |
|
||||
return false; |
|
||||
} |
|
||||
} |
|
||||
return true; |
|
||||
}, |
|
||||
/** |
|
||||
* 数字判断 |
|
||||
* @param value |
|
||||
*/ |
|
||||
isNumber: function( value ) { |
|
||||
return /(0|^[1-9]\d*$)/.test( value ); |
|
||||
}, |
|
||||
updateAlignButton: function( align ) { |
|
||||
var aligns = $( "#eduiVideoFloat", this.$widget )[0].children; |
|
||||
|
|
||||
for ( var i = 0, ci; ci = aligns[i++]; ) { |
|
||||
if ( ci.getAttribute( "name" ) == align ) { |
|
||||
if ( ci.className !="edui-video-focus" ) { |
|
||||
ci.className = "edui-video-focus"; |
|
||||
} |
|
||||
} else { |
|
||||
if ( ci.className =="edui-video-focus" ) { |
|
||||
ci.className = ""; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
/** |
|
||||
* 创建图片浮动选择按钮 |
|
||||
* @param ids |
|
||||
*/ |
|
||||
createAlignButton: function( ids ) { |
|
||||
var lang = this.lang, |
|
||||
vidoe_home = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/'; |
|
||||
|
|
||||
for ( var i = 0, ci; ci = ids[i++]; ) { |
|
||||
var floatContainer = $( "#" + ci, this.$widget ) [0], |
|
||||
nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight}; |
|
||||
for ( var j in nameMaps ) { |
|
||||
var div = document.createElement( "div" ); |
|
||||
div.setAttribute( "name", j ); |
|
||||
if ( j == "none" ) div.className="edui-video-focus"; |
|
||||
div.style.cssText = "background:url("+ vidoe_home +"images/" + j + "_focus.jpg);"; |
|
||||
div.setAttribute( "title", nameMaps[j] ); |
|
||||
floatContainer.appendChild( div ); |
|
||||
} |
|
||||
this.switchSelect( ci ); |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 选择切换 |
|
||||
*/ |
|
||||
switchSelect: function( selectParentId ) { |
|
||||
var selects = $( "#" + selectParentId, this.$widget )[0].children; |
|
||||
for ( var i = 0, ci; ci = selects[i++]; ) { |
|
||||
$(ci).on("click", function () { |
|
||||
for ( var j = 0, cj; cj = selects[j++]; ) { |
|
||||
cj.className = ""; |
|
||||
cj.removeAttribute && cj.removeAttribute( "class" ); |
|
||||
} |
|
||||
this.className = "edui-video-focus"; |
|
||||
} ) |
|
||||
} |
|
||||
}, |
|
||||
/** |
|
||||
* 找到id下具有focus类的节点并返回该节点下的某个属性 |
|
||||
* @param id |
|
||||
* @param returnProperty |
|
||||
*/ |
|
||||
findFocus: function( id, returnProperty ) { |
|
||||
var tabs = $( "#" + id , this.$widget)[0].children, |
|
||||
property; |
|
||||
for ( var i = 0, ci; ci = tabs[i++]; ) { |
|
||||
if ( ci.className=="edui-video-focus" ) { |
|
||||
property = ci.getAttribute( returnProperty ); |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
return property; |
|
||||
}, |
|
||||
/** |
|
||||
* 末尾字符检测 |
|
||||
*/ |
|
||||
endWith: function(str,endStrArr){ |
|
||||
for(var i=0,len = endStrArr.length;i<len;i++){ |
|
||||
var tmp = endStrArr[i]; |
|
||||
if(str.length - tmp.length<0) return false; |
|
||||
|
|
||||
if(str.substring(str.length-tmp.length)==tmp){ |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
return false; |
|
||||
}, |
|
||||
width:610, |
|
||||
height:498, |
|
||||
buttons: { |
|
||||
ok: { |
|
||||
exec: function( editor, $w ){ |
|
||||
$("#eduiVideoPreview", $w).html(""); |
|
||||
editor.getWidgetData(widgetName).insertSingle(); |
|
||||
} |
|
||||
}, |
|
||||
cancel: { |
|
||||
exec: function(){ |
|
||||
//清除视频
|
|
||||
$("#eduiVideoPreview").html(""); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
})(); |
|
||||
@ -1,150 +0,0 @@ |
|||||
/** |
|
||||
* English language package |
|
||||
*/ |
|
||||
UM.I18N['en'] = { |
|
||||
'labelMap':{ |
|
||||
'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen', |
|
||||
'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border', |
|
||||
'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote', |
|
||||
'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview', |
|
||||
'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date', |
|
||||
'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown', |
|
||||
'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code', |
|
||||
'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle', |
|
||||
'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable", |
|
||||
'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'image':'Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', |
|
||||
'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', |
|
||||
'video':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter', |
|
||||
'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL', |
|
||||
'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight', |
|
||||
'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default', |
|
||||
'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage', |
|
||||
'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset', |
|
||||
'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable', |
|
||||
'drafts': 'drafts', 'formula':'formula' |
|
||||
}, |
|
||||
'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'}, |
|
||||
'fontfamily':{ |
|
||||
'songti':'Sim sun', |
|
||||
'kaiti':'Sim kai', |
|
||||
'heiti':'Sim hei', |
|
||||
'lishu':'Sim li', |
|
||||
'yahei': 'Microsoft yahei', |
|
||||
'andaleMono':'Andale mono', |
|
||||
'arial': 'Arial', |
|
||||
'arialBlack':'Arial black', |
|
||||
'comicSansMs':'Comic sans ms', |
|
||||
'impact':'Impact', |
|
||||
'timesNewRoman':'Times new roman' |
|
||||
}, |
|
||||
'ok':"OK", |
|
||||
'cancel':"Cancel", |
|
||||
'closeDialog':"closeDialog", |
|
||||
'tableDrag':"You must import the file uiUtils.js before drag! ", |
|
||||
'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", |
|
||||
'anthorMsg':"Link", |
|
||||
'clearColor':'Clear', |
|
||||
'standardColor':'Standard color', |
|
||||
'themeColor':'Theme color', |
|
||||
'property':'Property', |
|
||||
'default':'Default', |
|
||||
'modify':'Modify', |
|
||||
'justifyleft':'Justify Left', |
|
||||
'justifyright':'Justify Right', |
|
||||
'justifycenter':'Justify Center', |
|
||||
'justify':'Default', |
|
||||
'clear':'Clear', |
|
||||
'anchorMsg':'Anchor', |
|
||||
'delete':'Delete', |
|
||||
'clickToUpload':"Click to upload", |
|
||||
'unset':"Language hasn't been set!", |
|
||||
't_row':'row', |
|
||||
't_col':'col', |
|
||||
'more':'More', |
|
||||
'pasteOpt':'Paste Option', |
|
||||
'pasteSourceFormat':"Keep Source Formatting", |
|
||||
'tagFormat':'Keep tag', |
|
||||
'pasteTextFormat':'Keep Text only', |
|
||||
|
|
||||
//===============dialog i18N=======================
|
|
||||
'image':{ |
|
||||
'static':{ |
|
||||
'lang_tab_local':"Local Upload", |
|
||||
'lang_tab_imgSearch':"Network Pictures", |
|
||||
'lang_input_dragTip':"Support drag upload", |
|
||||
'lang_btn_add':"Add" |
|
||||
}, |
|
||||
'uploadError': 'Upload Error' |
|
||||
}, |
|
||||
'emotion':{ |
|
||||
'static':{ |
|
||||
'lang_input_choice':'Choice', |
|
||||
'lang_input_Tuzki':'Tuzki', |
|
||||
'lang_input_lvdouwa':'LvDouWa', |
|
||||
'lang_input_BOBO':'BOBO', |
|
||||
'lang_input_babyCat':'BabyCat', |
|
||||
'lang_input_bubble':'Bubble', |
|
||||
'lang_input_youa':'YouA' |
|
||||
} |
|
||||
}, |
|
||||
'gmap':{ |
|
||||
'static':{ |
|
||||
'lang_input_address':'Address:', |
|
||||
'lang_input_search':'Search', |
|
||||
'address':{'value':"Beijing"} |
|
||||
}, |
|
||||
'searchError':'Unable to locate the address!' |
|
||||
}, |
|
||||
'link':{ |
|
||||
'static':{ |
|
||||
'lang_input_text':'Text:', |
|
||||
'lang_input_url':'URL:', |
|
||||
'lang_input_title':'Title:', |
|
||||
'lang_input_target':'open in new window:' |
|
||||
}, |
|
||||
'validLink':'Supports only effective when a link is selected', |
|
||||
'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!' |
|
||||
}, |
|
||||
'map':{ |
|
||||
'static':{ |
|
||||
'lang_city':"City", |
|
||||
'lang_address':"Address", |
|
||||
'city':{'value':"Beijing"}, |
|
||||
'lang_search':"Search", |
|
||||
'lang_dynamicmap':"Dynamic map" |
|
||||
}, |
|
||||
'cityMsg':"Please enter the city name!", |
|
||||
'errorMsg':"Can't find the place!" |
|
||||
}, |
|
||||
'video':{ |
|
||||
'static':{ |
|
||||
'lang_tab_insertV':"Video", |
|
||||
'lang_video_url':" URL ", |
|
||||
'lang_video_size':"Video Size", |
|
||||
'lang_videoW':"Width", |
|
||||
'lang_videoH':"Height", |
|
||||
'lang_alignment':"Alignment", |
|
||||
'videoSearchTxt':{'value':"Enter the search keyword!"}, |
|
||||
'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]}, |
|
||||
'videoSearchBtn':{'value':"Search in Baidu"}, |
|
||||
'videoSearchReset':{'value':"Clear result"} |
|
||||
}, |
|
||||
'numError':"Please enter the correct Num. e.g 123,400", |
|
||||
'floatLeft':"Float left", |
|
||||
'floatRight':"Float right", |
|
||||
'default':"Default", |
|
||||
'block':"Display in block", |
|
||||
'urlError':"The video url format may be wrong!", |
|
||||
'loading':" The video is loading, please wait…", |
|
||||
'clickToSelect':"Click to select", |
|
||||
'goToSource':'Visit source video ', |
|
||||
'noVideo':" Sorry,can't find the video,please try again!" |
|
||||
}, |
|
||||
'formula':{ |
|
||||
'static':{ |
|
||||
'lang_tab_common':'Common', |
|
||||
'lang_tab_symbol':'Symbol', |
|
||||
'lang_tab_letter':'Letter' |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |