--- a/js/flotr2/examples/js/ExampleList.js +++ b/js/flotr2/examples/js/ExampleList.js @@ -1,1 +1,30 @@ +(function () { +var ExampleList = function () { + + // Map of examples. + this.examples = {}; + +}; + +ExampleList.prototype = { + + add : function (example) { + this.examples[example.key] = example; + }, + + get : function (key) { + return key ? (this.examples[key] || null) : this.examples; + }, + + getType : function (type) { + return Flotr._.select(this.examples, function (example) { + return (example.type === type); + }); + } +} + +Flotr.ExampleList = new ExampleList(); + +})(); +