use of com.willshex.blogwt.client.markdown.plugin.FormPlugin in project blogwt by billy1380.
the class PostHelper method handlePluginContentReady.
public static HandlerRegistration handlePluginContentReady() {
return processor().addPluginContentReadyHandler((event, plugin, lines, params, id, content) -> {
Element el = Document.get().getElementById(id);
if (plugin instanceof IncludePlugin || plugin instanceof PostsPlugin) {
if (el != null && content != null) {
el.setInnerHTML(content);
}
} else if (plugin instanceof MapPlugin) {
if (el != null) {
MapHelper.showMap(el, lines, params);
}
} else if (plugin instanceof FormPlugin) {
if (el != null && content != null) {
el.removeAllChildren();
// FIXME: probably leaking this
// on unload never seems to get called
Widget form = FormPlugin.createWidget(lines, params);
RootPanel.get().add(form);
el.appendChild(form.getElement());
}
}
});
}
use of com.willshex.blogwt.client.markdown.plugin.FormPlugin in project blogwt by billy1380.
the class Processor method registerPlugins.
/* (non-Javadoc)
*
* @see org.markdown4j.client.MarkdownProcessor#registerPlugins() */
@Override
protected void registerPlugins() {
CachedIncludePlugin includePlugin = new CachedIncludePlugin(ensureManager());
includePlugin.setProcessor(this);
String mapsApiKey = PropertyController.get().stringProperty(PropertyHelper.MARKDOWN_MAPS_API_KEY);
if (mapsApiKey != null && mapsApiKey.trim().length() == 0) {
mapsApiKey = null;
}
registerPlugins(new WebSequencePlugin(ensureManager()), includePlugin, new GalleryPlugin(ensureManager()), mapsApiKey == null ? null : new MapPlugin(mapsApiKey, ensureManager()), new YoutubePlugin(), new FormPlugin(ensureManager()), new PostsPlugin(ensureManager()));
}
Aggregations