1(function( $ ) { 2 3 $.fn.tabs = function(options) { 4 5 var o = $.extend({}, $.fn.tabs.defaults, options); 6 7 return this.each(function() { 8 9 var $this = $(this); 10 var $tabs = $(this).parent().parent().find('a'); 11 12 $this.click(function(e){ 13 14 e.preventDefault(); 15 16 17 $tabs.removeClass(o.activeClass); 18 $(this).addClass(o.activeClass); 19 20 21 $('.'+o.panelClass).removeClass(o.activeClass); 22 $($(this).attr('href')).addClass(o.activeClass); 23 24 25 }); 26 27 }); 28 29 }; 30 31 $.fn.tabs.defaults = { 32 complete: function(){}, 33 panelClass: 'tab-panel', 34 activeClass: 'active' 35 }; 36 37 38 39 40 41})( jQuery ); 42 43pannergy = function() {} 44 45pannergy.stockChart = (function () { 46 47 var data = [[]]; 48 49 var getData = function(dataURL){ 50 $.get( 51 dataURL, 52 function(response){ 53 var itemLength = $(response).find('tick').length; 54 $(response).find('tick').each(function (i) { 55 56 ts=parseInt($(this).attr('timestamp')); 57 dts=new Date(ts*1000); 58 dts_y=dts.getFullYear(); 59 dts_m=dts.getMonth()+1; 60 dts_d=dts.getDate()-1; 61 62 dts_full=dts_y+'-'+dts_m+'-'+dts_d; 63 64 //alert(dts_full); 65 66 67 data[0].push([ts,parseInt($(this).attr('high'))]); 68 //console.log(data[0]); 69 }); 70 drawChart(); 71 } 72 ); 73 }; 74 75 var drawChart = function() { 76 var stockPlot = $.jqplot( 77 'stock-chart', 78 data, 79 { 80 series:[ 81 { 82 lineWidth:2, 83 shadow:false, 84 markerOptions: { size:2 } 85 } 86 ], 87 seriesDefaults: { 88 showMarker:false, 89 pointLabels: { show:true } 90 }, 91 axes:{ 92 xaxis:{ 93 tickRenderer: $.jqplot.CanvasAxisTickRenderer, 94 tickOptions:{ 95 fontSize: 8 96 }, 97 showTicks: true, 98 pad: 0 99 }, 100 yaxis:{ 101 tickRenderer: $.jqplot.CanvasAxisTickRenderer, 102 tickOptions:{ 103 formatString:'%.0f HUF ' 104 } 105 } 106 }, 107 highlighter:{ 108 tooltipAxes: 'both', 109 showTooltip: false, /**/ 110 show: true, 111 sizeAdjust: 7.5 112 }, 113 grid:{ 114 shadow:false, 115 borderWidth:0.4, 116 backgroundColor: '#fff', 117 gridLineColor: '#cccccc' 118 } 119 } 120 ); 121 }; 122 123 var init = function () { 124 if($('.stock-chart').length){ 125 getData('https://pannergy.com/wp-content/themes/pannergy-v2/xml/history.xml'); 126 } 127 if($('.stock-chart-2022').length){ 128 getData('https://pannergy.com/wp-content/themes/pannergy-v2/xml/history-2022.xml'); 129 } 130 }; 131 132 return { 133 init: init 134 }; 135 136})(); 137 138pannergy.init = function () { 139 140 $('.tabs a').tabs(); 141 pannergy.stockChart.init(); 142 143} 144 145$(document).ready(function(){ 146 147 pannergy.init(); 148 149 function datumcsinal(ts) 150 { 151 dts=new Date(ts*1000); 152 dts_y=dts.getFullYear(); 153 dts_m=dts.getMonth()+1; 154 dts_d=dts.getDate(); 155 if (dts_m.toString().length == 1) { dts_m = '0'+dts_m; } 156 if (dts_d.toString().length == 1) { dts_d = '0'+dts_d; } 157 dts_full=dts_y+'-'+dts_m+'-'+dts_d; 158 return dts_full; 159 } 160 161 $.jqplot.postDrawHooks.push(function(){ 162 $(".jqplot-xaxis-tick").each(function ($i) { 163 $(this).text(datumcsinal($(this).text())); 164 }); 165 $(".jqplot-xaxis").css({'width' : $(".jqplot-xaxis").width() + 20 }); 166 $(".jqplot-xaxis").css({'height' : 11 }); 167 }); 168 169 $('#stock-chart').bind('jqplotHighlighterHighlight', 170 function (ev, seriesIndex, pointIndex, data, plot) { 171 var content = datumcsinal(data[0]) + ", " + data[1] + " HUF"; 172 var elem = $('#customTooltipDiv'); 173 elem.html(content); 174 var h = elem.outerHeight(); 175 var w = elem.outerWidth(); 176 var left = ev.pageX+5; 177 var top = ev.pageY-30; 178 elem.stop(true, true).css({left:left, top:top}).fadeIn(200); 179 } 180 ); 181 182 $('#stock-chart').bind('jqplotHighlighterUnhighlight', 183 function (ev) { 184 $('#customTooltipDiv').fadeOut(300); 185 } 186 ); 187 188 189});
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.