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.modal-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 getModalContent(context) {
        var content = `
            

Cool content

This is some cool content generated with JS

`; content += context && context.secondaryClicked ? '

secondary clicked' : ''; return content; } function modalPluginFactory(pluginAPI, context) { return { type: 'modal', label: 'Modal with JS', onAction: function onAction(modalAPI) { modalAPI .setTitle('A cool modal with JS') .setWidth('jumbo') .setAppearance('shiny') .onMount(function (container) { // append your content for the modal container.innerHTML = getModalContent(); // listen to actions in the modal modalAPI.setActions([ { text: 'Primary', onClick: function () { console.log('modal-plugin.js: onPrimaryAction'); // close the modal :) modalAPI.closeModal(); }, }, { text: 'Secondary', onClick: function () { console.log('modal-plugin.js: onSecondaryAction'); container.innerHTML = getModalContent({ secondaryClicked: true }); }, }, ]); modalAPI.onClose(function () { return confirm('Are you sure you want to close this modal?'); }); }); }, }; } require(['@atlassian/clientside-extensions-registry'], function (registry) { registry.registerExtension('com.atlassian.plugins.atlassian-clientside-extensions-demo:modal-plugin-js', modalPluginFactory, { location: 'reff.old-web-items-location', label: 'loading…', weight: 200, }); }); })();





© 2015 - 2025 Weber Informatics LLC | Privacy Policy