eyo, fix. spam filter next?
This commit is contained in:
parent
135e877fa8
commit
408ef4a3e6
@ -12,25 +12,18 @@ class Book {
|
||||
return this.title+' av '+this.author+', terningkast '+this.rating+', utgitt '+this.published.toString().slice(0,15)+', forlag; '+this.publisher
|
||||
}
|
||||
toHtml(elm) {
|
||||
let span = function(selector, string, color='red') {
|
||||
let span = function(selector, string, p, color='red') {
|
||||
$($(selector)[$(selector).length-1]).append('<span style="color: '+color+'"></span>')
|
||||
//$($(selector+' > span')[$(selector+' > span').length-1])
|
||||
$($(selector+' > span')[$(selector+' > span').length-1]).text(string)
|
||||
$($(selector)[$(selector).length-1]).append(p)
|
||||
}
|
||||
let user = firebase.auth().currentUser
|
||||
elm.append('<p class="book"></p>', this.title)
|
||||
span('.book')
|
||||
//.text(this.toString())
|
||||
if (user) {
|
||||
$($('.kommentar')[$('.kommentar').length-1]).append(' <a class="btn btn-primary" href="javascript: remove(\''+this.cfid+'\')">Slett</a>')
|
||||
elm.append('<p class="book"></p>')
|
||||
span('.book', this.title, ' av ')
|
||||
span('.book', this.author, ', terningkast ')
|
||||
span('.book', this.rating, ', utgitt ')
|
||||
span('.book', this.published.toString().slice(0,15), ', forlag: ', 'green')
|
||||
span('.book', this.publisher, firebase.auth().currentUser?' <a class="btn btn-primary" href="javascript: remove(\''+this.cfid+'\')">Slett</a>':'', 'yellow')
|
||||
}
|
||||
} /*
|
||||
let span = function(string, color='red') {
|
||||
return '<span style="color: '+color+'">'+string+'</span>'
|
||||
}
|
||||
return '<p>'+span(this.title)+' av '+span(this.author)+', terningkast '+span(this.rating)+', utgitt '
|
||||
+span(this.published.toString().slice(0,15), 'green')+', forlag; '+span(this.publisher, 'yellow')
|
||||
+(user?' <a class="btn btn-primary" href="javascript: remove(\''+this.cfid+'\')">Slett</a>':'')+'</p>'
|
||||
}*/
|
||||
}
|
||||
|
||||
bookConverter = {
|
||||
|
@ -9,12 +9,9 @@ class Comment {
|
||||
return this.name+': '+this.message
|
||||
}
|
||||
toHtml(elm) {
|
||||
let user = firebase.auth().currentUser
|
||||
elm.append('<p class="kommentar"></p>')
|
||||
$($('.kommentar')[$('.kommentar').length-1]).text(this.toString())
|
||||
if (user) {
|
||||
$($('.kommentar')[$('.kommentar').length-1]).append(' <a class="btn btn-primary" href="javascript: remove(\''+this.cfid+'\')">Slett</a>')
|
||||
}
|
||||
firebase.auth().currentUser?$($('.kommentar')[$('.kommentar').length-1]).append(' <a class="btn btn-primary" href="javascript: remove(\''+this.cfid+'\')">Slett</a>'):undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user