ModelHandle/website/extensions/example/example.js
2018-11-18 09:58:06 +01:00

25 lines
609 B
JavaScript

ExampleExtension = function ()
{
this.ext = null;
};
ExampleExtension.prototype.IsEnabled = function ()
{
return false;
};
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);
};