diff --git a/.gitignore b/.gitignore index 7523bbb..d458a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ Mac/build/ Mac/Tentia.xcodeproj/project.xcworkspace/xcuserdata/jeena.xcuserdatad/UserInterfaceState.xcuserstate dsa_priv.pem *.pyc +Mac/.DS_Store diff --git a/WebKit/scripts/controller/Timeline.js b/WebKit/scripts/controller/Timeline.js index c806ef1..d5869bd 100644 --- a/WebKit/scripts/controller/Timeline.js +++ b/WebKit/scripts/controller/Timeline.js @@ -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); diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 9f6b201..a4478e8 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -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() {