ModelHandle/website/extensions/example/example.js
2018-11-18 10:44:57 +01:00

25 lines
608 B
JavaScript

ExampleExtension = function ()
{
this.ext = null;
};
ExampleExtension.prototype.IsEnabled = function ()
{
return true;
};
ExampleExtension.prototype.Init = function (extensionInterface)
{
this.ext = extensionInterface;
var buttonsDiv = this.ext.GetButtonsDiv ()
var buttonImage = document.createElement ('img');
buttonImage.className = 'topbutton';
buttonImage.src = 'extensions/example/example.png';
buttonImage.title = 'Example button.';
var myThis = this;
buttonImage.onclick = function () {
alert (JSON.stringify (myThis.ext.GetModelJson ()));
};
buttonsDiv.appendChild (buttonImage);
};