Skip to content

Commit

Permalink
Added example
Browse files Browse the repository at this point in the history
  • Loading branch information
mstahv committed Mar 7, 2024
1 parent 72dd27a commit c853bb3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/java/org/vaadin/tinymce/AutoSavePluginExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.vaadin.tinymce;

import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

@Route
public class AutoSavePluginExample extends VerticalLayout {

public AutoSavePluginExample() {
TinyMce tinyMce = new TinyMce();
tinyMce.configurePlugin(true, Plugin.AUTOSAVE)
// TODO add constant
.configure("toolbar", "restoredraft")
// save more eagerly for demo
.configure("autosave_interval","5s")
// Default by tinymce uses id of editor, which happens to be random
// byfault for this integration
.configure("autosave_prefix", "tinymce-autosave-myfield-id");
add(tinyMce);
}
}

0 comments on commit c853bb3

Please sign in to comment.