]> git.mxchange.org Git - friendica.git/blobdiff - js/autocomplete.js
Don't cache account probing for empty networks
[friendica.git] / js / autocomplete.js
index 053cc9e3aa56b34b29f7b45e7febbaec1407ddf9..8e64648e98686f2433093846898a27120601a980 100644 (file)
@@ -84,7 +84,12 @@ function editor_replace(item) {
 
        // $2 ensures that prefix (@,@!) is preserved
        var id = item.id;
-        // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
+
+       // don't add the id if it is empty (the id empty eg. if there are unknow contacts in thread)
+       if(id.length < 1)
+               return '$1$2' + item.nick.replace(' ', '') + ' ';
+
+       // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
        // 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id).
        if(id.length > 16) 
                id = item.id.substring(0,16);
@@ -194,7 +199,7 @@ function string2bb(element) {
                };
 
                this.attr('autocomplete','off');
-               this.textcomplete([contacts,smilies], {className:'acpopup', zIndex:1020});
+               this.textcomplete([contacts,smilies], {className:'acpopup', zIndex:10000});
        };
 })( jQuery );
 
@@ -221,7 +226,7 @@ function string2bb(element) {
                        template: contact_format,
                };
                this.attr('autocomplete', 'off');
-               var a = this.textcomplete([contacts, community], {className:'acpopup', maxCount:100, zIndex: 1020, appendTo:'#nav-search-box'});
+               var a = this.textcomplete([contacts, community], {className:'acpopup', maxCount:100, zIndex: 10000, appendTo:'nav'});
                a.on('textComplete:select', function(e, value, strategy) { submit_form(this); });
        };
 })( jQuery );
@@ -241,7 +246,7 @@ function string2bb(element) {
                };
 
                this.attr('autocomplete','off');
-               var a = this.textcomplete([contacts], {className:'acpopup', zIndex:1020});
+               var a = this.textcomplete([contacts], {className:'acpopup', zIndex:10000});
 
                if(autosubmit)
                        a.on('textComplete:select', function(e,value,strategy) { submit_form(this); });
@@ -267,7 +272,7 @@ function string2bb(element) {
                };
 
                this.attr('autocomplete','off');
-               var a = this.textcomplete([names], {className:'acpopup', zIndex:1020});
+               var a = this.textcomplete([names], {className:'acpopup', zIndex:10000});
 
                if(autosubmit)
                        a.on('textComplete:select', function(e,value,strategy) { submit_form(this); });
@@ -281,7 +286,7 @@ function string2bb(element) {
        $.fn.bbco_autocomplete = function(type) {
 
                if(type=='bbcode') {
-                       var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'quote', 'code', 'spoiler', 'map', 'nobb', 'list', 'ul', 'ol', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size'];
+                       var open_close_elements = ['bold', 'italic', 'underline', 'overline', 'strike', 'quote', 'code', 'spoiler', 'map', 'img', 'url', 'audio', 'video', 'youtube', 'vimeo', 'list', 'ul', 'ol', 'li', 'table', 'tr', 'th', 'td', 'center', 'color', 'font', 'size', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'nobb', 'noparse', 'pre', 'abstract'];
                        var open_elements = ['*', 'hr'];
 
                        var elements = open_close_elements.concat(open_elements);
@@ -315,7 +320,7 @@ function string2bb(element) {
                };
 
                this.attr('autocomplete','off');
-               var a = this.textcomplete([bbco], {className:'acpopup', zIndex:1020});
+               var a = this.textcomplete([bbco], {className:'acpopup', zIndex:10000});
 
                a.on('textComplete:select', function(e, value, strategy) { value; });