bs4 fixes

This commit is contained in:
Mario Vavti
2017-03-19 10:51:58 +01:00
parent b2ad4e8c2a
commit 2a25ddff36
7 changed files with 93 additions and 144 deletions

View File

@@ -66,6 +66,10 @@ function contact_format(item) {
return "<div>" + item.text + "</div>";
}
function smiley_format(item) {
return "<div class='dropdown-item'>" + item.icon + ' ' + item.text + "</div>";
}
function editor_replace(item) {
if(typeof item.replace !== 'undefined') {
return '$1$2' + item.replace;
@@ -181,15 +185,16 @@ function string2bb(element) {
index: 3,
search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); },
replace: editor_replace,
template: contact_format,
template: contact_format
};
smilies = {
match: /(^|\s)(:[a-z_:]{2,})$/,
index: 2,
search: function(term, callback) { $.getJSON('/smilies/json').done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
template: function(item) { return item.icon + item.text; },
//template: function(item) { return item.icon + item.text; },
replace: function(item) { return "$1" + item.text + ' '; },
template: smiley_format
};
this.attr('autocomplete','off');
this.textcomplete([contacts,smilies], {className:'acpopup', zIndex:1020});