-
-
Notifications
You must be signed in to change notification settings - Fork 81
Copy and Paste
Sebastian Rettig edited this page Apr 11, 2020
·
1 revision
- Copy & Paste is not done using the system clipboard but with a custom mechanism. That's why it won't work across sites.
- Copying content serializes the params and metadata into an object, which can be later pasted.
- Pasting doesn't do specific things in the backend at all. What it does is just add new content to the editor like it normally would.
- When a file reference is copied into the clipboard, the h5p editor client checks if the file is part of saved content. If it is, the file reference in the clipboard is be changed into an relative path like '../contentId/images/xxx.jpg'. This is the path that is used in params.
- The file reference from above is cloned when the user hits 'save'. The backend looks for paths with relative paths, clones these files and changes the paths.
- In order to get 4 working, the contentId must be passed correctly to the h5p editor client.