summaryrefslogtreecommitdiffstats
path: root/install/ui/jquery.ordered-map.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/jquery.ordered-map.js')
-rwxr-xr-xinstall/ui/jquery.ordered-map.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/install/ui/jquery.ordered-map.js b/install/ui/jquery.ordered-map.js
index f30f8d13..aa0d2814 100755
--- a/install/ui/jquery.ordered-map.js
+++ b/install/ui/jquery.ordered-map.js
@@ -75,5 +75,28 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function() {
return that.values[index];
};
+ that.sort = function() {
+ var keys = that.keys.slice(0);
+ keys.sort();
+ return that.trim(keys);
+ };
+
+ that.slice = function(start, end) {
+ var keys = that.keys.slice(start, end);
+ return that.trim(keys);
+ };
+
+ that.trim = function(keys) {
+ var new_map = $.ordered_map();
+
+ for (var i=0; i<keys.length; i++) {
+ var key = keys[i];
+ var value = that.get(key);
+ new_map.put(key, value);
+ }
+
+ return new_map;
+ };
+
return that;
};