fixed #70
This commit is contained in:
parent
accc5e5286
commit
201b0a46ba
3 changed files with 27 additions and 2 deletions
|
@ -59,6 +59,9 @@ function(Core, Paths, HostApp, URI) {
|
|||
if (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 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);
|
||||
if(this.since_id) {
|
||||
url.addSearch("since_id", this.since_id);
|
||||
|
|
|
@ -211,7 +211,7 @@ function(jQuery, Paths, URI, HostApp, Followings) {
|
|||
|
||||
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];
|
||||
status.mentions.map(function (mention) {
|
||||
entities.push(mention.entity)
|
||||
|
|
|
@ -55,6 +55,21 @@ String.prototype.endsWith = function(suffix) {
|
|||
return this.match(suffix+"$") == suffix;
|
||||
};
|
||||
|
||||
var entityMap = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
"/": '/'
|
||||
};
|
||||
|
||||
String.prototype.escapeHTML = function() {
|
||||
return String(this).replace(/[&<>"'\/]/g, function (s) {
|
||||
return entityMap[s];
|
||||
});
|
||||
}
|
||||
|
||||
var console = {
|
||||
log: function(s) {
|
||||
if (OS_TYPE == "mac") {
|
||||
|
|
Reference in a new issue