blt950 / pihub

PiHub, a website-desktop for your touchscreen Raspberry Pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pihub

How to install modules:

1. Place the module folder into modules folder in the root of the project.
2. Locate the config.js file in the root directory, add the modules name into the modules array.

How to create a module

Creating modules for PiHub, is incredibly easy. A few simple steps is all thats required!
Start by creating a folder in the modules directory, for this guide we will be creating a simple alert module with a icon.

Create the folder "alertbutton" in modules directory, then create a js file with the same name inside that folder.
At this point you should have /modules/alertbutton/alertbutton.js created, then add the following code:

alertbutton.js
function alertbutton_init() {
  addAppIcon("fa-exclamation-triangle", "alert('Hello World!')");
}

Youre done, it's that easy! Now head over to your config.js and add "alertbutton" into the array, and watch the button automaticly appear.

More advanced functions to come, undocumented example usage required is loadCSS which will load css files in a modules css folder.

About

PiHub, a website-desktop for your touchscreen Raspberry Pi.


Languages

Language:JavaScript 57.5%Language:CSS 28.2%Language:PHP 14.4%