Question


I have Jquery textcomplete plugin (made by YUKU) and when I use this method the plugin is brake.
This is hard explane,but i try it...
So this function suggest user(s)(when you type '@') on replyed post,like twitter.:

 var mentions = [''];
$('#comment').textcomplete({
html: {
    match: /\B@(\w*)$/,
    search: function (term, callback) {
        callback($.map(mentions, function (mention) {
            return mention.indexOf(term) === 0 ? mention : null;
        }));
    },
    index: 1,
    replace: function (mention) {
        return '@' + mention + ' ';
    }
}
}).overlay([
{
    match: /\B@\w+/g,
    css: {
        'background-color': '#d8dfea'
    }
}
]);

And when I not commented out this section,the word suggest not working.
The crhome console sayed me:
Uncaught TypeError: Object [object Object] has no method 'overlay'.
But this not possible,becouse I added jquery tools on header top,(yes i readed this),so my header top looks like this:

 <script type="text/javascript" src="/wp-content/plugins/lightview/jquery.js"></script>
 <script src="http://neocsatblog.mblx.hu/autoc/jquery.a-tools-1.4.1.js"></script>
 <script src="http://www.neocsatblog.mblx.hu/jquery-ui.js"></script>

And my word suggest function looks like this:

$(document).ready(function () {
 var elements = ['span', 'div', 'h1', 'h2', 'h3','a','blockqoute','font','p','strong',];
 var words = ['abszolút','azért','mert', 'szerintem', 'ez','hogy','pár','dolog','kár','szívás','szívesség','az','első','egyetértek','csak','de','kár','ha','Ha','akkor','viszont','így','érv','lényegtelen','ott','értem','alatt','általános','attól','zene','bonyolít','borít','bujdokol','csusza','javítás','érvényes','troll',];

techCompanies: {
    match: /(^|\s|\n)([a-zöüóűőúéáí-]{2,})$/i,
    search: function (term, callback) {
        callback($.map(words, function (word) {
            return word.indexOf(term) === 0 ? word : null;
        }));
    },
    replace: function (word) {
        return '$1' + word + ' ';
    }
}
 });
  });

Summary For the sake of clarity:
The erorr is,when you start typing a words, the plugin adds only the first word, not willing to work after,nothing suggest (when "@" method is enebled).
So the question is, why have conflict with the two functions?

Était-ce utile?

La solution

Overlay is another plugin by the same user Yuku. Either download it at website

else remove it !

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top