Permalink
Browse files

spaces not tabs. tired of all the check-in conflicts

  • Loading branch information...
1 parent b462164 commit 2116d46c1dfadd0bdf4a4e9a934eae04b8445b30 @robrobbins robrobbins committed Jul 4, 2013
Showing with 6,529 additions and 5,930 deletions.
  1. +3 −2 README.md
  2. +40 −40 base/base.js
  3. +60 −60 base/spec/base.spec.js
  4. +0 −1,820 build/debug/sudo-x.js
  5. +1,505 −517 build/debug/sudo.js
  6. +30 −30 build/lib/builder.js
  7. +37 −37 build/lib/filereader.js
  8. +22 −22 build/lib/filewriter.js
  9. +20 −20 build/lib/pathfinder.js
  10. +7 −7 build/lib/run.js
  11. +28 −28 build/lib/spec/filereader.spec.js
  12. +22 −22 build/lib/spec/filewriter.spec.js
  13. +4 −5 container/SpecRunner.html
  14. +66 −66 container/container.js
  15. +36 −36 container/spec/coffee/coffeeContainer.spec.coffee
  16. +73 −73 container/spec/container.spec.js
  17. +49 −49 container/spec/send.spec.js
  18. +1,452 −0 docs/sudo.html
  19. +219 −219 extensions/observable.js
  20. +34 −34 extras/dataview/dataview.js
  21. +109 −109 extras/dataview/spec/dataview.spec.js
  22. +4 −4 extras/dataview/specRunner.html
  23. +20 −20 extras/delegates/change/change.js
  24. +57 −57 extras/delegates/change/spec/change.spec.js
  25. +6 −9 extras/delegates/change/specRunner.html
  26. +22 −22 extras/delegates/data/data.js
  27. +35 −35 extras/delegates/data/spec/data.spec.js
  28. +6 −6 extras/delegates/data/specRunner.html
  29. +149 −149 extras/extensions/bindable.js
  30. +49 −49 extras/extensions/listener.js
  31. +109 −109 extras/extensions/persistable.js
  32. +98 −98 extras/navigator/navigator.js
  33. +92 −92 extras/navigator/spec/navigator-hc.spec.js
  34. +88 −88 extras/navigator/spec/navigator-ps.spec.js
  35. +4 −4 extras/navigator/specRunner.html
  36. +30 −30 extras/template/spec/template.spec.js
  37. +2 −5 extras/template/specRunner.html
  38. +47 −47 extras/template/template.js
  39. +38 −38 extras/viewController/spec/coffee/coffeeViewController.spec.coffee
  40. +56 −56 extras/viewController/spec/viewController.spec.js
  41. +2 −2 extras/viewController/specRunner.html
  42. +51 −51 extras/viewController/viewController.js
  43. +21 −21 lib/es5-shim/es5-sham.js
  44. +944 −944 lib/es5-shim/es5-shim.js
  45. +34 −34 model/model.js
  46. +60 −60 model/spec/model.spec.js
  47. +98 −98 model/spec/observable.spec.js
  48. +101 −101 model/spec/persistable.spec.js
  49. +5 −5 model/specRunner.html
  50. +22 −22 specRunner.html
  51. +0 −15 staticServer.js
  52. +16 −0 sudo-basic.html
  53. +0 −28 sudo-x.html
  54. +19 −7 sudo.html
  55. +113 −113 sudo.js
  56. +3 −3 view/SpecRunner.html
  57. +124 −124 view/spec/bindable.spec.js
  58. +50 −50 view/spec/coffee/coffeeView.spec.coffee
  59. +93 −93 view/spec/view.spec.js
  60. +45 −45 view/view.js
