MyBB Community Forums

Full Version: Automention: Autocomplete Mention
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
OK, tested again - it works only sometimes but I dont know how to reproduce.
(2016-07-30, 12:45 AM)NightFox Wrote: [ -> ]
(2015-10-29, 12:00 AM)EloquenceShenigans Wrote: [ -> ]Is there any way to remove the quotes?

eg. @"test" -> @test

I have had a look through the js however I can not see how to remove it.
This:

insertTpl: '${atwho-at}${text}',

	callbacks: {

...
		},
		beforeInsert: function(value, $li)  {
			if (value.indexOf(" ") !== -1) {
				return value.replace("@", '@"') + '":';
			} else {
				return value + ':';
			}
		}


For DVZ Shoutbox:
$(document).ready(function() {
...
	var shoutbox = '.panel > form > input[class="text"]';
	if ($(shoutbox).length) {
		$(shoutbox).atwho(ment_settings);
	}
});

can someone explain this detailed ?

im really need that

heres inside of automention.js

var ment_settings = {
	at: "@",
	searchKey: "text",
	displayTpl: "<li>${text}</li>",
	insertTpl: '${atwho-at}"${text}"',
	startWithSpace: true,
	maxLen: maxnamelength,
	callbacks: {
		matcher: function(flag, subtext) {
			var match, matched, regexp;
			regexp = new XRegExp('(\\s+|^)' + flag + '([\\p{L}|\\p{N}]+)$', 'gi');
			match = regexp.exec(subtext);
			if (match) {
				matched = match[2];
			}
			return matched;
		},
		remoteFilter: function(query, callback) {
			if (query.length > 2) {
				$.getJSON('xmlhttp.php?action=get_users', {query: query}, function(data) {
					callback(data);
				});
			}
			else {
				callback([]);
			}
		}
	}
}
function automentionck( local ) {
	$(local).atwho('setIframe').atwho(ment_settings);
	$(local).atwho(ment_settings);
} 
$(document).ready(function() {
	if (typeof $.fn.sceditor !== 'undefined') {
		if($('#message, #signature').sceditor("instance")) {
			$($('#message, #signature').sceditor("instance").getBody()).atwho('setIframe').atwho(ment_settings);
			$($('#message ~ div.sceditor-container textarea, #signature ~ div.sceditor-container textarea')[0]).atwho(ment_settings);
		}
		else {
			$('#message, #signature').atwho(ment_settings);
		}
		($.fn.on || $.fn.live).call($(document), 'click', '.quick_edit_button', function () {
			ed_id = $(this).attr('id');
			var pid = ed_id.replace( /[^0-9]/g, '');
			qse_area = 'quickedit_'+pid;
			setTimeout(function() {
				if ($('#'+qse_area+'').sceditor("instance")) {
					$($('#'+qse_area+'').sceditor("instance").getBody()).atwho('setIframe').atwho(ment_settings);
					$($('#'+qse_area+' ~ div.sceditor-container textarea')[0]).atwho(ment_settings);
				}
				else {
					$('#'+qse_area+'').atwho(ment_settings);
				}
			},600);
		});
	}
	else {
		$('#message, #signature').atwho(ment_settings);
		($.fn.on || $.fn.live).call($(document), 'click', '.quick_edit_button', function () {
			ed_id = $(this).attr('id');
			var pid = ed_id.replace( /[^0-9]/g, '');
			qse_area = 'quickedit_'+pid;
			$('#'+qse_area+'').atwho(ment_settings);
		});
	}
});
V 1.3.1 Released:

-Added DVZ_Shoutbox support
(2016-09-13, 10:18 PM)martec Wrote: [ -> ]V 1.3.1 Released:

-Added DVZ_Shoutbox support

my mention plugin doesnt work with @"username" . i was asked help at up.... it should be @username
(2016-09-14, 10:42 AM)Carbonzxc Wrote: [ -> ]
(2016-09-13, 10:18 PM)martec Wrote: [ -> ]V 1.3.1 Released:

-Added DVZ_Shoutbox support

my mention plugin doesnt work with @"username" . i was asked help at up.... it should be @username

sorry, but i can't made anything about this. i recommend you use DVZ_Mentions.

of cource you can replace
code below
insertTpl: '${atwho-at}"${text}"',
to
insertTpl: '${atwho-at}${text}',

but i will not give any support if usage without "" will work correctly.
There is a bug (at.js library I think, but it was fixed last month IIRC). Some usernames are not highlighted (fix: https://github.com/ichord/At.js/pull/422 )
V 1.3.2 Released:

-Added commit https://github.com/ichord/At.js/pull/422
Thank you! It would be nice to have a css file in themes to easier customization for every theme
Also, found an issue with Automention.

If a user name contains periods in it (B.O.B.), I can't get the Automention to autocompete the user name.

I tried typing "B.O.", and even rest of it, but nothing.

I am on Automention (1.3.0).

I also have DVZ Mentions (0.6).
I have a very strange problem with autocomplete mention in one of my themes. 
Actually the new theme is a copy from another one - just modified, where the autocomplete is working perfectly fine (see attachment one). 
Somehow in the new theme the autocomplete will not show - no matter what I'm trying to do. I did not change anything (I think) or did anything different, then before (see attachment two). 
I have DVZ Mentions and MyAlerts installed too - does anyone have a clue, what I additionally have to do? 

I'm thankful for every input, 'cause I'm nearly desperate by now XD.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19