Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-21452: Macros info, success, warning and error are only distinguished by colors #2590

Merged
merged 27 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
43cf09c
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 8, 2023
12d5de0
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 9, 2023
8959af0
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 10, 2023
801d694
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 10, 2023
bfb4467
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 10, 2023
8457d27
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 10, 2023
d6ed654
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Nov 15, 2023
1ea658a
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Dec 12, 2023
a382b4e
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 Dec 13, 2023
cee7e32
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Dec 13, 2023
0b9403e
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Dec 13, 2023
8b56a4c
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Dec 14, 2023
3ecd6e6
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Dec 14, 2023
2caaadf
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 5, 2024
fcabab8
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 5, 2024
8818450
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 8, 2024
177566f
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 Jan 10, 2024
d906315
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 10, 2024
341b4d9
XWIKI-21009: LiveData alternative to drag controls
Sereza7 Jan 17, 2024
e1dfba5
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 17, 2024
877c00f
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 17, 2024
e38416b
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 18, 2024
04b4ece
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 Jan 22, 2024
655cc72
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 22, 2024
6515418
XWIKI-21452: Macros info, success, warning and error are only disting…
tkrieck Jan 29, 2024
17c87ea
Merge branch 'xwiki:master' into XWIKI-21452
Sereza7 Jan 29, 2024
4e5bee5
XWIKI-21452: Macros info, success, warning and error are only disting…
Sereza7 Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,44 @@
// Messages
// --------------------------------------------------

.successmessage, .errormessage, .warningmessage, .infomessage,
span.successmessage, span.errormessage, span.warningmessage, span.infomessage,
span.box { // Used by: Inline boxes and messages
padding: floor(@font-size-base * 0.2);
// Used by: Inline boxes
span.successmessage, span.errormessage, span.warningmessage, span.infomessage {
padding: 0 floor(@font-size-base * 0.2);
& > img {
// Style the silk icons
margin: 0 .6rem;
vertical-align: sub;
}

& > span.fa {
// Style the font awesome icons
margin: 0 .6rem;
}
}

// Used by: message boxes
div.successmessage, div.errormessage, div.warningmessage, div.infomessage {
display: flex;
gap: .2rem .6rem;
justify-content: left;
align-items: baseline;
padding: .5rem .8rem;

& > img {
// Improve alignment for silk icons
align-self: flex-start;
}

& > div > .box-title,
& > div > .xwiki-metadata-container[data-xwiki-parameter-name="title"] {
font-weight: bold;
}

// Main message content
& > div > p,
& > div > [data-cke-display-name="$content"] {
margin: 0;
}
}

.box, .plainmessage, // Used by: Code Macro, Success Macro, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ disk = floppy-o
drink = glass
drive = hdd-o
email = envelope-o
emoticon_smile=smile-o
emoticon_smile= smile-o
emoticon_unhappy = frown-o
error = exclamation-triangle
exclamation = exclamation-circle
eye = eye
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-platform-icon-api</artifactId>
<version>${project.version}</version>
</dependency>
<!--dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.rendering.internal.util;

import javax.inject.Inject;
import javax.inject.Singleton;
import org.xwiki.component.annotation.Component;
import org.xwiki.icon.IconException;
import org.xwiki.icon.IconRenderer;
import org.xwiki.icon.IconSet;
import org.xwiki.icon.IconSetManager;
import org.xwiki.rendering.block.Block;
import org.xwiki.rendering.block.RawBlock;
import org.xwiki.rendering.syntax.Syntax;

/**
* Component to use the icon theme to provide a proper block for displaying an icon.
*
* @version $Id$
* @since 15.10.6
* @since 16.0.0RC1
*/
@Component
@Singleton
public class XWikiIconProvider extends DefaultIconProvider
{
@Inject
private IconSetManager iconSetManager;
@Inject
private IconRenderer iconRenderer;

/**
* Uses the icon theme to provide the right block for displaying an icon.
* @param iconName the name of the icon to display
* @return the block containing an icon.
*/
@Override
public Block get(String iconName)
{
IconSet iconSet = null;
try {
iconSet = getIconSet(iconName);
String iconContent = this.iconRenderer.renderHTML(iconName, iconSet);
return new RawBlock(iconContent, Syntax.HTML_5_0);
} catch (IconException e) {
return super.get(iconName);
}
}

private IconSet getIconSet(String iconName) throws IconException
{
IconSet iconSet = this.iconSetManager.getCurrentIconSet();
if (iconSet == null || !iconSet.hasIcon(iconName)) {
iconSet = this.iconSetManager.getDefaultIconSet();
}
return iconSet;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
500:org.xwiki.rendering.internal.renderer.XWikiAttachmentURILabelGenerator
500:org.xwiki.rendering.internal.renderer.XWikiLinkLabelGenerator
500:org.xwiki.rendering.internal.renderer.XWikiPageAttachmentURILabelGenerator
500:org.xwiki.rendering.internal.util.XWikiIconProvider
500:org.xwiki.rendering.internal.util.XWikiErrorBlockGenerator
500:org.xwiki.rendering.internal.wiki.XWikiWikiModel
500:org.xwiki.rendering.internal.macro.XWikiHTMLRawBlockFilter
Expand Down