use of org.markdown4j.client.IncludePlugin 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());
}
}
});
}
Aggregations