0
+***Still a work in progress, not released yet***
0
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
0
+Data binding! Keep many objects up-to-date without any of your objects knowing about eachother.
0
+1. Create some objects that implement the controller client api
0
+ * Read/Write objects must implement get, set, Events & the 'change' event
0
+ addEvent: function(type){}
0
+ addEvent: function(type){}
0
+ * Read only objects have to implement set with both a key and value argument
0
+ readOnlyObject1 = { set: function(key,value){} }
0
+ readOnlyObject2 = { set: function(key,value){} }
0
+ * Custom functions only have to support a single argument
0
+ customFunction1 = function(value){};
0
+ customFunction2 = function(value){};
0
+ var myController = new SubtleController();
0
+3. Bind your objects to the controller
0
+ myController.addBinding(readWriteObject1, 'controllerKey', 'readWriteObject1Key');
0
+ myController.addBinding(readWriteObject2, 'controllerKey', 'readWriteObject2Key');
0
+ myController.addBinding(readOnlyObject1, 'controllerKey', 'readOnlyObject1Key');
0
+ myController.addBinding(readOnlyObject2, 'controllerKey', 'readOnlyObject2Key');
0
+ myController.addBinding(customFunction1, 'controllerKey');
0
+ myController.addBinding(customFunction2, 'controllerKey');
0
+1. Modify one of your read/write objects
0
+ readWriteObject1.set('readWriteObject1Key', 'some random value');
0
+2. Commit your changes by firing the change event
0
+*optionally, you may pass a string, or array of strings, for the keys that have changed*
0
+ readWriteObject1.fireEvent('change', 'readWriteObject1Key');
0
+3. The Controller updates itself with the updated values. **It does this itself**
0
+ myController.set('controllerKey', readWriteObject1.get('viewKey'));
0
+4. The Controller updates all the bindings. **It does this itself**
0
+ readWriteObject1.set('readWriteObject1Key', myController.get('controllerKey'));
0
+ readWriteObject2.set('readWriteObject2Key', myController.get('controllerKey'));
0
+ readOnlyObject1.set('readOnlyObject1Key', myController.get('controllerKey'));
0
+ readOnlyObject2.set('readOnlyObject2Key', myController.get('controllerKey'));
0
-1. First, rename the SubtleController.js files to whatever the name of your plugin is
0
-2. Replace every occurrence of "SubtleController" with your plugins actual name