1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 11:27:58 +01:00

Make wop=sort actually do something

This commit is contained in:
Kris Maglione
2008-10-07 04:10:16 +00:00
parent 2c44c1047c
commit e33c32fcd6
2 changed files with 43 additions and 16 deletions

View File

@@ -79,6 +79,11 @@ liberator.util = { //{{{
yield ary[i];
},
ciCompare: function (a, b)
{
return String.localeCompare(a.toLowerCase(), b.toLowerCase());
},
clip: function (str, length)
{
return str.length <= length ? str : str.substr(0, length - 3) + "...";
@@ -161,9 +166,10 @@ liberator.util = { //{{{
return str.replace(/([\\{}()[\].?*+])/g, "\\$1");
},
escapeString: function (str)
escapeString: function (str, delimiter)
{
return '"' + str.replace(/([\\'])/g, "\\$1") + '"';
delimiter = delimiter || '"';
return delimiter + str.replace(/([\\'"])/g, "\\$1") + delimiter;
},
// Flatten an array: