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

  • Context: JavaScript 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Image Work
Click For Summary

Discussion Overview

The discussion centers around the mechanics of pasting images into a post on Physics Forums, specifically focusing on the technical implementation and functionality of the Post Composer. It touches on aspects of web development, particularly JavaScript and the Froala editor.

Discussion Character

  • Technical explanation, Exploratory

Main Points Raised

  • One participant describes the process of pasting an image, noting that it becomes visible immediately in the Post Composer after copying from the desktop or another web page.
  • Another participant suggests that JavaScript is likely responsible for accessing clipboard data to create an IMG element dynamically and send the image data to the PF server, including the creation of a thumbnail version.
  • A third participant identifies the editor used for the post composition as Froala, providing a link for further reference.

Areas of Agreement / Disagreement

Participants do not express disagreement, but the discussion remains exploratory without a definitive conclusion on the technical implementation details.

Contextual Notes

There are assumptions regarding the functionality of JavaScript and the Froala editor that are not fully explored or validated in the discussion.

Swamp Thing
Insights Author
Messages
1,048
Reaction score
799
TL;DR
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!
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
10
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K