jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brus...@apache.org
Subject svn commit: r1738006 - in /jspwiki/trunk: ./ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/scripts/behaviors/ jspwiki-war/src/main/scripts/moo-extend/ jspwiki-war/src/main/styles/haddock/default/ jspwiki-war/src/main/webapp/ jspwiki-w...
Date Wed, 06 Apr 2016 16:47:38 GMT
Author: brushed
Date: Wed Apr  6 16:47:37 2016
New Revision: 1738006

URL: http://svn.apache.org/viewvc?rev=1738006&view=rev
Log:
2.10.3-svn-9  Few fixes on the HADDOCK template 
       * improved styling of broken image links       
       * [JSPWIKI-394] Haddock: "page modified" markup differs to the original edits
       * Allow google-fonts in %%add-css

Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/AddCSS.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/GraphBar.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Array.NaturalSort.js
    jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/Template.Content.less
    jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/type.less
    jspwiki/trunk/jspwiki-war/src/main/webapp/PageModified.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ConflictContent.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/UserBox.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ViewTemplate.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Wed Apr  6 16:47:37 2016
@@ -1,3 +1,15 @@
+2016-04-06  Dirk Frederickx (brushed AT apache DOT org)
+
+       * 2.10.3-svn-9  Few fixes on the HADDOCK template 
+       
+       * improved styling of broken image links
+       
+       * [JSPWIKI-394] Haddock: "page modified" markup differs to the original edits
+         Improved styling of the PageModified/Conflict jsp's
+       
+       * Allow google-fonts in %%add-css
+
+
 2016-04-03  Dirk Frederickx (brushed AT apache DOT org)
 
        * 2.10.3-svn-8  Few more fixes on the HADDOCK template 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Wed Apr  6 16:47:37
2016
@@ -72,7 +72,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "8";
+    public static final String     BUILD         = "9";
 
     /**
      *  This is the generic version string you should use when printing out the version.
 It is of 

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/AddCSS.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/AddCSS.js?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/AddCSS.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/AddCSS.js Wed Apr  6 16:47:37 2016
@@ -40,10 +40,23 @@ function AddCSS( element ){
         //collect all css to be inserted
         while( item = elements.shift() ){ css += item.innerHTML; }
 
+        //allow google fonts @import url(https://fonts.googleapis.com/css?family=XXXX);
+        css = css.replace( /@import url\(https:\/\/fonts.googleapis.com\/css\?family=/gi,
"@imp@rt" );
+
         //magic to replace the inline wiki-image links to css url()
         //xss protection: remove invalid url's;  only allow url([wiki-attachement])
         css = css.replace( /url\(\<[^i][^)]*\)/gi, "url(invalid)" ); //remove url(<a...)
         css = css.replace( /url\([^<][^)]*\)/gi, "url(invalid)" );  //remove url(xxx)
+
+        //xss protection: remove @import statements
+        css = css.replace( /@import/gi, "invalid" );
+
+        //allow google fonts
+        css = css.replace( /@imp@rt/g, "@import url(https://fonts.googleapis.com/css?family=");
+
+        //xss protection: remove IE dynamic properties
+        css = css.replace( /expression|behavior/gi,"invalid" );
+
         css = css.replace( /url\(<img class="inline" .*?src="([^"]+)[^>]*>\)/gi,
"url($1)" );
 
         css = css.replace( /<p>|<\/p>/gi, "" ); //jspwiki inserts <p/>
for empty lines

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/GraphBar.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/GraphBar.js?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/GraphBar.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/behaviors/GraphBar.js Wed Apr  6 16:47:37 2016
@@ -137,6 +137,7 @@ var GraphBar = new Class({
                 }
 
                 data = data.scale(options.minv, options.maxv)
+                console.log(data);
 
                 for( i = 0; i < len; i++){
 
@@ -233,7 +234,8 @@ var GraphBar = new Class({
         //color mixer
         var c =color1;
         if( !isProgress && color2 ){ color1 = color1.mix(color2, 100 * (isGauge ?
val : percent)); }
-console.log(c,color1, val, percent, c, c  && c.mix(color2,0),isGauge );
+
+        //console.log(c,color1, val, percent, c, c  && c.mix(color2,0),isGauge );
 
         val = val * 100;
 

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Array.NaturalSort.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Array.NaturalSort.js?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Array.NaturalSort.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Array.NaturalSort.js Wed Apr  6
16:47:37 2016
@@ -118,8 +118,7 @@ Array.implement({
             if( !isNaN(column) ){ val = ( isNode ? val.getChildren() : val )[column]; }
 
             //retrieve the value and convert to string
-            val = ("" + (isNode ? val.getAttribute("jspwiki:sortvalue") || val.get("text")
|| val.get("title") : val)).trim();
-
+            val = ("" + (isNode ? val.getAttribute("data-sortvalue") || val.get("text") ||
val.get("title") : val)).trim();
 
             //2. Convert and store in type specific arrays (num, dmy, kmgt, nat)
 

Modified: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/Template.Content.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/Template.Content.less?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/Template.Content.less (original)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/Template.Content.less Wed Apr
 6 16:47:37 2016
@@ -121,8 +121,7 @@ We may just hide the on/off toggle in cs
 	//& > h2, & > h3, & > h4,  { margin-top:0; }
 }
 .page-content {
-    //margin:0 @padding-base-horizontal  @padding-base-vertical @padding-base-horizontal;
-    margin:0 @padding-base-horizontal;
+    padding: @padding-base-horizontal;
 }
 
 

Modified: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/type.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/type.less?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/type.less (original)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/default/type.less Wed Apr  6 16:47:37
2016
@@ -250,9 +250,23 @@ Footnotes
 Images
 */
 img {
-    border:0;
     &.inline { .img-responsive; /*max-width:100%;*/ }
 }
