2 * Author: Abdullah A Almsaeed
5 * This is a demo file used only for the main dashboard (index.html)
12 //Make the dashboard widgets sortable Using jquery UI
13 $(".connectedSortable").sortable({
14 placeholder: "sort-highlight",
15 connectWith: ".connectedSortable",
16 handle: ".box-header, .nav-tabs",
17 forcePlaceholderSize: true,
20 $(".connectedSortable .box-header, .connectedSortable .nav-tabs-custom").css("cursor", "move");
22 //jQuery UI sortable for the todo list
23 $(".todo-list").sortable({
24 placeholder: "sort-highlight",
26 forcePlaceholderSize: true,
30 //bootstrap WYSIHTML5 - text editor
31 $(".textarea").wysihtml5();
33 $('.daterange').daterangepicker({
35 'Today': [moment(), moment()],
36 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
37 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
38 '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')]
42 startDate: moment().subtract(29, 'days'),
44 }, function (start, end) {
45 window.alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
54 "SA": 400, //Saudi Arabia
59 "AU": 700, //Australia
62 "GB": 320, //Great Britain
65 //World map by jvectormap
66 $('#world-map').vectorMap({
68 backgroundColor: "transparent",
81 scale: ["#92c1dc", "#ebf4f9"],
82 normalizeFunction: 'polynomial'
85 onRegionLabelShow: function (e, el, code) {
86 if (typeof visitorsData[code] != "undefined")
87 el.html(el.html() + ': ' + visitorsData[code] + ' new visitors');
92 var myvalues = [1000, 1200, 920, 927, 931, 1027, 819, 930, 1021];
93 $('#sparkline-1').sparkline(myvalues, {
100 myvalues = [515, 519, 520, 522, 652, 810, 370, 627, 319, 630, 921];
101 $('#sparkline-2').sparkline(myvalues, {
103 lineColor: '#92c1dc',
104 fillColor: "#ebf4f9",
108 myvalues = [15, 19, 20, 22, 33, 27, 31, 27, 19, 30, 21];
109 $('#sparkline-3').sparkline(myvalues, {
111 lineColor: '#92c1dc',
112 fillColor: "#ebf4f9",
118 $("#calendar").datepicker();
120 //SLIMSCROLL FOR CHAT WIDGET
121 $('#chat-box').slimScroll({
125 /* Morris.js Charts */
127 var area = new Morris.Area({
128 element: 'revenue-chart',
131 {y: '2011 Q1', item1: 2666, item2: 2666},
132 {y: '2011 Q2', item1: 2778, item2: 2294},
133 {y: '2011 Q3', item1: 4912, item2: 1969},
134 {y: '2011 Q4', item1: 3767, item2: 3597},
135 {y: '2012 Q1', item1: 6810, item2: 1914},
136 {y: '2012 Q2', item1: 5670, item2: 4293},
137 {y: '2012 Q3', item1: 4820, item2: 3795},
138 {y: '2012 Q4', item1: 15073, item2: 5967},
139 {y: '2013 Q1', item1: 10687, item2: 4460},
140 {y: '2013 Q2', item1: 8432, item2: 5713}
143 ykeys: ['item1', 'item2'],
144 labels: ['Item 1', 'Item 2'],
145 lineColors: ['#a0d0e0', '#3c8dbc'],
148 var line = new Morris.Line({
149 element: 'line-chart',
152 {y: '2011 Q1', item1: 2666},
153 {y: '2011 Q2', item1: 2778},
154 {y: '2011 Q3', item1: 4912},
155 {y: '2011 Q4', item1: 3767},
156 {y: '2012 Q1', item1: 6810},
157 {y: '2012 Q2', item1: 5670},
158 {y: '2012 Q3', item1: 4820},
159 {y: '2012 Q4', item1: 15073},
160 {y: '2013 Q1', item1: 10687},
161 {y: '2013 Q2', item1: 8432}
166 lineColors: ['#efefef'],
169 gridTextColor: "#fff",
170 gridStrokeWidth: 0.4,
172 pointStrokeColors: ["#efefef"],
173 gridLineColor: "#efefef",
174 gridTextFamily: "Open Sans",
179 var donut = new Morris.Donut({
180 element: 'sales-chart',
182 colors: ["#3c8dbc", "#f56954", "#00a65a"],
184 {label: "Download Sales", value: 12},
185 {label: "In-Store Sales", value: 30},
186 {label: "Mail-Order Sales", value: 20}
191 //Fix for charts under tabs
192 $('.box ul.nav a').on('shown.bs.tab', function () {
198 /* The todo list plugin */
199 $(".todo-list").todolist({
200 onCheck: function (ele) {
201 window.console.log("The element has been checked");
204 onUncheck: function (ele) {
205 window.console.log("The element has been unchecked");