Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 90694fa

Browse files
committed
fixed example, removed logs
1 parent 864c324 commit 90694fa

File tree

5 files changed

+46
-61
lines changed

5 files changed

+46
-61
lines changed

dist/editorjs-codeflask.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/example.html

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<link href="https://fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
77
<link href="assets/demo.css" rel="stylesheet">
88
<script src="assets/json-preview.js"></script>
9+
<script src="example_data.js"></script>
910
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
1011
</head>
1112
<body>
@@ -105,47 +106,7 @@
105106
// n/a
106107

107108
},
108-
data: {
109-
"blocks":[
110-
{
111-
"type":"header",
112-
"data":{
113-
"text":"Example : @calumk/editorjs-codeflask ",
114-
"level":3
115-
}
116-
},
117-
{
118-
"type":"paragraph",
119-
"data":{
120-
"text":"This is an example of using EditorJs, with the @calumk/editorjs-codeflask package"
121-
}
122-
},
123-
{
124-
"type":"delimiter"
125-
},
126-
{
127-
"type" : "code",
128-
"data" : {
129-
"code" : "// example\n// This is an example of codeflask\n",
130-
"language" : "javascript"
131-
}
132-
},
133-
{
134-
"type" : "code",
135-
"data" : {
136-
"code" : "// example\n%Q0.0 := TRUE;\n",
137-
"language" : "iecst",
138-
"showlinenumbers" : false
139-
}
140-
},
141-
{
142-
"type" : "code",
143-
"data" : {
144-
"code" : "// minimal example \n// This is an example of codeflask with only the code setting\n"
145-
}
146-
},
147-
]
148-
},
109+
data: example_data, // Imported from example_data.js
149110

150111

151112
onReady: function(){

example/example_data.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
let example_data = {
2+
blocks: [
3+
{
4+
type: "header",
5+
data: {
6+
text: "Example : @calumk/editorjs-codeflask ",
7+
level: 3,
8+
},
9+
},
10+
{
11+
type: "paragraph",
12+
data: {
13+
text: "This is an example of using EditorJs, with the @calumk/editorjs-codeflask package",
14+
},
15+
},
16+
{
17+
type: "delimiter",
18+
},
19+
{
20+
type: "code",
21+
data: {
22+
code: "// example\n// This is an example of codeflask!\n",
23+
language: "javascript",
24+
},
25+
},
26+
{
27+
type: "code",
28+
data: {
29+
code: "// example\n%Q0.0 := TRUE;\n",
30+
language: "iecst",
31+
showlinenumbers: false,
32+
},
33+
},
34+
{
35+
type: "code",
36+
data: {
37+
code: "// minimal example \n// This is an example of codeflask with only the code setting\n",
38+
},
39+
},
40+
],
41+
};

example/example_json.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/codeflask.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
* @param {boolean} readOnly - read only mode flag
7070
*/
7171
constructor({data, config, api, readOnly}) {
72-
console.log(data)
72+
// console.log(data)
7373
this.api = api;
7474
this.readOnly = readOnly;
7575

@@ -103,7 +103,7 @@
103103
this.data.showlinenumbers = (data.showlinenumbers === undefined) ? true : data.showlinenumbers;
104104
this.data.editorInstance = {}
105105

106-
console.log(this.data)
106+
// console.log(this.data)
107107

108108
}
109109

0 commit comments

Comments
 (0)