How to get FILE inserted in DraftJS through CTRL + Z? - draftjs

I'm using DraftJS and it's all working fine, I can save images in my server when user pastes it in the editor, and I can delete then from the server when user for example exits the page without saving the content with the image.
But, if the user inserts an image (now the image is automatically saved in the server), then he erases the image and hit 'save' (now the image is deleted from the server), and then re-inserts the image using CTRL + Z, the image comes back to be displayed in the editor, but at that time I couldn't capture that there was an image inserted, because the image was not pasted.
Currently I can detect pasted files with the handlePastedFiles attribute in the Editor component. But I am not aware of a way to detect files inserted through another way that is not pasting.
I would need to detect the content inserted with CTRL + Z, then get the FILE inside it (not the url), and then send it again to the server.
How could I do this?

Related

Is it possible to move the text cursor/ caret multiple characters at once using C++?

I'm writing an application that pastes strings into any given editor. After selecting something to paste my application programmatically looses focus, giving it to the application that had focus before. It then sends Ctrl+V to the OS to paste it in the other application. I want to be able to set the position of the cursor after pasting. Currently a pasted text will always leave the cursor at the end of the text.
I already tried sending multiple Arrow Left presses to the OS, so for example if I wanted:
Hello $CURSOR_POSITION$World
54321
I would send 5 times ArrowLeft after pasting "Hello World". This is very slow tho as every single Arrow Left key is processed serparetly (moves left about once per second). As the strings can get very long using Ctrl+ArrowLeft to skip entire words does not solve the problem.
I already looked into ANSI-Codes, they only seem to work in consoles though, I want it to work in every editor.
Is there a way to achieve this using C++? Something like moveCursorLeft(5)?
Thanks in advance!

VS Code Extension, how to programme a refresh of PlantUML preview

How can I force PlantUML to refresh its preview, using code?
Longer Explanation
I have 2 editors open
Editor 1 contains a yml file.
Editor 2 contains a plantuml .wsd file
and a 3rd pane is showing the plantuml preview. (which is technically not an editor)
When I modify the yml file, it modifies a json model, and rewrites the .wsd file, and thus I get a new state diagram showing me the structure of my yml file in graph format.
The content of wsd is updating correctly when the yml changes. V1 created a new file each time, it saved fine I could see the content change, but the preview never updated.
Settings->PlantUML auto update is ticked.
In order to trigger the refresh I had to select the editor, and either modify or save.
So I re-wrote the code to select the editor 2 wsd contents, replace it in the existing file, and then save that file. Still the preview does not update.
I have also tried to fire the vscode command plantuml.preview, which is what the plantuml extension itself fires to display the preview, it fires and returns, but does not update the preview.
I have vscode.window.visibleTextEditors[ii], from which I can select the right editor, but I cannot find anything to set the focus. I've tried setting selections, and saving but still no refresh.
I am now trying to find the right vs code way to set the focus on the right editor and save it, then switch back to the left editor, mimicking pressing CMD-2, CMD-S, CMD-1, or manually selecting the editor and saving, which is the only way to update the preview.
I cannot find anything on how to set the editor focus, so perhaps I am going down the wrong path. Can anyone suggest how this could be done?

When html is updated dynamically on a webpage how can I save the generated html so, for example, I can compare it with diff for dubugging?

I want to understand what changes are made to the html of a webpage when I use an image carousel. When I go to the next image in the carousel the html of the page updates. I would like to get a copy of the updated html so I can run diff and compare the changes to the original html.
I am interacting with the webpage through Chrome but only have access to the publicly-available source code at the moment.
I have been using Chrome's Inspect Element panel. In the 'Elements' tab I can see the html changing when I move the carousel to the next image. Despite watching the html update in the 'Elements' tab, each time I try to save the html I can only save the original html at best. Here is what I've tried:
Open 'View Source' and save the source. In hindsight, I realised this fetches the source code fresh instead of loading the source code of the current view I'm looking at.
Save the page directly from the page I'm on.
Go to the 'Sources' tab in 'Inspect Elements' and save from there.
Try to save from the 'Elements' tab directly, but I cannot figure out a way to do this. There is no save option and I cannot select the text to copy and paste.
I've tried Googling and found related-sounding headings but these contained unrelated content.
Tried Firefox's Inspect Element, which at appears to be built on the same functionality. I wonder if it's built on the same engine?
I am using Chrome 84 on Linux Mint 19 but I would be willing to use a different browser or other application that would work on my system.
I hope this is the correct Stack Exchange for this question. I initially looked at webapps.stackexchange but that didn't seem as good a match once I scanned through other questions.
In the 'Elements' tab of Inspect Elements right click on an html tag, for example <html>, and select 'Copy OuterHTML'. Paste the selection into a text editor.
This works with both Chrome and Firefox. Firefox also gives the option to 'Copy InnerHTML'. The difference between the two is that 'OuterHTML' copies the opening and closing tags while 'InnerHTML' only copies the contents within the tags.

opening URL from a file and taking screenshots in UiPath

It's a UI path sequence.
I am trying to read some URLs from an Excel file.
Launch browser
Go to URL from file
Take Screenshot
Save screenshot
I am unable to use the "take Screenshot" activity. Unsure, how can I take the screenshot and save it as a file.
The Take Screenshot activity requires a variable (of type Image). Select the activity first, and in the properties, click on Output. Then, hit CTRL+K to add a new variable (or enter an existing one).
Use the Save Imageactivity to save any variable of type Imageto disk.

TinyMCE past image from MS Word

I need to copy word text with image to my server through copy - paste function. For that purpose, I choose TinyMCE editor.
The editor works fine, when inserting from word just text. It also works fine, when inserting from word just picture (the picture shows in TinyMCE textarea).
However, when I copy paste word text together with image, only the text shows in textarea.
Is there any way around how to solve this issue?
Next problem is, is there a plugin for TinyMCE that would get the link to the image from TinyMCE textarea, when pasting, and save the image on server?
You should have a look at the tinymce paste plugin - this should be able to handle it.