Browse Source

fix for PhantomJS

pull/1/head
wes 7 years ago
parent
commit
e7385b9499
  1. 7
      src/scripts/app.tag
  2. 5
      src/scripts/editor.tag
  3. 2
      src/scripts/links.tag
  4. 8
      src/scripts/post.tag
  5. 2
      src/scripts/projects.tag
  6. 4
      src/scripts/sidebar.tag
  7. 4
      src/scripts/social.tag
  8. 2
      src/templates/index.html

7
src/scripts/app.tag

@ -176,10 +176,9 @@ menuOff(ev) {
function activate(page) {
return function() {
if (page !== "posts") {
document.title = `${page.slice(0,1).toUpperCase()}${page.slice(1,page.length)}`;
document.title = page.slice(0,1).toUpperCase()+" "+page.slice(1,page.length);
self.currentPage = document.title;
}
console.log(`activating ${page}`);
self.active = lens.setActive(self.active, page);
self.update();
};
@ -222,7 +221,7 @@ self.one("updated", () => {
function loaduser() {
/* https://api.github.com/users/${self.username}/repos?sort=updated&direction=desc */
self.cached(`/blog/projects`)
self.cached("/blog/projects")
.then((resp) => resp.json())
.then((resp) => {
self.state.projects = Z.fromList(
@ -235,7 +234,7 @@ function loaduser() {
}
function getcategories() {
self.cached(`/blog/categories`)
self.cached("/blog/categories")
.then((resp) => resp.json())
.then((resp) => {
self.categories = resp;

5
src/scripts/editor.tag

@ -214,7 +214,7 @@ loadPost(_id) {
return false;
}
self.update({"loading" : true});
axios.get(`/blog/getpost/${_id.slice(-8)}`)
axios.get("/blog/getpost/"+_id.slice(-8))
.then(function(resp) {
self.update({"loading" : false});
self.refs.textarea.value = resp.data.content;
@ -240,7 +240,7 @@ deletePost(_id) {
return false;
}
self.update({"loading" : true});
axios.get(`/blog/deletepost/${self._id}`)
axios.get("/blog/deletepost/"+self._id)
.then(function(resp) {
console.log(resp);
self.listPosts();
@ -256,7 +256,6 @@ listPosts() {
axios.get("/blog/allposts")
.then(function(resp) {
var postsList = Z.extend(Z.empty, resp.data);
console.log(`trying to load post with id ${Z.focus(postsList, self.defaultPost)._id}`);
var currentPost = Z.focus(postsList, self.defaultPost);
if (currentPost == self.defaultPost) {

2
src/scripts/links.tag

@ -45,7 +45,7 @@ self.groups = []
getLinks() {
self.update({"loading" : true});
self.opts.cached(`/blog/links/`)
self.opts.cached("/blog/links/")
.then((resp) => resp.text())
.then((resp) => {
self.update(

8
src/scripts/post.tag

@ -131,7 +131,7 @@ updatePost(postcontent) {
self.loading = false;
self.prevloading = "";
self.nextloading = "";
self.route(`/posts/${self._id}`);
self.route("/posts/"+self._id);
RiotControl.trigger("postswitch", {"title" : self.title});
@ -145,7 +145,7 @@ updatePost(postcontent) {
nextPost(_id) {
self.update({"loading" : true});
self.opts.cached(`/blog/switchpost/${_id.slice(-hashLength)}/${self.category}`)
self.opts.cached("/blog/switchpost/"+_id.slice(-hashLength)+"/"+self.category)
.then((resp) => resp.text())
.then((resp) => {
var content = JSON.parse(resp);
@ -165,7 +165,7 @@ nextPost(_id) {
prevPost(_id) {
self.update({"loading" : true});
self.opts.cached(`/blog/prevpost/${_id.slice(-hashLength)}/${self.category}`)
self.opts.cached("/blog/prevpost/"+_id.slice(-hashLength)+"/"+self.category)
.then((resp) => resp.text())
.then((resp) => {
self.updatePost(JSON.parse(resp))
@ -176,7 +176,7 @@ getPost(_id) {
self.update({"loading" : true});
var url;
if (_id !== undefined && _id) {
url = `/blog/getpost/${_id.slice(-hashLength)}/${self.category}`;
url = "/blog/getpost/"+_id.slice(-hashLength)+"/"+self.category;
}
else {
url = "/blog/switchpost/";

2
src/scripts/projects.tag

@ -15,7 +15,7 @@
</div>
<div class="text-break">
<div if={this.swipe} class={`card animated ${this.transition}`}>
<div if={this.swipe} class={"card animated "+this.transition}>
<div class="card-header">
<h3 class="card-title project-title">{ this.project().name }</h3>
<h5 class="project-description">{ this.project().description }</h5>

4
src/scripts/sidebar.tag

@ -16,7 +16,7 @@
show={this.swiped !== undefined}
style={ this.styles() }
id="sidebar"
class={`animated ${this.swiped !== undefined ? (this.swiped ? "fadeInLeft" : "fadeOutLeft") : "" } container`}
class={"animated "+(this.swiped !== undefined ? (this.swiped ? "fadeInLeft" : "fadeOutLeft") : "" ) +" container"}
>
<div
style={{"height" : "100%", "overflow-x" : "hidden"}}
@ -60,7 +60,7 @@
<div
style={buttonStyles()}
class={`column ${this.open ? "col-1" : "col-12"}`}
class={"column "+(this.open ? "col-1" : "col-12")}
onclick={this.swipe}
>
</div>

4
src/scripts/social.tag

@ -28,8 +28,8 @@ updateButton(_id, title) {
}
if (_id != self._id) {
self.tweetHtml = `<a style="display:none;" data-size="small" class="twitter-share-button btn" data-text="${title}" data-via="weskerfoot" data-show-count="false" data-url="https://primop.me/blog/#!posts/${_id}" ref="tweet">Tweet ${_id}</a>`;
self.fbHtml = `<div class="fb-share-button" data-href="https://primop.me/blog/#!posts/${_id}" data-layout="button_count"></div>`;
self.tweetHtml = '<a style="display:none;" data-size="small" class="twitter-share-button btn" data-text="'+title+'" data-via="weskerfoot" data-show-count="false" data-url="https://primop.me/blog/#!posts/'+_id+'" ref="tweet">Tweet '+_id+'</a>';
self.fbHtml = '<div class="fb-share-button" data-href="https://primop.me/blog/#!posts/'+_id+'" data-layout="button_count"></div>';
self._id = _id;
self.update();
}

2
src/templates/index.html

@ -6,7 +6,7 @@
</head>
<html>
<body>
<div data-is="app" csrf_token="{{ csrf_token() }}"></div>
<div data-is="app" initial_post="{{ initial_post }}" csrf_token="{{ csrf_token() }}"></div>
</body>
<footer>
<script>

Loading…
Cancel
Save