Skip to content

Commit

Permalink
Fixes mybb#1249 - memberlist.php "undefined"
Browse files Browse the repository at this point in the history
Fixes mybb#1249
  • Loading branch information
ATofighi committed Aug 17, 2014
1 parent 3ad19a3 commit c8a2df3
Showing 1 changed file with 82 additions and 90 deletions.
172 changes: 82 additions & 90 deletions install/resources/mybb_theme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4359,14 +4359,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
Expand Down Expand Up @@ -4397,7 +4395,7 @@ if(use_xmlhttprequest == "1")
if(use_xmlhttprequest == "1")
{
$("#inviteusername").select2({
placeholder: "Search for a user",
placeholder: "{$lang->search_user}",
minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,
Expand All @@ -4415,14 +4413,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
Expand Down Expand Up @@ -5319,14 +5315,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users&getone=1", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
Expand Down Expand Up @@ -5590,14 +5584,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
// Allow the user entered text to be selected as well
Expand Down Expand Up @@ -5715,7 +5707,7 @@ if(use_xmlhttprequest == "1")
if(use_xmlhttprequest == "1")
{
$("#username").select2({
placeholder: "Search for a user",
placeholder: "{$lang->search_user}",
minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,
Expand All @@ -5733,14 +5725,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
// Allow the user entered text to be selected as well
Expand Down Expand Up @@ -6609,14 +6599,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users&getone=1", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
Expand Down Expand Up @@ -7109,15 +7097,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query,
getone: 1
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
}
});
Expand Down Expand Up @@ -7831,14 +7816,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
Expand Down Expand Up @@ -10771,14 +10754,12 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
Expand Down Expand Up @@ -11961,17 +11942,21 @@ if(use_xmlhttprequest == "1")
}
},
initSelection: function(element, callback) {
// the input tag has a value attribute preloaded that points to a preselected movie's id
// this function resolves that id attribute to an object that select2 can render
// using its formatResult renderer - that way the movie name is shown preselected
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
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);
}
},
});
Expand Down Expand Up @@ -12030,12 +12015,19 @@ if(use_xmlhttprequest == "1")
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("xmlhttp.php?action=get_users", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
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);
}
},
});
Expand Down

0 comments on commit c8a2df3

Please sign in to comment.