Skip to content

Commit

Permalink
remove indent
Browse files Browse the repository at this point in the history
  • Loading branch information
dexteryy committed Apr 9, 2014
1 parent f533dfe commit 9dd6f4d
Show file tree
Hide file tree
Showing 5 changed files with 937 additions and 937 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dollar",
"description": "A jQuery-compatible and non-All-in-One library which is more \"Zepto\" than Zepto.js",
"version": "1.5.0",
"version": "1.5.1",
"main": "dollar.js",
"dependencies": {
"mo": "~1.6.6"
Expand Down
174 changes: 87 additions & 87 deletions dollar/android23.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,108 +16,108 @@ define("dollar/android23", [
"dollar/origin"
], function(es5, _, detect, $){

var ext = $.fn,
nodes_access = $._nodesAccess,
css_method = $.camelize;
var ext = $.fn,
nodes_access = $._nodesAccess,
css_method = $.camelize;

_.mix(ext, {
_.mix(ext, {

data: $._kvAccess(function(node, name, value){
node.setAttribute('data-' + prop2data(name), value);
}, function(node, name){
if (name) {
return node.getAttribute('data-' + prop2data(name));
} else {
var data = {};
node.outerHTML
.replace(node.innerHTML, '')
.split(/\s+/)
.forEach(function(html){
var attr = (/^data-([\w\-]+)/.exec(html) || []);
if (attr[0]) {
this[css_method(attr[1])] = node.getAttribute(attr[0]);
}
}, data);
return data;
data: $._kvAccess(function(node, name, value){
node.setAttribute('data-' + prop2data(name), value);
}, function(node, name){
if (name) {
return node.getAttribute('data-' + prop2data(name));
} else {
var data = {};
node.outerHTML
.replace(node.innerHTML, '')
.split(/\s+/)
.forEach(function(html){
var attr = (/^data-([\w\-]+)/.exec(html) || []);
if (attr[0]) {
this[css_method(attr[1])] = node.getAttribute(attr[0]);
}
}, data);
return data;
}
}),

removeData: function(name){
this.forEach(function(node){
node.removeAttribute('data-' + prop2data(this));
}, name);
return this;
},

hasClass: function(cname){
for (var i = 0, l = this.length; i < l; i++) {
if (class_list(this[i]).indexOf(cname) !== -1) {
return true;
}
}),
}
return false;
},

removeData: function(name){
this.forEach(function(node){
node.removeAttribute('data-' + prop2data(this));
}, name);
return this;
},
addClass: function(cname){
return nodes_access.call(this, cname, function(node, value){
var list = class_list(node);
if (list.indexOf(value) === -1) {
list.push(value);
node.className = list.join(' ');
}
}, function(node){
return node.className;
});
},

hasClass: function(cname){
for (var i = 0, l = this.length; i < l; i++) {
if (class_list(this[i]).indexOf(cname) !== -1) {
return true;
}
removeClass: function(cname){
return nodes_access.call(this, cname, function(node, value){
var list = class_list(node),
n = list.indexOf(value);
if (n !== -1) {
list.splice(n, 1);
node.className = list.join(' ');
}
return false;
},
}, function(node){
return node.className;
});
},

addClass: function(cname){
return nodes_access.call(this, cname, function(node, value){
var list = class_list(node);
if (list.indexOf(value) === -1) {
toggleClass: function(cname, force){
return nodes_access.call(this, cname, function(node, value){
var list = class_list(node),
n = list.indexOf(value),
is_add = force;
if (is_add === undefined) {
is_add = n === -1;
}
if (is_add) {
if (n === -1) {
list.push(value);
node.className = list.join(' ');
}
}, function(node){
return node.className;
});
},

removeClass: function(cname){
return nodes_access.call(this, cname, function(node, value){
var list = class_list(node),
n = list.indexOf(value);
} else {
if (n !== -1) {
list.splice(n, 1);
node.className = list.join(' ');
}
}, function(node){
return node.className;
});
},

toggleClass: function(cname, force){
return nodes_access.call(this, cname, function(node, value){
var list = class_list(node),
n = list.indexOf(value),
is_add = force;
if (is_add === undefined) {
is_add = n === -1;
}
if (is_add) {
if (n === -1) {
list.push(value);
}
} else {
if (n !== -1) {
list.splice(n, 1);
}
}
node.className = list.join(' ');
}, function(node){
return node.className;
});
}

});

function prop2data(name){
return name.replace(/([A-Z])/g, function($0, $1){
return '-' + $1.toLowerCase();
}
node.className = list.join(' ');
}, function(node){
return node.className;
});
}

function class_list(elm){
return elm.className.split(/\s+/);
}
});

function prop2data(name){
return name.replace(/([A-Z])/g, function($0, $1){
return '-' + $1.toLowerCase();
});
}

function class_list(elm){
return elm.className.split(/\s+/);
}

return $;
return $;

});
130 changes: 65 additions & 65 deletions dollar/ie8.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,81 +7,81 @@ define('dollar/ie8', [
'jquery'
], function(es5, _, detect, $, jq){

var _array_slice = Array.prototype.slice;
var _array_slice = Array.prototype.slice;

var ext = $.fn;
var ext = $.fn;

['offset', 'width', 'height'].forEach(function(method){
ext[method] = function(){
return jq(this)[method]();
};
});

['show', 'hide'].forEach(function(method){
ext[method] = function(){
jq(this)[method]();
return this;
};
});

_.mix(ext, {

css: $._kvAccess(function(node, name, value){
jq(node).css(name, value);
}, function(node, name){
return jq(node).css(name);
}, function(dict){
jq(this).css(dict);
}),

on: function(subject, cb){
jq(this).on(subject, cb);
return this;
},

off: function(subject, cb){
jq(this).off(subject, cb);
return this;
}

});

ext.bind = ext.on;
ext.unbind = ext.off;
['offset', 'width', 'height'].forEach(function(method){
ext[method] = function(){
return jq(this)[method]();
};
});

$._querySelector = function(context, selector){
return _array_slice.call(jq.find(selector, context));
['show', 'hide'].forEach(function(method){
ext[method] = function(){
jq(this)[method]();
return this;
};
});

$.matchesSelector = jq.find.matchesSelector;
_.mix(ext, {

$.createNodes = function(str, attrs){
return $(jq(str, attrs));
};
css: $._kvAccess(function(node, name, value){
jq(node).css(name, value);
}, function(node, name){
return jq(node).css(name);
}, function(dict){
jq(this).css(dict);
}),

$.Event = function(type, props){
return new jq.Event(type, props);
};
on: function(subject, cb){
jq(this).on(subject, cb);
return this;
},

$.trigger = $.fn.trigger = function(me, event, data){
if (this === $) {
me = $(me);
} else {
data = event;
event = me;
me = this;
}
if (typeof event === 'string') {
event = $.Event(event);
}
_.mix(event, data);
me.forEach(function(node){
jq(node).trigger(event);
});
off: function(subject, cb){
jq(this).off(subject, cb);
return this;
};
}

});

ext.bind = ext.on;
ext.unbind = ext.off;

$._querySelector = function(context, selector){
return _array_slice.call(jq.find(selector, context));
};

$.matchesSelector = jq.find.matchesSelector;

$.createNodes = function(str, attrs){
return $(jq(str, attrs));
};

$.Event = function(type, props){
return new jq.Event(type, props);
};

$.trigger = $.fn.trigger = function(me, event, data){
if (this === $) {
me = $(me);
} else {
data = event;
event = me;
me = this;
}
if (typeof event === 'string') {
event = $.Event(event);
}
_.mix(event, data);
me.forEach(function(node){
jq(node).trigger(event);
});
return this;
};

return $;
return $;

});

Loading

0 comments on commit 9dd6f4d

Please sign in to comment.