Trello (sample widget)

This widget displays graphics from the Trello Service

The widget’s Script code

Script CodeExpand source

type("""#user""" , """{{email|default:'a@b.c'}}""")
type("""#password""" , """{{password|default:'password'}}""")
clickAndWait("""#login""")
openAndWait("""{{url|default:'https://trello.com/'}}""")
repeat(0){
  pause({{refresh|default:180}})
  refreshAndWait()
  waitForPageLoad()
  runScript("""
    j('.board-header, #header').hide();
  """)
}

The widget’s JSON Schema

We need the declare a schema for the required configuration fields:

  1. email: the email of the user
  2. password: the password of the user
  3. refresh: the refresh rate of the graph
  4. url: the url board that you want to display
  5. graph: the type of graph that you want to display

JSON SchemaExpand source

{
  "fields": [
    "email",
    "password",
    "refresh",
    "url"
  ],
  "schema": {
    "url": {
      "title": "Enter URL",
      "type": "Text",
      "help": "Paste the URL of the desired board from your Trello account",
      "validators": [
        "required"
      ]
    },
    "password": {
      "title": "Password",
      "type": "Password",
      "validators": [
        "required"
      ]
    },
    "email": {
      "title": "Email Address",
      "type": "Text",
      "validators": [
        "required",
        "email"
      ]
    },
    "refresh": {
      "title": "Refresh Interval (sec)",
      "type": "Number",
      "validators": [
        "required"
      ]
    }
  }
}