This commit is contained in:
Jeena Paradies 2012-11-22 11:08:01 +01:00
parent accc5e5286
commit 201b0a46ba
3 changed files with 27 additions and 2 deletions

View file

@ -59,6 +59,9 @@ function(Core, Paths, HostApp, URI) {
if (li) { if (li) {
this.body.removeChild(li); this.body.removeChild(li);
} }
} else if (status.type == "https://tent.io/types/post/repost/v0.1.0") {
//debug(status)
} }
} }
@ -71,7 +74,14 @@ 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,https://tent.io/types/post/delete/v0.1.0");
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"
];
url.addSearch("post_types", post_types.join(","));
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);

View file

@ -211,7 +211,7 @@ function(jQuery, Paths, URI, HostApp, Followings) {
template.in_reply.parentNode.className = "hidden"; template.in_reply.parentNode.className = "hidden";
var text = status.content.text.replace(/\n/g, "<br>"); var text = status.content.text.escapeHTML().replace(/\n/g, "<br>");
var entities = [status.entity]; var entities = [status.entity];
status.mentions.map(function (mention) { status.mentions.map(function (mention) {
entities.push(mention.entity) entities.push(mention.entity)

View file

@ -55,6 +55,21 @@ String.prototype.endsWith = function(suffix) {
return this.match(suffix+"$") == suffix; return this.match(suffix+"$") == suffix;
}; };
var entityMap = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
String.prototype.escapeHTML = function() {
return String(this).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
}
var console = { var console = {
log: function(s) { log: function(s) {
if (OS_TYPE == "mac") { if (OS_TYPE == "mac") {