Skip to content

Commit

Permalink
编译至mui v2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcui1984 committed Sep 20, 2015
1 parent 0cd3627 commit be7bd49
Show file tree
Hide file tree
Showing 34 changed files with 359 additions and 214 deletions.
9 changes: 6 additions & 3 deletions dist/css/mui.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.3.0 (https://github.com/dcloudio/mui)
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* =====================================================
*/

Expand Down Expand Up @@ -1954,6 +1954,10 @@ input[type='submit']:enabled:active, input[type='submit'].mui-active:enabled,

background-color: #c8c7cc;
}
.mui-table-view:before
{
top: -1px;
}

.mui-table-view-icon .mui-table-view-cell .mui-navigate-right .mui-icon
{
Expand Down Expand Up @@ -2068,8 +2072,6 @@ input[type='submit']:enabled:active, input[type='submit'].mui-active:enabled,

padding: 11px 15px;

background-color: inherit;

-webkit-touch-callout: none;
}
.mui-table-view-cell:after
Expand Down Expand Up @@ -3914,6 +3916,7 @@ select:focus
height: 100%;

vertical-align: top;
white-space: normal;
}
.mui-slider .mui-slider-group .mui-slider-item > a:not(.mui-control-item)
{
Expand Down
4 changes: 2 additions & 2 deletions dist/css/mui.min.css

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions dist/js/mui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.3.0 (https://github.com/dcloudio/mui)
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* =====================================================
*/
/**
Expand Down Expand Up @@ -748,7 +748,8 @@ var mui = (function(document, undefined) {
}
}
var target = e.target;
if (target.tagName && target.tagName === 'INPUT' && (target.type === 'text' || target.type === 'search' || target.type === 'number')) {
//TODO 需考虑所有键盘弹起的情况
if (target.tagName && (target.tagName === 'TEXTAREA' || (target.tagName === 'INPUT' && (target.type === 'text' || target.type === 'search' || target.type === 'number')))) {
if (target.disabled || target.readOnly) {
return;
}
Expand Down Expand Up @@ -3440,7 +3441,6 @@ var mui = (function(document, undefined) {
}
},
_start: function(e) {
e.target && !this._preventDefaultException(e.target, this.options.preventDefaultException) && e.preventDefault();
this.moved = this.needReset = false;
this._transitionTime();
if (this.isInTransition) {
Expand Down Expand Up @@ -4085,6 +4085,10 @@ var mui = (function(document, undefined) {
}
},
_start: function(e) {
//仅下拉刷新在start阻止默认事件
if (e.touches && e.touches.length && e.touches[0].clientX > 30) {
e.target && !this._preventDefaultException(e.target, this.options.preventDefaultException) && e.preventDefault();
}
if (!this.loading) {
this.pulldown = this.pullPocket = this.pullCaption = this.pullLoading = false
}
Expand Down Expand Up @@ -4638,6 +4642,7 @@ var mui = (function(document, undefined) {
var self = this;
// document.addEventListener('plusscrollbottom', this);
window.addEventListener('dragup', self);
document.addEventListener("plusscrollbottom", self);
self.scrollInterval = window.setInterval(function() {
if (self.isScroll && !self.loading) {
if (window.pageYOffset + window.innerHeight + 10 >= document.documentElement.scrollHeight) {
Expand Down Expand Up @@ -4705,7 +4710,7 @@ var mui = (function(document, undefined) {
// }
// }
self.isScroll = false;
if (e.type === 'dragup') {
if (e.type === 'dragup' || e.type === 'plusscrollbottom') {
self.isScroll = true;
setTimeout(function() {
self.isScroll = false;
Expand Down Expand Up @@ -5583,10 +5588,11 @@ var mui = (function(document, undefined) {

return element;
}());
var removeBackdropTimer;
var removeBackdrop = function(popover) {
backdrop.setAttribute('style', 'opacity:0');
$.targets.popover = $.targets._popover = null; //reset
setTimeout(function() {
removeBackdropTimer = $.later(function() {
if (!popover.classList.contains(CLASS_ACTIVE) && backdrop.parentNode && backdrop.parentNode === document.body) {
document.body.removeChild(backdrop);
}
Expand All @@ -5611,6 +5617,7 @@ var mui = (function(document, undefined) {
});

var togglePopover = function(popover, anchor) {
removeBackdropTimer && removeBackdropTimer.cancel(); //取消remove的timer
//remove一遍,以免来回快速切换,导致webkitTransitionEnd不触发,无法remove
popover.removeEventListener('webkitTransitionEnd', onPopoverShown);
popover.removeEventListener('webkitTransitionEnd', onPopoverHidden);
Expand Down Expand Up @@ -7011,8 +7018,16 @@ var mui = (function(document, undefined) {
});
self.input.addEventListener(changeEventName, function(event) {
self.checkValue();
$.trigger(self, changeEventName, self.getValue());
});
},
/**
* 获取当前值
**/
getValue: function() {
var self = this;
return parseInt(self.input.value);
},
/**
* 验证当前值是法合法
**/
Expand Down
10 changes: 5 additions & 5 deletions dist/js/mui.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions examples/hello-mui/css/mui.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v2.3.0 (https://github.com/dcloudio/mui)
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* =====================================================
*/

Expand Down Expand Up @@ -1954,6 +1954,10 @@ input[type='submit']:enabled:active, input[type='submit'].mui-active:enabled,

background-color: #c8c7cc;
}
.mui-table-view:before
{
top: -1px;
}

.mui-table-view-icon .mui-table-view-cell .mui-navigate-right .mui-icon
{
Expand Down Expand Up @@ -2068,8 +2072,6 @@ input[type='submit']:enabled:active, input[type='submit'].mui-active:enabled,

padding: 11px 15px;

background-color: inherit;

-webkit-touch-callout: none;
}
.mui-table-view-cell:after
Expand Down Expand Up @@ -3914,6 +3916,7 @@ select:focus
height: 100%;

vertical-align: top;
white-space: normal;
}
.mui-slider .mui-slider-group .mui-slider-item > a:not(.mui-control-item)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-mui/css/mui.min.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/hello-mui/examples/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
</style>
</head>
<body>
<!--<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">关于</h1>
<!--<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">关于</h1>
</header>-->
<div class="mui-content">
<div class="mui-content-padded">
Expand All @@ -48,7 +48,7 @@ <h4>新手指南</h4>
</p>
<p>更多详细介绍,请到<a href="http://dcloudio.github.io/mui">mui官网</a>查看;</p>
<h4>版本介绍</h4>
<p>当前版本为2.3.0,可到<a href="https://github.com/dcloudio/mui">Github</a>上获取最新版本。</p>
<p>当前版本为2.4.0,可到<a href="https://github.com/dcloudio/mui">Github</a>上获取最新版本。</p>
<h4>License</h4>
<p>
mui遵循MIT License,源码已提交至Github,<a href="https://github.com/dcloudio/mui">点击查看</a>;
Expand Down
140 changes: 70 additions & 70 deletions examples/hello-mui/examples/lazyload-image.html
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Hello MUI</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<!--标准mui.css-->
<link rel="stylesheet" href="../css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="../css/app.css"/>
<style type="text/css">
p{
text-indent: 22px;
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Hello MUI</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<!--标准mui.css-->
<link rel="stylesheet" href="../css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="../css/app.css" />
<style type="text/css">
p {
text-indent: 22px;
}
.des {
margin: .5em 0;
}
.des>li {
font-size: 14px;
color: #8f8f94;
.des {
margin: .5em 0;
}
</style>
</head>

<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">lazyload(延迟加载) </h1>
</header>
<div class="mui-content">
<div class="mui-content-padded">
<p>延迟加载的理念:页面初始化时,暂不加载处于屏幕可见区域之外的图片。该方案会有如下几大好处:</p>
<ul class="des">
<li>加快页面渲染速度</li>
<li>提升页面滚动性能</li>
<li>默认不下载屏幕外的图片,减少网络流量</li>
</ul>
</div>
<ul id="list" class="mui-table-view mui-table-view-chevron">

</ul>
</div>
</body>
<script src="../js/mui.min.js "></script>
<script src="../js/mui.lazyload.js"></script>
<script src="../js/mui.lazyload.img.js"></script>
<script>
mui.init();
var createFragment = function(count) {
var fragment = document.createDocumentFragment();
var li;
for (var i = 0; i < count; i++) {
li = document.createElement('li');
li.className = 'mui-table-view-cell mui-media';
li.innerHTML = '<a class="mui-navigate-right"><img class="mui-media-object mui-pull-left" data-lazyload="http://www.dcloud.io/hellomui/images/'+(i%5+1)+'.jpg?version='+Math.random()*1000+'"><div class="mui-media-body">主标题<p class="mui-ellipsis">列表二级标题</p></div></a>';
fragment.appendChild(li);
}
return fragment;
};
(function($) {
var list = document.getElementById("list");
list.appendChild(createFragment(50));
$(document).imageLazyload({
placeholder: '../images/60x60.gif'
});
})(mui);
</script>

.des>li {
font-size: 14px;
color: #8f8f94;
}
</style>
</head>

<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">lazyload(延迟加载) </h1>
</header>
<div class="mui-content">
<div class="mui-content-padded">
<p>延迟加载的理念:页面初始化时,暂不加载处于屏幕可见区域之外的图片。该方案会有如下几大好处:</p>
<ul class="des">
<li>加快页面渲染速度</li>
<li>提升页面滚动性能</li>
<li>默认不下载屏幕外的图片,减少网络流量</li>
</ul>
</div>
<ul id="list" class="mui-table-view mui-table-view-chevron">

</ul>
</div>
</body>
<script src="../js/mui.min.js "></script>
<script src="../js/mui.lazyload.js"></script>
<script src="../js/mui.lazyload.img.js"></script>
<script>
mui.init();
var createFragment = function(count) {
var fragment = document.createDocumentFragment();
var li;
for (var i = 0; i < count; i++) {
li = document.createElement('li');
li.className = 'mui-table-view-cell mui-media';
li.innerHTML = '<a class="mui-navigate-right"><img class="mui-media-object mui-pull-left" data-lazyload="http://www.dcloud.io/hellomui/images/' + (i % 5 + 1) + '.jpg?version=' + Math.random() * 1000 + '"><div class="mui-media-body">主标题<p class="mui-ellipsis">列表二级标题</p></div></a>';
fragment.appendChild(li);
}
return fragment;
};
(function($) {
var list = document.getElementById("list");
list.appendChild(createFragment(50));
$(document).imageLazyload({
placeholder: '../images/60x60.gif'
});
})(mui);
</script>

</html>
20 changes: 7 additions & 13 deletions examples/hello-mui/examples/numbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ <h5 class="mui-content-padded">设定步长值(步长 10)</h5>
<h5 class="mui-content-padded">取值操作</h5>
<div class="mui-numbox">
<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
<input id="testBox" class="mui-numbox-input" type="number" />
<input id="box" class="mui-numbox-input" type="number" />
<button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
</div>
<button id="getValue" class="mui-btn" style="padding: 7px 12px;">取当前值</button>
<button id="btn" class="mui-btn" style="padding: 7px 12px;">取当前值</button>
<h5 class="mui-content-padded">在行内</h5> 购买数量:
<div class="mui-numbox">
<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
Expand Down Expand Up @@ -99,17 +99,11 @@ <h5 class="mui-content-padded">通过样式定义大小(220x60)</h5>
</div>
</div>
<script src="../js/mui.min.js"></script>
<script>
(function($, doc) {
$.init();
$.plusReady(function() {
var btnGetValue = doc.querySelector('#getValue');
var boxTest = doc.querySelector('#testBox');
btnGetValue.addEventListener('click', function(event) {
plus.nativeUI.alert('当前值: ' + boxTest.value, null, "提示");
});
});
}(mui, document));
<script>
mui.init();
document.getElementById("btn").addEventListener('tap', function(event) {
mui.alert('当前值: ' + document.getElementById("box").value, null, "提示");
});
</script>
</body>

Expand Down
12 changes: 6 additions & 6 deletions examples/hello-mui/examples/picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<link rel="stylesheet" href="../css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="../css/app.css" />
<!--<link href="../css/mui.picker.css" rel="stylesheet" />
<link href="../css/mui.poppicker.css" rel="stylesheet" />-->
<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
<link href="../css/mui.picker.css" rel="stylesheet" />
<link href="../css/mui.poppicker.css" rel="stylesheet" />
<!--<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />-->
<style>
.mui-btn {
font-size: 16px;
Expand Down Expand Up @@ -61,9 +61,9 @@ <h5 class="mui-content-padded">级联示例</h5>
</div>
</div>
<script src="../js/mui.min.js"></script>
<script src="../js/mui.picker.min.js"></script>
<!--<script src="../js/mui.picker.js"></script>
<script src="../js/mui.poppicker.js"></script>-->
<!--<script src="../js/mui.picker.min.js"></script>-->
<script src="../js/mui.picker.js"></script>
<script src="../js/mui.poppicker.js"></script>
<script src="../js/city.data.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
<script>
Expand Down
Loading

0 comments on commit be7bd49

Please sign in to comment.