Skip to content

Commit

Permalink
Renamed event args of forEach loops in modals.handlers.drag typ…
Browse files Browse the repository at this point in the history
…e methods to `eventType` for better clarity
  • Loading branch information
adamlui committed Dec 23, 2024
1 parent 06f512f commit 501ebca
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 46 deletions.
9 changes: 5 additions & 4 deletions amazongpt/greasemonkey/amazongpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Adds the magic of AI to Amazon shopping
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.12.21.3
// @version 2024.12.23
// @license MIT
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
Expand Down Expand Up @@ -881,7 +881,8 @@
modals.handlers.drag.draggableElem = event.currentTarget
modals.handlers.drag.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.handlers.drag[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.handlers.drag[eventType]))
const draggableElemRect = modals.handlers.drag.draggableElem.getBoundingClientRect()
modals.handlers.drag.offsetX = event.clientX - draggableElemRect.left +21
modals.handlers.drag.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -897,8 +898,8 @@

mouseup() { // remove listeners, reset modals.handlers.drags.draggableElem
modals.handlers.drag.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.handlers.drag[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.handlers.drag[eventType]))
modals.handlers.drag.draggableElem = null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.12.23.1
// @version 2024.12.23.2
// @license MIT
// @icon https://media.autoclearchatgpt.com/images/icons/openai/black/icon48.png?a8868ef
// @icon64 https://media.autoclearchatgpt.com/images/icons/openai/black/icon64.png?a8868ef
Expand Down Expand Up @@ -568,7 +568,8 @@
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -584,8 +585,8 @@

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
9 changes: 5 additions & 4 deletions bravegpt/greasemonkey/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.12.21.7
// @version 2024.12.23
// @license MIT
// @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287
// @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287
Expand Down Expand Up @@ -1052,7 +1052,8 @@
modals.handlers.drag.draggableElem = event.currentTarget
modals.handlers.drag.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.handlers.drag[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.handlers.drag[eventType]))
const draggableElemRect = modals.handlers.drag.draggableElem.getBoundingClientRect()
modals.handlers.drag.offsetX = event.clientX - draggableElemRect.left +21
modals.handlers.drag.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -1068,8 +1069,8 @@

mouseup() { // remove listeners, reset modals.handlers.drags.draggableElem
modals.handlers.drag.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.handlers.drag[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.handlers.drag[eventType]))
modals.handlers.drag.draggableElem = null
}

Expand Down
7 changes: 4 additions & 3 deletions chatgpt-auto-continue/chromium/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ window.modals = {
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -126,8 +127,8 @@ window.modals = {

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
7 changes: 4 additions & 3 deletions chatgpt-auto-continue/firefox/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ window.modals = {
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -126,8 +127,8 @@ window.modals = {

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.12.23.1
// @version 2024.12.23.2
// @license MIT
// @icon https://media.chatgptautorefresh.com/images/icons/openai/black/icon48.png?c56f963
// @icon64 https://media.chatgptautorefresh.com/images/icons/openai/black/icon64.png?c56f963
Expand Down Expand Up @@ -607,7 +607,8 @@
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -623,8 +624,8 @@

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
9 changes: 5 additions & 4 deletions chatgpt-auto-talk/greasemonkey/chatgpt-auto-talk.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.12.23.1
// @version 2024.12.23.2
// @license MIT
// @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c
// @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c
Expand Down Expand Up @@ -555,7 +555,8 @@
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -571,8 +572,8 @@

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
7 changes: 4 additions & 3 deletions chatgpt-infinity/chrome/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ window.modals = {
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -126,8 +127,8 @@ window.modals = {

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
7 changes: 4 additions & 3 deletions chatgpt-infinity/firefox/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ window.modals = {
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -126,8 +127,8 @@ window.modals = {

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
7 changes: 4 additions & 3 deletions chatgpt-widescreen/chrome/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ window.modals = {
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -126,8 +127,8 @@ window.modals = {

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
7 changes: 4 additions & 3 deletions chatgpt-widescreen/firefox/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ window.modals = {
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.dragHandlers[eventType]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
modals.dragHandlers.offsetX = event.clientX - draggableElemRect.left +21
modals.dragHandlers.offsetY = event.clientY - draggableElemRect.top +12
Expand All @@ -126,8 +127,8 @@ window.modals = {

mouseup() { // remove listeners, reset modals.dragHandlers.draggableElem
modals.dragHandlers.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.dragHandlers[eventType]))
modals.dragHandlers.draggableElem = null
}
},
Expand Down
9 changes: 5 additions & 4 deletions duckduckgpt/greasemonkey/duckduckgpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.12.21.6
// @version 2024.12.23
// @license MIT
// @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302
// @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302
Expand Down Expand Up @@ -1059,7 +1059,8 @@
modals.handlers.drag.draggableElem = event.currentTarget
modals.handlers.drag.draggableElem.style.cursor = 'grabbing'
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.handlers.drag[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.addEventListener(eventType, modals.handlers.drag[eventType]))
const draggableElemRect = modals.handlers.drag.draggableElem.getBoundingClientRect(),
targetModalIsSettings = event.currentTarget.closest('[id*=-settings]')
modals.handlers.drag.offsetX = (
Expand All @@ -1078,8 +1079,8 @@

mouseup() { // remove listeners, reset modals.handlers.drags.draggableElem
modals.handlers.drag.draggableElem.style.cursor = 'inherit';
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.handlers.drag[event]))
['mousemove', 'mouseup'].forEach(eventType =>
document.removeEventListener(eventType, modals.handlers.drag[eventType]))
modals.handlers.drag.draggableElem = null
}

Expand Down
Loading

0 comments on commit 501ebca

Please sign in to comment.