Permalink
Browse files

* Fixed semicolons that were missing/extra

  • Loading branch information...
1 parent 5e5cfff commit 7e0fa1884638e0e61ba7231dab6345195015230a @npup committed Dec 21, 2010
@@ -5,9 +5,9 @@
var Ajax = {
getTransport: function() {
return Try.these(
- function() {return new XMLHttpRequest()},
- function() {return new ActiveXObject('Msxml2.XMLHTTP')},
- function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ function() {return new XMLHttpRequest();},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP');},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP');}
) || false;
},
@@ -256,7 +256,7 @@ Ajax.Request = Class.create(Ajax.Base, {
for (var i = 0, length = extras.length; i < length; i += 2)
headers[extras[i]] = extras[i+1];
else
- $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value; });
}
for (var name in headers)
@@ -278,7 +278,7 @@ Ajax.Request = Class.create(Ajax.Base, {
// IE sometimes returns 1223 for a 204 response.
if (this.transport.status === 1223) return 204;
return this.transport.status || 0;
- } catch (e) { return 0 }
+ } catch (e) { return 0; }
},
respondToReadyState: function(readyState) {
@@ -115,6 +115,6 @@ Ajax.Responders = {
Object.extend(Ajax.Responders, Enumerable);
Ajax.Responders.register({
- onCreate: function() { Ajax.activeRequestCount++ },
- onComplete: function() { Ajax.activeRequestCount-- }
+ onCreate: function() { Ajax.activeRequestCount++; },
+ onComplete: function() { Ajax.activeRequestCount--; }
});
@@ -101,7 +101,7 @@ Ajax.Response = Class.create({
getStatusText: function() {
try {
return this.transport.statusText || '';
- } catch (e) { return '' }
+ } catch (e) { return ''; }
},
/**
@@ -121,7 +121,7 @@ Ajax.Response = Class.create({
getAllHeaders: function() {
try {
return this.getAllResponseHeaders();
- } catch (e) { return null }
+ } catch (e) { return null; }
},
/**
View
@@ -216,7 +216,7 @@ Element._purgeElement = function(element) {
element._prototypeUID = void 0;
delete Element.Storage[uid];
}
-}
+};
/**
* mixin Element.Methods
@@ -632,9 +632,7 @@ Element.Methods = {
element.removeChild(element.firstChild);
}
Element._getContentFromAnonymousElement(tagName, content.stripScripts())
- .each(function(node) {
- element.appendChild(node)
- });
+ .each(function(node) {element.appendChild(node);});
} else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
// IE barfs when inserting a string that beings with a LINK
// element. The workaround is to add any content to the beginning
@@ -644,7 +642,7 @@ Element.Methods = {
element.removeChild(element.firstChild);
}
var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true);
- nodes.each(function(node) { element.appendChild(node) });
+ nodes.each(function(node) { element.appendChild(node); });
}
else {
element.innerHTML = content.stripScripts();
@@ -1820,7 +1818,7 @@ Element.Methods = {
element = $(element);
var id = Element.readAttribute(element, 'id');
if (id) return id;
- do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id));
+ do { id = 'anonymous_element_' + Element.idCounter++; } while ($(id));
Element.writeAttribute(element, 'id', id);
return id;
},
@@ -2847,7 +2845,7 @@ else if (Prototype.Browser.IE) {
}
}
}
- }
+ };
})();
Element._attributeTranslations.write = {
@@ -2922,7 +2920,7 @@ else if (Prototype.Browser.IE) {
if (arguments.length == 1) return element.firstDescendant();
return Object.isNumber(expression) ? _descendants(element)[expression] :
Element.select(element, expression)[index || 0];
- }
+ };
})();
}
@@ -2974,9 +2972,9 @@ if ('outerHTML' in document.documentElement) {
fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
parent.removeChild(element);
if (nextSibling)
- fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+ fragments.each(function(node) { parent.insertBefore(node, nextSibling); });
else
- fragments.each(function(node) { parent.appendChild(node) });
+ fragments.each(function(node) { parent.appendChild(node); });
}
else element.outerHTML = content.stripScripts();
@@ -3157,7 +3155,7 @@ Element.extend = (function() {
}
}
return element;
- }
+ };
}
return Prototype.K;
}
@@ -3493,7 +3491,7 @@ document.viewport = {
property[D] = 'client' + D;
- viewport['get' + D] = function() { return element[property[D]] };
+ viewport['get' + D] = function() { return element[property[D]]; };
return viewport['get' + D]();
}
View
@@ -144,7 +144,7 @@
_isButton = function(event, code) {
return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
_isButtonForDOMEvents(event, code);
- }
+ };
}
} else if (Prototype.Browser.WebKit) {
_isButton = _isButtonForWebKit;
@@ -162,15 +162,15 @@
* button. When a mouse is in left-handed mode, the browser will report
* clicks of the _right_ button as "left-clicks."
**/
- function isLeftClick(event) { return _isButton(event, 0) }
+ function isLeftClick(event) { return _isButton(event, 0); }
/**
* Event.isMiddleClick(@event) -> Boolean
*
* Determines whether a button-related mouse event involved the middle
* mouse button.
**/
- function isMiddleClick(event) { return _isButton(event, 1) }
+ function isMiddleClick(event) { return _isButton(event, 1); }
/**
* Event.isRightClick(@event) -> Boolean
@@ -182,7 +182,7 @@
* mouse button. When a mouse is in left-handed mode, the browser will
* report clicks of the _left_ button as "left-clicks."
**/
- function isRightClick(event) { return _isButton(event, 2) }
+ function isRightClick(event) { return _isButton(event, 2); }
/** deprecated
* Event.element(@event) -> Element
@@ -429,9 +429,9 @@
// These methods should be added _only_ to legacy IE event objects.
var additionalMethods = {
- stopPropagation: function() { this.cancelBubble = true },
- preventDefault: function() { this.returnValue = false },
- inspect: function() { return '[object Event]' }
+ stopPropagation: function() { this.cancelBubble = true; },
+ preventDefault: function() { this.returnValue = false; },
+ inspect: function() { return '[object Event]'; }
};
/**
@@ -121,7 +121,7 @@ var Form = {
initial = '';
accumulator = function(result, key, value) {
return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value);
- }
+ };
}
return elements.inject(initial, function(result, element) {
@@ -198,7 +198,7 @@ Form.Methods = {
if (serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));
return elements;
- })
+ });
},
/**
@@ -304,7 +304,7 @@ Form.Methods = {
});
var firstByIndex = elements.findAll(function(element) {
return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
- }).sortBy(function(element) { return element.tabIndex }).first();
+ }).sortBy(function(element) { return element.tabIndex; }).first();
return firstByIndex ? firstByIndex : elements.find(function(element) {
return /^(?:input|select|textarea)$/i.test(element.tagName);
@@ -358,7 +358,7 @@ Array.from = $A;
**/
function intersect(array) {
return this.uniq().findAll(function(item) {
- return array.detect(function(value) { return item === value });
+ return array.detect(function(value) { return item === value; });
});
}
@@ -486,7 +486,7 @@ Array.from = $A;
// fix for opera
var CONCAT_ARGUMENTS_BUGGY = (function() {
return [].concat(arguments)[0][0] !== 1;
- })(1,2)
+ })(1,2);
if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
@@ -50,7 +50,7 @@ var Class = (function() {
* [inheritance tutorial](http://prototypejs.org/learn/class-inheritance)
* on the Prototype website.
**/
- function subclass() {};
+ function subclass() {}
function create() {
var parent = null, properties = $A(arguments);
if (Object.isFunction(properties[0]))
@@ -111,7 +111,7 @@ Object.extend(Function.prototype, (function() {
return function() {
var a = merge(args, arguments);
return __method.apply(context, a);
- }
+ };
}
/** related to: Function#bind
@@ -174,7 +174,7 @@ Object.extend(Function.prototype, (function() {
return function(event) {
var a = update([event || window.event], args);
return __method.apply(context, a);
- }
+ };
}
/**
@@ -207,7 +207,7 @@ Object.extend(Function.prototype, (function() {
return function() {
var a = merge(args, arguments);
return __method.apply(this, a);
- }
+ };
}
/**
@@ -317,7 +317,7 @@ Object.extend(Function.prototype, (function() {
return function() {
var a = update([__method.bind(this)], arguments);
return wrapper.apply(this, a);
- }
+ };
}
/**
@@ -386,6 +386,6 @@ Object.extend(Function.prototype, (function() {
defer: defer,
wrap: wrap,
methodize: methodize
- }
+ };
})());
@@ -20,7 +20,7 @@
**/
function $H(object) {
return new Hash(object);
-};
+}
/** section: Language
* class Hash
@@ -36,7 +36,7 @@ Object.extend(String.prototype, (function() {
function prepareReplacement(replacement) {
if (Object.isFunction(replacement)) return replacement;
var template = new Template(replacement);
- return function(match) { return template.evaluate(match) };
+ return function(match) { return template.evaluate(match); };
}
/**
@@ -386,7 +386,7 @@ Object.extend(String.prototype, (function() {
* an array containing the value returned by each script.
**/
function evalScripts() {
- return this.extractScripts().map(function(script) { return eval(script) });
+ return this.extractScripts().map(function(script) { return eval(script); });
}
/** related to: String#unescapeHTML
@@ -84,7 +84,7 @@ var Prototype = {
WebKit: ua.indexOf('AppleWebKit/') > -1,
Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
MobileSafari: /Apple.*Mobile/.test(ua)
- }
+ };
})(),
/**
@@ -176,7 +176,7 @@ var Prototype = {
* Prototype.K(Prototype.K);
* // -> Prototype.K
**/
- K: function(x) { return x }
+ K: function(x) { return x; }
};
if (Prototype.Browser.MobileSafari)

0 comments on commit 7e0fa18

Please sign in to comment.