Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

Bold / Italic / Strike / Underline buttons don't work correctly #74

Closed
wants to merge 2 commits into from

Conversation

alanpca
Copy link

@alanpca alanpca commented Jun 12, 2013

  • Fixes Bold / Italic / Strike / Underline buttons don't work correctly #19
  • Problem: addRange or removeAllRanges kills the browser command states.
  • Store cache in commandCache
  • Add updateCommandCache and restoreCommandCache methods
  • Add support for command-with-arg buttons to be in an active state
  • Update command cache when running execCommand
  • Store and then update selected commands when selecting a toolbar
    button
  • Create the command cache by looking up the buttons that are in the
    DOM, set the default value to false

* Problem: `addRange` or `removeAllRanges` kills the browser command states.
* Store cache in `commandCache`
* Add `updateCommandCache` and `restoreCommandCache` methods
* Add support for command-with-arg buttons to be in an active state
* Update command cache when running `execCommand`
* Store and then update selected commands when selecting a toolbar
  button
* Create the command cache by looking up the buttons that are in the
  DOM, set the default value to `false`
* Map multiple hotkeys in a string into single hotkey commands
* Store them in a hash
* When buttons are pressed (`keydown`), compute a string to match them on
* They must match this format:
  * Keys must come in order of modifiers as shown below:
  * <CTRL>+(<SHIFT>+)<KEY> `(shift optional)`
  * <META>+(<SHIFT>+)<KEY>
  * <ALT>+(<SHIFT>+)<KEY>
  * <SHIFT>+<KEY>
  * <KEY> `(i.e. tab)`
* Change `bindHotKeys` to only bind single events for `keydown` and `keyup`
* Re-map the keys into a hash as mentioned above
* Prevent propagation and default if we match a command we're allowed
* Add callback option to test a hotkey to see if it's allowed.
* Add `namsepaceEvents` helper, to create all events with a namespace
* Add default callback for `hotKeyEnabledCallback`
  * returns `true` if a hotkey can execute  browser command
  * takes parameter `command`. i.e. `bold`
@alanpca alanpca closed this Jun 12, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bold / Italic / Strike / Underline buttons don't work correctly
2 participants