Add buttons to Mathjax dialog and update preview area automtically - ckeditor

I would like to add symbol buttons for Mathjax dialog (symbol buttons are not available for default Mathjax plugin).
As per above image, I have depicted two buttons called Alpha and Beta.
I would like to achieve functionality that whenever user clicks on these buttons a code should be written, like \alpha, in textarea and its preview should be instantly shown just underneath of textarea.
I am able to add Mathjax code to textarea, \alpha but its preview is not being displayed on the spot. I have to press any key to see preview.
I have tried with triggering keyup, keydown, keypress etc kind of events on textarea. But no luck.
Can any body help me out to show preview automatically as soon as button clicks and text added to text area in Mathjax dialog?
I am not getting exact element on which keyup or any other keyboard events are being fired. That's why not able to automatically update Preview section.
Any help would be heartily appreciated.

Related

Odd modal behavior with MaterializeCSS in Firefox

I found a really strange behavior when using a Materialize CSS modal in Firefox (66.0.1). It works fine in Chrome (73.0.3683.86) and MS Edge (where do you find the version?). I'm using Windows 10. It does this with the modal demo in the official Materialize CSS website as well.
The problem seems to start if you display a modal with enough content so that it displays a vertical scrollbar. It needs to have links or buttons to see the problem I will describe. You can simulate this by resizing Firefox so that its vertical height is small enough to make the scrollbar appear. Now close the modal. Then resize the height of Firefox so that the modal will appear without scrollbars. Open the modal and hover over a link or button and any hover effect that should happen, does not. Click once on any link or button and nothing happens. Click a second time and it works properly.
And even odder, after opening the first modal with a scrollbar, you can open the second without a scrollbar and do nothing for about 15 seconds and then the links or buttons will work fine.
When this happened, I tried right-clicking on the button to "inspect the element" in the Firefox Inspector. Instead of getting the button, I got the modal overlay element behind it. Note that when this happens, the overlay is not above the button or any of the modal content. It's not a z-index problem. To see whether it was a problem with the overlay, I added an onOpenEnd() function to the modal options that would remove the overlay as soon as the modal opened. I had the same problem. When I tried again to open it in the inspector, I got whatever was behind the button. So it's almost like the modal isn't even there until I click on the modal first or wait for 15 seconds.
I then tried to add some code to the onOpenEnd() function that would give focus to the button, but no effect with that. I tried tabbing to the button, but that didn't work either.
Just before submitting this I found another piece of the puzzle. As I said, hovering over the buttons when this is happening will not show the usual hover pointer. But if I hover above and a bit to the left of the buttons, the cursor does change. When I click there, the color of the buttons does change like it's been clicked, but the action (closing the modal) does not happen. Hmmmmm....
If you want to test this out, go to the Materialize CSS webisite and open the page for modals. (https://materializecss.com/modals.html) Reduce the vertical size of Firefox so that when you open the demo modal it has a vertical scrollbar. Now close the modal. Resize Firefox back to normal vertical height and open the modal again. Hover over the Agree or Disagree buttons and you won't get the pointer cursor. Try click once and nothing happens. Click again and the modal will close. Or wait the 15 seconds and then the buttons work.
Most of my users will have the modal open for more than 15 seconds so it's not a big problem. But sometimes they will open it just to check something and then want to close it. Sure they can click twice, but I'd rather it work properly. Chrome and Edge work fine. Firefox doesn't. Can anyone think of what is causing this and whether there is anything I can do in my code to make it work properly? Thanks.

How to check if tapped region falls inside a PopUp Control

I am using tap event listener from wp toolkit. In my app I show a pop up screen. I have defined the gesturelister to work on the Grid. In capturing the Tap gesture event, I get the screen coordinates (i.e X and Y) where it happened.
Now i want to know if the Tap happened inside the PopUp control or outside it. How can i achieve this on wp8. I have tried many solutions but none seems to work. Please help on this.
Is the Grid under or over the PopUp Control?
If yes, the solution is pretty simple.
When the click is on the Popup the Grid will not receive it.
When the click is not on the Popup the Grid will receive it.

Is it possible to add animation to Ajax Modal Popup Extender in javascript?

I have an ajax modal popup that animates the popup panel in.
Everything works fine in Firefox et al, but there are a couple of issues in IE8.
1) The text looks grainy (as per when you use a filter with text).
2) Hover state on buttons does not work.
I'm trying to find a solution, but struggling to come up with an answer. Maybe one solution is to try and call animation from javascript rather than place it in the aspx page.
Any ideas?

Mozilla Firefox radio button Issue

I am developing a web application. I used radio buttons for selecting the category as shown in following image.
On Selecting the first radio button hides the Overlay button. On selecting the second radio button shows a button where on click of that i can select the data from overlay.
After clicking on second radio button, if i click on browsers refresh button the option2 is selected by default but the "select From Overlay" is not displayed. This issue is coming in Mozilla Firefox. Can anyone suggest how to solve it?
The value being preserved across the refresh is a convenience feature of forms. In this case, you will need some extra page init script to look at the value on the radio buttons to initialize as if the click happened.
Note: If you refresh with Ctrl+F5, you will generally see the browser will load the page with all the form values from before the refresh tossed out. Your user won't do this, but it illustrates how the browser is juggling your input in an effort to preserve it.

How do I enable/disable my Ribbon Buttons in Outlook

I have an Outlook Add-in created with VSTO. Using the Ribbon Designer I have created a tab with three buttons on it. (Environment: Outlook 2010, .NET 4.0, VSTO latest runtime)
When one of the buttons is pressed a modeless dialog is opened. As long as the user is working on this dialog I do not want him to be able to press the button again. So basically I want to gray out the button till the dialog is closed. How can I do this?
For whatever reason, in the button click handler, if I do this.button1.enabled = false; it is just not working. Am I missing something about the way ribbons work.
Thanks
You need to re-render the control using IRibbonUI.InvalidateControl(controlID) or IRibbonUI.Invalidate(). See MDSN on how to dynamically update the Fluent UI for reference. This is done for performance reasons so that you can change all your Fluent UI settings and then re-render all control changes at once. However, if you are only changing one UI element (as you indicate) this can seem confusing and unnecessary.

Resources