update
This commit is contained in:
parent
ab125d3f47
commit
934854f39f
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -1,7 +1,7 @@
|
||||
[submodule "grapesjs"]
|
||||
path = grapesjs
|
||||
url = lol
|
||||
[submodule "demo"]
|
||||
path = demo
|
||||
url = https://github.com/GrapesJS/grapesjs
|
||||
branch = gh-pages
|
||||
[submodule "grapesjs"]
|
||||
path = grapesjs
|
||||
url = https://github.com/GrapesJS/grapesjs
|
||||
|
@ -1,9 +0,0 @@
|
||||
.red {
|
||||
color: #f24b4b;
|
||||
}
|
||||
.gjs-block {
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-height: auto;
|
||||
}
|
||||
|
1
grapesjs
Submodule
1
grapesjs
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 8893dbe2e79972e5c34806e71075d2e94a4a9e3e
|
1450
index.html
1450
index.html
File diff suppressed because it is too large
Load Diff
63
js/main.js
63
js/main.js
@ -1,63 +0,0 @@
|
||||
import fr from "../grapesjs/src/i18n/locale/fr.js";
|
||||
//const projectID = window.location.hash.substr(1);
|
||||
const projectID = 1;
|
||||
|
||||
if (projectID == '' || isNaN(projectID)) {
|
||||
alert("L’ID de projet est invalide. Cette application ne va pas fonctionner.");
|
||||
} else {
|
||||
const projectEndpoint = `/projects/${projectID}`;
|
||||
var editor = grapesjs.init({
|
||||
container : '#gjs',
|
||||
//plugins: ['grapesjs-preset-webpage', 'customBlocks', 'customTypes'],
|
||||
//components: '<div class="red">Le chargement du projet est en cours. Si ce message ne disparait pas, le chargement a sans doutes échoué…</div>',
|
||||
i18n: {
|
||||
locale: 'fr', // default locale
|
||||
detectLocale: false, // by default, the editor will detect the language
|
||||
//localeFallback: 'en', // default fallback
|
||||
messages: {fr},
|
||||
},
|
||||
storageManager: {
|
||||
type: 'remote',
|
||||
stepsBeforeSave: 1,
|
||||
autosave: true,
|
||||
options: {
|
||||
remote: {
|
||||
urlLoad: projectEndpoint,
|
||||
urlStore: projectEndpoint,
|
||||
fetchOptions: opts => (opts.method === 'POST' ? { method: 'PATCH' } : {}),
|
||||
onStore: data => ({ id: projectID, data }),
|
||||
onLoad: result => result.data,
|
||||
}
|
||||
}
|
||||
},
|
||||
//blockManager: {
|
||||
// appendTo: '#blocks',
|
||||
// blocks: [
|
||||
// {
|
||||
// id: 'section', // id is mandatory
|
||||
// label: '<b>Section</b>', // You can use HTML/SVG inside labels
|
||||
// attributes: { class:'gjs-block-section' },
|
||||
// content: `<section>
|
||||
// <h1>Ho ! Mais c’est un titre !</h1>
|
||||
// <div>Il faut regarder avec le cœur. L’essentiel est invisible pour les yeux. C’est du petit prince ;)</div>
|
||||
// </section>`,
|
||||
// }, {
|
||||
// id: 'text',
|
||||
// label: 'Text',
|
||||
// content: '<div data-gjs-type="text">Voici un bloc de texte tout seul :o</div>',
|
||||
// }, {
|
||||
// id: 'image',
|
||||
// label: 'Image',
|
||||
// // Select the component once it's dropped
|
||||
// select: true,
|
||||
// // You can pass components as a JSON instead of a simple HTML string,
|
||||
// // in this case we also use a defined component type `image`
|
||||
// content: { type: 'image' },
|
||||
// // This triggers `active` event on dropped components and the `image`
|
||||
// // reacts by opening the AssetManager
|
||||
// activate: true,
|
||||
// }
|
||||
// ]
|
||||
//},
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user