google / closure-library

Google's common JavaScript library
code.google.com/closure/library/
Apache License 2.0
4.88k stars 1.05k forks source link

goog.editor.Command.EDIT_HTML doesn't work in Closure Editor #1194

Closed shhnjk closed 1 year ago

shhnjk commented 1 year ago

goog.editor.Command.EDIT_HTML button does not seem to work anymore.

Repro:

  1. Add goog.editor.Command.EDIT_HTML in buttons.
  2. While Edit HTML button appears, clicking on it does nothing.

Note: you can test this dynamically by adding break point on buttons in the live demo.

12wrigja commented 1 year ago

https://github.com/google/closure-library/blob/c92fcbdbcc19f88581cd72045d085fd4e0f689e0/closure/goog/demos/editor/editor.html#L85-L96

Just adding the button to the UI is not enough to get a plugin to do something. You would need to figure out which plugin enabled editing HTML (don't think there is one provided in Closure that I can find?), and register it (like the other plugins listed above) in order for the command the button triggers to do anything.

shhnjk commented 1 year ago

Got it, so basically the Closure Editor doesn't provide plugin, and therefore I need to implement one myself.