Skip to content

Commit 630ae52

Browse files
committed
More replacing string concatenation with template interpolation
1 parent 118e7f8 commit 630ae52

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

twisted/common/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
<script>
1717
// Timezone settings
1818
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; // e.g. "America/New_York"
19-
document.cookie = "django_timezone=" + timezone;
19+
document.cookie = `django_timezone=${timezone}`;
2020
</script>
2121
</html>

twisted/twisted_site/templates/client/dashboard.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@
237237
const container = document.getElementById("windows-container");
238238
const clone = template.content.cloneNode(true);
239239
const win = clone.querySelector(".window");
240-
const id = "win-" + ++windowCounter;
240+
windowCounter++
241+
const id = `win-${windowCounter}`;
241242
win.dataset.winId = id;
242243

243244
win.querySelector(".title-bar-text").textContent = title;
@@ -250,13 +251,13 @@
250251
if (y === null) y = Math.random() * (window.innerHeight - w);
251252

252253

253-
win.style.left = x + "px";
254-
win.style.top = y + "px";
255-
win.style.width = w + "px";
256-
win.style.height = h + "px";
254+
win.style.left = `${x}px`;
255+
win.style.top = `${y}px`;
256+
win.style.width = `${w}px`;
257+
win.style.height = `${h}px`;
257258
container.appendChild(clone);
258259

259-
const realWin = container.querySelector('[data-win-id="' + id + '"]');
260+
const realWin = container.querySelector(`[data-win-id="${id}"]`);
260261

261262
// Taskbar button with round png icon
262263
const taskbutton_template = document.getElementById("taskbutton-template");

twisted/twisted_site/templates/client/osbase.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
<script>
3131
// Timezone settings
3232
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; // e.g. "America/New_York"
33-
document.cookie = "django_timezone=" + timezone;
33+
document.cookie = `django_timezone=${timezone}`;
3434
</script>
3535
</html>

twisted/twisted_site/templates/cotton/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
window.addEventListener('load', (event) => {
6161
message = document.querySelector('#djangomessage{{ forloop.counter }}').dataset.message
6262
setTimeout(() => {
63-
console.log("sending message " + message + "...")
63+
console.log(`sending message ${message}...`)
6464
window.dispatchEvent(new CustomEvent('toast', {
6565
detail: {
6666
message: message,

0 commit comments

Comments
 (0)