Authored by 杨延青

星潮username

... ... @@ -116,7 +116,6 @@ function limitUsername() {
nameVal = $name.html(),
nameSize = nameVal.length,
bytesCount = 0,
bcount = 0,
newName = '';
var i, code;
... ... @@ -131,16 +130,9 @@ function limitUsername() {
}
if (bytesCount > 8) {
newName += '..';
}
for (i = 0; i < nameSize; i++) {
code = nameVal.charAt(i);
bcount = bytesCountAction(code, bcount);
if (bcount > bytesCount - 2) {
newName += code;
}
newName += '..' + nameVal.charAt(nameSize - 1);
} else {
newName = nameVal;
}
$name.html(newName);
... ...