+img { position:relative;}
+img:before {
+   content:"\e607  ";
+   font-family: FontJspwiki;
+   color:@red;
+}
+img:after {
+    content: "Broken Image: [" attr(alt) "]";
+    position: absolute;
+    display:inline-block; width:100%;height:100%;
+    background:@white;
+    left:20px;padding-top:.5em;
+    color:@red;
+}
+
 //img.inline
 //img.outlink
 //img.attlink

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/PageModified.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/PageModified.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/PageModified.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/PageModified.jsp Wed Apr  6 16:47:37 2016
@@ -14,7 +14,7 @@
     "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.  
+    under the License.
 --%>
 
 <%@ page import="org.apache.log4j.*" %>
@@ -26,7 +26,7 @@
 <%@ page errorPage="/Error.jsp" %>
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
 
-<%! 
+<%!
     Logger log = Logger.getLogger("JSPWiki");
 %>
 
@@ -41,11 +41,9 @@
 
     // Make the user and conflicting text presentable for display.
     usertext = StringEscapeUtils.escapeXml( usertext );
-    usertext = TextUtil.replaceString( usertext, "\n", "<br />" );
 
     String conflicttext = wiki.getText(pagereq);
     conflicttext = StringEscapeUtils.escapeXml( conflicttext );
-    conflicttext = TextUtil.replaceString( conflicttext, "\n", "<br />" );
 
     pageContext.setAttribute( "conflicttext",
                               conflicttext,

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp Wed Apr
 6 16:47:37 2016
@@ -125,7 +125,7 @@
 
       <td><wiki:PageVersion /></td>
 
-      <td class="nowrap" jspwiki:sortvalue="${att.lastModified.time}">
+      <td class="nowrap" data-sortvalue="${att.lastModified.time}">
         <fmt:formatDate value="${att.lastModified}" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}"
/>
       </td>
 

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ConflictContent.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ConflictContent.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ConflictContent.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ConflictContent.jsp Wed Apr
 6 16:47:37 2016
@@ -22,22 +22,24 @@
 <%@ page import="javax.servlet.jsp.jstl.fmt.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
-<div class="page-content">
+<div class="page-content prettify">
 
