Magic Box v1.0 + bugfix sorting connected names in chat
This commit is contained in:
13
jquery/common.js
vendored
13
jquery/common.js
vendored
@@ -188,6 +188,19 @@ String.prototype.replaceAll = function(regex, text)
|
||||
return this.replace(new RegExp(regex, 'g'), text);
|
||||
};
|
||||
|
||||
function sort(oList, sField)
|
||||
{
|
||||
sField = sField || '';
|
||||
var asArray = [];
|
||||
for(var i in oList) asArray.push({id:i, value:oList[i]});
|
||||
return asArray.sort(function(asItem1, asItem2)
|
||||
{
|
||||
var sValue1 = sField==''?asItem1.value:asItem1.value[sField];
|
||||
var sValue2 = sField==''?asItem2.value:asItem2.value[sField];
|
||||
return sValue1>sValue2?1:-1;
|
||||
});
|
||||
};
|
||||
|
||||
function copyArray(asArray)
|
||||
{
|
||||
return asArray.slice(0); //trick to copy array
|
||||
|
||||
Reference in New Issue
Block a user