|
1 | 1 | var pjson = require('./package.json'), |
2 | | - debug = require('debug')('openframe:website'), |
3 | | - extension = module.exports = {}; |
| 2 | + Extension = require('openframe-extension'); |
4 | 3 |
|
5 | 4 | /** |
6 | | - * Extension initialization method. |
| 5 | + * Extensions should expose an instance of the Extension class. |
7 | 6 | * |
8 | | - * Called when the extension (and its dependencies) have been installed. |
9 | | - * |
10 | | - * @param {object} OF An interface provided to extensions giving limitted access to the frame environment |
| 7 | + * For info on building extensions, see [Openframe-Extension](https://github.com/OpenframeProject/Openframe-Extension). |
11 | 8 | */ |
12 | | -extension.init = function(OF) { |
13 | | - // do your extension thing |
14 | | - debug('=======> Openframe-Website initialized! <======='); |
15 | | - |
16 | | - /** |
17 | | - * Extensions can add new artwork formats to the frame. |
18 | | - * |
19 | | - * Each format must have a unique name, which should correspond to the |
20 | | - * name of the npm package. |
21 | | - */ |
22 | | - OF.addFormat( |
23 | | - { |
24 | | - // the name should be the same as the package name |
25 | | - 'name': pjson.name, |
26 | | - // this is what might get displayed to users (not currently used) |
27 | | - 'display_name': 'Website', |
28 | | - 'download': false, |
29 | | - 'start_command': 'xinit /usr/bin/chromium --kiosk $url', |
30 | | - 'end_command': 'sudo pkill -f chromium' |
31 | | - } |
32 | | - ); |
33 | | -}; |
34 | | - |
| 9 | +module.exports = new Extension({ |
| 10 | + format: { |
| 11 | + // the name should be the same as the package name |
| 12 | + 'name': pjson.name, |
| 13 | + // this is what might get displayed to users (not currently used) |
| 14 | + 'display_name': 'Website', |
| 15 | + 'download': false, |
| 16 | + 'start_command': 'xinit /usr/bin/chromium --kiosk $url', |
| 17 | + 'end_command': 'sudo pkill -f chromium' |
| 18 | + } |
| 19 | +}); |
0 commit comments