Bugfix + visual tweak
parent
349894d4f9
commit
c59caef23a
|
|
@ -46,7 +46,7 @@ export default class SzuruWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateTag(tag: Tag): Promise<any> {
|
async updateTag(tag: Tag): Promise<any> {
|
||||||
return (await this.apiPut("tag/" + tag.names[0], tag)).data;
|
return (await this.apiPut("tag/" + encodeURIComponent(tag.names[0]), tag)).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getTags(
|
async getTags(
|
||||||
|
|
@ -75,7 +75,7 @@ export default class SzuruWrapper {
|
||||||
tags: post.tags.map(x => x.name),
|
tags: post.tags.map(x => x.name),
|
||||||
safety: post.rating,
|
safety: post.rating,
|
||||||
source: post.source,
|
source: post.source,
|
||||||
notes: post.notes.map(note => <SzuruNote>{ polygon: note.polygons, text: note.text }),
|
notes: post.notes,
|
||||||
contentUrl: post.contentUrl
|
contentUrl: post.contentUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -86,10 +86,7 @@ export default class SzuruWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
async reverseSearch(contentUrl: string): Promise<ImageSearchResult> {
|
async reverseSearch(contentUrl: string): Promise<ImageSearchResult> {
|
||||||
var obj = {
|
var obj = { contentUrl };
|
||||||
contentUrl: contentUrl
|
|
||||||
};
|
|
||||||
|
|
||||||
return (await this.apiPost("posts/reverse-search", obj)).data;
|
return (await this.apiPost("posts/reverse-search", obj)).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,15 @@ select {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.compact-tags > li {
|
||||||
|
/*
|
||||||
|
Ident each newline but not the first line.
|
||||||
|
This makes tagName line breaks look better, though it is a bit hacky.
|
||||||
|
*/
|
||||||
|
text-indent: -1.5ch;
|
||||||
|
padding-left: 1.5ch;
|
||||||
|
}
|
||||||
|
|
||||||
.tag-general {
|
.tag-general {
|
||||||
color: #24aadd;
|
color: #24aadd;
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +103,8 @@ a.remove-tag {
|
||||||
|
|
||||||
.tag-usages {
|
.tag-usages {
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
/* Reset text-indent set by ".compact-tags > li" because it clashes with our margin */
|
||||||
|
text-indent: initial;
|
||||||
margin-left: 0.7em;
|
margin-left: 0.7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@
|
||||||
<ul class="compact-tags">
|
<ul class="compact-tags">
|
||||||
<li v-for="tag in selectedPost.tags" :key="tag.name">
|
<li v-for="tag in selectedPost.tags" :key="tag.name">
|
||||||
<a class="remove-tag" @click="removeTag(tag)">x</a>
|
<a class="remove-tag" @click="removeTag(tag)">x</a>
|
||||||
<span :class="getTagClasses(tag)">{{ tag.name }}</span>
|
<span :class="getTagClasses(tag)" v-html="breakTagName(tag.name)"></span>
|
||||||
<span
|
<span
|
||||||
v-if="showTagUsages"
|
v-if="showTagUsages"
|
||||||
class="tag-usages tag-usages-reserve-space"
|
class="tag-usages tag-usages-reserve-space"
|
||||||
|
|
@ -232,6 +232,10 @@ export default Vue.extend({
|
||||||
|
|
||||||
return classes;
|
return classes;
|
||||||
},
|
},
|
||||||
|
breakTagName(tagName: string) {
|
||||||
|
// Based on https://stackoverflow.com/a/6316913
|
||||||
|
return tagName.replace(/\_/g, "_<wbr>");
|
||||||
|
},
|
||||||
// Remove tag from post's taglist
|
// Remove tag from post's taglist
|
||||||
removeTag(tag: TagViewModel) {
|
removeTag(tag: TagViewModel) {
|
||||||
if (this.selectedPost) {
|
if (this.selectedPost) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue