maximumSelectionSize: {$mybb->usergroup['maxpmrecipients']}, 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, ", ") };
| 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, ", ") };
|