mirror of
https://github.com/flarum/core.git
synced 2025-08-28 10:30:54 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5437bf5c23 | ||
|
717af13bb1 | ||
|
e72541e35d | ||
|
577890d89c | ||
|
253a3d281d |
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v1.8.1](https://github.com/flarum/framework/compare/v1.8.0...v1.8.1)
|
||||||
|
### Fixed
|
||||||
|
* recover temporary solution for html entities in browser title (e72541e35de4f71f9d870bbd9bb46ddf586bdf1d)
|
||||||
|
* custom contrast color affected by parents (577890d89c593ae5b6cb96083fab69e2f1ae600c)
|
||||||
|
* reply placeholder wrong positioning (253a3d281dbf5ce3fa712b629b80587cf67e7dbe)
|
||||||
|
|
||||||
## [v1.8.0](https://github.com/flarum/framework/compare/v1.7.1...v1.8.0)
|
## [v1.8.0](https://github.com/flarum/framework/compare/v1.7.1...v1.8.0)
|
||||||
### Fixed
|
### Fixed
|
||||||
- (a11y) reply placeholder not accessible [#3793]
|
- (a11y) reply placeholder not accessible [#3793]
|
||||||
|
2
framework/core/js/dist-typings/common/helpers/textContrastClass.d.ts
generated
vendored
2
framework/core/js/dist-typings/common/helpers/textContrastClass.d.ts
generated
vendored
@@ -1 +1 @@
|
|||||||
export default function textContrastClass(hexcolor: string | null): string;
|
export default function textContrastClass(hexcolor: string | null | undefined): string;
|
||||||
|
2
framework/core/js/dist/admin.js
generated
vendored
2
framework/core/js/dist/admin.js
generated
vendored
File diff suppressed because one or more lines are too long
2
framework/core/js/dist/admin.js.map
generated
vendored
2
framework/core/js/dist/admin.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
framework/core/js/dist/forum.js
generated
vendored
2
framework/core/js/dist/forum.js
generated
vendored
File diff suppressed because one or more lines are too long
2
framework/core/js/dist/forum.js.map
generated
vendored
2
framework/core/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -411,12 +411,23 @@ export default class Application {
|
|||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
const title =
|
let title =
|
||||||
onHomepage || !this.title
|
onHomepage || !this.title
|
||||||
? extractText(app.translator.trans('core.lib.meta_titles.without_page_title', params))
|
? extractText(app.translator.trans('core.lib.meta_titles.without_page_title', params))
|
||||||
: extractText(app.translator.trans('core.lib.meta_titles.with_page_title', params));
|
: extractText(app.translator.trans('core.lib.meta_titles.with_page_title', params));
|
||||||
|
|
||||||
document.title = count + title;
|
title = count + title;
|
||||||
|
|
||||||
|
// We pass the title through a DOMParser to allow HTML entities
|
||||||
|
// to be rendered correctly, while still preventing XSS attacks
|
||||||
|
// from user input by using a script-disabled environment.
|
||||||
|
// https://github.com/flarum/framework/issues/3514
|
||||||
|
// https://github.com/flarum/framework/pull/3684
|
||||||
|
// This is only a temporary solution for 1.x,
|
||||||
|
// and the actual source of the issue will be fixed in 2.x
|
||||||
|
// Actual source of the issue: https://github.com/flarum/framework/issues/3685
|
||||||
|
const parser = new DOMParser();
|
||||||
|
document.title = parser.parseFromString(title, 'text/html').body.innerText;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected transformRequestOptions<ResponseType>(flarumOptions: FlarumRequestOptions<ResponseType>): InternalFlarumRequestOptions<ResponseType> {
|
protected transformRequestOptions<ResponseType>(flarumOptions: FlarumRequestOptions<ResponseType>): InternalFlarumRequestOptions<ResponseType> {
|
||||||
|
@@ -28,7 +28,7 @@ export default class Badge<CustomAttrs extends IBadgeAttrs = IBadgeAttrs> extend
|
|||||||
view() {
|
view() {
|
||||||
const { type, icon: iconName, label, color, style = {}, ...attrs } = this.attrs;
|
const { type, icon: iconName, label, color, style = {}, ...attrs } = this.attrs;
|
||||||
|
|
||||||
const className = classList('Badge', [type && `Badge--${type}`], attrs.className, color && textContrastClass(color));
|
const className = classList('Badge', [type && `Badge--${type}`], attrs.className, textContrastClass(color));
|
||||||
|
|
||||||
const iconChild = iconName ? icon(iconName, { className: 'Badge-icon' }) : m.trust(' ');
|
const iconChild = iconName ? icon(iconName, { className: 'Badge-icon' }) : m.trust(' ');
|
||||||
|
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
import isDark from '../utils/isDark';
|
import isDark from '../utils/isDark';
|
||||||
|
|
||||||
export default function textContrastClass(hexcolor: string | null): string {
|
export default function textContrastClass(hexcolor: string | null | undefined): string {
|
||||||
|
if (!hexcolor) return 'text-contrast--unchanged';
|
||||||
|
|
||||||
return isDark(hexcolor) ? 'text-contrast--light' : 'text-contrast--dark';
|
return isDark(hexcolor) ? 'text-contrast--light' : 'text-contrast--dark';
|
||||||
}
|
}
|
||||||
|
@@ -176,4 +176,10 @@ blockquote ol:last-child {
|
|||||||
--contrast-color: var(--text-on-dark);
|
--contrast-color: var(--text-on-dark);
|
||||||
color: var(--contrast-color);
|
color: var(--contrast-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This exists to prevent inheriting the contrast color from a parent element.
|
||||||
|
// Like when a badge is inside a tag hero.
|
||||||
|
&--unchanged {
|
||||||
|
--contrast-color: var(--unchanged-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -441,7 +441,7 @@
|
|||||||
color: var(--muted-color);
|
color: var(--muted-color);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
width: 100%;
|
width: calc(~"100% + 20px * 2");
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
.Post-header {
|
.Post-header {
|
||||||
|
@@ -21,7 +21,7 @@ class Application
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.8.0';
|
const VERSION = '1.8.1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The IoC container for the Flarum application.
|
* The IoC container for the Flarum application.
|
||||||
|
Reference in New Issue
Block a user