Commit 49873f4a authored by Markus Opolka's avatar Markus Opolka
Browse files

Add option to toggle inline comments

parent 9557d5db
......@@ -39,9 +39,10 @@
<v-flex xs5>
<v-card>
<v-card-text>
<v-checkbox label="Show Comments" v-model="showComments"></v-checkbox>
<ul style="list-style-type:none;" class="letter-text">
<li v-for="(value, key) in letter.text.body.l" :class="value._attributes.no">
{{value._attributes.no }}: {{ value._text }}
<li v-for="(value, key) in letter.text.body.l" :class="value._attributes.no" v-if="hasText(formatText(value._text))">
{{value._attributes.no }}: {{ formatText(value._text) }}
</li>
</ul>
</v-card-text>
......@@ -81,10 +82,22 @@ export default {
lettername: '',
letter: null,
images: [],
showComments: true,
features: []
}
},
methods: {
hasText (text) {
// Check if string is empty
return text.length !== 0
},
formatText (text) {
// Remove [Stuff] from text
if (!this.showComments) {
text = text.replace(/\[.*\]/, '')
}
return text
},
capitalize (word) {
// Capitalize first letter of a String
return word.charAt(0).toUpperCase() + word.slice(1)
......@@ -103,6 +116,7 @@ export default {
this.lettername = this.$route.params.letter
this.$http.get('http://localhost:3000/api/letters/' + this.lettername).then(function (data) {
// If there's only one element xml-js makes no array... great stuff -.-
if (data.body.TEI.text.head.graphic instanceof Array) {
this.images = data.body.TEI.text.head.graphic
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment