Author: ajaquith
Date: Sat Mar 6 19:18:15 2010
New Revision: 919824
URL: http://svn.apache.org/viewvc?rev=919824&view=rev
Log:
Slightly changed how EditActionBean.edit() works. It now forwards directly to
the editor JSPs. These JSPs now render EditorLayout.jsp, which allows each
editor to load its own resources (per mailing list discussion). Edit.jsp's
contents essentially morph into EditorLayout.jsp.
Added:
incubator/jspwiki/trunk/src/WebContent/templates/default/layout/EditorLayout.jsp
Removed:
incubator/jspwiki/trunk/src/WebContent/templates/default/Edit.jsp
Modified:
incubator/jspwiki/trunk/ChangeLog
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/FCK.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/wysiwyg.jsp
incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
Modified: incubator/jspwiki/trunk/ChangeLog
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=919824&r1=919823&r2=919824&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Sat Mar 6 19:18:15 2010
@@ -1,3 +1,30 @@
+2010-03-03 Andrew Jaquith <ajaquith AT apache DOT org>
+
+ * 3.0.0-svn-213
+
+ * Removed old URLConstructors. Fixed bug in StripesUrlContructor
+ that caused it to exhibit slightly behavior different different
+ behavior than DefaultUrlContructor. It now generates URLs identically.
+ Method parsePage() was removed from UrlContructor's interface spec.
+ (The only URLConstructor implementation is StripesUrlConstructor,
+ anyway, it doesn't need to do any page-param parsing because the
+ framework takes care of it.)
+
+ * Removed WikiServlet. All of its functionality had been previously
+ moved elsewhere, and it was not being used in web.xml either.
+ Also removed SpamFilter; the content-inspection package essentially
+ replaces it (and is far more flexible).
+
+ * Fixed bug that popped up in Preferences.jsp regarding skin listings.
+
+ * Slightly changed how EditActionBean.edit() works. It now forwards
+ directly to the editor JSPs. These JSPs now render EditorLayout.jsp,
+ which allows each editor to load its own resources (per mailing
+ list discussion). Edit.jsp's contents essentially morph into
+ EditorLayout.jsp.
+
+ * Fixed bug that caused ReferenceManager tests to fail.
+
2010-02-28 Andrew Jaquith <ajaquith AT apache DOT org>
* 3.0.0-svn-212
Modified:
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/FCK.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/editors/FCK.jsp?rev=919824&r1=919823&r2=919824&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/editors/FCK.jsp
(original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/editors/FCK.jsp
Sat Mar 6 19:18:15 2010
@@ -50,142 +50,167 @@
String usertext = EditorManager.getEditedText(pageContext);
TemplateManager.addResourceRequest( context, "script",
"scripts/fckeditor/fckeditor.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 ) )
+<s:layout-render name="${templates['layout/DefaultLayout.jsp']}">
+
+ <%-- Page title should say Edit: + pagename --%>
+ <s:layout-component name="headTitle">
+ <fmt:message key="edit.title.edit">
+ <fmt:param><wiki:Variable var="ApplicationName" /></fmt:param>
+ <fmt:param><wiki:PageName/></fmt:param>
+ </fmt:message>
+ </s:layout-component>
+
+ <%-- Add Javascript for plain editor --%>
+ <s:layout-component name="script">
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/jspwiki-edit.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/dialog.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/fckconfig.js' />"></script>
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <%-- FIXME: select CommentLayout or EditorLayout based on "comment" or
"edit" event--%>
+ <s:layout-render name="${templates['layout/EditorLayout.jsp']}">
+ <s:layout-component name="editor">
+
+ <wiki:CheckRequestContext context="edit">
+ <wiki:NoSuchPage> <%-- this is a new page, check if we're cloning
--%>
+ <%
+ String clone = request.getParameter( "clone" );
+ if( clone != null )
{
- usertext = engine.getPureText( p );
+ 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 );*/ }
+ }
}
- }
- 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 = StringEscapeUtils.escapeJavaScript(
renderingManager.getHTML( context, usertext ) );
-
- // Disable the WYSIWYG_EDITOR_MODE and reset the other properties
immediately
- // after the XHTML for FCK has been rendered.
- context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.FALSE );
- context.setVariable( WikiEngine.PROP_RUNFILTERS, null );
- wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS,
originalCCLOption );
-
- String templateDir = (String)copyOfWikiProperties.get(
WikiEngine.PROP_TEMPLATEDIR );
-
- String protocol = "http://";
- if( request.isSecure() )
- {
- protocol = "https://";
- }
-%>
-<div style="width:100%"> <%-- Required for IE6 on Windows --%>
-
- <%-- Print any messages or validation errors --%>
- <s:messages />
- <s:errors />
-
- <s:form beanclass="org.apache.wiki.action.EditActionBean"
- class="wikiform"
- id="editform"
- acceptcharset="UTF-8"
- enctype="application/x-www-form-urlencoded">
-
- <%-- If any conflicts, print the conflicting text here --%>
- <c:if test="${not empty wikiActionBean.conflictText}">
- <p>
- <s:label for="conflictText" />
- <s:textarea name="conflictText" readonly="true" />
- </p>
- </c:if>
-
- <%-- EditActionBean relies on these being found. So be careful, if you
make changes. --%>
- <p id="submitbuttons">
- <s:hidden name="page" />
- <s:hidden name="startTime" />
- </p>
-
- <script type="text/javascript">
-//<![CDATA[
-
- var oFCKeditor = new FCKeditor( 'htmlPageText' );
- oFCKeditor.BasePath = 'scripts/fckeditor/';
- oFCKeditor.Value = '<%=pageAsHtml%>';
- oFCKeditor.Width = '100%';
- oFCKeditor.Height = '450';
- oFCKeditor.Config['CustomConfigurationsPath'] =
'<%=request.getContextPath()%>/scripts/fckconfig.js';
- oFCKeditor.Config['StylesXmlPath'] =
'<%=request.getContextPath()%>/scripts/fckstyles.xml';
- oFCKeditor.Config['TemplatesXmlPath'] =
'<%=request.getContextPath()%>/scripts/fcktemplates.xml';
- oFCKeditor.Config['BaseHref'] =
'<%=protocol%><%=request.getServerName()%>:<%=request.getServerPort()%><%=request.getContextPath()%>/';
- oFCKeditor.Config['EditorAreaCSS'] =
'<%=request.getContextPath()%>/templates/<%=templateDir%>/jspwiki.css';
- oFCKeditor.Config['SmileyPath'] = oFCKeditor.Config['BaseHref'] +
'scripts/fckeditor/editor/images/smiley/msn/' ;
- oFCKeditor.Create();
-
-//]]>
- </script>
-
- <noscript>
- <div class="error"><fmt:message key="editor.fck.noscript" /></div>
- </noscript>
-
- <p>
- <s:label for="changeNote" />
- <s:text name="changeNote" size="50" maxlength="80" />
- </p>
-
- <wiki:CheckRequestContext context="comment">
- <fieldset>
- <legend><fmt:message key="editor.commentsignature" /></legend>
- <p><s:label for="author" accesskey="n" /> <s:text name="author"
/></p>
- <p><s:label for="email" accesskey="m" /> <s:text name="email"
size="24" /></p>
- </fieldset>
- </wiki:CheckRequestContext>
-
- <p>
- <c:set var="saveTitle" scope="page"><fmt:message
key="editor.plain.save.title" /></c:set>
- <wiki:CheckRequestContext context='edit'>
- <s:submit name="save" accesskey="s" title="${saveTitle}" />
- </wiki:CheckRequestContext>
- <wiki:CheckRequestContext context='comment'>
- <s:submit name="comment" accesskey="s" title="${saveTitle}" />
- </wiki:CheckRequestContext>
+ %>
+ </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 = StringEscapeUtils.escapeJavaScript(
renderingManager.getHTML( context, usertext ) );
+
+ // Disable the WYSIWYG_EDITOR_MODE and reset the other properties
immediately
+ // after the XHTML for FCK has been rendered.
+ context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE,
Boolean.FALSE );
+ context.setVariable( WikiEngine.PROP_RUNFILTERS, null );
+ wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS,
originalCCLOption );
+
+ String templateDir = (String)copyOfWikiProperties.get(
WikiEngine.PROP_TEMPLATEDIR );
+
+ String protocol = "http://";
+ if( request.isSecure() )
+ {
+ protocol = "https://";
+ }
+ %>
+
+ <%-- Print any messages or validation errors --%>
+ <s:messages />
+ <s:errors />
- <c:set var="previewTitle" scope="page"><fmt:message
key="editor.plain.preview.title" /></c:set>
- <s:submit name="preview" accesskey="v" title="${previewTitle}" />
+ <s:form beanclass="org.apache.wiki.action.EditActionBean"
+ class="wikiform"
+ id="editform"
+ acceptcharset="UTF-8"
+ enctype="application/x-www-form-urlencoded">
- <c:set var="cancelTitle" scope="page"><fmt:message
key="editor.plain.cancel.title" /></c:set>
- <s:submit name="cancel" accesskey="q" title="${cancelTitle}" />
- </p>
-
- <%-- Spam detection fields --%>
- <wiki:SpamProtect />
- </s:form>
-
-</div>
+ <%-- If any conflicts, print the conflicting text here --%>
+ <c:if test="${not empty wikiActionBean.conflictText}">
+ <p>
+ <s:label for="conflictText" />
+ <s:textarea name="conflictText" readonly="true" />
+ </p>
+ </c:if>
+
+ <%-- EditActionBean relies on these being found. So be careful, if
you make changes. --%>
+ <p id="submitbuttons">
+ <s:hidden name="page" />
+ <s:hidden name="startTime" />
+ </p>
+
+ <script type="text/javascript">
+ //<![CDATA[
+
+ var oFCKeditor = new FCKeditor( 'htmlPageText' );
+ oFCKeditor.BasePath = 'scripts/fckeditor/';
+ oFCKeditor.Value = '<%=pageAsHtml%>';
+ oFCKeditor.Width = '100%';
+ oFCKeditor.Height = '450';
+ oFCKeditor.Config['CustomConfigurationsPath'] =
'<%=request.getContextPath()%>/scripts/fckconfig.js';
+ oFCKeditor.Config['StylesXmlPath'] =
'<%=request.getContextPath()%>/scripts/fckstyles.xml';
+ oFCKeditor.Config['TemplatesXmlPath'] =
'<%=request.getContextPath()%>/scripts/fcktemplates.xml';
+ oFCKeditor.Config['BaseHref'] =
'<%=protocol%><%=request.getServerName()%>:<%=request.getServerPort()%><%=request.getContextPath()%>/';
+ oFCKeditor.Config['EditorAreaCSS'] =
'<%=request.getContextPath()%>/templates/<%=templateDir%>/jspwiki.css';
+ oFCKeditor.Config['SmileyPath'] = oFCKeditor.Config['BaseHref'] +
'scripts/fckeditor/editor/images/smiley/msn/' ;
+ oFCKeditor.Create();
+
+ //]]>
+ </script>
+
+ <noscript>
+ <div class="error"><fmt:message key="editor.fck.noscript" /></div>
+ </noscript>
+
+ <p>
+ <s:label for="changeNote" />
+ <s:text name="changeNote" size="50" maxlength="80" />
+ </p>
+
+ <wiki:CheckRequestContext context="comment">
+ <fieldset>
+ <legend><fmt:message key="editor.commentsignature" /></legend>
+ <p><s:label for="author" accesskey="n" /> <s:text
name="author" /></p>
+ <p><s:label for="email" accesskey="m" /> <s:text
name="email" size="24" /></p>
+ </fieldset>
+ </wiki:CheckRequestContext>
+
+ <p>
+ <c:set var="saveTitle" scope="page"><fmt:message
key="editor.plain.save.title" /></c:set>
+ <wiki:CheckRequestContext context='edit'>
+ <s:submit name="save" accesskey="s" title="${saveTitle}" />
+ </wiki:CheckRequestContext>
+ <wiki:CheckRequestContext context='comment'>
+ <s:submit name="comment" accesskey="s" title="${saveTitle}" />
+ </wiki:CheckRequestContext>
+
+ <c:set var="previewTitle" scope="page"><fmt:message
key="editor.plain.preview.title" /></c:set>
+ <s:submit name="preview" accesskey="v" title="${previewTitle}" />
+
+ <c:set var="cancelTitle" scope="page"><fmt:message
key="editor.plain.cancel.title" /></c:set>
+ <s:submit name="cancel" accesskey="q" title="${cancelTitle}" />
+ </p>
+
+ <%-- Spam detection fields --%>
+ <wiki:SpamProtect />
+ </s:form>
+
+ </s:layout-component>
+ </s:layout-render>
+ </s:layout-component>
+
+</s:layout-render>
Modified:
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp?rev=919824&r1=919823&r2=919824&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp
(original)
+++ incubator/jspwiki/trunk/src/WebContent/templates/default/editors/plain.jsp
Sat Mar 6 19:18:15 2010
@@ -26,155 +26,178 @@
<%--
This is a plain editor for JSPWiki.
--%>
-<div style="width:100%"> <%-- Required for IE6 on Windows --%>
+<s:layout-render name="${templates['layout/DefaultLayout.jsp']}">
- <s:form beanclass="org.apache.wiki.action.EditActionBean"
- class="wikiform"
- id="editform"
- acceptcharset="UTF-8"
- enctype="application/x-www-form-urlencoded">
-
- <%-- Toolbar --%>
- <div id="toolbar" class="line">
-
- <div id="configDialog" style="display:none;">
- <s:checkbox name="options.tabCompletion" id="tabCompletion"
/><fmt:message key="editor.plain.tabcompletion"/>
- <br />
- <s:checkbox name="options.smartPairs" id="smartPairs" /><fmt:message
key="editor.plain.smartpairs"/>
- </div>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.action'/></legend>
- <a href="#" class="tool tUNDO" title="<fmt:message
key='editor.plain.undo.title'/>">undo</a>
- <a href="#" class="tool tREDO" title="<fmt:message
key='editor.plain.redo.title'/>">redo</a>
- <a href="#" class="tool tSEARCH" title="<fmt:message
key='editor.plain.find.title'/>">find</a>
- <a href="#" class="tool tCONFIG" title="<fmt:message
key='editor.plain.config.title'/>">config</a>
- </fieldset>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.insert'/></legend>
- <a href="#" class="tool tLink" title="<fmt:message
key='editor.plain.tbLink.title'/>">link</a>
- <a href="#" class="tool tH1" title="<fmt:message
key='editor.plain.tbH1.title'/>">h1</a>
- <a href="#" class="tool tH2" title="<fmt:message
key='editor.plain.tbH2.title'/>">h2</a>
- <a href="#" class="tool tH3" title="<fmt:message
key='editor.plain.tbH3.title'/>">h3</a>
- <a href="#" class="tool tPRE" title="<fmt:message
key='editor.plain.tbPRE.title'/>">pre</a>
- <a href="#" class="tool tHR" title="<fmt:message
key='editor.plain.tbHR.title'/>">hr</a>
- <a href="#" class="tool tBR" title="<fmt:message
key='editor.plain.tbBR.title'/>">br</a>
- <a href="#" class="tool tCHAR" title="<fmt:message
key='editor.plain.tbCHAR.title'/>">special</a>
- </fieldset>
-
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.style'/></legend>
- <a href="#" class="tool tB" title="<fmt:message
key='editor.plain.tbB.title'/>">bold</a>
- <a href="#" class="tool tI" title="<fmt:message
key='editor.plain.tbI.title'/>">italic</a>
- <a href="#" class="tool tMONO" title="<fmt:message
key='editor.plain.tbMONO.title'/>">mono</a>
- <a href="#" class="tool tCSS" title="<fmt:message
key='editor.plain.tbCSS.title'/>">%%</a>
- <a href="#" class="tool tFONT" title="<fmt:message
key='editor.plain.tbFONT.title'/>">font</a>
- <a href="#" class="tool tCOLOR" title="<fmt:message
key='editor.plain.tbCOLOR.title'/>">color</a>
- <!--
- <a href="#" class="tool tSUP" title="<fmt:message
key='editor.plain.tbSUP.title'/>">sup</a>
- <a href="#" class="tool tSUB" title="<fmt:message
key='editor.plain.tbSUB.title'/>">sub</a>
- <a href="#" class="tool tSTRIKE" title="<fmt:message
key='editor.plain.tbSTRIKE.title'/>">strike</a>
- -->
- </fieldset>
+ <%-- Page title should say Edit: + pagename --%>
+ <s:layout-component name="headTitle">
+ <fmt:message key="edit.title.edit">
+ <fmt:param><wiki:Variable var="ApplicationName" /></fmt:param>
+ <fmt:param><wiki:PageName/></fmt:param>
+ </fmt:message>
+ </s:layout-component>
+
+ <%-- Add Javascript for plain editor --%>
+ <s:layout-component name="script">
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/jspwiki-edit.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/dialog.js' />"></script>
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <%-- FIXME: select CommentLayout or EditorLayout based on "comment" or
"edit" event--%>
+ <s:layout-render name="${templates['layout/EditorLayout.jsp']}">
+ <s:layout-component name="editor">
+
+ <s:form beanclass="org.apache.wiki.action.EditActionBean"
+ class="wikiform"
+ id="editform"
+ acceptcharset="UTF-8"
+ enctype="application/x-www-form-urlencoded">
+
+ <%-- Toolbar --%>
+ <div id="toolbar" class="line">
+
+ <div id="configDialog" style="display:none;">
+ <s:checkbox name="options.tabCompletion" id="tabCompletion"
/><fmt:message key="editor.plain.tabcompletion"/>
+ <br />
+ <s:checkbox name="options.smartPairs" id="smartPairs"
/><fmt:message key="editor.plain.smartpairs"/>
+ </div>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.action'/></legend>
+ <a href="#" class="tool tUNDO" title="<fmt:message
key='editor.plain.undo.title'/>">undo</a>
+ <a href="#" class="tool tREDO" title="<fmt:message
key='editor.plain.redo.title'/>">redo</a>
+ <a href="#" class="tool tSEARCH" title="<fmt:message
key='editor.plain.find.title'/>">find</a>
+ <a href="#" class="tool tCONFIG" title="<fmt:message
key='editor.plain.config.title'/>">config</a>
+ </fieldset>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.insert'/></legend>
+ <a href="#" class="tool tLink" title="<fmt:message
key='editor.plain.tbLink.title'/>">link</a>
+ <a href="#" class="tool tH1" title="<fmt:message
key='editor.plain.tbH1.title'/>">h1</a>
+ <a href="#" class="tool tH2" title="<fmt:message
key='editor.plain.tbH2.title'/>">h2</a>
+ <a href="#" class="tool tH3" title="<fmt:message
key='editor.plain.tbH3.title'/>">h3</a>
+ <a href="#" class="tool tPRE" title="<fmt:message
key='editor.plain.tbPRE.title'/>">pre</a>
+ <a href="#" class="tool tHR" title="<fmt:message
key='editor.plain.tbHR.title'/>">hr</a>
+ <a href="#" class="tool tBR" title="<fmt:message
key='editor.plain.tbBR.title'/>">br</a>
+ <a href="#" class="tool tCHAR" title="<fmt:message
key='editor.plain.tbCHAR.title'/>">special</a>
+ </fieldset>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.style'/></legend>
+ <a href="#" class="tool tB" title="<fmt:message
key='editor.plain.tbB.title'/>">bold</a>
+ <a href="#" class="tool tI" title="<fmt:message
key='editor.plain.tbI.title'/>">italic</a>
+ <a href="#" class="tool tMONO" title="<fmt:message
key='editor.plain.tbMONO.title'/>">mono</a>
+ <a href="#" class="tool tCSS" title="<fmt:message
key='editor.plain.tbCSS.title'/>">%%</a>
+ <a href="#" class="tool tFONT" title="<fmt:message
key='editor.plain.tbFONT.title'/>">font</a>
+ <a href="#" class="tool tCOLOR" title="<fmt:message
key='editor.plain.tbCOLOR.title'/>">color</a>
+ <!--
+ <a href="#" class="tool tSUP" title="<fmt:message
key='editor.plain.tbSUP.title'/>">sup</a>
+ <a href="#" class="tool tSUB" title="<fmt:message
key='editor.plain.tbSUB.title'/>">sub</a>
+ <a href="#" class="tool tSTRIKE" title="<fmt:message
key='editor.plain.tbSTRIKE.title'/>">strike</a>
+ -->
+ </fieldset>
+
+ <fieldset class="unit">
+ <legend><fmt:message key='editor.plain.extra'/></legend>
+ <a href="#" class="tool tACL" title="<fmt:message
key='editor.plain.tbACL.title'/>">acl</a>
+ <a href="#" class="tool tIMG" title="<fmt:message
key='editor.plain.tbIMG.title'/>">img</a>
+ <a href="#" class="tool tTABLE" title="<fmt:message
key='editor.plain.tbTABLE.title'/>">table</a>
+ <a href="#" class="tool tPLUGIN" title="<fmt:message
key='editor.plain.tbPLUGIN.title'/>">plugin</a>
+ <%--
+ <a href="#" class="tool tTOC" title="<fmt:message
key='editor.plain.tbTOC.title'/>">toc</a>
+ --%>
+ <a href="#" class="tool tDL" title="<fmt:message
key='editor.plain.tbDL.title'/>">dl</a>
+ <a href="#" class="tool tCODE" title="<fmt:message
key='editor.plain.tbCODE.title'/>">code</a>
+ <a href="#" class="tool tTAB" title="<fmt:message
key='editor.plain.tbTAB.title'/>">tab</a>
+ <a href="#" class="tool tSIGN" title="<fmt:message
key='editor.plain.tbSIGN.title'/>">sign</a>
+ <%-- --%>
+ </fieldset>
+
+ <div id="findDialog" style="display:none;clear:both;">
+ <input type="text" name="tbFIND" id="tbFIND" size="16"
value="find"/>
+ <s:checkbox name="options.findMatchCase" /><fmt:message
key="editor.plain.matchcase"/>
+ <s:checkbox name="options.findRegex" /><fmt:message
key="editor.plain.regexp"/>
+ <input type="text" name="tbREPLACE" id="tbREPLACE" size="16" />
+ <s:button class="btn" id="doreplace" name="findAndReplace" />
+ <s:checkbox name="options.findGlobal" /><fmt:message
key="editor.plain.global"/>
+ </div>
+
+ </div><%-- end of the toolbar --%>
+
+ <%-- Print any messages or validation errors --%>
+ <s:messages />
+ <s:errors />
+
+ <%-- If any conflicts, print the conflicting text here --%>
+ <c:if test="${not empty wikiActionBean.conflictText}">
+ <p>
+ <s:label for="conflictText" />
+ <s:textarea name="conflictText" readonly="true" />
+ </p>
+ <p>
+ <s:checkbox name="overrideConflict" />
+ <fmt:message key="overrideConflict" />
+ </p>
+ </c:if>
+
+ <%-- You knew this would be here somewhere. Yes, it's the textarea
where the user
+ actually edits stuff. --%>
+ <div id="editor-content" class="line" style="clear:both;">
+
+ <div class="unit size1of2">
+ <div class="editor-container">
+ <%-- js-insert: <div id="snipetoc"><ul>...</ul></div> --%>
+ <s:textarea id="wikiText" name="wikiText" class="editor"
rows="20" cols="80" />
+ <%-- js insert: <div class="resize-bar"></div> --%>
+ </div>
+ </div>
+
+ <div class="unit size1of2 lastUnit">
+ <div id="previewspin" class="spin"
style="display:none;"><fmt:message key="common.ajax.loading"/></div>
+ <div id="livepreview" class="xflow"></div>
+ </div>
+
+ </div>
+
+ <%-- Fields for changenote, renaming etc. --%>
+ <table>
+ <tr>
+ <td>
+ <s:label for="changenote" />
+ </td>
+ <td>
+ <s:text name="changenote" size="50" maxlength="80" />
+ </td>
+ </tr>
+ <wiki:UserCheck status="anonymous">
+ <tr>
+ <td><s:label for="author" accesskey="n" /></td>
+ <td><s:text name="author" /></td>
+ </tr>
+ <wiki:CheckRequestContext context="comment">
+ <tr>
+ <td><s:label for="email" accesskey="m" /></td>
+ <td><s:text name="email" size="24" /></td>
+ </tr>
+ </wiki:CheckRequestContext>
+ </wiki:UserCheck>
+ </table>
+
+ <%-- Spam detection fields and optional CAPTCHA --%>
+ <wiki:SpamProtect />
+
+ <%-- EditActionBean relies on these being found. So be careful, if
you make changes. --%>
+ <p id="submitbuttons">
+ <s:hidden name="page" />
+ <s:hidden name="startTime" />
+ <s:hidden name="append" />
+ <s:submit name="save" />
+ <s:submit name="cancel" />
+ </p>
+ </s:form>
+
+ </s:layout-component>
+ </s:layout-render>
+ </s:layout-component>
- <fieldset class="unit">
- <legend><fmt:message key='editor.plain.extra'/></legend>
- <a href="#" class="tool tACL" title="<fmt:message
key='editor.plain.tbACL.title'/>">acl</a>
- <a href="#" class="tool tIMG" title="<fmt:message
key='editor.plain.tbIMG.title'/>">img</a>
- <a href="#" class="tool tTABLE" title="<fmt:message
key='editor.plain.tbTABLE.title'/>">table</a>
- <a href="#" class="tool tPLUGIN" title="<fmt:message
key='editor.plain.tbPLUGIN.title'/>">plugin</a>
- <%--
- <a href="#" class="tool tTOC" title="<fmt:message
key='editor.plain.tbTOC.title'/>">toc</a>
- --%>
- <a href="#" class="tool tDL" title="<fmt:message
key='editor.plain.tbDL.title'/>">dl</a>
- <a href="#" class="tool tCODE" title="<fmt:message
key='editor.plain.tbCODE.title'/>">code</a>
- <a href="#" class="tool tTAB" title="<fmt:message
key='editor.plain.tbTAB.title'/>">tab</a>
- <a href="#" class="tool tSIGN" title="<fmt:message
key='editor.plain.tbSIGN.title'/>">sign</a>
- <%-- --%>
- </fieldset>
-
- <div id="findDialog" style="display:none;clear:both;">
- <input type="text" name="tbFIND" id="tbFIND" size="16" value="find"/>
- <s:checkbox name="options.findMatchCase" /><fmt:message
key="editor.plain.matchcase"/>
- <s:checkbox name="options.findRegex" /><fmt:message
key="editor.plain.regexp"/>
- <input type="text" name="tbREPLACE" id="tbREPLACE" size="16" />
- <s:button class="btn" id="doreplace" name="findAndReplace" />
- <s:checkbox name="options.findGlobal" /><fmt:message
key="editor.plain.global"/>
- </div>
-
- </div><%-- end of the toolbar --%>
-
- <%-- Print any messages or validation errors --%>
- <s:messages />
- <s:errors />
-
- <%-- If any conflicts, print the conflicting text here --%>
- <c:if test="${not empty wikiActionBean.conflictText}">
- <p>
- <s:label for="conflictText" />
- <s:textarea name="conflictText" readonly="true" />
- </p>
- <p>
- <s:checkbox name="overrideConflict" />
- <fmt:message key="overrideConflict" />
- </p>
- </c:if>
-
- <%-- You knew this would be here somewhere. Yes, it's the textarea where
the user
- actually edits stuff. --%>
- <div id="editor-content" class="line" style="clear:both;">
-
- <div class="unit size1of2">
- <div class="editor-container">
- <%-- js-insert: <div id="snipetoc"><ul>...</ul></div> --%>
- <s:textarea id="wikiText" name="wikiText" class="editor" rows="20"
cols="80" />
- <%-- js insert: <div class="resize-bar"></div> --%>
- </div>
- </div>
-
- <div class="unit size1of2 lastUnit">
- <div id="previewspin" class="spin" style="display:none;"><fmt:message
key="common.ajax.loading"/></div>
- <div id="livepreview" class="xflow"></div>
- </div>
-
- </div>
-
- <%-- Fields for changenote, renaming etc. --%>
- <table>
- <tr>
- <td>
- <s:label for="changenote" />
- </td>
- <td>
- <s:text name="changenote" size="50" maxlength="80" />
- </td>
- </tr>
- <wiki:UserCheck status="anonymous">
- <tr>
- <td><s:label for="author" accesskey="n" /></td>
- <td><s:text name="author" /></td>
- </tr>
- <wiki:CheckRequestContext context="comment">
- <tr>
- <td><s:label for="email" accesskey="m" /></td>
- <td><s:text name="email" size="24" /></td>
- </tr>
- </wiki:CheckRequestContext>
- </wiki:UserCheck>
- </table>
-
- <%-- Spam detection fields and optional CAPTCHA --%>
- <wiki:SpamProtect />
-
- <%-- EditActionBean relies on these being found. So be careful, if you
make changes. --%>
- <p id="submitbuttons">
- <s:hidden name="page" />
- <s:hidden name="startTime" />
- <s:hidden name="append" />
- <s:submit name="save" />
- <s:submit name="cancel" />
- </p>
- </s:form>
-
-</div>
\ No newline at end of file
+</s:layout-render>
Modified:
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/wysiwyg.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/editors/wysiwyg.jsp?rev=919824&r1=919823&r2=919824&view=diff
==============================================================================
---
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/wysiwyg.jsp
(original)
+++
incubator/jspwiki/trunk/src/WebContent/templates/default/editors/wysiwyg.jsp
Sat Mar 6 19:18:15 2010
@@ -48,7 +48,6 @@
--%>
<%
-
WikiContext context = WikiContextFactory.findContext( pageContext );
WikiEngine engine = context.getEngine();
//c.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.TRUE );
@@ -60,176 +59,197 @@
//String usertext = EditorManager.getEditedText(pageContext);
String usertext = engine.getPureText( wikiPage );
-
-
- //FIXME: seems to be broken
- //probably the default layout is invoked before these lines are
executed.
- //Needs to be refactored (ref v2.x)
- TemplateManager.addResourceRequest( context, "script",
"scripts/wysiwyg/MooEditable.js" );
- TemplateManager.addResourceRequest( context, "css",
"scripts/wysiwyg/MooEditable.SilkTheme.css" );
-%>
-<script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/wysiwyg/MooEditable.js' />"></script>
-
-<link rel="stylesheet" media="screen, projection, print" type="text/css"
href="<wiki:Link format='url' jsp='scripts/wysiwyg/MooEditable.css' />" />
-
-<link rel="stylesheet" media="screen, projection, print" type="text/css"
href="<wiki:Link format='url' jsp='scripts/wysiwyg/MooEditableSilkTheme.css'
/>" />
-
-<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 props = new Properties();
- props.putAll( engine.getWikiProperties() );
- props.setProperty( "jspwiki.renderingManager.renderer",
WysiwygEditingRenderer.class.getName() );
- renderingManager.initialize( engine, props );
-
- //String pageAsHtml = StringEscapeUtils.escapeJavaScript(
renderingManager.getHTML( context, usertext ) );
- String pageAsHtml = renderingManager.getHTML( context, usertext ) ;
-
- // Disable the WYSIWYG_EDITOR_MODE and reset the other properties
immediately
- // after the XHTML has been rendered.
- //context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE, Boolean.FALSE
);
- //context.setVariable( WikiEngine.PROP_RUNFILTERS, null );
- //wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS,
originalCCLOption );
-
-%>
-
-<div style="width:100%"> <%-- Required for IE6 on Windows --%>
-
- <%-- Print any validation errors --%>
- <s:errors />
+<s:layout-render name="${templates['layout/DefaultLayout.jsp']}">
- <s:form beanclass="org.apache.wiki.action.EditActionBean"
- class="wikiform"
- id="editform"
- method="post"
- acceptcharset="UTF-8"
- enctype="application/x-www-form-urlencoded" >
-
- <%-- If any conflicts, print the conflicting text here --%>
- <c:if test="${not empty wikiActionBean.conflictText}">
- <p>
- <s:label for="conflictText" />
- <s:textarea name="conflictText" readonly="true" />
- </p>
- </c:if>
-
-
- <%-- EditActionBean relies on these being found. So be careful, if you
make changes. --%>
- <p id="submitbuttons">
- <s:hidden name="page" />
- <s:hidden name="startTime" />
- <s:hidden name="append" />
- <c:set var="saveTitle" scope="page"><fmt:message
key="editor.plain.save.title" /></c:set>
- <wiki:CheckRequestContext context='edit'>
- <s:submit name="save" accesskey="s" title="${saveTitle}" />
- </wiki:CheckRequestContext>
- <wiki:CheckRequestContext context='comment'>
- <s:submit name="comment" accesskey="s" title="${saveTitle}" />
- </wiki:CheckRequestContext>
-
- <c:set var="previewTitle" scope="page"><fmt:message
key="editor.plain.preview.title" /></c:set>
- <s:submit name="preview" accesskey="v" title="${previewTitle}" />
-
- <c:set var="cancelTitle" scope="page"><fmt:message
key="editor.plain.cancel.title" /></c:set>
- <s:submit name="cancel" accesskey="q" title="${cancelTitle}" />
- </p>
-
- <%-- Fields for changenote, renaming etc. --%>
- <table>
- <tr>
- <td>
- <s:label for="changenote" name="changenote" />
- </td>
- <td>
- <s:text name="changenote" id="changenote" size="50" maxlength="80" />
- </td>
- </tr>
-
- <wiki:CheckRequestContext context="comment">
- <tr>
- <td><s:label for="author" accesskey="n" name="author" /></td>
- <td><s:text id="author" name="author" />
- <s:checkbox id="remember" name="remember" />
- <s:label for="remember" name="remember" />
- </td>
- </tr>
- <tr>
- <td><s:label for="link" accesskey="m" name="editor.plain.email" /></td>
- <td><s:text id="link" name="link" size="24" /></td>
- </tr>
- </wiki:CheckRequestContext>
-
- </table>
-
- <%-- FIXME: just for testing...
- <s:textarea id="htmlPageText" name="htmlPageText" class="editor" rows="10"
cols="80" />
- --%>
- <%-- FIXME:
- Remove all <a class="hashlink" >.</a> from the pageAsHtml !!
- --%>
- <textarea id="htmlPageText" name="htmlPageText" class="editor" rows="20"
cols="80" ><%= pageAsHtml%></textarea>
-
- <%-- FIXME: fake textarea to fool the action bean --%>
- <div style="display:none">
- <s:textarea id="wikiText" name="wikiText" class="editor" rows="20" cols="80"
/>
- </div>
-
-
- <%-- Spam detection fields --%>
- <wiki:SpamProtect />
-
-</s:form>
-</div>
-
-<script type="text/javascript">
-//<![CDATA[
-
-//FIXME: move this to jspwiki-edit.js
-window.addEvent('load', function(){
- $('htmlPageText').mooEditable();
-
- // Post submit
- /*
- $('editform').addEvent('submit', function(e){
- alert($('htmlPageText').value);
- return true;
- });
- */
-});
+ <%-- Page title should say Edit: + pagename --%>
+ <s:layout-component name="headTitle">
+ <fmt:message key="edit.title.edit">
+ <fmt:param><wiki:Variable var="ApplicationName" /></fmt:param>
+ <fmt:param><wiki:PageName/></fmt:param>
+ </fmt:message>
+ </s:layout-component>
+
+ <%-- Add Javascript for WYSIWYG editor --%>
+ <s:layout-component name="script">
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/jspwiki-edit.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/dialog.js' />"></script>
+ <script type="text/javascript" src="<wiki:Link format='url'
jsp='scripts/wysiwyg/MooEditable.js' />"></script>
+ </s:layout-component>
+
+ <%-- Stylesheets for WYSIWYG editor --%>
+ <s:layout-component name="stylesheet">
+ <link rel="stylesheet" media="screen, projection, print" type="text/css"
href="<wiki:Link format='url' jsp='scripts/wysiwyg/MooEditable.css' />" />
+ <link rel="stylesheet" media="screen, projection, print" type="text/css"
href="<wiki:Link format='url' jsp='scripts/wysiwyg/MooEditableSilkTheme.css'
/>" />
+ </s:layout-component>
+
+ <s:layout-component name="content">
+ <%-- FIXME: select CommentLayout or EditorLayout based on "comment" or
"edit" event--%>
+ <s:layout-render name="${templates['layout/EditorLayout.jsp']}">
+ <s:layout-component name="editor">
+
+ <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 props = new Properties();
+ props.putAll( engine.getWikiProperties() );
+ props.setProperty( "jspwiki.renderingManager.renderer",
WysiwygEditingRenderer.class.getName() );
+ renderingManager.initialize( engine, props );
+
+ //String pageAsHtml = StringEscapeUtils.escapeJavaScript(
renderingManager.getHTML( context, usertext ) );
+ String pageAsHtml = renderingManager.getHTML( context, usertext ) ;
+
+ // Disable the WYSIWYG_EDITOR_MODE and reset the other properties
immediately
+ // after the XHTML has been rendered.
+ //context.setVariable( RenderingManager.WYSIWYG_EDITOR_MODE,
Boolean.FALSE );
+ //context.setVariable( WikiEngine.PROP_RUNFILTERS, null );
+ //wikiPage.setAttribute( JSPWikiMarkupParser.PROP_CAMELCASELINKS,
originalCCLOption );
+
+ %>
+
+ <div style="width:100%"> <%-- Required for IE6 on Windows --%>
+
+ <%-- Print any validation errors --%>
+ <s:errors />
+
+ <s:form beanclass="org.apache.wiki.action.EditActionBean"
+ class="wikiform"
+ id="editform"
+ method="post"
+ acceptcharset="UTF-8"
+ enctype="application/x-www-form-urlencoded" >
+
+ <%-- If any conflicts, print the conflicting text here --%>
+ <c:if test="${not empty wikiActionBean.conflictText}">
+ <p>
+ <s:label for="conflictText" />
+ <s:textarea name="conflictText" readonly="true" />
+ </p>
+ </c:if>
+
+
+ <%-- EditActionBean relies on these being found. So be careful,
if you make changes. --%>
+ <p id="submitbuttons">
+ <s:hidden name="page" />
+ <s:hidden name="startTime" />
+ <s:hidden name="append" />
+ <c:set var="saveTitle" scope="page"><fmt:message
key="editor.plain.save.title" /></c:set>
+ <wiki:CheckRequestContext context='edit'>
+ <s:submit name="save" accesskey="s" title="${saveTitle}" />
+ </wiki:CheckRequestContext>
+ <wiki:CheckRequestContext context='comment'>
+ <s:submit name="comment" accesskey="s" title="${saveTitle}" />
+ </wiki:CheckRequestContext>
+
+ <c:set var="previewTitle" scope="page"><fmt:message
key="editor.plain.preview.title" /></c:set>
+ <s:submit name="preview" accesskey="v" title="${previewTitle}" />
+
+ <c:set var="cancelTitle" scope="page"><fmt:message
key="editor.plain.cancel.title" /></c:set>
+ <s:submit name="cancel" accesskey="q" title="${cancelTitle}" />
+ </p>
+
+ <%-- Fields for changenote, renaming etc. --%>
+ <table>
+ <tr>
+ <td>
+ <s:label for="changenote" name="changenote" />
+ </td>
+ <td>
+ <s:text name="changenote" id="changenote" size="50"
maxlength="80" />
+ </td>
+ </tr>
+
+ <wiki:CheckRequestContext context="comment">
+ <tr>
+ <td><s:label for="author" accesskey="n" name="author" /></td>
+ <td><s:text id="author" name="author" />
+ <s:checkbox id="remember" name="remember" />
+ <s:label for="remember" name="remember" />
+ </td>
+ </tr>
+ <tr>
+ <td><s:label for="link" accesskey="m"
name="editor.plain.email" /></td>
+ <td><s:text id="link" name="link" size="24" /></td>
+ </tr>
+ </wiki:CheckRequestContext>
+
+ </table>
+
+ <%-- FIXME: just for testing...
+ <s:textarea id="htmlPageText" name="htmlPageText" class="editor"
rows="10" cols="80" />
+ --%>
+ <%-- FIXME:
+ Remove all <a class="hashlink" >.</a> from the pageAsHtml !!
+ --%>
+ <textarea id="htmlPageText" name="htmlPageText" class="editor"
rows="20" cols="80" ><%= pageAsHtml%></textarea>
+
+ <%-- FIXME: fake textarea to fool the action bean --%>
+ <div style="display:none">
+ <s:textarea id="wikiText" name="wikiText" class="editor" rows="20"
cols="80" />
+ </div>
+
+
+ <%-- Spam detection fields --%>
+ <wiki:SpamProtect />
+
+ </s:form>
+ </div>
+
+ <script type="text/javascript">
+ //<![CDATA[
+
+ //FIXME: move this to jspwiki-edit.js
+ window.addEvent('load', function(){
+ $('htmlPageText').mooEditable();
+
+ // Post submit
+ /*
+ $('editform').addEvent('submit', function(e){
+ alert($('htmlPageText').value);
+ return true;
+ });
+ */
+ });
+
+ //]]>
+ </script>
+
+ </s:layout-component>
+ </s:layout-render>
+ </s:layout-component>
-//]]>
-</script>
+</s:layout-render>
Added:
incubator/jspwiki/trunk/src/WebContent/templates/default/layout/EditorLayout.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/templates/default/layout/EditorLayout.jsp?rev=919824&view=auto
==============================================================================
---
incubator/jspwiki/trunk/src/WebContent/templates/default/layout/EditorLayout.jsp
(added)
+++
incubator/jspwiki/trunk/src/WebContent/templates/default/layout/EditorLayout.jsp
Sat Mar 6 19:18:15 2010
@@ -0,0 +1,71 @@
+<%--
+ JSPWiki - a JSP-based WikiWiki clone.
+
+ 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.
+--%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://jakarta.apache.org/jspwiki.tld" prefix="wiki" %>
+<%@ taglib uri="http://stripes.sourceforge.net/stripes.tld" prefix="s" %>
+<%@ page errorPage="/Error.jsp" %>
+<s:layout-definition>
+ <wiki:TabbedSection defaultTab="edit">
+
+ <%-- View tab --%>
+ <wiki:Tab id="view" titleKey="view.tab" accesskey="v">
+ <wiki:InsertPage/>
+ </wiki:Tab>
+
+ <%-- Attachments tab --%>
+ <wiki:Tab id="attachments" accesskey="a"
+ title="${wiki:attachmentsTitle(request.Locale,
wikiActionBean.attachments)}">
+ <jsp:include page="${templates['tabs/AttachmentsTab.jsp']}" />
+ </wiki:Tab>
+
+ <%-- Info tab --%>
+ <wiki:Tab id="info" titleKey="info.tab" accesskey="i">
+ <jsp:include page="${templates['tabs/PageInfoTab.jsp']}" />
+ </wiki:Tab>
+
+ <%-- Editor tab --%>
+ <wiki:Tab id="edit" titleKey="edit.tab.edit" accesskey="e">
+ <s:layout-component name="editor" />
+ </wiki:Tab>
+
+ <%-- Preview tab --%>
+ <wiki:Tab id="preview" titleKey="preview.tab" accesskey="p"
+ onclick="Stripes.submitFormEvent('editform', 'preview',
'previewContent', null);">
+ <div class="information">
+ <fmt:message key="preview.info" />
+ </div>
+ <div id="previewContent"></div>
+ </wiki:Tab>
+
+ <%-- Help tab --%>
+ <wiki:Tab id="help" titleKey="edit.tab.help" accesskey="h">
+ <wiki:InsertPage page="EditPageHelp" />
+ <wiki:NoSuchPage page="EditPageHelp">
+ <div class="error">
+ <fmt:message key="comment.edithelpmissing">
+ <fmt:param><wiki:EditLink
page="EditPageHelp">EditPageHelp</wiki:EditLink></fmt:param>
+ </fmt:message>
+ </div>
+ </wiki:NoSuchPage>
+ </wiki:Tab>
+
+ </wiki:TabbedSection>
+</s:layout-definition>
Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=919824&r1=919823&r2=919824&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Sat Mar 6
19:18:15 2010
@@ -77,7 +77,7 @@
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "212";
+ public static final String BUILD = "213";
/**
* This is the generic version string you should use
Modified:
incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java?rev=919824&r1=919823&r2=919824&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
(original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/action/EditActionBean.java
Sat Mar 6 19:18:15 2010
@@ -62,6 +62,7 @@
import org.apache.wiki.preferences.Preferences.TimeFormat;
import org.apache.wiki.providers.ProviderException;
import org.apache.wiki.render.RenderingManager;
+import org.apache.wiki.ui.EditorManager;
import org.apache.wiki.ui.stripes.*;
import org.apache.wiki.util.HttpUtil;
import org.apache.wiki.util.TextUtil;
@@ -167,8 +168,9 @@
/**
* Loads the page's current text, initializes the EditActionBean for
- * editing, and forwards to the template JSP {...@code Edit.jsp}.
- * @return always returns a {...@link ForwardResolution} to the template
JSP
+ * editing, and forwards to the template JSP for the editor; for example,
+ * {...@code editors/plain.jsp}.
+ * @return always returns a {...@link ForwardResolution} to the editor JSP
* @throws ProviderException if the page's current contents cannot
* be retrieved
*/
@@ -183,7 +185,9 @@
// Init edit fields and forward to the display JSP
initEditFields( "Editing" );
- return new TemplateResolution( "Edit.jsp" );
+ WikiActionBeanContext context = getContext();
+ EditorManager editors = context.getEngine().getEditorManager();
+ return new TemplateResolution( editors.getEditorPath( context ) );
}
/**