Skip to content

Commit

Permalink
Merge pull request #13 from BrowserSourcesForOBS/dev
Browse files Browse the repository at this point in the history
v1.0.7
  • Loading branch information
XtoManuel authored Oct 25, 2023
2 parents 4062b40 + a311566 commit 0423c3d
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const titleCdowntime = document.getElementById('cdowntime-title')
const titleExtensible = document.getElementById('extensible-title')
const titleTime = document.getElementById('time-title')
// const test = document.getElementById('test')
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

let translateElements

Expand Down Expand Up @@ -143,7 +143,7 @@ buttonContainer.addEventListener('click', (event) => {
window.open(`/${data[0]}/viewCdown`, '_blank', 'width=800,height=600')
} else if (data[1] === 'copyButton') {
// Get the text to copy from the "data-copy-text" attribute
const copyText = `http://localhost:3000/${data[0]}/view`
const copyText = `http://localhost:${window.location.port}/${data[0]}/view`

if (copyText) {
copyTextToClipboard(copyText)
Expand All @@ -153,7 +153,7 @@ buttonContainer.addEventListener('click', (event) => {
}
} else if (data[1] === 'copyButtonCrono') {
// Get the text to copy from the "data-copy-text" attribute
const copyText = `http://localhost:3000/${data[0]}/viewCrono`
const copyText = `http://localhost:${window.location.port}/${data[0]}/viewCrono`

if (copyText) {
copyTextToClipboard(copyText)
Expand All @@ -163,7 +163,7 @@ buttonContainer.addEventListener('click', (event) => {
}
} else if (data[1] === 'copyButtonCdown') {
// Get the text to copy from the "data-copy-text" attribute
const copyText = `http://localhost:3000/${data[0]}/viewCdown`
const copyText = `http://localhost:${window.location.port}/${data[0]}/viewCdown`

if (copyText) {
copyTextToClipboard(copyText)
Expand Down
2 changes: 1 addition & 1 deletion core/template/cdown/control/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const titlePage = document.getElementById('titlePage')
const selectorLang = document.getElementById('language-selector')
const switchTheme = document.getElementById('switch-theme')
// const test = document.getElementById('test');
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - Control'
Expand Down
2 changes: 1 addition & 1 deletion core/template/cdown/view/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
const containers = document.querySelectorAll('.container')
const titlePage = document.getElementById('titlePage')
// const test = document.getElementById('test'); // Commented out unused variable
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

// Extract class element from URL
const classElement = window.location.href.split('/')[3]
Expand Down
2 changes: 1 addition & 1 deletion core/template/cdowntime/control/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const titlePage = document.getElementById('titlePage')
const selectorLang = document.getElementById('language-selector')
const switchTheme = document.getElementById('switch-theme')
// const test = document.getElementById('test'); // Commented out unused variable
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - Control'
Expand Down
2 changes: 1 addition & 1 deletion core/template/cdowntime/view/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
const containers = document.querySelectorAll('.container')
const titlePage = document.getElementById('titlePage')
// const test = document.getElementById('test'); // Commented out unused variable
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - View'
Expand Down
2 changes: 1 addition & 1 deletion core/template/crono/control/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const titlePage = document.getElementById('titlePage')
const languageSelector = document.getElementById('language-selector')
const switchTheme = document.getElementById('switch-theme')
// const test = document.getElementById('test')
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - Control'
Expand Down
2 changes: 1 addition & 1 deletion core/template/crono/view/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const timeElement = document.getElementById('time')
const containers = document.querySelectorAll('.container')
const titlePage = document.getElementById('titlePage')
// const test = document.getElementById('test')
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - View'
Expand Down
2 changes: 1 addition & 1 deletion core/template/extensible/control/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const titlePage = document.getElementById('titlePage')
const selectorLang = document.getElementById('language-selector')
const switchTheme = document.getElementById('switch-theme')
// const test = document.getElementById('test');
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - Control'
Expand Down
2 changes: 1 addition & 1 deletion core/template/extensible/viewCdown/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
const containers = document.querySelectorAll('.container')
const titlePage = document.getElementById('titlePage')
// const test = document.getElementById('test'); // Commented out unused variable
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

// Extract class element from URL
const classElement = window.location.href.split('/')[3]
Expand Down
2 changes: 1 addition & 1 deletion core/template/extensible/viewCrono/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const timeElement = document.getElementById('time')
const containers = document.querySelectorAll('.container')
const titlePage = document.getElementById('titlePage')
// const test = document.getElementById('test')
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - View - Crono'
Expand Down
2 changes: 1 addition & 1 deletion core/template/time/control/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const titlePage = document.getElementById('titlePage')
const langSelector = document.getElementById('language-selector')
const switchTheme = document.getElementById('switch-theme')
// const test = document.getElementById('test');
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - Control'
Expand Down
2 changes: 1 addition & 1 deletion core/template/time/view/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
const containers = document.querySelectorAll('.container')
const titlePage = document.getElementById('titlePage')
// const test = document.getElementById('test');
const socket = new WebSocket('ws://localhost:3000')
const socket = new WebSocket(`ws://localhost:${window.location.port}`)

const classElement = window.location.href.split('/')[3]
titlePage.textContent = classElement + ' - View'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obs-timer-controller",
"version": "1.0.6",
"version": "1.0.7",
"description": "Handling browser sources for OBS related to timers and countdowns.",
"main": "server.js",
"repository": {
Expand All @@ -24,9 +24,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"node": "node . test",
"pkg-win": "electron-packager . OBS-Timer-Controller --platform=win32 --arch=x64 --app-version=1.0.6 --out=dist --overwrite --icon=icon.ico --author=\"XtoManuel\" --description=\"Handling browser sources for OBS related to timers and countdowns.\"",
"pkg-linux": "electron-packager . OBS-Timer-Controller --platform=linux --arch=x64 --app-version=1.0.6 --out=dist --overwrite --icon=icon.ico --author=\"XtoManuel\" --description=\"Handling browser sources for OBS related to timers and countdowns.\"",
"pkg-mac": "electron-packager . OBS-Timer-Controller --platform=darwin --arch=x64 --app-version=1.0.6 --out=dist --overwrite --icon=icon.icns --author=\"XtoManuel\" --description=\"Handling browser sources for OBS related to timers and countdowns.\"",
"pkg-win": "electron-packager . OBS-Timer-Controller --platform=win32 --arch=x64 --app-version=1.0.7 --out=dist --overwrite --icon=icon.ico --author=\"XtoManuel\" --description=\"Handling browser sources for OBS related to timers and countdowns.\"",
"pkg-linux": "electron-packager . OBS-Timer-Controller --platform=linux --arch=x64 --app-version=1.0.7 --out=dist --overwrite --icon=icon.ico --author=\"XtoManuel\" --description=\"Handling browser sources for OBS related to timers and countdowns.\"",
"pkg-mac": "electron-packager . OBS-Timer-Controller --platform=darwin --arch=x64 --app-version=1.0.7 --out=dist --overwrite --icon=icon.icns --author=\"XtoManuel\" --description=\"Handling browser sources for OBS related to timers and countdowns.\"",
"pkg-all": "npm run pkg-win && npm run pkg-linux"
},
"author": "XtoManuel",
Expand Down
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ function openUrlWhenConfigExists () {
}
}

// Start the server on port 3000
const PORT = process.env.PORT || 3000
// Start the server
const PORT = process.env.PORT || 5001
server.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`)

// Open the default browser at 'http://localhost:3000' after starting the server using 'open'.
// Open the default browser at 'http://localhost:5001' after starting the server using 'open'.
openUrlWhenConfigExists()
})

0 comments on commit 0423c3d

Please sign in to comment.