small bugfixes

This commit is contained in:
Hannes Mannerheim 2015-06-18 00:09:04 +02:00
parent 4153f65587
commit 354f886304
2 changed files with 5 additions and 3 deletions

View File

@ -1096,13 +1096,15 @@ function expand_queet(q,doScrolling) {
// get full html for queet, first try localstorage cache
localStorageObjectCache_GET('fullQueetHtml',qid,function(data){
if(data) {
q.children('.queet').find('.queet-text').html($.trim(data.replace(/@<a/gi,'<a').replace(/!<a/gi,'<a').replace(/@<span class="vcard">/gi,'<span class="vcard">').replace(/!<span class="vcard">/gi,'<span class="vcard">').replace(/#<span class="tag">/gi,'<span class="tag">').replace(/&#64;<span class="vcard">/gi,'<span class="vcard">').replace(/@<span class="vcard">/gi,'<span class="vcard">').replace(/!<span class="vcard">/gi,'<span class="vcard">').replace(/#<span class="tag">/gi,'<span class="tag">')));
q.children('.queet').find('.queet-text').html(data);
q.children('.queet').outerHTML(detectRTL(q.children('.queet').outerHTML()));
}
else {
getFromAPI("attachment/" + attachmentId + ".json",function(data){
if(data) {
localStorageObjectCache_STORE('fullQueetHtml',qid,data);
q.children('.queet').find('.queet-text').html($.trim(data.replace(/@<a/gi,'<a').replace(/!<a/gi,'<a').replace(/@<span class="vcard">/gi,'<span class="vcard">').replace(/!<span class="vcard">/gi,'<span class="vcard">').replace(/#<span class="tag">/gi,'<span class="tag">').replace(/&#64;<span class="vcard">/gi,'<span class="vcard">').replace(/@<span class="vcard">/gi,'<span class="vcard">').replace(/!<span class="vcard">/gi,'<span class="vcard">').replace(/#<span class="tag">/gi,'<span class="tag">')));
q.children('.queet').find('.queet-text').html($.trim(data));
q.children('.queet').outerHTML(detectRTL(q.children('.queet').outerHTML()));
}
});
}

View File

@ -2410,7 +2410,7 @@ $('body').on('keyup', 'div.queet-box-syntax', function(e) {
// show matches
$.each(suggestionsToShow,function(){
var serverHtml = '';
if(suggestionsUsernameCount[this.username]>1) {
if(suggestionsUsernameCount[this.username]>1 && this.url !== false) {
serverHtml = '@' + this.url;
}
queetBox.siblings('.mentions-suggestions').append('<div title="@' + this.username + serverHtml + '"><img height="24" width="24" src="' + this.avatar + '" /><strong>' + this.name + '</strong> @<span>' + this.username + serverHtml + '</span></div>')