From 5b972cf6f698749b078d8af698390c39fdfaa12f Mon Sep 17 00:00:00 2001 From: Ian Prest Date: Mon, 10 Aug 2015 21:40:53 -0400 Subject: [PATCH] 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 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. --- extensions.js | 2 +- kb.css | 29 +++++++++++ kb.html | 95 +++++++++++++++++++----------------- kb.js | 11 ++++- serial.js | 25 +++++----- switches.json | 130 +++++++++++++++++++++++++------------------------- 6 files changed, 166 insertions(+), 126 deletions(-) diff --git a/extensions.js b/extensions.js index b91458d..ee1e83a 100644 --- a/extensions.js +++ b/extensions.js @@ -112,7 +112,7 @@ }; // Polyfill for HTMLCanvasElement.toBlob, which is currently only available on Firefox - if (!HTMLCanvasElement.prototype.toBlob) { + if (typeof(HTMLCanvasElement) !== 'undefined' && !HTMLCanvasElement.prototype.toBlob) { Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', { value: function (callback, type, quality) { var binStr = atob( this.toDataURL(type, quality).split(',')[1] ), diff --git a/kb.css b/kb.css index 2ebf674..6cc3ae3 100644 --- a/kb.css +++ b/kb.css @@ -308,3 +308,32 @@ for i in (1..9) { line-height: 1.5; border-radius: 3px; } + + +.dropdown-fixedwidth { + width:110px; + max-width:110px; + height: 26px; +} +.dropdown-fixedwidth>:first-child { + display: block; + left: 5px; + width: calc(100% - 12px); + text-align: left; + overflow: hidden; +} +.dropdown-fixedwidth .caret { + display: block; + position: absolute; + right: 5px; + top: 11px; +} + +.dropdown-select { + max-height: 40vh; + overflow-y: auto; +} + +.dropdown-fixedwidth:disabled { + background-color: #eee !important; +} \ No newline at end of file diff --git a/kb.html b/kb.html index 212df36..c7ae18f 100644 --- a/kb.html +++ b/kb.html @@ -193,7 +193,7 @@ Nav Bar / Header -
- - - +
-
- + + +
+
+ + +
-
- +
+
+ + +
-
- +
+
+ + +
+
@@ -601,7 +606,7 @@ Nav Bar / Header
-