ModelHandle/website/extensions/example/example.js
2018-11-18 12:37:26 +01:00

22 lines
543 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 = $('<img>').addClass ('topbutton').attr ('src', 'extensions/example/example.png').attr ('title', 'Example button.').appendTo (buttonsDiv);
var myThis = this;
buttonImage.click (function () {
alert (JSON.stringify (myThis.ext.GetModelJson ()));
});
};