mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-21 17:17:48 +08:00
Remove hacky patch for "safari emoji glitch fix" (#25208)
According to my test, the UI (emoji) is fine in Safari And actually the code is just dead code, because the "resize" event is never fired on page loading. So for most cases users just view the pages without this hacky patch, nobody ever complains.
This commit is contained in:
@ -37,19 +37,6 @@ export function stripTags(text) {
|
||||
return text.replace(/<[^>]*>?/g, '');
|
||||
}
|
||||
|
||||
// searches the inclusive range [minValue, maxValue].
|
||||
// credits: https://matthiasott.com/notes/write-your-media-queries-in-pixels-not-ems
|
||||
export function mqBinarySearch(feature, minValue, maxValue, step, unit) {
|
||||
if (maxValue - minValue < step) {
|
||||
return minValue;
|
||||
}
|
||||
const mid = Math.ceil((minValue + maxValue) / 2 / step) * step;
|
||||
if (matchMedia(`screen and (min-${feature}:${mid}${unit})`).matches) {
|
||||
return mqBinarySearch(feature, mid, maxValue, step, unit); // feature is >= mid
|
||||
}
|
||||
return mqBinarySearch(feature, minValue, mid - step, step, unit); // feature is < mid
|
||||
}
|
||||
|
||||
export function parseIssueHref(href) {
|
||||
const path = (href || '').replace(/[#?].*$/, '');
|
||||
const [_, owner, repo, type, index] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || [];
|
||||
|
Reference in New Issue
Block a user