(function () { 'use strict'; // Service to store data about this users showcases var serviceId = 'showcaseModals'; angular.module('showcases').factory(serviceId, ['$modal', showcaseModals]); var templatePath = modulesSharedResourcesUrl + 'Modules/Showcases/Views/Modals/'; function showcaseModals($modal) { var service = {}; // Create a new showcase in a modal service.createShowcase = function () { $modal.open({ templateUrl: templatePath + 'create-showcase.html?version=270122', controller: 'showcaseCreateModalController', size: 'sm', backdrop: 'static' }); } // Share the showcase using a modal service.share = function (currentShowcase) { $modal.open({ templateUrl: templatePath + 'share-showcase.html?version=270122', controller: 'showcaseShareModalController', size: 'lg', backdrop: 'static', resolve: { showcase: function () { return currentShowcase; } } }); }; // Show a message after an action has completed service.showMessage = function (message) { $modal.open({ templateUrl: templatePath + 'show-message.html?version=300719', controller: 'showcaseShowMessageModalController', size: 'lg', backdrop: 'static', resolve: { message: function () { return message; } } }); }; // Publish the showcase using a modal service.publish = function (currentShowcase) { $modal.open({ templateUrl: templatePath + 'publish-showcase.html?version=270122', controller: 'showcasePublishModalController', size: 'sm', backdrop: 'static', resolve: { showcase: function () { return currentShowcase; } } }); } // View the summary for a showcase using a modal service.summary = function (showcase) { $modal.open({ templateUrl: templatePath + 'showcase-summary.html?version=270122', controller: 'showcaseSummaryModalController', size: 'lg', backdrop: 'static', resolve: { showcase: function () { return showcase; } } }); } // Show a notice if the user tries to exit the showcase builder without saving changes service.builderConfirm = function (confirmed) { var modalTemplate = '' + ''; $modal.open({ template: modalTemplate, controller: 'builderGoBackConfirmController', size: 'sm', windowClass: 'center-modal', backdrop: 'static', resolve: { confirmed: function () { return confirmed; } } }); } return service; } })();