(function () { 'use strict'; var serviceId = 'brandingService'; angular.module('branding').factory(serviceId, ['$rootScope', '$http', 'config', '$q', brandingService]); function brandingService($rootScope, $http, config, $q) { var currentBranding; var service = { createBlankBranding: createBlankBranding, setBranding: setBranding, createBlankTerminology: createBlankTerminology }; return service; function createBlankBranding(organisationId) { if (config.appCode == 'OB') { return { fontStyle: 'Open Sans', fontColour: '#444444', headerStyle: 'standard', buttonStyle: 'standard', primaryColour: '#263238', secondaryColour: '#E52886', secondaryColourText: '#FFFFFF', textColour: '#c0ccd7', logoUrl: null, iconUrl: null, organisationId: organisationId } } if (config.appCode == 'MSA') { return { fontStyle: 'Open Sans', fontColour: '#444444', headerStyle: 'standard', buttonStyle: 'standard', primaryColour: '#263238', secondaryColour: '#009EE3', secondaryColourText: '#FFFFFF', textColour: '#c0ccd7', iconUrl: null, logoUrl: null, organisationId: organisationId } } if (config.appCode == 'CUPPA') { return { fontStyle: 'Open Sans', fontColour: '#444444', headerStyle: 'standard', buttonStyle: 'standard', primaryColour: '#CA4B2B', secondaryColour: '#FCA400', secondaryColourText: '#FFFFFF', textColour: '#ffffff', iconUrl: null, logoUrl: "https://cuppacarelive.blob.core.windows.net/branding/6c8ff5cb-28ac-e811-bce7-000d3ab29ae5-logo?version=1553868468404", organisationId: organisationId } } if (config.appCode == 'BDSU') { return { fontStyle: 'Open Sans', fontColour: '#444444', headerStyle: 'standard', buttonStyle: 'standard', primaryColour: '#263238', secondaryColour: '#01B8AA', secondaryColourText: '#FFFFFF', textColour: '#c0ccd7', logoUrl: null, iconUrl: null, organisationId: organisationId } } } function setBranding(branding) { currentBranding = branding } function createBlankTerminology(organisationId) { return { organisation: 'organisation', organisationPlural: 'organisations', group: 'group', groupPlural: 'groups', user: 'user', userPlural: 'users', role: 'role', rolePlural: 'roles', progress: 'progress view', progressPlural: 'progress views', progressTemplates: 'template', progressTemplatesPlural: 'templates', progressWorkflows: 'deployment', progressWorkflowsPlural: 'deployments', progressViews: 'view', progressViewsPlural: 'views', progressEngagement: 'engagement', progressEngagementPlural: 'engagement', framework: 'standard', frameworkPlural: 'standards', competency: 'outcome', competencyPlural: 'outcomes', grading: 'grading system', gradingPlural: 'grading systems', grade: 'grade', gradePlural: 'graded', }; } function shadeColor(color, percent) { var f = parseInt(color.slice(1), 16), t = percent < 0 ? 0 : 255, p = percent < 0 ? percent * -1 : percent, R = f >> 16, G = f >> 8 & 0x00FF, B = f & 0x0000FF; return "#" + (0x1000000 + (Math.round((t - R) * p) + R) * 0x10000 + (Math.round((t - G) * p) + G) * 0x100 + (Math.round((t - B) * p) + B)).toString(16).slice(1); } } })();