Skip to main content

Project API Introduction

By default, netDecor implements the most common project management system, based on "New", "Open", "Save" and "Save as" buttons. Older API (v2) exposed only Save and Open events. The new (V3) API, comes with functionality to rebuild the project management entirely form scratch. addButton method, removes all default buttons and adds new configugarable button to the panel. With other methods from te project API, it's possible to build completely custom implementation for the project pipeline.

Examples

These examples provide only buttons instantiation code. Actual implementation may differ between web frameworks and backends.

Classic with share button

With share

var newButton = NetDecor.v3.project.addButton({
label: { en:"New", pl: "Nowy" },
icon: "New",
shortcut:{
flags:["LCtrl"],
key:"N"
},
onclick: function () {
// implementation
}
});

var openButton = NetDecor.v3.project.addButton({
label: { en:"Open", pl: "Otwórz" },
icon: "Open",
shortcut:{
flags:["LCtrl"],
key:"O"
},
onclick: function () {
// implementation
}
});

var saveButton = NetDecor.v3.project.addButton({
label: { en:"Save", pl: "Zapisz" },
icon: "Save",
shortcut:{
flags:["LCtrl"],
key:"S"
},
onclick: function () {
// implementation
}
});


var saveAsButton = NetDecor.v3.project.addButton({
label: { en:"Save as", pl: "Zapisz jako" },
icon: "SaveAs",
onclick: function () {
// implementation
}
});

var shareButton = NetDecor.v3.project.addButton({
label: { en:"Share", pl: "Udostępnij" },
icon: "Share",
onclick: function () {
// implementation
}
});

Readonly gallery

var openButton = NetDecor.v3.project.addButton({
label: { en:"Open", pl: "Otwórz" },
icon: "Open",
shortcut:{
flags:["LCtrl"],
key:"O"
},
onclick: function () {
// implementation
}
});

var openCloudButton = NetDecor.v3.project.addButton({
label: { en:"Open from cloud", pl: "Otwórz z chmury" },
icon: "OpenCloud",
onclick: function () {
// implementation
}
});

Cloud based save

Cloud

var newButton = NetDecor.v3.project.addButton({
label: { en:"New", pl: "Nowy" },
icon: "New",
shortcut:{
flags:["LCtrl"],
key:"N"
},
onclick: function () {
// implementation
}
});

var openButton = NetDecor.v3.project.addButton({
label: { en:"Open", pl: "Otwórz" },
icon: "OpenCloud",
shortcut:{
flags:["LCtrl"],
key:"O"
},
onclick: function () {
// implementation
}
});

var saveButton = NetDecor.v3.project.addButton({
label: { en:"Save", pl: "Zapisz" },
icon: "SaveCloud",
shortcut:{
flags:["LCtrl"],
key:"N"
},
onclick: function () {
// implementation
}
});

See also

addButton

IconResourceId