-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
93 lines (86 loc) · 3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Grapesjs Firebase Storage</title>
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<link href="https://unpkg.com/grapesjs-template-manager/dist/grapesjs-template-manager.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs-template-manager"></script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.6.2/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.2/firebase-storage.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.2/firebase-firestore.js"></script>
<style>
body,
html {
height: 100%;
margin: 0;
}
</style>
</head>
<body>
<div id="gjs" style="height:0px; overflow:hidden">
<div style="margin:100px 100px 25px; padding:25px; font:caption">
This is a demo content from _index.html. You can use this template file for
development purpose. It won't be stored in your git repository
</div>
</div>
<script type="text/javascript">
window.editor = grapesjs.init({
height: '100%',
container: '#gjs',
showOffsets: true,
fromElement: true,
noticeOnUnload: false,
storageManager: false,
assetManager: {
embedAsBase64: 0,
},
storageManager: {
type: 'firestore'
},
plugins: ['grapesjs-firebase-storage', 'grapesjs-template-manager'],
pluginsOpts: {
'grapesjs-firebase-storage': {
firebaseConfig: { /* Firebase options */ }
}
}
});
// Running commands from panels
const pn = editor.Panels;
const panelOpts = pn.addPanel({
id: 'options'
});
panelOpts.get('buttons').add([{
attributes: {
title: 'Open Templates'
},
className: 'fa fa-file-o',
command: 'open-templates', //Open modal
id: 'open-templates'
}, {
attributes: {
title: 'Save As Template'
},
className: 'fa fa-archive',
command: 'save-as-template', //Save page as template
id: 'save-as-template'
}, {
attributes: {
title: 'Delete Template'
},
className: 'fa fa-trash-o',
command: 'delete-template', //Delete open page or template
id: 'delete-templates'
}, {
attributes: {
title: 'Take Screenshot'
},
className: 'fa fa-camera',
command: 'take-screenshot', //Take an image of the canvas
id: 'take-screenshot'
}]);
</script>
</body>
</html>