1+function ($) { "use strict"; 2 3 $(function(){ 4 5 // sparkline 6 var sr, sparkline = function($re){ 7 $(".sparkline").each(function(){ 8 var $data = $(this).data(); 9 if($re && !$data.resize) return; 10 ($data.type == 'pie') && $data.sliceColors && ($data.sliceColors = eval($data.sliceColors)); 11 ($data.type == 'bar') && $data.stackedBarColor && ($data.stackedBarColor = eval($data.stackedBarColor)); 12 $data.valueSpots = {'0:': $data.spotColor}; 13 $(this).sparkline('html', $data); 14 }); 15 }; 16 $(window).resize(function(e) { 17 clearTimeout(sr); 18 sr = setTimeout(function(){sparkline(true)}, 500); 19 }); 20 sparkline(false); 21 22 // easypie 23 var easypie = function(){ 24 $('.easypiechart').each(function(){ 25 var $this = $(this), 26 $data = $this.data(), 27 $step = $this.find('.step'), 28 $target_value = parseInt($($data.target).text()), 29 $value = 0; 30 $data.barColor || ( $data.barColor = function($percent) { 31 $percent /= 100; 32 return "rgb(" + Math.round(200 * $percent) + ", 200, " + Math.round(200 * (1 - $percent)) + ")"; 33 }); 34 $data.onStep = function(value){ 35 $value = value; 36 $step.text(parseInt(value)); 37 $data.target && $($data.target).text(parseInt(value) + $target_value); 38 } 39 $data.onStop = function(){ 40 $target_value = parseInt($($data.target).text()); 41 $data.update && setTimeout(function() { 42 $this.data('easyPieChart').update(100 - $value); 43 }, $data.update); 44 } 45 $(this).easyPieChart($data); 46 }); 47 }; 48 easypie(); 49 50 // datepicker 51 $(".datepicker-input").each(function(){ $(this).datepicker();}); 52 53 // dropfile 54 $('.dropfile').each(function(){ 55 var $dropbox = $(this); 56 if (typeof window.FileReader === 'undefined') { 57 $('small',this).html('File API & FileReader API not supported').addClass('text-danger'); 58 return; 59 } 60 61 this.ondragover = function () {$dropbox.addClass('hover'); return false; }; 62 this.ondragend = function () {$dropbox.removeClass('hover'); return false; }; 63 this.ondrop = function (e) { 64 e.preventDefault(); 65 $dropbox.removeClass('hover').html(''); 66 var file = e.dataTransfer.files[0], 67 reader = new FileReader(); 68 reader.onload = function (event) { 69 $dropbox.append($('<img>').attr('src', event.target.result)); 70 }; 71 reader.readAsDataURL(file); 72 return false; 73 }; 74 }); 75 76 // slider 77 $('.slider').each(function(){ 78 $(this).slider(); 79 }); 80 81 // sortable 82 if ($.fn.sortable) { 83 $('.sortable').sortable(); 84 } 85 86 // slim-scroll 87 $('.no-touch .slim-scroll').each(function(){ 88 var $self = $(this), $data = $self.data(), $slimResize; 89 $self.slimScroll($data); 90 $(window).resize(function(e) { 91 clearTimeout($slimResize); 92 $slimResize = setTimeout(function(){$self.slimScroll($data);}, 500); 93 }); 94 $(document).on('updateNav', function(){ 95 $self.slimScroll($data); 96 }); 97 }); 98 99 // portlet 100 $('.portlet').each(function(){ 101 $(".portlet").sortable({ 102 connectWith: '.portlet', 103 iframeFix: false, 104 items: '.portlet-item', 105 opacity: 0.8, 106 helper: 'original', 107 revert: true, 108 forceHelperSize: true, 109 placeholder: 'sortable-box-placeholder round-all', 110 forcePlaceholderSize: true, 111 tolerance: 'pointer' 112 }); 113 }); 114 115 // docs 116 $('#docs pre code').each(function(){ 117 var $this = $(this); 118 var t = $this.html(); 119 $this.html(t.replace(/</g, '<').replace(/>/g, '>')); 120 }); 121 122 // table select/deselect all 123 $(document).on('change', 'table thead [type="checkbox"]', function(e){ 124 e && e.preventDefault(); 125 var $table = $(e.target).closest('table'), $checked = $(e.target).is(':checked'); 126 $('tbody [type="checkbox"]',$table).prop('checked', $checked); 127 }); 128 129 // random progress 130 $(document).on('click', '[data-toggle^="progress"]', function(e){ 131 e && e.preventDefault(); 132 133 var $el = $(e.target), 134 $target = $($el.data('target')); 135 $('.progress', $target).each( 136 function(){
137 var $max = 50, $data, $ps = $('.progress-bar',this).last(); 138 ($(this).hasClass('progress-xs') || $(this).hasClass('progress-sm')) && ($max = 100); 139 $data = Math.floor(Math.random()*$max)+'%'; 140 $ps.css('width', $data).attr('data-original-title', $data); 141 } 142 ); 143 }); 144 145 // add notes 146/* function addMsg($msg){ 147 var $el = $('.nav-user'), $n = $('.count:first', $el), $v = parseInt($n.text()); 148 $('.count', $el).fadeOut().fadeIn().text($v+1); 149 $($msg).hide().prependTo($el.find('.list-group')).slideDown().css('display','block'); 150 } 151 var $msg = '<a href="#" class="media list-group-item">'+ 152 '<span class="pull-left thumb-sm text-center">'+ 153 '<i class="fa fa-envelope-o fa-2x text-success"></i>'+ 154 '</span>'+ 155 '<span class="media-body block m-b-none">'+ 156 'Sophi sent you a email<br>'+ 157 '<small class="text-muted">1 minutes ago</small>'+ 158 '</span>'+ 159 '</a>'; 160 setTimeout(function(){addMsg($msg);}, 1500);*/ 161 162 //chosen 163 $(".chosen-select").length && $(".chosen-select").chosen(); 164 165 }); 166}(window.jQuery);
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.