Commit graph

53 commits

Author SHA1 Message Date
Ian Prest
ea0ebdd1f1 Don't force-sync width2/height2 if "stepped" is checked. 2013-11-08 23:41:43 -05:00
Ian Prest
27f11c11a1 Make creation of stepped keycaps more obvious.
1. Added some info to the tooltips.
2. When you check the 'stepped' checkbox, we will modify the
width/width2 values so that they are different (if they are not
already).
-- At the very least, this gives a visual indication that the checkbox
actually *did* something.
2013-11-08 23:33:39 -05:00
Ian Prest
9c685a0132 When inserting new keys, account for both width & width2 of previous cap. 2013-11-08 23:21:05 -05:00
Ian Prest
6b69f167ae Fix closing tags in the text labels. 2013-11-08 22:58:04 -05:00
Ian Prest
d97747bfa7 Fix < characters in the text labels. 2013-11-08 22:56:01 -05:00
Ian Prest
6f1bfebe8b Sanitize any HTML entered into the label fields. 2013-11-08 22:42:58 -05:00
Ian Prest
868529bbf6 Prevent '?' from popping the help dialog on INPUT fields. 2013-10-20 00:08:21 -04:00
Ian Prest
a61273a53b Bumping to version 0.8 and deploying. 2013-10-19 16:14:54 -04:00
Ian Prest
25cca4bb2e A handful of bug fixes.
-- Line spacing was too big on the keycaps (I think it was picking up
the spacing from Bootstrap); fixed in CSS
-- DSA keys were showing the inner-border in the incorrect spot (wasn't
really noticable on the dark colors of Retro DSA); fixed in CSS
-- Replaced custom min/max functions with the correct Math.min, Math.max
functions.
-- The valiation for x/y offsets was too aggressive; for some
oddly-shaped keys, it didn't let you set values that were big enough.
-- Swapped the order of the keylabel tops for the primary & secondary
rectangles.  This ensures that the label is in the same place whether
stepped or not, at the expense of maybe affecting old layouts.
2013-10-19 16:05:53 -04:00
Ian Prest
7ecf426c9c Prevent oddly-shaped keys from being moved off-screen. 2013-10-19 01:53:15 -04:00
Ian Prest
d0835968c2 Split the "Load Preset" menu into two sections.
-- The first section is for true "presets"... standard layouts without
much customization.
-- The second section is for "samples"... these are layouts with more
extensive changes.
2013-10-19 01:27:34 -04:00
Ian Prest
5b6472a5d8 Added support for 'stepped' keycaps. 2013-10-19 01:05:52 -04:00
Ian Prest
6cea462ab8 Render HRs within key legend text.
We've always allowed HTML in the key text, but HRs didn't render... now
I've added styles to render the HR as a string of horizontal-line
characters (which ensures they pick up the correct text-color).
2013-10-18 20:24:15 -04:00
Ian Prest
c3429b909c Support a "secondary" legend size on our caps.
-- Primary size applies to the first cap; secondary size applies to all
other caps
-- If primary is changed, we automatically change the secondary to keep
it in sync; this is *usually* what we want.
-- Some special serialization rules to ensure we don't write out more
data than needed; same rules apply there, if primary is changed,
secondary changes.
2013-10-17 23:57:34 -04:00
Ian Prest
491ccb3c97 Support a 3rd (middle) row of text on the keycaps.
-- Germans have it rough... their caps can include a top, middle, and
bottom legend.
2013-10-17 23:17:50 -04:00
Ian Prest
95be097bc4 Increased number of font sizes available.
-- Used to be 1-5; is now 1-9.
-- DSA used to make size=5 *really* big.  Now that there are more sizes,
DSA no longer has any overrides (so it's back to being a linear
scale)... old size 5 ==> new size 8.
2013-10-15 23:06:32 -04:00
Ian Prest
11695849f6 Fixed keyboard-background field on undo/redo. 2013-10-15 22:43:44 -04:00
Ian Prest
d0ba759ddb Switched to new JSONL parser
The new parser is generated by Jison (a JS parser generator, like
Bison).
-- Modified one of the Jison samples to support our "leniency"
requirement.
-- Added a makefile to build & minify the parser.
-- The new parser also generates better error messages... but they
expect to be displayed in a console.  So I changed the error alert DIV
to use a fixed-width font.
2013-10-15 22:36:51 -04:00
Ian Prest
4225f2f4c7 Bumping version to 0.7 and deploying. 2013-10-14 22:22:07 -04:00
Ian Prest
071087373c Prevent default behaviour on Ctrl+A
-- only seemed to be a problem in FireFox
2013-10-14 22:21:13 -04:00
Ian Prest
84cf6bca7a Added the ability to specify a font size.
-- Using relative sizes within a range of 1-5, default 3.
2013-10-14 21:41:55 -04:00
Ian Prest
30839db662 Can now center text on keycaps.
-- Center in the X and/or Y directions
-- also added a sixth label (front-printed, right-justified)
2013-10-14 21:09:16 -04:00
Ian Prest
d7afb241e2 Fixed a bug when serializing keycap profiles. 2013-10-14 18:07:41 -04:00
Ian Prest
352428b585 Fixed paste to maintain relative position between keys. 2013-10-14 17:03:02 -04:00
Ian Prest
a968dfaa02 Moving multiple keys no longer causes overlaps.
-- If any of the keys would end up with x<0 || y<0, then we abort the
operation.
2013-10-14 14:54:03 -04:00
Ian Prest
f52b2b1a3e Added top/bottom-right text and front-printed text.
-- all labels are separated by \n's in the serialized data; now just
supporting 3 more
-- labels are now stored as an array internally
-- Fixed a bug where inserting a key would say "g:undefined"
-- Fixed a bug where you could have an invalid key selected after
editing the raw data.
2013-10-14 14:08:05 -04:00
Ian Prest
a4935ee37d Support keyboard background colors.
-- Extended serialized format to include metadata.
-- Route access to keyboard keys through a helper function.
-- Added a new editor tab for keyboard properties
-- F2 when no keys are selected goes to kbd-properties tab
-- Single metadata property so far: "backcolor"; sets the background
color of #keyboard

