<%
  import org.apache.commons.lang.StringEscapeUtils;

  def rcontext = _ctx.getRequestContext();
  String cancelLabel = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.Cancel"));
  String titleMessage = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.Confirmation"));
  String exitMessage = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.ConfirmExit"));
  String okLabel = StringEscapeUtils.escapeJavaScript(_ctx.appRes("UIConfirmBox.label.Ok"));
  String cancelLink = uicomponent.getActionLink();
  def requireJs = rcontext.getJavascriptManager().getRequireJS();
  requireJs.require("SHARED/UIConfirmBox", "UIConfirmBox");
  requireJs.addScripts("UIConfirmBox.init();");  
%>
<a style="display:none" id="link_$uicomponent.id" href="$cancelLink"></a>
<button type="button" class="btn" id="$uicomponent.id" onclick="if(eXo.wiki.UIWikiPageEditForm.cancelSave('$uicomponent.id','$titleMessage','$exitMessage', 'Delete Icon','$okLabel','$cancelLabel'))  $cancelLink;">
  <%=_ctx.appRes("UISubmitToolBar.action.Cancel");%>    
</button>
