Skip to content

Commit c853bb3

Browse files
committed
Added example
1 parent 72dd27a commit c853bb3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.vaadin.tinymce;
2+
3+
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
4+
import com.vaadin.flow.router.Route;
5+
6+
@Route
7+
public class AutoSavePluginExample extends VerticalLayout {
8+
9+
public AutoSavePluginExample() {
10+
TinyMce tinyMce = new TinyMce();
11+
tinyMce.configurePlugin(true, Plugin.AUTOSAVE)
12+
// TODO add constant
13+
.configure("toolbar", "restoredraft")
14+
// save more eagerly for demo
15+
.configure("autosave_interval","5s")
16+
// Default by tinymce uses id of editor, which happens to be random
17+
// byfault for this integration
18+
.configure("autosave_prefix", "tinymce-autosave-myfield-id");
19+
add(tinyMce);
20+
}
21+
}

0 commit comments

Comments
 (0)