HTML: Is it possible to create popup after a drag and drop of a file for upload? - html

I'm working on a webapp that is not AJAX-based. I have implemented a drag and drop functionality for file uploads but, as expected, the transfer gets cancelled if the user clicks on any link. Is it possible to create a drag and drop functionality so that a popup is created and the file transfer is handled in that window, letting the user continue using the webapp?

Yes, there is a function in JQuery which detects ondrop events and lets you run function while true(detects ondrop)
using jquery .on for drop events when uploading files from the desktop?
u can read more about it here, maybe it wil help

Related

How track data with Angular and Google Analytic?

I work on a one single page application (360 virtual visit) with Angular 11. I would like to track user events and especially on buttons.
I started to put the Global site tag in my Index.html file like this: Global Site tag in Index.html
On google analytic, I receive connection data user First Data User
But I have no idea how I can track bouton click with Angular.
Does anyone have an idea that works today ?
do not hesitate to ask me questions for more information. :D
Thank you in advance for your answers. I would share my progress.
For something like Button Clicks, you have to configure custom events in Google Analytics and push that custom event whenever user clicks the button.
You can create onButtonClick() function and call it when user clicks the button. In the function, you should push event to the window.dataLayer:
onButtonClick() {
window.dataLayer.push({
event: 'button_click',
data: {
user: this.current_user._id,
... // Send some custom data that you want to track
}
})
}
You should be careful with SPA when you install gtag the way it is described into docs as it will track page views incorrect. In SPA browser loads the page only once, and all other actions will rerender the content but it still will not be counted as a views.
Instead you will need to set up router events. Here is a great tutorial for that. It also will explain how to set up other events like button clicks.
By the way in the example above they suggest to send user id with event. Instead of it you may send it with config only once, and it will be automatically added to any your event:
gtag('config', 'GA-ID', {
page_path: event.urlAfterRedirects,
user_id: this.user.id
});
You need to configure the Google tag manager to send events to Google Analytics. I've written a post about it: https://pieterjandeclippel.medium.com/angular-or-react-or-whatever-and-google-analytics-97342c909e61
Now it seems that Universal analytics will be on its way out, so you might want to try GA4 instead.
But I haven't tried with that one yet, since my own website has been configured to use UA.
We've added the same feature recently and this guide here, albeit a bit dated, explains it quite well.
It boils down to you using a dedicated GoogleAnalyticsService that enables you track specific events (ie. button clicks, scroll events, etc).

How to show the upload file dialog on page load

Using PF10 (in a JoinFaces project), I'd like the Upload File dialog for choosing a file to show up when the page loads (i.e., without waiting for the user to click on the Choose button of <p:fileUpload/>). How can I do that?
You could use client side API show() function for this. But it seems more and more browsers are blocking triggering a click by script on an input type="file". See https://github.com/primefaces/primefaces/issues/7772
You could take your chances and try to hijack a mouse move event to trigger a click on the upload input, which is answered on this question: In JavaScript can I make a "click" event fire programmatically for a file input element? But I don't really like that hack.

Drag and drop image onto Google Doc in IFRAME sandbox mode

I'm working on a plugin where we rely on the user's ability to drag-and-drop an image from our Google Docs plugin sidebar to their current Google Document, inserting it in the document when they drop.
This has worked fine up till now using HtmlService.SandboxMode.NATIVE, as the browser implements this natively, but that sandbox mode will soon be sunsetted in favor of HtmlService.SandboxMode.IFRAME.
In iFrame sandbox mode, this no longer works, as dragging and dropping between iFrames is disallowed by browser security.
I initially thought we might be able fake this by catching an event on drop, and inserting the image at the user's cursor location, but we're not getting any events for the drag and drop over the document.
It doesn't look like window messaging is an option.
Has anyone dealt with this or a similar situation?
Any insight into how we might either
a) make drag and drop work, or
b) fake it?

Add button to favorites page within my app. WP 8

I have a panorama sound app with buttons that play sounds. How can I use a Hold event to allow user to save their favorite sound buttons to the Favorites page? I can do the Hold event but have no clue where to go from there as far as saving/copying the button as well as no clue how to handle isolated storage.
For Isolated storage look at these to links:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj714090(v=vs.105).aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286408(v=vs.105).aspx
And for the hold event you can look at this question:
Hold Event Longlistselector

How to trigger "share via" menu popup as3

I build android app with as3.
I need to create a button which will trigger the native share via menu, so i will be able to let the user share the link to my game.
Haven't tried it myself, but apparently this might do the job:
https://github.com/mr-archano/Android-AIR-Extensions