JavaScript How does pasting an image work, e.g. when composing a PF post?

  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Image Work
AI Thread Summary
The discussion focuses on the functionality of pasting images directly into a post composer, highlighting that images become visible immediately upon pasting from the desktop or another web page. The conversation suggests that JavaScript is capable of accessing clipboard data to dynamically create an IMG element and send the image data to the server, along with generating a thumbnail version. There is a request for coding guidance on implementing these functions, specifically addressing the Froala WYSIWYG editor.
Swamp Thing
Insights Author
Messages
1,032
Reaction score
769
TL;DR Summary
How to implement this thing where you can paste an image when composing a post on Physics Forums?
I have pasted the image below after copying it from my desktop. The image becomes visible in the Post Composer as soon as you paste it. It also works if you copy from another web page.

I assume that JavaScript is able to grab the data from the clipboard and create an IMG element on the fly, and also send the IMG data to the PF server. It can also create a thumbnail version.
How to code these functions?
1564358555005.jpeg
 
Technology news on Phys.org
Thanks!
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...
Back
Top