PageSourceSearch

https://wcfappeals.kazi.go.tz/material/js/material-dashboard.js?v=2.1.0

js kazi.go.tz collected 2026-10-02 19:02:51 UTC 21,847 bytes, 820 lines download raw bytes

1/*!
2
3 =========================================================
4 * Material Dashboard PRO - v2.1.0
5 =========================================================
6
7 * Product Page: https://www.creative-tim.com/product/material-dashboard-pro-laravel
8 * Copyright 2018 Creative Tim (http://www.creative-tim.com) & UPDIVISION (http://www.updivision.com)
9
10 * Designed by www.invisionapp.com Coded by www.creative-tim.com & www.updivision.com
11
12 =========================================================
13
14 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15
16 */
17
18(function() {
19  isWindows = navigator.platform.indexOf('Win') > -1 ? true : false;
20
21  if (isWindows) {
22    // if we are on windows OS we activate the perfectScrollbar function
23    $('.sidebar .sidebar-wrapper, .main-panel').perfectScrollbar();
24
25    $('html').addClass('perfect-scrollbar-on');
26  } else {
27    $('html').addClass('perfect-scrollbar-off');
28  }
29})();
30
31
32var breakCards = true;
33
34var searchVisible = 0;
35var transparent = true;
36
37var transparentDemo = true;
38var fixedTop = false;
39
40var mobile_menu_visible = 0,
41  mobile_menu_initialized = false,
42  toggle_initialized = false,
43  bootstrap_nav_initialized = false;
44
45var seq = 0,
46  delays = 80,
47  durations = 500;
48var seq2 = 0,
49  delays2 = 80,
50  durations2 = 500;
51
52$(document).ready(function() {
53  $sidebar = $('.sidebar');
54  window_width = $(window).width();
55
56  $('body').bootstrapMaterialDesign({
57    autofill: false
58  });
59
60  md.initSidebarsCheck();
61
62  window_width = $(window).width();
63
64  // check if there is an image set for the sidebar's background
65  md.checkSidebarImage();
66
67  md.initMinimizeSidebar();
68
69  // Multilevel Dropdown menu
70
71  $('.dropdown-menu a.dropdown-toggle').on('click', function(e) {
72    var $el = $(this);
73    var $parent = $(this).offsetParent(".dropdown-menu");
74    if (!$(this).next().hasClass('show')) {
75      $(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
76    }
77    var $subMenu = $(this).next(".dropdown-menu");
78    $subMenu.toggleClass('show');
79
80    $(this).closest("a").toggleClass('open');
81
82    $(this).parents('a.dropdown-item.dropdown.show').on('hidden.bs.dropdown', function(e) {
83      $('.dropdown-menu .show').removeClass("show");
84    });
85
86    if (!$parent.parent().hasClass('navbar-nav')) {
87      $el.next().css({
88        "top": $el[0].offsetTop,
89        "left": $parent.outerWidth() - 4
90      });
91    }
92
93    return false;
94  });
95
96
97  //   Activate bootstrap-select
98  if ($(".selectpicker").length != 0) {
99    $(".selectpicker").selectpicker();
100  }
101
102  //  Activate the tooltips
103  $('[rel="tooltip"]').tooltip();
104
105  // Activate Popovers
106  $('[data-toggle="popover"]').popover();
107
108  //Activate tags
109  // we style the badges with our colors
110  var tagClass = $('.tagsinput').data('color');
111
112  if ($(".tagsinput").length != 0) {
113    $('.tagsinput').tagsinput();
114  }
115
116  $('.bootstrap-tagsinput').addClass('' + tagClass + '-badge');
117
118  //    Activate bootstrap-select
119  $(".select").dropdown({
120    "dropdownClass": "dropdown-menu",
121    "optionClass": ""
122  });
123
124  $('.form-control').on("focus", function() {
125    $(this).parent('.input-group').addClass("input-group-focus");
126  }).on("blur", function() {
127    $(this).parent(".input-group").removeClass("input-group-focus");
128  });
129
130
131  if (breakCards == true) {
132    // We break the cards headers if there is too much stress on them :-)
133    $('[data-header-animation="true"]').each(function() {
134      var $fix_button = $(this)
135      var $card = $(this).parent('.card');
136
137      $card.find('.fix-broken-card').click(function() {
138        console.log(this);
139        var $header = $(this).parent().parent().siblings('.card-header, .card-header-image');
140
141        $header.removeClass('hinge').addClass('fadeInDown');
142
143        $card.attr('data-count', 0);
144
145        setTimeout(function() {
146          $header.removeClass('fadeInDown animate');
147        }, 480);
148      });
149
150      $card.mouseenter(function() {
151        var $this = $(this);
152        hover_count = parseInt($this.attr('data-count'), 10) + 1 || 0;
153        $this.attr("data-count", hover_count);
154
155        if (hover_count >= 20) {
156          $(this).children('.card-header, .card-header-image').addClass('hinge animated');
157        }
158      });
159    });
160  }
161
162  // remove class has-error for checkbox validation
163  $('input[type="checkbox"][required="true"], input[type="radio"][required="true"]').on('click', function() {
164    if ($(this).hasClass('error')) {
165      $(this).closest('div').removeClass('has-error');
166    }
167  });
168
169});
170
171$(document).on('click', '.navbar-toggler', function() {
172  $toggle = $(this);
173
174  if (mobile_menu_visible == 1) {
175    $('html').removeClass('nav-open');
176
177    $('.close-layer').remove();
178    setTimeout(function() {
179      $toggle.removeClass('toggled');
180    }, 400);
181
182    mobile_menu_visible = 0;
183  } else {
184    setTimeout(function() {
185      $toggle.addClass('toggled');
186    }, 430);
187
188    var $layer = $('<div class="close-layer"></div>');
189
190    if ($('body').find('.main-panel').length != 0) {
191      $layer.appendTo(".main-panel");
192
193    } else if (($('body').hasClass('off-canvas-sidebar'))) {
194      $layer.appendTo(".wrapper-full-page");
195    }
196
197    setTimeout(function() {
198      $layer.addClass('visible');
199    }, 100);
200
201    $layer.click(function() {
202      $('html').removeClass('nav-open');
203      mobile_menu_visible = 0;
204
205      $layer.removeClass('visible');
206
207      setTimeout(function() {
208        $layer.remove();
209        $toggle.removeClass('toggled');
210
211      }, 400);
212    });
213
214    $('html').addClass('nav-open');
215    mobile_menu_visible = 1;
216
217  }
218
219});
220
221// activate collapse right menu when the windows is resized
222$(window).resize(function() {
223  md.initSidebarsCheck();
224
225  // reset the seq for charts drawing animations
226  seq = seq2 = 0;
227
228  setTimeout(function() {
229    md.initDashboardPageCharts();
230  }, 500);
231});
232
233md = {
234  misc: {
235    navbar_menu_visible: 0,
236    active_collapse: true,
237    disabled_collapse_init: 0,
238  },
239
240  checkSidebarImage: function() {
241    $sidebar = $('.sidebar');
242    image_src = $sidebar.data('image');
243
244    if (image_src !== undefined) {
245      sidebar_container = '<div class="sidebar-background" style="background-image: url(' + image_src + ') "/>';
246      $sidebar.append(sidebar_container);
247    }
248  },
249
250  showNotification: function(from, align) {
251    type = ['', 'info', 'danger', 'success', 'warning', 'rose', 'primary'];
252
253    color = Math.floor((Math.random() * 6) + 1);
254
255    $.notify({
256      icon: "add_alert",
257      message: "Welcome to <b>Material Dashboard Pro</b> - a beautiful admin panel for every web developer."
258
259    }, {
260      type: type[color],
261      timer: 3000,
262      placement: {
263        from: from,
264        align: align
265      }
266    });
267  },
268
269  initDocumentationCharts: function() {
270    if ($('#dailySalesChart').length != 0 && $('#websiteViewsChart').length != 0) {
271      /* ----------==========     Daily Sales Chart initialization For Documentation    ==========---------- */
272
273      dataDailySalesChart = {
274        labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
275        series: [
276          [12, 17, 7, 17, 23, 18, 38]
277        ]
278      };
279
280      optionsDailySalesChart = {
281        lineSmooth: Chartist.Interpolation.cardinal({
282          tension: 0
283        }),
284        low: 0,
285        high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
286        chartPadding: {
287          top: 0,
288          right: 0,
289          bottom: 0,
290          left: 0
291        },
292      }
293
294      var dailySalesChart = new Chartist.Line('#dailySalesChart', dataDailySalesChart, optionsDailySalesChart);
295
296      var animationHeaderChart = new Chartist.Line('#websiteViewsChart', dataDailySalesChart, optionsDailySalesChart);
297    }
298  },
299
300
301  initFormExtendedDatetimepickers: function() {
302    $('.datetimepicker').datetimepicker({
303      icons: {
304        time: "fa fa-clock-o",
305        date: "fa fa-calendar",
306        up: "fa fa-chevron-up",
307        down: "fa fa-chevron-down",
308        previous: 'fa fa-chevron-left',
309        next: 'fa fa-chevron-right',
310        today: 'fa fa-screenshot',
311        clear: 'fa fa-trash',
312        close: 'fa fa-remove'
313      }
314    });
315
316    $('.datepicker').datetimepicker({
317      format: 'MM/DD/YYYY',
318
319      icons: {
320        time: "fa fa-clock-o",
321        date: "fa fa-calendar",
322        up: "fa fa-chevron-up",
323        down: "fa fa-chevron-down",
324        previous: 'fa fa-chevron-left',
325        next: 'fa fa-chevron-right',
326        today: 'fa fa-screenshot',
327        clear: 'fa fa-trash',
328        close: 'fa fa-remove',
329
330      },
331
332    });
333
334    $('.timepicker').datetimepicker({
335      //          format: 'H:mm',    // use this format if you want the 24hours timepicker
336      format: 'h:mm A', //use this format if you want the 12hours timpiecker with AM/PM toggle
337      icons: {
338        time: "fa fa-clock-o",
339        date: "fa fa-calendar",
340        up: "fa fa-chevron-up",
341        down: "fa fa-chevron-down",
342        previous: 'fa fa-chevron-left',
343        next: 'fa fa-chevron-right',
344        today: 'fa fa-screenshot',
345        clear: 'fa fa-trash',
346        close: 'fa fa-remove'
347
348      }
349    });
350  },
351
352
353  initSliders: function() {
354    // Sliders for demo purpose
355    var slider = document.getElementById('sliderRegular');
356
357    noUiSlider.create(slider, {
358      start: 40,
359      connect: [true, false],
360      range: {
361        min: 0,
362        max: 100
363      }
364    });
365
366    var slider2 = document.getElementById('sliderDouble');
367
368    noUiSlider.create(slider2, {
369      start: [20, 60],
370      connect: true,
371      range: {
372        min: 0,
373        max: 100
374      }
375    });
376  },
377
378  initSidebarsCheck: function() {
379    if ($(window).width() <= 991) {
380      if ($sidebar.length != 0) {
381        md.initRightMenu();
382      }
383    }
384  },
385
386  checkFullPageBackgroundImage: function() {
387    $page = $('.full-page');
388    image_src = $page.data('image');
389
390    if (image_src !== undefined) {
391      image_container = '<div class="full-page-background" style="background-image: url(' + image_src + ') "/>'
392      $page.append(image_container);
393    }
394  },
395
396  initDashboardPageCharts: function() {
397
398    if ($('#dailySalesChart').length != 0 || $('#completedTasksChart').length != 0 || $('#websiteViewsChart').length != 0) {
399      /* ----------==========     Daily Sales Chart initialization    ==========---------- */
400
401      dataDailySalesChart = {
402        labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
403        series: [
404          [12, 17, 7, 17, 23, 18, 38]
405        ]
406      };
407
408      optionsDailySalesChart = {
409        lineSmooth: Chartist.Interpolation.cardinal({
410          tension: 0
411        }),
412        low: 0,
413        high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
414        chartPadding: {
415          top: 0,
416          right: 0,
417          bottom: 0,
418          left: 0
419        },
420      }
421
422      var dailySalesChart = new Chartist.Line('#dailySalesChart', dataDailySalesChart, optionsDailySalesChart);
423
424      md.startAnimationForLineChart(dailySalesChart);
425
426
427
428      /* ----------==========     Completed Tasks Chart initialization    ==========---------- */
429
430      dataCompletedTasksChart = {
431        labels: ['12p', '3p', '6p', '9p', '12p', '3a', '6a', '9a'],
432        series: [
433          [230, 750, 450, 300, 280, 240, 200, 190]
434        ]
435      };
436
437      optionsCompletedTasksChart = {
438        lineSmooth: Chartist.Interpolation.cardinal({
439          tension: 0
440        }),
441        low: 0,
442        high: 1000, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
443        chartPadding: {
444          top: 0,
445          right: 0,
446          bottom: 0,
447          left: 0
448        }
449      }
450
451      var completedTasksChart = new Chartist.Line('#completedTasksChart', dataCompletedTasksChart, optionsCompletedTasksChart);
452
453      // start animation for the Completed Tasks Chart - Line Chart
454      md.startAnimationForLineChart(completedTasksChart);
455
456
457      /* ----------==========     Emails Subscription Chart initialization    ==========---------- */
458
459      var dataWebsiteViewsChart = {
460        labels: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
461        series: [
462          [542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]
463
464        ]
465      };
466      var optionsWebsiteViewsChart = {
467        axisX: {
468          showGrid: false
469        },
470        low: 0,
471        high: 1000,
472        chartPadding: {
473          top: 0,
474          right: 5,
475          bottom: 0,
476          left: 0
477        }
478      };
479      var responsiveOptions = [
480        ['screen and (max-width: 640px)', {
481          seriesBarDistance: 5,
482          axisX: {
483            labelInterpolationFnc: function(value) {
484              return value[0];
485            }
486          }
487        }]
488      ];
489      var websiteViewsChart = Chartist.Bar('#websiteViewsChart', dataWebsiteViewsChart, optionsWebsiteViewsChart, responsiveOptions);
490
491      //start animation for the Emails Subscription Chart
492      md.startAnimationForBarChart(websiteViewsChart);
493    }
494  },
495
496  initMinimizeSidebar: function() {
497
498    $('#minimizeSidebar').click(function() {
499      var $btn = $(this);
500
501      if (md.misc.sidebar_mini_active == true) {
502        $('body').removeClass('sidebar-mini');
503        md.misc.sidebar_mini_active = false;
504      } else {
505        $('body').addClass('sidebar-mini');
506        md.misc.sidebar_mini_active = true;
507      }
508
509      // we simulate the window Resize so the charts will get updated in realtime.
510      var simulateWindowResize = setInterval(function() {
511        window.dispatchEvent(new Event('resize'));
512      }, 180);
513
514      // we stop the simulation of Window Resize after the animations are completed
515      setTimeout(function() {
516        clearInterval(simulateWindowResize);
517      }, 1000);
518    });
519  },
520
521  checkScrollForTransparentNavbar: debounce(function() {
522    if ($(document).scrollTop() > 260) {
523      if (transparent) {
524        transparent = false;
525        $('.navbar-color-on-scroll').removeClass('navbar-transparent');
526      }
527    } else {
528      if (!transparent) {
529        transparent = true;
530        $('.navbar-color-on-scroll').addClass('navbar-transparent');
531      }
532    }
533  }, 17),
534
535
536  initRightMenu: debounce(function() {
537    $sidebar_wrapper = $('.sidebar-wrapper');
538
539    if (!mobile_menu_initialized) {
540      $navbar = $('nav').find('.navbar-collapse').children('.navbar-nav');
541
542      mobile_menu_content = '';
543
544      nav_content = $navbar.html();
545
546      nav_content = '<ul class="nav navbar-nav nav-mobile-menu">' + nav_content + '</ul>';
547
548      navbar_form = $('nav').find('.navbar-form').get(0).outerHTML;
549
550      $sidebar_nav = $sidebar_wrapper.find(' > .nav');
551
552      // insert the navbar form before the sidebar list
553      $nav_content = $(nav_content);
554      $navbar_form = $(navbar_form);
555      $nav_content.insertBefore($sidebar_nav);
556      $navbar_form.insertBefore($nav_content);
557
558      $(".sidebar-wrapper .dropdown .dropdown-menu > li > a").click(function(event) {
559        event.stopPropagation();
560
561      });
562
563      // simulate resize so all the charts/maps will be redrawn
564      window.dispatchEvent(new Event('resize'));
565
566      mobile_menu_initialized = true;
567    } else {
568      if ($(window).width() > 991) {
569        // reset all the additions that we made for the sidebar wrapper only if the screen is bigger than 991px
570        $sidebar_wrapper.find('.navbar-form').remove();
571        $sidebar_wrapper.find('.nav-mobile-menu').remove();
572
573        mobile_menu_initialized = false;
574      }
575    }
576  }, 200),
577
578  startAnimationForLineChart: function(chart) {
579
580    chart.on('draw', function(data) {
581      if (data.type === 'line' || data.type === 'area') {
582        data.element.animate({
583          d: {
584            begin: 600,
585            dur: 700,
586            from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
587            to: data.path.clone().stringify(),
588            easing: Chartist.Svg.Easing.easeOutQuint
589          }
590        });
591      } else if (data.type === 'point') {
592        seq++;
593        data.element.animate({
594          opacity: {
595            begin: seq * delays,
596            dur: durations,
597            from: 0,
598            to: 1,
599            easing: 'ease'
600          }
601        });
602      }
603    });
604
605    seq = 0;
606  },
607  startAnimationForBarChart: function(chart) {
608
609    chart.on('draw', function(data) {
610      if (data.type === 'bar') {
611        seq2++;
612        data.element.animate({
613          opacity: {
614            begin: seq2 * delays2,
615            dur: durations2,
616            from: 0,
617            to: 1,
618            easing: 'ease'
619          }
620        });
621      }
622    });
623
624    seq2 = 0;
625  },
626
627
628  initFullCalendar: function() {
629    $calendar = $('#fullCalendar');
630
631    today = new Date();
632    y = today.getFullYear();
633    m = today.getMonth();
634    d = today.getDate();
635
636    $calendar.fullCalendar({
637      viewRender: function(view, element) {
638        // We make sure that we activate the perfect scrollbar when the view isn't on Month
639        if (view.name != 'month') {
640          $(element).find('.fc-scroller').perfectScrollbar();
641        }
642      },
643      header: {
644        left: 'title',
645        center: 'month,agendaWeek,agendaDay',
646        right: 'prev,next,today'
647      },
648      defaultDate: today,
649      selectable: true,
650      selectHelper: true,
651      views: {
652        month: { // name of view
653          titleFormat: 'MMMM YYYY'
654          // other view-specific options here
655        },
656        week: {
657          titleFormat: " MMMM D YYYY"
658        },
659        day: {
660          titleFormat: 'D MMM, YYYY'
661        }
662      },
663
664      select: function(start, end) {
665
666        // on select we show the Sweet Alert modal with an input
667        swal({
668            title: 'Create an Event',
669            html: '<div class="form-group">' +
670              '<input class="form-control" placeholder="Event Title" id="input-field">' +
671              '</div>',
672            showCancelButton: true,
673            confirmButtonClass: 'btn btn-success',
674            cancelButtonClass: 'btn btn-danger',
675            buttonsStyling: false
676          }).then(function(result) {
677
678            var eventData;
679            event_title = $('#input-field').val();
680
681            if (event_title) {
682              eventData = {
683                title: event_title,
684                start: start,
685                end: end
686              };
687              $calendar.fullCalendar('renderEvent', eventData, true); // stick? = true
688            }
689
690            $calendar.fullCalendar('unselect');
691
692          })
693          .catch(swal.noop);
694      },
695      editable: true,
696      eventLimit: true, // allow "more" link when too many events
697
698
699      // color classes: [ event-blue | event-azure | event-green | event-orange | event-red ]
700      events: [{
701          title: 'All Day Event',
702          start: new Date(y, m, 1),
703          className: 'event-default'
704        },
705        {
706          id: 999,
707          title: 'Repeating Event',
708          start: new Date(y, m, d - 4, 6, 0),
709          allDay: false,
710          className: 'event-rose'
711        },
712        {
713          id: 999,
714          title: 'Repeating Event',
715          start: new Date(y, m, d + 3, 6, 0),
716          allDay: false,
717          className: 'event-rose'
718        },
719        {
720          title: 'Meeting',
721          start: new Date(y, m, d - 1, 10, 30),
722          allDay: false,
723          className: 'event-green'
724        },
725        {
726          title: 'Lunch',
727          start: new Date(y, m, d + 7, 12, 0),
728          end: new Date(y, m, d + 7, 14, 0),
729          allDay: false,
730          className: 'event-red'
731        },
732        {
733          title: 'Md-pro Launch',
734          start: new Date(y, m, d - 2, 12, 0),
735          allDay: true,
736          className: 'event-azure'
737        },
738        {
739          title: 'Birthday Party',
740          start: new Date(y, m, d + 1, 19, 0),
741          end: new Date(y, m, d + 1, 22, 30),
742          allDay: false,
743          className: 'event-azure'
744        },
745        {
746          title: 'Click for Creative Tim',
747          start: new Date(y, m, 21),
748          end: new Date(y, m, 22),
749          url: 'http://www.creative-tim.com/',
750          className: 'event-orange'
751        },
752        {
753          title: 'Click for Google',
754          start: new Date(y, m, 21),
755          end: new Date(y, m, 22),
756          url: 'http://www.creative-tim.com/',
757          className: 'event-orange'
758        }
759      ]
760    });
761  },
762
763  initVectorMap: function() {
764    var mapData = {
765      "AU": 760,
766      "BR": 550,
767      "CA": 120,
768      "DE": 1300,
769      "FR": 540,
770      "GB": 690,
771      "GE": 200,
772      "IN": 200,
773      "RO": 600,
774      "RU": 300,
775      "US": 2920,
776    };
777
778    $('#worldMap').vectorMap({
779      map: 'world_mill_en',
780      backgroundColor: "transparent",
781      zoomOnScroll: false,
782      regionStyle: {
783        initial: {
784          fill: '#e4e4e4',
785          "fill-opacity": 0.9,
786          stroke: 'none',
787          "stroke-width": 0,
788          "stroke-opacity": 0
789        }
790      },
791
792      series: {
793        regions: [{
794          values: mapData,
795          scale: ["#AAAAAA", "#444444"],
796          normalizeFunction: 'polynomial'
797        }]
798      },
799    });
800  }
801}
802
803// Returns a function, that, as long as it continues to be invoked, will not
804// be triggered. The function will be called after it stops being called for
805// N milliseconds. If `immediate` is passed, trigger the function on the
806// leading edge, instead of the trailing.
807
808function debounce(func, wait, immediate) {
809  var timeout;
810  return function() {
811    var context = this,
812      args = arguments;
813    clearTimeout(timeout);
814    timeout = setTimeout(function() {
815      timeout = null;
816      if (!immediate) func.apply(context, args);
817    }, wait);
818    if (immediate && !timeout) func.apply(context, args);
819  };
820};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.