added add/show geolocation and changed name from TweetModel to PostModel

This commit is contained in:
Jeena Paradies 2012-11-22 19:21:38 +01:00
parent d39b643844
commit 76b63d5c68
12 changed files with 398 additions and 50 deletions

View file

@ -237,7 +237,7 @@ function(jQuery, Paths, URI, HostApp, Followings) {
}
// {"type":"Point","coordinates":[57.10803113,12.25854746]}
if (status.content && status.content.location && status.content.location.type == "Point") {
if (status.content && status.content.location && (typeof status.content.location.type == "undefined" || status.content.location.type == "Point")) {
template.geo.href = "http://maps.google.com/maps?q=" + status.content.location.coordinates[0] + "," + status.content.location.coordinates[1];
template.geo.style.display = "";
}
@ -249,7 +249,7 @@ function(jQuery, Paths, URI, HostApp, Followings) {
return template.item;
}
Core.prototype.sendNewMessage = function(content, in_reply_to_status_id, in_reply_to_entity, callback) {
Core.prototype.sendNewMessage = function(content, in_reply_to_status_id, in_reply_to_entity, location, callback) {
var url = URI(Paths.mkApiRootPath("/posts"));
@ -266,6 +266,10 @@ function(jQuery, Paths, URI, HostApp, Followings) {
},
};
if (location) {
data["content"]["location"] = { "type": "Point", "coordinates": location }
}
var mentions = this.parseMentions(content, in_reply_to_status_id, in_reply_to_entity);
if (mentions.length > 0) {