diff --git a/chrome/extension/content.js b/chrome/extension/content.js index 4fc6986f..b4863c03 100644 --- a/chrome/extension/content.js +++ b/chrome/extension/content.js @@ -74,10 +74,7 @@ if (chatgpt.canvasIsOpen()) inputArea.parentNode.style.width = '100%' else if (!env.tallChatbar) { // narrow it to not clash w/ buttons const widths = { chatbar: chatbarDiv.getBoundingClientRect().width } - const visibleBtnTypes = [...btns.types, 'send'].filter(type => - !(type == 'fullWindow' && !sites[env.site].hasSidebar) - && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) - && !(type == 'newChat' && config.ncbDisabled)) + const visibleBtnTypes = [...btns.getVisibleTypes(), 'send'] visibleBtnTypes.forEach(type => widths[type] = btns[type]?.getBoundingClientRect().width || document.querySelector(`${sites.chatgpt.selectors.btns.send}, ${ @@ -276,6 +273,13 @@ // Update SVG if (!btn.contains(btnSVG)) btn.append(btnSVG) + }, + + getVisibleTypes() { // used in update.tooltip() + chatbar.tweak() + return this.types.filter(type => + !(type == 'fullWindow' && !sites[env.site].hasSidebar) + && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) + && !(type == 'newChat' && config.ncbDisabled)) } } @@ -340,10 +344,7 @@ }, tooltip(btnType) { // text & position - const visibleBtnTypes = btns.types.filter(type => - !(type == 'fullWindow' && !sites[env.site].hasSidebar) - && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) - && !(type == 'newChat' && config.ncbDisabled)) + const visibleBtnTypes = btns.getVisibleTypes() const ctrAddend = ( env.site == 'perplexity' ? ( location.pathname == '/' ? 94 : 105 ) : env.site == 'poe' ? 45 : 13 ) +25 const spreadFactor = env.site == 'perplexity' ? 26.5 : env.site == 'poe' ? 34 : 30.55 diff --git a/firefox/extension/content.js b/firefox/extension/content.js index 61ce8a0a..05678433 100644 --- a/firefox/extension/content.js +++ b/firefox/extension/content.js @@ -74,10 +74,7 @@ if (chatgpt.canvasIsOpen()) inputArea.parentNode.style.width = '100%' else if (!env.tallChatbar) { // narrow it to not clash w/ buttons const widths = { chatbar: chatbarDiv.getBoundingClientRect().width } - const visibleBtnTypes = [...btns.types, 'send'].filter(type => - !(type == 'fullWindow' && !sites[env.site].hasSidebar) - && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) - && !(type == 'newChat' && config.ncbDisabled)) + const visibleBtnTypes = [...btns.getVisibleTypes(), 'send'] visibleBtnTypes.forEach(type => widths[type] = btns[type]?.getBoundingClientRect().width || document.querySelector(`${sites.chatgpt.selectors.btns.send}, ${ @@ -276,6 +273,13 @@ // Update SVG if (!btn.contains(btnSVG)) btn.append(btnSVG) + }, + + getVisibleTypes() { // used in update.tooltip() + chatbar.tweak() + return this.types.filter(type => + !(type == 'fullWindow' && !sites[env.site].hasSidebar) + && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) + && !(type == 'newChat' && config.ncbDisabled)) } } @@ -340,10 +344,7 @@ }, tooltip(btnType) { // text & position - const visibleBtnTypes = btns.types.filter(type => - !(type == 'fullWindow' && !sites[env.site].hasSidebar) - && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) - && !(type == 'newChat' && config.ncbDisabled)) + const visibleBtnTypes = btns.getVisibleTypes() const ctrAddend = ( env.site == 'perplexity' ? ( location.pathname == '/' ? 94 : 105 ) : env.site == 'poe' ? 45 : 13 ) +25 const spreadFactor = env.site == 'perplexity' ? 26.5 : env.site == 'poe' ? 34 : 30.55 diff --git a/greasemonkey/chatgpt-widescreen-mode.user.js b/greasemonkey/chatgpt-widescreen-mode.user.js index 14762fe2..35505232 100644 --- a/greasemonkey/chatgpt-widescreen-mode.user.js +++ b/greasemonkey/chatgpt-widescreen-mode.user.js @@ -222,7 +222,7 @@ // @description:zu Yengeza Isikrini Esibanzi + Izindlela Zesikrini Esigcwele ku-chatgpt.com + perplexity.ai + poe.com ukuze uthole ukubuka okuthuthukisiwe + okuncishisiwe ukuskrola // @author Adam Lui // @namespace https://github.com/adamlui -// @version 2024.12.11 +// @version 2024.12.11.1 // @license MIT // @icon https://media.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?9a393be // @icon64 https://media.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?9a393be @@ -515,10 +515,7 @@ if (chatgpt.canvasIsOpen()) inputArea.parentNode.style.width = '100%' else if (!env.tallChatbar) { // narrow it to not clash w/ buttons const widths = { chatbar: chatbarDiv.getBoundingClientRect().width } - const visibleBtnTypes = [...btns.types, 'send'].filter(type => - !(type == 'fullWindow' && !sites[env.site].hasSidebar) - && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) - && !(type == 'newChat' && config.ncbDisabled)) + const visibleBtnTypes = [...btns.getVisibleTypes(), 'send'] visibleBtnTypes.forEach(type => widths[type] = btns[type]?.getBoundingClientRect().width || document.querySelector(`${sites[env.site].selectors.btns.send}, ${ @@ -708,6 +705,13 @@ // Update SVG if (!btn.contains(btnSVG)) btn.append(btnSVG) + }, + + getVisibleTypes() { // used in update.tooltip() + chatbar.tweak() + return this.types.filter(type => + !(type == 'fullWindow' && !sites[env.site].hasSidebar) + && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) + && !(type == 'newChat' && config.ncbDisabled)) } } @@ -774,10 +778,7 @@ }, tooltip(btnType) { // text & position - const visibleBtnTypes = btns.types.filter(type => - !(type == 'fullWindow' && !sites[env.site].hasSidebar) - && !(type == 'wideScreen' && chatgpt.canvasIsOpen()) - && !(type == 'newChat' && config.ncbDisabled)) + const visibleBtnTypes = btns.getVisibleTypes() const ctrAddend = ( env.site == 'perplexity' ? ( location.pathname == '/' ? 94 : 105 ) : env.site == 'poe' ? 45 : 13 ) +25 const spreadFactor = env.site == 'perplexity' ? 26.5 : env.site == 'poe' ? 34 : 30.55