(function () { 'use strict'; // Service to store data about this users showcases var serviceId = 'showcasesService'; angular.module('showcases').factory(serviceId, showcase); function showcase() { var service = {}; var currentShowcaseId; function findShowcaseWithName(showcases, name) { return showcases.find(function (showcase) { return showcase.name == name; }); } // Get the current showcase Id service.getCurrentShowcaseId = function () { return currentShowcaseId; } // Set the current showcase Id service.setCurrentShowcaseId = function (showcaseId) { currentShowcaseId = showcaseId; } // Check if the name for a new showcase is unique service.checkShowcaseNameUnique = function (showcases, name) { return !findShowcaseWithName(showcases, name); } // Check if the name for an existing showcase is unique service.checkExistingShowcaseNameUnique = function (showcases, currentShowcase, name) { var showcase = findShowcaseWithName(showcases, name); return !showcase || showcase.showcaseId === currentShowcase.showcaseId; } // Get the thumbnail for a showcase theme service.getThemeThumbnail = function (name) { return 'https://uiframework.mkmapps.com/latest/lib/products/myshowcase/images/showcase/thumbs/' + name + '-thumb.png?version=270122'; } // Get the list of background colours available for showcases service.getBackgroundColours = function () { return [ { name: 'Red', colour: '#DB4549' }, { name: 'Tangerine', colour: '#F39138' }, { name: 'Turquoise', colour: '#88CFC4' }, { name: 'Blue', colour: '#309CD1' }, { name: 'Orange', colour: '#F5764B' }, { name: 'Green', colour: '#4DB175' }, { name: 'Pink', colour: '#F25F65' }, { name: 'Royal Purple', colour: '#647E99' }, { name: 'Slate', colour: '#303B41' }, { name: 'Black', colour: '#000000' }, { name: 'Ash', colour: '#444444' }, { name: 'Grey', colour: '#888888' }, { name: 'Off white', colour: '#CCCCCC' }, { name: 'Light grey', colour: '#EAEDEF' }, { name: 'Lighter grey', colour: '#f9f9fa' }, { name: 'White', colour: '#FFFFFF' } ] } // Get the list of colour palettes available for showcases service.getColourPalettes = function() { return [ { set: "1", category: "Classic", palettes: [ { backgroundColour: '#EAEDEF', fontColour: '#1F1F1F', highlightColour: '#AAAAAA', name: 'Default' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#DB4549', name: 'Red' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#F39138', name: 'Tangerine' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#88CFC4', name: 'Turquoise' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#309CD1', name: 'Blue' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#F5764B', name: 'Orange' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#4DB175', name: 'Green' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#F25F65', name: 'Pink' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#647E99', name: 'Royal blue' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#303B41', name: 'Slate' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#000000', name: 'Black' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#454545', name: 'Ash' }, { backgroundColour: '#EEEEEE', fontColour: '#464646', highlightColour: '#888888', name: 'Grey' }, ] } ]; } // Get the list of background patterns available for showcases service.getBackgroundPatterns = function() { return [ { name: 'pattern 1', src: '/viewshowcase/patterns/pattern1.png' }, { name: 'pattern 2', src: '/viewshowcase/patterns/pattern2.png' }, { name: 'pattern 3', src: '/viewshowcase/patterns/pattern3.png' }, { name: 'pattern 4', src: '/viewshowcase/patterns/pattern4.png' }, { name: 'pattern 5', src: '/viewshowcase/patterns/pattern5.png' }, { name: 'pattern 6', src: '/viewshowcase/patterns/pattern6.png' }, { name: 'pattern 7', src: '/viewshowcase/patterns/pattern7.png' }, { name: 'pattern 8', src: '/viewshowcase/patterns/pattern8.png' }, { name: 'pattern 9', src: '/viewshowcase/patterns/pattern9.png' }, { name: 'pattern 10', src: '/viewshowcase/patterns/pattern10.png' }, ]; } // Get the list of fonts available for showcases service.getFonts = function() { return [ { font: 'Amatic SC' }, { font: 'Courier New' }, { font: 'Impact' }, { font: 'Lobster' }, { font: 'Onyx' }, { font: 'Open Sans' }, { font: 'Open Sans Condensed' }, { font: 'Pacifico' }, { font: 'Roboto' }, { font: 'Roboto Condensed' }, { font: 'Roboto Slab' }, { font: 'Rockwell' }, { font: 'Shadows Into Light' }, { font: 'Source Sans Pro' }, { font: 'Stencil' }, { font: 'Times New Roman' }, { font: 'Trebuchet MS' }, { font: 'Verdana' }, ]; } return service; } // Service to store data about showcase items var serviceId = 'showcaseItemsService'; angular.module('showcases').factory(serviceId, showcaseItems); function showcaseItems() { var showcaseItems = [ { title: 'Rich Text Item', displayType: 'status', addInType: 'richtext', iconUrl: 'https://uiframework.mkmapps.com/latest/lib/products/myshowcase/images/drag-in-richtext.jpg', thumbnailUrl: 'https://uiframework.mkmapps.com/latest/lib/products/myshowcase/images/add-in-richtext.png', isShowcaseItemOnly: true, areDetailsEditedForShowcase: true }, { title: 'Heading Item', displayType: 'status', addInType: 'heading', iconUrl: 'https://uiframework.mkmapps.com/latest/lib/products/myshowcase/images/drag-in-heading.jpg', thumbnailUrl: 'https://uiframework.mkmapps.com/latest/lib/products/myshowcase/images/add-in-heading.png', isShowcaseItemOnly: true, areDetailsEditedForShowcase: true } ]; return { getAddIns: function () { return showcaseItems; } }; } })();