Skip to content

Instantly share code, notes, and snippets.

@timlevett
Last active September 2, 2015 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timlevett/86cbde0dd60a327964cf to your computer and use it in GitHub Desktop.
Save timlevett/86cbde0dd60a327964cf to your computer and use it in GitHub Desktop.
Brain dump of the settings for widgets page
  • Settings come from widgets config
{
  "settings" : [
    { 
      "id" : 1,
      "Name" : "Degree Type",
      "options" : ["C","F","K"] ,
      "description" : "What degree type you would want displayed in your weather widget",
      "default" : "F"
    }
  ]
}
  • /web/settings/expanded walks through layout and creates a list of things. Simple set of possible settings to start. true/false, array = options, etc...
  • Settings are then saved in one layoutSettings keyvalue
{
  "key" : "layout:settings",
  "value" : [{
    "fname" : "weather",
    "settings" : [{"id" : 1, "v" : "F"}]
  }]
}
@apetro
Copy link

apetro commented Sep 2, 2015

This is brilliant.

@timlevett
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment