Commit graph

33 commits

Author SHA1 Message Date
Ian Prest
580b916084 Update to https 2024-09-16 18:15:01 -07:00
Ian Prest
5b972cf6f6 Misc changes, mostly for per-key switch type
-- Switches.json -> now using hash for "switches" for easy lookup
-- Serialization changed so that we use "" for default switch types, and
this round-trips properly.
-- Had to switch from <select> to bootstrap-style dropdowns; when I
started trying to handle the 'default' settings better (i.e., when the
per-key setting was blank), Angular was throwing errors using the
<select> element.
-- Changing switch mount blanks out brand/type, etc.
-- Now disabling switch mount/brand/type controls when appropriate
-- PNG rendering now only doing #keyboard-bg, which allows me to make
#keyboard full-width again.
2015-08-10 21:40:53 -04:00
iandoug
112f82dd87 Cleanup some untidyness.. 2015-08-08 22:00:50 +02:00
iandoug
292624ba1e Added switch settings for each key 2015-08-08 21:55:46 +02:00
Ian Prest
e3b4dd2bb3 Updated switches data to be a bit more descriptive
-- Found part numbers for a few switch types
-- Split switch data into a JS object, rather than a simple string
-- Small tweaks to UI layout
-- When setting mount-type, brand & switch-type are reset
-- When setting brand, switch-type is reset
2015-08-06 22:57:52 -04:00
Ian Prest
8161c430d3 Fix a font-size serialization bug found by iandoug
-- Custom font sizes on first key; second key had font-sizes reset by
changing the 'default' font size.
-- Unfortunately, this was the same as the *original* default font-size,
so we didn't actually write 'f'.
-- Now forcing 'f' out in this scenario.
2015-08-05 22:48:01 -04:00
Ian Prest
dbaa19d600 Fix a serialization issue with text sizes
-- Needed parentheses on one of my conditions in compareTextSizes(); was
returning false more often than necessary, which isn't that bad, but
would cause serialization output to be bigger than necessary sometimes.
-- More problematic was that we wouldn't always write f2/fa during
serialization if it was necessary.
---- Any time 'f' is written, we need to blow away the saved font-array.
---- And any time the font comparison fails, we *have* to write f2/fa,
so the call to serializeProp was wrong.
-- Fixes #104
2015-08-04 22:54:58 -04:00
Ian Prest
ad24eadc87 Implemented keyboard 'decals'
-- Intended to put decorative labels (logos, etc.) on keyboard layouts.
-- They're basically just invisible keycaps; this works pretty well,
since there are already so many formatting options for text on keycaps,
and it saves us from having to manage a completely separate type of
thing.
-- Props to iandoug for the idea!

Also:
-- Disable x2,y2,width2,height2 on decals
-- Increase max keycap size to 18x18 (allows for really large decals)
2015-08-03 23:40:42 -04:00
Ian Prest
4943a246f1 Tweaked serialization to omit background completely when removed 2015-08-03 18:41:30 -04:00
Ian Prest
02875e849b Now removing *all* metadata from raw-data tab 2015-08-03 00:27:59 -04:00
Ian Prest
9992516153 Implement basic file saving -> Gist 2015-08-02 19:27:43 -04:00
Ian Prest
44ab242e1a Increased max file-size for saved layouts to 16kb 2015-08-01 15:45:44 -04:00
Ian Prest
fead76e37d Fixed a small deserialization error with vertical centering (align&2) 2015-07-30 21:28:56 -04:00
Ian Prest
66b278b84d Merge branch 'master' into fully-generic-legends
Conflicts:
	serial.js
	tests/conf.js
	tests/kb-serial.js
2015-07-26 21:04:11 -04:00
Ian Prest
4a8d9a0c37 Fix serialization of text colors & add unit-tests for text colors 2015-07-26 20:38:52 -04:00
Ian Prest
b4c0c6875a Serialization for fully-generic-legends
-- Added tests for legends & text-size
-- Colors currently untested
2015-07-26 20:03:09 -04:00
Ian Prest
50d068b663 Merge remote-tracking branch 'origin/master' into fully-generic-legends 2015-07-26 17:30:24 -04:00
Ian Prest
72564b2765 Testing: Added a very simple serialization test
-- Modified serial.js a little so it could be loaded by the test harness
-- Removed dependency on some Angular/JQuery helper functions
2015-07-26 01:26:44 -04:00
Ian Prest
df91acc938 Remove unnecessary string.prototyp extensions
-- I had another copy of the same thing in extensions.js
2015-07-13 23:32:17 -04:00
Ian Prest
7b5da3b640 Fixed tiny serialization issue
-- Serializer was outputting the text color even if it was the same as
the default.
-- Also, now rounding numbers to four decimal places, so we don't output
numbers like 7.2499999999999.  :)
2015-07-05 15:50:55 -04:00
Ian Prest
3967c99df2 Added an additional 'keyboard name' metadata field. 2015-07-04 23:20:17 -04:00
Ian Prest
3b11c8b9f6 Added metadata fields for "author" and "notes". 2015-07-04 21:38:04 -04:00
Ian Prest
5b063b9b5e Can now set different colors for each text label on a keycap.
-- New color picker (angular-bootstrap-colorpicker)
-- Color picker placed beside each label field.
-- Can also drag & drop from palette to label fields (using
angular-dragdrop).
2015-07-04 01:39:20 -04:00
Ian Prest
103e822313 Fix serialization errors with rotated clusters.
-- If the first row in your layout was rotated, the x & y coordinates
didn't get output correctly.
-- The serializer didn't take into account that *both* x & y are updated
when *either* rx & ry are specified in the output; as a result, it would
mis-calculate the correct x & y coordinates for some rotated keys.
-- Fixes #57 and #61
2015-07-03 19:22:18 -04:00
Ian Prest
3f44b1f866 Added the ability to upload a JSON file.
-- "Upload" button on the raw-data tab
-- Drag & drop to either the raw-data editor, or to the main kb preview
area
2015-07-03 00:42:30 -04:00
Ian Prest
1bb8b02efd Added the ability to download the raw-data as JSON
-- Button on the "Raw Data" tab
-- Data is serialized to (pretty) JSON, then downloaded using
FileSaver.js
2015-07-02 23:20:15 -04:00
Ian Prest
620f0504ea Fix problem where first key always reset itself to 1x1 size.
-- width2/height2 weren't being set, so they had the default (1x1) size
-- Fixes #81.
2015-07-02 17:24:18 -04:00
Ian Prest
250427c4bb Serialization for rotated-clusters. 2013-11-12 22:56:43 -05:00
Ian Prest
b9ff4c651b Started implementation of rotated-cluster support.
-- Each key has a rotation angle, and center of rotation; available in
the editor.
-- Displaying crosshairs in the editor for the center of rotation.
-- Keyboard shortcuts to move CoR, and change angle.
-- Keyboard height is correctly calculated.
TODO:
-- Serialization is still wonky.
-- Can't click on rotated keys to select them.
2013-11-12 22:56:41 -05:00
Ian Prest
084a2e48d2 Speed up kbHeight calculations.
-- Querying the DOM was expensive; now just looping over all the keys.
2013-11-10 15:06:13 -05:00
Ian Prest
23e8f11c8c Refactored the serialization code to make it easier to maintain.
-- All the key defaults are now centralized.
2013-11-10 14:58:28 -05:00
Ian Prest
55e466e8cc Moved the S3 saving code into serial.js. 2013-11-09 23:25:43 -05:00
Ian Prest
cbc4b80d45 Moved serialization routines into their own .js file. 2013-11-09 23:08:08 -05:00