55 * This is a demo file used only for the main dashboard (index.html)
66 **/
77
8- $ ( function ( ) {
8+ /* global moment:false, Chart:false, Sparkline:false */
99
10+ $ ( function ( ) {
1011 'use strict'
1112
1213 // Make the dashboard widgets sortable Using jquery UI
1314 $ ( '.connectedSortable' ) . sortable ( {
14- placeholder : 'sort-highlight' ,
15- connectWith : '.connectedSortable' ,
16- handle : '.card-header, .nav-tabs' ,
15+ placeholder : 'sort-highlight' ,
16+ connectWith : '.connectedSortable' ,
17+ handle : '.card-header, .nav-tabs' ,
1718 forcePlaceholderSize : true ,
18- zIndex : 999999
19+ zIndex : 999999
1920 } )
20- $ ( '.connectedSortable .card-header, .connectedSortable .nav-tabs-custom ' ) . css ( 'cursor' , 'move' )
21+ $ ( '.connectedSortable .card-header' ) . css ( 'cursor' , 'move' )
2122
2223 // jQuery UI sortable for the todo list
2324 $ ( '.todo-list' ) . sortable ( {
24- placeholder : 'sort-highlight' ,
25- handle : '.handle' ,
25+ placeholder : 'sort-highlight' ,
26+ handle : '.handle' ,
2627 forcePlaceholderSize : true ,
27- zIndex : 999999
28+ zIndex : 999999
2829 } )
2930
3031 // bootstrap WYSIHTML5 - text editor
3132 $ ( '.textarea' ) . summernote ( )
3233
3334 $ ( '.daterange' ) . daterangepicker ( {
34- ranges : {
35- ' Today' : [ moment ( ) , moment ( ) ] ,
36- ' Yesterday' : [ moment ( ) . subtract ( 1 , 'days' ) , moment ( ) . subtract ( 1 , 'days' ) ] ,
37- 'Last 7 Days' : [ moment ( ) . subtract ( 6 , 'days' ) , moment ( ) ] ,
35+ ranges : {
36+ Today : [ moment ( ) , moment ( ) ] ,
37+ Yesterday : [ moment ( ) . subtract ( 1 , 'days' ) , moment ( ) . subtract ( 1 , 'days' ) ] ,
38+ 'Last 7 Days' : [ moment ( ) . subtract ( 6 , 'days' ) , moment ( ) ] ,
3839 'Last 30 Days' : [ moment ( ) . subtract ( 29 , 'days' ) , moment ( ) ] ,
39- 'This Month' : [ moment ( ) . startOf ( 'month' ) , moment ( ) . endOf ( 'month' ) ] ,
40- 'Last Month' : [ moment ( ) . subtract ( 1 , 'month' ) . startOf ( 'month' ) , moment ( ) . subtract ( 1 , 'month' ) . endOf ( 'month' ) ]
40+ 'This Month' : [ moment ( ) . startOf ( 'month' ) , moment ( ) . endOf ( 'month' ) ] ,
41+ 'Last Month' : [ moment ( ) . subtract ( 1 , 'month' ) . startOf ( 'month' ) , moment ( ) . subtract ( 1 , 'month' ) . endOf ( 'month' ) ]
4142 } ,
4243 startDate : moment ( ) . subtract ( 29 , 'days' ) ,
43- endDate : moment ( )
44+ endDate : moment ( )
4445 } , function ( start , end ) {
45- window . alert ( 'You chose: ' + start . format ( 'MMMM D, YYYY' ) + ' - ' + end . format ( 'MMMM D, YYYY' ) )
46+ // eslint-disable-next-line no-alert
47+ alert ( 'You chose: ' + start . format ( 'MMMM D, YYYY' ) + ' - ' + end . format ( 'MMMM D, YYYY' ) )
4648 } )
4749
4850 /* jQueryKnob */
4951 $ ( '.knob' ) . knob ( )
5052
5153 // jvectormap data
5254 var visitorsData = {
53- 'US' : 398 , //USA
54- 'SA' : 400 , //Saudi Arabia
55- 'CA' : 1000 , //Canada
56- 'DE' : 500 , //Germany
57- 'FR' : 760 , //France
58- 'CN' : 300 , //China
59- 'AU' : 700 , //Australia
60- 'BR' : 600 , //Brazil
61- 'IN' : 800 , //India
62- 'GB' : 320 , //Great Britain
63- 'RU' : 3000 //Russia
55+ US : 398 , // USA
56+ SA : 400 , // Saudi Arabia
57+ CA : 1000 , // Canada
58+ DE : 500 , // Germany
59+ FR : 760 , // France
60+ CN : 300 , // China
61+ AU : 700 , // Australia
62+ BR : 600 , // Brazil
63+ IN : 800 , // India
64+ GB : 320 , // Great Britain
65+ RU : 3000 // Russia
6466 }
6567 // World map by jvectormap
6668 $ ( '#world-map' ) . vectorMap ( {
67- map : 'usa_en' ,
68- backgroundColor : 'transparent' ,
69- regionStyle : {
69+ map : 'usa_en' ,
70+ backgroundColor : 'transparent' ,
71+ regionStyle : {
7072 initial : {
71- fill : 'rgba(255, 255, 255, 0.7)' ,
72- 'fill-opacity' : 1 ,
73- stroke : 'rgba(0,0,0,.2)' ,
74- 'stroke-width' : 1 ,
73+ fill : 'rgba(255, 255, 255, 0.7)' ,
74+ 'fill-opacity' : 1 ,
75+ stroke : 'rgba(0,0,0,.2)' ,
76+ 'stroke-width' : 1 ,
7577 'stroke-opacity' : 1
7678 }
7779 } ,
78- series : {
80+ series : {
7981 regions : [ {
80- values : visitorsData ,
81- scale : [ '#ffffff' , '#0154ad' ] ,
82+ values : visitorsData ,
83+ scale : [ '#ffffff' , '#0154ad' ] ,
8284 normalizeFunction : 'polynomial'
8385 } ]
8486 } ,
8587 onRegionLabelShow : function ( e , el , code ) {
86- if ( typeof visitorsData [ code ] != 'undefined' )
88+ if ( typeof visitorsData [ code ] !== 'undefined' ) {
8789 el . html ( el . html ( ) + ': ' + visitorsData [ code ] + ' new visitors' )
90+ }
8891 }
8992 } )
9093
9194 // Sparkline charts
92- var sparkline1 = new Sparkline ( $ ( " #sparkline-1" ) [ 0 ] , { width : 80 , height : 50 , lineColor : '#92c1dc' , endColor : '#ebf4f9' } ) ;
93- var sparkline2 = new Sparkline ( $ ( " #sparkline-2" ) [ 0 ] , { width : 80 , height : 50 , lineColor : '#92c1dc' , endColor : '#ebf4f9' } ) ;
94- var sparkline3 = new Sparkline ( $ ( " #sparkline-3" ) [ 0 ] , { width : 80 , height : 50 , lineColor : '#92c1dc' , endColor : '#ebf4f9' } ) ;
95+ var sparkline1 = new Sparkline ( $ ( ' #sparkline-1' ) [ 0 ] , { width : 80 , height : 50 , lineColor : '#92c1dc' , endColor : '#ebf4f9' } )
96+ var sparkline2 = new Sparkline ( $ ( ' #sparkline-2' ) [ 0 ] , { width : 80 , height : 50 , lineColor : '#92c1dc' , endColor : '#ebf4f9' } )
97+ var sparkline3 = new Sparkline ( $ ( ' #sparkline-3' ) [ 0 ] , { width : 80 , height : 50 , lineColor : '#92c1dc' , endColor : '#ebf4f9' } )
9598
96- sparkline1 . draw ( [ 1000 , 1200 , 920 , 927 , 931 , 1027 , 819 , 930 , 1021 ] ) ;
97- sparkline2 . draw ( [ 515 , 519 , 520 , 522 , 652 , 810 , 370 , 627 , 319 , 630 , 921 ] ) ;
98- sparkline3 . draw ( [ 15 , 19 , 20 , 22 , 33 , 27 , 31 , 27 , 19 , 30 , 21 ] ) ;
99+ sparkline1 . draw ( [ 1000 , 1200 , 920 , 927 , 931 , 1027 , 819 , 930 , 1021 ] )
100+ sparkline2 . draw ( [ 515 , 519 , 520 , 522 , 652 , 810 , 370 , 627 , 319 , 630 , 921 ] )
101+ sparkline3 . draw ( [ 15 , 19 , 20 , 22 , 33 , 27 , 31 , 27 , 19 , 30 , 21 ] )
99102
100103 // The Calender
101104 $ ( '#calendar' ) . datetimepicker ( {
@@ -110,155 +113,155 @@ $(function () {
110113
111114 /* Chart.js Charts */
112115 // Sales chart
113- var salesChartCanvas = document . getElementById ( 'revenue-chart-canvas' ) . getContext ( '2d' ) ;
114- //$('#revenue-chart').get(0).getContext('2d');
116+ var salesChartCanvas = document . getElementById ( 'revenue-chart-canvas' ) . getContext ( '2d' )
117+ // $('#revenue-chart').get(0).getContext('2d');
115118
116119 var salesChartData = {
117- labels : [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ] ,
120+ labels : [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' ] ,
118121 datasets : [
119122 {
120- label : 'Digital Goods' ,
121- backgroundColor : 'rgba(60,141,188,0.9)' ,
122- borderColor : 'rgba(60,141,188,0.8)' ,
123- pointRadius : false ,
124- pointColor : '#3b8bba' ,
125- pointStrokeColor : 'rgba(60,141,188,1)' ,
126- pointHighlightFill : '#fff' ,
123+ label : 'Digital Goods' ,
124+ backgroundColor : 'rgba(60,141,188,0.9)' ,
125+ borderColor : 'rgba(60,141,188,0.8)' ,
126+ pointRadius : false ,
127+ pointColor : '#3b8bba' ,
128+ pointStrokeColor : 'rgba(60,141,188,1)' ,
129+ pointHighlightFill : '#fff' ,
127130 pointHighlightStroke : 'rgba(60,141,188,1)' ,
128- data : [ 28 , 48 , 40 , 19 , 86 , 27 , 90 ]
131+ data : [ 28 , 48 , 40 , 19 , 86 , 27 , 90 ]
129132 } ,
130133 {
131- label : 'Electronics' ,
132- backgroundColor : 'rgba(210, 214, 222, 1)' ,
133- borderColor : 'rgba(210, 214, 222, 1)' ,
134- pointRadius : false ,
135- pointColor : 'rgba(210, 214, 222, 1)' ,
136- pointStrokeColor : '#c1c7d1' ,
137- pointHighlightFill : '#fff' ,
134+ label : 'Electronics' ,
135+ backgroundColor : 'rgba(210, 214, 222, 1)' ,
136+ borderColor : 'rgba(210, 214, 222, 1)' ,
137+ pointRadius : false ,
138+ pointColor : 'rgba(210, 214, 222, 1)' ,
139+ pointStrokeColor : '#c1c7d1' ,
140+ pointHighlightFill : '#fff' ,
138141 pointHighlightStroke : 'rgba(220,220,220,1)' ,
139- data : [ 65 , 59 , 80 , 81 , 56 , 55 , 40 ]
140- } ,
142+ data : [ 65 , 59 , 80 , 81 , 56 , 55 , 40 ]
143+ }
141144 ]
142145 }
143146
144147 var salesChartOptions = {
145- maintainAspectRatio : false ,
146- responsive : true ,
148+ maintainAspectRatio : false ,
149+ responsive : true ,
147150 legend : {
148151 display : false
149152 } ,
150153 scales : {
151154 xAxes : [ {
152- gridLines : {
153- display : false ,
155+ gridLines : {
156+ display : false
154157 }
155158 } ] ,
156159 yAxes : [ {
157- gridLines : {
158- display : false ,
160+ gridLines : {
161+ display : false
159162 }
160163 } ]
161164 }
162165 }
163166
164167 // This will get the first returned node in the jQuery collection.
165- var salesChart = new Chart ( salesChartCanvas , {
166- type : 'line' ,
167- data : salesChartData ,
168- options : salesChartOptions
169- }
170- )
168+ // eslint-disable-next-line no-unused-vars
169+ var salesChart = new Chart ( salesChartCanvas , { // lgtm[js/unused-local-variable]
170+ type : 'line' ,
171+ data : salesChartData ,
172+ options : salesChartOptions
173+ } )
171174
172175 // Donut Chart
173176 var pieChartCanvas = $ ( '#sales-chart-canvas' ) . get ( 0 ) . getContext ( '2d' )
174- var pieData = {
177+ var pieData = {
175178 labels : [
176- 'Instore Sales' ,
177- 'Download Sales' ,
178- 'Mail-Order Sales' ,
179+ 'Instore Sales' ,
180+ 'Download Sales' ,
181+ 'Mail-Order Sales'
179182 ] ,
180183 datasets : [
181184 {
182- data : [ 30 , 12 , 20 ] ,
183- backgroundColor : [ '#f56954' , '#00a65a' , '#f39c12' ] ,
185+ data : [ 30 , 12 , 20 ] ,
186+ backgroundColor : [ '#f56954' , '#00a65a' , '#f39c12' ]
184187 }
185188 ]
186189 }
187190 var pieOptions = {
188191 legend : {
189192 display : false
190193 } ,
191- maintainAspectRatio : false ,
192- responsive : true ,
194+ maintainAspectRatio : false ,
195+ responsive : true
193196 }
194- //Create pie or douhnut chart
197+ // Create pie or douhnut chart
195198 // You can switch between pie and douhnut using the method below.
196- var pieChart = new Chart ( pieChartCanvas , {
199+ // eslint-disable-next-line no-unused-vars
200+ var pieChart = new Chart ( pieChartCanvas , { // lgtm[js/unused-local-variable]
197201 type : 'doughnut' ,
198202 data : pieData ,
199- options : pieOptions
200- } ) ;
203+ options : pieOptions
204+ } )
201205
202206 // Sales graph chart
203- var salesGraphChartCanvas = $ ( '#line-chart' ) . get ( 0 ) . getContext ( '2d' ) ;
204- //$('#revenue-chart').get(0).getContext('2d');
207+ var salesGraphChartCanvas = $ ( '#line-chart' ) . get ( 0 ) . getContext ( '2d' )
208+ // $('#revenue-chart').get(0).getContext('2d');
205209
206210 var salesGraphChartData = {
207- labels : [ '2011 Q1' , '2011 Q2' , '2011 Q3' , '2011 Q4' , '2012 Q1' , '2012 Q2' , '2012 Q3' , '2012 Q4' , '2013 Q1' , '2013 Q2' ] ,
211+ labels : [ '2011 Q1' , '2011 Q2' , '2011 Q3' , '2011 Q4' , '2012 Q1' , '2012 Q2' , '2012 Q3' , '2012 Q4' , '2013 Q1' , '2013 Q2' ] ,
208212 datasets : [
209213 {
210- label : 'Digital Goods' ,
211- fill : false ,
212- borderWidth : 2 ,
213- lineTension : 0 ,
214- spanGaps : true ,
215- borderColor : '#efefef' ,
216- pointRadius : 3 ,
217- pointHoverRadius : 7 ,
218- pointColor : '#efefef' ,
214+ label : 'Digital Goods' ,
215+ fill : false ,
216+ borderWidth : 2 ,
217+ lineTension : 0 ,
218+ spanGaps : true ,
219+ borderColor : '#efefef' ,
220+ pointRadius : 3 ,
221+ pointHoverRadius : 7 ,
222+ pointColor : '#efefef' ,
219223 pointBackgroundColor : '#efefef' ,
220- data : [ 2666 , 2778 , 4912 , 3767 , 6810 , 5670 , 4820 , 15073 , 10687 , 8432 ]
224+ data : [ 2666 , 2778 , 4912 , 3767 , 6810 , 5670 , 4820 , 15073 , 10687 , 8432 ]
221225 }
222226 ]
223227 }
224228
225229 var salesGraphChartOptions = {
226- maintainAspectRatio : false ,
227- responsive : true ,
230+ maintainAspectRatio : false ,
231+ responsive : true ,
228232 legend : {
229- display : false ,
233+ display : false
230234 } ,
231235 scales : {
232236 xAxes : [ {
233- ticks : {
234- fontColor : '#efefef' ,
237+ ticks : {
238+ fontColor : '#efefef'
235239 } ,
236- gridLines : {
237- display : false ,
240+ gridLines : {
241+ display : false ,
238242 color : '#efefef' ,
239- drawBorder : false ,
243+ drawBorder : false
240244 }
241245 } ] ,
242246 yAxes : [ {
243- ticks : {
247+ ticks : {
244248 stepSize : 5000 ,
245- fontColor : '#efefef' ,
249+ fontColor : '#efefef'
246250 } ,
247- gridLines : {
248- display : true ,
251+ gridLines : {
252+ display : true ,
249253 color : '#efefef' ,
250- drawBorder : false ,
254+ drawBorder : false
251255 }
252256 } ]
253257 }
254258 }
255259
256260 // This will get the first returned node in the jQuery collection.
257- var salesGraphChart = new Chart ( salesGraphChartCanvas , {
258- type : 'line' ,
259- data : salesGraphChartData ,
260- options : salesGraphChartOptions
261- }
262- )
263-
261+ // eslint-disable-next-line no-unused-vars
262+ var salesGraphChart = new Chart ( salesGraphChartCanvas , { // lgtm[js/unused-local-variable]
263+ type : 'line' ,
264+ data : salesGraphChartData ,
265+ options : salesGraphChartOptions
266+ } )
264267} )
0 commit comments