-<h4><%=LocaleSupport.getLocalizedMessage(pageContext, "conflict.oops.title")%></h4>
+<h4><fmt:message key="conflict.oops.title"/></h4>
   <div class="error">
     <fmt:message key="conflict.oops" />
   </div>
-  <fmt:message key="conflict.goedit" >
-    <fmt:param><wiki:EditLink><wiki:PageName /></wiki:EditLink></fmt:param>
-  </fmt:message>
-
-<h4><%=LocaleSupport.getLocalizedMessage(pageContext, "conflict.modified")%></h4>
-
-  <pre><%=pageContext.getAttribute("conflicttext",PageContext.REQUEST_SCOPE)%></pre>
-
-<h4><%=LocaleSupport.getLocalizedMessage(pageContext, "conflict.yourtext")%></h4>
-
-  <pre><%=pageContext.getAttribute("usertext",PageContext.REQUEST_SCOPE)%></pre>
+  <wiki:Link cssClass="btn btn-primary btn-block" context="edit" >
+    <fmt:message key="conflict.goedit" >
+      <fmt:param><wiki:PageName /></fmt:param>
+    </fmt:message>
+  </wiki:Link>
+<br />
+<div class="columns">
+<h4><fmt:message key="conflict.modified"/></h4>
+  <pre>${conflicttext}</pre>
+<hr />
+<h4><fmt:message key="conflict.yourtext"/></h4>
+  <pre>${usertext}</pre>
+</div>
 
 </div>
\ No newline at end of file

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp Wed Apr  6
16:47:37 2016
@@ -182,7 +182,7 @@
           </wiki:Link>
         </td>
 
-	    <td class="nowrap" jspwiki:sortvalue="${currentPage.lastModified.time}">
+	    <td class="nowrap" data-sortvalue="${currentPage.lastModified.time}">
         <fmt:formatDate value="${currentPage.lastModified}" pattern="${prefs.DateFormat}"
timeZone="${prefs.TimeZone}" />
         </td>
 
@@ -344,7 +344,7 @@
 
       <td><wiki:PageVersion /></td>
 
-	  <td class="nowrap" jspwiki:sortvalue="${att.lastModified.time}">
+	  <td class="nowrap" data-sortvalue="${att.lastModified.time}">
 	    <fmt:formatDate value="${att.lastModified}" pattern="${prefs.DateFormat}" timeZone="${prefs.TimeZone}"
/>
 	  </td>
 

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp Wed Apr  6 16:47:37
2016
@@ -51,14 +51,14 @@
     </c:set>
 
   <%-- view --%>
-  <wiki:CheckRequestContext context='info|diff|upload|rename|edit'>
+  <wiki:CheckRequestContext context='info|diff|upload|rename|edit|conflict'>
   <li id="view">
     <wiki:Link page="${page}" ><fmt:message key="view.tab"/></wiki:Link>
   </li>
   </wiki:CheckRequestContext>
 
   <%-- attachment --%>
-  <wiki:CheckRequestContext context='view|info|rename|diff|rename|edit'>
+  <wiki:CheckRequestContext context='view|info|rename|diff|rename|edit|conflict'>
   <wiki:PageExists>
   <li id="attach"
    class="<wiki:Permission permission='!upload'>disabled</wiki:Permission>">
@@ -71,7 +71,7 @@
   </wiki:CheckRequestContext>
 
   <%-- info --%>
-  <wiki:CheckRequestContext context='view|info|upload|rename|edit'>
+  <wiki:CheckRequestContext context='view|info|upload|rename|edit|conflict'>
   <wiki:PageExists>
   <li id="info">
     <wiki:Link context="info" accessKey="i">
@@ -194,13 +194,13 @@
           <wiki:CheckVersion mode="latest">
             <wiki:Link cssClass="reader-view">
               <wiki:Param name='skin' value='reader'/>
