refactor(variables): global variables removed

pull/3/head
Vladimir Lugovsky 2015-12-17 00:49:15 +03:00
parent 119f4ab51a
commit 1cff1f2a1c
5 changed files with 56 additions and 82 deletions

View File

@ -9,7 +9,7 @@
.controller('DashboardCalendarCtrl', DashboardCalendarCtrl); .controller('DashboardCalendarCtrl', DashboardCalendarCtrl);
/** @ngInject */ /** @ngInject */
function DashboardCalendarCtrl($scope) { function DashboardCalendarCtrl(layoutColors) {
var $element = $('#calendar').fullCalendar({ var $element = $('#calendar').fullCalendar({
//height: 335, //height: 335,
header: { header: {
@ -44,7 +44,7 @@
title: 'Long Event', title: 'Long Event',
start: '2015-07-07', start: '2015-07-07',
end: '2015-07-10', end: '2015-07-10',
color: colorDanger color: layoutColors.danger
}, },
{ {
id: 999, id: 999,
@ -60,28 +60,28 @@
title: 'Conference', title: 'Conference',
start: '2015-07-11', start: '2015-07-11',
end: '2015-07-13', end: '2015-07-13',
color: colorSuccessLight color: layoutColors.successLight
}, },
{ {
title: 'Meeting', title: 'Meeting',
start: '2015-07-12T10:30:00', start: '2015-07-12T10:30:00',
end: '2015-07-12T12:30:00', end: '2015-07-12T12:30:00',
color: colorDanger color: layoutColors.danger
}, },
{ {
title: 'Meeting', title: 'Meeting',
start: '2015-07-14T14:30:00', start: '2015-07-14T14:30:00',
color: colorSuccessLight color: layoutColors.successLight
}, },
{ {
title: 'Dinner', title: 'Dinner',
start: '2015-07-14T20:00:00', start: '2015-07-14T20:00:00',
color: colorSuccess color: layoutColors.success
}, },
{ {
title: 'Birthday Party', title: 'Birthday Party',
start: '2015-07-13T07:00:00', start: '2015-07-13T07:00:00',
color: colorSuccess color: layoutColors.success
}, },
{ {
title: 'Click for Google', title: 'Click for Google',

View File

@ -9,7 +9,7 @@
.controller('DashboardLineChartCtrl', DashboardLineChartCtrl); .controller('DashboardLineChartCtrl', DashboardLineChartCtrl);
/** @ngInject */ /** @ngInject */
function DashboardLineChartCtrl($scope, tplSkinManager, tplSkinChartWatcherHelper) { function DashboardLineChartCtrl($scope, tplSkinManager, tplSkinChartWatcherHelper, layoutColors) {
var chartData = [ var chartData = [
{ date: new Date(2012, 11), value: 0, value0: 0 }, { date: new Date(2012, 11), value: 0, value0: 0 },
{ date: new Date(2013, 0), value: 15000, value0: 19000}, { date: new Date(2013, 0), value: 15000, value0: 19000},
@ -71,9 +71,9 @@
id: 'g0', id: 'g0',
bullet: 'none', bullet: 'none',
useLineColorForBulletBorder: true, useLineColorForBulletBorder: true,
lineColor: colorDefault, lineColor: layoutColors.default,
lineThickness: 1, lineThickness: 1,
negativeLineColor: colorDanger, negativeLineColor: layoutColors.danger,
type: 'smoothedLine', type: 'smoothedLine',
valueField: 'value0', valueField: 'value0',
fillAlphas: 1, fillAlphas: 1,
@ -83,9 +83,9 @@
id: 'g1', id: 'g1',
bullet: 'none', bullet: 'none',
useLineColorForBulletBorder: true, useLineColorForBulletBorder: true,
lineColor: colorPrimary, lineColor: layoutColors.primary,
lineThickness: 1, lineThickness: 1,
negativeLineColor: colorDanger, negativeLineColor: layoutColors.danger,
type: 'smoothedLine', type: 'smoothedLine',
valueField: 'value', valueField: 'value',
fillAlphas: 1, fillAlphas: 1,

View File

@ -9,7 +9,7 @@
.controller('DashboardMapCtrl', DashboardMapCtrl); .controller('DashboardMapCtrl', DashboardMapCtrl);
/** @ngInject */ /** @ngInject */
function DashboardMapCtrl() { function DashboardMapCtrl(layoutColors) {
var map = AmCharts.makeChart('amChartMap', { var map = AmCharts.makeChart('amChartMap', {
type: 'map', type: 'map',
theme: 'blur', theme: 'blur',
@ -21,40 +21,40 @@
zoomLongitude: 10, zoomLongitude: 10,
zoomLatitude: 52, zoomLatitude: 52,
areas: [ areas: [
{ title: 'Austria', id: 'AT', color: colorPrimary, customData: '1 244', groupId: '1'}, { title: 'Austria', id: 'AT', color: layoutColors.primary, customData: '1 244', groupId: '1'},
{ title: 'Ireland', id: 'IE', color: colorPrimary, customData: '1 342', groupId: '1'}, { title: 'Ireland', id: 'IE', color: layoutColors.primary, customData: '1 342', groupId: '1'},
{ title: 'Denmark', id: 'DK', color: colorPrimary, customData: '1 973', groupId: '1'}, { title: 'Denmark', id: 'DK', color: layoutColors.primary, customData: '1 973', groupId: '1'},
{ title: 'Finland', id: 'FI', color: colorPrimary, customData: '1 573', groupId: '1'}, { title: 'Finland', id: 'FI', color: layoutColors.primary, customData: '1 573', groupId: '1'},
{ title: 'Sweden', id: 'SE', color: colorPrimary, customData: '1 084', groupId: '1'}, { title: 'Sweden', id: 'SE', color: layoutColors.primary, customData: '1 084', groupId: '1'},
{ title: 'Great Britain', id: 'GB', color: colorPrimary, customData: '1 452', groupId: '1'}, { title: 'Great Britain', id: 'GB', color: layoutColors.primary, customData: '1 452', groupId: '1'},
{ title: 'Italy', id: 'IT', color: colorPrimary, customData: '1 321', groupId: '1'}, { title: 'Italy', id: 'IT', color: layoutColors.primary, customData: '1 321', groupId: '1'},
{ title: 'France', id: 'FR', color: colorPrimary, customData: '1 112', groupId: '1'}, { title: 'France', id: 'FR', color: layoutColors.primary, customData: '1 112', groupId: '1'},
{ title: 'Spain', id: 'ES', color: colorPrimary, customData: '1 865', groupId: '1'}, { title: 'Spain', id: 'ES', color: layoutColors.primary, customData: '1 865', groupId: '1'},
{ title: 'Greece', id: 'GR', color: colorPrimary, customData: '1 453', groupId: '1'}, { title: 'Greece', id: 'GR', color: layoutColors.primary, customData: '1 453', groupId: '1'},
{ title: 'Germany', id: 'DE', color: colorPrimary, customData: '1 957', groupId: '1'}, { title: 'Germany', id: 'DE', color: layoutColors.primary, customData: '1 957', groupId: '1'},
{ title: 'Belgium', id: 'BE', color: colorPrimary, customData: '1 011', groupId: '1'}, { title: 'Belgium', id: 'BE', color: layoutColors.primary, customData: '1 011', groupId: '1'},
{ title: 'Luxembourg', id: 'LU', color: colorPrimary, customData: '1 011', groupId: '1'}, { title: 'Luxembourg', id: 'LU', color: layoutColors.primary, customData: '1 011', groupId: '1'},
{ title: 'Netherlands', id: 'NL', color: colorPrimary, customData: '1 213', groupId: '1'}, { title: 'Netherlands', id: 'NL', color: layoutColors.primary, customData: '1 213', groupId: '1'},
{ title: 'Portugal', id: 'PT', color: colorPrimary, customData: '1 291', groupId: '1'}, { title: 'Portugal', id: 'PT', color: layoutColors.primary, customData: '1 291', groupId: '1'},
{ title: 'Lithuania', id: 'LT', color: colorSuccessLight, customData: '567', groupId: '2'}, { title: 'Lithuania', id: 'LT', color: layoutColors.successLight, customData: '567', groupId: '2'},
{ title: 'Latvia', id: 'LV', color: colorSuccessLight, customData: '589', groupId: '2'}, { title: 'Latvia', id: 'LV', color: layoutColors.successLight, customData: '589', groupId: '2'},
{ title: 'Czech Republic ', id: 'CZ', color: colorSuccessLight, customData: '785', groupId: '2'}, { title: 'Czech Republic ', id: 'CZ', color: layoutColors.successLight, customData: '785', groupId: '2'},
{ title: 'Slovakia', id: 'SK', color: colorSuccessLight, customData: '965', groupId: '2'}, { title: 'Slovakia', id: 'SK', color: layoutColors.successLight, customData: '965', groupId: '2'},
{ title: 'Estonia', id: 'EE', color: colorSuccessLight, customData: '685', groupId: '2'}, { title: 'Estonia', id: 'EE', color: layoutColors.successLight, customData: '685', groupId: '2'},
{ title: 'Hungary', id: 'HU', color: colorSuccessLight, customData: '854', groupId: '2'}, { title: 'Hungary', id: 'HU', color: layoutColors.successLight, customData: '854', groupId: '2'},
{ title: 'Cyprus', id: 'CY', color: colorSuccessLight, customData: '754', groupId: '2'}, { title: 'Cyprus', id: 'CY', color: layoutColors.successLight, customData: '754', groupId: '2'},
{ title: 'Malta', id: 'MT', color: colorSuccessLight, customData: '867', groupId: '2'}, { title: 'Malta', id: 'MT', color: layoutColors.successLight, customData: '867', groupId: '2'},
{ title: 'Poland', id: 'PL', color: colorSuccessLight, customData: '759', groupId: '2'}, { title: 'Poland', id: 'PL', color: layoutColors.successLight, customData: '759', groupId: '2'},
{ title: 'Romania', id: 'RO', color: colorSuccess, customData: '302', groupId: '3'}, { title: 'Romania', id: 'RO', color: layoutColors.success, customData: '302', groupId: '3'},
{ title: 'Bulgaria', id: 'BG', color: colorSuccess, customData: '102', groupId: '3'}, { title: 'Bulgaria', id: 'BG', color: layoutColors.success, customData: '102', groupId: '3'},
{ title: 'Slovenia', id: 'SI', color: colorDanger, customData: '23', groupId: '4'}, { title: 'Slovenia', id: 'SI', color: layoutColors.danger, customData: '23', groupId: '4'},
{ title: 'Croatia', id: 'HR', color: colorDanger, customData: '96', groupId: '4'} { title: 'Croatia', id: 'HR', color: layoutColors.danger, customData: '96', groupId: '4'}
] ]
}, },
areasSettings: { areasSettings: {
rollOverOutlineColor: '#FFFFFF', rollOverOutlineColor: '#FFFFFF',
rollOverColor: colorPrimaryDark, rollOverColor: layoutColors.primaryDark,
alpha: 0.8, alpha: 0.8,
unlistedAreasAlpha: 0.1, unlistedAreasAlpha: 0.1,
balloonText: '[[title]]: [[customData]] users' balloonText: '[[title]]: [[customData]] users'
@ -76,19 +76,19 @@
data: [ data: [
{ {
title: 'over 1 000 users', title: 'over 1 000 users',
color: colorPrimary color: layoutColors.primary
}, },
{ {
title: '500 - 1 000 users', title: '500 - 1 000 users',
color: colorSuccessLight color: layoutColors.successLight
}, },
{ {
title: '100 - 500 users', title: '100 - 500 users',
color: colorSuccess color: layoutColors.success
}, },
{ {
title: '0 - 100 users', title: '0 - 100 users',
color: colorDanger color: layoutColors.danger
} }
] ]
}, },

View File

@ -9,36 +9,36 @@
.controller('TrafficChartCtrl', TrafficChartCtrl); .controller('TrafficChartCtrl', TrafficChartCtrl);
/** @ngInject */ /** @ngInject */
function TrafficChartCtrl() { function TrafficChartCtrl(layoutColors) {
var doughnutData = [ var doughnutData = [
{ {
value: 2000, value: 2000,
color: colorPrimary, color: layoutColors.primary,
highlight: colorPrimaryDark, highlight: layoutColors.primaryDark,
label: 'Ad Campaigns' label: 'Ad Campaigns'
}, },
{ {
value: 1500, value: 1500,
color: colorDanger, color: layoutColors.danger,
highlight: colorDangerDark, highlight: layoutColors.dangerDark,
label: 'Search engines' label: 'Search engines'
}, },
{ {
value: 1000, value: 1000,
color: colorSuccessLight, color: layoutColors.successLight,
highlight: '#6c9c3f', highlight: '#6c9c3f',
label: 'Direct Traffic' label: 'Direct Traffic'
}, },
{ {
value: 1200, value: 1200,
color: colorSuccess, color: layoutColors.success,
highlight: colorSuccessDark, highlight: layoutColors.successDark,
label: 'Referral Traffic' label: 'Referral Traffic'
}, },
{ {
value: 400, value: 400,
color: colorWarning, color: layoutColors.warning,
highlight: colorWarningDark, highlight: layoutColors.warningDark,
label: 'Other' label: 'Other'
} }
]; ];

View File

@ -1,26 +0,0 @@
'use strict';
var colorPrimary = '#41bee9';
var colorInfo = '#5bc0de';
var colorDanger = '#9d498c';
var colorSuccess = '#348779';
var colorWarning = '#bbcb50';
var colorDefault = '#e1e1e1';
var colorSuccessLight = '#85BA54';
var colorPrimaryLight = '#5FBCBB';
var colorWarningLight = '#c5d36a';
var colorPrimaryDark = '#1488b0';
var colorDangerDark = '#632e58';
var colorSuccessDark = '#1c4a42';
var colorWarningDark = '#8b992d';
var colorPrimaryBg = '#C5ECF9';
var colorSuccessBg = '#C1DBD7';
var colorDangerBg = '#E1C8DD';
var colorDefaultText = '#585858';
var pageLoaded = false;
var resWidthCollapseSidebar = 1200;
var resWidthHideSidebar = 500;