<%
  import org.exoplatform.wiki.service.WikiPageParams;
  
  def rcontext = _ctx.getRequestContext() ;
  String restUrlToViewCurrentPage = uicomponent.getRestUrlToViewCurrentPage();
  WikiPageParams wikiPageParams = uicomponent.getCurrentWikiPageParams();
  String wikiType = wikiPageParams.getType();
  String wikiOwner = wikiPageParams.getOwner();
  String pageId = wikiPageParams.getPageName();
  String selectedSyntax = uicomponent.getSyntax();  
  def requireJs = rcontext.getJavascriptManager().getRequireJS();
  requireJs.require("SHARED/UIWikiRichTextArea", "UIWikiRichTextArea");
  requireJs.addScripts("UIWikiRichTextArea.init('UIWikiRichTextArea_TextArea', '" + restUrlToViewCurrentPage + "', '" 
            + selectedSyntax + "', '" + wikiType + "', '" + wikiOwner + "', '" + pageId + "');");
  requireJs.addScripts("window.require([\"/wiki/javascript/xwiki/xwiki.js\"], function(xwiki) {window.require([\"/wiki/javascript/xwiki/xwikiexplorer/xwikiexplorer.js\"], function(xwikiexplorer) {});});");
%>
<div class="UIWikiRichTextEditor">
  <% uicomponent.renderChild(uicomponent.RICHTEXT_AREA_INPUT); %>
</div>
