You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by br...@apache.org on 2015/08/15 22:45:48 UTC
svn commit: r1696096 [7/8] - in /jspwiki/trunk: ./
jspwiki-war/src/main/config/wro/ jspwiki-war/src/main/java/org/apache/wiki/
jspwiki-war/src/main/resources/ini/ jspwiki-war/src/main/resources/templates/
jspwiki-war/src/main/scripts/moo-extend/ jspwik...
Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp?rev=1696096&r1=1696095&r2=1696096&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/TinyMCE.jsp Sat Aug 15 20:45:46 2015
@@ -109,11 +109,16 @@
{
//pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context, usertext ) );
pageAsHtml = renderingManager.getHTML( context, usertext );
+
+ //FFS !! seems more stable, and runs pre and post translate filters as well
+ //pageAsHtml = engine.textToHTML( context, usertext );
+
}
catch( Exception e )
{
pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
//pageAsHtml = e.toString() + "\n" + usertext; //error
+ e.printStackTrace();
}
// Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately
@@ -123,6 +128,7 @@
context.setVariable( WikiEngine.PROP_RUNFILTERS, null );
wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption );
+ /*FSS not used
String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
String protocol = "http://";
@@ -130,13 +136,13 @@
{
protocol = "https://";
}
-
+ */
%>
<form method="post" accept-charset="<wiki:ContentEncoding/>"
action="<wiki:CheckRequestContext
context='edit'><wiki:EditLink format='url'/></wiki:CheckRequestContext><wiki:CheckRequestContext
context='comment'><wiki:CommentLink format='url'/></wiki:CheckRequestContext>"
- class="editform"
+ class="editform wysiwyg"
id="editform"
enctype="application/x-www-form-urlencoded" >
@@ -165,12 +171,35 @@
</wiki:CheckRequestContext>
</span>
+ <div class="btn-group editor-tools">
- <%--<div class="btn-group editor-tools">--%>
+ <div class="btn-group config">
+ <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
+ <button class="btn btn-default dropdown-toggle"><span class="icon-wrench"></span><span class="caret"></span></button>
+ <ul class="dropdown-menu" data-hover-parent="div">
+ <li>
+ <a>
+ <label for="livepreview">
+ <input type="checkbox" data-cmd="livepreview" id="livepreview"/>
+ <fmt:message key='editor.plain.livepreview'/> <span class="icon-refresh"/>
+ </label>
+ </a>
+ </li>
+ <li>
+ <a>
+ <label for="previewcolumn">
+ <input type="checkbox" data-cmd="previewcolumn" id="previewcolumn" />
+ <fmt:message key='editor.plain.sidebysidepreview'/> <span class="icon-columns"/>
+ </label>
+ </a>
+ </li>
+
+ </ul>
+ </div>
<c:set var="editors" value="<%= engine.getEditorManager().getEditorList() %>" />
<c:if test='${fn:length(editors)>1}'>
-` <div class="btn-group config">
+ <div class="btn-group config">
<%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
<button class="btn btn-default dropdown-toggle"><span class="icon-pencil"></span><span class="caret"></span></button>
<ul class="dropdown-menu" data-hover-parent="div">
@@ -190,7 +219,7 @@
</div>
</c:if>
- <%--</div>--%>
+ </div>
<div class="form-group pull-right">
@@ -234,7 +263,14 @@
</div>
</wiki:CheckRequestContext>
- <textarea name="htmlPageText"><%=pageAsHtml%></textarea>
+
+ <div class="row edit-area livepreview previewcolumn"><%-- .livepreview .previewcolumn--%>
+ <div class="col-50">
+ <textarea name="htmlPageText"
+ autofocus="autofocus"><%=pageAsHtml%></textarea>
+ </div>
+ <div class="ajaxpreview col-50" >Preview comes here</div>
+ </div>
</form>
<script type="text/javascript">
@@ -242,26 +278,57 @@
Wiki.add("[name=htmlPageText]", function( element){
+ function containerHeight(){ return $(editor.getContainer()).getStyle("height"); }
+ function editorHeight(){ return $(editor.getContentAreaContainer()).getStyle("height"); }
+ function editorContent(){ return editor.getContent(); }
+ function previewContent(value){ preview.set("text", value); }
+ function resizePreview(){ preview.setStyle("height", containerHeight()); }
+
+ var form = element.form,
+ editor,
+ preview = form.getElement(".ajaxpreview"),
+ resizer = form.getElement(".resizer"),
+ resizeCookie = "editorHeight",
+
+ html2markup = Wiki.getXHRPreview( editorContent, previewContent );
+
+ $$("[data-cmd^=live]:checked").addEvent("configured", html2markup);
+ Wiki.configuration( form );
+
+
+
element.value = element.value
.replace( /<a class="hashlink"[^>]+>#<\/a>/g, "" )
.replace( /<img class="outlink"[^>]+>/g, "" ); // <img class="outlink" src="/..../images/out.png" alt=""
tinymce.init({
selector: "textarea[name=htmlPageText]",
+ //content_css : "template/haddock/haddock.css",
//extended_valid_elements: "...]",
//invalid_elements: blockquote ...",
language: Wiki.prefs.get( "Language" ), //"${prefs.Language}",
- height: Wiki.prefs.get( "EditorCookie" ),
+ height: Wiki.prefs.get( resizeCookie ),
+ content_css: $("main-stylesheet").href,
//plugins from the standard 4.2.2. package
plugins: 'anchor charmap code fullscreen image insertdatetime link lists media paste preview searchreplace table wordcount',
- setup : function(editor) {
+ setup: function( ed ){
+
+ editor = ed;
+
+ editor.on("init", function(){
+ // container height is apparently not yet properly initialized at this time - ugh!
+ (function () {
+ resizePreview();
+ html2markup();
+ }).delay(100);
+ });
+ editor.on("ResizeEditor", function(){
+ Wiki.prefs.set(resizeCookie, editorHeight() );
+ resizePreview();
+ });
+ editor.on("change", html2markup );
- console.log("Editor: " + editor.id + " is now initialized.");
- editor.on("ResizeEditor", (function(e){
- //console.log(e, e.target, e.width, e.height);
- //Wiki.prefs.set("EditorCookie", e.height);
- }).debounce() );
}
});
});
Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/plain.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/plain.jsp?rev=1696096&r1=1696095&r2=1696096&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/plain.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/plain.jsp Sat Aug 15 20:45:46 2015
@@ -102,8 +102,7 @@
<span class="cage">
<input class="btn btn-primary" type="submit" name="ok" accesskey="s"
- value="<fmt:message key='editor.plain.save.submit'/>"
- title="<fmt:message key='editor.plain.save.title'/>" />
+ value="<fmt:message key='editor.plain.save.submit'/>" />
<wiki:CheckRequestContext context="edit">
<input class="form-control" data-hover-parent="span" type="text" size="80" maxlength="80"
@@ -114,6 +113,7 @@
</span>
<div class="btn-group editor-tools">
+
<div class="btn-group sections">
<button class="btn btn-default"><span class="icon-bookmark"><span class="caret"></span></button>
<ul class="dropdown-menu" data-hover-parent="div">
@@ -123,25 +123,36 @@
<li><a>..</a></li>
</ul>
</div>
- <button class="btn btn-default" data-cmd="undo" title="<fmt:message key='editor.plain.undo.title'/>"><span class="icon-undo"></span></button>
- <button class="btn btn-default" data-cmd="redo" title="<fmt:message key='editor.plain.redo.title'/>"><span class="icon-repeat"></span></button>
- <button class="btn btn-default" data-cmd="find" title="<fmt:message key='editor.plain.find.title'/>"><span class="icon-search"></span></button>
- <%--
- <div class="btn-group config" data-toggle="buttons">
- <label class="btn btn-default" for="livepreview">
- <input type="checkbox" data-cmd="livepreview" id="livepreview"/><span class="icon-refresh">
- </label>
- </div>
- <div class="btn-group config" data-toggle="buttons">
- <label class="btn btn-default" for="previewcolumn">
- <input type="checkbox" data-cmd="previewcolumn" id="previewcolumn" /><span class="icon-columns"/>
- </label>
- </div>
- --%>
-` <div class="btn-group config">
+ <div class="btn-group formatting-options">
+ <button class="btn btn-default"><span class="icon-tint" /><span class="caret" /></button>
+ <ul class="dropdown-menu dropdown-menu-horizontal" data-hover-parent="div">
+ <li><a href="#" data-cmd="bold" title="<fmt:message key='editor.plain.tbB.title' />"><b>bold</b></a></li>
+ <li><a href="#" data-cmd="italic" title="<fmt:message key='editor.plain.tbI.title' />"><i>italic</i></a></li>
+ <li><a href="#" data-cmd="mono" title="<fmt:message key='editor.plain.tbMONO.title' />"><tt>mono</tt></a></li>
+ <li><a href="#" data-cmd="sub" title="<fmt:message key='editor.plain.tbSUB.title' />">a<span class="sub">sub</span></a></li>
+ <li><a href="#" data-cmd="sup" title="<fmt:message key='editor.plain.tbSUP.title' />">a<span class="sup">sup</span></a></li>
+ <li><a href="#" data-cmd="strike" title="<fmt:message key='editor.plain.tbSTRIKE.title' />"><span class="strike">strike</span></a></li>
+ <li><a href="#" data-cmd="link" title="<fmt:message key='editor.plain.tbLink.title'/>"><span class="icon-link"/></a></li>
+ <li><a href="#" data-cmd="img" title="<fmt:message key='editor.plain.tbIMG.title'/>"><span class="icon-picture"/></a></li>
+ <li><a href="#" data-cmd="plugin" title="<fmt:message key='editor.plain.tbPLUGIN.title'/>"><span class="icon-puzzle-piece"/></a></li>
+ <li><a href="#" data-cmd="font" title="<fmt:message key='editor.plain.tbFONT.title' />">Font<span class="caret" /></a></li>
+ <li><a href="#" data-cmd="chars" title="<fmt:message key='editor.plain.tbCHARS.title' />"><span class="icon-euro"/><span class="caret" /></a></li>
+<%--
+--%>
+ </ul>
+ </div>
+
+
+ <fmt:message key='editor.plain.undo.title' var='msg'/>
+ <button class="btn btn-default" data-cmd="undo" title="${msg}"><span class="icon-undo"></span></button>
+ <fmt:message key='editor.plain.redo.title' var='msg'/>
+ <button class="btn btn-default" data-cmd="redo" title="${msg}"><span class="icon-repeat"></span></button>
+ <button class="btn btn-default" data-cmd="find"><span class="icon-search" /></button>
+
+ <div class="btn-group config">
<%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
- <button class="btn btn-default dropdown-toggle"><span class="icon-wrench"></span><span class="caret"></span></button>
+ <button class="btn btn-default"><span class="icon-wrench"></span><span class="caret"></span></button>
<ul class="dropdown-menu" data-hover-parent="div">
<li>
<a>
@@ -188,12 +199,11 @@
</ul>
</div>
- <%-- --%>
<c:set var="editors" value="<%= context.getEngine().getEditorManager().getEditorList() %>" />
<c:if test='${fn:length(editors)>1}'>
-` <div class="btn-group config">
+ <div class="btn-group config">
<%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
- <button class="btn btn-default dropdown-toggle"><span class="icon-pencil"></span><span class="caret"></span></button>
+ <button class="btn btn-default"><span class="icon-pencil"></span><span class="caret"></span></button>
<ul class="dropdown-menu" data-hover-parent="div">
<c:forEach items="${editors}" var="edt">
<c:choose>
@@ -296,7 +306,9 @@
<div class="ajaxpreview col-50"></div>
</div>
- <div class="resizer" title="<fmt:message key='editor.plain.edit.resize'/>"></div>
+ <div class="resizer"
+ data-resize-cookie="editorHeight"
+ title="<fmt:message key='editor.plain.edit.resize'/>"></div>
</div><%-- end of .snipe --%>
Added: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp?rev=1696096&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp (added)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp Sat Aug 15 20:45:46 2015
@@ -0,0 +1,324 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+--%>
+<%@ page language="java" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
+<%@ page import="java.util.Properties"%>
+<%@ page import="org.apache.wiki.*" %>
+<%@ page import="org.apache.wiki.auth.*" %>
+<%@ page import="org.apache.wiki.auth.permissions.*" %>
+<%@ page import="org.apache.wiki.render.*" %>
+<%@ page import="org.apache.wiki.parser.JSPWikiMarkupParser" %>
+<%@ page import="org.apache.wiki.ui.*" %>
+
+<%@ page import="org.apache.wiki.util.TextUtil" %>
+
+<%@ page import="org.apache.wiki.filters.*" %>
+<%@ page import="org.apache.commons.lang.*" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+<fmt:setLocale value="${prefs.Language}" />
+<fmt:setBundle basename="templates.default"/>
+<%--
+ This provides a wysiwy editor for JSPWiki. (based on mooeditable)
+--%>
+<%
+ WikiContext context = WikiContext.findContext( pageContext );
+ WikiEngine engine = context.getEngine();
+
+ context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.TRUE );
+ context.setVariable( WikiEngine.PROP_RUNFILTERS, "false" );
+
+ WikiPage wikiPage = context.getPage();
+ String originalCCLOption = (String)wikiPage.getAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS );
+ wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, "false" );
+
+ String usertext = EditorManager.getEditedText(pageContext);
+
+%>
+<wiki:RequestResource type="stylesheet" resource="scripts/mooeditable/Assets/MooEditable/MooEditable.css" />
+<wiki:RequestResource type="stylesheet" resource="scripts/mooeditable/Assets/MooEditable/MooEditable.Extras.css" />
+<wiki:RequestResource type="script" resource="scripts/mooeditable/Source/MooEditable/MooEditable.js" />
+<wiki:RequestResource type="script" resource="scripts/mooeditable/Source/MooEditable/MooEditable.UI.MenuList.js" />
+<wiki:RequestResource type="script" resource="scripts/mooeditable/Source/MooEditable/MooEditable.Extras.js" />
+
+<wiki:CheckRequestContext context="edit">
+<wiki:NoSuchPage> <%-- this is a new page, check if we're cloning --%>
+<%
+ String clone = request.getParameter( "clone" );
+ if( clone != null )
+ {
+ WikiPage p = engine.getPage( clone );
+ if( p != null )
+ {
+ AuthorizationManager mgr = engine.getAuthorizationManager();
+ PagePermission pp = new PagePermission( p, PagePermission.VIEW_ACTION );
+
+ try
+ {
+ if( mgr.checkPermission( context.getWikiSession(), pp ) )
+ {
+ usertext = engine.getPureText( p );
+ }
+ }
+ catch( Exception e ) { /*log.error( "Accessing clone page "+clone, e );*/ }
+ }
+ }
+%>
+</wiki:NoSuchPage>
+<%
+ if( usertext == null )
+ {
+ usertext = engine.getPureText( context.getPage() );
+ }
+%>
+</wiki:CheckRequestContext>
+<%
+ if( usertext == null ) usertext = "";
+
+ RenderingManager renderingManager = new RenderingManager();
+
+ // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
+ Properties copyOfWikiProperties = new Properties();
+ copyOfWikiProperties.putAll( engine.getWikiProperties() );
+ copyOfWikiProperties.setProperty( "jspwiki.renderingManager.renderer", WysiwygEditingRenderer.class.getName() );
+ renderingManager.initialize( engine, copyOfWikiProperties );
+
+ String pageAsHtml;
+ try
+ {
+ //pageAsHtml = StringEscapeUtils.escapeJavaScript( renderingManager.getHTML( context, usertext ) );
+ pageAsHtml = renderingManager.getHTML( context, usertext );
+ }
+ catch( Exception e )
+ {
+ pageAsHtml = "Error in converting wiki-markup to well-formed HTML \n" + e.toString();
+ //pageAsHtml = e.toString() + "\n" + usertext; //error
+ }
+
+ // Disable the WYSIWYG_EDITOR_MODE and reset the other properties immediately
+ // after the XHTML for wysiwyg editor has been rendered.
+ context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.FALSE );
+
+ context.setVariable( WikiEngine.PROP_RUNFILTERS, null );
+ wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS, originalCCLOption );
+
+ /*not used
+ String templateDir = (String)copyOfWikiProperties.get( WikiEngine.PROP_TEMPLATEDIR );
+
+ String protocol = "http://";
+ if( request.isSecure() )
+ {
+ protocol = "https://";
+ }
+ */
+%>
+<form method="post" accept-charset="<wiki:ContentEncoding/>"
+ action="<wiki:CheckRequestContext
+ context='edit'><wiki:EditLink format='url'/></wiki:CheckRequestContext><wiki:CheckRequestContext
+ context='comment'><wiki:CommentLink format='url'/></wiki:CheckRequestContext>"
+ class="editform wysiwyg"
+ id="editform"
+ enctype="application/x-www-form-urlencoded" >
+
+ <%-- Edit.jsp relies on these being found. So be careful, if you make changes. --%>
+ <input type="hidden" name="page" value="<wiki:Variable var='pagename' />" />
+ <input type="hidden" name="action" value="save" />
+ <%=SpamFilter.insertInputFields( pageContext )%>
+ <input type="hidden" name="<%=SpamFilter.getHashFieldName(request)%>" value="${lastchange}" />
+ <%-- This following field is only for the SpamFilter to catch bots which are just randomly filling all fields and submitting.
+ Normal user should never see this field, nor type anything in it. --%>
+ <input class="hidden" type="text" name="<%=SpamFilter.getBotFieldName()%>" id="<%=SpamFilter.getBotFieldName()%>" value="" />
+
+
+ <div class="form-inline form-group">
+
+ <span class="cage">
+ <input class="btn btn-primary" type="submit" name="ok" accesskey="s"
+ value="<fmt:message key='editor.plain.save.submit'/>"
+ title="<fmt:message key='editor.plain.save.title'/>" />
+
+ <wiki:CheckRequestContext context="edit">
+ <input class="form-control" data-hover-parent="span" type="text" size="80" maxlength="80"
+ name="changenote" id="changenote"
+ placeholder="<fmt:message key='editor.plain.changenote'/>"
+ value="${changenote}" />
+ </wiki:CheckRequestContext>
+ </span>
+
+
+ <div class="btn-group editor-tools">
+
+ <div class="btn-group config">
+ <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
+ <button class="btn btn-default dropdown-toggle"><span class="icon-wrench"></span><span class="caret"></span></button>
+ <ul class="dropdown-menu" data-hover-parent="div">
+ <li>
+ <a>
+ <label for="livepreview">
+ <input type="checkbox" data-cmd="livepreview" id="livepreview"/>
+ <fmt:message key='editor.plain.livepreview'/> <span class="icon-refresh"/>
+ </label>
+ </a>
+ </li>
+ <li>
+ <a>
+ <label for="previewcolumn">
+ <input type="checkbox" data-cmd="previewcolumn" id="previewcolumn" />
+ <fmt:message key='editor.plain.sidebysidepreview'/> <span class="icon-columns"/>
+ </label>
+ </a>
+ </li>
+
+ </ul>
+ </div>
+
+ <c:set var="editors" value="<%= engine.getEditorManager().getEditorList() %>" />
+ <c:if test='${fn:length(editors)>1}'>
+ <div class="btn-group config">
+ <%-- note: 'dropdown-toggle' is only here to style the last button properly! --%>
+ <button class="btn btn-default dropdown-toggle"><span class="icon-pencil"></span><span class="caret"></span></button>
+ <ul class="dropdown-menu" data-hover-parent="div">
+ <c:forEach items="${editors}" var="edt">
+ <c:choose>
+ <c:when test="${edt != prefs.editor}">
+ <li>
+ <wiki:Link context="edit"><wiki:Param name="editor" value="${edt}" />${edt}</wiki:Link>
+ </li>
+ </c:when>
+ <c:otherwise>
+ <li class="dropdown-header">${edt}</li>
+ </c:otherwise>
+ </c:choose>
+ </c:forEach>
+ </ul>
+ </div>
+ </c:if>
+
+ </div>
+
+ <div class="form-group pull-right">
+
+ <%-- is PREVIEW functionality still needed - with livepreview ?
+ <input class="btn btn-primary" type="submit" name="preview" accesskey="v"
+ value="<fmt:message key='editor.plain.preview.submit'/>"
+ title="<fmt:message key='editor.plain.preview.title'/>" />
+ --%>
+ <input class="btn btn-danger" type="submit" name="cancel" accesskey="q"
+ value="<fmt:message key='editor.plain.cancel.submit'/>"
+ title="<fmt:message key='editor.plain.cancel.title'/>" />
+
+ </div>
+ <%--TODO: allow page rename as part of an edit session
+ <wiki:Permission permission="rename">
+ <div class="form-group form-inline">
+ <label for="renameto"><fmt:message key='editor.renameto'/></label>
+ <input type="text" name="renameto" value="<wiki:Variable var='pagename' />" size="40" />
+ <input type="checkbox" name="references" checked="checked" />
+ <fmt:message key="info.updatereferrers"/>
+ </div>
+ </wiki:Permission>
+ --%>
+
+ </div>
+
+ <wiki:CheckRequestContext context="comment">
+ <div class="info">
+ <label><fmt:message key="editor.commentsignature"/></label>
+ <input class="form-control form-col-20" type="text" name="author" id="authorname"
+ placeholder="<fmt:message key='editor.plain.name'/>"
+ value="${author}" />
+ <label class="btn btn-default btn-sm" for="rememberme">
+ <input type="checkbox" name="remember" id="rememberme"
+ <%=TextUtil.isPositive((String)session.getAttribute("remember")) ? "checked='checked'" : ""%> />
+ <fmt:message key="editor.plain.remember"/>
+ </label>
+ <input class="form-control form-col-20" type="text" name="link" id="link" size="24"
+ placeholder="<fmt:message key='editor.plain.email'/>"
+ value="${link}" />
+ </div>
+ </wiki:CheckRequestContext>
+
+
+ <div class="row edit-area livepreview previewcolumn"><%-- .livepreview .previewcolumn--%>
+ <div class="col-50">
+ <textarea name="htmlPageText"
+ autofocus="autofocus"><%=pageAsHtml%></textarea>
+ </div>
+ <div class="ajaxpreview col-50">Preview comes here</div>
+ </div>
+
+ <div class="resizer"
+ data-resize-cookie="editorHeight"
+ title="<fmt:message key='editor.plain.edit.resize'/>"></div>
+
+</form>
+<script type="text/javascript">
+//<![CDATA[
+
+Wiki.add("[name=htmlPageText]", function( element){
+
+ function containerHeight(){ return editor.container.getStyle("height"); }
+ function editorHeight(){ return editor.iframe.getStyle("height"); }
+ function editorContent(){ return editor.getContent(); }
+ function previewContent(value){ preview.set("text", value); }
+ function resizePreview(){ preview.setStyle("height", containerHeight()); }
+
+ var form = element.form,
+ editor,
+ preview = form.getElement(".ajaxpreview"),
+ resizer = form.getElement(".resizer"),
+ resizeCookie = "editorHeight",
+
+ html2markup = Wiki.getXHRPreview( editorContent, previewContent );
+
+ $$("[data-cmd^=live]:checked").addEvent("configured", html2markup);
+ Wiki.configuration( form );
+
+ element.value = element.value
+ .replace( /<a class="hashlink"[^>]+>#<\/a>/g, "" )
+ .replace( /<img class="outlink"[^>]+>/g, "" ); // <img class="outlink" src="/..../images/out.png" alt=""
+
+
+
+ element.mooEditable({
+ dimensions:{
+ x: "100%",
+ y: "100%"//Wiki.prefs.get( resizeCookie )
+ },
+ extraCSS: "body{padding:.5em;}",
+ externalCSS: $("main-stylesheet").href,
+ onAttach: function(){
+
+ editor = this;
+ resizePreview();
+ html2markup();
+ Wiki.resizer( editor.iframe, resizePreview );
+ },
+ onChange: html2markup,
+ onEditorKeyUp: html2markup,
+ onEditorPaste: html2markup,
+ //onEditorMouseUp: html2markup,
+ actions: 'bold italic underline strikethrough | formatBlock justifyleft justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist indent outdent insertHorizontalRule | undo redo removeformat | createlink unlink | urlimage | toggleview'
+ });
+
+});
+
+//]]>
+</script>
Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/fonts/FontJspwiki.eot
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/fonts/FontJspwiki.eot?rev=1696096&r1=1696095&r2=1696096&view=diff
==============================================================================
Binary files - no diff available.