Skip to content

Commit 2830202

Browse files
committed
uniform comment capitalization, fix small grammar issues
1 parent 32bb070 commit 2830202

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Require both `jquery` and `jquery-ujs` into your application.js manifest.
6060
How to run tests
6161
------------
6262

63-
Follow [this wiki](https://github.com/rails/jquery-ujs/wiki/Running-Tests-and-Contributing) to run tests .
63+
Follow [this wiki](https://github.com/rails/jquery-ujs/wiki/Running-Tests-and-Contributing) to run tests.
6464

6565

6666
[data]: http://www.w3.org/TR/html5/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes "Embedding custom non-visible data with the data-* attributes"

src/rails.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
7373
},
7474

75-
// making sure that all forms have actual up-to-date token(cached forms contain old one)
75+
// Make sure that all forms have actual up-to-date tokens (cached forms contain old ones)
7676
refreshCSRFTokens: function(){
7777
$('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken());
7878
},
@@ -334,7 +334,7 @@
334334
return false;
335335
},
336336

337-
// replace element's html with the 'data-disable-with' after storing original html
337+
// Replace element's html with the 'data-disable-with' after storing original html
338338
// and prevent clicking on it
339339
disableElement: function(element) {
340340
var replacement = element.data('disable-with');
@@ -349,7 +349,7 @@
349349
});
350350
},
351351

352-
// restore element to its original state which was disabled by 'disableElement' above
352+
// Restore element to its original state which was disabled by 'disableElement' above
353353
enableElement: function(element) {
354354
if (element.data('ujs:enable-with') !== undefined) {
355355
element.html(element.data('ujs:enable-with')); // set to old enabled state
@@ -404,7 +404,7 @@
404404
if (metaClick && (!method || method === 'GET') && !data) { return true; }
405405

406406
var handleRemote = rails.handleRemote(link);
407-
// response from rails.handleRemote() will either be false or a deferred object promise.
407+
// Response from rails.handleRemote() will either be false or a deferred object promise.
408408
if (handleRemote === false) {
409409
rails.enableElement(link);
410410
} else {
@@ -426,7 +426,7 @@
426426
if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button);
427427

428428
var handleRemote = rails.handleRemote(button);
429-
// response from rails.handleRemote() will either be false or a deferred object promise.
429+
// Response from rails.handleRemote() will either be false or a deferred object promise.
430430
if (handleRemote === false) {
431431
rails.enableFormElement(button);
432432
} else {
@@ -451,7 +451,7 @@
451451

452452
if (!rails.allowAction(form)) return rails.stopEverything(e);
453453

454-
// skip other logic when required values are missing or file upload is present
454+
// Skip other logic when required values are missing or file upload is present
455455
if (form.attr('novalidate') === undefined) {
456456
blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false);
457457
if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
@@ -462,12 +462,12 @@
462462
if (remote) {
463463
nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
464464
if (nonBlankFileInputs) {
465-
// slight timeout so that the submit button gets properly serialized
465+
// Slight timeout so that the submit button gets properly serialized
466466
// (make it easy for event handler to serialize form without disabled values)
467467
setTimeout(function(){ rails.disableFormElements(form); }, 13);
468468
var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
469469

470-
// re-enable form elements if event bindings return false (canceling normal form submission)
470+
// Re-enable form elements if event bindings return false (canceling normal form submission)
471471
if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); }
472472

473473
return aborted;
@@ -477,7 +477,7 @@
477477
return false;
478478

479479
} else {
480-
// slight timeout so that the submit button gets properly serialized
480+
// Slight timeout so that the submit button gets properly serialized
481481
setTimeout(function(){ rails.disableFormElements(form); }, 13);
482482
}
483483
});
@@ -487,7 +487,7 @@
487487

488488
if (!rails.allowAction(button)) return rails.stopEverything(event);
489489

490-
// register the pressed submit button
490+
// Register the pressed submit button
491491
var name = button.attr('name'),
492492
data = name ? {name:name, value:button.val()} : null;
493493

0 commit comments

Comments
 (0)