Skip to content

Commit

Permalink
编译至v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcui1984 committed Apr 12, 2015
1 parent 48f4a40 commit df377fd
Show file tree
Hide file tree
Showing 19 changed files with 1,825 additions and 578 deletions.
53 changes: 27 additions & 26 deletions dist/css/mui.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v1.4.0 (https://github.com/dcloudio/mui)
* Mui v1.5.0 (https://github.com/dcloudio/mui)
* =====================================================
*/

Expand Down Expand Up @@ -629,6 +629,9 @@ p {
width: auto;
overflow: auto;
}
.mui-plus-pullrefresh .mui-slider-group {
overflow: visible;
}
.mui-plus-pullrefresh .mui-scroll {
position: static;
width: auto;
Expand Down Expand Up @@ -886,15 +889,15 @@ button,
-webkit-transition-duration: .2s;
transition-duration: .2s;
}
input[type="button"]:active, input[type="button"].mui-active,
input[type="submit"]:active,
input[type="submit"].mui-active,
input[type="reset"]:active,
input[type="reset"].mui-active,
button:active,
button.mui-active,
.mui-btn:active,
.mui-btn.mui-active {
input[type="button"]:enabled:active, input[type="button"].mui-active:enabled,
input[type="submit"]:enabled:active,
input[type="submit"].mui-active:enabled,
input[type="reset"]:enabled:active,
input[type="reset"].mui-active:enabled,
button:enabled:active,
button.mui-active:enabled,
.mui-btn:enabled:active,
.mui-btn.mui-active:enabled {
color: #fff;
background-color: #929292;
}
Expand All @@ -916,9 +919,9 @@ input[type="submit"],
background-color: #007aff;
border: 1px solid #007aff;
}
input[type="submit"]:active, input[type="submit"].mui-active,
.mui-btn-primary:active,
.mui-btn-primary.mui-active, .mui-btn-blue:active, .mui-btn-blue.mui-active {
input[type="submit"]:enabled:active, input[type="submit"].mui-active:enabled,
.mui-btn-primary:enabled:active,
.mui-btn-primary.mui-active:enabled, .mui-btn-blue:enabled:active, .mui-btn-blue.mui-active:enabled {
color: #fff;
background-color: #0062cc;
border: 1px solid #0062cc;
Expand All @@ -929,7 +932,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
background-color: #4cd964;
border: 1px solid #4cd964;
}
.mui-btn-positive:active, .mui-btn-positive.mui-active, .mui-btn-success:active, .mui-btn-success.mui-active, .mui-btn-green:active, .mui-btn-green.mui-active {
.mui-btn-positive:enabled:active, .mui-btn-positive.mui-active:enabled, .mui-btn-success:enabled:active, .mui-btn-success.mui-active:enabled, .mui-btn-green:enabled:active, .mui-btn-green.mui-active:enabled {
color: #fff;
background-color: #2ac845;
border: 1px solid #2ac845;
Expand All @@ -940,7 +943,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
background-color: #f0ad4e;
border: 1px solid #f0ad4e;
}
.mui-btn-warning:active, .mui-btn-warning.mui-active, .mui-btn-yellow:active, .mui-btn-yellow.mui-active {
.mui-btn-warning:enabled:active, .mui-btn-warning.mui-active:enabled, .mui-btn-yellow:enabled:active, .mui-btn-yellow.mui-active:enabled {
color: #fff;
background-color: #ec971f;
border: 1px solid #ec971f;
Expand All @@ -951,7 +954,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
background-color: #dd524d;
border: 1px solid #dd524d;
}
.mui-btn-negative:active, .mui-btn-negative.mui-active, .mui-btn-danger:active, .mui-btn-danger.mui-active, .mui-btn-red:active, .mui-btn-red.mui-active {
.mui-btn-negative:enabled:active, .mui-btn-negative.mui-active:enabled, .mui-btn-danger:enabled:active, .mui-btn-danger.mui-active:enabled, .mui-btn-red:enabled:active, .mui-btn-red.mui-active:enabled {
color: #fff;
background-color: #cf2d28;
border: 1px solid #cf2d28;
Expand All @@ -962,7 +965,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
background-color: #8a6de9;
border: 1px solid #8a6de9;
}
.mui-btn-royal:active, .mui-btn-royal.mui-active, .mui-btn-purple:active, .mui-btn-purple.mui-active {
.mui-btn-royal:enabled:active, .mui-btn-royal.mui-active:enabled, .mui-btn-purple:enabled:active, .mui-btn-purple.mui-active:enabled {
color: #fff;
background-color: #6641e2;
border: 1px solid #6641e2;
Expand All @@ -973,7 +976,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
background-color: #c7c7cc;
border: 1px solid #c7c7cc;
}
.mui-btn-grey:active, .mui-btn-grey.mui-active {
.mui-btn-grey:enabled:active, .mui-btn-grey.mui-active:enabled {
color: #fff;
background-color: #acacb4;
border: 1px solid #acacb4;
Expand All @@ -997,7 +1000,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
.mui-btn-outlined.mui-btn-royal, .mui-btn-outlined.mui-btn-purple {
color: #8a6de9;
}
.mui-btn-outlined.mui-btn-primary:active, .mui-btn-outlined.mui-btn-blue:active, .mui-btn-outlined.mui-btn-positive:active, .mui-btn-outlined.mui-btn-success:active, .mui-btn-outlined.mui-btn-green:active, .mui-btn-outlined.mui-btn-warning:active, .mui-btn-outlined.mui-btn-yellow:active, .mui-btn-outlined.mui-btn-negative:active, .mui-btn-outlined.mui-btn-danger:active, .mui-btn-outlined.mui-btn-red:active, .mui-btn-outlined.mui-btn-royal:active, .mui-btn-outlined.mui-btn-purple:active {
.mui-btn-outlined.mui-btn-primary:enabled:active, .mui-btn-outlined.mui-btn-blue:enabled:active, .mui-btn-outlined.mui-btn-positive:enabled:active, .mui-btn-outlined.mui-btn-success:enabled:active, .mui-btn-outlined.mui-btn-green:enabled:active, .mui-btn-outlined.mui-btn-warning:enabled:active, .mui-btn-outlined.mui-btn-yellow:enabled:active, .mui-btn-outlined.mui-btn-negative:enabled:active, .mui-btn-outlined.mui-btn-danger:enabled:active, .mui-btn-outlined.mui-btn-red:enabled:active, .mui-btn-outlined.mui-btn-royal:enabled:active, .mui-btn-outlined.mui-btn-purple:enabled:active {
color: #fff;
}

Expand All @@ -1008,7 +1011,7 @@ input[type="submit"]:active, input[type="submit"].mui-active,
background-color: transparent;
border: 0;
}
.mui-btn-link:active, .mui-btn-link.mui-active {
.mui-btn-link:enabled:active, .mui-btn-link.mui-active:enabled {
color: #0062cc;
background-color: transparent;
}
Expand All @@ -1028,13 +1031,13 @@ input[type="submit"]:active, input[type="submit"].mui-active,
}

.mui-btn .mui-badge-inverted,
.mui-btn:active .mui-badge-inverted {
.mui-btn:enabled:active .mui-badge-inverted {
background-color: transparent;
}

.mui-btn-primary:active .mui-badge-inverted,
.mui-btn-positive:active .mui-badge-inverted,
.mui-btn-negative:active .mui-badge-inverted {
.mui-btn-primary:enabled:active .mui-badge-inverted,
.mui-btn-positive:enabled:active .mui-badge-inverted,
.mui-btn-negative:enabled:active .mui-badge-inverted {
color: #fff;
}

Expand Down Expand Up @@ -1512,8 +1515,6 @@ input[type="submit"]:active, input[type="submit"].mui-active,
overflow: hidden;
background-color: inherit;

-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-touch-callout: none;
}
.mui-table-view-cell:after {
Expand Down
4 changes: 2 additions & 2 deletions dist/css/mui.min.css

Large diffs are not rendered by default.

24 changes: 18 additions & 6 deletions dist/js/mui.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* =====================================================
* Mui v1.4.0 (https://github.com/dcloudio/mui)
* Mui v1.5.0 (https://github.com/dcloudio/mui)
* =====================================================
*/
/**
Expand Down Expand Up @@ -656,6 +656,9 @@ var mui = (function(document, undefined) {
}
var target = e.target;
if (target.tagName && target.tagName === 'INPUT' && target.type === 'text') {
if (target.disabled || target.readOnly) {
return;
}
document.body.classList.add(CLASS_FOCUSIN);
var isFooter = false;
for (; target && target !== document; target = target.parentNode) {
Expand Down Expand Up @@ -1370,7 +1373,7 @@ var mui = (function(document, undefined) {
*/
$.fire = function(webview, eventType, data) {
if (webview) {
webview.evalJS("typeof mui!=='undefined'&&mui.receive('" + eventType + "','" + JSON.stringify(data || {}) + "')");
webview.evalJS("typeof mui!=='undefined'&&mui.receive('" + eventType + "','" + JSON.stringify(data || {}).replace(/\'/g, "\\u0027").replace(/\\/g, "\\u005c") + "')");
}
};
/**
Expand Down Expand Up @@ -4701,7 +4704,7 @@ var mui = (function(document, undefined) {
$.trigger(this, 'shown', this);
}
var onPopoverHidden = function(e) {
this.setAttribute('style', '');
setStyle(this,'none');
this.removeEventListener('webkitTransitionEnd', onPopoverHidden);
this.removeEventListener('touchmove', $.preventDefault);
fixedPopoverScroll(false);
Expand Down Expand Up @@ -4788,7 +4791,7 @@ var mui = (function(document, undefined) {
// }
}
}
popover.setAttribute('style', 'display:block'); //actionsheet transform
setStyle(popover, 'block'); //actionsheet transform
popover.offsetHeight;
popover.classList.add(CLASS_ACTIVE);
backdrop.setAttribute('style', '');
Expand All @@ -4798,6 +4801,15 @@ var mui = (function(document, undefined) {
backdrop.classList.add(CLASS_ACTIVE);
popover.addEventListener('webkitTransitionEnd', onPopoverShown);
};
var setStyle = function(popover, display, top, left) {
var style = popover.style;
if (typeof display !== 'undefined')
style.display = display;
if (typeof top !== 'undefined')
style.top = top + 'px';
if (typeof left !== 'undefined')
style.left = left + 'px';
};
var calPosition = function(popover, anchor, isActionSheet) {
if (!popover || !anchor) {
return;
Expand All @@ -4808,7 +4820,7 @@ var mui = (function(document, undefined) {
var pWidth = popover.offsetWidth;
var pHeight = popover.offsetHeight;
if (isActionSheet) { //actionsheet
popover.setAttribute('style', 'display:block;top:' + (wHeight - pHeight + window.pageYOffset) + 'px;left:' + (wWidth - pWidth) / 2 + 'px;');
setStyle(popover, 'block', (wHeight - pHeight + window.pageYOffset), (wWidth - pWidth) / 2)
return;
}
var aWidth = anchor.offsetWidth;
Expand Down Expand Up @@ -4862,7 +4874,7 @@ var mui = (function(document, undefined) {
} else if (position === 'middle') {
arrow.setAttribute('style', 'display:none');
}
popover.setAttribute('style', 'display:block;top:' + pTop + 'px;left:' + pLeft + 'px;');
setStyle(popover, 'block', pTop, pLeft);
};

$.createMask = function(callback) {
Expand Down
8 changes: 4 additions & 4 deletions dist/js/mui.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/hello-mui/css/mui.min.css

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions examples/hello-mui/css/mui.numbox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.mui-numbox {
border: solid 1px #bbb;
overflow: hidden !important;
display: inline-block;
height: 35px;
border-radius: 3px;
background-color: #efeff4 !important;
vertical-align: top;
box-sizing: border-box;
position: relative;
padding: 0px 40px 0px 40px;
width: 120px;
vertical-align: middle;
}
.mui-numbox [class*=mui-numbox-btn] {
width: 40px;
height: 100%;
margin: 0px;
position: absolute;
top: 0px;
border: none;
border-radius: 0px !important;
font-size: 18px;
color: #555;
line-height: 100%;
font-weight: normal;
overflow: hidden;
padding: 0px;
background-color: #f9f9f9;
}
.mui-numbox [class*=mui-numbox-btn]:active {
background-color: #ccc;
}
.mui-numbox [class*=mui-numbox-btn][disabled] {
color: #c0c0c0;
}
.mui-numbox .mui-numbox-btn-plus {
right: 0px;
}
.mui-numbox .mui-numbox-btn-minus {
left: 0px;
}
.mui-numbox .mui-numbox-input {
width: 100% !important;
height: 100% !important;
text-align: center;
border: none;
border-left: solid 1px #ccc !important;
border-right: solid 1px #ccc !important;
appearance: none;
margin: 0px;
padding: 0px 3px !important;
display: inline-block;
border-radius: 0px !important;
}
.mui-input-row .mui-numbox {
margin: 2px 8px;
float: right;
}
2 changes: 1 addition & 1 deletion examples/hello-mui/examples/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h4>新手指南</h4>
</p>
<p>更多详细介绍,请到<a href="http://dcloudio.github.io/mui">mui官网</a>查看;</p>
<h4>版本介绍</h4>
<p>当前版本为1.4.0,可到<a href="https://github.com/dcloudio/mui">Github</a>上获取最新版本。</p>
<p>当前版本为1.5.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
86 changes: 86 additions & 0 deletions examples/hello-mui/examples/locker-dom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>手势锁屏示例</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">
<link rel="stylesheet" href="../css/mui.min.css" />
<style>
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow: hidden;
background-color: #efeff4;
}
#holder {
width: 300px;
height: 300px;
border: solid 1px #bbb;
border-radius: 5px;
margin: 50px auto;
background-color: #fff;
}
#alert {
width: 300px;
height: 45px;
line-height: 45px;
text-align: center;
color: red;
margin: auto auto;
border: dashed 1px #bbb;
border-radius: 5px;
background-color: #fff;
}
</style>
</head>

<body>
<div id='holder' class="mui-locker" data-locker-options='{"ringColor":"rgba(221,221,221,1)","fillColor":"#ffffff","pointColor":"rgba(0,136,204,1)","lineColor":"rgba(0,136,204,1)"}'></div>
<div id='alert'></div>
<script src="../js/mui.min.js"></script>
<script src="../js/mui.locker.js"></script>
<script>
(function($,doc){
$.init();

var holder = doc.querySelector('#holder'),
alert = doc.querySelector('#alert'),
record = [];
//处理事件
holder.addEventListener('done', function(event) {
var rs = event.detail;
if (rs.points.length < 4) {
alert.innerText = '设定的手势太简单了';
record = [];
rs.sender.clear();
return;
}
record.push(rs.points.join(''));
if (record.length >= 2) {
if (record[0] == record[1]) {
alert.innerText = '手势设定完成';
} else {
alert.innerText = '两次手势设定不一致';
}
rs.sender.clear();
record = [];
} else {
alert.innerText = '请确认手势设定';
rs.sender.clear();
}
});
}(mui,document));

</script>
</body>

</html>
Loading

0 comments on commit df377fd

Please sign in to comment.