fixed location and a names bug

This commit is contained in:
jeena 2013-10-03 21:21:32 +02:00
parent da2d8cfcd5
commit 47fb023fdd
4 changed files with 11 additions and 7 deletions

View file

@ -174,7 +174,7 @@ class Controller(QtCore.QObject):
pass pass
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def openNewMessageWidow(self): def openNewMessageWidow(self, text=""):
self.openNewMessageWindowInReplyToStatus("") # FIXME: create a status_string with this content self.openNewMessageWindowInReplyToStatus("") # FIXME: create a status_string with this content
@QtCore.pyqtSlot(str) @QtCore.pyqtSlot(str)

View file

@ -189,7 +189,7 @@ function(APICalls, HostApp) {
} }
NewPost.prototype.replaceAll = function(txt, replace, with_this) { NewPost.prototype.replaceAll = function(txt, replace, with_this) {
return txt.replace(new RegExp(replace, 'g'),with_this); return txt.replace(new RegExp(replace, 'g'), with_this);
} }
NewPost.prototype.replaceWithName = function(txt, with_item) { NewPost.prototype.replaceWithName = function(txt, with_item) {
@ -228,7 +228,7 @@ function(APICalls, HostApp) {
// parse the text: // parse the text:
// replace all the line braks by <br/>, and all the double spaces by the html version &nbsp; // replace all the line braks by <br/>, and all the double spaces by the html version &nbsp;
text = this.replaceAll(text,'\n','<br/>'); text = this.replaceAll(text,'\n','<br/>');
text = this.replaceAll(text,' ','&nbsp;&nbsp;'); //text = this.replaceAll(text,' ','&nbsp;&nbsp;');
// replace the words by a highlighted version of the words // replace the words by a highlighted version of the words

View file

@ -318,12 +318,12 @@ function(jQuery, APICalls, URI, HostApp, Markdown) {
return false; return false;
}); });
// {"type":"Point","coordinates":[57.10803113,12.25854746]} if (status.content && status.content.location) {
if (status.content && status.content.location && (typeof status.content.location.type == "undefined" || status.content.location.type == "Point")) { var lat = status.content.location.latitude;
var lat = status.content.location.coordinates[0]; var lng = status.content.location.longitude;
var lng = status.content.location.coordinates[1];
if (typeof lat != "undefined" && typeof lng != "undefined" && lat > 0 && lng > 0) { if (typeof lat != "undefined" && typeof lng != "undefined" && lat > 0 && lng > 0) {
var href = this.mapHref(lat, lng); var href = this.mapHref(lat, lng);
template.geo.href = href; template.geo.href = href;
template.geo.style.display = ""; template.geo.style.display = "";

View file

@ -199,4 +199,8 @@ String.prototype.escapeSpecialChars = function() {
.replace(/[\n]/g, '\\n') .replace(/[\n]/g, '\\n')
.replace(/[\r]/g, '\\r') .replace(/[\r]/g, '\\r')
.replace(/[\t]/g, '\\t'); .replace(/[\t]/g, '\\t');
}
String.prototype.escapeRegExp = function() {
return this.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
} }