-/* Zepto v1.1.4-13-geba5344 - zepto event data ie - zeptojs.com/license */
+/* Zepto v1.1.4-80-ga9184b2 - zepto event data ie - zeptojs.com/license */
var Zepto = (function() {
var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,
maybeClass = !maybeID && selector[0] == '.',
nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked
isSimple = simpleSelectorRE.test(nameOnly)
- return (isDocument(element) && isSimple && maybeID) ?
+ return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById
( (found = element.getElementById(nameOnly)) ? [found] : [] ) :
- (element.nodeType !== 1 && element.nodeType !== 9) ? [] :
+ (element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :
slice.call(
- isSimple && !maybeID ?
+ isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName
maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class
element.getElementsByTagName(selector) : // Or a tag
element.querySelectorAll(selector) // Or it's not simple, and we need to query all
// JSON => parse if valid
// String => self
function deserializeValue(value) {
- var num
try {
return value ?
value == "true" ||
( value == "false" ? false :
value == "null" ? null :
- !/^0/.test(value) && !isNaN(num = Number(value)) ? num :
+ +value + "" == value ? +value :
/^[\[\{]/.test(value) ? $.parseJSON(value) :
value )
: value
$.uuid = 0
$.support = { }
$.expr = { }
+ $.noop = function() {}
$.map = function(elements, callback){
var value, values = [], i, key
},
find: function(selector){
var result, $this = this
- if (!selector) result = []
+ if (!selector) result = $()
else if (typeof selector == 'object')
result = $(selector).filter(function(){
var node = this
return filtered(this.map(function(){ return children(this) }), selector)
},
contents: function() {
- return this.map(function() { return slice.call(this.childNodes) })
+ return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })
},
siblings: function(selector){
return filtered(this.map(function(i, el){
$this.css(props)
})
if (!this.length) return null
+ if (!$.contains(document.documentElement, this[0]))
+ return {top: 0, left: 0}
var obj = this[0].getBoundingClientRect()
return {
left: obj.left + window.pageXOffset,
},
css: function(property, value){
if (arguments.length < 2) {
- var element = this[0], computedStyle = getComputedStyle(element, '')
+ var computedStyle, element = this[0]
if(!element) return
+ computedStyle = getComputedStyle(element, '')
if (typeof property == 'string')
return element.style[camelize(property)] || computedStyle.getPropertyValue(property)
else if (isArray(property)) {
if (!isString(selector) && !isFunction(callback) && callback !== false)
callback = data, data = selector, selector = undefined
- if (isFunction(data) || data === false)
+ if (callback === undefined || data === false)
callback = data, data = undefined
if (callback === false) callback = returnFalse
event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)
event._args = args
return this.each(function(){
+ // handle focus(), blur() by calling them directly
+ if (event.type in focus && typeof this[event.type] == "function") this[event.type]()
// items in the collection might not be DOM elements
- if('dispatchEvent' in this) this.dispatchEvent(event)
+ else if ('dispatchEvent' in this) this.dispatchEvent(event)
else $(this).triggerHandler(event, args)
})
}
}
// shortcut methods for `.bind(event, fn)` for each event type
- ;('focusin focusout load resize scroll unload click dblclick '+
+ ;('focusin focusout focus blur load resize scroll unload click dblclick '+
'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+
'change select keydown keypress keyup error').split(' ').forEach(function(event) {
$.fn[event] = function(callback) {
- return callback ?
+ return (0 in arguments) ?
this.bind(event, callback) :
this.trigger(event)
}
})
- ;['focus', 'blur'].forEach(function(name) {
- $.fn[name] = function(callback) {
- if (callback) this.bind(name, callback)
- else this.each(function(){
- try { this[name]() }
- catch(e) {}
- })
- return this
- }
- })
-
$.Event = function(type, props) {
if (!isString(type)) props = type, type = props.type
var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true