How to show spinner while Safari is converting HEIC to JPEG via <input type=file> - webkit

Safari allows you to select HEIC files with
<input type="file" accept="image/jpeg">
and it automatically converts them to JPEG. The conversion could be slow for multiple files on slower machines. I want to fill the waiting time between choosing the files and the firing of the the "onchange" event with a spinner.
I'm able to show a spinner when the user clicks on the input, and hide it when the "onchange" event fires. The problem is that if the user cancels the "Choose files" dialog there is no event.

This might be useful. It checks if something was added to the input field, i.e. a file was selected or not.

Related

VB.NET WebBrowser Control OnClick Event Not Triggering

I'm using Vb.Net to trigger event listeners in a web-browser control, however it only seems to work on some site and not on others...
WebBrowser1.Document.GetElementById("button name").InvokeMember("click")
WebBrowser1.Document.GetElementById("button name").InvokeMember("Onclick")
It works on sites like adf.ly, gmail, google, but not on others.
for example, On the airserver log in website (http://www.airserver.com/Download) it only works for some buttons. The "download for free" and "buy now" buttons all work.
But, the popup (comes up when you press download for free) has a "register for trial" button. I have tried to use these codes, they do not work. (Yes, I have put in my name and email into the required fields)
WebBrowser1.Document.GetElementById("registrButton").InvokeMember("click")
WebBrowser1.Document.GetElementById("registrButton").InvokeMember("Onclick")
I have also looked at the chrome event break-point, it tells me that it a "click" event was triggered.
This is the html code for the button if you are not bothered to go to airserver
<a id="registrButton" class="button register" href="#" onclick="$('#promoRequest').submit();return false;">Register for Trial</a>
It's because it's a pop up (probably ajax and the code is not viewable in the webbrowser).
But the solution is here, use this link would 100% work:
http://www.airserver.com/register/PC
then redirect back to your download page, and do whatever you were doing.

Give focus to text-entry field in prompt in node-webkit

In most browsers, a javascript prompt() gives focus to the text entry field so the user can begin typing immediately.
In node-webkit, a javascript prompt() gives focus to the prompt window, but not the text entry field. The user has to click inside the field before typing.
How can I set the focus to inside the text entry field when using a prompt in node-webkit?
An extensible way is to create your own prompts with a javascript modal window. Many of the common JS frameworks have easy ways of creating a modal window which will give you complete control over the text and inputs being displayed.

PDF creation with page refresh

I have a page with a viewPanel and a dialog. When an item in the viewPanel is clicked, the dialog opens, prompting the user to make changes to that item, and offering them the option to generate a report of the item in PDF format.
At first, I tried putting the PDF creation onto a button, as described here: http://www.eknori.de/2011-10-25/xpages-to-pdf-with-itext/ However, whenever the button is pressed, I get a "NotFoundError: DOM Exception 8" which seems to stem from the dojo JS. So currently I have an alternative whereby the button simply sets some sessionScope variables and opens a pdf.xsp XPage, where the variables are read back and the PDF is created.
The PDF gets created correctly, but it also means that the page that the user is on won't be refreshed to display their new change in the viewPanel. I've tried adding page redirects at the bottom of the XPage which creates the PDF, but with no luck.
So, how can I create a PDF and prompt a user to download it, but also refresh the page that they are currently on?
Are you isseuing an partial refresh on the button to hide your dialog and to execute the code for pdf generation? If so you I think that there is your problem. What you could do is to do a partial refresh on the onClose() method of the dialog to refresh the viewpanel. In the clientside onunload method you could open a so called xAgent which renders the pdf for you in a new window (window.open(pdf.xsp?docid=xxx). Take a look here: NotesIn9: 039 Creating PDF’s with XPages Part 2
Of cours the problem with this approach is that when you have a button / image in yoru viewpanel row that displays if the report has been created is not shown because the xagent runs after the / during the time the viewpanel row is being refreshed.

Add cancel header to the HyperlinkTheme.xml file

Is there is any way to add a cancel event header to the theme file, so that i can configure the user cancellation event and display an appropriate message. so far i am getting a setup failed message even if the user cancelled the installation or any other failure occurred.
You can control the text on the confirmation message box displayed when the user clicks the cancel button. To do so, provide a custom .wxl file and change the ConfirmCancelMessage string. The default is:
<String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
(See the src\ext\BalExtension\wixstdba\Resources\*.wxl files for examples).
However, in wixstdba, when the user clicks the cancel button during Apply(), wixstdba will always go to the failure page. That or the success page are the only two options today. There has been some discussion about extending the failure page to be more customizable but no work has been done on that idea.

Set focus() back to contenteditable

I'm building a mini WYSIWYG editor with a modal window (Twitter Bootstrap) for entering image paths. The workflow is like this:
User is editing something in the contenteditable div and wants to insert an image
User clicks the image button, the modal window opens
User enters some URL into the input field and hit the enter key
Now I'm trying to focus() back to the contenteditable div. Unfortunately it seems not to be focussed, because things like document.execCommand() don't work.
In other words:
How can I bring back the focus() to the contenteditable div after being in an input field?
I have seen a couple of solutions for that, some with big scripts doing some Range/Selection-stuff, but I'm sure there is a much simpler solution for this...
Anyone?