innerText -> textContent
parent
83643a5fff
commit
a9b887eece
|
@ -109,7 +109,7 @@ function displayRedirectBanner(url, id, destination, storage) {
|
||||||
var bannerExit = document.createElement('div');
|
var bannerExit = document.createElement('div');
|
||||||
bannerExit.id = 'indie-wiki-banner-exit';
|
bannerExit.id = 'indie-wiki-banner-exit';
|
||||||
banner.appendChild(bannerExit);
|
banner.appendChild(bannerExit);
|
||||||
bannerExit.innerText = '✕';
|
bannerExit.textContent = '✕';
|
||||||
bannerExit.onclick = function () { this.parentElement.remove(); };
|
bannerExit.onclick = function () { this.parentElement.remove(); };
|
||||||
|
|
||||||
// Output control links container
|
// 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');
|
||||||
bannerRestoreLink.classList.add('indie-wiki-banner-link-small');
|
bannerRestoreLink.classList.add('indie-wiki-banner-link-small');
|
||||||
bannerRestoreLink.classList.add('indie-wiki-banner-hidden');
|
bannerRestoreLink.classList.add('indie-wiki-banner-hidden');
|
||||||
bannerRestoreLink.innerText = '⎌ Restore banner';
|
bannerRestoreLink.textContent = '⎌ Restore banner';
|
||||||
bannerControls.appendChild(bannerRestoreLink);
|
bannerControls.appendChild(bannerRestoreLink);
|
||||||
bannerRestoreLink.onclick = function (e) {
|
bannerRestoreLink.onclick = function (e) {
|
||||||
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
|
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
|
||||||
response.siteSettings.get(id).set('action', 'alert');
|
response.siteSettings.get(id).set('action', 'alert');
|
||||||
chrome.storage.sync.set({ 'siteSettings': response.siteSettings });
|
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');
|
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-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');
|
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.id = 'indie-wiki-banner-disable';
|
||||||
bannerDisableLink.classList.add('indie-wiki-banner-link');
|
bannerDisableLink.classList.add('indie-wiki-banner-link');
|
||||||
bannerDisableLink.classList.add('indie-wiki-banner-link-small');
|
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);
|
bannerControls.appendChild(bannerDisableLink);
|
||||||
bannerDisableLink.onclick = function (e) {
|
bannerDisableLink.onclick = function (e) {
|
||||||
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
|
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
|
||||||
response.siteSettings.get(id).set('action', 'disabled');
|
response.siteSettings.get(id).set('action', 'disabled');
|
||||||
chrome.storage.sync.set({ 'siteSettings': response.siteSettings });
|
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');
|
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-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-hidden');
|
||||||
document.getElementById('indie-wiki-banner-restore').classList.remove('indie-wiki-banner-disabled');
|
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.id = 'indie-wiki-banner-redirect';
|
||||||
bannerRedirectLink.classList.add('indie-wiki-banner-link');
|
bannerRedirectLink.classList.add('indie-wiki-banner-link');
|
||||||
bannerRedirectLink.classList.add('indie-wiki-banner-link-small');
|
bannerRedirectLink.classList.add('indie-wiki-banner-link-small');
|
||||||
bannerRedirectLink.innerText = '↪ Auto redirect this wiki';
|
bannerRedirectLink.textContent = '↪ Auto redirect this wiki';
|
||||||
bannerControls.appendChild(bannerRedirectLink);
|
bannerControls.appendChild(bannerRedirectLink);
|
||||||
bannerRedirectLink.onclick = function (e) {
|
bannerRedirectLink.onclick = function (e) {
|
||||||
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
|
chrome.storage.sync.get({ 'siteSettings': {} }, function (response) {
|
||||||
response.siteSettings.get(id).set('action', 'redirect');
|
response.siteSettings.get(id).set('action', 'redirect');
|
||||||
chrome.storage.sync.set({ 'siteSettings': response.siteSettings });
|
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');
|
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-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-hidden');
|
||||||
document.getElementById('indie-wiki-banner-restore').classList.remove('indie-wiki-banner-disabled');
|
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');
|
bannerWikiLink.classList.add('indie-wiki-banner-link');
|
||||||
bannerText.appendChild(bannerWikiLink);
|
bannerText.appendChild(bannerWikiLink);
|
||||||
bannerWikiLink.href = url;
|
bannerWikiLink.href = url;
|
||||||
bannerWikiLink.innerText = 'Visit ' + destination + ' →';
|
bannerWikiLink.textContent = 'Visit ' + destination + ' →';
|
||||||
|
|
||||||
// Increment stats
|
// Increment stats
|
||||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||||
|
|
16
popup.js
16
popup.js
|
@ -58,12 +58,12 @@ async function loadBreezeWikiOptions() {
|
||||||
for (var i = 0; i < breezewikiHosts.length; i++) {
|
for (var i = 0; i < breezewikiHosts.length; i++) {
|
||||||
let option = document.createElement('option');
|
let option = document.createElement('option');
|
||||||
option.value = breezewikiHosts[i].instance;
|
option.value = breezewikiHosts[i].instance;
|
||||||
let innerText = breezewikiHosts[i].instance.replace('https://', '');
|
let textContent = breezewikiHosts[i].instance.replace('https://', '');
|
||||||
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
|
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
|
||||||
if (numberOfPeriods > 1) {
|
if (numberOfPeriods > 1) {
|
||||||
innerText = innerText.substring(innerText.indexOf('.') + 1);
|
textContent = textContent.substring(textContent.indexOf('.') + 1);
|
||||||
}
|
}
|
||||||
option.innerText = innerText;
|
option.textContent = textContent;
|
||||||
breezewikiHostSelect.appendChild(option);
|
breezewikiHostSelect.appendChild(option);
|
||||||
if (option.value === host) {
|
if (option.value === host) {
|
||||||
breezewikiHostSelect.value = host;
|
breezewikiHostSelect.value = host;
|
||||||
|
@ -95,12 +95,12 @@ async function loadBreezeWikiOptions() {
|
||||||
for (var i = 0; i < hostOptions.length; i++) {
|
for (var i = 0; i < hostOptions.length; i++) {
|
||||||
let option = document.createElement('option');
|
let option = document.createElement('option');
|
||||||
option.value = hostOptions[i].instance;
|
option.value = hostOptions[i].instance;
|
||||||
let innerText = hostOptions[i].instance.replace('https://', '');
|
let textContent = hostOptions[i].instance.replace('https://', '');
|
||||||
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
|
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
|
||||||
if (numberOfPeriods > 1) {
|
if (numberOfPeriods > 1) {
|
||||||
innerText = innerText.substring(innerText.indexOf('.') + 1);
|
textContent = textContent.substring(textContent.indexOf('.') + 1);
|
||||||
}
|
}
|
||||||
option.innerText = innerText;
|
option.textContent = textContent;
|
||||||
breezewikiHostSelect.appendChild(option);
|
breezewikiHostSelect.appendChild(option);
|
||||||
if (option.value === host) {
|
if (option.value === host) {
|
||||||
breezewikiHostSelect.value = host;
|
breezewikiHostSelect.value = host;
|
||||||
|
|
16
settings.js
16
settings.js
|
@ -87,12 +87,12 @@ async function loadBreezeWikiOptions() {
|
||||||
for (var i = 0; i < breezewikiHosts.length; i++) {
|
for (var i = 0; i < breezewikiHosts.length; i++) {
|
||||||
let option = document.createElement('option');
|
let option = document.createElement('option');
|
||||||
option.value = breezewikiHosts[i].instance;
|
option.value = breezewikiHosts[i].instance;
|
||||||
let innerText = breezewikiHosts[i].instance.replace('https://', '');
|
let textContent = breezewikiHosts[i].instance.replace('https://', '');
|
||||||
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
|
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
|
||||||
if (numberOfPeriods > 1) {
|
if (numberOfPeriods > 1) {
|
||||||
innerText = innerText.substring(innerText.indexOf('.') + 1);
|
textContent = textContent.substring(textContent.indexOf('.') + 1);
|
||||||
}
|
}
|
||||||
option.innerText = innerText;
|
option.textContent = textContent;
|
||||||
breezewikiHostSelect.appendChild(option);
|
breezewikiHostSelect.appendChild(option);
|
||||||
if (option.value === host) {
|
if (option.value === host) {
|
||||||
breezewikiHostSelect.value = host;
|
breezewikiHostSelect.value = host;
|
||||||
|
@ -124,12 +124,12 @@ async function loadBreezeWikiOptions() {
|
||||||
for (var i = 0; i < hostOptions.length; i++) {
|
for (var i = 0; i < hostOptions.length; i++) {
|
||||||
let option = document.createElement('option');
|
let option = document.createElement('option');
|
||||||
option.value = hostOptions[i].instance;
|
option.value = hostOptions[i].instance;
|
||||||
let innerText = hostOptions[i].instance.replace('https://', '');
|
let textContent = hostOptions[i].instance.replace('https://', '');
|
||||||
const numberOfPeriods = (innerText.match(/\./g)||[]).length;
|
const numberOfPeriods = (textContent.match(/\./g)||[]).length;
|
||||||
if (numberOfPeriods > 1) {
|
if (numberOfPeriods > 1) {
|
||||||
innerText = innerText.substring(innerText.indexOf('.') + 1);
|
textContent = textContent.substring(textContent.indexOf('.') + 1);
|
||||||
}
|
}
|
||||||
option.innerText = innerText;
|
option.textContent = textContent;
|
||||||
breezewikiHostSelect.appendChild(option);
|
breezewikiHostSelect.appendChild(option);
|
||||||
if (option.value === host) {
|
if (option.value === host) {
|
||||||
breezewikiHostSelect.value = host;
|
breezewikiHostSelect.value = host;
|
||||||
|
|
Loading…
Reference in New Issue