From 7883d091be868af8fff7732a22fb406ca44750e9 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:37:18 +0300 Subject: [PATCH 1/3] Fix app onboarding on Safari --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 655feb483..3c5d829ce 100644 --- a/public/script.js +++ b/public/script.js @@ -6154,7 +6154,7 @@ async function doOnboarding(avatarId) { template.find('input[name="enable_simple_mode"]').on('input', function () { simpleUiMode = $(this).is(':checked'); }); - let userName = await callGenericPopup(template, POPUP_TYPE.INPUT, currentUser?.name || name1, { rows: 2 }); + let userName = await callGenericPopup(template, POPUP_TYPE.INPUT, currentUser?.name || name1, { rows: 2, wide: true, large: true }); if (userName) { userName = userName.replace('\n', ' '); From be518d3668751edf2a9f676a5ce08f3bc9874bb3 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:28:42 +0300 Subject: [PATCH 2/3] More Safari weirdness cope --- public/css/popup-safari-fix.css | 6 +++++- public/scripts/RossAscends-mods.js | 10 +++++++--- public/scripts/chats.js | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/public/css/popup-safari-fix.css b/public/css/popup-safari-fix.css index db256ea24..4f916747e 100644 --- a/public/css/popup-safari-fix.css +++ b/public/css/popup-safari-fix.css @@ -1,5 +1,9 @@ /* iPhone copium land */ -.ios .popup .popup-body { +body.safari .popup .popup-body:has(.maximized_textarea) { + height: 100%; +} + +body.safari .popup .popup-body { height: fit-content; max-height: 90vh; max-height: 90svh; diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index d06068c66..dceba9063 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -725,10 +725,14 @@ export function initRossMods() { RA_autoconnect(); } - const isAppleDevice = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); + const userAgent = getParsedUA(); + console.debug('User Agent', userAgent); + const isMobileSafari = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); + const isDesktopSafari = userAgent?.browser?.name === 'Safari' && userAgent?.platform?.type === 'desktop'; + const isIOS = userAgent?.os?.name === 'iOS'; - if (getParsedUA()?.os?.name === 'iOS' || isAppleDevice) { - document.body.classList.add('ios'); + if (isIOS || isMobileSafari || isDesktopSafari) { + document.body.classList.add('safari'); } $('#main_api').change(function () { diff --git a/public/scripts/chats.js b/public/scripts/chats.js index e605f02db..6d1e8d694 100644 --- a/public/scripts/chats.js +++ b/public/scripts/chats.js @@ -1430,7 +1430,7 @@ jQuery(function () { wrapper.classList.add('flexFlowColumn', 'justifyCenter', 'alignitemscenter'); const textarea = document.createElement('textarea'); textarea.value = String(bro.val()); - textarea.classList.add('height100p', 'wide100p'); + textarea.classList.add('height100p', 'wide100p', 'maximized_textarea'); bro.hasClass('monospace') && textarea.classList.add('monospace'); textarea.addEventListener('input', function () { bro.val(textarea.value).trigger('input'); From 3d86d110e8cc1d9c06f9f668e163622d670b762a Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:57:18 +0300 Subject: [PATCH 3/3] Ignore Safari cope for large popups --- public/css/popup-safari-fix.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/css/popup-safari-fix.css b/public/css/popup-safari-fix.css index 4f916747e..6838e3352 100644 --- a/public/css/popup-safari-fix.css +++ b/public/css/popup-safari-fix.css @@ -1,5 +1,6 @@ /* iPhone copium land */ -body.safari .popup .popup-body:has(.maximized_textarea) { +body.safari .popup .popup-body:has(.maximized_textarea), +body.safari .popup.large_dialogue_popup .popup-body { height: 100%; }