Browse files

Load preferences from JSON

  • Loading branch information...
1 parent c514dba commit 4f6eb44d229757e9a53eaecc6ecb22fa9ab38d2c @sergeche sergeche committed Jun 16, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 javascript/preferences.js
View
11 javascript/preferences.js
@@ -110,6 +110,17 @@ zen_coding.define('preferences', function(require, _) {
},
/**
+ * Loads user-defined preferences from JSON
+ * @param {Object} json
+ * @returns
+ */
+ load: function(json) {
+ _.each(json, function(value, key) {
+ this.set(key, value);
+ }, this);
+ },
+
+ /**
* For unit testing: use empty storage
*/
_startTest: function() {

0 comments on commit 4f6eb44

Please sign in to comment.