Skip to content

Commit 65d549d

Browse files
committed
first commit
0 parents  commit 65d549d

10 files changed

Lines changed: 263 additions & 0 deletions

File tree

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/**/*.js

.eslintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# see http://eslint.org/docs/rules/ for recommended rules
2+
extends: 'eslint:recommended'
3+
4+
rules:
5+
indent:
6+
- 2
7+
- 4
8+
- SwitchCase: 1
9+
linebreak-style: [2, unix]
10+
no-console: [0]
11+
no-unused-vars: [1]
12+
# commas go last
13+
comma-style: [1, last]
14+
# variable comes before literal in conditional
15+
yoda: [1, never]
16+
# dots on same line as property
17+
dot-location: [1, property]
18+
# don't allow void operator
19+
no-void: [1]
20+
# no space before function paren
21+
space-before-function-paren: [1, never]
22+
# prefer a single declaration for vars
23+
one-var:
24+
- 1
25+
space-before-blocks: [1, always]
26+
# prefer no space between array brackets
27+
array-bracket-spacing: [1, never]
28+
# prefer no space between object curly brackets
29+
object-curly-spacing: [1, never]
30+
# prefer no space between object prop brackets
31+
computed-property-spacing: [1, never]
32+
# prefer camelcase
33+
# camelcase:
34+
# - 1
35+
# - properties: always
36+
# prefer brackets for blocks
37+
curly: [1]
38+
no-multi-spaces: [1]
39+
space-in-parens: [1, never]
40+
eol-last: [1]
41+
no-trailing-spaces: [1]
42+
no-mixed-spaces-and-tabs: [1]
43+
# Allow but do not force dangling commas.
44+
comma-dangle: [0]
45+
# prefer object shorthand for new object creation (i.e. var a = {};)
46+
object-shorthand: [2, always]
47+
# use single quotes
48+
quotes: [2, single]
49+
# use semicolons to end statements
50+
semi: [2, always]
51+
52+
# warn if function params are reassigned
53+
no-param-reassign:
54+
- 1
55+
- props: false
56+
# enforce type equality
57+
eqeqeq: [2]
58+
59+
no-return-assign: [2, always]
60+
no-undef-init: [1]
61+
no-lonely-if: [2]
62+
no-use-before-define: [2, nofunc]
63+
# enforce constructor functions are uppercased
64+
new-cap:
65+
- 2
66+
- newIsCap: true
67+
capIsNew: false
68+
69+
70+
71+
env:
72+
# allow node env globals
73+
node: true
74+
# allow commonjs module definition globals (e.g. require, module.exports)
75+
commonjs: true
76+
77+
78+
79+
80+
globals:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.swp
2+
node_modules/
3+
log/*
4+
artwork/
5+
npm-debug.log
6+
coverage/*
7+
player/*

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.eslintignore
2+
.eslintrc.yml
3+
.jsbeautifyrc
4+
test/*

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
> NOTE: this repo is under development. The contents is likely to change significantly.
2+
3+
# Openframe Website Plugin
4+
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.

install.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
#
3+
# Be VERY Careful. This script may be executed with admin privileges.
4+
5+
echo "Openframe Website Plugin -- install.sh"
6+
7+
# Some limited platform detection might be in order... though at present we're targeting the Pi
8+
os=$(uname)
9+
arq=$(uname -m)
10+
11+
if [ $os == "Linux" ]; then
12+
13+
# on Debian Linux distributions
14+
sudo apt-get update
15+
# do we really want to upgrade? this could take a damn long time.
16+
# sudo apt-get upgrade
17+
18+
# same for any debian disto (untested), including rpi (tested)
19+
sudo apt-get install chromium
20+
21+
22+
23+
if [ $arq == "armv7l" ]; then
24+
# on RaspberryPi
25+
26+
# ####
27+
#
28+
# FOR NOW, CODE GOES HERE since we're shooting for RPi support
29+
#
30+
# ####
31+
32+
# TODO: update chromium window_placement settings
33+
echo "armv7l"
34+
35+
36+
else
37+
# Non-arm7 Debian...
38+
echo "non armv7l"
39+
fi
40+
41+
elif [ $os == "Darwin" ]; then
42+
# OSX
43+
echo "osx"
44+
fi

package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "openframe-website",
3+
"version": "0.1.0",
4+
"description": "Openframe plugin which adds support for website-based artwork via chromium.",
5+
"main": "plugin.js",
6+
"scripts": {
7+
"install": "./install.sh",
8+
"uninstall": "./uninstall.sh",
9+
"patch-release": "npm version patch && npm publish && git push --follow-tags",
10+
"test": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha"
11+
},
12+
"keywords": [
13+
"openframe",
14+
"openframe-website",
15+
"format"
16+
],
17+
"author": {
18+
"name": "Jonathan Wohl",
19+
"url": "http://jonathanwohl.com"
20+
},
21+
"contributors": [
22+
{
23+
"name": "Jonathan Wohl",
24+
"url": "http://jonathanwohl.com"
25+
},
26+
{
27+
"name": "Ishac Bertran",
28+
"url": "http://ishacbertran.com"
29+
}
30+
],
31+
"license": "GPL-3.0",
32+
"devDependencies": {
33+
"istanbul": "^0.4.2",
34+
"mocha": "^2.3.4",
35+
"sinon": "^1.17.2"
36+
},
37+
"repository": {
38+
"type": "git",
39+
"url": "https://github.com/OpenframeProject/Openframe-Website"
40+
}
41+
}

plugin.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
var pjson = require('./package.json'),
2+
plugin = module.exports = {};
3+
4+
/**
5+
* Plugin initialization method.
6+
*
7+
* Called when the plugin (and its dependencies) have been installed.
8+
*
9+
* @param {object} ofPluginApi An interface provided to plugins giving limitted access to the frame environment
10+
*/
11+
plugin.init = function(ofPluginApi) {
12+
// do your plugin thing
13+
console.log('=======> Openframe-Image initialized! <=======');
14+
15+
/**
16+
* Plugins can add new artwork formats to the frame.
17+
*
18+
* Each format must have a unique name, which should correspond to the
19+
* name of the npm package.
20+
*/
21+
ofPluginApi.addFormat(
22+
{
23+
// the name should be the same as the package name
24+
'name': pjson.name,
25+
// this is what might get displayed to users (not currently used)
26+
'display_name': 'Website',
27+
'download': false,
28+
'start_command': 'xinit /usr/bin/chromium --kiosk $url',
29+
'end_command': 'sudo pkill -f chromium'
30+
}
31+
);
32+
33+
/**
34+
* Plugins also have access to the global event system
35+
*/
36+
plugin.pubsub = ofPluginApi.getPubsub();
37+
38+
/**
39+
* Plugins also have access to the Swagger REST client (https://github.com/swagger-api/swagger-js)
40+
* See openframe.io/explorer for API docs, or openframe.io/explorer/swagger.json for the swagger definition
41+
* which shows the available methods as 'operationId'
42+
*/
43+
plugin.rest = ofPluginApi.rest();
44+
};
45+

test/plugin.spec.js

Whitespace-only changes.

uninstall.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
#
3+
# Be VERY Careful. This script may be executed with admin privileges.
4+
5+
echo "Openframe Website Plugin -- uninstall.sh"
6+
7+
# Some limited platform detection might be in order... though at present we're targeting the Pi
8+
os=$(uname)
9+
arq=$(uname -m)
10+
11+
if [ $os == "Linux" ]; then
12+
13+
# on Debian Linux distributions
14+
15+
if [ $arq == "armv7l" ]; then
16+
# on RaspberryPi
17+
18+
# ####
19+
#
20+
# FOR NOW, CODE GOES HERE since we're shooting for RPi support
21+
#
22+
# ####
23+
echo "armv7l"
24+
25+
26+
else
27+
# Non-arm7 Debian...
28+
echo "non armv7l"
29+
fi
30+
31+
elif [ $os == "Darwin" ]; then
32+
# OSX
33+
echo "osx"
34+
fi

0 commit comments

Comments
 (0)