|
@ -10,16 +10,20 @@ |
|
|
next={this.next} |
|
|
next={this.next} |
|
|
> |
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
<div class="text-break animated fadeIn"> |
|
|
<div class="text-break"> |
|
|
<loading if={this.loading}></loading> |
|
|
<div class={"animated " + (this.loading ? "invisible" : "fadeIn")}> |
|
|
<div |
|
|
<social |
|
|
class={this.loading ? "invisible" : ""} |
|
|
show={!this.loading} |
|
|
|
|
|
ref="social" |
|
|
|
|
|
postid={this.opts.state._id} |
|
|
> |
|
|
> |
|
|
<social ref="social" postid={this.opts.state._id}> |
|
|
|
|
|
</social> |
|
|
</social> |
|
|
<h4 class="post-title">{ this.title }</h4> |
|
|
<h4 class="post-title">{ this.title }</h4> |
|
|
<p class="post-content centered text-break"> |
|
|
<p class="post-content centered text-break"> |
|
|
<raw content="{ this.converter.makeHtml(this.content) }"></raw> |
|
|
<raw |
|
|
|
|
|
content="{ this.converter.makeHtml(this.content) }" |
|
|
|
|
|
> |
|
|
|
|
|
</raw> |
|
|
</p> |
|
|
</p> |
|
|
<div class="divider"></div> |
|
|
<div class="divider"></div> |
|
|
</div> |
|
|
</div> |
|
@ -116,7 +120,6 @@ updatePost(postcontent) { |
|
|
self.title = postcontent.title; |
|
|
self.title = postcontent.title; |
|
|
self.swipe = !self.swipe; |
|
|
self.swipe = !self.swipe; |
|
|
self.loading = false; |
|
|
self.loading = false; |
|
|
self.one("updated", self.toTop); |
|
|
|
|
|
self.prevloading = ""; |
|
|
self.prevloading = ""; |
|
|
self.nextloading = ""; |
|
|
self.nextloading = ""; |
|
|
self.route(`/posts/${self._id}`); |
|
|
self.route(`/posts/${self._id}`); |
|
@ -128,6 +131,7 @@ updatePost(postcontent) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
nextPost(_id) { |
|
|
nextPost(_id) { |
|
|
|
|
|
self.update({"loading" : true}); |
|
|
fetch(`/blog/switchpost/${_id.slice(-hashLength)}`) |
|
|
fetch(`/blog/switchpost/${_id.slice(-hashLength)}`) |
|
|
.then((resp) => resp.text()) |
|
|
.then((resp) => resp.text()) |
|
|
.then((resp) => { |
|
|
.then((resp) => { |
|
@ -147,6 +151,7 @@ nextPost(_id) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
prevPost(_id) { |
|
|
prevPost(_id) { |
|
|
|
|
|
self.update({"loading" : true}); |
|
|
fetch(`/blog/prevpost/${_id.slice(-hashLength)}`) |
|
|
fetch(`/blog/prevpost/${_id.slice(-hashLength)}`) |
|
|
.then((resp) => resp.text()) |
|
|
.then((resp) => resp.text()) |
|
|
.then((resp) => { |
|
|
.then((resp) => { |
|
@ -156,6 +161,7 @@ prevPost(_id) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getPost(_id) { |
|
|
getPost(_id) { |
|
|
|
|
|
self.update({"loading" : true}); |
|
|
var url; |
|
|
var url; |
|
|
if (_id !== undefined && _id) { |
|
|
if (_id !== undefined && _id) { |
|
|
url = `/blog/getpost/${_id.slice(-hashLength)}`; |
|
|
url = `/blog/getpost/${_id.slice(-hashLength)}`; |
|
|