Skip to content

Commit a311566

Browse files
committed
v1.0.7
Add PORT config
1 parent 6aaaafa commit a311566

File tree

15 files changed

+24
-24
lines changed

15 files changed

+24
-24
lines changed

core/client.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const titleCdowntime = document.getElementById('cdowntime-title')
1717
const titleExtensible = document.getElementById('extensible-title')
1818
const titleTime = document.getElementById('time-title')
1919
// const test = document.getElementById('test')
20-
const socket = new WebSocket('ws://localhost:3000')
20+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
2121

2222
let translateElements
2323

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

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

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

168168
if (copyText) {
169169
copyTextToClipboard(copyText)

core/template/cdown/control/control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const titlePage = document.getElementById('titlePage')
1919
const selectorLang = document.getElementById('language-selector')
2020
const switchTheme = document.getElementById('switch-theme')
2121
// const test = document.getElementById('test');
22-
const socket = new WebSocket('ws://localhost:3000')
22+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
2323

2424
const classElement = window.location.href.split('/')[3]
2525
titlePage.textContent = classElement + ' - Control'

core/template/cdown/view/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
33
const containers = document.querySelectorAll('.container')
44
const titlePage = document.getElementById('titlePage')
55
// const test = document.getElementById('test'); // Commented out unused variable
6-
const socket = new WebSocket('ws://localhost:3000')
6+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
77

88
// Extract class element from URL
99
const classElement = window.location.href.split('/')[3]

core/template/cdowntime/control/control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const titlePage = document.getElementById('titlePage')
1919
const selectorLang = document.getElementById('language-selector')
2020
const switchTheme = document.getElementById('switch-theme')
2121
// const test = document.getElementById('test'); // Commented out unused variable
22-
const socket = new WebSocket('ws://localhost:3000')
22+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
2323

2424
const classElement = window.location.href.split('/')[3]
2525
titlePage.textContent = classElement + ' - Control'

core/template/cdowntime/view/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
33
const containers = document.querySelectorAll('.container')
44
const titlePage = document.getElementById('titlePage')
55
// const test = document.getElementById('test'); // Commented out unused variable
6-
const socket = new WebSocket('ws://localhost:3000')
6+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
77

88
const classElement = window.location.href.split('/')[3]
99
titlePage.textContent = classElement + ' - View'

core/template/crono/control/control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const titlePage = document.getElementById('titlePage')
1717
const languageSelector = document.getElementById('language-selector')
1818
const switchTheme = document.getElementById('switch-theme')
1919
// const test = document.getElementById('test')
20-
const socket = new WebSocket('ws://localhost:3000')
20+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
2121

2222
const classElement = window.location.href.split('/')[3]
2323
titlePage.textContent = classElement + ' - Control'

core/template/crono/view/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const timeElement = document.getElementById('time')
22
const containers = document.querySelectorAll('.container')
33
const titlePage = document.getElementById('titlePage')
44
// const test = document.getElementById('test')
5-
const socket = new WebSocket('ws://localhost:3000')
5+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
66

77
const classElement = window.location.href.split('/')[3]
88
titlePage.textContent = classElement + ' - View'

core/template/extensible/control/control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const titlePage = document.getElementById('titlePage')
2424
const selectorLang = document.getElementById('language-selector')
2525
const switchTheme = document.getElementById('switch-theme')
2626
// const test = document.getElementById('test');
27-
const socket = new WebSocket('ws://localhost:3000')
27+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
2828

2929
const classElement = window.location.href.split('/')[3]
3030
titlePage.textContent = classElement + ' - Control'

core/template/extensible/viewCdown/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const timeElement = document.getElementById('time')
33
const containers = document.querySelectorAll('.container')
44
const titlePage = document.getElementById('titlePage')
55
// const test = document.getElementById('test'); // Commented out unused variable
6-
const socket = new WebSocket('ws://localhost:3000')
6+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
77

88
// Extract class element from URL
99
const classElement = window.location.href.split('/')[3]

core/template/extensible/viewCrono/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const timeElement = document.getElementById('time')
22
const containers = document.querySelectorAll('.container')
33
const titlePage = document.getElementById('titlePage')
44
// const test = document.getElementById('test')
5-
const socket = new WebSocket('ws://localhost:3000')
5+
const socket = new WebSocket(`ws://localhost:${window.location.port}`)
66

77
const classElement = window.location.href.split('/')[3]
88
titlePage.textContent = classElement + ' - View - Crono'

0 commit comments

Comments
 (0)