54
54
< script src ="/bower_components/froala-wysiwyg-editor/js/plugins/save.min.js "> </ script >
55
55
< script src ="/bower_components/froala-wysiwyg-editor/js/plugins/table.min.js "> </ script >
56
56
< script src ="/bower_components/froala-wysiwyg-editor/js/plugins/video.min.js "> </ script >
57
+ < script src ="/bower_components/froala-wysiwyg-editor/js/plugins/edit_in_popup.min.js "> </ script >
57
58
<!-- End Froala -->
58
59
59
60
< link rel ="stylesheet " href ="./app.css ">
@@ -70,7 +71,7 @@ <h2>Sample 1: Save to disk</h2>
70
71
</ div >
71
72
< script >
72
73
$ ( function ( ) {
73
- $ ( '#edit' ) . froalaEditor ( {
74
+ var editor = new FroalaEditor ( '#edit' , {
74
75
75
76
imageUploadURL : '/upload_image' ,
76
77
imageUploadParams : {
@@ -87,9 +88,9 @@ <h2>Sample 1: Save to disk</h2>
87
88
imageManagerDeleteMethod : "POST" ,
88
89
89
90
videoUploadURL : '/upload_video' ,
90
- } )
91
+ } ) ;
91
92
// Catch image removal from the editor.
92
- . on ( 'froalaEditor.image.removed' , function ( e , editor , $img ) {
93
+ editor . events . on ( 'froalaEditor.image.removed' , function ( e , editor , $img ) {
93
94
$ . ajax ( {
94
95
// Request method.
95
96
method : "POST" ,
@@ -108,8 +109,8 @@ <h2>Sample 1: Save to disk</h2>
108
109
. fail ( function ( err ) {
109
110
console . log ( 'image delete problem: ' + JSON . stringify ( err ) ) ;
110
111
} )
111
- } )
112
- . on ( 'froalaEditor.video.removed' , function ( e , editor , $video ) {
112
+ } ) ;
113
+ editor . events . on ( 'froalaEditor.video.removed' , function ( e , editor , $video ) {
113
114
$ . ajax ( {
114
115
// Request method.
115
116
method : "POST" ,
@@ -128,10 +129,10 @@ <h2>Sample 1: Save to disk</h2>
128
129
. fail ( function ( err ) {
129
130
console . log ( 'video delete problem: ' + JSON . stringify ( err ) ) ;
130
131
} )
131
- } )
132
+ } ) ;
132
133
133
134
// Catch image removal from the editor.
134
- . on ( 'froalaEditor.file.unlink' , function ( e , editor , link ) {
135
+ editor . events . on ( 'froalaEditor.file.unlink' , function ( e , editor , link ) {
135
136
136
137
$ . ajax ( {
137
138
// Request method.
@@ -163,7 +164,7 @@ <h2>Sample 2: Save to disk (resize on server)</h2>
163
164
</ div >
164
165
< script >
165
166
$ ( function ( ) {
166
- $ ( '#edit-resize' ) . froalaEditor ( {
167
+ var editor2 = new FroalaEditor ( '#edit-resize' , {
167
168
168
169
imageUploadURL : '/upload_image_resize' ,
169
170
imageUploadParams : {
@@ -178,9 +179,9 @@ <h2>Sample 2: Save to disk (resize on server)</h2>
178
179
imageManagerLoadURL : '/load_images' ,
179
180
imageManagerDeleteURL : "/delete_image" ,
180
181
imageManagerDeleteMethod : "POST"
181
- } )
182
+ } ) ;
182
183
// Catch image removal from the editor.
183
- . on ( 'froalaEditor.image.removed' , function ( e , editor , $img ) {
184
+ editor2 . events . on ( 'froalaEditor.image.removed' , function ( e , editor , $img ) {
184
185
$ . ajax ( {
185
186
// Request method.
186
187
method : "POST" ,
@@ -202,7 +203,7 @@ <h2>Sample 2: Save to disk (resize on server)</h2>
202
203
} )
203
204
204
205
// Catch image removal from the editor.
205
- . on ( 'froalaEditor.file.unlink' , function ( e , editor , link ) {
206
+ editor2 . events . on ( 'froalaEditor.file.unlink' , function ( e , editor , link ) {
206
207
207
208
$ . ajax ( {
208
209
// Request method.
@@ -234,7 +235,7 @@ <h2>Sample 3: Save to disk with custom validation: Images must be squares (width
234
235
</ div >
235
236
< script >
236
237
$ ( function ( ) {
237
- $ ( '#edit-validation' ) . froalaEditor ( {
238
+ var editor3 = new FroalaEditor ( '#edit-validation' , {
238
239
239
240
imageUploadURL : '/upload_image_validation' ,
240
241
imageUploadParams : {
@@ -252,9 +253,9 @@ <h2>Sample 3: Save to disk with custom validation: Images must be squares (width
252
253
imageManagerLoadURL : '/load_images' ,
253
254
imageManagerDeleteURL : "/delete_image" ,
254
255
imageManagerDeleteMethod : "POST"
255
- } )
256
+ } ) ;
256
257
// Catch image removal from the editor.
257
- . on ( 'froalaEditor.image.removed' , function ( e , editor , $img ) {
258
+ editor3 . events . on ( 'froalaEditor.image.removed' , function ( e , editor , $img ) {
258
259
$ . ajax ( {
259
260
// Request method.
260
261
method : "POST" ,
@@ -273,10 +274,10 @@ <h2>Sample 3: Save to disk with custom validation: Images must be squares (width
273
274
. fail ( function ( err ) {
274
275
console . log ( 'image delete problem: ' + JSON . stringify ( err ) ) ;
275
276
} )
276
- } )
277
+ } ) ;
277
278
278
279
// Catch image removal from the editor.
279
- . on ( 'froalaEditor.file.unlink' , function ( e , editor , link ) {
280
+ editor3 . events . on ( 'froalaEditor.file.unlink' , function ( e , editor , link ) {
280
281
281
282
$ . ajax ( {
282
283
// Request method.
@@ -313,7 +314,7 @@ <h2>Sample 4: Save to Amazon using signature version 4</h2>
313
314
$ . get ( "get_amazon" , { } )
314
315
. done ( function ( data ) {
315
316
316
- $ ( '#edit-amazon' ) . froalaEditor ( {
317
+ new FroalaEditor ( '#edit-amazon' , {
317
318
imageUploadToS3 : data ,
318
319
fileUploadToS3 : data ,
319
320
videoUploadToS3 : data
0 commit comments