Is it possible to use / extend the Clipboard servi...
# help-with-umbraco
h
Hi all, working on a bit of a POC for a new editor experience using EditorJS (piggybacking a little of the work Dave & Lee had started a while back) - wanted to explore the possibility of storing editor progress or content in the Umbraco Clipboard. I know there is a clipboard service, but I can't find any documentation or way to extend this. Any pointers?
s
I am not sure it's meant for any of that, but since I can see there's a few options of types of things to store on the clipboard it COULD work.. not sure, maybe have a look at this PR and get some inspiration: https://github.com/umbraco/Umbraco-CMS/pull/8809 The
clipboardService
should be injectable like any other service in angularjs.
h
Thanks @Sebastiaan - I'll take a look at this, might be a no go for our use case but would be great to utilise in built functionality
n
h
Ahhh interesting Nathan thank you. Will take a poke around. Would that just work OOTB with custom property editors?! 🤔 or does it need some kind of customisation?
l
Hi Luke 👋 If you don't go down the Preserver package route, then I'd suggest looking at using the
localStorageService
instead of the
clipboardService
- ultimately they both store data in the browser's localStorage, but last time I used the
clipboardService
it had some restrictions (for elementTypes), as Seb mentions and linked to. API reference for `localStorageService`: https://github.com/grevory/angular-local-storage#api-documentation With regards to EditorJS, I'd be interested to hear how you get on with it. Linking to my previous efforts (for reference): https://github.com/mindrevolution/umbraco-editorjs (The gotchas we faced at the time were trying to extend the plugins to work with Umbraco media, etc. and a general feeling that we were starting to compete with Block List).
h
Thanks @leekelleher - super useful, Bege has had a stab at it at this end and seemingly has a rough POC working reasonably well with the media library etc. Will definitely check out the localStorageService too as might also be suitable (I wasn't aware it exists in truth) - thank you all 🙏 Once I have something a bit more concrete to share I'll throw it in front of your respective eyes 😂
n
Honestly, I haven't touched it in ages, no idea how it works with block based editors etc
2 Views