All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.plugins.atlassian-clientside-extensions-demo.3.0.0-m01-5ba70bd-lt2pg0b9.source-code.panel-plugin.js Maven / Gradle / Ivy

Go to download

Demonstrates how product developers and plugin developers can make use of the Client-side Extensions APIs.

There is a newer version: 4.0.0-jakarta-m001-6cdaaa6-m5gf9rqt
Show newest version
/* eslint-disable*/
(function () {
    function getPanelContent() {
        return `
            

Cool panel

This is some cool content generated with JS

`; } function panelPluginFactory(pluginAPI) { function onClick() { alert('You clicked a button'); } return { type: 'panel', label: 'Panel with JS', onAction: function onAction(panelAPI) { panelAPI .onMount(function (container) { var button = document.createElement('button'); button.setAttribute('data-testid', 'panel-plugin-button'); button.innerText = 'Click me!'; button.addEventListener('click', onClick); container.innerHTML = getPanelContent(); container.appendChild(button); }) .onUnmount(function (container) { console.log('removed event listener for button'); // Don't forget to clean-up your code var button = container.querySelector('button'); button.removeEventListener('click', onClick); }); }, }; } require(['@atlassian/clientside-extensions-registry'], function (registry) { registry.registerExtension('com.atlassian.plugins.atlassian-clientside-extensions-demo:panel-plugin-js', panelPluginFactory, { location: 'reff.old-web-items-location', label: 'loading…', weight: 100, }); }); })();




© 2015 - 2025 Weber Informatics LLC | Privacy Policy