Share Brilliantly
davinci toolboxes
Most Toolboxes are designed to accessible as a drag and drop icon in the control box. The control box can be opened
through the context menu that is activated by a right mouse click.
The following code adds the media item to the context menu, which as a child menu item name audio.
There is a function associated with the key click which specifies what happens when the audio item is clicked.
(function () {
$context([{
name: 'media',
children: [{
name: 'audio',
click: function () {
}
}]
}])
})();
$controlBox.addItem({
html: '<img id="' + id + '" class="" style="width:30px;display:block;margin:auto;" src="'+ICON_ROOT+'1059132 - bar note single.png" /><br/>',
id:'davinci.audio'
});
$controlBox.open();
$('#' + id).click(function () {
$controlWindow.open();
$controlWindow.content('');
$controlWindow.header(title);
let audioId = $util.guid();
let helpId = $util.guid();
let content = `<div draggable="true" id="` + audioId + `-parent"><div class="control-widget" id="` + googleMapId + `" ><div style="display:flex;flex-direction:row;"><div style="width:50px;"><img class="" style="width:30px;display:block;margin:auto;" src="`+ICON_ROOT+`1059132 - bar note single.png" /></div><div style="flex:1">audio</br><a class="link" id="` + helpId + `" href="#headerPopup-` + helpId +`" style="font-size:12px;margin-right:5px;" href="#">tutorial</a><a class="link" style="font-size:12px;margin-right:5px;" target="_audiohelp" href="/home/documentation/template.html?url=/library/ctrls/davinci/audio/v1.0.0/site/doc.js">help</a></div></div></div></div>`
let callback = async function () {
(await import('/lib/components/v1.0.0/audio.js')).addAudio()
};
$controlWindow.dragComponent(content, audioId + '-parent', callback);
}