<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -93,3 +93,50 @@ Events can be bubbled to other Broadcaster or Base objects:
 
 Bubbled messages can optionally include a namespace which will be prepended to
 the message when bubbled.
+
+
+== ElementBase ==
+
+ElementBase extends Base with getter and setter functionality that looks inside
+a wrapped DOM element first to find and set attributes. If a suitable element
+is not found inside the wrapped element, getting and setting works like in a
+normal Base object.
+
+  &lt;div class=&quot;post&quot;&gt;
+    &lt;h2 class=&quot;title&quot;&gt;How to maximize return on your social graph&lt;/h2&gt;
+    &lt;p class=&quot;body&quot;&gt;Optimize virality of your crowdsourcing marketing strategy with SEO techniques.&lt;/p&gt;
+  &lt;/div&gt;
+
+  var Post = Class.create(ElementBase, {});
+  var post = new Post($$('.post').first());
+  post.get('title'); //&quot;How to maximize return on your social graph&quot;
+  post.set('body', 'Be a douchebag.');
+
+Elements containing the value for a certain attribute are by default located
+by looking for the first element inside the wrapped element (the post div in
+the example above) having the attribute class name. You can change this by
+overriding the getElementFromSelector method:
+
+  //Require elements to also have the &quot;value&quot; class
+  Post.prototype.getElementBySelector = function(attribute){
+    return this.element.down('.value.'+attribute);
+  };
+
+If you only need to override this for a single attribute, you can define
+a custom element getter method for it:
+
+  //Return the anchor tag inside the .title element
+  Post.prototype.getTitleElement = function(){
+    return this.element.down('.title a');
+  };
+
+These elements are also used for setting values. Getting and setting values
+is implemented using innerHTML, but can be customised by overriding the
+extractValueFromElement and insertValueInElement methods:
+
+  Post.prototype.extractValueFromElement = function(element){
+    return element.innerHTML.replace(/&lt;.*&gt;/, '');
+  };
+  Post.prototype.insertValueInElement = function(element, value){
+    element.innerHTML = value.toUpperCase();
+  };</diff>
      <filename>javascript/base/README</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ca8c311fdd288449ac1fca5be7432924b84833da</id>
    </parent>
  </parents>
  <author>
    <name>Tore Darell</name>
    <email>toredarell@gmail.com</email>
  </author>
  <url>http://github.com/toretore/experiments/commit/be34f2ba22964fdf66d6f82b57d0b1ef59c1d30a</url>
  <id>be34f2ba22964fdf66d6f82b57d0b1ef59c1d30a</id>
  <committed-date>2009-11-09T07:21:26-08:00</committed-date>
  <authored-date>2009-11-09T07:21:26-08:00</authored-date>
  <message>Add ElementBase docs</message>
  <tree>e58aa4df767c329927f5905e87c8656e4e942f48</tree>
  <committer>
    <name>Tore Darell</name>
    <email>toredarell@gmail.com</email>
  </committer>
</commit>
