mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
[API] Begin moving out type
This commit is contained in:
@ -9,18 +9,6 @@ define([
|
|||||||
"name": "To-do Plugin",
|
"name": "To-do Plugin",
|
||||||
"description": "Allows creating and editing to-do lists.",
|
"description": "Allows creating and editing to-do lists.",
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"types": [
|
|
||||||
{
|
|
||||||
"key": "example.todo",
|
|
||||||
"name": "To-Do List",
|
|
||||||
"glyph": "2",
|
|
||||||
"description": "A list of things that need to be done.",
|
|
||||||
"features": ["creation"],
|
|
||||||
"model": {
|
|
||||||
"tasks": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"views": [
|
"views": [
|
||||||
{
|
{
|
||||||
"key": "example.todo",
|
"key": "example.todo",
|
||||||
|
19
tutorials/todo/todo.js
Normal file
19
tutorials/todo/todo.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
define(function () {
|
||||||
|
return function todoPlugin(mct) {
|
||||||
|
var todoType = new mct.Type({
|
||||||
|
metadata: {
|
||||||
|
label: "To-Do List",
|
||||||
|
glyph: "2",
|
||||||
|
description: "A list of things that need to be done."
|
||||||
|
},
|
||||||
|
initialize: function (model) {
|
||||||
|
model.tasks = [];
|
||||||
|
},
|
||||||
|
creatable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
mct.type('example.todo', todoType);
|
||||||
|
|
||||||
|
return mct;
|
||||||
|
};
|
||||||
|
});
|
Reference in New Issue
Block a user