Makes H<n> work better when applied to a collapsed seection within a list.
Revert the H<n> commands to use the browser's execCommand in all cases. Remove the quink format block handler but leave the rangy one in to be used as the basis for setting css classes onto selections.
Fix toolbar state indication.
Popup menu as a separate component. Currently almost implemented in the toolbar's style tab in an invisible button at the end. Only single select at present.
This is being done as the existing browser supplied way of multi-select via select/option tags renders a UI that is both very hard to use in some browsers and would also be too big for the toolbar in Chrome. Chrome will always force the size of the multiselect to at least 4 rows (which is a bug). In any case the multiselect component rendered by desktop browsers is really bad to use making it hard to impossible to see what is actually selected. It's much, much better on iOS.
The Quink component attempts to keep existing menu UI and implement multi select in a way more similar to iOS than desktop (without adding another third party library).
Mostly works for applying a single style to the selection.
Currently the style has to be in quink.css and the name of the styles in styles.json. This is poor and needs to be changed.
The apply style button icon is still missing from the toolbar although the button itself works if you know where to look for it.
Move the example qk_h[n] styles from quink.css into a user stylesheet (styles.css) that's kept in the resources directory.
Add a stylesheet manager that reads the user stylesheet and inlines it into the document. It also holds a list of the css classes in the inlined area.
StylesheetMgr no longer a singleton. An instance is created for a stylesheet file and this is then handed into the toolbar. The toolbar uses the stylesheet manager to extract the css classes that are used in the apply styles menu.
Updates to user defined styles file. More simple examples and an explanatory comment.
Add a visible toolbar button for apply styles. Currently using a png that was intended for another purpose altogether.
Add a new query param for a user defined style file (styles).
Create a new example for the user defined styles (styles.html) that uses an example user supplied style file.
Remove the content from resources/styles.css. This is now the example user style file.
Make the apply styles toolbar visible only if there are user supplied styles to apply.
Note that there's probably a general toolbar issue here that the toolbar button might be made visible even if the user supplied toolbar def indicates that it shouldn't be visible. This will also apply to other similar buttons (e.g. submit).
Style menu is still inadequate in that it doesn't show the current state, so toggling the style is done without any indication on the menu.
Extend the styles param so that it can also be a selector for a style node within the document.
Add an example that shows this.
Still not quite right as the StylesheetMgr really ought to allow a selector/url to be passed into the init function which is then used in preference to anything else.
Move invocation point for initApplyStyleMenu to make sure that it works as expected after the toolbar has been reconfigured.
Tidy.
Allow a user stylesheet to be any of: a stylesheet present in the resources directory, a stylesheet present elsewhere with the url specified as the styles url param or finally as a style element within the document whose selector is specified by the styles url param.
Change the way in which a StylesheetMgr object is created to make it more obvious which functions form the external api.
Some reordering of functions in the StylesheetMgr.
Update the styles2 example to show the appropriate toolbar tab on load.
Show the styles tab when the example loads.