Misc:
-- Moved undo/redo key bindings to the editor... allows undo/redo
hotkeys to work properly in raw data
-- Raw data changes now get logged as a transaction
2013-10-14 11:49:36 -04:00
Ian Prest
b3d76aa6c0 Fixed a bug during deserialization of ghosted keys
-- Previously could never turn off ghosting
-- 'false' values never got propagated.
2013-10-14 02:51:16 -04:00
Ian Prest
9fc55e5d5a Bumping version to 0.6 and deploying. 2013-10-14 02:10:18 -04:00
Ian Prest
a5055e99d5 Can now SAVE layouts to the server.
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.
2013-10-14 02:08:29 -04:00
Ian Prest
ffb0e31498 Mark the keyboard as not-dirty when loading preset. 2013-10-13 21:48:36 -04:00
Ian Prest
35abe57b0b Added the ability to "ghost" a keycap.
-- Ghosted keys are dimmed out
-- This is useful for drawing attention to the *unghosted* keys, while
still presenting them in context.
2013-10-09 23:21:23 -04:00
Ian Prest
374626a794 Reset the dirty flag if the permalink link is clicked. 2013-10-09 22:10:42 -04:00
Ian Prest
ee3b832391 Added a warning when leaving the page.
-- we only prompt if the data is dirty.
2013-10-09 22:06:01 -04:00
Ian Prest
bd576a9d8b Prevent hotkey-invoked copy from emptying the clipboard 2013-10-09 20:56:25 -04:00
Ian Prest
b0d9fdab9e Added copy/paste support.
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.
2013-10-09 20:53:36 -04:00
Ian Prest
5f7e254076 Form now updates properly when keys change.
-- 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.
2013-10-09 19:25:48 -04:00
Ian Prest
4bccc62f87 Keep the location-hash until the layout is changed. 2013-09-29 20:55:44 -04:00
Ian Prest
42bdb576d5 Fix bug when clicking on a swatch.
Strangely, the bug only exhibited itself on FF.
2013-09-29 20:42:23 -04:00
Ian Prest
e9c0155b80 Bumping version to 0.5 and deploying. 2013-09-29 19:36:52 -04:00
Ian Prest
df82610920 Added Shift+J/K to extend selection, and (De-)SelectAll command 2013-09-29 19:26:37 -04:00
Ian Prest
a1b969bb24 SHIFT+click now extends the selection
-- 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.
2013-09-29 18:57:54 -04:00
Ian Prest
a9aff79b49 Allowing ALT everywhere CTRL is allowed.
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.
2013-09-29 18:12:12 -04:00
Ian Prest
3337e45f6a Now using URLON for permalinks.
URLON is a serialization format designed specifically for URLs.  See
more here:
-- http://blog.vjeux.com/2011/javascript/urlon-url-object-notation.html
-- https://github.com/vjeux/URLON
2013-09-29 18:02:56 -04:00
Ian Prest
8b243b11f8 Fix small gap between border and background color. 2013-09-29 17:14:25 -04:00
Ian Prest
1548fdea08 Added basic undo/redo support. 2013-09-29 15:50:45 -04:00
Ian Prest
3077351aab Fixed stupid JS int-->string issue when sorting. 2013-09-27 00:16:27 -04:00
Ian Prest
a4c85ad612 Fix & simplify the next/prev key logic
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.
2013-09-27 00:04:28 -04:00
Ian Prest
9fb3e4978b Added a basic 'help' dialog. 2013-09-26 23:03:52 -04:00
Ian Prest
1ac1f032d8 Better validation of values entered into the form. 2013-09-26 22:14:01 -04:00