aboutsummaryrefslogtreecommitdiffstats
path: root/src/sidebar.ts
AgeCommit message (Collapse)Author
2019-06-10Add license (GNU GPLv3+)Teddy Wing
2019-05-01Rename 'gmail_css_class' to 'gmail_selectors'Teddy Wing
Since I'd like to put non-class selectors in this module now.
2019-05-01sidebar.ts: Add comment showing command keysTeddy Wing
2019-05-01sidebar.ts: Extract multi-key shortcut command codeTeddy Wing
Make the multi-key command generic so that it works with other commands, not just `\m`. Use the array equality method from Abhi (https://stackoverflow.com/users/2968762/abhi) on Stack Overflow: https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript/19746771#19746771
2019-05-01sidebar.ts: Extract `key_codes` to moduleTeddy Wing
Move this to a separate module as we'll probably want to use the same dictionary of key codes to make other shortcuts. Also fix some syntax while we're at it.
2019-05-01Add shortcut to toggle the left sidebarTeddy Wing
Map sidebar toggle to `\m`. Initialise the code after a timeout to account for Gmail's initial loading screen. Needed to use an `as HTMLElement` cast in order to get the code to compile: https://github.com/Microsoft/TypeScript/issues/16920 src/sidebar.ts:10:5 - error TS2740: Type 'Element' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 110 more.
2019-05-01Use CommonJS modules, fix importsTeddy Wing
* Use single quotes * Add 'sidebar.ts' to main * Fix `SIDEBAR` import from 'gmail_css_class.ts' * Remove ".ts" extensions from imports * Build to 'build/' directory instead of a file. This creates one JS file per module by the Typescript compiler.
2019-05-01Move Gmail CSS class definitions to a new moduleTeddy Wing
Allow them to be used for a new Sidebar module that will enable sidebar toggling. Had to switch the compiled module system to `amd` because of this error message: tsconfig.json:3:3 - error TS6082: Only 'amd' and 'system' modules are supported alongside --outFile. Thinking I'm going to switch to Typescript namespaces to save myself the trouble of using a 'require' library for the AMD modules.