Skip to content

Commit

Permalink
MINOR Fixed jquery.changetracker JSpec tests, added support for calli…
Browse files Browse the repository at this point in the history
…ng public methods as string arguments on plugin (which was already assumed to be the case in the JSpec tests)
  • Loading branch information
chillu committed Dec 15, 2011
1 parent 482324b commit ddad7fb
Show file tree
Hide file tree
Showing 30 changed files with 12,008 additions and 253 deletions.
15 changes: 12 additions & 3 deletions admin/javascript/jquery-changetracker/lib/jquery.changetracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
* @param DOMElement field
*/
this.resetField = function(field) {
return $(field).removeData('changetracker.origVal');
return $(field).removeData('changetracker.origVal').removeClass('changed');
};

/**
Expand All @@ -99,7 +99,16 @@
this.getFields = function() {
return this.find(options.fieldSelector).not(options.ignoreFieldSelector);
};

return this.initialize();

// Support invoking "public" methods as string arguments
if (typeof arguments[0] === 'string') {
var property = arguments[1];
var args = Array.prototype.slice.call(arguments);
args.splice(0, 1);
return this[arguments[0]].apply(this, args);
} else {
return this.initialize();
}

};
}(jQuery));
31 changes: 0 additions & 31 deletions admin/javascript/jquery-changetracker/spec/.tmp_spec.html.49538~

This file was deleted.

34 changes: 0 additions & 34 deletions admin/javascript/jquery-changetracker/spec/.tmp_spec.html.8678~

This file was deleted.

32 changes: 0 additions & 32 deletions admin/javascript/jquery-changetracker/spec/.tmp_spec.html.970~

This file was deleted.

This file was deleted.

105 changes: 0 additions & 105 deletions admin/javascript/jquery-changetracker/spec/.tmp_speed.html.70283~

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<html>
<head>
<link type="text/css" rel="stylesheet" href="../vendor/jspec/lib/jspec.css" />

<script src="../vendor/jquery-1.3.2.js"></script>
<script src="../vendor/jspec/lib/jspec.js"></script>
<script src="../vendor/jspec/lib/jspec.jquery.js"></script>

<link type="text/css" rel="stylesheet" href="./lib/jspec.css" />
<script src="http://code.jquery.com/jquery-1.7.1.js"></script>
<script src="./lib/jspec.js"></script>
<script src="./lib/jspec.xhr.js"></script>
<script src="../lib/jquery.changetracker.js"></script>
<script src="unit/spec.helper.js"></script>
<script>
function runSuites() {
JSpec
.exec('spec.changetracker.basics.js')
.run()
.run({ fixturePath: 'fixtures' })
.report()
}
</script>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ddad7fb

Please sign in to comment.