dashboard.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Author: Abdullah A Almsaeed
  3. * Date: 4 Jan 2014
  4. * Description:
  5. * This is a demo file used only for the main dashboard (index.html)
  6. **/
  7. "use strict";
  8. $(function () {
  9. //Make the dashboard widgets sortable Using jquery UI
  10. $(".connectedSortable").sortable({
  11. placeholder: "sort-highlight",
  12. connectWith: ".connectedSortable",
  13. handle: ".box-header, .nav-tabs",
  14. forcePlaceholderSize: true,
  15. zIndex: 999999
  16. });
  17. $(".connectedSortable .box-header, .connectedSortable .nav-tabs-custom").css("cursor", "move");
  18. //jQuery UI sortable for the todo list
  19. $(".todo-list").sortable({
  20. placeholder: "sort-highlight",
  21. handle: ".handle",
  22. forcePlaceholderSize: true,
  23. zIndex: 999999
  24. });
  25. //bootstrap WYSIHTML5 - text editor
  26. $(".textarea").wysihtml5();
  27. $('.daterange').daterangepicker(
  28. {
  29. ranges: {
  30. 'Today': [moment(), moment()],
  31. 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
  32. 'Last 7 Days': [moment().subtract('days', 6), moment()],
  33. 'Last 30 Days': [moment().subtract('days', 29), moment()],
  34. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  35. 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
  36. },
  37. startDate: moment().subtract('days', 29),
  38. endDate: moment()
  39. },
  40. function (start, end) {
  41. alert("You chose: " + start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  42. });
  43. //The Calender
  44. $("#calendar").datepicker();
  45. //SLIMSCROLL FOR CHAT WIDGET
  46. $('#chat-box').slimScroll({
  47. height: '250px'
  48. });
  49. /* The todo list plugin */
  50. $(".todo-list").todolist({
  51. onCheck: function (ele) {
  52. console.log("The element has been checked")
  53. },
  54. onUncheck: function (ele) {
  55. console.log("The element has been unchecked")
  56. }
  57. });
  58. });