-
-
Notifications
You must be signed in to change notification settings - Fork 31
Extensions
Riva Farabi edited this page Aug 25, 2018
·
3 revisions
Using the friendly JavaScript, you can build your own button with your own functions.
Coming soon
Note: Make sure Node installed on your computer
- Clone or download the extension repository and place them in C:\Users{user-name}\deckboard
- Run
npm install
in the extension folder - Launch Deckboard
- The extension will be listed on Extensions tab in Settings modal
Note: Make sure Node installed on your computer
- Create a NodeJS project inside extensions folder located in C:\Users{user-name}\deckboard
- Run
npm i deckboard-extension-kit
+-- deckboard
+-- extensions
+-- {your-extension}
+-- node_modules
+-- index.js
+-- package.json
- In
index.js
, exportnew DeckboardExtension()
with something like below.
const { DeckboardExtension, extensionLog, INPUT_METHOD } = require("..")
const selections = {
label: 'Do Something', // Action lookup label
value: 'study', // Action lookup value
icon: 'book', // FontAwesome icon
color: '#8E44AD', // Button's default color
inputs: [
{
type: INPUT_METHOD.INPUT_SELECT, // Create a drop down selection field
label: 'Subject', // Input fields label
ref: 'subject', // Field's reference name that can be used in execute function
items: [ // Array of drop down items
{
value: 'math',
label: 'Mathematics'
},
{
value: 'biology',
label: 'Biology'
}
]
}, {
type: INPUT_METHOD.INPUT_TEXT,
label: 'Additional Note',
ref: 'note'
}
]
}
const execute = (action, args) => {
switch (action) {
case "study":
doStudy(args.subject, args.note);
break;
default:
doNothing();
break;
}
};
function doStudy(activity, options) {
extensionLog('info', `I did ${activity}. ${options ? 'Notes: ' + options : ''}`)
}
function doNothing() {
extensionlog('info', 'I did nothing...')
}
const myExtension = new DeckboardExtension("Example Extension", selections, execute);
module.exports = myExtension
Copyright © 2020 Riva Farabi