Comments (4)
What I've done is to upload photo that are sorted on my server, and at the moment it is not configurable.
I needed to force the plug-in directly from .vue files.
Would be helpful to have an option to indicate our root folder where to place image and then provide that information to the api that store image.
Here is the code I've added to your UnlayerEditor.vue
window.unlayer.registerCallback('image', (file, done) => {
let data = new FormData();
data.append('file', file.attachments[0]);
fetch('/api/upload-unlayer', {
method: 'POST',
headers: {
'Accept': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
},
body: data
}).then(response => {
// Make sure the response was valid
if (response.status >= 200 && response.status < 300) {
return response.json()
}
let error = new Error(response.statusText);
error.response = response;
throw error
}).then(data => done({progress: 100, url: data.url}))
});
from nova-unlayer-field.
That's currently not possible. PRs are very welcome to implement this
from nova-unlayer-field.
Hey @espositodaniele
What exactly do you want to implement for images? I'm exploring options how to improve the package, your input is very welcome.
from nova-unlayer-field.
guys, do you meth this upload functionality?
Also, I couldn't find any documentation for image
callback/event, can you please provide some?
from nova-unlayer-field.
Related Issues (12)
- Use dynamic variables HOT 1
- Array to string conversion HOT 10
- Update to Nova v4 HOT 1
- Question: how to edit stored design/html? HOT 17
- Please make the "Enter fullscreen", "Exit fullscreen" text translatable HOT 1
- Dependency Dashboard
- Not compatible with nova 3.2 HOT 1
- Display mode not working HOT 1
- 'locale' config option is not optional HOT 3
- Error while installing package HOT 4
- Add tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-unlayer-field.