|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
727 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | function pluginsFrom(plugins) {
|
|---|
| 2 | var flatPlugins = {
|
|---|
| 3 | level1Value: [],
|
|---|
| 4 | level1Property: [],
|
|---|
| 5 | level2Block: []
|
|---|
| 6 | };
|
|---|
| 7 |
|
|---|
| 8 | plugins = plugins || [];
|
|---|
| 9 |
|
|---|
| 10 | flatPlugins.level1Value = plugins
|
|---|
| 11 | .map(function(plugin) { return plugin.level1 && plugin.level1.value; })
|
|---|
| 12 | .filter(function(plugin) { return plugin != null; });
|
|---|
| 13 |
|
|---|
| 14 | flatPlugins.level1Property = plugins
|
|---|
| 15 | .map(function(plugin) { return plugin.level1 && plugin.level1.property; })
|
|---|
| 16 | .filter(function(plugin) { return plugin != null; });
|
|---|
| 17 |
|
|---|
| 18 | flatPlugins.level2Block = plugins
|
|---|
| 19 | .map(function(plugin) { return plugin.level2 && plugin.level2.block; })
|
|---|
| 20 | .filter(function(plugin) { return plugin != null; });
|
|---|
| 21 |
|
|---|
| 22 | return flatPlugins;
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | module.exports = pluginsFrom;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.