fixed #68
This commit is contained in:
parent
cda26a519f
commit
2badd56b2b
3 changed files with 21 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ Mac/build/
|
||||||
Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate
|
Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate
|
||||||
dsa_priv.pem
|
dsa_priv.pem
|
||||||
*.pyc
|
*.pyc
|
||||||
|
Mac/.DS_Store
|
||||||
|
|
|
@ -42,14 +42,25 @@ function(Core, Paths, HostApp, URI) {
|
||||||
this.since_id = status.id;
|
this.since_id = status.id;
|
||||||
this.since_id_entity = status.entity;
|
this.since_id_entity = status.entity;
|
||||||
|
|
||||||
if(this.body.childNodes.length > 0) {
|
if (status.type == "https://tent.io/types/post/status/v0.1.0") {
|
||||||
if(this.body.childNodes.length > this.max_length) {
|
|
||||||
this.body.removeChild(this.body.lastChild);
|
if(this.body.childNodes.length > 0) {
|
||||||
|
if(this.body.childNodes.length > this.max_length) {
|
||||||
|
this.body.removeChild(this.body.lastChild);
|
||||||
|
}
|
||||||
|
this.body.insertBefore(this.getStatusDOMElement(status), this.body.firstChild);
|
||||||
|
} else {
|
||||||
|
this.body.appendChild(this.getStatusDOMElement(status));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (status.type == "https://tent.io/types/post/delete/v0.1.0") {
|
||||||
|
|
||||||
|
var li = document.getElementById("post-" + status.content.id);
|
||||||
|
if (li) {
|
||||||
|
this.body.removeChild(li);
|
||||||
}
|
}
|
||||||
this.body.insertBefore(this.getStatusDOMElement(status), this.body.firstChild);
|
|
||||||
} else {
|
|
||||||
this.body.appendChild(this.getStatusDOMElement(status));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +71,7 @@ function(Core, Paths, HostApp, URI) {
|
||||||
|
|
||||||
var those = this;
|
var those = this;
|
||||||
var url = URI(Paths.mkApiRootPath("/posts"));
|
var url = URI(Paths.mkApiRootPath("/posts"));
|
||||||
url.addSearch("post_types", "https://tent.io/types/post/status/v0.1.0");
|
url.addSearch("post_types", "https://tent.io/types/post/status/v0.1.0,https://tent.io/types/post/delete/v0.1.0");
|
||||||
url.addSearch("limit", this.max_length);
|
url.addSearch("limit", this.max_length);
|
||||||
if(this.since_id) {
|
if(this.since_id) {
|
||||||
url.addSearch("since_id", this.since_id);
|
url.addSearch("since_id", this.since_id);
|
||||||
|
|
|
@ -135,6 +135,8 @@ function(jQuery, Paths, URI, HostApp, Followings) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
var template = this.getTemplate();
|
var template = this.getTemplate();
|
||||||
|
|
||||||
|
template.item.id = "post-" + status.id;
|
||||||
|
|
||||||
template.reply_to.onclick = function() {
|
template.reply_to.onclick = function() {
|
||||||
|
|
||||||
|
|
Reference in a new issue