Implemented as a POST upload to AWS/S3.
-- Each layout is a separate file; identified by its MD5 hash
-- No real security to protect against malicious users "erasing"
layouts, but S3 offers versioning.
Also:
-- Added save button on the toolbar.
-- Added load/save alert boxes.
-- Added Ctrl+S hotkey to save.
Couldn't get real access to the clipboard, so we can only copy/paste
within one instance of the app, at the moment.
Also fixed a few undo/redo bugs:
-- after undo/redo, invalid keys were still selected and showing in the
editor
-- A number of transactions didn't do anything, but invoking them would
empty the redo stack; now checking for these conditions before logging
the transaction.
-- Limiting the undo stack to 32 levels, for performance/memory reasons.
-- When I started copying key nodes instead of assigning references
(when I added validation), I caused a problem where the form wouldn't
update when you modified a key outside of the form.
-- This also affected inserting keys, which would insert keys in a
seemingly random place.
-- I'm now properly updating $scope.multi when I modify properties on
the selected keys.
-- I also deleted the findKeyAfter() function (used only in addKeys),
and using the more-robust sortKeys() method.
-- Note that this can be a bit unintuitive sometimes.
-- If works great so long as the range between your last selected key
and the key you clicked on don't overlap. I think this will be the most
common case.
-- If the ranges overlap, a bunch of items will end up being toggled,
which is weird.
Apparently Ctrl+Click isn't allowed on Mac computers (gets translated to
right-click). In order to allow multi-select, etc., on Macs, I'm
checking for Alt everywhere I was previously checking for Ctrl.
I broke the next/prev key logic when I added the input validation; since
$scope.multi is now a *copy* of a key, rather than an actual key, we
can't rely on looking it up in the keys[] array to determine the
most-recently selected key.
-- Added a list of predefined keys to the 'Add Key' dropdown (ISO enter,
etc.), to easily create those keys.
-- Doing our best to simulate mouse-capture (which doesn't exist in
HTML) so that marquee select is a little more usable.