(function(params) {
var config = {
id: "examplecompany.testextension",
name: "Example Company Test Extension",
viewerToolbarControls: function (api, viewerType, viewerToolbar) {
// Toolbar button for all viewers
var buttonControlConfig = {
type: "button",
id: "all-viewer-custom-button",
title: "All Viewer Custom Button",
class: "",
imageUrl: parameters.getResourceFileUrl("review.farm.png"),
onClick: function () {
alert("You clicked the all viewer custom button!");
},
permissionCheck: {
permissionName: "HasPermission",
artifactTypeId: 1000007
},
};
viewerToolbar.createToolbarControl(buttonControlConfig, "center", 10);
// Viewer specific toolbar buttons
if (viewerType === "native") {
var nativeButtonConfig = {
type: "button",
id: "native-custom-button",
title: "Native Custom Button",
class: "",
imageUrl: parameters.getResourceFileUrl("review.goose.png"),
onClick: function () {
alert("You clicked the native viewer custom button!");
},
};
viewerToolbar.createToolbarControl(nativeButtonConfig, "center", 11);
} else if (viewerType === "image") {
var imageElement = document.createElement("img");
imageElement.src = parameters.getResourceFileUrl("review.my-image.png");
imageElement.id = "image-1";
imageElement.onClick: function () {
alert("You clicked the image viewer custom image");
};
var imageButtonConfig = {
type: "custom",
id: "image-custom-button",
title: "Image Custom Button",
class: "",
innerHTML: imageElement
};
viewerToolbar.createToolbarControl(imageButtonConfig, "center", 11);
}
};
return config;
}(params))