ShiftForward/mucuchies — pull request #14 by ruippeixotog (2014-07-01 17:27:16+00:00)
Title: Create an adapter source

The `AdapterSource` is a pseudo-source that transforms and provides the data coming from another source. It allows users to use widgets requiring a certain data type with sources that provide data in another.

An usage example:

```javascript
sources: {
(...)
rssSource: {
className: 'Dashboard.RssSource',
args: {
feedUrl: "http://rss.slashdot.org/Slashdot/slashdot"
}
}
},

(...)

widgets: [
(...)
{
pos: [2, 2],
widget: 'Dashboard.RssWidget',
source: 'rssSource',
args: { rotatePeriod: 15000 }
},
{
pos: [2, 3],
widget: 'Dashboard.TextWidget',
source: 'Dashboard.AdapterSource',
sourceArgs: {
source: { className: 'rssSource' },
transform: function(data) { return data.entries[0].title; }
}
}
]
```