Add a toolbar.#46
Conversation
This make the toolbar from the PG `mqeditor` an internal toolbar for the library. This makes some things cleaner. In particular, all of the options that were added to make the toolbar work externally are no longer needed (blurWithCursor, textFieldEnter, and textFieldExit) and were removed. The things those options were used for can be dealt with internally. Note that Bootstrap need to be loaded in the page since the toolbar uses Bootstrap tooltips, popovers, and buttons. Also the following screen reader issues that were fixed. * The result of typing an auto command was not being voiced. * If a toolbar button that inserts a LaTeX command is used its result was not voiced. * When a select occurs clear the textarea value in the next tick after setting it and selecting the textarea contents. This prevents screen readers from announcing its contents in the case that selection occurs when the input is focused. Also remove the browser highlight styles for selections. The browser styles conflict with the other styles in some browsers and don't look good. (I noticed that this was done in the Desmos code as well.)
| <a href="http://docs.mathquill.com/en/latest/Getting_Started/" | ||
| >MathQuill’s Getting Started Guide</a | ||
| > |
There was a problem hiding this comment.
This feels off. Should this be:
<a href="http://docs.mathquill.com/en/latest/Getting_Started/">
MathQuill’s Getting Started Guide
</a>
There was a problem hiding this comment.
That is what prettier did with it. It does that because that avoids adding whitespace nodes in the resulting HTML. I changed it to what you suggested, since it really doesn't matter if whitespace nodes are added.
There was a problem hiding this comment.
Ahh, didn't consider the white space would be preferable inside the tag than out of it. I guess for some tags it might matter.
This is just something I have been wanting to do for a while. I like Dart Sass and scss so much better than less. It is the more popular library, and is generally more versatile. Also add links to all testing pages on the index page of the developement server. The `README.md` says they are there.
c571827 to
5a24261
Compare
|
Just some things I've noticed, not directly related to this PR though. In demo.html, the example to put math between Should the subscript/superscript button create a box for base and subscript or superscript if there is no input? This isn't new behavior, but I know some inputs would put boxes in place. |
|
I wanted to test positing of the menu for inputs in the middle of a page, but the option to enable/disable menu is not present on either the demo or visual test inputs. |
Those have always been that way. Those use the
I don't know what you really mean with this? |
|
The toolbar is only enabled on the |
|
For testing an input in the middle, test this with PG. I gave instructions for doing so in openwebwork/pg#1417. |
Maybe the buttons can still work if there is no input, entering a What I was expecting to happen was when that button was hit with no input, putting the cursor in the superscript or subscript location and then an empty blue box in the base to signify it was missing / needed to be filled in. |
|
Checking what WebAssign does, it doesn't ever put an 'empty box' in the base, but will input the Again, not part of this PR, and I don't really use the toolbar, just something I noticed that was different from other toolbars I've seen. |
|
I see what you mean. The behavior is what we decided on. Note that if you uncheck the |
These are changes needed to use the new internal toolbar implemented in openwebwork/mathquill#46. To test this you need to use that branch. Clone that branch somewhere on the webwork2 server, and then in the directory of that clone execute ```bash npm ci npm run build npm link ``` Then in the `pg/htdocs` directory run `npm link @openwebwork/mathquill`. After doing so if you look at `pg/htdocs/node_modules/@openwebwork/mathquill` you will see that it is now a link to the MathQuill clone above. Execute `npm ci` again to reset that back to the currently published MathQuill version. Once openwebwork/mathquill#46 is merged, I will publish it and add it to this pull request. So don't merge this pull request until then.
This make the toolbar from the PG
mqeditoran internal toolbar for the library. This makes some things cleaner. In particular, all of the options that were added to make the toolbar work externally are no longer needed (blurWithCursor, textFieldEnter, and textFieldExit) and were removed. The things those options were used for can be dealt with internally. Note that Bootstrap need to be loaded in the page since the toolbar uses Bootstrap tooltips, popovers, and buttons.Also the following screen reader issues that were fixed.
Also remove the browser highlight styles for selections. The browser styles conflict with the other styles in some browsers and don't look good. (I noticed that this was done in the Desmos code as well.)
Convert less to scss. This is just something I have been wanting to do for a while. I like Dart Sass and scss so much better than less. It is the more popular library, and is generally more versatile.
Also add links to all testing pages on the index page of the developement server. The
README.mdsays they are there.