mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/pools: inherit option to show underscores as spaces
This commit is contained in:
@ -30,7 +30,7 @@ class PostReadonlySidebarControl extends events.EventTarget {
|
||||
canViewTags: api.hasPrivilege("tags:view"),
|
||||
escapeColons: uri.escapeColons,
|
||||
extractRootDomain: uri.extractRootDomain,
|
||||
getPrettyTagName: misc.getPrettyTagName,
|
||||
getPrettyName: misc.getPrettyName,
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -204,7 +204,7 @@ function dataURItoBlob(dataURI) {
|
||||
return new Blob([data], { type: mimeString });
|
||||
}
|
||||
|
||||
function getPrettyTagName(tag) {
|
||||
function getPrettyName(tag) {
|
||||
if (settings.get().tagUnderscoresAsSpaces) {
|
||||
return tag.replace(/_/g, " ");
|
||||
}
|
||||
@ -228,5 +228,5 @@ module.exports = {
|
||||
decamelize: decamelize,
|
||||
escapeSearchTerm: escapeSearchTerm,
|
||||
dataURItoBlob: dataURItoBlob,
|
||||
getPrettyTagName: getPrettyTagName,
|
||||
getPrettyName: getPrettyName,
|
||||
};
|
||||
|
@ -210,7 +210,7 @@ function makePostLink(id, includeHash) {
|
||||
|
||||
function makeTagLink(name, includeHash, includeCount, tag) {
|
||||
const category = tag ? tag.category : "unknown";
|
||||
let text = misc.getPrettyTagName(name);
|
||||
let text = misc.getPrettyName(name);
|
||||
if (includeHash === true) {
|
||||
text = "#" + text;
|
||||
}
|
||||
@ -235,7 +235,7 @@ function makeTagLink(name, includeHash, includeCount, tag) {
|
||||
|
||||
function makePoolLink(id, includeHash, includeCount, pool, name) {
|
||||
const category = pool ? pool.category : "unknown";
|
||||
let text = name ? name : pool.names[0];
|
||||
let text = misc.getPrettyName(name ? name : pool.names[0]);
|
||||
if (includeHash === true) {
|
||||
text = "#" + text;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class PoolView extends events.EventTarget {
|
||||
this._ctx = ctx;
|
||||
ctx.pool.addEventListener("change", (e) => this._evtChange(e));
|
||||
ctx.section = ctx.section || "summary";
|
||||
ctx.getPrettyPoolName = misc.getPrettyPoolName;
|
||||
ctx.getPrettyName = misc.getPrettyName;
|
||||
|
||||
this._hostNode = document.getElementById("content-holder");
|
||||
this._install();
|
||||
|
@ -42,9 +42,8 @@ class SettingsView extends events.EventTarget {
|
||||
tagSuggestions: this._find("tag-suggestions").checked,
|
||||
autoplayVideos: this._find("autoplay-videos").checked,
|
||||
postsPerPage: this._find("posts-per-page").value,
|
||||
tagUnderscoresAsSpaces: this._find(
|
||||
"tag-underscores-as-spaces"
|
||||
).checked,
|
||||
tagUnderscoresAsSpaces: this._find("underscores-as-spaces")
|
||||
.checked,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
@ -18,7 +18,7 @@ class TagView extends events.EventTarget {
|
||||
this._ctx = ctx;
|
||||
ctx.tag.addEventListener("change", (e) => this._evtChange(e));
|
||||
ctx.section = ctx.section || "summary";
|
||||
ctx.getPrettyTagName = misc.getPrettyTagName;
|
||||
ctx.getPrettyName = misc.getPrettyName;
|
||||
|
||||
this._hostNode = document.getElementById("content-holder");
|
||||
this._install();
|
||||
|
Reference in New Issue
Block a user