Closed getdave closed 10 years ago
Add a standard Dictionary object to the framework.
(function() { var Dictionary = function(startValues) { this.values = startValues || {}; }; Dictionary.prototype.store = function(name, value) { this.values[name] = value; }; Dictionary.prototype.lookup = function(name) { return this.values[name]; }; Dictionary.prototype.contains = function(name) { return Object.prototype.hasOwnProperty.call(this.values, name) && Object.prototype.propertyIsEnumerable.call(this.values, name); }; // Register widget SITE.utils.Dictionary = Dictionary; }());
Please note that due to the order in which the JS is compiled by Grunt all utils needs to be defined in the globals.js file.
globals.js
Fixed in feature branch. Will close via commit.
Add a standard Dictionary object to the framework.