<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,7 @@
     &lt;button id=&quot;trashSelected&quot;&gt;Remove Question&lt;/button&gt;
     &lt;button id=&quot;trashAll&quot;&gt;Remove All&lt;/button&gt;
     &lt;button id=&quot;undo&quot;&gt;Undo&lt;/button&gt;
+    &lt;button id=&quot;redo&quot;&gt;Redo&lt;/button&gt;
   &lt;/div&gt;
   
   &lt;div id=&quot;ballot&quot;&gt;&lt;/div&gt;</diff>
      <filename>Poll Authoring Tool/Resources/ballot-editor.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 // represents a ballot view, containing questions
 var BallotEditor = new Class({
-  sort: null, selected: null, history: [],
+  sort: null, selected: null, history: [], future: [],
   
   initialize: function(view) {
     this.view = $(view);
@@ -48,16 +48,27 @@ var BallotEditor = new Class({
     thing.dispose();
   },
   
-  addHistory: function(data) {
-    if (this.history.length &gt; 150) this.history.shift();
+  addHistoryWithFuture: function(data) {
+    while(this.history.length &gt; 150) { this.history.shift(); }
     this.history.push(data || this.serialize());
   },
   
+  addHistory: function(data) {
+    this.addHistoryWithFuture(data);
+    this.future = [];
+  },
+  
   revert: function() {
-    this.history.pop();
+    this.future.unshift(this.history.pop());
     var last = this.history.getLast();
     if (last) this.loadWithoutHistory(last);
-  }
+  },
+  
+  antirevert: function() {
+    var revived = this.future.shift();
+    this.loadWithoutHistory(revived);
+    this.addHistoryWithFuture(revived);
+  },
 });
 
 
@@ -140,7 +151,7 @@ BallotEditor.Question = new Class({
   serialize: function() {
     return {
       'message': this.elements.message.get('value'),
-      'type': this.elements.pollType.get('value'),
+      'type': this.elements.pollType.get('value').toLowerCase(),
       'options': this.elements.answers.getChildren().map(function(child) {
         return child.get('value').trim();
       }).filter(function(answer) { return answer.length &gt; 0; })
@@ -167,6 +178,7 @@ window.addEvent('load', function() {
   
   var updateUndo = function() {
     undo.disabled = (editor.history.length &lt; 2);
+    redo.disabled = (editor.future.length &lt; 1);
   }
   
   var saveWithoutHistory = function() {
@@ -186,6 +198,7 @@ window.addEvent('load', function() {
     editor.add(new BallotEditor.Question(editor, 
       {&quot;message&quot;: 'New Question', &quot;type&quot;: 'plurality', &quot;options&quot;: []}
     ), 'top');
+    editor.view.getElement('.message').focus();
     save();
   }
   
@@ -205,8 +218,44 @@ window.addEvent('load', function() {
     updateUndo();
   }
   
+  redo.onclick = function() {
+    editor.antirevert();
+    saveWithoutHistory();
+    updateUndo();
+  }
+  
   updateUndo();
   
   document.body.addEvent('unload', save);
   document.body.addEvent('change', save);
+  
+  //window.addEvent('keyup', function(evt) {
+  //  document.title = evt.key;
+  //});
+  
+  // Keyboard based control
+  var keyAccess = new Keyboard({
+    eventType: 'keyup', 
+    active: true,
+    events: { 
+      'ctrl+z': undo.onclick(), 
+      'ctrl+shift+z': redo.onclick(), 
+      'up': function (evt) {
+        var list = $$('input'), thing = list[list.indexOf($(evt.target)) - 1];
+        if (thing) thing.focus();
+      },
+      'down': function(evt) {
+        var list = $$('input'), thing = list[list.indexOf($(evt.target)) + 1];
+        if (thing) thing.focus();
+      },
+      'left': function(evt) {
+        if (evt.target.hasClass('type'))
+          evt.target.getPrevious('.message').focus();
+      },
+      'right': function(evt) {
+        if (evt.target.hasClass('message'))
+          evt.target.getNext('.type').focus();
+      }
+    }
+  });
 });
\ No newline at end of file</diff>
      <filename>Poll Authoring Tool/Resources/script/ballot-editor.js</filename>
    </modified>
    <modified>
      <diff>@@ -137,7 +137,7 @@ textarea {
 	left: 0;
 	right: 0;
 	bottom: 0;
-	overflow: auto;
+	overflow-y: scroll;
 }
 
 #ballot .question {
@@ -148,7 +148,7 @@ textarea {
 
 #ballot .question .bar {
   margin: 10px 10px 0 10px;
-	padding: 5px;
+	padding: 5px 0 5px 5px;
 	background-color: #666666;
 	-webkit-user-select: none;
 	-webkit-border-radius: 5px;
@@ -156,7 +156,8 @@ textarea {
 
 #ballot .question .bar * { vertical-align: middle; }
 #ballot .question .bar .handle { cursor: default; padding: 0 10px 0 5px; }
-#ballot .question .bar .message { width: 299px; margin-right: 5px; }
+#ballot .question .bar .message { width: 300px; margin-right: 5px; }
+#ballot .question .bar .type { width: 120px; }
 
 #ballot .question .answers {
   background-color: #4c4c4c;</diff>
      <filename>Poll Authoring Tool/Resources/style/sheet.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>400a288dec651aa50528d7958ed7573cc5b6bba8</id>
    </parent>
  </parents>
  <author>
    <name>Bluebie the Pony</name>
    <email>blueberry@creativepony.com</email>
  </author>
  <url>http://github.com/GuitarString/Electric-Water/commit/4cdf5fd2249f049b0c1fb8fcd612d3eddeda8fa8</url>
  <id>4cdf5fd2249f049b0c1fb8fcd612d3eddeda8fa8</id>
  <committed-date>2009-10-30T19:06:57-07:00</committed-date>
  <authored-date>2009-10-30T19:06:57-07:00</authored-date>
  <message>Fancy pants 'redo' support to compliment the undo, and the addition of keyboard navigation within the ballot editor. Can now use the arrow keys in there to move around between the various fields for +1 Awesome Speediness of Power.</message>
  <tree>562dbf49dc29d572c0570d3ea51af32d8a32f709</tree>
  <committer>
    <name>Bluebie the Pony</name>
    <email>blueberry@creativepony.com</email>
  </committer>
</commit>
