implemented photo post type

This commit is contained in:
Jeena Paradies 2012-11-24 03:43:11 +01:00
parent 00e1f54636
commit 0786f1cf3f
5 changed files with 64 additions and 17 deletions

View file

@ -98,7 +98,7 @@ function(HostApp, Paths, Hmac) {
this.state = Hmac.makeid(19);
var auth = "/oauth/authorize?client_id=" + register_data["id"]
+ "&redirect_uri=" + this.app_info["redirect_uris"][0] // Check if this still works on mac
+ "&redirect_uri=" + this.app_info["redirect_uris"][0]
+ "&scope=" + Object.keys(this.app_info["scopes"]).join(",")
+ "&state=" + this.state
+ "&tent_post_types=all";

View file

@ -42,15 +42,22 @@ function(Core, Paths, HostApp, URI) {
this.since_id = status.id;
this.since_id_entity = status.entity;
if (status.type == "https://tent.io/types/post/status/v0.1.0") {
if (status.type == "https://tent.io/types/post/status/v0.1.0" || status.type == "https://tent.io/types/post/photo/v0.1.0") {
var new_node = this.getStatusDOMElement(status);
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);
this.body.insertBefore(new_node, this.body.firstChild);
} else {
this.body.appendChild(this.getStatusDOMElement(status));
this.body.appendChild(new_node);
}
} else if (status.type == "https://tent.io/types/post/delete/v0.1.0") {
@ -78,7 +85,8 @@ function(Core, Paths, HostApp, URI) {
var post_types = [
"https://tent.io/types/post/repost/v0.1.0",
"https://tent.io/types/post/status/v0.1.0",
"https://tent.io/types/post/delete/v0.1.0"
"https://tent.io/types/post/delete/v0.1.0",
"https://tent.io/types/post/photo/v0.1.0"
];
url.addSearch("post_types", post_types.join(","));