Skip to content

Commit

Permalink
All string use ' instead of "
Browse files Browse the repository at this point in the history
  • Loading branch information
slavic authored and madrobby committed Mar 29, 2011
1 parent e2e46d3 commit a1c01b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/ajax.js
Expand Up @@ -34,7 +34,7 @@
if (/=\?/.test(settings.url)) return $.ajaxJSONP(settings);

if (!settings.url) settings.url = window.location.toString();
if (settings.data && !settings.contentType) settings.contentType = "application/x-www-form-urlencoded";
if (settings.data && !settings.contentType) settings.contentType = 'application/x-www-form-urlencoded';

if (settings.type.match(/get/i) && settings.data) {
var queryString,
Expand Down Expand Up @@ -112,15 +112,15 @@
var s = [],
rec = '',
add = function(key, value){
if(v) s[s.length] = encodeURIComponent(v + "[" + key +"]") + '=' + encodeURIComponent(value);
if(v) s[s.length] = encodeURIComponent(v + '[' + key +']') + '=' + encodeURIComponent(value);
else s[s.length] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
};
for(var i in obj){
if(obj[i] instanceof Array || obj[i] instanceof Object)
rec += (s.length + rec.length > 0 ? '&' : '') + $.param(obj[i], (v ? v + "[" + i + "]" : i));
rec += (s.length + rec.length > 0 ? '&' : '') + $.param(obj[i], (v ? v + '[' + i + ']' : i));
else
add(obj instanceof Array ? '' : i, obj[i]);
};
return s.join("&").replace(/%20/g, "+") + rec;
return s.join('&').replace(/%20/g, '+') + rec;
};
})(Zepto);
2 changes: 1 addition & 1 deletion src/polyfill.js
Expand Up @@ -7,7 +7,7 @@ if (Array.prototype.reduce === undefined)
Array.prototype.reduce = function(fun){
if(this === void 0 || this === null) throw new TypeError();
var t = Object(this), len = t.length >>> 0, k = 0, accumulator;
if(typeof fun !== "function") throw new TypeError();
if(typeof fun !== 'function') throw new TypeError();
if(len == 0 && arguments.length == 1) throw new TypeError();

if(arguments.length >= 2)
Expand Down
12 changes: 6 additions & 6 deletions src/zepto.js
Expand Up @@ -2,7 +2,7 @@ var Zepto = (function() {
var slice = [].slice, key, css, $$, fragmentRE, container, document = window.document, undefined,
getComputedStyle = document.defaultView.getComputedStyle;

function classRE(name){ return new RegExp("(^|\\s)" + name + "(\\s|$)") }
function classRE(name){ return new RegExp('(^|\\s)' + name + '(\\s|$)') }
function compact(array){ return array.filter(function(item){ return item !== undefined && item !== null }) }
function flatten(array){ return [].concat.apply([], array); }
function camelize(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }
Expand All @@ -14,7 +14,7 @@ var Zepto = (function() {
}

fragmentRE = /^\s*<[^>]+>/;
container = document.createElement("div");
container = document.createElement('div');
function fragment(html) {
container.innerHTML = ('' + html).trim();
var result = slice.call(container.childNodes);
Expand Down Expand Up @@ -85,7 +85,7 @@ var Zepto = (function() {
});
else {
var ignores = slice.call(
typeof selector === "string" ?
typeof selector === 'string' ?
this.filter(selector) :
selector instanceof NodeList ? selector : $(selector));
slice.call(this).forEach(function(el){
Expand Down Expand Up @@ -180,9 +180,9 @@ var Zepto = (function() {
css: function(property, value){
if (value === undefined && typeof property == 'string')
return this[0].style[camelize(property)] || getComputedStyle(this[0], '').getPropertyValue(property);
css = "";
css = '';
for (key in property) css += key + ':' + property[key] + ';';
if (typeof property == 'string') css = property + ":" + value;
if (typeof property == 'string') css = property + ':' + value;
return this.each(function() { this.style.cssText += ';' + css });
},
index: function(element){
Expand Down Expand Up @@ -222,7 +222,7 @@ var Zepto = (function() {
return this.each(function(index, element){
if (html instanceof Z) {
dom = html;
if (operator == "afterBegin" || operator == "afterEnd")
if (operator == 'afterBegin' || operator == 'afterEnd')
for (var i=0; i<dom.length; i++) element['insertAdjacentElement'](operator, dom[dom.length-i-1]);
else
for (var i=0; i<dom.length; i++) element['insertAdjacentElement'](operator, dom[i]);
Expand Down

0 comments on commit a1c01b7

Please sign in to comment.