dom-events

Can you detect when a PDF is printed or downloaded from the browser PDF viewer?

允我心安 提交于 2020-05-25 13:13:50
问题 We have an AngularJS web app that loads PDF documents from the server and displays them within the page like this: <object id="preview" type="application/pdf" data="blob:{fileUrl}"> We have a new requirement to audit whenever a user performs certain actions: views a document (done) prints a document downloads a document The PDF download and print controls are within the browser PDF viewer. We only have to support latest Google Chrome (Chrome 68 as of July 2018). Is it possible to detect when

Can you detect when a PDF is printed or downloaded from the browser PDF viewer?

↘锁芯ラ 提交于 2020-05-25 13:13:05
问题 We have an AngularJS web app that loads PDF documents from the server and displays them within the page like this: <object id="preview" type="application/pdf" data="blob:{fileUrl}"> We have a new requirement to audit whenever a user performs certain actions: views a document (done) prints a document downloads a document The PDF download and print controls are within the browser PDF viewer. We only have to support latest Google Chrome (Chrome 68 as of July 2018). Is it possible to detect when

Make an image draggable inside a container (panning) in react. setState causing trouble

。_饼干妹妹 提交于 2020-05-16 22:05:14
问题 I have an image viewer component with a container that is zoomable with mouse scroll. Have implemented this and it works. the problem I am facing is trying to make the image draggable once its zoomed. The code works as I get some changes in the translate property of the element. On console logging I figured out that the onMouseMove event stops as soon as I update the styles using state. like it only works for an instant. Also since I am new to react I have been recommended not to use refs. is

Make an image draggable inside a container (panning) in react. setState causing trouble

大兔子大兔子 提交于 2020-05-16 22:05:10
问题 I have an image viewer component with a container that is zoomable with mouse scroll. Have implemented this and it works. the problem I am facing is trying to make the image draggable once its zoomed. The code works as I get some changes in the translate property of the element. On console logging I figured out that the onMouseMove event stops as soon as I update the styles using state. like it only works for an instant. Also since I am new to react I have been recommended not to use refs. is

Detect double Ctrl keypress in JS

青春壹個敷衍的年華 提交于 2020-05-13 05:03:51
问题 I have a custom CMS and would like to add a "shortcuts menu" triggered by the pressing of the Ctrl key twice within, say, 300 milliseconds. I use prototype, so my starting point obviously is: Event.observe(document, 'keypress', function(event) { if(event.keyCode == Event.KEY_XYZ) { show_shortcuts}); My approach at the moment would be populating a global variable with the current time in milliseconds, and checking on each keypress whether a keypress has happened less than 300 milliseconds ago.

Detect double Ctrl keypress in JS

倾然丶 夕夏残阳落幕 提交于 2020-05-13 05:03:49
问题 I have a custom CMS and would like to add a "shortcuts menu" triggered by the pressing of the Ctrl key twice within, say, 300 milliseconds. I use prototype, so my starting point obviously is: Event.observe(document, 'keypress', function(event) { if(event.keyCode == Event.KEY_XYZ) { show_shortcuts}); My approach at the moment would be populating a global variable with the current time in milliseconds, and checking on each keypress whether a keypress has happened less than 300 milliseconds ago.

Detect double Ctrl keypress in JS

孤街醉人 提交于 2020-05-13 05:02:51
问题 I have a custom CMS and would like to add a "shortcuts menu" triggered by the pressing of the Ctrl key twice within, say, 300 milliseconds. I use prototype, so my starting point obviously is: Event.observe(document, 'keypress', function(event) { if(event.keyCode == Event.KEY_XYZ) { show_shortcuts}); My approach at the moment would be populating a global variable with the current time in milliseconds, and checking on each keypress whether a keypress has happened less than 300 milliseconds ago.

Triggering a custom event with attributes from a Firefox extension

让人想犯罪 __ 提交于 2020-05-11 07:38:18
问题 I have a Firefox extension that modifies the content of the page that the user is looking at. As part of that process the extension needs to trigger a custom event that the extension itself adds to the page source. I am having difficulties passing parameters to that custom event. What am I doing wrong? Script block inserted into the head of the page: document.addEventListener("show-my-overlay", EX_ShowOverlay, false, false, true); function EX_ShowOverlay(e) { alert('Parameter: ' + e.index); /

clearInterval doesn't clearInterval

扶醉桌前 提交于 2020-04-30 16:32:15
问题 var timer; function check_element_load(){ timer = window.setInterval(function(){ console.log("still working"); // keeps running forever if(document.getElementById("comments")){ console.log("FOUND"); // this actually runs document.getElementsByTagName("fb:comments")[0].setAttribute('order_by', 'social'); window.clearInterval(timer); // < not effective } }, 50); } check_element_load(); I'm trying to put a script on top to keep checking if a specific element was successfully loaded in the

pinch zoom in, zoom out - Javascript/jQuery/jQuery mobile events for web on Android platform?

微笑、不失礼 提交于 2020-04-09 18:40:28
问题 What are the Javascript or jQuery or jQuery mobile events involved in pinch zoom in and zoom out? I am trying to capture those events to zoom in and zoom out of an image which is inside a div without affecting the entire layout of the website. Simplest way to detect a pinch works for iPad but not android. What are the equivalent way to detect the same on Android platform for web? Any help is appreciated. EDIT: I have been trying touchy.js and that works for doing zoom-in and zoom-out for