This commit is contained in:
Jeena Paradies 2012-11-22 00:50:51 +01:00
parent cda26a519f
commit 2badd56b2b
3 changed files with 21 additions and 7 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ Mac/build/
Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate
dsa_priv.pem
*.pyc
Mac/.DS_Store

View file

@ -42,14 +42,25 @@ function(Core, Paths, HostApp, URI) {
this.since_id = status.id;
this.since_id_entity = status.entity;
if(this.body.childNodes.length > 0) {
if(this.body.childNodes.length > this.max_length) {
this.body.removeChild(this.body.lastChild);
if (status.type == "https://tent.io/types/post/status/v0.1.0") {
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 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);
if(this.since_id) {
url.addSearch("since_id", this.since_id);

View file

@ -135,6 +135,8 @@ function(jQuery, Paths, URI, HostApp, Followings) {
var _this = this;
var template = this.getTemplate();
template.item.id = "post-" + status.id;
template.reply_to.onclick = function() {