Skip to content

Commit b318a70

Browse files
committed
Plugin -> Extension
1 parent 65d549d commit b318a70

6 files changed

Lines changed: 44 additions & 54 deletions

File tree

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
> NOTE: this repo is under development. The contents is likely to change significantly.
1+
# Openframe Website Extension
22

3-
# Openframe Website Plugin
3+
An Openframe format extension which enables display of websites via chromium.
44

5-
An Openframe format plugin which enables display of websites via chromium.
6-
7-
For info on developing your own plugins, see the [Openframe-PluginExample](https://github.com/OpenframeProject/Openframe-PluginExample) repo.
5+
For info on developing your own extensions, see the [Openframe-ExtensionExample](https://github.com/OpenframeProject/Openframe-ExtensionExample) repo.

extension.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var pjson = require('./package.json'),
2+
debug = require('debug')('openframe:website'),
3+
extension = module.exports = {};
4+
5+
/**
6+
* Extension initialization method.
7+
*
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
11+
*/
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+

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Be VERY Careful. This script may be executed with admin privileges.
44

5-
echo "Openframe Website Plugin -- install.sh"
5+
echo "Openframe Website Extension -- install.sh"
66

77
# Some limited platform detection might be in order... though at present we're targeting the Pi
88
os=$(uname)

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "openframe-website",
33
"version": "0.1.0",
4-
"description": "Openframe plugin which adds support for website-based artwork via chromium.",
5-
"main": "plugin.js",
4+
"description": "Openframe extension which adds support for website-based artwork via chromium.",
5+
"main": "extension.js",
66
"scripts": {
77
"install": "./install.sh",
88
"uninstall": "./uninstall.sh",
@@ -37,5 +37,8 @@
3737
"repository": {
3838
"type": "git",
3939
"url": "https://github.com/OpenframeProject/Openframe-Website"
40+
},
41+
"dependencies": {
42+
"debug": "^2.2.0"
4043
}
4144
}

plugin.js

Lines changed: 0 additions & 45 deletions
This file was deleted.

uninstall.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Be VERY Careful. This script may be executed with admin privileges.
44

5-
echo "Openframe Website Plugin -- uninstall.sh"
5+
echo "Openframe Website -- uninstall.sh"
66

77
# Some limited platform detection might be in order... though at present we're targeting the Pi
88
os=$(uname)

0 commit comments

Comments
 (0)