Skip to content

Commit

Permalink
Add consistency with other FL extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lensvol committed Aug 12, 2022
1 parent 984d645 commit b74ef3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
const entries = Object.entries(result.query.results);
if (entries.length > 0) {
if (entries.length > 5){
console.warn(`Wiki server returned ${entries.length} results for the query '${conditions}'.\n`
console.warn(`[FL 1-Click Wiki] Wiki server returned ${entries.length} results for the query '${conditions}'.\n`
+ `Please notify the wiki admins about this.`);
}
for (let [key, entry] of entries) {
console.debug(`Opening tab for ${entry.fullurl}`);
console.debug(`[FL 1-Click Wiki] Opening tab for ${entry.fullurl}`);
openNewTab(entry.fullurl, targetPosition);
}
} else {
console.debug(`No pages found for ID ${request.storyletId}, falling back to using title.`);
console.debug(`[FL 1-Click Wiki] No pages found for ID ${request.storyletId}, falling back to using title.`);
openNewTab(destination, targetPosition);
}
})
.catch(error => {
console.error(error);
console.debug("Error has occured, falling back to using title.")
console.debug("[FL 1-Click Wiki] Error has occured, falling back to using title.")
openNewTab(destination, targetPosition);
});
} else {
console.debug("No ID found for the storylet, falling back to using title.");
console.debug("[FL 1-Click Wiki] No ID found for the storylet, falling back to using title.");
openNewTab(destination, targetPosition);
}

Expand Down
9 changes: 4 additions & 5 deletions inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@

if (currentStoryletId !== undefined) {
if (currentStoryletId != null) {
console.debug(`Current storylet ID: ${currentStoryletId}`)
console.debug(`[FL 1-Click Wiki] Current storylet ID: ${currentStoryletId}`)
} else{
console.debug(`Current storylet ID is not known, falling back to title...`)
console.debug(`[FL 1-Click Wiki] Current storylet ID is not known, falling back to title...`)
}

window.postMessage({
Expand Down Expand Up @@ -87,7 +87,7 @@

let existingButtons = mediaRoot.getElementsByClassName(GLOBE_BTN_CLASS_LIST);
if (existingButtons.length > 0) {
console.debug("Duplicate Wiki buttons found, please tell the developer about it!");
console.debug("[FL 1-Click Wiki] Duplicate Wiki buttons found, please tell the developer about it!");
return;
}

Expand All @@ -108,7 +108,6 @@
container.insertBefore(rootFrequencyHolder, container.firstChild);
}

//container.insertBefore(wikiButton, container.firstChild);
rootFrequencyHolder.appendChild(wikiButton);
}
}
Expand Down Expand Up @@ -137,7 +136,7 @@

let existingButtons = branchContainer.getElementsByClassName(GLOBE_BTN_CLASS_LIST);
if (existingButtons.length > 0) {
console.debug("Duplicate Wiki buttons found, please tell the developer about it!");
console.debug("[FL 1-Click Wiki] Duplicate Wiki buttons found, please tell the developer about it!");
return;
}

Expand Down

0 comments on commit b74ef3c

Please sign in to comment.