Usability improvement for autoimplementation.html
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 12 May 2011 12:20:26 -0600
changeset 107 7b65be873827
parent 106 1afdd066499b
child 108 b8f82a441162
Usability improvement for autoimplementation.html
autoimplementation.html
--- a/autoimplementation.html	Thu May 12 12:04:42 2011 -0600
+++ b/autoimplementation.html	Thu May 12 12:20:26 2011 -0600
@@ -1497,8 +1497,19 @@
 		var button = document.createElement("button");
 		specCell.lastChild.lastChild.appendChild(button);
 		button.textContent = "Store new result";
+		button.className = "store-new-result";
 		button.onclick = (function(key, val, button) { return function() {
 			localStorage[key] = val;
+			// Make it easier to do mass updates, and also to jump to the next
+			// new result
+			var buttons = document.getElementsByClassName("store-new-result");
+			for (var i = 0; i < buttons.length; i++) {
+				if (button == buttons[i]
+				&& i + 1 < buttons.length) {
+					buttons[i + 1].focus();
+					break;
+				}
+			}
 			button.parentNode.removeChild(button);
 		} })(key, newValue, button);
 	} else {