This is an automated email from the ASF dual-hosted git repository.
brushed pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
The following commit(s) were added to refs/heads/master by this push:
new e8dd352 2.11.0-M3-git-01 TEMPLATE fixes for UserPreferences in Dark
Mode
e8dd352 is described below
commit e8dd3526bedd5cd59380e67f9ad604933b36a9b3
Author: brushed <[email protected]>
AuthorDate: Sat Mar 9 20:44:48 2019 +0100
2.11.0-M3-git-01 TEMPLATE fixes for UserPreferences in Dark Mode
UserPreferences fixes
- new toggle style for on/off switches
- restyle bi-model checkboxes for Page Layout setting
- fix a few style issues in the UserPreferences when in Dark Mode
The JSPWiki template should by default open up in the light mode.
Consistent css-style for the toolbar of the jspwiki wysiwyg editor
Added Description meta-tag to improve on-page SEO
* Added the Content-Security-Policy meta-tag to reduce the risk of
XSS attacks
---
ChangeLog | 18 +++++
.../src/main/java/org/apache/wiki/Release.java | 2 +-
.../src/main/resources/ini/jspwiki.properties | 2 +-
.../haddock/default/responsive-viewport.less | 6 +-
.../src/main/styles/haddock/default/variables.less | 14 +++-
.../main/styles/haddock/default/wiki-wysiwyg.less | 80 ++++++++++++++++++++++
.../static/templates/default/haddock-dark.css | 43 ++++++++----
.../webapp/templates/default/PreferencesTab.jsp | 32 ++++++---
.../main/webapp/templates/default/commonheader.jsp | 10 +++
.../webapp/templates/default/editors/wysiwyg.jsp | 3 +-
10 files changed, 177 insertions(+), 33 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 47d91db..d71fa6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2019-03-09 Dirk Frederickx (brushed AT apache DOT org)
+
+ * 2.11.0-M3-git-01
+
+ * UserPreferences fixes
+ - new toggle style for on/off switches
+ - restyle bi-model checkboxes for Page Layout setting
+ - fix a few style issues in the UserPreferences when in Dark Mode
+
+ * The JSPWiki template should by default open up in the light mode.
+
+ * Consistent css-style for the toolbar of the jspwiki wysiwyg editor
+
+ * Added Description meta-tag to improve on-page SEO
+
+ * Added the Content-Security-Policy meta-tag to reduce the risk of XSS
attacks.
+
+
2019-03-04 Juan Pablo Santos (juanpablo AT apache DOT org)
* prepare release for 2.11.0.M2
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/Release.java
b/jspwiki-main/src/main/java/org/apache/wiki/Release.java
index c76de20..96f5860 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/Release.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/Release.java
@@ -72,7 +72,7 @@ public final class Release {
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "";
+ public static final String BUILD = "01";
/**
* This is the generic version string you should use when printing out
the version. It is of
diff --git a/jspwiki-main/src/main/resources/ini/jspwiki.properties
b/jspwiki-main/src/main/resources/ini/jspwiki.properties
index cd51a2d..ac36959 100644
--- a/jspwiki-main/src/main/resources/ini/jspwiki.properties
+++ b/jspwiki-main/src/main/resources/ini/jspwiki.properties
@@ -998,7 +998,7 @@ jspwiki.defaultprefs.template.editor =plain
jspwiki.defaultprefs.template.sectionediting =true
# Set Appearance light/dark
-jspwiki.defaultprefs.template.appearance =true
+jspwiki.defaultprefs.template.appearance =false
# Set the language
# By default, the language is read from the client browser http request
diff --git
a/jspwiki-war/src/main/styles/haddock/default/responsive-viewport.less
b/jspwiki-war/src/main/styles/haddock/default/responsive-viewport.less
index 79670e6..fdd89df 100644
--- a/jspwiki-war/src/main/styles/haddock/default/responsive-viewport.less
+++ b/jspwiki-war/src/main/styles/haddock/default/responsive-viewport.less
@@ -162,8 +162,10 @@ Medium size screens, tablets, phones in landscape mode
padding-top: @padding-xs-vertical;
padding-bottom:@padding-xs-vertical;
- background-size: @padding-small-horizontal
@padding-small-horizontal;
- background-position:@padding-small-horizontal center;
+ background-position:
+ ( @padding-small-horizontal + @wikiTriangleSize/2 )
@padding-small-vertical*1,
+ ( @padding-small-horizontal - @wikiTriangleSize*3/2 )
@padding-small-vertical*1;
+
}
label.form-switch {
padding-top: @padding-small-vertical;
diff --git a/jspwiki-war/src/main/styles/haddock/default/variables.less
b/jspwiki-war/src/main/styles/haddock/default/variables.less
index a5210e9..695f54c 100644
--- a/jspwiki-war/src/main/styles/haddock/default/variables.less
+++ b/jspwiki-war/src/main/styles/haddock/default/variables.less
@@ -120,11 +120,19 @@ images/feather-small.png wxh 162x286
// Forms
@wikiFormFontColor: hsl(240, 100%, 23%); //font color for input, textarea
form element
-@wikiFormSwitchColor:fade(@silver, 70%);
-@wikiFormSwitchColorOn:fade(@blue, 70%);
-@wikiTriangleSize: @padding-base-horizontal/2;
+@wikiFormSwitch-bg:fade(@silver, 70%);
+@wikiFormSwitch-border:fade(@silver, 70%);
+@wikiFormSwitchOn-bg:fade(@blue, 70%);
+@wikiFormSwitchOn-border:fade(@blue, 70%);
+
+@wikiTriangleSize: @padding-base-horizontal/2.5;
@wikiTriangleColor: @wiki-header-bg;
+@wikiRadioActive-color: @btn-primary-color;
+@wikiRadioActive-bg: lighten(@wiki-header-bg,10%);
+@wikiRadioActive-border: lighten(@wiki-header-bg,10%);
+
+
// Highlight
@wiki-hover: @dropdown-link-hover-bg;
@highlight: hsla(60, 100%, 50%, 0.05); //highlight in item lists, search
filter, ...
diff --git a/jspwiki-war/src/main/styles/haddock/default/wiki-wysiwyg.less
b/jspwiki-war/src/main/styles/haddock/default/wiki-wysiwyg.less
new file mode 100644
index 0000000..ae43c3a
--- /dev/null
+++ b/jspwiki-war/src/main/styles/haddock/default/wiki-wysiwyg.less
@@ -0,0 +1,80 @@
+/*
+ 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"); fyou 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.
+*/
+
+/*
+Overwrite of MooEditable.css,
+adopting the jspwiki haddock icons for the editor toolbar
+
+DOM Structure:
+
+<div class="mooeditable-ui-toolbar ">
+ <button class="mooeditable-ui-button bold-item toolbar-item"
title="Bold ( Cmd+B )">
+ <span class="button-icon"></span>
+ <span class="button-text">Bold</span>
+ </button>
+ <button class="mooeditable-ui-button italic-item toolbar-item"
title="Italic ( Cmd+I )"><span class="button-icon"></span><span
class="button-text">Italic</span></button>
+ <button class="mooeditable-ui-button underline-item toolbar-item"
title="Underline ( Cmd+U )"><span class="button-icon"></span><span
class="button-text">Underline</span></button>
+ <button class="mooeditable-ui-button strikethrough-item toolbar-item"
title="Strikethrough ( Cmd+S )"><span class="button-icon"></span><span
class="button-text">Strikethrough</span></button>
+
+ <span class="toolbar-separator"></span>
+
+ <select class="formatBlock-item toolbar-item" title="Block Formatting"
style="height: 21px;">
+ <option value="p" style="">Paragraph</option>
+ <option value="h2" style="font-size:18px;
font-weight:bold;">Heading 2</option>
+ <option value="h3" style="font-size:14px;
font-weight:bold;">Heading 3</option>
+ <option value="h4" style="font-size:12px;
font-weight:bold;">Heading 4</option>
+ </select>
+
+ <button class="mooeditable-ui-button justifyleft-item toolbar-item"
title="Align Left"><span class="button-icon"></span><span
class="button-text">Align Left</span></button>
+ <button class="mooeditable-ui-button justifyright-item toolbar-item"
title="Align Right"><span class="button-icon"></span><span
class="button-text">Align Right</span></button>
+ <button class="mooeditable-ui-button justifycenter-item toolbar-item"
title="Align Center"><span class="button-icon"></span><span
class="button-text">Align Center</span></button>
+ <button class="mooeditable-ui-button justifyfull-item toolbar-item"
title="Align Justify"><span class="button-icon"></span><span
class="button-text">Align Justify</span></button>
+ <span class="toolbar-separator"></span>
+ <button class="mooeditable-ui-button insertunorderedlist-item
toolbar-item" title="Unordered List"><span class="button-icon"></span><span
class="button-text">Unordered List</span></button>
+ <button class="mooeditable-ui-button insertorderedlist-item
toolbar-item" title="Ordered List"><span class="button-icon"></span><span
class="button-text">Ordered List</span></button>
+ <button class="mooeditable-ui-button indent-item toolbar-item"
title="Indent"><span class="button-icon"></span><span
class="button-text">Indent</span></button>
+ <button class="mooeditable-ui-button outdent-item toolbar-item"
title="Outdent"><span class="button-icon"></span><span
class="button-text">Outdent</span></button>
+ <button class="mooeditable-ui-button insertHorizontalRule-item
toolbar-item" title="Insert Horizontal Rule"><span
class="button-icon"></span><span class="button-text">Insert Horizontal
Rule</span></button>
+ <span class="toolbar-separator"></span>
+ <button class="mooeditable-ui-button undo-item toolbar-item"
title="Undo ( Cmd+Z )"><span class="button-icon"></span><span
class="button-text">Undo</span></button>
+ <button class="mooeditable-ui-button redo-item toolbar-item"
title="Redo ( Cmd+Y )"><span class="button-icon"></span><span
class="button-text">Redo</span></button>
+ <button class="mooeditable-ui-button removeformat-item toolbar-item"
title="Remove Formatting"><span class="button-icon"></span><span
class="button-text">Remove Formatting</span></button>
+ <span class="toolbar-separator"></span>
+ <button class="mooeditable-ui-button createlink-item toolbar-item"
title="Add Hyperlink ( Cmd+L )"><span class="button-icon"></span><span
class="button-text">Add Hyperlink</span></button>
+ <button class="mooeditable-ui-button unlink-item toolbar-item"
title="Remove Hyperlink"><span class="button-icon"></span><span
class="button-text">Remove Hyperlink</span></button>
+ <span class="toolbar-separator"></span>
+ <button class="mooeditable-ui-button urlimage-item toolbar-item"
title="Add Image ( Cmd+M )"><span class="button-icon"></span><span
class="button-text">Add Image</span></button>
+ <span class="toolbar-separator"></span>
+ <button class="mooeditable-ui-button toggleview-item toolbar-item"
title="Toggle View"><span class="button-icon"></span><span
class="button-text">Toggle View</span></button>
+</div>
+
+
+*/
+
+.mooeditable-ui-toolbar {
+
+ .bold-item .button-icon {
+ .btn;
+ .btn-default;
+
+ }
+
+}
diff --git
a/jspwiki-war/src/main/styles/static/templates/default/haddock-dark.css
b/jspwiki-war/src/main/styles/static/templates/default/haddock-dark.css
index afaa9b9..528e6a6 100644
--- a/jspwiki-war/src/main/styles/static/templates/default/haddock-dark.css
+++ b/jspwiki-war/src/main/styles/static/templates/default/haddock-dark.css
@@ -57,15 +57,19 @@ html {
--border-color: var(--background-lighter);
- --context-primary: #0088cc;
- --context-success: #47a447;
- --context-info: #5bc0de;
- --context-warning: #ed9c28;
- --context-error: #d53f3a;
- --color-black: #111;
- --color-white: #fff;
-
- --wikiTriangleColor: var(--context-info);
+ --context-primary: hsl(200, 100%, 40%); /*#0088cc*/
+ --context-success: hsl(120, 40%, 46%); /*#47a447*/
+ --context-info: hsl(194, 66%, 61%); /*#5bc0de*/
+ --context-info-darker: hsl(193, 53%, 43%); /*10% darker */
+ --context-warning: hsl(35, 85%, 54%); /*#ed9c28*/
+ --context-error: hsl( 2, 65%, 53%); /*#d53f3a*/
+ --color-black: hsl(0, 0%, 7%); /*#111*/
+ --color-white: hsl(0,0%, 100%); /*#fff*/
+
+
+ --button-active: hsl(214, 68%, 58%);
+ --button-active-darker: hsl(214, 68%, 51%);
+ --wikiTriangleColor: var(--button-active);
--wikiTriangleSize: 4.8px;
--padding-base-horizontal: 12px;
--padding-base-vertical: 6px;
@@ -192,15 +196,24 @@ html {
label.form-switch > input[type=checkbox],
input[type=checkbox].form-switch {
- box-shadow:inset -1.25em 0 0 1px var(--background-lighter);
- background-color:transparent;
- border:1px solid var(--background-lighter);
+ box-shadow:inset -1.25em 0 0 1px var(--text-color-normal);
+ background-color:var(--background-light);
+ border:1px solid var(--text-color-normal);
+}
+label.form-switch > input[type=checkbox]:hover,
+input[type=checkbox].form-switch:hover {
+ box-shadow:inset -1.25em 0 0 1px var(--text-color-normal);
+ border: 1px solid var(--text-color-normal);
}
-
label.form-switch > input[type=checkbox]:checked,
input[type=checkbox].form-switch:checked {
- box-shadow: inset 1.25em 0 0 1px var(--context-info);
- border: 1px solid var(--context-info);
+ box-shadow: inset 1.25em 0 0 1px var(--button-active);
+ border: 1px solid var(--button-active);
+}
+label.form-switch > input[type=checkbox]:checked:hover,
+input[type=checkbox].form-switch:checked:hover {
+ box-shadow:inset 1.25em 0 0 1px var(--button-active-darker);
+ border: 1px solid var(--button-active-darker);
}
label.form-switch > input[type=checkbox]:focus,
input[type=checkbox].form-switch:focus {
diff --git a/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
b/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
index e9199c8..d77c3e2 100644
--- a/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/PreferencesTab.jsp
@@ -165,19 +165,31 @@
</c:if>
<div class="form-group">
- <label class="hidden" for="prefLayout"><fmt:message
key="prefs.user.layout"/></label>
<label class="control-label form-col-20"
for="prefOrientation"><fmt:message key="prefs.user.layout"/></label>
- <select id="prefLayout" name="prefLayout" data-pref="Layout">
- <option value='fluid' ${prefs.Layout=='fluid' ? 'selected="selected"' :
''} ><fmt:message key="prefs.user.layout.fluid"/></option>
- <option value='fixed' ${prefs.Layout=='fixed' ? 'selected="selected"' :
''} ><fmt:message key="prefs.user.layout.fixed"/></option>
- </select>
- <select id="prefOrientation" name="prefOrientation"
data-pref="Orientation">
- <option value='fav-left' ${prefs.Orientation=='fav-left' ?
'selected="selected"' : ''} ><fmt:message
key="prefs.user.orientation.left"/></option>
- <option value='fav-right' ${prefs.Orientation=='fav-right' ?
'selected="selected"' : ''} ><fmt:message
key="prefs.user.orientation.right"/></option>
- <%-- <option value='fav-hidden' ${prefs.Orientation=='fav-hidden' ?
'selected="selected"' : ''} ><fmt:message
key="prefs.user.orientation.hidden"/></option> --%>
- </select>
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-default" >
+ <input type="radio" data-pref="Layout"
+ name="prefLayout" ${prefs.Layout!='fixed' ?
"checked='checked'" : ""} value="fluid"><fmt:message
key='prefs.user.layout.fluid' />
+ </label>
+ <label class="btn btn-default">
+ <input type="radio" data-pref="Layout"
+ name="prefLayout" ${prefs.Layout=='fixed' ?
"checked='checked'" : ""} value="fixed"><fmt:message
key='prefs.user.layout.fixed' />
+ </label>
+ </div>
+
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-default">
+ <input type="radio" data-pref="Orientation"
+ name="prefOrientation"
${prefs.Orientation=='fav-left' ? "checked='checked'" : ""}
value="fav-left"><fmt:message key='prefs.user.orientation.left' />
+ </label>
+ <label class="btn btn-default">
+ <input type="radio" data-pref="Orientation"
+ name="prefOrientation"
${prefs.Orientation=='fav-right' ? "checked='checked'" : ""}
value="fav-right"><fmt:message key='prefs.user.orientation.right' />
+ </label>
+ </div>
</div>
+
<div class="form-group">
<label class="control-label form-col-20" for="prefTimeFormat"><fmt:message
key="prefs.user.timeformat"/></label>
<select id="prefTimeFormat" name="prefTimeFormat" data-pref="DateFormat">
diff --git a/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
b/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
index d5f0cb4..7bc559d 100644
--- a/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/commonheader.jsp
@@ -44,6 +44,16 @@ BOOTSTRAP, IE compatibility /
http://getbootstrap.com/getting-started/#support-i
<meta charset="<wiki:ContentEncoding />">
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
+<%--
+<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
+--%>
+
+<%--
+<wiki:PageExists>
+ <meta name="Description" content="Page version <wiki:PageVersion />, last
modified by <wiki:Author format='plain'/>, on <wiki:PageDate
format='${prefs["DateFormat"]}'/>" />
+</wiki:PageExists>
+--%>
+
<%-- COOKIE read client preferences --%>
<%
diff --git a/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp
b/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp
index be0a53b..e49b9d7 100644
--- a/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp
+++ b/jspwiki-war/src/main/webapp/templates/default/editors/wysiwyg.jsp
@@ -309,7 +309,8 @@ Wiki.add("[name=htmlPageText]", function( element){
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'
+ //actions: 'bold italic underline strikethrough | formatBlock
justifyleft justifyright justifycenter justifyfull | insertunorderedlist
insertorderedlist indent outdent insertHorizontalRule | undo redo removeformat
| createlink unlink | urlimage | toggleview'
+ actions: 'formatBlock | bold italic strikethrough | justifyleft
justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist
indent outdent insertHorizontalRule | undo redo removeformat | createlink
unlink | urlimage | toggleview'
});
});