Skip to content

Commit

Permalink
Do not use replaceAll
Browse files Browse the repository at this point in the history
  • Loading branch information
NightScript370 committed Mar 13, 2024
1 parent d98157e commit 8a63ec0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/js/chaiTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class ChaiTables {
for (const yearloop = calendar.clone(); yearloop.getJewishYear() !== calendar.getJewishYear() + 1; yearloop.setJewishYear(yearloop.getJewishYear() + 1)) {
const ctLink = this.getChaiTablesLink(8, 0, yearloop, 413, true);

const ctFetch = await fetch('https://ctscrape.torahquickie.xyz/' + ctLink.toString().replaceAll('https://', '').replaceAll('http://', ''));
const ctFetch = await fetch('https://ctscrape.torahquickie.xyz/' + ctLink.toString().replace(/https?:\/\//g, '');
console.log(ctFetch.url)
const ctResponse = await ctFetch.text()
const ctDoc = (new DOMParser()).parseFromString(ctResponse, "text/html");
Expand Down
2 changes: 1 addition & 1 deletion assets/js/chanukah.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const jCal = new WebsiteCalendar()

for (const title of document.getElementsByClassName('shabbatTitleCore')) {
title.innerHTML = [
`<span style="font-size: 0.85em">${settings.location.name().toLowerCase().replaceAll(' ', ' ')}</span>`,
`<span style="font-size: 0.85em">${settings.location.name().toLowerCase().replace(/ /g, ' ')}</span>`,
title.innerHTML,
jCal.formatJewishYear().hebrew
].join('')
Expand Down
2 changes: 1 addition & 1 deletion assets/js/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function updateList(event) {

async function setLocation(name, admin, country, latitude, longitude) {
if (country)
country = country.replaceAll("Palestine", "Israel")
country = country.split("Palestine").join("Israel")

geoLocation.locationName = [...new Set([name, admin, country])].filter(Boolean).join(", ");

Expand Down
4 changes: 2 additions & 2 deletions assets/js/zmanimListUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ class zmanimListUpdater {
if (timeSlot.hasAttribute('data-specialDropdownContent')) {
const description = timeSlot.querySelector('.accordianContent');
description.innerHTML = description.innerHTML
.replaceAll('${getAteretTorahSunsetOffset()}', settings.customTimes.tzeithIssurMelakha().minutes.toString())
.replaceAll('${getCandleLightingOffset()}', settings.customTimes.candleLighting().toString())
.split('${getAteretTorahSunsetOffset()}').join(settings.customTimes.tzeithIssurMelakha().minutes.toString())
.split('${getCandleLightingOffset()}').join(settings.customTimes.candleLighting().toString())
}

if (zmanInfo[zmanId].title.hb)
Expand Down

0 comments on commit 8a63ec0

Please sign in to comment.