(function () { 'use strict'; //showcase service var serviceId = 'showcase'; var showCreateShowcase = false; var currentShowcase; angular.module('app').factory(serviceId, ['datacontext', showcase]); var preview = false; function showcase(datacontext) { var service = { getShowcaseSummary: getShowcaseSummary, getCurrentShowcase: getCurrentShowcase, setCurrentShowcase: setCurrentShowcase, preview: preview, getColourPalettes: getColourPalettes, checkShowcaseNameUnique: checkShowcaseNameUnique, setShowCreateShowcase: setShowCreateShowcase, getShowCreateShowcase: getShowCreateShowcase, getBackgroundPatterns: getBackgroundPatterns, getShowcaseFonts: getShowcaseFonts }; return service; function setShowCreateShowcase(value) { showCreateShowcase = value; } function getShowCreateShowcase() { return showCreateShowcase; } //what is the current showcase for the user function getCurrentShowcase() { return currentShowcase; // return datacontext.getCurrentShowcase(); } //set the current showcase for the user function setCurrentShowcase(theShowcase) { currentShowcase = theShowcase; //return datacontext.setCurrentShowcase(theShowcase); } //get the showcase summary (high level overview of all users showcases with number of items etc.) function getShowcaseSummary() { return datacontext.getShowcaseSummary().then(function (showcaseSum) { return showcaseSum; }); } function checkShowcaseNameUnique(name) { return datacontext.getShowcases(true).then(function (showcases) { for (var i = 0; i < showcases.length; i++) { if (showcases[i].name === name) return false; } return true; }); } function getColourPalettes() { 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' }, ] } ]; } function getBackgroundPatterns() { 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' }, ]; } function getShowcaseFonts() { 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' }, ]; } } })();