summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-12 12:16:04 -0400
committerGitHub <noreply@github.com>2023-06-12 18:16:04 +0200
commit3e9fc3672902adc8f2c589d034aa3772f06825e2 (patch)
tree111d717b70e05a6b950bb016e2e9cd566e998787 /web_src
parent8e798ebbdfa5583eecd916f8d669ae4ba4093c83 (diff)
downloadgitea-3e9fc3672902adc8f2c589d034aa3772f06825e2.tar.gz
gitea-3e9fc3672902adc8f2c589d034aa3772f06825e2.zip
Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211)
Backport #25208 by @wxiaoguang 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. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/css/base.css13
-rw-r--r--web_src/js/features/common-global.js14
-rw-r--r--web_src/js/utils.js13
3 files changed, 0 insertions, 40 deletions
diff --git a/web_src/css/base.css b/web_src/css/base.css
index f9b2ca99ba..38faf2287c 100644
--- a/web_src/css/base.css
+++ b/web_src/css/base.css
@@ -2199,19 +2199,6 @@ table th[data-sortt-desc] .svg {
vertical-align: -0.075em;
}
-@supports (-webkit-hyphens:none) {
- body:not(.safari-above125) .emoji,
- body:not(.safari-above125) .reaction {
- font-size: inherit;
- vertical-align: inherit;
- }
- body:not(.safari-above125) .emoji img,
- body:not(.safari-above125) .reaction img {
- font-size: 1.25em;
- vertical-align: -0.225em !important;
- }
-}
-
.emoji img,
.reaction img {
border-width: 0 !important;
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index cb50ebcae0..46a80beb51 100644
--- a/web_src/js/features/common-global.js
+++ b/web_src/js/features/common-global.js
@@ -1,6 +1,5 @@
import $ from 'jquery';
import 'jquery.are-you-sure';
-import {mqBinarySearch} from '../utils.js';
import {createDropzone} from './dropzone.js';
import {initCompColorPicker} from './comp/ColorPicker.js';
import {showGlobalErrorMessage} from '../bootstrap.js';
@@ -62,19 +61,6 @@ export function initGlobalButtonClickOnEnter() {
}
export function initGlobalCommon() {
- // Undo Safari emoji glitch fix at high enough zoom levels
- if (navigator.userAgent.match('Safari')) {
- $(window).on('resize', () => {
- const px = mqBinarySearch('width', 0, 4096, 1, 'px');
- const em = mqBinarySearch('width', 0, 1024, 0.01, 'em');
- if (em * 16 * 1.25 - px <= -1) {
- $('body').addClass('safari-above125');
- } else {
- $('body').removeClass('safari-above125');
- }
- });
- }
-
// Semantic UI modules.
const $uiDropdowns = $('.ui.dropdown');
diff --git a/web_src/js/utils.js b/web_src/js/utils.js
index 4f9ad452f6..4655b8eacc 100644
--- a/web_src/js/utils.js
+++ b/web_src/js/utils.js
@@ -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) || [];