home *** CD-ROM | disk | FTP | other *** search
/ 74.208.221.89 / 74.208.221.89.zip / 74.208.221.89 / manage / bottomscripts.ascx < prev    next >
Text File  |  2015-03-09  |  21KB  |  633 lines

  1. ∩╗┐ <!-- PACE LOADER - turn this on if you want ajax loading to show (caution: uses lots of memory on iDevices)-->
  2. <script data-pace-options='{ "restartOnRequestAfter": true }' src="js/plugin/pace/pace.min.js"></script>
  3.  
  4. <!-- Link to Google CDN's jQuery + jQueryUI; fall back to local -->
  5. <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
  6. <script>
  7.     if (!window.jQuery) {
  8.         document.write('<script src="js/libs/jquery-2.0.2.min.js"><\/script>');
  9.     }
  10. </script>
  11.  
  12. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
  13. <script>
  14.     if (!window.jQuery.ui) {
  15.         document.write('<script src="js/libs/jquery-ui-1.10.3.min.js"><\/script>');
  16.     }
  17. </script>
  18.  
  19. <!-- IMPORTANT: APP CONFIG -->
  20. <script src="js/app.config.js"></script>
  21.  
  22. <!-- JS TOUCH : include this plugin for mobile drag / drop touch events-->
  23. <script src="js/plugin/jquery-touch/jquery.ui.touch-punch.min.js"></script>
  24.  
  25. <!-- BOOTSTRAP JS -->
  26. <script src="js/bootstrap/bootstrap.min.js"></script>
  27.  
  28. <!-- CUSTOM NOTIFICATION -->
  29. <script src="js/notification/SmartNotification.min.js"></script>
  30.  
  31. <!-- JARVIS WIDGETS -->
  32. <script src="js/smartwidgets/jarvis.widget.min.js"></script>
  33.  
  34. <!-- EASY PIE CHARTS -->
  35. <script src="js/plugin/easy-pie-chart/jquery.easy-pie-chart.min.js"></script>
  36.  
  37. <!-- SPARKLINES -->
  38. <script src="js/plugin/sparkline/jquery.sparkline.min.js"></script>
  39.  
  40. <!-- JQUERY VALIDATE -->
  41. <script src="js/plugin/jquery-validate/jquery.validate.min.js"></script>
  42.  
  43. <!-- JQUERY MASKED INPUT -->
  44. <script src="js/plugin/masked-input/jquery.maskedinput.min.js"></script>
  45.  
  46. <!-- JQUERY SELECT2 INPUT -->
  47. <script src="js/plugin/select2/select2.min.js"></script>
  48.  
  49. <!-- JQUERY UI + Bootstrap Slider -->
  50. <script src="js/plugin/bootstrap-slider/bootstrap-slider.min.js"></script>
  51.  
  52. <!-- browser msie issue fix -->
  53. <script src="js/plugin/msie-fix/jquery.mb.browser.min.js"></script>
  54.  
  55. <!-- FastClick: For mobile devices -->
  56. <script src="js/plugin/fastclick/fastclick.min.js"></script>
  57.  
  58. <!--[if IE 8]>
  59.  
  60. <h1>Your browser is out of date, please update your browser by going to www.microsoft.com/download</h1>
  61.  
  62. <![endif]-->
  63. <!-- Demo purpose only -->
  64.  
  65. <!-- MAIN APP JS FILE -->
  66. <script src="js/app.min.js"></script>
  67.  
  68. <!-- ENHANCEMENT PLUGINS : NOT A REQUIREMENT -->
  69. <!-- Voice command : plugin -->
  70.  
  71. <!-- PAGE RELATED PLUGIN(S) -->
  72. <!-- Flot Chart Plugin: Flot Engine, Flot Resizer, Flot Tooltip -->
  73. <script src="js/plugin/flot/jquery.flot.cust.min.js"></script>
  74. <script src="js/plugin/flot/jquery.flot.resize.min.js"></script>
  75. <script src="js/plugin/flot/jquery.flot.tooltip.min.js"></script>
  76.  
  77.  
  78. <!-- Full Calendar -->
  79. <script src="js/plugin/fullcalendar/jquery.fullcalendar.min.js"></script>
  80.  
  81. <script>
  82.     $(document).ready(function () {
  83.  
  84.         // DO NOT REMOVE : GLOBAL FUNCTIONS!
  85.         pageSetUp();
  86.  
  87.         /*
  88.          * PAGE RELATED SCRIPTS
  89.          */
  90.  
  91.         $(".js-status-update a").click(function () {
  92.             var selText = $(this).text();
  93.             var $this = $(this);
  94.             $this.parents('.btn-group').find('.dropdown-toggle').html(selText + ' <span class="caret"></span>');
  95.             $this.parents('.dropdown-menu').find('li').removeClass('active');
  96.             $this.parent().addClass('active');
  97.         });
  98.  
  99.         /*
  100.         * TODO: add a way to add more todo's to list
  101.         */
  102.  
  103.         // initialize sortable
  104.         $(function () {
  105.             $("#sortable1, #sortable2").sortable({
  106.                 handle: '.handle',
  107.                 connectWith: ".todo",
  108.                 update: countTasks
  109.             }).disableSelection();
  110.         });
  111.  
  112.         // check and uncheck
  113.         $('.todo .checkbox > input[type="checkbox"]').click(function () {
  114.             var $this = $(this).parent().parent().parent();
  115.  
  116.             if ($(this).prop('checked')) {
  117.                 $this.addClass("complete");
  118.  
  119.                 // remove this if you want to undo a check list once checked
  120.                 //$(this).attr("disabled", true);
  121.                 $(this).parent().hide();
  122.  
  123.                 // once clicked - add class, copy to memory then remove and add to sortable3
  124.                 $this.slideUp(500, function () {
  125.                     $this.clone().prependTo("#sortable3").effect("highlight", {}, 800);
  126.                     $this.remove();
  127.                     countTasks();
  128.                 });
  129.             } else {
  130.                 // insert undo code here...
  131.             }
  132.  
  133.         })
  134.         // count tasks
  135.         function countTasks() {
  136.  
  137.             $('.todo-group-title').each(function () {
  138.                 var $this = $(this);
  139.                 $this.find(".num-of-tasks").text($this.next().find("li").size());
  140.             });
  141.  
  142.         }
  143.  
  144.         /*
  145.         * RUN PAGE GRAPHS
  146.         */
  147.  
  148.         /* TAB 1: UPDATING CHART */
  149.         // For the demo we use generated data, but normally it would be coming from the server
  150.  
  151.         var data = [], totalPoints = 200, $UpdatingChartColors = $("#updating-chart").css('color');
  152.  
  153.         function getRandomData() {
  154.             if (data.length > 0)
  155.                 data = data.slice(1);
  156.  
  157.             // do a random walk
  158.             while (data.length < totalPoints) {
  159.                 var prev = data.length > 0 ? data[data.length - 1] : 50;
  160.                 var y = prev + Math.random() * 10 - 5;
  161.                 if (y < 0)
  162.                     y = 0;
  163.                 if (y > 100)
  164.                     y = 100;
  165.                 data.push(y);
  166.             }
  167.  
  168.             // zip the generated y values with the x values
  169.             var res = [];
  170.             for (var i = 0; i < data.length; ++i)
  171.                 res.push([i, data[i]])
  172.             return res;
  173.         }
  174.  
  175.         // setup control widget
  176.         var updateInterval = 1500;
  177.         $("#updating-chart").val(updateInterval).change(function () {
  178.  
  179.             var v = $(this).val();
  180.             if (v && !isNaN(+v)) {
  181.                 updateInterval = +v;
  182.                 $(this).val("" + updateInterval);
  183.             }
  184.  
  185.         });
  186.  
  187.         // setup plot
  188.         var options = {
  189.             yaxis: {
  190.                 min: 0,
  191.                 max: 100
  192.             },
  193.             xaxis: {
  194.                 min: 0,
  195.                 max: 100
  196.             },
  197.             colors: [$UpdatingChartColors],
  198.             series: {
  199.                 lines: {
  200.                     lineWidth: 1,
  201.                     fill: true,
  202.                     fillColor: {
  203.                         colors: [{
  204.                             opacity: 0.4
  205.                         }, {
  206.                             opacity: 0
  207.                         }]
  208.                     },
  209.                     steps: false
  210.  
  211.                 }
  212.             }
  213.         };
  214.  
  215.         var plot = $.plot($("#updating-chart"), [getRandomData()], options);
  216.  
  217.         /* live switch */
  218.         $('input[type="checkbox"]#start_interval').click(function () {
  219.             if ($(this).prop('checked')) {
  220.                 $on = true;
  221.                 updateInterval = 1500;
  222.                 update();
  223.             } else {
  224.                 clearInterval(updateInterval);
  225.                 $on = false;
  226.             }
  227.         });
  228.  
  229.         function update() {
  230.             if ($on == true) {
  231.                 plot.setData([getRandomData()]);
  232.                 plot.draw();
  233.                 setTimeout(update, updateInterval);
  234.  
  235.             } else {
  236.                 clearInterval(updateInterval)
  237.             }
  238.  
  239.         }
  240.  
  241.         var $on = false;
  242.  
  243.         /*end updating chart*/
  244.  
  245.         /* TAB 2: Social Network  */
  246.  
  247.         $(function () {
  248.             // jQuery Flot Chart
  249.             var twitter = [[1, 27], [2, 34], [3, 51], [4, 48], [5, 55], [6, 65], [7, 61], [8, 70], [9, 65], [10, 75], [11, 57], [12, 59], [13, 62]], facebook = [[1, 25], [2, 31], [3, 45], [4, 37], [5, 38], [6, 40], [7, 47], [8, 55], [9, 43], [10, 50], [11, 47], [12, 39], [13, 47]], data = [{
  250.                 label: "Twitter",
  251.                 data: twitter,
  252.                 lines: {
  253.                     show: true,
  254.                     lineWidth: 1,
  255.                     fill: true,
  256.                     fillColor: {
  257.                         colors: [{
  258.                             opacity: 0.1
  259.                         }, {
  260.                             opacity: 0.13
  261.                         }]
  262.                     }
  263.                 },
  264.                 points: {
  265.                     show: true
  266.                 }
  267.             }, {
  268.                 label: "Facebook",
  269.                 data: facebook,
  270.                 lines: {
  271.                     show: true,
  272.                     lineWidth: 1,
  273.                     fill: true,
  274.                     fillColor: {
  275.                         colors: [{
  276.                             opacity: 0.1
  277.                         }, {
  278.                             opacity: 0.13
  279.                         }]
  280.                     }
  281.                 },
  282.                 points: {
  283.                     show: true
  284.                 }
  285.             }];
  286.  
  287.             var options = {
  288.                 grid: {
  289.                     hoverable: true
  290.                 },
  291.                 colors: ["#568A89", "#3276B1"],
  292.                 tooltip: true,
  293.                 tooltipOpts: {
  294.                     //content : "Value <b>$x</b> Value <span>$y</span>",
  295.                     defaultTheme: false
  296.                 },
  297.                 xaxis: {
  298.                     ticks: [[1, "JAN"], [2, "FEB"], [3, "MAR"], [4, "APR"], [5, "MAY"], [6, "JUN"], [7, "JUL"], [8, "AUG"], [9, "SEP"], [10, "OCT"], [11, "NOV"], [12, "DEC"], [13, "JAN+1"]]
  299.                 },
  300.                 yaxes: {
  301.  
  302.                 }
  303.             };
  304.  
  305.             var plot3 = $.plot($("#statsChart"), data, options);
  306.         });
  307.  
  308.         // END TAB 2
  309.  
  310.         // TAB THREE GRAPH //
  311.         /* TAB 3: Revenew  */
  312.  
  313.         $(function () {
  314.  
  315.             var trgt = [[1354586000000, 153], [1364587000000, 658], [1374588000000, 198], [1384589000000, 663], [1394590000000, 801], [1404591000000, 1080], [1414592000000, 353], [1424593000000, 749], [1434594000000, 523], [1444595000000, 258], [1454596000000, 688], [1464597000000, 364]], prft = [[1354586000000, 53], [1364587000000, 65], [1374588000000, 98], [1384589000000, 83], [1394590000000, 980], [1404591000000, 808], [1414592000000, 720], [1424593000000, 674], [1434594000000, 23], [1444595000000, 79], [1454596000000, 88], [1464597000000, 36]], sgnups = [[1354586000000, 647], [1364587000000, 435], [1374588000000, 784], [1384589000000, 346], [1394590000000, 487], [1404591000000, 463], [1414592000000, 479], [1424593000000, 236], [1434594000000, 843], [1444595000000, 657], [1454596000000, 241], [1464597000000, 341]], toggles = $("#rev-toggles"), target = $("#flotcontainer");
  316.  
  317.             var data = [{
  318.                 label: "Target Profit",
  319.                 data: trgt,
  320.                 bars: {
  321.                     show: true,
  322.                     align: "center",
  323.                     barWidth: 30 * 30 * 60 * 1000 * 80
  324.                 }
  325.             }, {
  326.                 label: "Actual Profit",
  327.                 data: prft,
  328.                 color: '#3276B1',
  329.                 lines: {
  330.                     show: true,
  331.                     lineWidth: 3
  332.                 },
  333.                 points: {
  334.                     show: true
  335.                 }
  336.             }, {
  337.                 label: "Actual Signups",
  338.                 data: sgnups,
  339.                 color: '#71843F',
  340.                 lines: {
  341.                     show: true,
  342.                     lineWidth: 1
  343.                 },
  344.                 points: {
  345.                     show: true
  346.                 }
  347.             }]
  348.  
  349.             var options = {
  350.                 grid: {
  351.                     hoverable: true
  352.                 },
  353.                 tooltip: true,
  354.                 tooltipOpts: {
  355.                     //content: '%x - %y',
  356.                     //dateFormat: '%b %y',
  357.                     defaultTheme: false
  358.                 },
  359.                 xaxis: {
  360.                     mode: "time"
  361.                 },
  362.                 yaxes: {
  363.                     tickFormatter: function (val, axis) {
  364.                         return "$" + val;
  365.                     },
  366.                     max: 1200
  367.                 }
  368.  
  369.             };
  370.  
  371.             plot2 = null;
  372.  
  373.             function plotNow() {
  374.                 var d = [];
  375.                 toggles.find(':checkbox').each(function () {
  376.                     if ($(this).is(':checked')) {
  377.                         d.push(data[$(this).attr("name").substr(4, 1)]);
  378.                     }
  379.                 });
  380.                 if (d.length > 0) {
  381.                     if (plot2) {
  382.                         plot2.setData(d);
  383.                         plot2.draw();
  384.                     } else {
  385.                         plot2 = $.plot(target, d, options);
  386.                     }
  387.                 }
  388.  
  389.             };
  390.  
  391.             toggles.find(':checkbox').on('change', function () {
  392.                 plotNow();
  393.             });
  394.             plotNow()
  395.  
  396.         });
  397.  
  398.         /*
  399.          * VECTOR MAP
  400.          */
  401.  
  402.         data_array = {
  403.             "US": 4977,
  404.             "AU": 4873,
  405.             "IN": 3671,
  406.             "BR": 2476,
  407.             "TR": 1476,
  408.             "CN": 146,
  409.             "CA": 134,
  410.             "BD": 100
  411.         };
  412.  
  413.         $('#vector-map').vectorMap({
  414.             map: 'world_mill_en',
  415.             backgroundColor: '#fff',
  416.             regionStyle: {
  417.                 initial: {
  418.                     fill: '#c4c4c4'
  419.                 },
  420.                 hover: {
  421.                     "fill-opacity": 1
  422.                 }
  423.             },
  424.             series: {
  425.                 regions: [{
  426.                     values: data_array,
  427.                     scale: ['#85a8b6', '#4d7686'],
  428.                     normalizeFunction: 'polynomial'
  429.                 }]
  430.             },
  431.             onRegionLabelShow: function (e, el, code) {
  432.                 if (typeof data_array[code] == 'undefined') {
  433.                     e.preventDefault();
  434.                 } else {
  435.                     var countrylbl = data_array[code];
  436.                     el.html(el.html() + ': ' + countrylbl + ' visits');
  437.                 }
  438.             }
  439.         });
  440.  
  441.         /*
  442.          * FULL CALENDAR JS
  443.          */
  444.  
  445.         if ($("#calendar").length) {
  446.             var date = new Date();
  447.             var d = date.getDate();
  448.             var m = date.getMonth();
  449.             var y = date.getFullYear();
  450.  
  451.             var calendar = $('#calendar').fullCalendar({
  452.  
  453.                 editable: true,
  454.                 draggable: true,
  455.                 selectable: false,
  456.                 selectHelper: true,
  457.                 unselectAuto: false,
  458.                 disableResizing: false,
  459.  
  460.                 header: {
  461.                     left: 'title', //,today
  462.                     center: 'prev, next, today',
  463.                     right: 'month, agendaWeek, agenDay' //month, agendaDay,
  464.                 },
  465.  
  466.                 select: function (start, end, allDay) {
  467.                     var title = prompt('Event Title:');
  468.                     if (title) {
  469.                         calendar.fullCalendar('renderEvent', {
  470.                             title: title,
  471.                             start: start,
  472.                             end: end,
  473.                             allDay: allDay
  474.                         }, true // make the event "stick"
  475.                         );
  476.                     }
  477.                     calendar.fullCalendar('unselect');
  478.                 },
  479.  
  480.                 events: [{
  481.                     title: 'All Day Event',
  482.                     start: new Date(y, m, 1),
  483.                     description: 'long description',
  484.                     className: ["event", "bg-color-greenLight"],
  485.                     icon: 'fa-check'
  486.                 }, {
  487.                     title: 'Long Event',
  488.                     start: new Date(y, m, d - 5),
  489.                     end: new Date(y, m, d - 2),
  490.                     className: ["event", "bg-color-red"],
  491.                     icon: 'fa-lock'
  492.                 }, {
  493.                     id: 999,
  494.                     title: 'Repeating Event',
  495.                     start: new Date(y, m, d - 3, 16, 0),
  496.                     allDay: false,
  497.                     className: ["event", "bg-color-blue"],
  498.                     icon: 'fa-clock-o'
  499.                 }, {
  500.                     id: 999,
  501.                     title: 'Repeating Event',
  502.                     start: new Date(y, m, d + 4, 16, 0),
  503.                     allDay: false,
  504.                     className: ["event", "bg-color-blue"],
  505.                     icon: 'fa-clock-o'
  506.                 }, {
  507.                     title: 'Meeting',
  508.                     start: new Date(y, m, d, 10, 30),
  509.                     allDay: false,
  510.                     className: ["event", "bg-color-darken"]
  511.                 }, {
  512.                     title: 'Lunch',
  513.                     start: new Date(y, m, d, 12, 0),
  514.                     end: new Date(y, m, d, 14, 0),
  515.                     allDay: false,
  516.                     className: ["event", "bg-color-darken"]
  517.                 }, {
  518.                     title: 'Birthday Party',
  519.                     start: new Date(y, m, d + 1, 19, 0),
  520.                     end: new Date(y, m, d + 1, 22, 30),
  521.                     allDay: false,
  522.                     className: ["event", "bg-color-darken"]
  523.                 }, {
  524.                     title: 'Smartadmin Open Day',
  525.                     start: new Date(y, m, 28),
  526.                     end: new Date(y, m, 29),
  527.                     className: ["event", "bg-color-darken"]
  528.                 }],
  529.  
  530.                 eventRender: function (event, element, icon) {
  531.                     if (!event.description == "") {
  532.                         element.find('.fc-event-title').append("<br/><span class='ultra-light'>" + event.description + "</span>");
  533.                     }
  534.                     if (!event.icon == "") {
  535.                         element.find('.fc-event-title').append("<i class='air air-top-right fa " + event.icon + " '></i>");
  536.                     }
  537.                 }
  538.             });
  539.  
  540.         };
  541.  
  542.         /* hide default buttons */
  543.         $('.fc-header-right, .fc-header-center').hide();
  544.  
  545.         // calendar prev
  546.         $('#calendar-buttons #btn-prev').click(function () {
  547.             $('.fc-button-prev').click();
  548.             return false;
  549.         });
  550.  
  551.         // calendar next
  552.         $('#calendar-buttons #btn-next').click(function () {
  553.             $('.fc-button-next').click();
  554.             return false;
  555.         });
  556.  
  557.         // calendar today
  558.         $('#calendar-buttons #btn-today').click(function () {
  559.             $('.fc-button-today').click();
  560.             return false;
  561.         });
  562.  
  563.         // calendar month
  564.         $('#mt').click(function () {
  565.             $('#calendar').fullCalendar('changeView', 'month');
  566.         });
  567.  
  568.         // calendar agenda week
  569.         $('#ag').click(function () {
  570.             $('#calendar').fullCalendar('changeView', 'agendaWeek');
  571.         });
  572.  
  573.         // calendar agenda day
  574.         $('#td').click(function () {
  575.             $('#calendar').fullCalendar('changeView', 'agendaDay');
  576.         });
  577.  
  578.         /*
  579.          * CHAT
  580.          */
  581.  
  582.         $.filter_input = $('#filter-chat-list');
  583.         $.chat_users_container = $('#chat-container > .chat-list-body')
  584.         $.chat_users = $('#chat-users')
  585.         $.chat_list_btn = $('#chat-container > .chat-list-open-close');
  586.         $.chat_body = $('#chat-body');
  587.  
  588.         /*
  589.         * LIST FILTER (CHAT)
  590.         */
  591.  
  592.         // custom css expression for a case-insensitive contains()
  593.         jQuery.expr[':'].Contains = function (a, i, m) {
  594.             return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
  595.         };
  596.  
  597.         function listFilter(list) {// header is any element, list is an unordered list
  598.             // create and add the filter form to the header
  599.  
  600.             $.filter_input.change(function () {
  601.                 var filter = $(this).val();
  602.                 if (filter) {
  603.                     // this finds all links in a list that contain the input,
  604.                     // and hide the ones not containing the input while showing the ones that do
  605.                     $.chat_users.find("a:not(:Contains(" + filter + "))").parent().slideUp();
  606.                     $.chat_users.find("a:Contains(" + filter + ")").parent().slideDown();
  607.                 } else {
  608.                     $.chat_users.find("li").slideDown();
  609.                 }
  610.                 return false;
  611.             }).keyup(function () {
  612.                 // fire the above change event after every letter
  613.                 $(this).change();
  614.  
  615.             });
  616.  
  617.         }
  618.  
  619.         // on dom ready
  620.         listFilter($.chat_users);
  621.  
  622.         // open chat list
  623.         $.chat_list_btn.click(function () {
  624.             $(this).parent('#chat-container').toggleClass('open');
  625.         })
  626.  
  627.         $.chat_body.animate({
  628.             scrollTop: $.chat_body[0].scrollHeight
  629.         }, 500);
  630.  
  631.     });
  632.  
  633. </script>