Skip to content

Commit

Permalink
makes and moves can.Map and can.List and moves can/view/bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbmeyer committed Sep 12, 2013
1 parent 26d6cbf commit 8af5a0f
Show file tree
Hide file tree
Showing 127 changed files with 3,783 additions and 3,500 deletions.
18 changes: 9 additions & 9 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"isDefault": true
},
"can/observe": {
"name": "can.Observe",
"description": "Observable key-value bindings",
"name": "can.Map, can.List, can.compute",
"description": "Observables and key-value bindings",
"type": "core",
"isDefault": true
},
"can/observe/compute": {
"can/compute": {
"name": "can.compute",
"description": "can.compute lets you make observable values",
"type": "core",
Expand Down Expand Up @@ -67,7 +67,7 @@
"type": "plugin",
"description": "Live-binding Handlebars and Mustache views"
},
"can/view/mustache/bindings": {
"can/view/bindings": {
"name": "can.view.bindings",
"type": "plugin",
"description": "Two way bindings and in-template declarative event handlers."
Expand All @@ -92,27 +92,27 @@
"type": "plugin",
"description": "Proxy construct methods"
},
"can/observe/delegate": {
"can/map/delegate": {
"name": "can.Observe.delegate",
"type": "plugin",
"description": "Listen to Observe attributes"
},
"can/observe/setter": {
"can/map/setter": {
"name": "can.Observe.setter",
"type": "plugin",
"description": "Use setter methods on Observes"
},
"can/observe/attributes": {
"can/map/attributes": {
"name": "can.Observe.attributes",
"type": "plugin",
"description": "Define Observe attributes"
},
"can/observe/validations": {
"can/map/validations": {
"name": "can.Observe.validations",
"type": "plugin",
"description": "Validate Observe attributes"
},
"can/observe/backup": {
"can/map/backup": {
"name": "can.Observe.backup",
"type": "plugin",
"description": "Backup and restore an Observes state"
Expand Down
12 changes: 6 additions & 6 deletions can.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ framework:

- [can.Construct] - inheritable constructor functions
- [can.Control] - declarative event bindings
- [can.Observe], [can.Observe.List], [can.compute] - observable objects, list, and values.
- [can.Map], [can.List], [can.compute] - observable objects, list, and values.
- [can.Model] - observes connected to a RESTful JSON interface
- [can.view] - template loading, caching, rendering
- [can.EJS] - live binding templates
Expand All @@ -26,11 +26,11 @@ The following modules are typically distributed as plugins:
- [can.Mustache] - Live binding Handlebars and Mustache templates
- [can.Construct.proxy] - Proxy construct methods
- [can.Construct.super] - Call super methods
- [can.Observe.delegate] - Listen to Observe attributes
- [can.Observe.setter] - Use setter methods on Observes
- [can.Observe.attributes] - Define Observe attributes
- [can.Observe.validations] - Validate attributes
- [can.Observe.backup] - Backup and restore an Observe's state
- [can.Map.delegate] - Listen to Observe attributes
- [can.Map.setter] - Use setter methods on Observes
- [can.Map.attributes] - Define Observe attributes
- [can.Map.validations] - Validate attributes
- [can.Map.backup] - Backup and restore an Observe's state
- [can.Control.plugin] - Registers a jQuery plugin function for Controls[1]
- [can.view.modifiers View modifiers] - Use jQuery modifiers to render views[1]

Expand Down
16 changes: 8 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __1.1.6__ ( May 30 2013 )
- change: [Binding to an Observe.compute value is broken](https://github.com/bitovi/canjs/issues/372)
- change: [Added validatesNumericalityOf to validations](https://github.com/bitovi/canjs/issues/370)
- change: [Include can.Object in CanJS distribution](https://github.com/bitovi/canjs/issues/368)
- change: [can.Observe makes can.Deferred into an observable](https://github.com/bitovi/canjs/issues/367)
- change: [can.Map makes can.Deferred into an observable](https://github.com/bitovi/canjs/issues/367)
- change: [Update sub to not break when str is undefined](https://github.com/bitovi/canjs/issues/365)
- change: [List memory leak fix](https://github.com/bitovi/canjs/issues/363)
- change: [Integrated incremental live lists](https://github.com/bitovi/canjs/issues/361)
Expand Down Expand Up @@ -65,7 +65,7 @@ __1.1.5__ ( Mar 28 2013 )
- change: [fixing computes from converting type](https://github.com/bitovi/canjs/issues/278)
- change: [can.view with Deferreds doesn't pass failures](https://github.com/bitovi/canjs/issues/276)
- change: [HTML comments trip EJS rendering](https://github.com/bitovi/canjs/issues/271)
- change: [can.Observe.prototype.each overrides {{#each}} Mustache helper.](https://github.com/bitovi/canjs/issues/258)
- change: [can.Map.prototype.each overrides {{#each}} Mustache helper.](https://github.com/bitovi/canjs/issues/258)
- change: [Any model with a "." in the key name will cause observe.js _set() to throw and error](https://github.com/bitovi/canjs/issues/257)
- change: [Item.List splice method does not convert inserted elements to Item type](https://github.com/bitovi/canjs/issues/253)
- change: [Mustache: DOM exception when applying certain block patterns](https://github.com/bitovi/canjs/issues/243)
Expand Down Expand Up @@ -93,7 +93,7 @@ __1.1.4__ ( February 5, 2013 )
- fix: [Observe.List sort doesn't use custom method passed](https://github.com/bitovi/canjs/issues/169)
- fix: [test&fix: null values crashing validations](https://github.com/bitovi/canjs/pull/145)
- fix: [EJS rendering null value](https://github.com/bitovi/canjs/pull/118)
- fix: [can.Observe sort plugin doesn't trigger add events](https://github.com/bitovi/canjs/issues/205)
- fix: [can.Map sort plugin doesn't trigger add events](https://github.com/bitovi/canjs/issues/205)
- fix: [Observe.List sort plugin erroring on item removal](https://github.com/bitovi/canjs/pull/88)
- fix: [Live binding on observe.lists nested in an observe doesn't work](https://github.com/bitovi/canjs/issues/204)
- fix: [Observe.List sort doesn't use custom method passed](https://github.com/bitovi/canjs/issues/169)
Expand All @@ -114,7 +114,7 @@ __1.1.3__ ( December 11, 2012 )
- fix: [compute only updates once when a list's contents are replaced](https://github.com/bitovi/canjs/commit/9cb47dfabba5dbe3bef161e6aae4a5ce2965ac49)
- add: [Updated jQuery hashchange plugin](https://github.com/bitovi/canjs/pull/201)
- add: [Generate computes from an observe property](https://github.com/bitovi/canjs/issues/203)
- add: [Add can.Observe.List.prototype.replace](https://github.com/bitovi/canjs/issues/194)
- add: [Add can.List.prototype.replace](https://github.com/bitovi/canjs/issues/194)
- add: [Return resolved data models in view callback](https://github.com/bitovi/canjs/issues/1log
83)

Expand Down Expand Up @@ -161,18 +161,18 @@ __1.1.0__ ( November 13, 2012 )
- can.Control
- add: [control does not listen to touchmove event on controller itself](https://github.com/bitovi/canjs/issues/104)

- can.Observe
- can.Map
- add: [List binding on .length of an object](https://github.com/bitovi/canjs/issues/142)
- fix: [validation error that incorrectly labels an attribute with a value of 0 as empty](https://github.com/bitovi/canjs/pull/132)
- add: [you can now pluralise event names to listen to matching events of that type (rather than firing a single event)](https://github.com/bitovi/canjs/issues/122)
- add: [compound sets now behave correctly](https://github.com/bitovi/canjs/issues/119)
- fix: [can.Observe.delegate sets wrong event.currentTarget](https://github.com/bitovi/canjs/issues/123)
- add: [ability to assign object as attribute type in can.Observe](https://github.com/bitovi/canjs/issues/107)
- fix: [can.Map.delegate sets wrong event.currentTarget](https://github.com/bitovi/canjs/issues/123)
- add: [ability to assign object as attribute type in can.Map](https://github.com/bitovi/canjs/issues/107)

- can.Model
- fix: [can.Model with attributes that are models gets corrupted when you call attr()](https://github.com/bitovi/canjs/pull/141)
- add: [missing dependency to can/model](https://github.com/bitovi/canjs/pull/140)
- Moved can/model/elements to can/observe/elements and renamed `models` to `instances`
- Moved can/model/elements to can/map/elements and renamed `models` to `instances`
- fix: [can.Model.List doesn't fire the change event on the expando properties ](https://github.com/bitovi/canjs/issues/129)

__1.0.7__ (June 25nd 2012)
Expand Down
2 changes: 1 addition & 1 deletion component/component.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
steal("can/util","can/control","can/observe","can/view/mustache","can/view/mustache/bindings",function(can){
steal("can/util","can/control","can/observe","can/view/mustache","can/view/bindings",function(can){

var ignoreAttributesRegExp = /data-view-id|class|id/i
/**
Expand Down
4 changes: 2 additions & 2 deletions component/component_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test("basic tabs",function(){
},
removePanel: function(panel){
var panels = this.attr("panels");
can.Map.startBatch();
can.batch.start();
panels.splice(panels.indexOf(panel),1);
if(panel === this.attr("active")){
if(panels.length){
Expand All @@ -83,7 +83,7 @@ test("basic tabs",function(){
this.removeAttr("active")
}
}
can.Map.stopBatch()
can.batch.stop()
},
makeActive: function(panel){
this.attr("active",panel);
Expand Down
2 changes: 1 addition & 1 deletion component/examples/1.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</script>
<script src="../../../steal/steal.js"></script>
<script type='text/javascript'>
steal("can/util", "can/component", "can/observe/setter", "can/util/fixture",
steal("can/util", "can/component", "can/map/setter", "can/util/fixture",
"can/model", function (can) {


Expand Down
2 changes: 1 addition & 1 deletion component/examples/2.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</script>
<script src="../../../steal/steal.js"></script>
<script type='text/javascript'>
steal("can/util", "can/component", "can/observe/setter", "can/util/fixture",
steal("can/util", "can/component", "can/map/setter", "can/util/fixture",
"can/model", function (can) {


Expand Down
2 changes: 1 addition & 1 deletion component/examples/3.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</script>
<script src="../../../steal/steal.js"></script>
<script type='text/javascript'>
steal("can/util", "can/component", "can/observe/setter", "can/util/fixture",
steal("can/util", "can/component", "can/map/setter", "can/util/fixture",
"can/model", function (can) {


Expand Down
2 changes: 1 addition & 1 deletion component/examples/4.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<script src="../../lib/steal/steal.js"></script>
<script type='text/javascript'>
steal("can/util", "can/component", "can/observe/setter", "can/util/fixture",
steal("can/util", "can/component", "can/map/setter", "can/util/fixture",
"can/model", function (can) {


Expand Down
2 changes: 1 addition & 1 deletion component/examples/paginate.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</script>
<script src="../../lib/steal/steal.js"></script>
<script type='text/javascript'>
steal("can/util", "can/component", "can/observe/setter", "can/util/fixture",
steal("can/util", "can/component", "can/map/setter", "can/util/fixture",
"can/model", function (can) {

var Website = can.Model.extend({
Expand Down
4 changes: 2 additions & 2 deletions component/examples/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
removePanel: function(panel){
var panels = this.attr("panels");
can.Map.startBatch();
can.batch.start();
panels.splice(panels.indexOf(panel),1);
if(panel === this.attr("active")){
if(panels.length){
Expand All @@ -79,7 +79,7 @@
this.removeAttr("active")
}
}
can.Map.stopBatch()
can.batch.stop()
},
makeActive: function(panel){
this.attr("active",panel);
Expand Down
2 changes: 1 addition & 1 deletion component/examples/treecombo.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</script>
<script src="../../lib/steal/steal.js"></script>
<script type='text/javascript'>
steal("can/util", "can/component", "can/observe/setter", "can/util/fixture",
steal("can/util", "can/component", "can/map/setter", "can/util/fixture",
"can/model", function (can) {

can.Component.extend({
Expand Down
26 changes: 13 additions & 13 deletions observe/compute/compute.js → compute/compute.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
steal('can/util', 'can/util/bind', function(can, bind) {
steal('can/util', 'can/util/bind', 'can/util/batch',function(can, bind) {

// returns the
// - observes and attr methods are called by func
Expand All @@ -7,14 +7,14 @@ steal('can/util', 'can/util/bind', function(can, bind) {
var getValueAndObserved = function(func, self){

var oldReading;
if (can.Observe) {
// Set a callback on can.Observe to know
if (can.Map) {
// Set a callback on can.Map to know
// when an attr is read.
// Keep a reference to the old reader
// if there is one. This is used
// for nested live binding.
oldReading = can.Observe.__reading;
can.Observe.__reading = function(obj, attr){
oldReading = can.Map.__reading;
can.Map.__reading = function(obj, attr){
// Add the observe and attr that was read
// to `observed`
observed.push({
Expand All @@ -30,8 +30,8 @@ steal('can/util', 'can/util/bind', function(can, bind) {
value = func.call(self);

// Set back so we are no longer reading.
if(can.Observe){
can.Observe.__reading = oldReading;
if(can.Map){
can.Map.__reading = oldReading;
}
return {
value : value,
Expand Down Expand Up @@ -194,13 +194,13 @@ steal('can/util', 'can/util/bind', function(can, bind) {
}
// fire the change
if( old !== value){
can.Observe.triggerBatch(computed, "change",[value, old] );
can.batch.trigger(computed, "change",[value, old] );
}
return value;
} else {
// Let others know to listen to changes in this compute
if( can.Observe.__reading && canReadForChangeEvent) {
can.Observe.__reading(computed,'change');
if( can.Map.__reading && canReadForChangeEvent) {
can.Map.__reading(computed,'change');
}
// if we are bound, use the cached value
if( computeState.bound ) {
Expand Down Expand Up @@ -229,7 +229,7 @@ steal('can/util', 'can/util/bind', function(can, bind) {
// `can.compute(obj, "propertyName", [eventName])`

var propertyName = context,
isObserve = getterSetter instanceof can.Observe;
isObserve = getterSetter instanceof can.Map;
if(isObserve){
computed.hasDependencies = true;
}
Expand Down Expand Up @@ -299,7 +299,7 @@ steal('can/util', 'can/util/bind', function(can, bind) {
var updater= function(newValue, oldValue){
value = newValue;
// might need a way to look up new and oldVal
can.Observe.triggerBatch(computed, "change",[newValue, oldValue])
can.batch.trigger(computed, "change",[newValue, oldValue])
}

return can.extend(computed,{
Expand Down Expand Up @@ -327,7 +327,7 @@ steal('can/util', 'can/util/bind', function(can, bind) {
* - _oldVal_ is the value of the compute before it changed.
*
* `bind` lets you listen to a compute to know when it changes. It works just like
* can.Observe's `[can.Observe.prototype.bind bind]`:
* can.Map's `[can.Map.prototype.bind bind]`:
@codestart
* var tally = can.compute(0);
* tally.bind('change', function(ev, newVal, oldVal) {
Expand Down
Loading

0 comments on commit 8af5a0f

Please sign in to comment.