Vergleich private_send_autocomplete - 1.8.2 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/select2/select2.css">
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/select2/select2.min.js"></script>

<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/select2/select2.css?ver=1807">
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/select2/select2.min.js?ver=1806"></script>

<script type="text/javascript">
<!--
if(use_xmlhttprequest == "1")

<script type="text/javascript">
<!--
if(use_xmlhttprequest == "1")

Zeile 7Zeile 7
	MyBB.select2();
$("#to").select2({
placeholder: "{$lang->search_user}",

	MyBB.select2();
$("#to").select2({
placeholder: "{$lang->search_user}",

		minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: true,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "xmlhttp.php?action=get_users",
dataType: 'json',
data: function (term, page) {
return {
query: term, // search term
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
var newqueries = [];
exp_queries = query.split(",");
$.each(exp_queries, function(index, value ){
if(value.replace(/\s/g, '') != "")
{
var newquery = {
id: value.replace(/,\s?/g, ", "),
text: value.replace(/,\s?/g, ", ")






		minimumInputLength: 2,
maximumSelectionSize: function() {
if ({$mybb->usergroup['maxpmrecipients']} == 0) {
return 0;
}
return Math.max(1, {$mybb->usergroup['maxpmrecipients']} - $("#bcc").select2('data').length);
},
multiple: true,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "xmlhttp.php?action=get_users",
dataType: 'json',
data: function (term, page) {
return {
query: term, // search term
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};
}
},
initSelection: function(element, callback) {
var query = $(element).val().replace(', ', ',');
if (query !== "") {
var newqueries = [];
exp_queries = query.split(",");
$.each(exp_queries, function(index, value ){
if(value.replace(/\s/g, '') != "")
{
var newquery = {
id: value.replace(/,\s?/g, ", "),
text: value.replace(/,\s?/g, ", ")

						};
newqueries.push(newquery);
}
});
callback(newqueries);
}

						};
newqueries.push(newquery);
}
});
callback(newqueries);
}

 
		}
})
.on("change", function(e) {
if ({$mybb->usergroup['maxpmrecipients']} == 0)
{
return;
}
if (e.val.length >= {$mybb->usergroup['maxpmrecipients']})
{
$("#bcc").select2("enable", false);
}
else
{
$("#bcc").select2("enable", true);

		}
});


		}
});


  $("#bcc").select2({

	$("#bcc").select2({

		placeholder: "{$lang->search_user}",

		placeholder: "{$lang->search_user}",

		minimumInputLength: 3,
maximumSelectionSize: 3,







		minimumInputLength: 2,
maximumSelectionSize: function() {
if ({$mybb->usergroup['maxpmrecipients']} == 0)
{
return 0;
}
return Math.max(1, {$mybb->usergroup['maxpmrecipients']} - $("#to").select2('data').length);
},

		multiple: true,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "xmlhttp.php?action=get_users",

		multiple: true,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "xmlhttp.php?action=get_users",

Zeile 78Zeile 103
				});
callback(newqueries);
}

				});
callback(newqueries);
}

 
		}
})
.on("change", function(e) {
if ({$mybb->usergroup['maxpmrecipients']} == 0)
{
return;
}
if (e.val.length >= {$mybb->usergroup['maxpmrecipients']})
{
$("#to").select2("enable", false);
}
else
{
$("#to").select2("enable", true);

		}
});
}

		}
});
}