Commit 9cc25abf authored by hbcui1984's avatar hbcui1984

编译至mui v2.5.0

parent 9813ac62
......@@ -49,6 +49,7 @@ module.exports = function(grunt) {
'js/mui.detect.5+.js',
'js/mui.target.js',
'js/mui.fixed.js',
'js/mui.fixed.bind.js',
'js/mui.fixed.classlist.js',
'js/mui.fixed.animation.js',
'js/mui.fixed.fastclick.js',
......@@ -150,7 +151,7 @@ module.exports = function(grunt) {
uglify: {
options: {
banner: '<%= banner %>',
compress: true,
compress: {},
mangle: true,
preserveComments: false
},
......
/*!
* =====================================================
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/
......
This diff is collapsed.
/*!
* =====================================================
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/
/**
......@@ -190,25 +190,6 @@ var mui = (function(document, undefined) {
}
return this;
};
/**
* map
*/
$.map = function(elements, callback) {
var value, values = [],
i, key;
if (typeof elements.length === 'number') { //TODO 此处逻辑不严谨,可能会有Object:{a:'b',length:1}的情况未处理
for (i = 0, len = elements.length; i < len; i++) {
value = callback(elements[i], i);
if (value != null) values.push(value);
}
} else {
for (key in elements) {
value = callback(elements[key], key);
if (value != null) values.push(value);
}
}
return values.length > 0 ? [].concat.apply([], values) : values;
};
/**
* each
* @param {type} elements
......@@ -587,6 +568,32 @@ var mui = (function(document, undefined) {
window.CustomEvent = CustomEvent;
}
})();
/*
A shim for non ES5 supporting browsers.
Adds function bind to Function prototype, so that you can do partial application.
Works even with the nasty thing, where the first word is the opposite of extranet, the second one is the profession of Columbus, and the version number is 9, flipped 180 degrees.
*/
Function.prototype.bind = Function.prototype.bind || function(to) {
// Make an array of our arguments, starting from second argument
var partial = Array.prototype.splice.call(arguments, 1),
// We'll need the original function.
fn = this;
var bound = function() {
// Join the already applied arguments to the now called ones (after converting to an array again).
var args = partial.concat(Array.prototype.splice.call(arguments, 0));
// If not being called as a constructor
if (!(this instanceof bound)) {
// return the result of the function called bound to target and partially applied.
return fn.apply(to, args);
}
// If being called as a constructor, apply the function bound to self.
fn.apply(this, args);
}
// Attach the prototype of the function to our newly created function.
bound.prototype = fn.prototype;
return bound;
};
/**
* mui fixed classList
* @param {type} document
......@@ -4253,6 +4260,7 @@ var mui = (function(document, undefined) {
indicators: false,
bounceTime: 200,
startX: false,
slideTime: 0, //滑动动画时间
snap: SELECTOR_SLIDER_ITEM
}, options));
if (this.options.startX) {
......@@ -4313,7 +4321,14 @@ var mui = (function(document, undefined) {
}
var detail = e.detail;
detail.slideNumber = detail.slideNumber || 0;
var items = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM);
var temps = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM);
var items = [];
for (var i = 0, len = temps.length; i < len; i++) {
var item = temps[i];
if (item.parentNode === self.scroller) {
items.push(item);
}
}
var _slideNumber = detail.slideNumber;
if (self.loop) {
_slideNumber += 1;
......@@ -4356,7 +4371,7 @@ var mui = (function(document, undefined) {
},
_handleTabShow: function(e) {
var self = this;
self.gotoItem((e.detail.tabNumber || 0), self.options.bounceTime);
self.gotoItem((e.detail.tabNumber || 0), self.options.slideTime);
},
_handleIndicatorTap: function(event) {
var self = this;
......@@ -7012,10 +7027,9 @@ var mui = (function(document, undefined) {
self.input.value = val.toString();
$.trigger(self.input, changeEventName, null);
});
// self.input.addEventListener(changeEventName, function(event) {
// self.checkValue();
// $.trigger(self, changeEventName, self.getValue());
// });
self.input.addEventListener(changeEventName, function(event) {
self.checkValue();
});
},
/**
* 获取当前值
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* =====================================================
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/
......
This diff is collapsed.
/*!
* =====================================================
* Mui v2.4.0 (https://github.com/dcloudio/mui)
* Mui v2.5.0 (http://dev.dcloud.net.cn/mui)
* =====================================================
*/
/**
......@@ -190,25 +190,6 @@ var mui = (function(document, undefined) {
}
return this;
};
/**
* map
*/
$.map = function(elements, callback) {
var value, values = [],
i, key;
if (typeof elements.length === 'number') { //TODO 此处逻辑不严谨,可能会有Object:{a:'b',length:1}的情况未处理
for (i = 0, len = elements.length; i < len; i++) {
value = callback(elements[i], i);
if (value != null) values.push(value);
}
} else {
for (key in elements) {
value = callback(elements[key], key);
if (value != null) values.push(value);
}
}
return values.length > 0 ? [].concat.apply([], values) : values;
};
/**
* each
* @param {type} elements
......@@ -587,6 +568,32 @@ var mui = (function(document, undefined) {
window.CustomEvent = CustomEvent;
}
})();
/*
A shim for non ES5 supporting browsers.
Adds function bind to Function prototype, so that you can do partial application.
Works even with the nasty thing, where the first word is the opposite of extranet, the second one is the profession of Columbus, and the version number is 9, flipped 180 degrees.
*/
Function.prototype.bind = Function.prototype.bind || function(to) {
// Make an array of our arguments, starting from second argument
var partial = Array.prototype.splice.call(arguments, 1),
// We'll need the original function.
fn = this;
var bound = function() {
// Join the already applied arguments to the now called ones (after converting to an array again).
var args = partial.concat(Array.prototype.splice.call(arguments, 0));
// If not being called as a constructor
if (!(this instanceof bound)) {
// return the result of the function called bound to target and partially applied.
return fn.apply(to, args);
}
// If being called as a constructor, apply the function bound to self.
fn.apply(this, args);
}
// Attach the prototype of the function to our newly created function.
bound.prototype = fn.prototype;
return bound;
};
/**
* mui fixed classList
* @param {type} document
......@@ -4253,6 +4260,7 @@ var mui = (function(document, undefined) {
indicators: false,
bounceTime: 200,
startX: false,
slideTime: 0, //滑动动画时间
snap: SELECTOR_SLIDER_ITEM
}, options));
if (this.options.startX) {
......@@ -4313,7 +4321,14 @@ var mui = (function(document, undefined) {
}
var detail = e.detail;
detail.slideNumber = detail.slideNumber || 0;
var items = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM);
var temps = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM);
var items = [];
for (var i = 0, len = temps.length; i < len; i++) {
var item = temps[i];
if (item.parentNode === self.scroller) {
items.push(item);
}
}
var _slideNumber = detail.slideNumber;
if (self.loop) {
_slideNumber += 1;
......@@ -4356,7 +4371,7 @@ var mui = (function(document, undefined) {
},
_handleTabShow: function(e) {
var self = this;
self.gotoItem((e.detail.tabNumber || 0), self.options.bounceTime);
self.gotoItem((e.detail.tabNumber || 0), self.options.slideTime);
},
_handleIndicatorTap: function(event) {
var self = this;
......@@ -7012,10 +7027,9 @@ var mui = (function(document, undefined) {
self.input.value = val.toString();
$.trigger(self.input, changeEventName, null);
});
// self.input.addEventListener(changeEventName, function(event) {
// self.checkValue();
// $.trigger(self, changeEventName, self.getValue());
// });
self.input.addEventListener(changeEventName, function(event) {
self.checkValue();
});
},
/**
* 获取当前值
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -28,6 +28,7 @@
indicators: false,
bounceTime: 200,
startX: false,
slideTime: 0, //滑动动画时间
snap: SELECTOR_SLIDER_ITEM
}, options));
if (this.options.startX) {
......@@ -88,7 +89,14 @@
}
var detail = e.detail;
detail.slideNumber = detail.slideNumber || 0;
var items = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM);
var temps = self.scroller.querySelectorAll(SELECTOR_SLIDER_ITEM);
var items = [];
for (var i = 0, len = temps.length; i < len; i++) {
var item = temps[i];
if (item.parentNode === self.scroller) {
items.push(item);
}
}
var _slideNumber = detail.slideNumber;
if (self.loop) {
_slideNumber += 1;
......@@ -131,7 +139,7 @@
},
_handleTabShow: function(e) {
var self = this;
self.gotoItem((e.detail.tabNumber || 0), self.options.bounceTime);
self.gotoItem((e.detail.tabNumber || 0), self.options.slideTime);
},
_handleIndicatorTap: function(event) {
var self = this;
......
/*
A shim for non ES5 supporting browsers.
Adds function bind to Function prototype, so that you can do partial application.
Works even with the nasty thing, where the first word is the opposite of extranet, the second one is the profession of Columbus, and the version number is 9, flipped 180 degrees.
*/
Function.prototype.bind = Function.prototype.bind || function(to) {
// Make an array of our arguments, starting from second argument
var partial = Array.prototype.splice.call(arguments, 1),
// We'll need the original function.
fn = this;
var bound = function() {
// Join the already applied arguments to the now called ones (after converting to an array again).
var args = partial.concat(Array.prototype.splice.call(arguments, 0));
// If not being called as a constructor
if (!(this instanceof bound)) {
// return the result of the function called bound to target and partially applied.
return fn.apply(to, args);
}
// If being called as a constructor, apply the function bound to self.
fn.apply(this, args);
}
// Attach the prototype of the function to our newly created function.
bound.prototype = fn.prototype;
return bound;
};
\ No newline at end of file
......@@ -185,25 +185,6 @@ var mui = (function(document, undefined) {
}
return this;
};
/**
* map
*/
$.map = function(elements, callback) {
var value, values = [],
i, key;
if (typeof elements.length === 'number') { //TODO 此处逻辑不严谨,可能会有Object:{a:'b',length:1}的情况未处理
for (i = 0, len = elements.length; i < len; i++) {
value = callback(elements[i], i);
if (value != null) values.push(value);
}
} else {
for (key in elements) {
value = callback(elements[key], key);
if (value != null) values.push(value);
}
}
return values.length > 0 ? [].concat.apply([], values) : values;
};
/**
* each
* @param {type} elements
......
......@@ -49,10 +49,9 @@
self.input.value = val.toString();
$.trigger(self.input, changeEventName, null);
});
// self.input.addEventListener(changeEventName, function(event) {
// self.checkValue();
// $.trigger(self, changeEventName, self.getValue());
// });
self.input.addEventListener(changeEventName, function(event) {
self.checkValue();
});
},
/**
* 获取当前值
......
{
"name": "mui",
"description": "Build mobile apps with simple HTML, CSS, and JS components.",
"version": "2.4.0",
"version": "2.5.0",
"keywords": [
"css",
"fonts",
......@@ -10,7 +10,7 @@
"mobile",
"prototype"
],
"homepage": "https://github.com/dcloudio/mui",
"homepage": "http://dev.dcloud.net.cn/mui",
"author": "DCloud",
"style": "dist/css/mui.css",
"sass": "sass/mui.scss",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment