Compare commits

..

5 Commits

Author SHA1 Message Date
Adrian Amaglio
bc83e37cdd lets try 2023-08-01 17:53:38 +02:00
Adrian Amaglio
934854f39f update 2023-08-01 17:40:57 +02:00
Adrian Amaglio
ab125d3f47 nomodule 2023-08-01 17:36:27 +02:00
Adrian Amaglio
434e2d9a1b modules 2023-08-01 17:35:27 +02:00
Adrian Amaglio
f6be728c19 temp 2023-08-01 17:26:50 +02:00
9 changed files with 4337 additions and 54 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,7 @@
[submodule "demo"]
path = demo
url = https://github.com/GrapesJS/grapesjs
branch = gh-pages
[submodule "grapesjs"] [submodule "grapesjs"]
path = grapesjs path = grapesjs
url = https://github.com/GrapesJS/grapesjs url = https://github.com/GrapesJS/grapesjs

View File

@ -1,18 +1,16 @@
FROM node:20-alpine FROM node:20-alpine
# Workdir # Workdir
RUN mkdir /usr/local/app RUN mkdir /usr/lib/json-server
RUN chown 33:33 /usr/local/app #RUN chown 33:33 /usr/lib/json-server
WORKDIR /usr/local/app WORKDIR /usr/lib/json-server
ADD entrypoint.sh /usr/local/bin
# Install modules # Install modules
RUN npm install -g json-server RUN npm install -g json-server
USER 33 ADD entrypoint.sh /usr/local/bin
#USER 33
# Cant kill with ctrl+c
#ENTRYPOINT ["/usr/local/bin/json-server", "db.json"]
ENTRYPOINT ["entrypoint.sh"] ENTRYPOINT ["entrypoint.sh"]
CMD ["json-server", "-H", "0.0.0.0", "db.json"] CMD ["json-server", "-H", "0.0.0.0", "/usr/lib/json-server/db.json"]

View File

@ -1,3 +1,9 @@
#!/bin/sh #!/bin/sh
if [ ! -f db.json ] ; then
touch db.json
fi
if [ ! -s db.json ] ; then
echo '{"projects": [ {"id": 1, "data": {"assets": [], "styles": [], "pages": []} } ]}' > db.json
fi
"$@" "$@"

View File

@ -1,3 +0,0 @@
.red {
color: #f24b4b;
}

2875
db.json Normal file

File diff suppressed because it is too large Load Diff

1
demo Submodule

@ -0,0 +1 @@
Subproject commit cb3f311e10fe182301048ffc28ccd9b20b0435ab

@ -1 +1 @@
Subproject commit f8b66a1d7e28b6c156cb7d6c61d2951872e9675f Subproject commit 8893dbe2e79972e5c34806e71075d2e94a4a9e3e

1451
index.html

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +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("LID de projet est invalide. Cette application ne va pas fonctionner.");
} else {
const projectEndpoint = `/projects/${projectID}`;
var editor = grapesjs.init({
container : '#gjs',
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,
}
}
}
});
}