-              <fmt:message key='actions.showreaderview' /><span class="icon-leanpub"
></span>
+              <fmt:message key='actions.showreaderview' /> <span class="icon-leanpub"
></span>
             </wiki:Link>
           </wiki:CheckVersion>
           <wiki:CheckVersion mode="notlatest">
             <wiki:Link cssClass="reader-view" version="${param.version}">
               <wiki:Param name='skin' value='reader'/>
-              <fmt:message key='actions.showreaderview' /><span class="icon-leanpub"
></span>
+              <fmt:message key='actions.showreaderview' /> <span class="icon-leanpub"
></span>
             </wiki:Link>
           </wiki:CheckVersion>
         </li>

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/UserBox.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/UserBox.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/UserBox.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/UserBox.jsp Wed Apr  6 16:47:37
2016
@@ -33,7 +33,7 @@
 
 <div class="cage pull-right userbox user-${loginstatus}">
 
-  <div class="btn"><span class="icon-user"></span><span class="caret"/></span></div>
+  <div class="btn"><span class="icon-user"></span><span class="caret"></span></div>
 
   <ul class="dropdown-menu pull-right" data-hover-parent=".userbox">
 
@@ -73,8 +73,7 @@
           <wiki:Link cssClass="btn btn-default btn-block" jsp="UserPreferences.jsp">
             <wiki:Param name='redirect' value='${redirect}'/>
             <wiki:Param name='tab' value='groups'/>
-            <span class="icon-group"></span>
-            <fmt:message key="actions.groups" />
+            <span class="icon-group"></span> <fmt:message key="actions.groups"
/>
           </wiki:Link>
           </wiki:Permission>
          </wiki:CheckRequestContext>
@@ -86,9 +85,8 @@
         <wiki:CheckRequestContext context='!login'>
         <wiki:Permission permission="login">
           <wiki:Link cssClass="btn btn-primary btn-block login" jsp="Login.jsp">
-            <span class="icon-signin"></span>
             <wiki:Param name='redirect' value='${redirect}'/>
-          <fmt:message key="actions.login" />
+            <span class="icon-signin"></span> <fmt:message key="actions.login"
/>
         </wiki:Link>
         </wiki:Permission>
         <wiki:Permission permission='editProfile'>
@@ -106,8 +104,7 @@
       <wiki:UserCheck status="authenticated">
         <a href="<wiki:Link jsp='Logout.jsp' format='url' />"
           class="btn btn-default btn-block logout" data-modal=".modal">
-            <span class="icon-signout"></span>
-          <fmt:message key="actions.logout"/>
+            <span class="icon-signout"></span> <fmt:message key="actions.logout"/>
           <div class="modal"><fmt:message key='actions.confirmlogout'/></div>
         </a>
       </wiki:UserCheck>

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ViewTemplate.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ViewTemplate.jsp?rev=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ViewTemplate.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/ViewTemplate.jsp Wed Apr 
6 16:47:37 2016
@@ -53,7 +53,7 @@
 
   <c:set var="sidebar"><wiki:Variable var='sidebar' /></c:set><%-- page
variable setting--%>
   <c:set var="sidebar" value="${not sidebar ? prefs.Sidebar : sidebar }" />
-  <wiki:CheckRequestContext context='login|prefs|createGroup|viewGroup'>
+  <wiki:CheckRequestContext context='login|prefs|createGroup|viewGroup|conflict'>
     <c:set var="sidebar" value="" />
   </wiki:CheckRequestContext>
   <div class="content ${sidebar}" data-toggle="li#menu,.sidebar>.close" data-toggle-pref="Sidebar"
>

Modified: 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=1738006&r1=1738005&r2=1738006&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/editors/wysiwyg.jsp Wed Apr
 6 16:47:37 2016
@@ -90,6 +90,7 @@
     if( usertext == null ) usertext = "";
 
     RenderingManager renderingManager = new RenderingManager();
+    //RenderingManager renderingManager = engine.getRenderingManager();
 
     // since the WikiProperties are shared, we'll want to make our own copy of it for modifying.
     Properties copyOfWikiProperties = new Properties();



Mime
View raw message