X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=hacks%2FHack.js;h=2133299523ff3cdc4757aeef2442b2b8fbadbd57;hb=98d8bc4d5f0bc0b315b54369a8f288d93e9b2c44;hp=28cfad7821a9f05f088b41059134d3d9cfb2e5eb;hpb=0fe39807102fa21ad98accc5cdd46c0324745be8;p=Hacks.git diff --git a/hacks/Hack.js b/hacks/Hack.js index 28cfad7..2133299 100644 --- a/hacks/Hack.js +++ b/hacks/Hack.js @@ -3,6 +3,7 @@ enyo.kind({ name: "Hack", kind: "VFlexBox", + preferences: [], stop: function() { }, start: function() { @@ -10,5 +11,26 @@ enyo.kind({ resize: function() { }, hidden: function() { + }, + getPreferencesMetadata: function() { + return this.preferences; + }, + getPreferences: function() { + var o = {}; + for (var i = 0; i < this.preferences.length; i++) { + var p = this.preferences[i]; + o[p.name] = this[p.name]; + } + return o; + }, + setPreferences: function(prefs) { + for (var i in prefs) { + if (this[i] == undefined) + throw new Error('Cannot set nonexistent preference "' + i + '"'); + this[i] = prefs[i]; + } + this.preferencesChanged(); + }, + preferencesChanged: function() { } });