innerText -> textContent

pull/227/head
Kevin Payravi 2023-08-07 02:44:21 -04:00
parent 83643a5fff
commit a9b887eece
3 changed files with 30 additions and 30 deletions

View File

@ -109,7 +109,7 @@ function displayRedirectBanner(url, id, destination, storage) {
var bannerExit = document.createElement('div');
bannerExit.id = 'indie-wiki-banner-exit';
banner.appendChild(bannerExit);
bannerExit.innerText = '✕';
bannerExit.textContent = '✕';
bannerExit.onclick = function () { this.parentElement.remove(); };
// Output control links container
@ -123,17 +123,17 @@ function displayRedirectBanner(url, id, destination, storage) {
bannerRestoreLink.classList.add('indie-wiki-banner-link');
bannerRestoreLink.classList.add('indie-wiki-banner-link-small');
bannerRestoreLink.classList.add('indie-wiki-banner-hidden');
bannerRestoreLink.innerText = '⎌ Restore banner';
bannerRestoreLink.textContent = '⎌ Restore banner';
bannerControls.appendChild(bannerRestoreLink);
bannerRestoreLink.onclick = function (e) {
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
response.siteSettings.get(id).set('action', 'alert');
chrome.storage.sync.set({ 'siteSettings': response.siteSettings });
e.target.innerText = '✓ Banner restored';
e.target.textContent = '✓ Banner restored';
e.target.classList.add('indie-wiki-banner-disabled');
document.getElementById('indie-wiki-banner-redirect').innerText = '↪ Auto redirect this wiki';
document.getElementById('indie-wiki-banner-redirect').textContent = '↪ Auto redirect this wiki';
document.getElementById('indie-wiki-banner-redirect').classList.remove('indie-wiki-banner-disabled');
document.getElementById('indie-wiki-banner-disable').innerText = '✕ Disable banner for this wiki';
document.getElementById('indie-wiki-banner-disable').textContent = '✕ Disable banner for this wiki';
document.getElementById('indie-wiki-banner-disable').classList.remove('indie-wiki-banner-disabled');
});
}
@ -143,17 +143,17 @@ function displayRedirectBanner(url, id, destination, storage) {
bannerDisableLink.id = 'indie-wiki-banner-disable';
bannerDisableLink.classList.add('indie-wiki-banner-link');
bannerDisableLink.classList.add('indie-wiki-banner-link-small');
bannerDisableLink.innerText = '✕ Disable banner for this wiki';
bannerDisableLink.textContent = '✕ Disable banner for this wiki';
bannerControls.appendChild(bannerDisableLink);
bannerDisableLink.onclick = function (e) {
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
response.siteSettings.get(id).set('action', 'disabled');
chrome.storage.sync.set({ 'siteSettings': response.siteSettings });
e.target.innerText = '✓ Banner disabled';
e.target.textContent = '✓ Banner disabled';
e.target.classList.add('indie-wiki-banner-disabled');
document.getElementById('indie-wiki-banner-redirect').innerText = '↪ Auto redirect this wiki';
document.getElementById('indie-wiki-banner-redirect').textContent = '↪ Auto redirect this wiki';
document.getElementById('indie-wiki-banner-redirect').classList.remove('indie-wiki-banner-disabled');
document.getElementById('indie-wiki-banner-restore').innerText = '⎌ Restore banner';
document.getElementById('indie-wiki-banner-restore').textContent = '⎌ Restore banner';
document.getElementById('indie-wiki-banner-restore').classList.remove('indie-wiki-banner-hidden');
document.getElementById('indie-wiki-banner-restore').classList.remove('indie-wiki-banner-disabled');
});
@ -164,17 +164,17 @@ function displayRedirectBanner(url, id, destination, storage) {
bannerRedirectLink.id = 'indie-wiki-banner-redirect';
bannerRedirectLink.classList.add('indie-wiki-banner-link');
bannerRedirectLink.classList.add('indie-wiki-banner-link-small');
bannerRedirectLink.innerText = '↪ Auto redirect this wiki';
bannerRedirectLink.textContent = '↪ Auto redirect this wiki';
bannerControls.appendChild(bannerRedirectLink);
bannerRedirectLink.onclick = function (e) {
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
response.siteSettings.get(id).set('action', 'redirect');
chrome.storage.sync.set({ 'siteSettings': response.siteSettings });
e.target.innerText = '✓ Redirect enabled';
e.target.textContent = '✓ Redirect enabled';
e.target.classList.add('indie-wiki-banner-disabled');
document.getElementById('indie-wiki-banner-disable').innerText = '✕ Disable banner for this wiki';
document.getElementById('indie-wiki-banner-disable').textContent = '✕ Disable banner for this wiki';
document.getElementById('indie-wiki-banner-disable').classList.remove('indie-wiki-banner-disabled');
document.getElementById('indie-wiki-banner-restore').innerText = '⎌ Restore banner';
document.getElementById('indie-wiki-banner-restore').textContent = '⎌ Restore banner';
document.getElementById('indie-wiki-banner-restore').classList.remove('indie-wiki-banner-hidden');
document.getElementById('indie-wiki-banner-restore').classList.remove('indie-wiki-banner-disabled');
});
@ -189,7 +189,7 @@ function displayRedirectBanner(url, id, destination, storage) {
bannerWikiLink.classList.add('indie-wiki-banner-link');
bannerText.appendChild(bannerWikiLink);
bannerWikiLink.href = url;
bannerWikiLink.innerText = 'Visit ' + destination + ' →';
bannerWikiLink.textContent = 'Visit ' + destination + ' →';
// Increment stats
if (document.readyState === 'interactive' || document.readyState === 'complete') {

View File

@ -58,12 +58,12 @@ async function loadBreezeWikiOptions() {
for (var i = 0; i < breezewikiHosts.length; i++) {
let option = document.createElement('option');
option.value = breezewikiHosts[i].instance;
let innerText = breezewikiHosts[i].instance.replace('https://', '');
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
let textContent = breezewikiHosts[i].instance.replace('https://', '');
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
if (numberOfPeriods > 1) {
innerText = innerText.substring(innerText.indexOf('.') + 1);
textContent = textContent.substring(textContent.indexOf('.') + 1);
}
option.innerText = innerText;
option.textContent = textContent;
breezewikiHostSelect.appendChild(option);
if (option.value === host) {
breezewikiHostSelect.value = host;
@ -95,12 +95,12 @@ async function loadBreezeWikiOptions() {
for (var i = 0; i < hostOptions.length; i++) {
let option = document.createElement('option');
option.value = hostOptions[i].instance;
let innerText = hostOptions[i].instance.replace('https://', '');
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
let textContent = hostOptions[i].instance.replace('https://', '');
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
if (numberOfPeriods > 1) {
innerText = innerText.substring(innerText.indexOf('.') + 1);
textContent = textContent.substring(textContent.indexOf('.') + 1);
}
option.innerText = innerText;
option.textContent = textContent;
breezewikiHostSelect.appendChild(option);
if (option.value === host) {
breezewikiHostSelect.value = host;

View File

@ -87,12 +87,12 @@ async function loadBreezeWikiOptions() {
for (var i = 0; i < breezewikiHosts.length; i++) {
let option = document.createElement('option');
option.value = breezewikiHosts[i].instance;
let innerText = breezewikiHosts[i].instance.replace('https://', '');
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
let textContent = breezewikiHosts[i].instance.replace('https://', '');
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
if (numberOfPeriods > 1) {
innerText = innerText.substring(innerText.indexOf('.') + 1);
textContent = textContent.substring(textContent.indexOf('.') + 1);
}
option.innerText = innerText;
option.textContent = textContent;
breezewikiHostSelect.appendChild(option);
if (option.value === host) {
breezewikiHostSelect.value = host;
@ -124,12 +124,12 @@ async function loadBreezeWikiOptions() {
for (var i = 0; i < hostOptions.length; i++) {
let option = document.createElement('option');
option.value = hostOptions[i].instance;
let innerText = hostOptions[i].instance.replace('https://', '');
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
let textContent = hostOptions[i].instance.replace('https://', '');
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
if (numberOfPeriods > 1) {
innerText = innerText.substring(innerText.indexOf('.') + 1);
textContent = textContent.substring(textContent.indexOf('.') + 1);
}
option.innerText = innerText;
option.textContent = textContent;
breezewikiHostSelect.appendChild(option);
if (option.value === host) {
breezewikiHostSelect.value = host;