View
@@ -145,5 +145,6 @@ be sure to add them to sudo.html (and/or the sudo-x.html) config file or they wi
### Extras
-The `-x` debug version, `build/debug/sudo-x.js`, simply contains the 'modules' located in the `extras` directory that have been
-tested and documented. They do not belong in core but provide added functionality that some may find useful.
+The debug version, `build/debug/sudo.js`, contains the basic 'modules' as well as the others located in the `extras` directory that have been
+tested and documented. A basic build is also available (`sudo-basic`), this serves as an example of how to configure a custom build of
+`sudo.js` if desired.
View
@@ -6,21 +6,21 @@
//
// `constructor`
sudo.Base = function() {
- // can delegate
- this.delegates = [];
- // a beautiful and unique snowflake
- this.uid = sudo.unique();
+ // can delegate
+ this.delegates = [];
+ // a beautiful and unique snowflake
+ this.uid = sudo.unique();
};
// ###addDelegate
// Push an instance of a Class Object into this object's `_delegates_` list.
//
// `param` {Object} an instance of a sudo.delegates Class Object
// `returns` {Object} `this`
sudo.Base.prototype.addDelegate = function addDelegate(del) {
- del.delegator = this;
- this.delegates.push(del);
- if('addedAsDelegate' in del) del.addedAsDelegate(this);
- return this;
+ del.delegator = this;
+ this.delegates.push(del);
+ if('addedAsDelegate' in del) del.addedAsDelegate(this);
+ return this;
};
// ###base
// Lookup the function matching the name passed in and call it with
@@ -31,26 +31,26 @@ sudo.Base.prototype.addDelegate = function addDelegate(del) {
// `params` {*} any other number of arguments to be passed to the looked up method
// along with the initial method name
sudo.Base.prototype.base = function base() {
- var args = Array.prototype.slice.call(arguments),
- name = args.shift(),
- found = false,
- obj = this,
- curr;
- // find method on the prototype, excluding the caller
- while(!found) {
- curr = Object.getPrototypeOf(obj);
- if(curr[name] && curr[name] !== this[name]) found = true;
- // keep digging
- else obj = curr;
- }
- return curr[name].apply(this, args);
+ var args = Array.prototype.slice.call(arguments),
+ name = args.shift(),
+ found = false,
+ obj = this,
+ curr;
+ // find method on the prototype, excluding the caller
+ while(!found) {
+ curr = Object.getPrototypeOf(obj);
+ if(curr[name] && curr[name] !== this[name]) found = true;
+ // keep digging
+ else obj = curr;
+ }
+ return curr[name].apply(this, args);
};
// ###construct
// A convenience method that alleviates the need to place:
// `Object.getPrototypeOf(this).consturctor.apply(this, arguments)`
// in every constructor
sudo.Base.prototype.construct = function construct() {
- Object.getPrototypeOf(this).constructor.apply(this, arguments || []);
+ Object.getPrototypeOf(this).constructor.apply(this, arguments || []);
};
// ###delegate
// From this object's list of delegates find the object whose `_role_` matches
@@ -62,13 +62,13 @@ sudo.Base.prototype.construct = function construct() {
// `param` {String} `meth` Optional method to bind to the action this delegate is being used for
// `returns`
sudo.Base.prototype.delegate = function delegate(role, meth) {
- var del = this.delegates, i;
- for(i = 0; i < del.length; i++) {
- if(del[i].role === role) {
- if(!meth) return del[i];
- return del[i][meth].bind(del[i]);
- }
- }
+ var del = this.delegates, i;
+ for(i = 0; i < del.length; i++) {
+ if(del[i].role === role) {
+ if(!meth) return del[i];
+ return del[i][meth].bind(del[i]);
+ }
+ }
};
// ###getDelegate
// Fetch a delegate whose role property matches the passed in argument.
@@ -78,7 +78,7 @@ sudo.Base.prototype.delegate = function delegate(role, meth) {
// `param` {String} `role`
// 'returns' {Object|undefined}
sudo.Base.prototype.getDelegate = function getDelegate(role) {
- return this.delegate(role);
+ return this.delegate(role);
};
// ###removeDelegate
// From this objects `delegates` list remove the object (there should only ever be 1)
@@ -87,16 +87,16 @@ sudo.Base.prototype.getDelegate = function getDelegate(role) {
// `param` {String} `role`
// `returns` {Object} `this`
sudo.Base.prototype.removeDelegate = function removeDelegate(role) {
- var del = this.delegates, i;
- for(i = 0; i < del.length; i++) {
- if(del[i].role === role) {
- // no _delegator_ for you
- del[i].delegator = void 0;
- del.splice(i, 1);
- return this;
- }
- }
- return this;
+ var del = this.delegates, i;
+ for(i = 0; i < del.length; i++) {
+ if(del[i].role === role) {
+ // no _delegator_ for you
+ del[i].delegator = void 0;
+ del.splice(i, 1);
+ return this;
+ }
+ }
+ return this;
};
// `private`
sudo.Base.prototype.role = 'base';
View
@@ -1,62 +1,62 @@
describe('Sudo Base Object', function() {
- beforeEach(function() {
- b = new _.Base();
- d = new _.Base();
- d.role = 'encyclopediaSalesman';
- d.burgle = function() {
- return this.role;
- };
- d.addedAsDelegate = function() {
- this.added = true;
- };
- });
-
- it('is an instance of the Base class', function() {
- expect(b instanceof _.Base).toBe(true);
- });
-
- it('has a unique id', function() {
- expect(b.uid).toBeTruthy();
- });
-
- it('has an empty delegates Array', function() {
- expect(Array.isArray(b.delegates)).toBe(true);
- });
-
- it('can add a delegate', function() {
- b.addDelegate(d);
- expect(b.delegates.length).toBe(1);
- });
-
- it('calls addedAsDelegate if present', function() {
- var spy = spyOn(d, 'addedAsDelegate').andCallThrough();
- b.addDelegate(d);
- expect(spy).toHaveBeenCalled();
- expect(d.added).toBe(true);
- });
-
- it('can fetch a delegate by role', function() {
- b.addDelegate(d);
- expect(b.delegate('encyclopediaSalesman')).toBe(d);
- });
-
- it('returns a function when passed a matching name', function() {
- b.addDelegate(d);
- expect(typeof b.delegate('encyclopediaSalesman', 'burgle')).toBe('function');
- });
-
- it('returns a function, bound to the delegate, if delegated to', function() {
- b.addDelegate(d);
- expect(b.delegate('encyclopediaSalesman', 'burgle')()).toBe('encyclopediaSalesman');
- });
-
- it('can remove a delegate', function() {
- e = new _.Base();
- e.role = 'suspiciousHomeOwner';
- b.addDelegate(d);
- b.addDelegate(e);
- expect(b.delegates.length).toBe(2);
- b.removeDelegate('encyclopediaSalesman');
- expect(b.delegates.length).toBe(1);
- });
+ beforeEach(function() {
+ b = new _.Base();
+ d = new _.Base();
+ d.role = 'encyclopediaSalesman';
+ d.burgle = function() {
+ return this.role;
+ };
+ d.addedAsDelegate = function() {
+ this.added = true;
+ };
+ });
+
+ it('is an instance of the Base class', function() {
+ expect(b instanceof _.Base).toBe(true);
+ });
+
+ it('has a unique id', function() {
+ expect(b.uid).toBeTruthy();
+ });
+
+ it('has an empty delegates Array', function() {
+ expect(Array.isArray(b.delegates)).toBe(true);
+ });
+
+ it('can add a delegate', function() {
+ b.addDelegate(d);
+ expect(b.delegates.length).toBe(1);
+ });
+
+ it('calls addedAsDelegate if present', function() {
+ var spy = spyOn(d, 'addedAsDelegate').andCallThrough();
+ b.addDelegate(d);
+ expect(spy).toHaveBeenCalled();
+ expect(d.added).toBe(true);
+ });
+
+ it('can fetch a delegate by role', function() {
+ b.addDelegate(d);
+ expect(b.delegate('encyclopediaSalesman')).toBe(d);
+ });
+
+ it('returns a function when passed a matching name', function() {
+ b.addDelegate(d);
+ expect(typeof b.delegate('encyclopediaSalesman', 'burgle')).toBe('function');
+ });
+
+ it('returns a function, bound to the delegate, if delegated to', function() {
+ b.addDelegate(d);
+ expect(b.delegate('encyclopediaSalesman', 'burgle')()).toBe('encyclopediaSalesman');
+ });
+
+ it('can remove a delegate', function() {
+ e = new _.Base();
+ e.role = 'suspiciousHomeOwner';
+ b.addDelegate(d);
+ b.addDelegate(e);
+ expect(b.delegates.length).toBe(2);
+ b.removeDelegate('encyclopediaSalesman');
+ expect(b.delegates.length).toBe(1);
+ });
});
Oops, something went wrong.

0 comments on commit 2116d46

Please sign in to comment.