Version Description
- [Note] The security of our users' data is our top priority, and for this reason we tightened our SQL queries and made our encryption key harder to guess. If you are using a caching plugin, please flush its cache so that the tracking code can be regenerated with the new key. Also, if you are using Slimstat to track external websites, please make sure to replace the tracking code with the new one available under Settings > Advanced. As usual, feel free to contact us if you have any questions.
- [Note] Added un-minified js tracker to the repo, for those who would like to take a look at how things work.
- [New] Introduced option to ignore bots when in Server-side mode.
- [Update] Cleaned up the Settings/Filters screen by consolidating some options.
- [Update] AmMap has been updated to version 3.13.1
- [Update] MaxMind GeoLite IP has been updated to the latest version (2015-02-04).
- [Fix] Patched a rare SQL injection vulnerability exploitable using a bruteforce attack on the secret key (used to encrypt the data between client and server).
- [Fix] Increased checks on SQL code that stores data in the database (maybe_insert_row).
- [Fix] Report filters could not be removed after being set.
Download this release
Release Info
Developer | coolmann |
Plugin | Slimstat Analytics |
Version | 3.9.6 |
Comparing to | |
See all releases |
Code changes from version 3.9.5 to 3.9.6
- admin/config/index.php +3 -6
- admin/js/ammap/ammap.js +194 -180
- admin/js/ammap/world.js +2 -2
- admin/view/wp-slimstat-reports.php +2 -6
- admin/wp-slimstat-admin.php +25 -14
- databases/maxmind.dat +0 -0
- readme.txt +12 -1
- wp-slimstat.js +492 -1
- wp-slimstat.min.js +1 -0
- wp-slimstat.php +37 -38
admin/config/index.php
CHANGED
@@ -76,6 +76,7 @@ switch ($config_tabs[$current_tab-1]){
|
|
76 |
|
77 |
'filters_categories_header' => array('description' => __('Profiling','wp-slimstat'), 'type' => 'section_header'),
|
78 |
'ignore_spammers' => array('description' => __('Ignore Spammers','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Enable this option if you don't want to track visits from users identified as spammers by third-party tools like Akismet. Pageviews generated by users whose comments are later marked as spam, will also be removed from the database.",'wp-slimstat')),
|
|
|
79 |
'ignore_resources' => array('description' => __('Permalinks','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the URLs on your website that you don't want to track, separated by commas. Don't include the domain name: <em>/about, ?p=1</em>, etc. Wildcards: <code>*</code> matches 'any string, including the empty string', <code>!</code> matches 'any character'. For example, <code>/abou*</code> will match /about and /abound, <code>/abo*t</code> will match /aboundant and /about, <code>/abo!t</code> will match /about and /abort. Strings are case-insensitive.",'wp-slimstat')),
|
80 |
'ignore_countries' => array('description' => __('Countries','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Country codes (i.e.: <code>en-us, it, es</code>) that you don't want to track, separated by commas.",'wp-slimstat')),
|
81 |
'ignore_browsers' => array('description' => __('User Agents','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Browsers (user agents) you don't want to track, separated by commas. You can specify the browser's version adding a slash after the name (i.e. <em>Firefox/3.6</em>). Wildcards: <code>*</code> matches 'any string, including the empty string', <code>!</code> matches 'any character'. For example, <code>Chr*</code> will match Chrome and Chromium, <code>IE/!.0</code> will match IE/7.0 and IE/8.0. Strings are case-insensitive.",'wp-slimstat')),
|
@@ -84,12 +85,8 @@ switch ($config_tabs[$current_tab-1]){
|
|
84 |
'filters_outbound_header' => array('description' => __('Internal and Outbound Links','wp-slimstat'), 'type' => 'section_header'),
|
85 |
'enable_outbound_tracking' => array('description' => __('Track Outbound Clicks','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Track when your visitors click on link to external websites. This option required Spy Mode to be enabled.','wp-slimstat')),
|
86 |
'track_internal_links' => array('description' => __('Track Coordinates','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Collect mouse coordinates and other information for clicks on internal links. Strongly recommended if you're using the heatmap add-on. By default, this information is only collected for external links.",'wp-slimstat')),
|
87 |
-
'
|
88 |
-
'
|
89 |
-
'ignore_outbound_href' => array('description' => __('No Callback on URL','wp-slimstat'), 'type' => 'text', 'long_description' => __("Track the event but do not invoke the callback function on links whose <em>href</em> attribute contains one of these strings (separated by comma).",'wp-slimstat')),
|
90 |
-
'do_not_track_outbound_classes' => array('description' => __('Do not Track Classes','wp-slimstat'), 'type' => 'text', 'long_description' => __("Do not track links marked with one of these classnames (separated by comma).",'wp-slimstat')),
|
91 |
-
'do_not_track_outbound_rel' => array('description' => __('Do not Track Rel','wp-slimstat'), 'type' => 'text', 'long_description' => __("Do not track links having one of these values (separated by comma) as their <em>rel</em> attribute.",'wp-slimstat')),
|
92 |
-
'do_not_track_outbound_href' => array('description' => __('Do not Track URL','wp-slimstat'), 'type' => 'text', 'long_description' => __("Do not track links whose <em>href</em> attribute contains one of these strings (separated by comma).",'wp-slimstat')),
|
93 |
|
94 |
'filters_miscellaneous_header' => array('description' => __('Miscellaneous','wp-slimstat'), 'type' => 'section_header'),
|
95 |
'anonymize_ip' => array('description' => __('Enable Privacy Mode','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Mask your visitors' IP addresses to comply with European Privacy Laws.",'wp-slimstat')),
|
76 |
|
77 |
'filters_categories_header' => array('description' => __('Profiling','wp-slimstat'), 'type' => 'section_header'),
|
78 |
'ignore_spammers' => array('description' => __('Ignore Spammers','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Enable this option if you don't want to track visits from users identified as spammers by third-party tools like Akismet. Pageviews generated by users whose comments are later marked as spam, will also be removed from the database.",'wp-slimstat')),
|
79 |
+
'ignore_bots' => array('description' => __('Ignore Bots','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Turn on this feature if you want to have the accuracy level of server-side tracking, but not the inconvenience of getting your database clogged with pageviews generated by crawlers, spiders, search engine bots, etc. Please note that in Javascript Mode, bots are ignored regardless of this setting.",'wp-slimstat')),
|
80 |
'ignore_resources' => array('description' => __('Permalinks','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the URLs on your website that you don't want to track, separated by commas. Don't include the domain name: <em>/about, ?p=1</em>, etc. Wildcards: <code>*</code> matches 'any string, including the empty string', <code>!</code> matches 'any character'. For example, <code>/abou*</code> will match /about and /abound, <code>/abo*t</code> will match /aboundant and /about, <code>/abo!t</code> will match /about and /abort. Strings are case-insensitive.",'wp-slimstat')),
|
81 |
'ignore_countries' => array('description' => __('Countries','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Country codes (i.e.: <code>en-us, it, es</code>) that you don't want to track, separated by commas.",'wp-slimstat')),
|
82 |
'ignore_browsers' => array('description' => __('User Agents','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Browsers (user agents) you don't want to track, separated by commas. You can specify the browser's version adding a slash after the name (i.e. <em>Firefox/3.6</em>). Wildcards: <code>*</code> matches 'any string, including the empty string', <code>!</code> matches 'any character'. For example, <code>Chr*</code> will match Chrome and Chromium, <code>IE/!.0</code> will match IE/7.0 and IE/8.0. Strings are case-insensitive.",'wp-slimstat')),
|
85 |
'filters_outbound_header' => array('description' => __('Internal and Outbound Links','wp-slimstat'), 'type' => 'section_header'),
|
86 |
'enable_outbound_tracking' => array('description' => __('Track Outbound Clicks','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Track when your visitors click on link to external websites. This option required Spy Mode to be enabled.','wp-slimstat')),
|
87 |
'track_internal_links' => array('description' => __('Track Coordinates','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Collect mouse coordinates and other information for clicks on internal links. Strongly recommended if you're using the heatmap add-on. By default, this information is only collected for external links.",'wp-slimstat')),
|
88 |
+
'ignore_outbound_classes_rel_href' => array('description' => __('No Callback','wp-slimstat'), 'type' => 'text', 'long_description' => __("Track the event but do not invoke the callback function on links marked with one of these class names, <em>rel</em> attribute or whose <em>href</em> attribute contains one of these strings (separated by comma). Useful to prevent conflicts with lightbox and similar libraries.",'wp-slimstat')),
|
89 |
+
'do_not_track_outbound_classes_rel_href' => array('description' => __('Do Not Track','wp-slimstat'), 'type' => 'text', 'long_description' => __("Do not track links marked with one of these class names, <em>rel</em> attributes or whose <em>href</em> attribute contains one of these strings (separated by comma).",'wp-slimstat')),
|
|
|
|
|
|
|
|
|
90 |
|
91 |
'filters_miscellaneous_header' => array('description' => __('Miscellaneous','wp-slimstat'), 'type' => 'section_header'),
|
92 |
'anonymize_ip' => array('description' => __('Enable Privacy Mode','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Mask your visitors' IP addresses to comply with European Privacy Laws.",'wp-slimstat')),
|
admin/js/ammap/ammap.js
CHANGED
@@ -3,16 +3,19 @@ AmCharts.Class=function(a){var b=function(){arguments[0]!==AmCharts.inheriting&&
|
|
3 |
a,b);this.events[a].push({handler:b,scope:c})},b.prototype.removeListener=function(a,b,c){if(a&&a.events)for(a=a.events[b],b=a.length-1;0<=b;b--)a[b].handler===c&&a.splice(b,1)},b.prototype.fire=function(a,b){for(var c=this.events[a],g=0,h=c.length;g<h;g++){var k=c[g];k.handler.call(k.scope,b)}});for(var c in a)b.prototype[c]=a[c];return b};AmCharts.addChart=function(a){AmCharts.charts.push(a)};AmCharts.removeChart=function(a){for(var b=AmCharts.charts,c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)};
|
4 |
AmCharts.isModern=!0;AmCharts.getIEVersion=function(){var a=0;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=/MSIE ([0-9]{1,}[.0-9]{0,})/;null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}else"Netscape"==navigator.appName&&(b=navigator.userAgent,c=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/,null!=c.exec(b)&&(a=parseFloat(RegExp.$1)));return a};
|
5 |
AmCharts.applyLang=function(a,b){var c=AmCharts.translations;b.dayNames=AmCharts.dayNames;b.shortDayNames=AmCharts.shortDayNames;b.monthNames=AmCharts.monthNames;b.shortMonthNames=AmCharts.shortMonthNames;c&&(c=c[a])&&(AmCharts.lang=c,c.monthNames&&(b.dayNames=c.dayNames,b.shortDayNames=c.shortDayNames,b.monthNames=c.monthNames,b.shortMonthNames=c.shortMonthNames))};AmCharts.IEversion=AmCharts.getIEVersion();9>AmCharts.IEversion&&0<AmCharts.IEversion&&(AmCharts.isModern=!1,AmCharts.isIE=!0);
|
6 |
-
AmCharts.dx=0;AmCharts.dy=0;if(document.addEventListener||window.opera)AmCharts.isNN=!0,AmCharts.isIE=!1,AmCharts.dx=.5,AmCharts.dy=.5;document.attachEvent&&(AmCharts.isNN=!1,AmCharts.isIE=!0,AmCharts.isModern||(AmCharts.dx=0,AmCharts.dy=0));window.chrome&&(AmCharts.chrome=!0);AmCharts.handleResize=function(){for(var a=AmCharts.charts,b=0;b<a.length;b++){var c=a[b];c&&c.div&&c.handleResize()}};
|
7 |
-
AmCharts.
|
8 |
-
AmCharts.
|
9 |
-
AmCharts.
|
|
|
|
|
10 |
AmCharts.isIE&&(document.attachEvent("onmousemove",AmCharts.handleMouseMove),window.attachEvent("onresize",AmCharts.handleResize),document.attachEvent("onmouseup",AmCharts.handleMouseUp),window.attachEvent("onload",AmCharts.handleLoad));
|
11 |
AmCharts.clear=function(){var a=AmCharts.charts;if(a)for(var b=0;b<a.length;b++)a[b].clear();AmCharts.charts=null;AmCharts.isNN&&(document.removeEventListener("mousemove",AmCharts.handleMouseMove,!0),window.removeEventListener("resize",AmCharts.handleResize,!0),document.removeEventListener("mouseup",AmCharts.handleMouseUp,!0),window.removeEventListener("load",AmCharts.handleLoad,!0),window.removeEventListener("DOMMouseScroll",AmCharts.handleWheel,!0),document.removeEventListener("mousewheel",AmCharts.handleWheel,
|
12 |
!0));AmCharts.isIE&&(document.detachEvent("onmousemove",AmCharts.handleMouseMove),window.detachEvent("onresize",AmCharts.handleResize),document.detachEvent("onmouseup",AmCharts.handleMouseUp),window.detachEvent("onload",AmCharts.handleLoad))};
|
13 |
AmCharts.makeChart=function(a,b,c){var d=b.type,f=b.theme;AmCharts.isString(f)&&(f=AmCharts.themes[f],b.theme=f);var e;switch(d){case "serial":e=new AmCharts.AmSerialChart(f);break;case "xy":e=new AmCharts.AmXYChart(f);break;case "pie":e=new AmCharts.AmPieChart(f);break;case "radar":e=new AmCharts.AmRadarChart(f);break;case "gauge":e=new AmCharts.AmAngularGauge(f);break;case "funnel":e=new AmCharts.AmFunnelChart(f);break;case "map":e=new AmCharts.AmMap(f);break;case "stock":e=new AmCharts.AmStockChart(f)}AmCharts.extend(e,
|
14 |
-
b);AmCharts.isReady?isNaN(c)?e.write(a):setTimeout(function(){AmCharts.realWrite(e,a)},c):AmCharts.ready(function(){isNaN(c)?e.write(a):setTimeout(function(){AmCharts.realWrite(e,a)},c)});return e};AmCharts.realWrite=function(a,b){a.write(b)};AmCharts.toBoolean=function(a,b){if(void 0===a)return b;switch(String(a).toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return Boolean(a)}};AmCharts.removeFromArray=function(a,b){var c;if(void 0!=b&&void 0!=a)for(c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1)};AmCharts.
|
15 |
-
AmCharts.
|
|
|
16 |
b,c,d,f,e,g)}return AmCharts.wrappedText(a,b,c,d,f,e,g,h,k+1)}return l}};AmCharts.getStyle=function(a,b){var c="";document.defaultView&&document.defaultView.getComputedStyle?c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b):a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);return c};AmCharts.removePx=function(a){if(void 0!=a)return Number(a.substring(0,a.length-2))};
|
17 |
AmCharts.getURL=function(a,b){if(a)if("_self"!=b&&b)if("_top"==b&&window.top)window.top.location.href=a;else if("_parent"==b&&window.parent)window.parent.location.href=a;else if("_blank"==b)window.open(a);else{var c=document.getElementsByName(b)[0];c?c.src=a:(c=AmCharts.windows[b])?c.opener&&!c.opener.closed?c.location.href=a:AmCharts.windows[b]=window.open(a):AmCharts.windows[b]=window.open(a)}else window.location.href=a};AmCharts.ifArray=function(a){return a&&0<a.length?!0:!1};
|
18 |
AmCharts.callMethod=function(a,b){var c;for(c=0;c<b.length;c++){var d=b[c];if(d){if(d[a])d[a]();var f=d.length;if(0<f){var e;for(e=0;e<f;e++){var g=d[e];if(g&&g[a])g[a]()}}}}};AmCharts.toNumber=function(a){return"number"==typeof a?a:Number(String(a).replace(/[^0-9\-.]+/g,""))};
|
@@ -35,12 +38,15 @@ AmCharts.getObjById=function(a,b){var c,d;for(d=0;d<a.length;d++){var f=a[d];f.i
|
|
35 |
AmCharts.copyProperties=function(a,b){for(var c in a)a.hasOwnProperty(c)&&"events"!=c&&void 0!==a[c]&&"function"!=typeof a[c]&&"cname"!=c&&(b[c]=a[c])};AmCharts.processObject=function(a,b,c){!1===a instanceof b&&(a=AmCharts.extend(new b(c),a));return a};AmCharts.fixNewLines=function(a){var b=RegExp("\\n","g");a&&(a=a.replace(b,"<br />"));return a};AmCharts.fixBrakes=function(a){if(AmCharts.isModern){var b=RegExp("<br>","g");a&&(a=a.replace(b,"\n"))}else a=AmCharts.fixNewLines(a);return a};
|
36 |
AmCharts.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)AmCharts.deleteObject(a[c],b-1),a[c]=null;else if(a&&!a.tagName)try{for(c in a)a[c]&&("object"==typeof a[c]&&AmCharts.deleteObject(a[c],b-1),"function"!=typeof a[c]&&(a[c]=null))}catch(d){}}};
|
37 |
AmCharts.bounce=function(a,b,c,d,f){return(b/=f)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c};AmCharts.easeInSine=function(a,b,c,d,f){return-d*Math.cos(b/f*(Math.PI/2))+d+c};AmCharts.easeOutSine=function(a,b,c,d,f){return d*Math.sin(b/f*(Math.PI/2))+c};
|
38 |
-
AmCharts.easeOutElastic=function(a,b,c,d,f){a=1.70158;var e=0,g=d;if(0===b)return c;if(1==(b/=f))return c+d;e||(e=.3*f);g<Math.abs(d)?(g=d,a=e/4):a=e/(2*Math.PI)*Math.asin(d/g);return g*Math.pow(2,-10*b)*Math.sin(2*(b*f-a)*Math.PI/e)+d+c};AmCharts.
|
39 |
-
"
|
40 |
-
(
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
44 |
rotate:function(a,b){this.R.rotate(this,a,b);this.angle=a},animate:function(a,b,c){for(var d in a)if(a.hasOwnProperty(d)){var f=d,e=a[d];c=AmCharts.getEffect(c);this.R.animate(this,f,e,b,c)}},push:function(a){if(a){var b=this.node;b.appendChild(a.node);var c=a.clipPath;c&&b.appendChild(c);(a=a.grad)&&b.appendChild(a)}},text:function(a){this.R.setText(this,a)},remove:function(){this.R.remove(this)},clear:function(){var a=this.node;if(a.hasChildNodes())for(;1<=a.childNodes.length;)a.removeChild(a.firstChild)},
|
45 |
hide:function(){this.setAttr("visibility","hidden")},show:function(){this.setAttr("visibility","visible")},getBBox:function(){return this.R.getBBox(this)},toFront:function(){var a=this.node;if(a){this.prevNextNode=a.nextSibling;var b=a.parentNode;b&&b.appendChild(a)}},toPrevious:function(){var a=this.node;a&&this.prevNextNode&&(a=a.parentNode)&&a.insertBefore(this.prevNextNode,null)},toBack:function(){var a=this.node;if(a){this.prevNextNode=a.nextSibling;var b=a.parentNode;if(b){var c=b.firstChild;
|
46 |
c&&b.insertBefore(a,c)}}},mouseover:function(a){this.R.addListener(this,"mouseover",a);return this},mouseout:function(a){this.R.addListener(this,"mouseout",a);return this},click:function(a){this.R.addListener(this,"click",a);return this},dblclick:function(a){this.R.addListener(this,"dblclick",a);return this},mousedown:function(a){this.R.addListener(this,"mousedown",a);return this},mouseup:function(a){this.R.addListener(this,"mouseup",a);return this},touchstart:function(a){this.R.addListener(this,
|
@@ -54,115 +60,118 @@ move:function(a,b,c,d){isNaN(b)&&(b=0);isNaN(c)&&(c=0);b="translate("+b+","+c+")
|
|
54 |
a.grad;e&&this.D.remove(e);b=document.createElementNS(AmCharts.SVG_NS,b);e=AmCharts.getUniqueId();b.setAttribute("id",e);if(!isNaN(d)){var g=0,h=0,k=0,l=0;90==d?k=100:270==d?l=100:180==d?g=100:0===d&&(h=100);b.setAttribute("x1",g+"%");b.setAttribute("x2",h+"%");b.setAttribute("y1",k+"%");b.setAttribute("y2",l+"%")}for(d=0;d<c.length;d++)g=document.createElementNS(AmCharts.SVG_NS,"stop"),h=100*d/(c.length-1),0===d&&(h=0),g.setAttribute("offset",h+"%"),g.setAttribute("stop-color",c[d]),b.appendChild(g);
|
55 |
f.parentNode.appendChild(b);c="#";AmCharts.baseHref&&!AmCharts.isIE&&(c=this.removeTarget(window.location.href)+c);f.setAttribute("fill","url("+c+e+")");a.grad=b},removeTarget:function(a){urlArr=a.split("#");return urlArr[0]},pattern:function(a,b,c){var d=a.node;isNaN(c)&&(c=1);var f=a.patternNode;f&&this.D.remove(f);var f=document.createElementNS(AmCharts.SVG_NS,"pattern"),e=AmCharts.getUniqueId(),g=b;b.url&&(g=b.url);var h=Number(b.width);isNaN(h)&&(h=4);var k=Number(b.height);isNaN(k)&&(k=4);h/=
|
56 |
c;k/=c;c=b.x;isNaN(c)&&(c=0);var l=-Math.random()*Number(b.randomX);isNaN(l)||(c=l);l=b.y;isNaN(l)&&(l=0);var m=-Math.random()*Number(b.randomY);isNaN(m)||(l=m);f.setAttribute("id",e);f.setAttribute("width",h);f.setAttribute("height",k);f.setAttribute("patternUnits","userSpaceOnUse");f.setAttribute("xlink:href",g);b.color&&(m=document.createElementNS(AmCharts.SVG_NS,"rect"),m.setAttributeNS(null,"height",h),m.setAttributeNS(null,"width",k),m.setAttributeNS(null,"fill",b.color),f.appendChild(m));this.D.image(g,
|
57 |
-
0,0,h,k,f).translate(c,l);g="#";AmCharts.baseHref&&!AmCharts.isIE&&(g=this.removeTarget(window.location.href)+g);d.setAttribute("fill","url("+g+e+")");a.patternNode=f;d.parentNode.appendChild(f)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);a.grad&&this.D.remove(a.grad);a.patternNode&&this.D.remove(a.patternNode);this.D.remove(a.node)}});AmCharts.AmChart=AmCharts.Class({construct:function(a){this.theme=a;this.version="3.
|
58 |
-
2;this.decimalSeparator=".";this.thousandsSeparator=",";this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];this.creditsPosition="top-left";var b=document.createElement("div"),c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.chartDiv=b;b=document.createElement("div");c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.legendDiv=
|
59 |
-
2;this.handDrawThickness=1;this.prefixesOfBigNumbers=[{number:1E3,prefix:"k"},{number:1E6,prefix:"M"},{number:1E9,prefix:"G"},{number:1E12,prefix:"T"},{number:1E15,prefix:"P"},{number:1E18,prefix:"E"},{number:1E21,prefix:"Z"},{number:1E24,prefix:"Y"}];this.prefixesOfSmallNumbers=[{number:1E-24,prefix:"y"},{number:1E-21,prefix:"z"},{number:1E-18,prefix:"a"},{number:1E-15,prefix:"f"},{number:1E-12,prefix:"p"},{number:1E-9,prefix:"n"},
|
60 |
-
|
61 |
-
var e=this.updateHeight();this.realHeight=e;
|
62 |
-
d.text,f,this.fontFamily,e);f.translate(g+(this.realWidth-this.marginRight-g)/2,b);f.node.style.pointerEvents="none";g=!0;void 0!==d.bold&&(g=d.bold);g&&f.attr({"font-weight":"bold"});f.attr({opacity:d.alpha});b+=e+6;this.freeLabelsSet.push(f)}}},write:function(a){if(a=
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
decimalSeparator
|
68 |
-
this.
|
69 |
-
|
70 |
-
a.set(),this.
|
71 |
-
this.
|
72 |
-
|
73 |
-
this.
|
74 |
-
this.interval&&clearInterval(this.interval);this.
|
75 |
-
a.
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
"
|
83 |
-
"xy"!=
|
84 |
-
|
85 |
-
a.
|
86 |
-
|
87 |
-
|
88 |
-
this.
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
94 |
this.animationDuration=.3;this.fixedPosition=!1;this.offsetY=6;this.offsetX=1;this.textAlign="center";AmCharts.isModern||(this.offsetY*=1.5);AmCharts.applyTheme(this,a,this.cname)},draw:function(){var a=this.pointToX,b=this.pointToY;this.deltaSignX=this.deltaSignY=1;var c=this.chart;AmCharts.VML&&(this.fadeOutDuration=0);this.xAnim&&c.stopAnim(this.xAnim);this.yAnim&&c.stopAnim(this.yAnim);if(!isNaN(a)){var d=this.follow,f=c.container,e=this.set;AmCharts.remove(e);this.removeDiv();e=f.set();e.node.style.pointerEvents=
|
95 |
-
"none";this.set=e;c.balloonsSet.push(e);if(this.show){var g=this.l,h=this.t,k=this.r,l=this.b,m=this.balloonColor,n=this.fillColor,
|
96 |
-
(
|
97 |
-
|
98 |
-
this.cornerRadius),this.showBullet&&(
|
99 |
-
f=1*this.deltaSignX;u.left=l+"px";u.top=h+"px";e.translate(q-f,
|
100 |
-
"px")));this.prevX=q-f;this.prevY=
|
101 |
-
b=this.textDiv.style;b.left=a+this.horizontalPadding+"px";b.top=f+this.verticalPadding+"px"}}}},changeColor:function(a){this.balloonColor=a},setBounds:function(a,b,c,d){this.l=a;this.t=b;this.r=c;this.b=d;this.destroyTO&&clearTimeout(this.destroyTO)},showBalloon:function(a){this.text=a;this.show
|
102 |
-
c=a.chart;if(0<b){a.destroyTO=setTimeout(function(){a.destroy.call(a)},1E3*b);a.follow=!1;a.show=!1;var d=a.set;d&&(d.setAttr("opacity",a.fillAlpha),a.fadeAnim1=d.animate({opacity:0},b,"easeInSine"));a.textDiv&&(a.fadeAnim2=c.animate({node:a.textDiv},"opacity",1,0,b,"easeInSine",""))}else a.show
|
103 |
-
this;(b.follow=a)?(b.pShowBullet=b.showBullet,b.showBullet=!1):void 0!==b.pShowBullet&&(b.showBullet=b.pShowBullet);clearInterval(b.interval);var c=b.chart.mouseX,d=b.chart.mouseY;!isNaN(c)&&a&&(b.pointToX=c-b.offsetX*b.deltaSignX,b.pointToY=d,b.followMouse(),b.interval=setInterval(function(){b.followMouse.call(b)},
|
104 |
-
this.set=null}});AmCharts.circle=function(a,b,c,d,f,e,g,h,k){if(void 0==f||0===f)f=.01;void 0===e&&(e="#000000");void 0===g&&(g=0);d={fill:c,stroke:e,"fill-opacity":d,"stroke-width":f,"stroke-opacity":g};a=isNaN(k)?a.circle(0,0,b).attr(d):a.ellipse(0,0,b,k).attr(d);h&&a.gradient("radialGradient",[c,AmCharts.adjustLuminosity(c,-.6)]);return a};
|
105 |
-
AmCharts.text=function(a,b,c,d,f,e,g,h){e||(e="middle");"right"==e&&(e="end");isNaN(h)&&(h=1);void 0!==b&&(b=String(b),AmCharts.isIE&&!AmCharts.isModern&&(b=b.replace("&","&"),b=b.replace("&","&")));c={fill:c,"font-family":d,"font-size":f,opacity:h};!0===g&&(c["font-weight"]="bold");c["text-anchor"]=e;return a.text(b,c)};
|
106 |
-
AmCharts.polygon=function(a,b,c,d,f,e,g,h,k,l,m){isNaN(e)&&(e=.01);isNaN(h)&&(h=f);var n=d,
|
107 |
-
e);a=a.path(l+" Z").attr(f);
|
108 |
-
AmCharts.rect=function(a,b,c,d,f,e,g,h,k,l,m){isNaN(e)&&(e=0);void 0===k&&(k=0);void 0===l&&(l=270);isNaN(f)&&(f=0);var n=d,
|
109 |
AmCharts.bullet=function(a,b,c,d,f,e,g,h,k,l,m){var n;"circle"==b&&(b="round");switch(b){case "round":n=AmCharts.circle(a,c/2,d,f,e,g,h);break;case "square":n=AmCharts.polygon(a,[-c/2,c/2,c/2,-c/2],[c/2,c/2,-c/2,-c/2],d,f,e,g,h,l-180);break;case "rectangle":n=AmCharts.polygon(a,[-c,c,c,-c],[c/2,c/2,-c/2,-c/2],d,f,e,g,h,l-180);break;case "diamond":n=AmCharts.polygon(a,[-c/2,0,c/2,0],[0,-c/2,0,c/2],d,f,e,g,h);break;case "triangleUp":n=AmCharts.triangle(a,c,0,d,f,e,g,h);break;case "triangleDown":n=AmCharts.triangle(a,
|
110 |
c,180,d,f,e,g,h);break;case "triangleLeft":n=AmCharts.triangle(a,c,270,d,f,e,g,h);break;case "triangleRight":n=AmCharts.triangle(a,c,90,d,f,e,g,h);break;case "bubble":n=AmCharts.circle(a,c/2,d,f,e,g,h,!0);break;case "line":n=AmCharts.line(a,[-c/2,c/2],[0,0],d,f,e,g,h);break;case "yError":n=a.set();n.push(AmCharts.line(a,[0,0],[-c/2,c/2],d,f,e));n.push(AmCharts.line(a,[-k,k],[-c/2,-c/2],d,f,e));n.push(AmCharts.line(a,[-k,k],[c/2,c/2],d,f,e));break;case "xError":n=a.set(),n.push(AmCharts.line(a,[-c/
|
111 |
2,c/2],[0,0],d,f,e)),n.push(AmCharts.line(a,[-c/2,-c/2],[-k,k],d,f,e)),n.push(AmCharts.line(a,[c/2,c/2],[-k,k],d,f,e))}n&&n.pattern(m);return n};
|
112 |
AmCharts.triangle=function(a,b,c,d,f,e,g,h){if(void 0===e||0===e)e=1;void 0===g&&(g="#000");void 0===h&&(h=0);d={fill:d,stroke:g,"fill-opacity":f,"stroke-width":e,"stroke-opacity":h};b/=2;var k;0===c&&(k=" M"+-b+","+b+" L0,"+-b+" L"+b+","+b+" Z");180==c&&(k=" M"+-b+","+-b+" L0,"+b+" L"+b+","+-b+" Z");90==c&&(k=" M"+-b+","+-b+" L"+b+",0 L"+-b+","+b+" Z");270==c&&(k=" M"+-b+",0 L"+b+","+b+" L"+b+","+-b+" Z");return a.path(k).attr(d)};
|
113 |
AmCharts.line=function(a,b,c,d,f,e,g,h,k,l,m){if(a.handDrawn&&!m)return AmCharts.handDrawnLine(a,b,c,d,f,e,g,h,k,l,m);e={fill:"none","stroke-width":e};void 0!==g&&0<g&&(e["stroke-dasharray"]=g);isNaN(f)||(e["stroke-opacity"]=f);d&&(e.stroke=d);d=Math.round;l&&(d=AmCharts.doNothing);l=AmCharts.dx;f=AmCharts.dy;g="M"+(d(b[0])+l)+","+(d(c[0])+f);for(h=1;h<b.length;h++)g+=" L"+(d(b[h])+l)+","+(d(c[h])+f);if(AmCharts.VML)return a.path(g,void 0,!0).attr(e);k&&(g+=" M0,0 L0,0");return a.path(g).attr(e)};
|
114 |
-
AmCharts.makeHD=function(a,b,c){for(var d=[],f=[],e=1;e<a.length;e++)for(var g=Number(a[e-1]),h=Number(b[e-1]),k=Number(a[e]),l=Number(b[e]),m=Math.sqrt(Math.pow(k-g,2)+Math.pow(l-h,2)),m=Math.round(m/50)+1,k=(k-g)/m,l=(l-h)/m,n=0;n<=m;n++){var
|
115 |
-
AmCharts.handDrawnLine=function(a,b,c,d,f,e,g,h,k,l,m){var n=a.set();for(m=1;m<b.length;m++)for(var
|
116 |
-
AmCharts.wedge=function(a,b,c,d,f,e,g,h,k,l,m,n){var
|
117 |
-
|
118 |
-
","+q+","+(k+
|
119 |
-
","+
|
120 |
-
if(m){b=[];for(c=0;c<m.length;c++)b.push(AmCharts.adjustLuminosity(l.fill,m[c]));0<b.length&&a.gradient("linearGradient",b)}a.pattern(n);d.push(a);return d};AmCharts.adjustLuminosity=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,"");6>a.length&&(a=String(a[0])+String(a[0])+String(a[1])+String(a[1])+String(a[2])+String(a[2]));b=b||0;var c="#",d,f;for(f=0;3>f;f++)d=parseInt(a.substr(2*f,2),16),d=Math.round(Math.min(Math.max(0,d+d*b),255)).toString(16),c+=("00"+d).substr(d.length);return c};AmCharts.AmLegend=AmCharts.Class({construct:function(a){this.cname="AmLegend";this.createEvents("rollOverMarker","rollOverItem","rollOutMarker","rollOutItem","showItem","hideItem","clickMarker","rollOverItem","rollOutItem","clickLabel");this.position="bottom";this.borderColor=this.color="#000000";this.borderAlpha=0;this.markerLabelGap=5;this.verticalGap=10;this.align="left";this.horizontalGap=0;this.spacing=10;this.markerDisabledColor="#AAB3B3";this.markerType="square";this.markerSize=
|
121 |
-
this.markerBorderAlpha=1;this.marginBottom=this.marginTop=0;this.marginLeft=this.marginRight=20;this.autoMargins=!0;this.valueWidth=50;this.switchable=!0;this.switchType="x";this.switchColor="#FFFFFF";this.rollOverColor="#CC0000";this.reversedOrder=!1;this.labelText="[[title]]";this.valueText="[[value]]";this.useMarkerColorForLabels=!1;this.rollOverGraphAlpha=1;this.textClickEnabled=!1;this.equalWidths=!0;this.dateFormat="DD-MM-YYYY";this.backgroundColor="#FFFFFF";this.backgroundAlpha=
|
122 |
-
|
123 |
-
b||"left"==b)this.maxColumns=1,this.autoMargins&&(this.marginLeft=this.marginRight=10);else if(this.autoMargins){this.marginRight=a.marginRight;this.marginLeft=a.marginLeft;var h=a.autoMarginOffset;"bottom"==b?(this.marginBottom=h,this.marginTop=0):(this.marginTop=h,this.marginBottom=0)}
|
124 |
-
e.className="amChartsLegend");this.divWidth=
|
125 |
-
a.width+15,this.titleHeight=a.height+6;this.index=this.maxLabelWidth=0;if(this.showEntries){for(a=0;a<g.length;a++)this.createEntry(g[a]);for(a=this.index=0;a<g.length;a++)this.createValue(g[a])}this.arrangeEntries();this.updateValues()},arrangeEntries:function(){var a=this.position,b=this.marginLeft+this.titleWidth,c=this.marginRight,d=this.marginTop,f=this.marginBottom,e=this.horizontalGap,g=this.div,
|
126 |
-
this.set&&this.set.remove();var
|
127 |
-
k&&(
|
128 |
-
a=k+d+f+1;0>a&&(a=0);g.style.height=Math.round(a)+"px";
|
129 |
-
a.
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
133 |
a)})},rollOverMarker:function(a,b){this.switchable&&this.dispatch("rollOverMarker",a,b);this.dispatch("rollOverItem",a,b)},rollOutMarker:function(a,b){this.switchable&&this.dispatch("rollOutMarker",a,b);this.dispatch("rollOutItem",a,b)},clickMarker:function(a,b){this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b));this.dispatch("clickMarker",a,b)},rollOverLabel:function(a,b){a.hidden||(this.textClickEnabled&&a.legendLabel&&a.legendLabel.attr({fill:this.rollOverColor}),
|
134 |
this.dispatch("rollOverItem",a,b))},rollOutLabel:function(a,b){if(!a.hidden){if(this.textClickEnabled&&a.legendLabel){var c=this.color;void 0!==this.selectedColor&&a.showBalloon&&(c=this.selectedColor);this.useMarkerColorForLabels&&(c=a.lineColor,void 0===c&&(c=a.color));a.legendLabel.attr({fill:c})}this.dispatch("rollOutItem",a,b)}},clickLabel:function(a,b){this.textClickEnabled?a.hidden||this.dispatch("clickLabel",a,b):this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",
|
135 |
-
a,b))},dispatch:function(a,b,c){this.fire(a,{type:a,dataItem:b,target:this,event:c,chart:this.chart})},createValue:function(a){var b=this,c=b.fontSize;if(!1!==a.visibleInLegend){var
|
136 |
-
b.valueWidth,
|
137 |
-
c)}).click(function(c){b.clickLabel(a,c)})}},createV:function(){var a=this.markerSize;return AmCharts.polygon(this.container,[a/5,a/2,a-a/5,a/2],[a/3,a-a/5,a/5,a/1.7],this.switchColor)},createX:function(){var a=(this.markerSize-4)/2,b={stroke:this.switchColor,"stroke-width":3},c=this.container,d=AmCharts.line(c,[-a,a],[-a,a]).attr(b),a=AmCharts.line(c,[-a,a],[a,-a]).attr(b);return this.container.set([d,a])},createMarker:function(a,b,c,d,f,e,g,h){var k=this.markerSize,
|
138 |
-
f||(f=b);isNaN(d)&&(d=this.markerBorderThickness);isNaN(e)&&(e=this.markerBorderAlpha);return AmCharts.bullet(l,a,k,b,c,d,f,e,k,g,h)},validateNow:function(){this.invalidateSize()},updateValues:function(){var a=this.valueLabels,b=this.chart,c,d=this.data;for(c=0;c<a.length;c++){var f=a[c],e=f.dItem,g=" ";if(d)e.value?f.text(e.value):f.text("");else{if(void 0!==e.type){var h=e.currentDataItem,k=this.periodValueText;e.legendPeriodValueText&&(k=e.legendPeriodValueText);
|
139 |
-
(g=e.legendValueText),g=b.formatString(g,h)):k&&(g=b.formatPeriodString(k,e))}else g=b.formatString(this.valueText,e);if(k=this.valueFunction)h&&(e=h),g=k(e,g);f.text(g)}}},renderFix:function(){if(!AmCharts.VML){var a=this.container;a&&a.renderFix()}},destroy:function(){this.div.innerHTML="";AmCharts.remove(this.set)}});AmCharts.AmMap=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(a){this.cname="AmMap";this.type="map";this.theme=a;this.version="3.
|
140 |
this.fitMapToContainer=!0;this.mouseWheelZoomEnabled=this.backgroundZoomsToTop=!1;this.allowClickOnSelectedObject=this.useHandCursorOnClickableOjects=this.showBalloonOnSelectedObject=!0;this.showObjectsAfterZoom=this.wheelBusy=!1;this.zoomOnDoubleClick=this.useObjectColorForBalloon=!0;this.allowMultipleDescriptionWindows=!1;this.dragMap=this.centerMap=this.linesAboveImages=!0;this.colorSteps=5;this.showAreasInList=!0;this.showLinesInList=this.showImagesInList=!1;this.areasProcessor=new AmCharts.AreasProcessor(this);
|
141 |
this.areasSettings=new AmCharts.AreasSettings(a);this.imagesProcessor=new AmCharts.ImagesProcessor(this);this.imagesSettings=new AmCharts.ImagesSettings(a);this.linesProcessor=new AmCharts.LinesProcessor(this);this.linesSettings=new AmCharts.LinesSettings(a);this.showDescriptionOnHover=!1;AmCharts.AmMap.base.construct.call(this,a);this.creditsPosition="bottom-left";this.product="ammap";this.areasClasses={};AmCharts.applyTheme(this,a,this.cname)},initChart:function(){this.zoomInstantly=!0;var a=this.container;
|
142 |
if(this.sizeChanged&&AmCharts.hasSVG&&this.chartCreated){this.freeLabelsSet&&this.freeLabelsSet.remove();this.freeLabelsSet=a.set();this.container.setSize(this.realWidth,this.realHeight);this.resizeMap();this.drawBackground();this.redrawLabels();this.drawTitles();this.processObjects();this.rescaleObjects();a=this.container;this.zoomControl.init(this,a);this.drawBg();var b=this.smallMap;b&&b.init(this,a);(b=this.valueLegend)&&b.init(this,a);this.sizeChanged=!1;this.zoomToLongLat(this.zLevelTemp,this.zLongTemp,
|
143 |
this.zLatTemp,!0);this.previousWidth=this.realWidth;this.previousHeight=this.realHeight;this.updateSmallMap();this.linkSet.toFront()}else(AmCharts.AmMap.base.initChart.call(this),AmCharts.hasSVG)?(this.dataChanged&&(this.parseData(),this.dispatchDataUpdated=!0,this.dataChanged=!1,a=this.legend)&&(a.position="absolute",a.invalidateSize()),this.createDescriptionsDiv(),this.svgAreas=[],this.svgAreasById={},this.drawChart()):(document.createTextNode(this.svgNotSupported),this.chartDiv.style.textAlign=
|
144 |
"",this.chartDiv.setAttribute("class","ammapAlert"),this.chartDiv.innerHTML=this.svgNotSupported,this.fire("failed",{type:"failed",chart:this}),clearInterval(this.interval))},invalidateSize:function(){var a=this.zoomLongitude();isNaN(a)||(this.zLongTemp=a);a=this.zoomLatitude();isNaN(a)||(this.zLatTemp=a);a=this.zoomLevel();isNaN(a)||(this.zLevelTemp=a);AmCharts.AmMap.base.invalidateSize.call(this)},handleWheelReal:function(a){if(!this.wheelBusy){this.stopAnimation();var b=this.zoomLevel(),c=this.zoomControl,
|
145 |
-
d=c.zoomFactor;this.wheelBusy=!0;a=AmCharts.fitToBounds(0<a?b*d:b/d,c.minZoomLevel,c.maxZoomLevel);d=this.mouseX/this.mapWidth;c=this.mouseY/this.mapHeight;d=(this.zoomX()-d)*(a/b)+d;b=(this.zoomY()-c)*(a/b)+c;this.zoomTo(a,d,b)}},addLegend:function(a,b){a.position="absolute";a.autoMargins=!1;a.valueWidth=0;a.switchable=!1;AmCharts.AmMap.base.addLegend.call(this,a,b);return a},handleLegendEvent:function(){},createDescriptionsDiv:function(){if(!this.descriptionsDiv){var a=
|
146 |
-
b=a.style;b.position="absolute";b.left="0px";b.top="0px";this.descriptionsDiv=a}this.containerDiv.appendChild(this.descriptionsDiv)},drawChart:function(){AmCharts.AmMap.base.drawChart.call(this);var a=this.dataProvider;this.dataProvider=a=AmCharts.extend(a,new AmCharts.MapData,!0);this.areasSettings=AmCharts.processObject(this.areasSettings,AmCharts.AreasSettings,this.theme);this.imagesSettings=AmCharts.processObject(this.imagesSettings,AmCharts.ImagesSettings,this.theme);
|
147 |
-
AmCharts.LinesSettings,this.theme);var b=this.container;this.mapContainer&&this.mapContainer.remove();this.mapContainer=b.set();this.graphsSet.push(this.mapContainer);var c;a.map&&(c=AmCharts.maps[a.map]);a.mapVar&&(c=a.mapVar);c?(this.svgData=c.svg,this.getBounds(),this.buildEverything()):(a=a.mapURL)&&this.loadXml(a);this.balloonsSet.toFront()},drawBg:function(){var a=this;
|
148 |
-
|
149 |
-
2)
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
(
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
(c=this.zoomLevel()),b.setAttr("fill-opacity",a.alphaReal),b.setAttr("stroke-opacity",a.outlineAlphaReal),b.setAttr("stroke-width",a.outlineThicknessReal/c));(c=a.pattern)&&b.pattern(c,this.mapScale);(b=a.imageLabel)&&!a.labelInactive&&b.setAttr("fill",a.labelColorReal)}},zoomToRectangle:function(a,b,c,d){var f=this.realWidth,e=this.realHeight,g=this.mapSet.scale,h=this.zoomControl,f=AmCharts.fitToBounds(c/f>d/e?.8*f/(c*g):.8*e/(d*g),h.minZoomLevel,h.maxZoomLevel);this.zoomToMapXY(f,(a+c/2)*g,(b+
|
167 |
d/2)*g)},zoomToLatLongRectangle:function(a,b,c,d){var f=this.dataProvider,e=this.zoomControl,g=Math.abs(c-a),h=Math.abs(b-d),k=Math.abs(f.rightLongitude-f.leftLongitude),f=Math.abs(f.topLatitude-f.bottomLatitude),e=AmCharts.fitToBounds(g/k>h/f?.8*k/g:.8*f/h,e.minZoomLevel,e.maxZoomLevel);this.zoomToLongLat(e,a+(c-a)/2,d+(b-d)/2)},getGroupById:function(a){var b=[];this.getGroup(this.imagesProcessor.allObjects,a,b);this.getGroup(this.linesProcessor.allObjects,a,b);this.getGroup(this.areasProcessor.allObjects,
|
168 |
a,b);return b},zoomToGroup:function(a){a="object"==typeof a?a:this.getGroupById(a);var b,c,d,f,e;for(e=0;e<a.length;e++){var g=a[e].displayObject.getBBox(),h=g.y,k=g.y+g.height,l=g.x,g=g.x+g.width;if(h<b||isNaN(b))b=h;if(k>f||isNaN(f))f=k;if(l<c||isNaN(c))c=l;if(g>d||isNaN(d))d=g}a=this.mapSet.getBBox();c-=a.x;d-=a.x;f-=a.y;b-=a.y;this.zoomToRectangle(c,b,d-c,f-b)},getGroup:function(a,b,c){if(a){var d;for(d=0;d<a.length;d++){var f=a[d];f.groupId==b&&c.push(f)}}},zoomToStageXY:function(a,b,c,d){if(!this.objectWasClicked){var f=
|
@@ -172,76 +181,81 @@ b,d=e.y*b,f=e.width*b,e=e.height*b,h=a.autoZoomReal&&isNaN(a.zoomLevel)?f/h>e/k?
|
|
172 |
f=this.zoomLevel();isNaN(b)&&(b=this.realWidth/this.mapWidth,b=(this.zoomX()-.5*b)*(a/f)+.5*b);isNaN(c)&&(c=this.realHeight/this.mapHeight,c=(this.zoomY()-.5*c)*(a/f)+.5*c);this.stopAnimation();isNaN(a)||(f=this.mapContainer,this.initialX=f.x,this.initialY=f.y,this.initialScale=f.scale,this.finalX=this.mapWidth*b,this.finalY=this.mapHeight*c,this.finalScale=a,this.finalX!=this.initialX||this.finalY!=this.initialY||this.finalScale!=this.initialScale?d?(this.tweenPercent=1,this.rescaleMapAndObjects(),
|
173 |
this.wheelBusy=!1):this.animateMap():this.wheelBusy=!1)},loadXml:function(a){var b;b=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");b.overrideMimeType&&b.overrideMimeType("text/xml");b.open("GET",a,!1);b.send();this.parseXMLObject(b.responseXML);this.svgData&&this.buildEverything()},stopAnimation:function(){this.frame=this.totalFrames},processObjects:function(){var a=this.container,b=this.stageImagesContainer;b&&b.remove();this.stageImagesContainer=b=a.set();this.trendLinesSet.push(b);
|
174 |
var c=this.stageLinesContainer;c&&c.remove();this.stageLinesContainer=c=a.set();this.trendLinesSet.push(c);var d=this.mapImagesContainer;d&&d.remove();this.mapImagesContainer=d=a.set();this.mapContainer.push(d);var f=this.mapLinesContainer;f&&f.remove();this.mapLinesContainer=f=a.set();this.mapContainer.push(f);this.linesAboveImages?(d.toFront(),b.toFront(),f.toFront(),c.toFront()):(f.toFront(),c.toFront(),d.toFront(),b.toFront());if(a=this.selectedObject)this.imagesProcessor.reset(),this.linesProcessor.reset(),
|
175 |
-
this.linesAboveImages?(this.imagesProcessor.process(a),this.linesProcessor.process(a)):(this.linesProcessor.process(a),this.imagesProcessor.process(a));this.rescaleObjects()},processAreas:function(){this.areasProcessor.process(this.dataProvider)},buildSVGMap:function(){var a=this.svgData.g.path,b=this.container,c=b.set();void 0===a.length&&(a=[a]);var d;for(d=0;d<a.length;d++){var f=a[d],e=f.d,g=f.title;f.titleTr&&(g=f.titleTr);e=b.path(e);e.id=f.id;this.
|
176 |
-
this.svgAreas.push(e);c.push(e)}this.mapSet=c;this.mapContainer.push(c);this.resizeMap()},addObjectEventListeners:function(a,b){var c=this;a.mouseup(function(a){c.clickMapObject(b,a)}).mouseover(function(a){c.rollOverMapObject(b,!0,a)}).mouseout(function(a){c.rollOutMapObject(b,a)}).touchend(function(a){c.clickMapObject(b,a)}).touchstart(function(a){c.rollOverMapObject(b
|
177 |
-
0;c<b.length;c++)if(b[c]==a)return!0}return!1},clearMap:function(){this.chartDiv.innerHTML="";this.clearObjectList()},clearObjectList:function(){var a=this.objectList;a&&a.div&&(a.div.innerHTML="")},checkIfLast:function(a){if(a){var b=a.parentNode;if(b&&b.lastChild==a)return!0}return!1},showAsRolledOver:function(a){var b=a.displayObject;if(!a.showAsSelected&&b&&!a.isOver){b.node.onmouseout=
|
178 |
-
(b.toFront(),a.isFirst=!0);var c=a.rollOverColorReal,d;if(void 0!=c)if("MapImage"==a.objectType)(d=a.image)&&d.setAttr("fill",c);else if("MapLine"==a.objectType){if((d=a.lineSvg)&&d.setAttr("stroke",c),d=a.arrowSvg)d.setAttr("fill",c),d.setAttr("stroke",c)}else b.setAttr("fill",c);(c=a.imageLabel)&&!a.labelInactive&&(d=a.labelRollOverColorReal,void 0!=
|
179 |
-
if("MapArea"==a.objectType){c=this.areasSettings;d=a.rollOverAlphaReal;isNaN(d)||b.setAttr("fill-opacity",d);d=c.rollOverOutlineAlpha;isNaN(d)||b.setAttr("stroke-opacity",d);d=1;this.areasSettings.adjustOutlineThickness&&(d=this.zoomLevel());var f=c.rollOverOutlineThickness;isNaN(f)||b.setAttr("stroke-width",f/d);(c=c.rollOverPattern)&&b.pattern(c,this.mapScale)}"MapImage"==
|
180 |
-
this.checkIfClickable(a)&&b.setAttr("cursor","pointer");this.addObjectEventListeners(b,a);a.isOver=!0}},rollOverMapObject:function(a,b,c){if(this.chartCreated){this.handleMouseMove();var d=this.previouslyHovered;d&&d!=a?(!1===this.checkIfSelected(d)&&(this.returnInitialColor(d,!0),this.previouslyHovered=null),this.hideBalloon()):clearTimeout(this.hoverInt);
|
181 |
-
a.displayObject)&&(this.allowClickOnSelectedObject?d.setAttr("cursor","pointer"):d.setAttr("cursor","default"));if(this.showDescriptionOnHover)this.showDescription(a);else if((this.showBalloonOnSelectedObject||!this.checkIfSelected(a))&&!1!==b&&(f=this.balloon,b=a.colorReal,d="",void 0!==b&&this.useObjectColorForBalloon||
|
182 |
-
this.getAreaCenterLatitude(a),e=this.getAreaCenterLongitude(a),g=this.latitudeToY(g),e=this.longitudeToX(e));
|
183 |
-
|
184 |
-
"[[percent]]":c,"[[description]]":d,"[[customData]]":g})},clickMapObject:function(a,b){this.hideBalloon();if(this.chartCreated&&!this.preventHover&&!this.mapWasDragged&&this.checkIfClickable(a)
|
185 |
-
a.objectType&&a.autoZoomReal||a.url||a.linkToObject||0<a.images.length||0<a.lines.length||!isNaN(a.zoomLevel)||!isNaN(a.zoomX)||!isNaN(a.zoomY)||a.description?!0:!1:!1},handleResize:function(){(AmCharts.isPercents(this.width)||
|
186 |
-
c;this.mapHeight=e*c;this.mapWidth=f*c}else b=group.transform.match(/([\-]?[\d.]+)/g),a.translate(b[0],b[1],b[2])},zoomIn:function(){this.skipClick=!0;var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomTo(a)},zoomOut:function(){this.skipClick
|
187 |
-
this.zoomControl.
|
188 |
-
this.mapHeight)/1E4:NaN},goHome:function(){this.selectObject(this.dataProvider);var a={type:"homeButtonClicked",chart:this};this.fire(a.type,a)},zoomLevel:function(){return Math.round(1E5*this.mapContainer.scale)/1E5},showDescriptionAndGetUrl:function(){var a=
|
189 |
-
this.zoomLatitude(),b.zoomLongitude=this.zoomLongitude(),b.zoomLevel=this.zoomLevel());this.extendMapData(b)||this.selectObject(b)}}},extendMapData:function(a){var b=a.objectType;if("MapImage"!=b&&"MapArea"!=b&&"MapLine"!=b)return AmCharts.extend(a,
|
190 |
-
b&&b.close();b=new AmCharts.DescriptionWindow;a.descriptionWindow=b;var c=a.descriptionWindowWidth,d=a.descriptionWindowHeight,f=a.descriptionWindowLeft,e=a.descriptionWindowTop,g=a.descriptionWindowRight,h=a.descriptionWindowBottom;isNaN(g)||(f=
|
191 |
-
a.titleTr);b.show(this,this.descriptionsDiv,a.description,k);a=b.div.style;a.position="absolute";a.width=c+"px";a.maxHeight=d+"px";isNaN(h)||(e-=b.div.offsetHeight);isNaN(g)||(f-=b.div.offsetWidth);a.left=f+"px";a.top=e+"px"}},parseXMLObject:function(a){var b=
|
192 |
-
a.topLatitude=Number(b.topLatitude);a.bottomLatitude=Number(b.bottomLatitude);a.projection=b.projection;var c=b.wrappedLongitudes;c&&(a.rightLongitude+=360);a.wrappedLongitudes=c}catch(d){}},recalcLongitude:function(a){var b=this.dataProvider.wrappedLongitudes;
|
193 |
-
b=this.mercatorLatitudeToCoordinate(b),d=this.mercatorLatitudeToCoordinate(d));b=(a-b)/(d-b)*this.mapHeight}return b},longitudeToCoordinate:function(a){a=this.recalcLongitude(a);var b,c=this.dataProvider;this.mapSet&&(b=c.leftLongitude,b=(a-b)/(c.rightLongitude-
|
194 |
-
|
195 |
-
|
196 |
-
b)/1E6},
|
197 |
-
this.zoomTo(b,a,c);isNaN(d)||isNaN(f)||this.zoomToLongLat(b,d,f,!0)}}},parseXMLNode:function(a,b,c,d){void 0===d&&(d="");var f,e,g;if(c){var h=c.childNodes.length;for(f=0;f<h;f++){e=c.childNodes[f];
|
198 |
-
a[b][k]?void 0===a[b][k].length?(n=a[b][k],a[b][k]=[],a[b][k].push(n),a[b][k].push({}),n=a[b][k][1]):"object"==typeof a[b][k]&&(a[b][k].push({}),n=a[b][k][a[b][k].length-1]):(a[b][k]={},n=a[b][k]);if(e.attributes&&
|
199 |
-
(a[b]=c)}},doDoubleClickZoom:function(){if(!this.mapWasDragged){var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomToStageXY(a,this.mouseX,this.mouseY)}},getDevInfo:function(){var a=this.zoomLevel(),a={chart:this,
|
200 |
-
a
|
201 |
-
",
|
202 |
-
|
203 |
-
a,"image");this.processObject(a.lines,a,"line")},processObject:function(a,b,c){if(a){var d;for(d=0;d<a.length;d++){var f=a[d];f.parentObject=b;"area"==c&&AmCharts.extend(f,new AmCharts.MapArea(this.theme),!0);"image"==c&&(f=
|
204 |
-
positionChanged:function(){var a={type:"positionChanged",zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLevel:this.zoomLevel(),chart:this};this.fire(a.type,a)},getX:function(a,b){return this.getXY(a,this.realWidth,b)},getY:function(a,
|
205 |
-
|
206 |
-
this.
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
a),
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
241 |
AmCharts.processDescriptionWindow=function(a,b){isNaN(b.descriptionWindowX)&&(b.descriptionWindowX=a.descriptionWindowX);isNaN(b.descriptionWindowY)&&(b.descriptionWindowY=a.descriptionWindowY);isNaN(b.descriptionWindowLeft)&&(b.descriptionWindowLeft=a.descriptionWindowLeft);isNaN(b.descriptionWindowRight)&&(b.descriptionWindowRight=a.descriptionWindowRight);isNaN(b.descriptionWindowTop)&&(b.descriptionWindowTop=a.descriptionWindowTop);isNaN(b.descriptionWindowBottom)&&(b.descriptionWindowBottom=
|
242 |
-
a.descriptionWindowBottom);isNaN(b.descriptionWindowWidth)&&(b.descriptionWindowWidth=a.descriptionWindowWidth);isNaN(b.descriptionWindowHeight)&&(b.descriptionWindowHeight=a.descriptionWindowHeight)};AmCharts.MapData=AmCharts.Class({inherits:AmCharts.MapObject,construct:function(){this.cname="MapData";AmCharts.MapData.base.construct.call(this);this.projection="mercator";this.topLatitude=90;this.bottomLatitude=-90;this.leftLongitude=-180;this.rightLongitude=180;this.zoomLevel=1;this.getAreasFromMap=!1}});AmCharts.DescriptionWindow=AmCharts.Class({construct:function(){},show:function(a,b,c,d){var f=this,e=document.createElement("div");e.style.position="absolute";e.className="ammapDescriptionWindow";f.div=e;b.appendChild(e);var
|
243 |
-
"xIcon.gif"};e.appendChild(
|
244 |
-
l=a.fontFamily,m=this.color;void 0==h&&(h=a.minValueReal);void 0!==h&&(g=AmCharts.text(b,h,m,l,k,"left"),g.translate(0,k/2-1),e.push(g),g=g.getBBox().height);h=this.maxValue;void 0===h&&(h=a.maxValueReal);void 0!==h&&(g=AmCharts.text(b,h,m,l,k,"right"),g.translate(this.width,k/2-1),e.push(g),g=g.getBBox().height);if(this.showAsGradient)c=AmCharts.rect(b,
|
245 |
-
d,1*l/(f-1)),m=AmCharts.rect(b,k,this.height,m,1,this.borderThickness,this.borderColor,1),m.translate(k*l,g),e.push(m);d=c=0;f=e.getBBox();g=a.getY(this.bottom,!0);k=a.getY(this.top);l=a.getX(this.right,!0);
|
246 |
-
c.
|
247 |
-
|
|
3 |
a,b);this.events[a].push({handler:b,scope:c})},b.prototype.removeListener=function(a,b,c){if(a&&a.events)for(a=a.events[b],b=a.length-1;0<=b;b--)a[b].handler===c&&a.splice(b,1)},b.prototype.fire=function(a,b){for(var c=this.events[a],g=0,h=c.length;g<h;g++){var k=c[g];k.handler.call(k.scope,b)}});for(var c in a)b.prototype[c]=a[c];return b};AmCharts.addChart=function(a){AmCharts.charts.push(a)};AmCharts.removeChart=function(a){for(var b=AmCharts.charts,c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)};
|
4 |
AmCharts.isModern=!0;AmCharts.getIEVersion=function(){var a=0;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=/MSIE ([0-9]{1,}[.0-9]{0,})/;null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}else"Netscape"==navigator.appName&&(b=navigator.userAgent,c=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/,null!=c.exec(b)&&(a=parseFloat(RegExp.$1)));return a};
|
5 |
AmCharts.applyLang=function(a,b){var c=AmCharts.translations;b.dayNames=AmCharts.dayNames;b.shortDayNames=AmCharts.shortDayNames;b.monthNames=AmCharts.monthNames;b.shortMonthNames=AmCharts.shortMonthNames;c&&(c=c[a])&&(AmCharts.lang=c,c.monthNames&&(b.dayNames=c.dayNames,b.shortDayNames=c.shortDayNames,b.monthNames=c.monthNames,b.shortMonthNames=c.shortMonthNames))};AmCharts.IEversion=AmCharts.getIEVersion();9>AmCharts.IEversion&&0<AmCharts.IEversion&&(AmCharts.isModern=!1,AmCharts.isIE=!0);
|
6 |
+
AmCharts.dx=0;AmCharts.dy=0;if(document.addEventListener||window.opera)AmCharts.isNN=!0,AmCharts.isIE=!1,AmCharts.dx=.5,AmCharts.dy=.5;document.attachEvent&&(AmCharts.isNN=!1,AmCharts.isIE=!0,AmCharts.isModern||(AmCharts.dx=0,AmCharts.dy=0));window.chrome&&(AmCharts.chrome=!0);AmCharts.handleResize=function(){for(var a=AmCharts.charts,b=0;b<a.length;b++){var c=a[b];c&&c.div&&c.handleResize()}};
|
7 |
+
AmCharts.handleMouseUp=function(a){for(var b=AmCharts.charts,c=0;c<b.length;c++){var d=b[c];d&&d.handleReleaseOutside&&d.handleReleaseOutside(a)}};AmCharts.handleMouseMove=function(a){for(var b=AmCharts.charts,c=0;c<b.length;c++){var d=b[c];d&&d.handleMouseMove&&d.handleMouseMove(a)}};
|
8 |
+
AmCharts.handleWheel=function(a){for(var b=AmCharts.charts,c=0;c<b.length;c++){var d=b[c];if(d&&d.mouseIsOver){d.mouseWheelScrollEnabled||d.mouseWheelZoomEnabled?d.handleWheel&&d.handleWheel(a):a.stopPropagation&&a.stopPropagation();break}}};AmCharts.resetMouseOver=function(){for(var a=AmCharts.charts,b=0;b<a.length;b++){var c=a[b];c&&(c.mouseIsOver=!1)}};AmCharts.ready=function(a){AmCharts.onReadyArray.push(a)};
|
9 |
+
AmCharts.handleLoad=function(){AmCharts.isReady=!0;for(var a=AmCharts.onReadyArray,b=0;b<a.length;b++){var c=a[b];isNaN(AmCharts.processDelay)?c():setTimeout(c,AmCharts.processDelay*b)}};AmCharts.addInitHandler=function(a,b){AmCharts.initHandlers.push({method:a,types:b})};AmCharts.callInitHandler=function(a){var b=AmCharts.initHandlers;if(AmCharts.initHandlers)for(var c=0;c<b.length;c++){var d=b[c];d.types?AmCharts.isInArray(d.types,a.type)&&d.method(a):d.method(a)}};
|
10 |
+
AmCharts.getUniqueId=function(){AmCharts.uid++;return"AmChartsEl-"+AmCharts.uid};
|
11 |
+
AmCharts.isNN&&(document.addEventListener("mousemove",AmCharts.handleMouseMove,!0),window.addEventListener("resize",AmCharts.handleResize,!0),window.addEventListener("orientationchange",AmCharts.handleResize,!0),document.addEventListener("mouseup",AmCharts.handleMouseUp,!0),window.addEventListener("load",AmCharts.handleLoad,!0),window.addEventListener("DOMMouseScroll",AmCharts.handleWheel,!0),document.addEventListener("mousewheel",AmCharts.handleWheel,!0));
|
12 |
AmCharts.isIE&&(document.attachEvent("onmousemove",AmCharts.handleMouseMove),window.attachEvent("onresize",AmCharts.handleResize),document.attachEvent("onmouseup",AmCharts.handleMouseUp),window.attachEvent("onload",AmCharts.handleLoad));
|
13 |
AmCharts.clear=function(){var a=AmCharts.charts;if(a)for(var b=0;b<a.length;b++)a[b].clear();AmCharts.charts=null;AmCharts.isNN&&(document.removeEventListener("mousemove",AmCharts.handleMouseMove,!0),window.removeEventListener("resize",AmCharts.handleResize,!0),document.removeEventListener("mouseup",AmCharts.handleMouseUp,!0),window.removeEventListener("load",AmCharts.handleLoad,!0),window.removeEventListener("DOMMouseScroll",AmCharts.handleWheel,!0),document.removeEventListener("mousewheel",AmCharts.handleWheel,
|
14 |
!0));AmCharts.isIE&&(document.detachEvent("onmousemove",AmCharts.handleMouseMove),window.detachEvent("onresize",AmCharts.handleResize),document.detachEvent("onmouseup",AmCharts.handleMouseUp),window.detachEvent("onload",AmCharts.handleLoad))};
|
15 |
AmCharts.makeChart=function(a,b,c){var d=b.type,f=b.theme;AmCharts.isString(f)&&(f=AmCharts.themes[f],b.theme=f);var e;switch(d){case "serial":e=new AmCharts.AmSerialChart(f);break;case "xy":e=new AmCharts.AmXYChart(f);break;case "pie":e=new AmCharts.AmPieChart(f);break;case "radar":e=new AmCharts.AmRadarChart(f);break;case "gauge":e=new AmCharts.AmAngularGauge(f);break;case "funnel":e=new AmCharts.AmFunnelChart(f);break;case "map":e=new AmCharts.AmMap(f);break;case "stock":e=new AmCharts.AmStockChart(f)}AmCharts.extend(e,
|
16 |
+
b);AmCharts.isReady?isNaN(c)?e.write(a):setTimeout(function(){AmCharts.realWrite(e,a)},c):AmCharts.ready(function(){isNaN(c)?e.write(a):setTimeout(function(){AmCharts.realWrite(e,a)},c)});return e};AmCharts.realWrite=function(a,b){a.write(b)};AmCharts.toBoolean=function(a,b){if(void 0===a)return b;switch(String(a).toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return Boolean(a)}};AmCharts.removeFromArray=function(a,b){var c;if(void 0!=b&&void 0!=a)for(c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1)};AmCharts.isInArray=function(a,b){for(var c=0;c<a.length;c++)if(a[c]==b)return!0;return!1};
|
17 |
+
AmCharts.getDecimals=function(a){var b=0;isNaN(a)||(a=String(a),-1!=a.indexOf("e-")?b=Number(a.split("-")[1]):-1!=a.indexOf(".")&&(b=a.split(".")[1].length));return b};
|
18 |
+
AmCharts.wrappedText=function(a,b,c,d,f,e,g,h,k){var l=AmCharts.text(a,b,c,d,f,e,g),m="\n";AmCharts.isModern||(m="<br>");if(10<k)return l;if(l){var n=l.getBBox();if(n.width>h){n=Math.ceil(n.width/h);l.remove();for(var l=[],t=0;-1<(index=b.indexOf(" ",t));)l.push(index),t=index+1;Math.round(b.length/2);for(var p,t=0;t<l.length;t+=Math.ceil(l.length/n))p=l[t],b=b.substr(0,p)+m+b.substr(p+1);if(isNaN(p)){if(0==k)for(t=1;t<n;t++)p=Math.round(b.length/n*t),b=b.substr(0,p)+m+b.substr(p);return AmCharts.text(a,
|
19 |
b,c,d,f,e,g)}return AmCharts.wrappedText(a,b,c,d,f,e,g,h,k+1)}return l}};AmCharts.getStyle=function(a,b){var c="";document.defaultView&&document.defaultView.getComputedStyle?c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b):a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);return c};AmCharts.removePx=function(a){if(void 0!=a)return Number(a.substring(0,a.length-2))};
|
20 |
AmCharts.getURL=function(a,b){if(a)if("_self"!=b&&b)if("_top"==b&&window.top)window.top.location.href=a;else if("_parent"==b&&window.parent)window.parent.location.href=a;else if("_blank"==b)window.open(a);else{var c=document.getElementsByName(b)[0];c?c.src=a:(c=AmCharts.windows[b])?c.opener&&!c.opener.closed?c.location.href=a:AmCharts.windows[b]=window.open(a):AmCharts.windows[b]=window.open(a)}else window.location.href=a};AmCharts.ifArray=function(a){return a&&0<a.length?!0:!1};
|
21 |
AmCharts.callMethod=function(a,b){var c;for(c=0;c<b.length;c++){var d=b[c];if(d){if(d[a])d[a]();var f=d.length;if(0<f){var e;for(e=0;e<f;e++){var g=d[e];if(g&&g[a])g[a]()}}}}};AmCharts.toNumber=function(a){return"number"==typeof a?a:Number(String(a).replace(/[^0-9\-.]+/g,""))};
|
38 |
AmCharts.copyProperties=function(a,b){for(var c in a)a.hasOwnProperty(c)&&"events"!=c&&void 0!==a[c]&&"function"!=typeof a[c]&&"cname"!=c&&(b[c]=a[c])};AmCharts.processObject=function(a,b,c){!1===a instanceof b&&(a=AmCharts.extend(new b(c),a));return a};AmCharts.fixNewLines=function(a){var b=RegExp("\\n","g");a&&(a=a.replace(b,"<br />"));return a};AmCharts.fixBrakes=function(a){if(AmCharts.isModern){var b=RegExp("<br>","g");a&&(a=a.replace(b,"\n"))}else a=AmCharts.fixNewLines(a);return a};
|
39 |
AmCharts.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)AmCharts.deleteObject(a[c],b-1),a[c]=null;else if(a&&!a.tagName)try{for(c in a)a[c]&&("object"==typeof a[c]&&AmCharts.deleteObject(a[c],b-1),"function"!=typeof a[c]&&(a[c]=null))}catch(d){}}};
|
40 |
AmCharts.bounce=function(a,b,c,d,f){return(b/=f)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c};AmCharts.easeInSine=function(a,b,c,d,f){return-d*Math.cos(b/f*(Math.PI/2))+d+c};AmCharts.easeOutSine=function(a,b,c,d,f){return d*Math.sin(b/f*(Math.PI/2))+c};
|
41 |
+
AmCharts.easeOutElastic=function(a,b,c,d,f){a=1.70158;var e=0,g=d;if(0===b)return c;if(1==(b/=f))return c+d;e||(e=.3*f);g<Math.abs(d)?(g=d,a=e/4):a=e/(2*Math.PI)*Math.asin(d/g);return g*Math.pow(2,-10*b)*Math.sin(2*(b*f-a)*Math.PI/e)+d+c};AmCharts.fixStepE=function(a){a=a.toExponential(0).split("e");var b=Number(a[1]);9==Number(a[0])&&b++;return AmCharts.generateNumber(1,b)};
|
42 |
+
AmCharts.generateNumber=function(a,b){var c="",d;d=0>b?Math.abs(b)-1:Math.abs(b);var f;for(f=0;f<d;f++)c+="0";return 0>b?Number("0."+c+String(a)):Number(String(a)+c)};AmCharts.setCN=function(a,b,c,d){if(a.addClassNames&&b&&(b=b.node)&&c){var f=b.getAttribute("class");a=a.classNamePrefix+"-";d&&(a="");f?b.setAttribute("class",f+" "+a+c):b.setAttribute("class",a+c)}};
|
43 |
+
AmCharts.parseDefs=function(a,b){for(var c in a){var d=typeof a[c];if(0<a[c].length&&"object"==d)for(d=0;d<a[c].length;d++){var f=document.createElementNS(AmCharts.SVG_NS,c);b.appendChild(f);AmCharts.parseDefs(a[c][d],f)}else"object"==d?(f=document.createElementNS(AmCharts.SVG_NS,c),b.appendChild(f),AmCharts.parseDefs(a[c],f)):b.setAttribute(c,a[c])}};AmCharts.AmDraw=AmCharts.Class({construct:function(a,b,c,d){AmCharts.SVG_NS="http://www.w3.org/2000/svg";AmCharts.SVG_XLINK="http://www.w3.org/1999/xlink";AmCharts.hasSVG=!!document.createElementNS&&!!document.createElementNS(AmCharts.SVG_NS,"svg").createSVGRect;1>b&&(b=10);1>c&&(c=10);this.div=a;this.width=b;this.height=c;this.rBin=document.createElement("div");AmCharts.hasSVG?(AmCharts.SVG=!0,b=this.createSvgElement("svg"),a.appendChild(b),this.container=b,this.addDefs(d),this.R=new AmCharts.SVGRenderer(this)):
|
44 |
+
AmCharts.isIE&&AmCharts.VMLRenderer&&(AmCharts.VML=!0,AmCharts.vmlStyleSheet||(document.namespaces.add("amvml","urn:schemas-microsoft-com:vml"),31>document.styleSheets.length?(b=document.createStyleSheet(),b.addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true"),AmCharts.vmlStyleSheet=b):document.styleSheets[0].addRule(".amvml","behavior:url(#default#VML); display:inline-block; antialias:true")),this.container=a,this.R=new AmCharts.VMLRenderer(this,d),this.R.disableSelection(a))},
|
45 |
+
createSvgElement:function(a){return document.createElementNS(AmCharts.SVG_NS,a)},circle:function(a,b,c,d){var f=new AmCharts.AmDObject("circle",this);f.attr({r:c,cx:a,cy:b});this.addToContainer(f.node,d);return f},ellipse:function(a,b,c,d,f){var e=new AmCharts.AmDObject("ellipse",this);e.attr({rx:c,ry:d,cx:a,cy:b});this.addToContainer(e.node,f);return e},setSize:function(a,b){0<a&&0<b&&(this.container.style.width=a+"px",this.container.style.height=b+"px")},rect:function(a,b,c,d,f,e,g){var h=new AmCharts.AmDObject("rect",
|
46 |
+
this);AmCharts.VML&&(f=Math.round(100*f/Math.min(c,d)),c+=2*e,d+=2*e,h.bw=e,h.node.style.marginLeft=-e,h.node.style.marginTop=-e);1>c&&(c=1);1>d&&(d=1);h.attr({x:a,y:b,width:c,height:d,rx:f,ry:f,"stroke-width":e});this.addToContainer(h.node,g);return h},image:function(a,b,c,d,f,e){var g=new AmCharts.AmDObject("image",this);g.attr({x:b,y:c,width:d,height:f});this.R.path(g,a);this.addToContainer(g.node,e);return g},addToContainer:function(a,b){b||(b=this.container);b.appendChild(a)},text:function(a,
|
47 |
+
b,c){return this.R.text(a,b,c)},path:function(a,b,c,d){var f=new AmCharts.AmDObject("path",this);d||(d="100,100");f.attr({cs:d});c?f.attr({dd:a}):f.attr({d:a});this.addToContainer(f.node,b);return f},set:function(a){return this.R.set(a)},remove:function(a){if(a){var b=this.rBin;b.appendChild(a);b.innerHTML=""}},renderFix:function(){var a=this.container,b=a.style,c;try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(d){c=a.createSVGMatrix()}a=1-c.e%1;c=1-c.f%1;.5<a&&--a;.5<c&&--c;a&&(b.left=a+"px");
|
48 |
+
c&&(b.top=c+"px")},update:function(){this.R.update()},addDefs:function(a){if(AmCharts.hasSVG){var b=this.createSvgElement("desc"),c=this.container;c.setAttribute("version","1.1");c.style.position="absolute";this.setSize(this.width,this.height);AmCharts.rtl&&(c.setAttribute("direction","rtl"),c.style.left="auto",c.style.right="0px");b.appendChild(document.createTextNode("JavaScript chart by amCharts "+a.version));c.appendChild(b);a.defs&&(b=this.createSvgElement("defs"),c.appendChild(b),AmCharts.parseDefs(a.defs,
|
49 |
+
b),this.defs=b)}}});AmCharts.AmDObject=AmCharts.Class({construct:function(a,b){this.D=b;this.R=b.R;this.node=this.R.create(this,a);this.y=this.x=0;this.scale=1},attr:function(a){this.R.attr(this,a);return this},getAttr:function(a){return this.node.getAttribute(a)},setAttr:function(a,b){this.R.setAttr(this,a,b);return this},clipRect:function(a,b,c,d){this.R.clipRect(this,a,b,c,d)},translate:function(a,b,c,d){d||(a=Math.round(a),b=Math.round(b));this.R.move(this,a,b,c);this.x=a;this.y=b;this.scale=c;this.angle&&this.rotate(this.angle)},
|
50 |
rotate:function(a,b){this.R.rotate(this,a,b);this.angle=a},animate:function(a,b,c){for(var d in a)if(a.hasOwnProperty(d)){var f=d,e=a[d];c=AmCharts.getEffect(c);this.R.animate(this,f,e,b,c)}},push:function(a){if(a){var b=this.node;b.appendChild(a.node);var c=a.clipPath;c&&b.appendChild(c);(a=a.grad)&&b.appendChild(a)}},text:function(a){this.R.setText(this,a)},remove:function(){this.R.remove(this)},clear:function(){var a=this.node;if(a.hasChildNodes())for(;1<=a.childNodes.length;)a.removeChild(a.firstChild)},
|
51 |
hide:function(){this.setAttr("visibility","hidden")},show:function(){this.setAttr("visibility","visible")},getBBox:function(){return this.R.getBBox(this)},toFront:function(){var a=this.node;if(a){this.prevNextNode=a.nextSibling;var b=a.parentNode;b&&b.appendChild(a)}},toPrevious:function(){var a=this.node;a&&this.prevNextNode&&(a=a.parentNode)&&a.insertBefore(this.prevNextNode,null)},toBack:function(){var a=this.node;if(a){this.prevNextNode=a.nextSibling;var b=a.parentNode;if(b){var c=b.firstChild;
|
52 |
c&&b.insertBefore(a,c)}}},mouseover:function(a){this.R.addListener(this,"mouseover",a);return this},mouseout:function(a){this.R.addListener(this,"mouseout",a);return this},click:function(a){this.R.addListener(this,"click",a);return this},dblclick:function(a){this.R.addListener(this,"dblclick",a);return this},mousedown:function(a){this.R.addListener(this,"mousedown",a);return this},mouseup:function(a){this.R.addListener(this,"mouseup",a);return this},touchstart:function(a){this.R.addListener(this,
|
60 |
a.grad;e&&this.D.remove(e);b=document.createElementNS(AmCharts.SVG_NS,b);e=AmCharts.getUniqueId();b.setAttribute("id",e);if(!isNaN(d)){var g=0,h=0,k=0,l=0;90==d?k=100:270==d?l=100:180==d?g=100:0===d&&(h=100);b.setAttribute("x1",g+"%");b.setAttribute("x2",h+"%");b.setAttribute("y1",k+"%");b.setAttribute("y2",l+"%")}for(d=0;d<c.length;d++)g=document.createElementNS(AmCharts.SVG_NS,"stop"),h=100*d/(c.length-1),0===d&&(h=0),g.setAttribute("offset",h+"%"),g.setAttribute("stop-color",c[d]),b.appendChild(g);
|
61 |
f.parentNode.appendChild(b);c="#";AmCharts.baseHref&&!AmCharts.isIE&&(c=this.removeTarget(window.location.href)+c);f.setAttribute("fill","url("+c+e+")");a.grad=b},removeTarget:function(a){urlArr=a.split("#");return urlArr[0]},pattern:function(a,b,c){var d=a.node;isNaN(c)&&(c=1);var f=a.patternNode;f&&this.D.remove(f);var f=document.createElementNS(AmCharts.SVG_NS,"pattern"),e=AmCharts.getUniqueId(),g=b;b.url&&(g=b.url);var h=Number(b.width);isNaN(h)&&(h=4);var k=Number(b.height);isNaN(k)&&(k=4);h/=
|
62 |
c;k/=c;c=b.x;isNaN(c)&&(c=0);var l=-Math.random()*Number(b.randomX);isNaN(l)||(c=l);l=b.y;isNaN(l)&&(l=0);var m=-Math.random()*Number(b.randomY);isNaN(m)||(l=m);f.setAttribute("id",e);f.setAttribute("width",h);f.setAttribute("height",k);f.setAttribute("patternUnits","userSpaceOnUse");f.setAttribute("xlink:href",g);b.color&&(m=document.createElementNS(AmCharts.SVG_NS,"rect"),m.setAttributeNS(null,"height",h),m.setAttributeNS(null,"width",k),m.setAttributeNS(null,"fill",b.color),f.appendChild(m));this.D.image(g,
|
63 |
+
0,0,h,k,f).translate(c,l);g="#";AmCharts.baseHref&&!AmCharts.isIE&&(g=this.removeTarget(window.location.href)+g);d.setAttribute("fill","url("+g+e+")");a.patternNode=f;d.parentNode.appendChild(f)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);a.grad&&this.D.remove(a.grad);a.patternNode&&this.D.remove(a.patternNode);this.D.remove(a.node)}});AmCharts.AmChart=AmCharts.Class({construct:function(a){this.theme=a;this.classNamePrefix="amcharts";this.addClassNames=!1;this.version="3.13.1";AmCharts.addChart(this);this.createEvents("dataUpdated","init","rendered","drawn","failed","resized");this.height=this.width="100%";this.dataChanged=!0;this.chartCreated=!1;this.previousWidth=this.previousHeight=0;this.backgroundColor="#FFFFFF";this.borderAlpha=this.backgroundAlpha=0;this.color=this.borderColor="#000000";this.fontFamily="Verdana";this.fontSize=
|
64 |
+
11;this.usePrefixes=!1;this.precision=-1;this.percentPrecision=2;this.decimalSeparator=".";this.thousandsSeparator=",";this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];this.creditsPosition="top-left";var b=document.createElement("div"),c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.chartDiv=b;b=document.createElement("div");c=b.style;c.overflow="hidden";c.position="relative";c.textAlign="left";this.legendDiv=
|
65 |
+
b;this.titleHeight=0;this.hideBalloonTime=150;this.handDrawScatter=2;this.handDrawThickness=1;this.prefixesOfBigNumbers=[{number:1E3,prefix:"k"},{number:1E6,prefix:"M"},{number:1E9,prefix:"G"},{number:1E12,prefix:"T"},{number:1E15,prefix:"P"},{number:1E18,prefix:"E"},{number:1E21,prefix:"Z"},{number:1E24,prefix:"Y"}];this.prefixesOfSmallNumbers=[{number:1E-24,prefix:"y"},{number:1E-21,prefix:"z"},{number:1E-18,prefix:"a"},{number:1E-15,prefix:"f"},{number:1E-12,prefix:"p"},{number:1E-9,prefix:"n"},
|
66 |
+
{number:1E-6,prefix:"\u03bc"},{number:.001,prefix:"m"}];this.panEventsEnabled=!0;AmCharts.bezierX=3;AmCharts.bezierY=6;this.product="amcharts";this.animations=[];this.balloon=new AmCharts.AmBalloon(this.theme);this.balloon.chart=this;AmCharts.applyTheme(this,a,"AmChart")},drawChart:function(){this.drawBackground();this.redrawLabels();this.drawTitles();this.brr()},drawBackground:function(){AmCharts.remove(this.background);var a=this.container,b=this.backgroundColor,c=this.backgroundAlpha,d=this.set;
|
67 |
+
AmCharts.isModern||0!==c||(c=.001);var f=this.updateWidth();this.realWidth=f;var e=this.updateHeight();this.realHeight=e;b=AmCharts.polygon(a,[0,f-1,f-1,0],[0,0,e-1,e-1],b,c,1,this.borderColor,this.borderAlpha);AmCharts.setCN(this,b,"bg");this.background=b;d.push(b);if(b=this.backgroundImage)this.path&&(b=this.path+b),a=a.image(b,0,0,f,e),AmCharts.setCN(this,b,"bg-image"),this.bgImg=a,d.push(a)},drawTitles:function(){var a=this.titles;if(AmCharts.ifArray(a)){var b=20,c;for(c=0;c<a.length;c++){var d=
|
68 |
+
a[c];if(!1!==d.enabled){var f=d.color;void 0===f&&(f=this.color);var e=d.size;isNaN(e)&&(e=this.fontSize+2);isNaN(d.alpha);var g=this.marginLeft,f=AmCharts.text(this.container,d.text,f,this.fontFamily,e);f.translate(g+(this.realWidth-this.marginRight-g)/2,b);f.node.style.pointerEvents="none";AmCharts.setCN(this,f,"title");d.id&&AmCharts.setCN(this,f,"title-"+d.id);g=!0;void 0!==d.bold&&(g=d.bold);g&&f.attr({"font-weight":"bold"});f.attr({opacity:d.alpha});b+=e+6;this.freeLabelsSet.push(f)}}}},write:function(a){if(a=
|
69 |
+
"object"!=typeof a?document.getElementById(a):a){for(;a.firstChild;)a.removeChild(a.firstChild);this.div=a;a.style.overflow="hidden";a.style.textAlign="left";var b=this.chartDiv,c=this.legendDiv,d=this.legend,f=c.style,e=b.style;this.measure();var g,h=document.createElement("div");g=h.style;g.position="relative";this.containerDiv=h;h.className=this.classNamePrefix+"-main-div";b.className=this.classNamePrefix+"-chart-div";a.appendChild(h);var k=this.exportConfig;k&&AmCharts.AmExport&&!this.AmExport&&
|
70 |
+
(this.AmExport=new AmCharts.AmExport(this,k));this.amExport&&AmCharts.AmExport&&(this.AmExport=AmCharts.extend(this.amExport,new AmCharts.AmExport(this),!0));this.AmExport&&this.AmExport.init&&this.AmExport.init();if(d)if(d=this.addLegend(d,d.divId),d.enabled)switch(d.position){case "bottom":h.appendChild(b);h.appendChild(c);break;case "top":h.appendChild(c);h.appendChild(b);break;case "absolute":g.width=a.style.width;g.height=a.style.height;f.position="absolute";e.position="absolute";void 0!==d.left&&
|
71 |
+
(f.left=d.left+"px");void 0!==d.right&&(f.right=d.right+"px");void 0!==d.top&&(f.top=d.top+"px");void 0!==d.bottom&&(f.bottom=d.bottom+"px");d.marginLeft=0;d.marginRight=0;h.appendChild(b);h.appendChild(c);break;case "right":g.width=a.style.width;g.height=a.style.height;f.position="relative";e.position="absolute";h.appendChild(b);h.appendChild(c);break;case "left":g.width=a.style.width;g.height=a.style.height;f.position="absolute";e.position="relative";h.appendChild(b);h.appendChild(c);break;case "outside":h.appendChild(b)}else h.appendChild(b);
|
72 |
+
else h.appendChild(b);this.listenersAdded||(this.addListeners(),this.listenersAdded=!0);this.initChart()}},createLabelsSet:function(){AmCharts.remove(this.labelsSet);this.labelsSet=this.container.set();this.freeLabelsSet.push(this.labelsSet)},initChart:function(){this.initHC||(AmCharts.callInitHandler(this),this.initHC=!0);this.renderFix();AmCharts.applyLang(this.language,this);var a=this.numberFormatter;a&&(isNaN(a.precision)||(this.precision=a.precision),void 0!==a.thousandsSeparator&&(this.thousandsSeparator=
|
73 |
+
a.thousandsSeparator),void 0!==a.decimalSeparator&&(this.decimalSeparator=a.decimalSeparator));(a=this.percentFormatter)&&!isNaN(a.precision)&&(this.percentPrecision=a.precision);this.nf={precision:this.precision,thousandsSeparator:this.thousandsSeparator,decimalSeparator:this.decimalSeparator};this.pf={precision:this.percentPrecision,thousandsSeparator:this.thousandsSeparator,decimalSeparator:this.decimalSeparator};this.divIsFixed=AmCharts.findIfFixed(this.chartDiv);this.previousHeight=this.divRealHeight;
|
74 |
+
this.previousWidth=this.divRealWidth;this.destroy();this.startInterval();a=0;document.attachEvent&&!window.opera&&(a=1);this.dmouseX=this.dmouseY=0;var b=document.getElementsByTagName("html")[0];b&&window.getComputedStyle&&(b=window.getComputedStyle(b,null))&&(this.dmouseY=AmCharts.removePx(b.getPropertyValue("margin-top")),this.dmouseX=AmCharts.removePx(b.getPropertyValue("margin-left")));this.mouseMode=a;(a=this.container)?(a.container.innerHTML="",a.width=this.realWidth,a.height=this.realHeight,
|
75 |
+
a.addDefs(this),this.chartDiv.appendChild(a.container)):a=new AmCharts.AmDraw(this.chartDiv,this.realWidth,this.realHeight,this);a.chart=this;AmCharts.VML||AmCharts.SVG?(a.handDrawn=this.handDrawn,a.handDrawScatter=this.handDrawScatter,a.handDrawThickness=this.handDrawThickness,this.container=a,this.set&&this.set.remove(),this.set=a.set(),this.gridSet&&this.gridSet.remove(),this.gridSet=a.set(),this.cursorLineSet&&this.cursorLineSet.remove(),this.cursorLineSet=a.set(),this.graphsBehindSet&&this.graphsBehindSet.remove(),
|
76 |
+
this.graphsBehindSet=a.set(),this.bulletBehindSet&&this.bulletBehindSet.remove(),this.bulletBehindSet=a.set(),this.columnSet&&this.columnSet.remove(),this.columnSet=a.set(),this.graphsSet&&this.graphsSet.remove(),this.graphsSet=a.set(),this.trendLinesSet&&this.trendLinesSet.remove(),this.trendLinesSet=a.set(),this.axesSet&&this.axesSet.remove(),this.axesSet=a.set(),this.cursorSet&&this.cursorSet.remove(),this.cursorSet=a.set(),this.scrollbarsSet&&this.scrollbarsSet.remove(),this.scrollbarsSet=a.set(),
|
77 |
+
this.bulletSet&&this.bulletSet.remove(),this.bulletSet=a.set(),this.freeLabelsSet&&this.freeLabelsSet.remove(),this.axesLabelsSet&&this.axesLabelsSet.remove(),this.axesLabelsSet=a.set(),this.freeLabelsSet=a.set(),this.balloonsSet&&this.balloonsSet.remove(),this.balloonsSet=a.set(),this.zoomButtonSet&&this.zoomButtonSet.remove(),this.zoomButtonSet=a.set(),this.linkSet&&this.linkSet.remove(),this.linkSet=a.set()):this.fire("failed",{type:"failed",chart:this})},measure:function(){var a=this.div;if(a){var b=
|
78 |
+
this.chartDiv,c=a.offsetWidth,d=a.offsetHeight,f=this.container;a.clientHeight&&(c=a.clientWidth,d=a.clientHeight);var e=AmCharts.removePx(AmCharts.getStyle(a,"padding-left")),g=AmCharts.removePx(AmCharts.getStyle(a,"padding-right")),h=AmCharts.removePx(AmCharts.getStyle(a,"padding-top")),k=AmCharts.removePx(AmCharts.getStyle(a,"padding-bottom"));isNaN(e)||(c-=e);isNaN(g)||(c-=g);isNaN(h)||(d-=h);isNaN(k)||(d-=k);e=a.style;a=e.width;e=e.height;-1!=a.indexOf("px")&&(c=AmCharts.removePx(a));-1!=e.indexOf("px")&&
|
79 |
+
(d=AmCharts.removePx(e));a=AmCharts.toCoordinate(this.width,c);e=AmCharts.toCoordinate(this.height,d);this.balloon=AmCharts.processObject(this.balloon,AmCharts.AmBalloon,this.theme);this.balloon.chart=this;(a!=this.previousWidth||e!=this.previousHeight)&&0<a&&0<e&&(b.style.width=a+"px",b.style.height=e+"px",f&&f.setSize(a,e));this.balloon.setBounds(2,2,a-2,e);this.realWidth=a;this.realHeight=e;this.divRealWidth=c;this.divRealHeight=d}},destroy:function(){this.chartDiv.innerHTML="";this.clearTimeOuts();
|
80 |
+
this.interval&&clearInterval(this.interval);this.interval=NaN},clearTimeOuts:function(){var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=[]},clear:function(a){AmCharts.callMethod("clear",[this.chartScrollbar,this.scrollbarV,this.scrollbarH,this.chartCursor]);this.chartCursor=this.scrollbarH=this.scrollbarV=this.chartScrollbar=null;this.clearTimeOuts();this.interval&&clearInterval(this.interval);this.container&&(this.container.remove(this.chartDiv),this.container.remove(this.legendDiv));
|
81 |
+
a||AmCharts.removeChart(this)},setMouseCursor:function(a){"auto"==a&&AmCharts.isNN&&(a="default");this.chartDiv.style.cursor=a;this.legendDiv.style.cursor=a},redrawLabels:function(){this.labels=[];var a=this.allLabels;this.createLabelsSet();var b;for(b=0;b<a.length;b++)this.drawLabel(a[b])},drawLabel:function(a){if(this.container&&!1!==a.enabled){var b=a.y,c=a.text,d=a.align,f=a.size,e=a.color,g=a.rotation,h=a.alpha,k=a.bold,l=AmCharts.toCoordinate(a.x,this.realWidth),b=AmCharts.toCoordinate(b,this.realHeight);
|
82 |
+
l||(l=0);b||(b=0);void 0===e&&(e=this.color);isNaN(f)&&(f=this.fontSize);d||(d="start");"left"==d&&(d="start");"right"==d&&(d="end");"center"==d&&(d="middle",g?b=this.realHeight-b+b/2:l=this.realWidth/2-l);void 0===h&&(h=1);void 0===g&&(g=0);b+=f/2;c=AmCharts.text(this.container,c,e,this.fontFamily,f,d,k,h);c.translate(l,b);AmCharts.setCN(this,c,"label");a.id&&AmCharts.setCN(this,c,"label-"+a.id);0!==g&&c.rotate(g);a.url?(c.setAttr("cursor","pointer"),c.click(function(){AmCharts.getURL(a.url)})):
|
83 |
+
c.node.style.pointerEvents="none";this.labelsSet.push(c);this.labels.push(c)}},addLabel:function(a,b,c,d,f,e,g,h,k,l){a={x:a,y:b,text:c,align:d,size:f,color:e,alpha:h,rotation:g,bold:k,url:l,enabled:!0};this.container&&this.drawLabel(a);this.allLabels.push(a)},clearLabels:function(){var a=this.labels,b;for(b=a.length-1;0<=b;b--)a[b].remove();this.labels=[];this.allLabels=[]},updateHeight:function(){var a=this.divRealHeight,b=this.legend;if(b){var c=this.legendDiv.offsetHeight,b=b.position;if("top"==
|
84 |
+
b||"bottom"==b){a-=c;if(0>a||isNaN(a))a=0;this.chartDiv.style.height=a+"px"}}return a},updateWidth:function(){var a=this.divRealWidth,b=this.divRealHeight,c=this.legend;if(c){var d=this.legendDiv,f=d.offsetWidth;isNaN(c.width)||(f=c.width);var e=d.offsetHeight,d=d.style,g=this.chartDiv.style,c=c.position;if("right"==c||"left"==c){a-=f;if(0>a||isNaN(a))a=0;g.width=a+"px";"left"==c?(g.left=f+"px",d.left="0px"):(g.left="0px",d.left=a+"px");b>e&&(d.top=(b-e)/2+"px")}}return a},getTitleHeight:function(){var a=
|
85 |
+
0,b=this.titles,c=!0;if(0<b.length){var a=15,d;for(d=0;d<b.length;d++){var f=b[d];!1!==f.enabled&&(c=!1,f=f.size,isNaN(f)&&(f=this.fontSize+2),a+=f+6)}c&&(a=0)}return a},addTitle:function(a,b,c,d,f){isNaN(b)&&(b=this.fontSize+2);a={text:a,size:b,color:c,alpha:d,bold:f,enabled:!0};this.titles.push(a);return a},handleWheel:function(a){var b=0;a||(a=window.event);a.wheelDelta?b=a.wheelDelta/120:a.detail&&(b=-a.detail/3);b&&this.handleWheelReal(b,a.shiftKey);a.preventDefault&&a.preventDefault()},handleWheelReal:function(a){},
|
86 |
+
addListeners:function(){var a=this,b=a.chartDiv;document.addEventListener?(a.panEventsEnabled&&(b.style.msTouchAction="none"),"ontouchstart"in document.documentElement&&(b.addEventListener("touchstart",function(b){a.handleTouchMove.call(a,b);a.handleTouchStart.call(a,b)},!0),b.addEventListener("touchmove",function(b){a.handleTouchMove.call(a,b)},!0),b.addEventListener("touchend",function(b){a.handleTouchEnd.call(a,b)},!0)),b.addEventListener("mousedown",function(b){a.mouseIsOver=!0;a.handleMouseMove.call(a,
|
87 |
+
b);a.handleMouseDown.call(a,b)},!0),b.addEventListener("mouseover",function(b){a.handleMouseOver.call(a,b)},!0),b.addEventListener("mouseout",function(b){a.handleMouseOut.call(a,b)},!0)):(b.attachEvent("onmousedown",function(b){a.handleMouseDown.call(a,b)}),b.attachEvent("onmouseover",function(b){a.handleMouseOver.call(a,b)}),b.attachEvent("onmouseout",function(b){a.handleMouseOut.call(a,b)}))},dispDUpd:function(){if(!this.skipEvents){var a;this.dispatchDataUpdated&&(this.dispatchDataUpdated=!1,a=
|
88 |
+
"dataUpdated",this.fire(a,{type:a,chart:this}));this.chartCreated||(a="init",this.fire(a,{type:a,chart:this}));this.chartRendered||(a="rendered",this.fire(a,{type:a,chart:this}),this.chartRendered=!0);a="drawn";this.fire(a,{type:a,chart:this})}this.skipEvents=!1},validateSize:function(){var a=this;a.measure();var b=a.legend;if(a.realWidth!=a.previousWidth||a.realHeight!=a.previousHeight){if(0<a.realWidth&&0<a.realHeight){a.sizeChanged=!0;if(b){clearTimeout(a.legendInitTO);var c=setTimeout(function(){b.invalidateSize()},
|
89 |
+
100);a.timeOuts.push(c);a.legendInitTO=c}"xy"!=a.type?a.marginsUpdated=!1:(a.marginsUpdated=!0,a.selfZoom=!0);clearTimeout(a.initTO);c=setTimeout(function(){a.initChart()},150);a.timeOuts.push(c);a.initTO=c}a.fire("resized",{type:"resized",chart:a})}a.renderFix();b&&b.renderFix()},invalidateSize:function(){this.previousHeight=this.previousWidth=NaN;this.invalidateSizeReal()},invalidateSizeReal:function(){var a=this;a.marginsUpdated=!1;clearTimeout(a.validateTO);var b=setTimeout(function(){a.validateSize()},
|
90 |
+
5);a.timeOuts.push(b);a.validateTO=b},validateData:function(a){this.chartCreated&&(this.dataChanged=!0,this.marginsUpdated="xy"!=this.type?!1:!0,this.initChart(a))},validateNow:function(a,b){this.initTO&&clearTimeout(this.initTO);a&&(this.dataChanged=!0);this.skipEvents=b;this.chartRendered=!1;this.write(this.div)},showItem:function(a){a.hidden=!1;this.initChart()},hideItem:function(a){a.hidden=!0;this.initChart()},hideBalloon:function(){var a=this;clearInterval(a.hoverInt);clearTimeout(a.balloonTO);
|
91 |
+
a.hoverInt=setTimeout(function(){a.hideBalloonReal.call(a)},a.hideBalloonTime)},cleanChart:function(){},hideBalloonReal:function(){var a=this.balloon;a&&a.hide()},showBalloon:function(a,b,c,d,f){var e=this;clearTimeout(e.balloonTO);clearInterval(e.hoverInt);e.balloonTO=setTimeout(function(){e.showBalloonReal.call(e,a,b,c,d,f)},1)},showBalloonReal:function(a,b,c,d,f){this.handleMouseMove();var e=this.balloon;e.enabled&&(e.followCursor(!1),e.changeColor(b),!c||e.fixedPosition?(e.setPosition(d,f),e.followCursor(!1)):
|
92 |
+
e.followCursor(!0),a&&e.showBalloon(a))},handleTouchMove:function(a){this.hideBalloon();var b=this.chartDiv;a.touches&&(a=a.touches.item(0),this.mouseX=a.pageX-AmCharts.findPosX(b),this.mouseY=a.pageY-AmCharts.findPosY(b))},handleMouseOver:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!0},handleMouseOut:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!1},handleMouseMove:function(a){if(this.mouseIsOver){var b=this.chartDiv;a||(a=window.event);var c,d;if(a){this.posX=AmCharts.findPosX(b);
|
93 |
+
this.posY=AmCharts.findPosY(b);switch(this.mouseMode){case 1:c=a.clientX-this.posX;d=a.clientY-this.posY;if(!this.divIsFixed){var b=document.body,f,e;b&&(f=b.scrollLeft,y1=b.scrollTop);if(b=document.documentElement)e=b.scrollLeft,y2=b.scrollTop;f=Math.max(f,e);e=Math.max(y1,y2);c+=f;d+=e}break;case 0:this.divIsFixed?(c=a.clientX-this.posX,d=a.clientY-this.posY):(c=a.pageX-this.posX,d=a.pageY-this.posY)}a.touches&&(a=a.touches.item(0),c=a.pageX-this.posX,d=a.pageY-this.posY);this.mouseX=c-this.dmouseX;
|
94 |
+
this.mouseY=d-this.dmouseY}}},handleTouchStart:function(a){this.handleMouseDown(a)},handleTouchEnd:function(a){AmCharts.resetMouseOver();this.handleReleaseOutside(a)},handleReleaseOutside:function(a){},handleMouseDown:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!0;a&&a.preventDefault&&(this.panEventsEnabled?a.preventDefault():a.touches||a.preventDefault())},addLegend:function(a,b){a=AmCharts.processObject(a,AmCharts.AmLegend,this.theme);a.divId=b;var c;c="object"!=typeof b&&b?document.getElementById(b):
|
95 |
+
b;this.legend=a;a.chart=this;c?(a.div=c,a.position="outside",a.autoMargins=!1):a.div=this.legendDiv;c=this.handleLegendEvent;this.listenTo(a,"showItem",c);this.listenTo(a,"hideItem",c);this.listenTo(a,"clickMarker",c);this.listenTo(a,"rollOverItem",c);this.listenTo(a,"rollOutItem",c);this.listenTo(a,"rollOverMarker",c);this.listenTo(a,"rollOutMarker",c);this.listenTo(a,"clickLabel",c);return a},removeLegend:function(){this.legend=void 0;this.legendDiv.innerHTML=""},handleResize:function(){(AmCharts.isPercents(this.width)||
|
96 |
+
AmCharts.isPercents(this.height))&&this.invalidateSizeReal();this.renderFix()},renderFix:function(){if(!AmCharts.VML){var a=this.container;a&&a.renderFix()}},getSVG:function(){if(AmCharts.hasSVG)return this.container},animate:function(a,b,c,d,f,e,g){a["an_"+b]&&AmCharts.removeFromArray(this.animations,a["an_"+b]);c={obj:a,frame:0,attribute:b,from:c,to:d,time:f,effect:e,suffix:g};a["an_"+b]=c;this.animations.push(c);return c},setLegendData:function(a){var b=this.legend;b&&b.setData(a)},startInterval:function(){var a=
|
97 |
+
this;clearInterval(a.interval);a.interval=setInterval(function(){a.updateAnimations.call(a)},AmCharts.updateRate)},stopAnim:function(a){AmCharts.removeFromArray(this.animations,a)},updateAnimations:function(){var a;this.container&&this.container.update();for(a=this.animations.length-1;0<=a;a--){var b=this.animations[a],c=1E3*b.time/AmCharts.updateRate,d=b.frame+1,f=b.obj,e=b.attribute;if(d<=c){b.frame++;var g=Number(b.from),h=Number(b.to)-g,c=AmCharts[b.effect](0,d,g,h,c);0===h?(this.animations.splice(a,
|
98 |
+
1),f.node.style[e]=Number(b.to)+b.suffix):f.node.style[e]=c+b.suffix}else f.node.style[e]=Number(b.to)+b.suffix,this.animations.splice(a,1)}},inIframe:function(){try{return window.self!==window.top}catch(a){return!0}},brr:function(){var a=window.location.hostname.split("."),b;2<=a.length&&(b=a[a.length-2]+"."+a[a.length-1]);this.amLink&&(a=this.amLink.parentNode)&&a.removeChild(this.amLink);a=this.creditsPosition;if("amcharts.com"!=b||!0===this.inIframe()){var c=b=0,d=this.realWidth,f=this.realHeight;
|
99 |
+
if("serial"==this.type||"xy"==this.type)b=this.marginLeftReal,c=this.marginTopReal,d=b+this.plotAreaWidth,f=c+this.plotAreaHeight;var e="http://www.amcharts.com/javascript-charts/",g="JavaScript charts",h="JS chart by amCharts";"ammap"==this.product&&(e="http://www.ammap.com/javascript-maps/",g="Interactive JavaScript maps",h="JS map by amCharts");var k=document.createElement("a"),h=document.createTextNode(h);k.setAttribute("href",e);k.setAttribute("title",g);k.appendChild(h);this.chartDiv.appendChild(k);
|
100 |
+
this.amLink=k;e=k.style;e.position="absolute";e.textDecoration="none";e.color=this.color;e.fontFamily=this.fontFamily;e.fontSize=this.fontSize+"px";e.opacity=.7;e.display="block";var g=k.offsetWidth,k=k.offsetHeight,h=5+b,l=c+5;"bottom-left"==a&&(h=5+b,l=f-k-3);"bottom-right"==a&&(h=d-g-5,l=f-k-3);"top-right"==a&&(h=d-g-5,l=c+5);e.left=h+"px";e.top=l+"px"}}});AmCharts.Slice=AmCharts.Class({construct:function(){}});AmCharts.SerialDataItem=AmCharts.Class({construct:function(){}});
|
101 |
+
AmCharts.GraphDataItem=AmCharts.Class({construct:function(){}});AmCharts.Guide=AmCharts.Class({construct:function(a){this.cname="Guide";AmCharts.applyTheme(this,a,this.cname)}});AmCharts.AmBalloon=AmCharts.Class({construct:function(a){this.cname="AmBalloon";this.enabled=!0;this.fillColor="#FFFFFF";this.fillAlpha=.8;this.borderThickness=2;this.borderColor="#FFFFFF";this.borderAlpha=1;this.cornerRadius=0;this.maxWidth=220;this.horizontalPadding=8;this.verticalPadding=4;this.pointerWidth=6;this.pointerOrientation="V";this.color="#000000";this.adjustBorderColor=!0;this.show=this.follow=this.showBullet=!1;this.bulletSize=3;this.shadowAlpha=.4;this.shadowColor="#000000";this.fadeOutDuration=
|
102 |
this.animationDuration=.3;this.fixedPosition=!1;this.offsetY=6;this.offsetX=1;this.textAlign="center";AmCharts.isModern||(this.offsetY*=1.5);AmCharts.applyTheme(this,a,this.cname)},draw:function(){var a=this.pointToX,b=this.pointToY;this.deltaSignX=this.deltaSignY=1;var c=this.chart;AmCharts.VML&&(this.fadeOutDuration=0);this.xAnim&&c.stopAnim(this.xAnim);this.yAnim&&c.stopAnim(this.yAnim);if(!isNaN(a)){var d=this.follow,f=c.container,e=this.set;AmCharts.remove(e);this.removeDiv();e=f.set();e.node.style.pointerEvents=
|
103 |
+
"none";this.set=e;c.balloonsSet.push(e);if(this.show){var g=this.l,h=this.t,k=this.r,l=this.b,m=this.balloonColor,n=this.fillColor,t=this.borderColor,p=n;void 0!=m&&(this.adjustBorderColor?p=t=m:n=m);var z=this.horizontalPadding,y=this.verticalPadding,v=this.pointerWidth,B=this.pointerOrientation,A=this.cornerRadius,w=c.fontFamily,r=this.fontSize;void 0==r&&(r=c.fontSize);var m=document.createElement("div"),u=c.classNamePrefix;m.className=u+"-balloon-div";this.className&&(m.className=m.className+
|
104 |
+
" "+u+"-balloon-div-"+this.className);u=m.style;u.pointerEvents="none";u.position="absolute";var q=this.minWidth,x="";isNaN(q)||(x="min-width:"+(q-2*z)+"px; ");m.innerHTML='<div style="text-align:'+this.textAlign+"; "+x+"max-width:"+this.maxWidth+"px; font-size:"+r+"px; color:"+this.color+"; font-family:"+w+'">'+this.text+"</div>";c.chartDiv.appendChild(m);this.textDiv=m;r=m.offsetWidth;w=m.offsetHeight;m.clientHeight&&(r=m.clientWidth,w=m.clientHeight);w+=2*y;x=r+2*z;!isNaN(q)&&x<q&&(x=q);window.opera&&
|
105 |
+
(w+=2);var C=!1,r=this.offsetY;c.handDrawn&&(r+=c.handDrawScatter+2);"H"!=B?(q=a-x/2,b<h+w+10&&"down"!=B?(C=!0,d&&(b+=r),r=b+v,this.deltaSignY=-1):(d&&(b-=r),r=b-w-v,this.deltaSignY=1)):(2*v>w&&(v=w/2),r=b-w/2,a<g+(k-g)/2?(q=a+v,this.deltaSignX=-1):(q=a-x-v,this.deltaSignX=1));r+w>=l&&(r=l-w);r<h&&(r=h);q<g&&(q=g);q+x>k&&(q=k-x);var h=r+y,l=q+z,y=this.shadowAlpha,F=this.shadowColor,z=this.borderThickness,D=this.bulletSize,E;0<A||0===v?(0<y&&(a=AmCharts.rect(f,x,w,n,0,z+1,F,y,this.cornerRadius),AmCharts.isModern?
|
106 |
+
a.translate(1,1):a.translate(4,4),e.push(a)),n=AmCharts.rect(f,x,w,n,this.fillAlpha,z,t,this.borderAlpha,this.cornerRadius),this.showBullet&&(E=AmCharts.circle(f,D,p,this.fillAlpha),e.push(E))):(p=[],A=[],"H"!=B?(g=a-q,g>x-v&&(g=x-v),g<v&&(g=v),p=[0,g-v,a-q,g+v,x,x,0,0],A=C?[0,0,b-r,0,0,w,w,0]:[w,w,b-r,w,w,0,0,w]):(p=b-r,p>w-v&&(p=w-v),p<v&&(p=v),A=[0,p-v,b-r,p+v,w,w,0,0],p=a<g+(k-g)/2?[0,0,q<a?0:a-q,0,0,x,x,0]:[x,x,q+x>a?x:a-q,x,x,0,0,x]),0<y&&(a=AmCharts.polygon(f,p,A,n,0,z,F,y),a.translate(1,1),
|
107 |
+
e.push(a)),n=AmCharts.polygon(f,p,A,n,this.fillAlpha,z,t,this.borderAlpha));this.bg=n;e.push(n);n.toFront();AmCharts.setCN(c,n,"balloon-bg");this.className&&AmCharts.setCN(c,n,"balloon-bg-"+this.className);f=1*this.deltaSignX;u.left=l+"px";u.top=h+"px";e.translate(q-f,r);n=n.getBBox();this.bottom=r+w+1;this.yPos=n.y+r;E&&E.translate(this.pointToX-q+f,b-r);b=this.animationDuration;0<this.animationDuration&&!d&&!isNaN(this.prevX)&&(e.translate(this.prevX,this.prevY),e.animate({translate:q-f+","+r},
|
108 |
+
b,"easeOutSine"),m&&(u.left=this.prevTX+"px",u.top=this.prevTY+"px",this.xAnim=c.animate({node:m},"left",this.prevTX,l,b,"easeOutSine","px"),this.yAnim=c.animate({node:m},"top",this.prevTY,h,b,"easeOutSine","px")));this.prevX=q-f;this.prevY=r;this.prevTX=l;this.prevTY=h}}},followMouse:function(){if(this.follow&&this.show){var a=this.chart.mouseX-this.offsetX*this.deltaSignX,b=this.chart.mouseY;this.pointToX=a;this.pointToY=b;if(a!=this.previousX||b!=this.previousY)if(this.previousX=a,this.previousY=
|
109 |
+
b,0===this.cornerRadius)this.draw();else{var c=this.set;if(c){var d=c.getBBox(),a=a-d.width/2,f=b-d.height-10;a<this.l&&(a=this.l);a>this.r-d.width&&(a=this.r-d.width);f<this.t&&(f=b+10);c.translate(a,f);b=this.textDiv.style;b.left=a+this.horizontalPadding+"px";b.top=f+this.verticalPadding+"px"}}}},changeColor:function(a){this.balloonColor=a},setBounds:function(a,b,c,d){this.l=a;this.t=b;this.r=c;this.b=d;this.destroyTO&&clearTimeout(this.destroyTO)},showBalloon:function(a){this.text=a;this.show=
|
110 |
+
!0;this.destroyTO&&clearTimeout(this.destroyTO);a=this.chart;this.fadeAnim1&&a.stopAnim(this.fadeAnim1);this.fadeAnim2&&a.stopAnim(this.fadeAnim2);this.draw()},hide:function(){var a=this,b=a.fadeOutDuration,c=a.chart;if(0<b){a.destroyTO=setTimeout(function(){a.destroy.call(a)},1E3*b);a.follow=!1;a.show=!1;var d=a.set;d&&(d.setAttr("opacity",a.fillAlpha),a.fadeAnim1=d.animate({opacity:0},b,"easeInSine"));a.textDiv&&(a.fadeAnim2=c.animate({node:a.textDiv},"opacity",1,0,b,"easeInSine",""))}else a.show=
|
111 |
+
!1,a.follow=!1,a.destroy()},setPosition:function(a,b,c){this.pointToX=a;this.pointToY=b;c&&(a==this.previousX&&b==this.previousY||this.draw());this.previousX=a;this.previousY=b},followCursor:function(a){var b=this;(b.follow=a)?(b.pShowBullet=b.showBullet,b.showBullet=!1):void 0!==b.pShowBullet&&(b.showBullet=b.pShowBullet);clearInterval(b.interval);var c=b.chart.mouseX,d=b.chart.mouseY;!isNaN(c)&&a&&(b.pointToX=c-b.offsetX*b.deltaSignX,b.pointToY=d,b.followMouse(),b.interval=setInterval(function(){b.followMouse.call(b)},
|
112 |
+
40))},removeDiv:function(){if(this.textDiv){var a=this.textDiv.parentNode;a&&a.removeChild(this.textDiv)}},destroy:function(){clearInterval(this.interval);AmCharts.remove(this.set);this.removeDiv();this.set=null}});AmCharts.circle=function(a,b,c,d,f,e,g,h,k){if(void 0==f||0===f)f=.01;void 0===e&&(e="#000000");void 0===g&&(g=0);d={fill:c,stroke:e,"fill-opacity":d,"stroke-width":f,"stroke-opacity":g};a=isNaN(k)?a.circle(0,0,b).attr(d):a.ellipse(0,0,b,k).attr(d);h&&a.gradient("radialGradient",[c,AmCharts.adjustLuminosity(c,-.6)]);return a};
|
113 |
+
AmCharts.text=function(a,b,c,d,f,e,g,h){e||(e="middle");"right"==e&&(e="end");"left"==e&&(e="start");isNaN(h)&&(h=1);void 0!==b&&(b=String(b),AmCharts.isIE&&!AmCharts.isModern&&(b=b.replace("&","&"),b=b.replace("&","&")));c={fill:c,"font-family":d,"font-size":f,opacity:h};!0===g&&(c["font-weight"]="bold");c["text-anchor"]=e;return a.text(b,c)};
|
114 |
+
AmCharts.polygon=function(a,b,c,d,f,e,g,h,k,l,m){isNaN(e)&&(e=.01);isNaN(h)&&(h=f);var n=d,t=!1;"object"==typeof n&&1<n.length&&(t=!0,n=n[0]);void 0===g&&(g=n);f={fill:n,stroke:g,"fill-opacity":f,"stroke-width":e,"stroke-opacity":h};void 0!==m&&0<m&&(f["stroke-dasharray"]=m);m=AmCharts.dx;e=AmCharts.dy;a.handDrawn&&(c=AmCharts.makeHD(b,c,a.handDrawScatter),b=c[0],c=c[1]);g=Math.round;l&&(g=AmCharts.doNothing);l="M"+(g(b[0])+m)+","+(g(c[0])+e);for(h=1;h<b.length;h++)l+=" L"+(g(b[h])+m)+","+(g(c[h])+
|
115 |
+
e);a=a.path(l+" Z").attr(f);t&&a.gradient("linearGradient",d,k);return a};
|
116 |
+
AmCharts.rect=function(a,b,c,d,f,e,g,h,k,l,m){isNaN(e)&&(e=0);void 0===k&&(k=0);void 0===l&&(l=270);isNaN(f)&&(f=0);var n=d,t=!1;"object"==typeof n&&(n=n[0],t=!0);void 0===g&&(g=n);void 0===h&&(h=f);b=Math.round(b);c=Math.round(c);var p=0,z=0;0>b&&(b=Math.abs(b),p=-b);0>c&&(c=Math.abs(c),z=-c);p+=AmCharts.dx;z+=AmCharts.dy;f={fill:n,stroke:g,"fill-opacity":f,"stroke-opacity":h};void 0!==m&&0<m&&(f["stroke-dasharray"]=m);a=a.rect(p,z,b,c,k,e).attr(f);t&&a.gradient("linearGradient",d,l);return a};
|
117 |
AmCharts.bullet=function(a,b,c,d,f,e,g,h,k,l,m){var n;"circle"==b&&(b="round");switch(b){case "round":n=AmCharts.circle(a,c/2,d,f,e,g,h);break;case "square":n=AmCharts.polygon(a,[-c/2,c/2,c/2,-c/2],[c/2,c/2,-c/2,-c/2],d,f,e,g,h,l-180);break;case "rectangle":n=AmCharts.polygon(a,[-c,c,c,-c],[c/2,c/2,-c/2,-c/2],d,f,e,g,h,l-180);break;case "diamond":n=AmCharts.polygon(a,[-c/2,0,c/2,0],[0,-c/2,0,c/2],d,f,e,g,h);break;case "triangleUp":n=AmCharts.triangle(a,c,0,d,f,e,g,h);break;case "triangleDown":n=AmCharts.triangle(a,
|
118 |
c,180,d,f,e,g,h);break;case "triangleLeft":n=AmCharts.triangle(a,c,270,d,f,e,g,h);break;case "triangleRight":n=AmCharts.triangle(a,c,90,d,f,e,g,h);break;case "bubble":n=AmCharts.circle(a,c/2,d,f,e,g,h,!0);break;case "line":n=AmCharts.line(a,[-c/2,c/2],[0,0],d,f,e,g,h);break;case "yError":n=a.set();n.push(AmCharts.line(a,[0,0],[-c/2,c/2],d,f,e));n.push(AmCharts.line(a,[-k,k],[-c/2,-c/2],d,f,e));n.push(AmCharts.line(a,[-k,k],[c/2,c/2],d,f,e));break;case "xError":n=a.set(),n.push(AmCharts.line(a,[-c/
|
119 |
2,c/2],[0,0],d,f,e)),n.push(AmCharts.line(a,[-c/2,-c/2],[-k,k],d,f,e)),n.push(AmCharts.line(a,[c/2,c/2],[-k,k],d,f,e))}n&&n.pattern(m);return n};
|
120 |
AmCharts.triangle=function(a,b,c,d,f,e,g,h){if(void 0===e||0===e)e=1;void 0===g&&(g="#000");void 0===h&&(h=0);d={fill:d,stroke:g,"fill-opacity":f,"stroke-width":e,"stroke-opacity":h};b/=2;var k;0===c&&(k=" M"+-b+","+b+" L0,"+-b+" L"+b+","+b+" Z");180==c&&(k=" M"+-b+","+-b+" L0,"+b+" L"+b+","+-b+" Z");90==c&&(k=" M"+-b+","+-b+" L"+b+",0 L"+-b+","+b+" Z");270==c&&(k=" M"+-b+",0 L"+b+","+b+" L"+b+","+-b+" Z");return a.path(k).attr(d)};
|
121 |
AmCharts.line=function(a,b,c,d,f,e,g,h,k,l,m){if(a.handDrawn&&!m)return AmCharts.handDrawnLine(a,b,c,d,f,e,g,h,k,l,m);e={fill:"none","stroke-width":e};void 0!==g&&0<g&&(e["stroke-dasharray"]=g);isNaN(f)||(e["stroke-opacity"]=f);d&&(e.stroke=d);d=Math.round;l&&(d=AmCharts.doNothing);l=AmCharts.dx;f=AmCharts.dy;g="M"+(d(b[0])+l)+","+(d(c[0])+f);for(h=1;h<b.length;h++)g+=" L"+(d(b[h])+l)+","+(d(c[h])+f);if(AmCharts.VML)return a.path(g,void 0,!0).attr(e);k&&(g+=" M0,0 L0,0");return a.path(g).attr(e)};
|
122 |
+
AmCharts.makeHD=function(a,b,c){for(var d=[],f=[],e=1;e<a.length;e++)for(var g=Number(a[e-1]),h=Number(b[e-1]),k=Number(a[e]),l=Number(b[e]),m=Math.sqrt(Math.pow(k-g,2)+Math.pow(l-h,2)),m=Math.round(m/50)+1,k=(k-g)/m,l=(l-h)/m,n=0;n<=m;n++){var t=g+n*k+Math.random()*c,p=h+n*l+Math.random()*c;d.push(t);f.push(p)}return[d,f]};
|
123 |
+
AmCharts.handDrawnLine=function(a,b,c,d,f,e,g,h,k,l,m){var n=a.set();for(m=1;m<b.length;m++)for(var t=[b[m-1],b[m]],p=[c[m-1],c[m]],p=AmCharts.makeHD(t,p,a.handDrawScatter),t=p[0],p=p[1],z=1;z<t.length;z++)n.push(AmCharts.line(a,[t[z-1],t[z]],[p[z-1],p[z]],d,f,e+Math.random()*a.handDrawThickness-a.handDrawThickness/2,g,h,k,l,!0));return n};AmCharts.doNothing=function(a){return a};
|
124 |
+
AmCharts.wedge=function(a,b,c,d,f,e,g,h,k,l,m,n){var t=Math.round;e=t(e);g=t(g);h=t(h);var p=t(g/e*h),z=AmCharts.VML,y=359.5+e/100;359.94<y&&(y=359.94);f>=y&&(f=y);var v=1/180*Math.PI,y=b+Math.sin(d*v)*h,B=c-Math.cos(d*v)*p,A=b+Math.sin(d*v)*e,w=c-Math.cos(d*v)*g,r=b+Math.sin((d+f)*v)*e,u=c-Math.cos((d+f)*v)*g,q=b+Math.sin((d+f)*v)*h,v=c-Math.cos((d+f)*v)*p,x={fill:AmCharts.adjustLuminosity(l.fill,-.2),"stroke-opacity":0,"fill-opacity":l["fill-opacity"]},C=0;180<Math.abs(f)&&(C=1);d=a.set();var F;
|
125 |
+
z&&(y=t(10*y),A=t(10*A),r=t(10*r),q=t(10*q),B=t(10*B),w=t(10*w),u=t(10*u),v=t(10*v),b=t(10*b),k=t(10*k),c=t(10*c),e*=10,g*=10,h*=10,p*=10,1>Math.abs(f)&&1>=Math.abs(r-A)&&1>=Math.abs(u-w)&&(F=!0));f="";var D;n&&(x["fill-opacity"]=0,x["stroke-opacity"]=l["stroke-opacity"]/2,x.stroke=l.stroke);0<k&&(D=" M"+y+","+(B+k)+" L"+A+","+(w+k),z?(F||(D+=" A"+(b-e)+","+(k+c-g)+","+(b+e)+","+(k+c+g)+","+A+","+(w+k)+","+r+","+(u+k)),D+=" L"+q+","+(v+k),0<h&&(F||(D+=" B"+(b-h)+","+(k+c-p)+","+(b+h)+","+(k+c+p)+
|
126 |
+
","+q+","+(k+v)+","+y+","+(k+B)))):(D+=" A"+e+","+g+",0,"+C+",1,"+r+","+(u+k)+" L"+q+","+(v+k),0<h&&(D+=" A"+h+","+p+",0,"+C+",0,"+y+","+(B+k))),D=a.path(D+" Z",void 0,void 0,"1000,1000").attr(x),d.push(D),D=a.path(" M"+y+","+B+" L"+y+","+(B+k)+" L"+A+","+(w+k)+" L"+A+","+w+" L"+y+","+B+" Z",void 0,void 0,"1000,1000").attr(x),k=a.path(" M"+r+","+u+" L"+r+","+(u+k)+" L"+q+","+(v+k)+" L"+q+","+v+" L"+r+","+u+" Z",void 0,void 0,"1000,1000").attr(x),d.push(D),d.push(k));z?(F||(f=" A"+t(b-e)+","+t(c-g)+
|
127 |
+
","+t(b+e)+","+t(c+g)+","+t(A)+","+t(w)+","+t(r)+","+t(u)),e=" M"+t(y)+","+t(B)+" L"+t(A)+","+t(w)+f+" L"+t(q)+","+t(v)):e=" M"+y+","+B+" L"+A+","+w+(" A"+e+","+g+",0,"+C+",1,"+r+","+u)+" L"+q+","+v;0<h&&(z?F||(e+=" B"+(b-h)+","+(c-p)+","+(b+h)+","+(c+p)+","+q+","+v+","+y+","+B):e+=" A"+h+","+p+",0,"+C+",0,"+y+","+B);a.handDrawn&&(b=AmCharts.line(a,[y,A],[B,w],l.stroke,l.thickness*Math.random()*a.handDrawThickness,l["stroke-opacity"]),d.push(b));a=a.path(e+" Z",void 0,void 0,"1000,1000").attr(l);
|
128 |
+
if(m){b=[];for(c=0;c<m.length;c++)b.push(AmCharts.adjustLuminosity(l.fill,m[c]));0<b.length&&a.gradient("linearGradient",b)}a.pattern(n);d.wedge=a;d.push(a);return d};AmCharts.adjustLuminosity=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,"");6>a.length&&(a=String(a[0])+String(a[0])+String(a[1])+String(a[1])+String(a[2])+String(a[2]));b=b||0;var c="#",d,f;for(f=0;3>f;f++)d=parseInt(a.substr(2*f,2),16),d=Math.round(Math.min(Math.max(0,d+d*b),255)).toString(16),c+=("00"+d).substr(d.length);return c};AmCharts.AmLegend=AmCharts.Class({construct:function(a){this.enabled=!0;this.cname="AmLegend";this.createEvents("rollOverMarker","rollOverItem","rollOutMarker","rollOutItem","showItem","hideItem","clickMarker","rollOverItem","rollOutItem","clickLabel");this.position="bottom";this.borderColor=this.color="#000000";this.borderAlpha=0;this.markerLabelGap=5;this.verticalGap=10;this.align="left";this.horizontalGap=0;this.spacing=10;this.markerDisabledColor="#AAB3B3";this.markerType="square";this.markerSize=
|
129 |
+
16;this.markerBorderThickness=this.markerBorderAlpha=1;this.marginBottom=this.marginTop=0;this.marginLeft=this.marginRight=20;this.autoMargins=!0;this.valueWidth=50;this.switchable=!0;this.switchType="x";this.switchColor="#FFFFFF";this.rollOverColor="#CC0000";this.reversedOrder=!1;this.labelText="[[title]]";this.valueText="[[value]]";this.useMarkerColorForLabels=!1;this.rollOverGraphAlpha=1;this.textClickEnabled=!1;this.equalWidths=!0;this.dateFormat="DD-MM-YYYY";this.backgroundColor="#FFFFFF";this.backgroundAlpha=
|
130 |
+
0;this.useGraphSettings=!1;this.showEntries=!0;AmCharts.applyTheme(this,a,this.cname)},setData:function(a){this.legendData=a;this.invalidateSize()},invalidateSize:function(){this.destroy();this.entries=[];this.valueLabels=[];var a=this.legendData;this.enabled&&(AmCharts.ifArray(a)||AmCharts.ifArray(this.data))&&this.drawLegend()},drawLegend:function(){var a=this.chart,b=this.position,c=this.width,d=a.divRealWidth,f=a.divRealHeight,e=this.div,g=this.legendData;this.data&&(g=this.data);isNaN(this.fontSize)&&
|
131 |
+
(this.fontSize=a.fontSize);if("right"==b||"left"==b)this.maxColumns=1,this.autoMargins&&(this.marginLeft=this.marginRight=10);else if(this.autoMargins){this.marginRight=a.marginRight;this.marginLeft=a.marginLeft;var h=a.autoMarginOffset;"bottom"==b?(this.marginBottom=h,this.marginTop=0):(this.marginTop=h,this.marginBottom=0)}c=void 0!==c?AmCharts.toCoordinate(c,d):a.realWidth;"outside"==b?(c=e.offsetWidth,f=e.offsetHeight,e.clientHeight&&(c=e.clientWidth,f=e.clientHeight)):(isNaN(c)||(e.style.width=
|
132 |
+
c+"px"),e.className="amChartsLegend "+a.classNamePrefix+"-legend-div");this.divWidth=c;(b=this.container)?(b.container.innerHTML="",e.appendChild(b.container),b.width=c,b.height=f,b.addDefs(a)):b=new AmCharts.AmDraw(e,c,f,a);this.container=b;this.lx=0;this.ly=8;f=this.markerSize;f>this.fontSize&&(this.ly=f/2-1);0<f&&(this.lx+=f+this.markerLabelGap);this.titleWidth=0;if(f=this.title)f=AmCharts.text(this.container,f,this.color,a.fontFamily,this.fontSize,"start",!0),AmCharts.setCN(a,f,"legend-title"),
|
133 |
+
f.translate(this.marginLeft,this.marginTop+this.verticalGap+this.ly+1),a=f.getBBox(),this.titleWidth=a.width+15,this.titleHeight=a.height+6;this.index=this.maxLabelWidth=0;if(this.showEntries){for(a=0;a<g.length;a++)this.createEntry(g[a]);for(a=this.index=0;a<g.length;a++)this.createValue(g[a])}this.arrangeEntries();this.updateValues()},arrangeEntries:function(){var a=this.position,b=this.marginLeft+this.titleWidth,c=this.marginRight,d=this.marginTop,f=this.marginBottom,e=this.horizontalGap,g=this.div,
|
134 |
+
h=this.divWidth,k=this.maxColumns,l=this.verticalGap,m=this.spacing,n=h-c-b,t=0,p=0,z=this.container;this.set&&this.set.remove();var y=z.set();this.set=y;var v=z.set();y.push(v);var B=this.entries,A,w;for(w=0;w<B.length;w++){A=B[w].getBBox();var r=A.width;r>t&&(t=r);A=A.height;A>p&&(p=A)}var r=p=0,u=e,q=0,x=0;for(w=0;w<B.length;w++){var C=B[w];this.reversedOrder&&(C=B[B.length-w-1]);A=C.getBBox();var F;this.equalWidths?F=e+r*(t+m+this.markerLabelGap):(F=u,u=u+A.width+e+m);A.height>x&&(x=A.height);
|
135 |
+
F+A.width>n&&0<w&&0!==r&&(p++,r=0,F=e,u=F+A.width+e+m,q=q+x+l,x=0);C.translate(F,q);r++;!isNaN(k)&&r>=k&&(r=0,p++,q=q+x+l,x=0);v.push(C)}A=v.getBBox();k=A.height+2*l-1;"left"==a||"right"==a?(h=A.width+2*e,g.style.width=h+b+c+"px"):h=h-b-c-1;c=AmCharts.polygon(this.container,[0,h,h,0],[0,0,k,k],this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);AmCharts.setCN(this.chart,c,"legend-bg");y.push(c);y.translate(b,d);c.toBack();b=e;if("top"==a||"bottom"==a||"absolute"==a||"outside"==
|
136 |
+
a)"center"==this.align?b=e+(h-A.width)/2:"right"==this.align&&(b=e+h-A.width);v.translate(b,l+1);this.titleHeight>k&&(k=this.titleHeight);a=k+d+f+1;0>a&&(a=0);a>this.chart.divRealHeight&&(g.style.top="0px");g.style.height=Math.round(a)+"px";z.setSize(this.divWidth,a)},createEntry:function(a){if(!1!==a.visibleInLegend){var b=this.chart,c=a.markerType;a.legendEntryWidth=this.markerSize;c||(c=this.markerType);var d=a.color,f=a.alpha;a.legendKeyColor&&(d=a.legendKeyColor());a.legendKeyAlpha&&(f=a.legendKeyAlpha());
|
137 |
+
var e;!0===a.hidden&&(e=d=this.markerDisabledColor);var g=a.pattern,h=a.customMarker;h||(h=this.customMarker);var k=this.container,l=this.markerSize,m=0,n=0,t=l/2;if(this.useGraphSettings){c=a.type;this.switchType=void 0;if("line"==c||"step"==c||"smoothedLine"==c||"ohlc"==c)g=k.set(),a.hidden||(d=a.lineColorR,e=a.bulletBorderColorR),m=AmCharts.line(k,[0,2*l],[l/2,l/2],d,a.lineAlpha,a.lineThickness,a.dashLength),AmCharts.setCN(b,m,"graph-stroke"),g.push(m),a.bullet&&(a.hidden||(d=a.bulletColorR),m=
|
138 |
+
AmCharts.bullet(k,a.bullet,a.bulletSize,d,a.bulletAlpha,a.bulletBorderThickness,e,a.bulletBorderAlpha))&&(AmCharts.setCN(b,m,"graph-bullet"),m.translate(l+1,l/2),g.push(m)),t=0,m=l,n=l/3;else{var p;a.getGradRotation&&(p=a.getGradRotation());m=a.fillColorsR;!0===a.hidden&&(m=d);if(g=this.createMarker("rectangle",m,a.fillAlphas,a.lineThickness,d,a.lineAlpha,p,g))t=l,g.translate(t,l/2);m=l}AmCharts.setCN(b,g,"graph-"+c);AmCharts.setCN(b,g,"graph-"+a.id)}else h?(b.path&&(h=b.path+h),g=k.image(h,0,0,l,
|
139 |
+
l)):(g=this.createMarker(c,d,f,void 0,void 0,void 0,void 0,g))&&g.translate(l/2,l/2);AmCharts.setCN(b,g,"legend-marker");this.addListeners(g,a);k=k.set([g]);this.switchable&&a.switchable&&k.setAttr("cursor","pointer");void 0!=a.id&&AmCharts.setCN(b,k,"legend-item-"+a.id);AmCharts.setCN(b,k,a.className,!0);(e=this.switchType)&&"none"!=e&&("x"==e?(c=this.createX(),c.translate(l/2,l/2)):c=this.createV(),c.dItem=a,!0!==a.hidden?"x"==e?c.hide():c.show():"x"!=e&&c.hide(),this.switchable||c.hide(),this.addListeners(c,
|
140 |
+
a),a.legendSwitch=c,k.push(c),AmCharts.setCN(b,c,"legend-switch"));e=this.color;a.showBalloon&&this.textClickEnabled&&void 0!==this.selectedColor&&(e=this.selectedColor);this.useMarkerColorForLabels&&(e=d);!0===a.hidden&&(e=this.markerDisabledColor);d=AmCharts.massReplace(this.labelText,{"[[title]]":a.title});c=this.fontSize;g&&(l<=c&&g.translate(t,l/2+this.ly-c/2+(c+2-l)/2-n),a.legendEntryWidth=g.getBBox().width);var z;d&&(d=AmCharts.fixBrakes(d),a.legendTextReal=d,z=this.labelWidth,z=isNaN(z)?AmCharts.text(this.container,
|
141 |
+
d,e,b.fontFamily,c,"start"):AmCharts.wrappedText(this.container,d,e,b.fontFamily,c,"start",!1,z,0),AmCharts.setCN(b,z,"legend-label"),z.translate(this.lx+m,this.ly),k.push(z),b=z.getBBox().width,this.maxLabelWidth<b&&(this.maxLabelWidth=b));this.entries[this.index]=k;a.legendEntry=this.entries[this.index];a.legendLabel=z;this.index++}},addListeners:function(a,b){var c=this;a&&a.mouseover(function(a){c.rollOverMarker(b,a)}).mouseout(function(a){c.rollOutMarker(b,a)}).click(function(a){c.clickMarker(b,
|
142 |
a)})},rollOverMarker:function(a,b){this.switchable&&this.dispatch("rollOverMarker",a,b);this.dispatch("rollOverItem",a,b)},rollOutMarker:function(a,b){this.switchable&&this.dispatch("rollOutMarker",a,b);this.dispatch("rollOutItem",a,b)},clickMarker:function(a,b){this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",a,b));this.dispatch("clickMarker",a,b)},rollOverLabel:function(a,b){a.hidden||(this.textClickEnabled&&a.legendLabel&&a.legendLabel.attr({fill:this.rollOverColor}),
|
143 |
this.dispatch("rollOverItem",a,b))},rollOutLabel:function(a,b){if(!a.hidden){if(this.textClickEnabled&&a.legendLabel){var c=this.color;void 0!==this.selectedColor&&a.showBalloon&&(c=this.selectedColor);this.useMarkerColorForLabels&&(c=a.lineColor,void 0===c&&(c=a.color));a.legendLabel.attr({fill:c})}this.dispatch("rollOutItem",a,b)}},clickLabel:function(a,b){this.textClickEnabled?a.hidden||this.dispatch("clickLabel",a,b):this.switchable&&(!0===a.hidden?this.dispatch("showItem",a,b):this.dispatch("hideItem",
|
144 |
+
a,b))},dispatch:function(a,b,c){this.fire(a,{type:a,dataItem:b,target:this,event:c,chart:this.chart})},createValue:function(a){var b=this,c=b.fontSize,d=b.chart;if(!1!==a.visibleInLegend){var f=b.maxLabelWidth;b.equalWidths||(b.valueAlign="left");"left"==b.valueAlign&&(f=a.legendEntry.getBBox().width);var e=f;if(b.valueText&&0<b.valueWidth){var g=b.color;b.useMarkerColorForValues&&(g=a.color,a.legendKeyColor&&(g=a.legendKeyColor()));!0===a.hidden&&(g=b.markerDisabledColor);var h=b.valueText,f=f+b.lx+
|
145 |
+
b.markerLabelGap+b.valueWidth,k="end";"left"==b.valueAlign&&(f-=b.valueWidth,k="start");g=AmCharts.text(b.container,h,g,b.chart.fontFamily,c,k);AmCharts.setCN(d,g,"legend-value");g.translate(f,b.ly);b.entries[b.index].push(g);e+=b.valueWidth+2*b.markerLabelGap;g.dItem=a;b.valueLabels.push(g)}b.index++;d=b.markerSize;d<c+7&&(d=c+7,AmCharts.VML&&(d+=3));c=b.container.rect(a.legendEntryWidth,0,e,d,0,0).attr({stroke:"none",fill:"#fff","fill-opacity":.005});c.dItem=a;b.entries[b.index-1].push(c);c.mouseover(function(c){b.rollOverLabel(a,
|
146 |
+
c)}).mouseout(function(c){b.rollOutLabel(a,c)}).click(function(c){b.clickLabel(a,c)})}},createV:function(){var a=this.markerSize;return AmCharts.polygon(this.container,[a/5,a/2,a-a/5,a/2],[a/3,a-a/5,a/5,a/1.7],this.switchColor)},createX:function(){var a=(this.markerSize-4)/2,b={stroke:this.switchColor,"stroke-width":3},c=this.container,d=AmCharts.line(c,[-a,a],[-a,a]).attr(b),a=AmCharts.line(c,[-a,a],[a,-a]).attr(b);return this.container.set([d,a])},createMarker:function(a,b,c,d,f,e,g,h){var k=this.markerSize,
|
147 |
+
l=this.container;f||(f=this.markerBorderColor);f||(f=b);isNaN(d)&&(d=this.markerBorderThickness);isNaN(e)&&(e=this.markerBorderAlpha);return AmCharts.bullet(l,a,k,b,c,d,f,e,k,g,h)},validateNow:function(){this.invalidateSize()},updateValues:function(){var a=this.valueLabels,b=this.chart,c,d=this.data;for(c=0;c<a.length;c++){var f=a[c],e=f.dItem,g=" ";if(d)e.value?f.text(e.value):f.text("");else{if(void 0!==e.type){var h=e.currentDataItem,k=this.periodValueText;e.legendPeriodValueText&&(k=e.legendPeriodValueText);
|
148 |
+
h?(g=this.valueText,e.legendValueText&&(g=e.legendValueText),g=b.formatString(g,h)):k&&(g=b.formatPeriodString(k,e))}else g=b.formatString(this.valueText,e);if(k=this.valueFunction)h&&(e=h),g=k(e,g);f.text(g)}}},renderFix:function(){if(!AmCharts.VML){var a=this.container;a&&a.renderFix()}},destroy:function(){this.div.innerHTML="";AmCharts.remove(this.set)}});AmCharts.AmMap=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(a){this.cname="AmMap";this.type="map";this.theme=a;this.version="3.13.1";this.svgNotSupported="This browser doesn't support SVG. Use Chrome, Firefox, Internet Explorer 9 or later.";this.createEvents("rollOverMapObject","rollOutMapObject","clickMapObject","selectedObjectChanged","homeButtonClicked","zoomCompleted","dragCompleted","positionChanged","writeDevInfo","click");this.zoomDuration=1;this.zoomControl=new AmCharts.ZoomControl(a);
|
149 |
this.fitMapToContainer=!0;this.mouseWheelZoomEnabled=this.backgroundZoomsToTop=!1;this.allowClickOnSelectedObject=this.useHandCursorOnClickableOjects=this.showBalloonOnSelectedObject=!0;this.showObjectsAfterZoom=this.wheelBusy=!1;this.zoomOnDoubleClick=this.useObjectColorForBalloon=!0;this.allowMultipleDescriptionWindows=!1;this.dragMap=this.centerMap=this.linesAboveImages=!0;this.colorSteps=5;this.showAreasInList=!0;this.showLinesInList=this.showImagesInList=!1;this.areasProcessor=new AmCharts.AreasProcessor(this);
|
150 |
this.areasSettings=new AmCharts.AreasSettings(a);this.imagesProcessor=new AmCharts.ImagesProcessor(this);this.imagesSettings=new AmCharts.ImagesSettings(a);this.linesProcessor=new AmCharts.LinesProcessor(this);this.linesSettings=new AmCharts.LinesSettings(a);this.showDescriptionOnHover=!1;AmCharts.AmMap.base.construct.call(this,a);this.creditsPosition="bottom-left";this.product="ammap";this.areasClasses={};AmCharts.applyTheme(this,a,this.cname)},initChart:function(){this.zoomInstantly=!0;var a=this.container;
|
151 |
if(this.sizeChanged&&AmCharts.hasSVG&&this.chartCreated){this.freeLabelsSet&&this.freeLabelsSet.remove();this.freeLabelsSet=a.set();this.container.setSize(this.realWidth,this.realHeight);this.resizeMap();this.drawBackground();this.redrawLabels();this.drawTitles();this.processObjects();this.rescaleObjects();a=this.container;this.zoomControl.init(this,a);this.drawBg();var b=this.smallMap;b&&b.init(this,a);(b=this.valueLegend)&&b.init(this,a);this.sizeChanged=!1;this.zoomToLongLat(this.zLevelTemp,this.zLongTemp,
|
152 |
this.zLatTemp,!0);this.previousWidth=this.realWidth;this.previousHeight=this.realHeight;this.updateSmallMap();this.linkSet.toFront()}else(AmCharts.AmMap.base.initChart.call(this),AmCharts.hasSVG)?(this.dataChanged&&(this.parseData(),this.dispatchDataUpdated=!0,this.dataChanged=!1,a=this.legend)&&(a.position="absolute",a.invalidateSize()),this.createDescriptionsDiv(),this.svgAreas=[],this.svgAreasById={},this.drawChart()):(document.createTextNode(this.svgNotSupported),this.chartDiv.style.textAlign=
|
153 |
"",this.chartDiv.setAttribute("class","ammapAlert"),this.chartDiv.innerHTML=this.svgNotSupported,this.fire("failed",{type:"failed",chart:this}),clearInterval(this.interval))},invalidateSize:function(){var a=this.zoomLongitude();isNaN(a)||(this.zLongTemp=a);a=this.zoomLatitude();isNaN(a)||(this.zLatTemp=a);a=this.zoomLevel();isNaN(a)||(this.zLevelTemp=a);AmCharts.AmMap.base.invalidateSize.call(this)},handleWheelReal:function(a){if(!this.wheelBusy){this.stopAnimation();var b=this.zoomLevel(),c=this.zoomControl,
|
154 |
+
d=c.zoomFactor;this.wheelBusy=!0;a=AmCharts.fitToBounds(0<a?b*d:b/d,c.minZoomLevel,c.maxZoomLevel);d=this.mouseX/this.mapWidth;c=this.mouseY/this.mapHeight;d=(this.zoomX()-d)*(a/b)+d;b=(this.zoomY()-c)*(a/b)+c;this.zoomTo(a,d,b)}},addLegend:function(a,b){a.position="absolute";a.autoMargins=!1;a.valueWidth=0;a.switchable=!1;AmCharts.AmMap.base.addLegend.call(this,a,b);void 0==a.enabled&&(a.enabled=!0);return a},handleLegendEvent:function(){},createDescriptionsDiv:function(){if(!this.descriptionsDiv){var a=
|
155 |
+
document.createElement("div"),b=a.style;b.position="absolute";b.left="0px";b.top="0px";this.descriptionsDiv=a}this.containerDiv.appendChild(this.descriptionsDiv)},drawChart:function(){AmCharts.AmMap.base.drawChart.call(this);var a=this.dataProvider;this.dataProvider=a=AmCharts.extend(a,new AmCharts.MapData,!0);this.areasSettings=AmCharts.processObject(this.areasSettings,AmCharts.AreasSettings,this.theme);this.imagesSettings=AmCharts.processObject(this.imagesSettings,AmCharts.ImagesSettings,this.theme);
|
156 |
+
this.linesSettings=AmCharts.processObject(this.linesSettings,AmCharts.LinesSettings,this.theme);var b=this.container;this.mapContainer&&this.mapContainer.remove();this.mapContainer=b.set();this.graphsSet.push(this.mapContainer);var c;a.map&&(c=AmCharts.maps[a.map]);a.mapVar&&(c=a.mapVar);c?(this.svgData=c.svg,this.getBounds(),this.buildEverything()):(a=a.mapURL)&&this.loadXml(a);this.balloonsSet.toFront()},drawBg:function(){var a=this;a.background.click(function(){a.handleBackgroundClick()})},buildEverything:function(){var a=
|
157 |
+
this;if(0<a.realWidth&&0<a.realHeight){var b=a.container;a.zoomControl=AmCharts.processObject(a.zoomControl,AmCharts.ZoomControl,a.theme);a.zoomControl.init(this,b);a.drawBg();a.buildSVGMap();var c=a.smallMap;c&&(a.smallMap=AmCharts.processObject(a.smallMap,AmCharts.SmallMap,a.theme),c=a.smallMap,c.init(a,b));c=a.dataProvider;isNaN(c.zoomX)&&isNaN(c.zoomY)&&isNaN(c.zoomLatitude)&&isNaN(c.zoomLongitude)&&(a.centerMap?(c.zoomLatitude=a.coordinateToLatitude(a.mapHeight/2),c.zoomLongitude=a.coordinateToLongitude(a.mapWidth/
|
158 |
+
2)):(c.zoomX=0,c.zoomY=0),a.zoomInstantly=!0);a.selectObject(a.dataProvider);a.processAreas();if(c=a.valueLegend)c=AmCharts.processObject(c,AmCharts.ValueLegend,a.theme),a.valueLegend=c,c.init(a,b);a.objectList&&(a.objectList=AmCharts.processObject(a.objectList,AmCharts.ObjectList),b=a.objectList)&&(a.clearObjectList(),b.init(a));clearInterval(a.mapInterval);a.mapInterval=setInterval(function(){a.update.call(a)},AmCharts.updateRate);a.dispDUpd();a.linkSet.toFront();a.chartCreated=!0}else a.cleanChart()},
|
159 |
+
hideGroup:function(a){this.showHideGroup(a,!1)},showGroup:function(a){this.showHideGroup(a,!0)},showHideGroup:function(a,b){this.showHideReal(this.imagesProcessor.allObjects,a,b);this.showHideReal(this.areasProcessor.allObjects,a,b);this.showHideReal(this.linesProcessor.allObjects,a,b)},showHideReal:function(a,b,c){var d;for(d=0;d<a.length;d++){var f=a[d];if(f.groupId==b){var e=f.displayObject;e&&(c?(f.hidden=!1,e.show()):(f.hidden=!0,e.hide()))}}},update:function(){this.zoomControl.update()},animateMap:function(){var a=
|
160 |
+
this;a.totalFrames=1E3*a.zoomDuration/AmCharts.updateRate;a.totalFrames+=1;a.frame=0;a.tweenPercent=0;setTimeout(function(){a.updateSize.call(a)},AmCharts.updateRate)},updateSize:function(){var a=this,b=a.totalFrames;a.preventHover=!0;a.frame<=b?(a.frame++,b=AmCharts.easeOutSine(0,a.frame,0,1,b),1<=b?(b=1,a.preventHover=!1,a.wheelBusy=!1):setTimeout(function(){a.updateSize.call(a)},AmCharts.updateRate),.8<b&&(a.preventHover=!1)):(b=1,a.preventHover=!1,a.wheelBusy=!1);a.tweenPercent=b;a.rescaleMapAndObjects()},
|
161 |
+
rescaleMapAndObjects:function(){var a=this.initialScale,b=this.initialX,c=this.initialY,d=this.tweenPercent,a=a+(this.finalScale-a)*d;this.mapContainer.translate(b+(this.finalX-b)*d,c+(this.finalY-c)*d,a);if(this.areasSettings.adjustOutlineThickness)for(b=this.dataProvider.areas,c=0;c<b.length;c++){var f=b[c],e=f.displayObject;e&&e.setAttr("stroke-width",f.outlineThicknessReal/a)}this.rescaleObjects();this.positionChanged();this.updateSmallMap();1==d&&(d={type:"zoomCompleted",chart:this},this.fire(d.type,
|
162 |
+
d))},updateSmallMap:function(){this.smallMap&&this.smallMap.update()},rescaleObjects:function(){var a=this.mapContainer.scale,b=this.imagesProcessor.objectsToResize,c;for(c=0;c<b.length;c++){var d=b[c].image;d.translate(d.x,d.y,b[c].scale/a,!0)}b=this.linesProcessor;if(d=b.linesToResize)for(c=0;c<d.length;c++){var f=d[c];f.line.setAttr("stroke-width",f.thickness/a)}b=b.objectsToResize;for(c=0;c<b.length;c++)d=b[c],d.translate(d.x,d.y,1/a)},handleTouchStart:function(a){this.handleMouseMove(a);this.handleMouseDown(a)},
|
163 |
+
handleTouchEnd:function(a){this.previousDistance=NaN;this.handleReleaseOutside(a)},handleMouseDown:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!0;a&&this.mouseIsOver&&a.preventDefault&&this.panEventsEnabled&&a.preventDefault();if(this.chartCreated&&!this.preventHover&&(this.dragMap&&(this.stopAnimation(),this.isDragging=!0,this.mapContainerClickX=this.mapContainer.x,this.mapContainerClickY=this.mapContainer.y),a||(a=window.event),a.shiftKey&&!0===this.developerMode&&this.getDevInfo(),a&&
|
164 |
+
a.touches)){var b=this.mouseX,c=this.mouseY,d=a.touches.item(1);d&&(a=d.pageX-AmCharts.findPosX(this.div),d=d.pageY-AmCharts.findPosY(this.div),this.middleXP=(b+(a-b)/2)/this.realWidth,this.middleYP=(c+(d-c)/2)/this.realHeight)}},stopDrag:function(){this.isDragging=!1},handleReleaseOutside:function(){if(AmCharts.isModern&&!this.preventHover){this.stopDrag();var a=this.zoomControl;a&&a.draggerUp();this.mapWasDragged=!1;var a=this.mapContainer,b=this.mapContainerClickX,c=this.mapContainerClickY;isNaN(b)||
|
165 |
+
isNaN(c)||!(2<Math.abs(a.x-b)||Math.abs(a.y-c))||(this.mapWasDragged=!0,a={type:"dragCompleted",zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLevel:this.zoomLevel(),chart:this},this.fire(a.type,a));!this.mouseIsOver||this.mapWasDragged||this.skipClick||(a={type:"click",x:this.mouseX,y:this.mouseY,chart:this},this.fire(a.type,a),this.skipClick=!1);this.mapContainerClickY=this.mapContainerClickX=NaN;this.objectWasClicked=!1;this.zoomOnDoubleClick&&this.mouseIsOver&&(a=(new Date).getTime(),200>a-this.previousClickTime&&
|
166 |
+
20<a-this.previousClickTime&&this.doDoubleClickZoom(),this.previousClickTime=a)}},handleTouchMove:function(a){this.handleMouseMove(a)},resetPinch:function(){this.mapWasPinched=!1},handleMouseMove:function(a){var b=this;AmCharts.AmMap.base.handleMouseMove.call(b,a);b.panEventsEnabled&&b.mouseIsOver&&a&&a.preventDefault&&a.preventDefault();var c=b.previuosMouseX,d=b.previuosMouseY,f=b.mouseX,e=b.mouseY,g=b.zoomControl;isNaN(c)&&(c=f);isNaN(d)&&(d=e);b.mouse2X=NaN;b.mouse2Y=NaN;a&&a.touches&&(a=a.touches.item(1))&&
|
167 |
+
(b.mouse2X=a.pageX-AmCharts.findPosX(b.div),b.mouse2Y=a.pageY-AmCharts.findPosY(b.div));if(a=b.mapContainer){var h=b.mouse2X,k=b.mouse2Y;b.pinchTO&&clearTimeout(b.pinchTO);b.pinchTO=setTimeout(function(){b.resetPinch.call(b)},1E3);var l=b.realHeight,m=b.realWidth,n=b.mapWidth,t=b.mapHeight;if(!isNaN(h)){b.stopDrag();var h=Math.sqrt(Math.pow(h-f,2)+Math.pow(k-e,2)),p=b.previousDistance,k=Math.max(b.realWidth,b.realHeight);5>Math.abs(p-h)&&(b.isDragging=!0);if(!isNaN(p)){var z=5*Math.abs(p-h)/k,k=a.scale,
|
168 |
+
k=AmCharts.fitToBounds(p<h?k+k*z:k-k*z,g.minZoomLevel,g.maxZoomLevel),g=b.zoomLevel(),y=b.middleXP,p=b.middleYP,z=l/t,v=m/n,y=(b.zoomX()-y*v)*(k/g)+y*v,p=(b.zoomY()-p*z)*(k/g)+p*z;.1<Math.abs(k-g)&&(b.zoomTo(k,y,p,!0),b.mapWasPinched=!0,clearTimeout(b.pinchTO))}b.previousDistance=h}h=a.scale;b.isDragging&&(b.hideBalloon(),b.positionChanged(),c=a.x+(f-c),d=a.y+(e-d),b.preventDragOut&&(t=-t*h+l/2,l/=2,c=AmCharts.fitToBounds(c,-n*h+m/2,m/2),d=AmCharts.fitToBounds(d,t,l)),a.translate(c,d,h),b.updateSmallMap());
|
169 |
+
b.previuosMouseX=f;b.previuosMouseY=e}},selectObject:function(a){var b=this;a||(a=b.dataProvider);a.isOver=!1;var c=a.linkToObject;"string"==typeof c&&(c=b.getObjectById(c));a.useTargetsZoomValues&&c&&(a.zoomX=c.zoomX,a.zoomY=c.zoomY,a.zoomLatitude=c.zoomLatitude,a.zoomLongitude=c.zoomLongitude,a.zoomLevel=c.zoomLevel);var d=b.selectedObject;d&&b.returnInitialColor(d);b.selectedObject=a;var f=!1,e;"MapArea"==a.objectType&&(a.autoZoomReal&&(f=!0),e=b.areasSettings.selectedOutlineColor);if(c&&!f&&("string"==
|
170 |
+
typeof c&&(c=b.getObjectById(c)),isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY))){if(b.extendMapData(c))return;b.selectObject(c);return}b.allowMultipleDescriptionWindows||b.closeAllDescriptions();clearTimeout(b.selectedObjectTimeOut);clearTimeout(b.processObjectsTimeOut);c=b.zoomDuration;!f&&isNaN(a.zoomLevel)&&isNaN(a.zoomX)&&isNaN(a.zoomY)?(b.showDescriptionAndGetUrl(),b.processObjects()):(b.selectedObjectTimeOut=setTimeout(function(){b.showDescriptionAndGetUrl.call(b)},1E3*c+200),b.showObjectsAfterZoom?
|
171 |
+
b.processObjectsTimeOut=setTimeout(function(){b.processObjects.call(b)},1E3*c+200):b.processObjects());if(f=a.displayObject){a.bringForwardOnHover&&f.toFront();if(!a.preserveOriginalAttributes){f.setAttr("stroke",a.outlineColorReal);var g=a.selectedColorReal;void 0!==g&&f.setAttr("fill",g);void 0!==e&&f.setAttr("stroke",e);if("MapLine"==a.objectType){var h=a.lineSvg;h&&h.setAttr("stroke",g);var k=a.arrowSvg;k&&(k.setAttr("fill",g),k.setAttr("stroke",g))}var l=a.imageLabel;l&&(c=a.selectedLabelColorReal,
|
172 |
+
void 0!==c&&l.setAttr("fill",c))}a.selectable||(f.setAttr("cursor","default"),l&&l.setAttr("cursor","default"))}else b.returnInitialColorReal(a);if(f=a.groupId)for(l=b.getGroupById(f),c=0;c<l.length;c++)if(k=l[c],k.isOver=!1,f=k.displayObject)if(h=k.selectedColorReal,void 0!==e&&f.setAttr("stroke",e),void 0!==h?f.setAttr("fill",h):b.returnInitialColor(k),"MapLine"==k.objectType&&((h=k.lineSvg)&&h.setAttr("stroke",g),k=k.arrowSvg))k.setAttr("fill",g),k.setAttr("stroke",g);b.zoomToSelectedObject();
|
173 |
+
d!=a&&(a={type:"selectedObjectChanged",chart:b},b.fire(a.type,a))},returnInitialColor:function(a,b){this.returnInitialColorReal(a);b&&(a.isFirst=!1);if(this.selectedObject.bringForwardOnHover){var c=this.selectedObject.displayObject;c&&c.toFront()}if(c=a.groupId){var c=this.getGroupById(c),d;for(d=0;d<c.length;d++)this.returnInitialColorReal(c[d]),b&&(c[d].isFirst=!1)}},closeAllDescriptions:function(){this.descriptionsDiv.innerHTML=""},returnInitialColorReal:function(a){a.isOver=!1;var b=a.displayObject;
|
174 |
+
if(b){b.toPrevious();if("MapImage"==a.objectType){var c=a.tempScale;isNaN(c)||b.translate(b.x,b.y,c,!0);a.tempScale=NaN}c=a.colorReal;if("MapLine"==a.objectType){var d=a.lineSvg;d&&d.setAttr("stroke",c);if(d=a.arrowSvg)d.setAttr("fill",c),d.setAttr("stroke",c)}a.showAsSelected&&(c=a.selectedColorReal);"bubble"==a.type&&(c=void 0);void 0!==c&&b.setAttr("fill",c);(d=a.image)&&d.setAttr("fill",c);b.setAttr("stroke",a.outlineColorReal);"MapArea"==a.objectType&&(c=1,this.areasSettings.adjustOutlineThickness&&
|
175 |
(c=this.zoomLevel()),b.setAttr("fill-opacity",a.alphaReal),b.setAttr("stroke-opacity",a.outlineAlphaReal),b.setAttr("stroke-width",a.outlineThicknessReal/c));(c=a.pattern)&&b.pattern(c,this.mapScale);(b=a.imageLabel)&&!a.labelInactive&&b.setAttr("fill",a.labelColorReal)}},zoomToRectangle:function(a,b,c,d){var f=this.realWidth,e=this.realHeight,g=this.mapSet.scale,h=this.zoomControl,f=AmCharts.fitToBounds(c/f>d/e?.8*f/(c*g):.8*e/(d*g),h.minZoomLevel,h.maxZoomLevel);this.zoomToMapXY(f,(a+c/2)*g,(b+
|
176 |
d/2)*g)},zoomToLatLongRectangle:function(a,b,c,d){var f=this.dataProvider,e=this.zoomControl,g=Math.abs(c-a),h=Math.abs(b-d),k=Math.abs(f.rightLongitude-f.leftLongitude),f=Math.abs(f.topLatitude-f.bottomLatitude),e=AmCharts.fitToBounds(g/k>h/f?.8*k/g:.8*f/h,e.minZoomLevel,e.maxZoomLevel);this.zoomToLongLat(e,a+(c-a)/2,d+(b-d)/2)},getGroupById:function(a){var b=[];this.getGroup(this.imagesProcessor.allObjects,a,b);this.getGroup(this.linesProcessor.allObjects,a,b);this.getGroup(this.areasProcessor.allObjects,
|
177 |
a,b);return b},zoomToGroup:function(a){a="object"==typeof a?a:this.getGroupById(a);var b,c,d,f,e;for(e=0;e<a.length;e++){var g=a[e].displayObject.getBBox(),h=g.y,k=g.y+g.height,l=g.x,g=g.x+g.width;if(h<b||isNaN(b))b=h;if(k>f||isNaN(f))f=k;if(l<c||isNaN(c))c=l;if(g>d||isNaN(d))d=g}a=this.mapSet.getBBox();c-=a.x;d-=a.x;f-=a.y;b-=a.y;this.zoomToRectangle(c,b,d-c,f-b)},getGroup:function(a,b,c){if(a){var d;for(d=0;d<a.length;d++){var f=a[d];f.groupId==b&&c.push(f)}}},zoomToStageXY:function(a,b,c,d){if(!this.objectWasClicked){var f=
|
181 |
f=this.zoomLevel();isNaN(b)&&(b=this.realWidth/this.mapWidth,b=(this.zoomX()-.5*b)*(a/f)+.5*b);isNaN(c)&&(c=this.realHeight/this.mapHeight,c=(this.zoomY()-.5*c)*(a/f)+.5*c);this.stopAnimation();isNaN(a)||(f=this.mapContainer,this.initialX=f.x,this.initialY=f.y,this.initialScale=f.scale,this.finalX=this.mapWidth*b,this.finalY=this.mapHeight*c,this.finalScale=a,this.finalX!=this.initialX||this.finalY!=this.initialY||this.finalScale!=this.initialScale?d?(this.tweenPercent=1,this.rescaleMapAndObjects(),
|
182 |
this.wheelBusy=!1):this.animateMap():this.wheelBusy=!1)},loadXml:function(a){var b;b=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");b.overrideMimeType&&b.overrideMimeType("text/xml");b.open("GET",a,!1);b.send();this.parseXMLObject(b.responseXML);this.svgData&&this.buildEverything()},stopAnimation:function(){this.frame=this.totalFrames},processObjects:function(){var a=this.container,b=this.stageImagesContainer;b&&b.remove();this.stageImagesContainer=b=a.set();this.trendLinesSet.push(b);
|
183 |
var c=this.stageLinesContainer;c&&c.remove();this.stageLinesContainer=c=a.set();this.trendLinesSet.push(c);var d=this.mapImagesContainer;d&&d.remove();this.mapImagesContainer=d=a.set();this.mapContainer.push(d);var f=this.mapLinesContainer;f&&f.remove();this.mapLinesContainer=f=a.set();this.mapContainer.push(f);this.linesAboveImages?(d.toFront(),b.toFront(),f.toFront(),c.toFront()):(f.toFront(),c.toFront(),d.toFront(),b.toFront());if(a=this.selectedObject)this.imagesProcessor.reset(),this.linesProcessor.reset(),
|
184 |
+
this.linesAboveImages?(this.imagesProcessor.process(a),this.linesProcessor.process(a)):(this.linesProcessor.process(a),this.imagesProcessor.process(a));this.rescaleObjects()},processAreas:function(){this.areasProcessor.process(this.dataProvider)},buildSVGMap:function(){var a=this.svgData.g.path,b=this.container,c=b.set();void 0===a.length&&(a=[a]);var d;for(d=0;d<a.length;d++){var f=a[d],e=f.d,g=f.title;f.titleTr&&(g=f.titleTr);e=b.path(e);e.id=f.id;if(this.areasSettings.preserveOriginalAttributes){e.customAttr=
|
185 |
+
{};for(var h in f)"d"!=h&&"id"!=h&&"title"!=h&&(e.customAttr[h]=f[h])}this.svgAreasById[f.id]={area:e,title:g,className:f["class"]};this.svgAreas.push(e);c.push(e)}this.mapSet=c;this.mapContainer.push(c);this.resizeMap()},addObjectEventListeners:function(a,b){var c=this;a.mouseup(function(a){c.clickMapObject(b,a)}).mouseover(function(a){c.rollOverMapObject(b,!0,a)}).mouseout(function(a){c.rollOutMapObject(b,a)}).touchend(function(a){c.clickMapObject(b,a)}).touchstart(function(a){c.rollOverMapObject(b,
|
186 |
+
!0,a)})},checkIfSelected:function(a){var b=this.selectedObject;if(b==a)return!0;if(b=b.groupId){var b=this.getGroupById(b),c;for(c=0;c<b.length;c++)if(b[c]==a)return!0}return!1},clearMap:function(){this.chartDiv.innerHTML="";this.clearObjectList()},clearObjectList:function(){var a=this.objectList;a&&a.div&&(a.div.innerHTML="")},checkIfLast:function(a){if(a){var b=a.parentNode;if(b&&b.lastChild==a)return!0}return!1},showAsRolledOver:function(a){var b=a.displayObject;if(!a.showAsSelected&&b&&!a.isOver){b.node.onmouseout=
|
187 |
+
function(){};b.node.onmouseover=function(){};b.node.onclick=function(){};!a.isFirst&&a.bringForwardOnHover&&(b.toFront(),a.isFirst=!0);var c=a.rollOverColorReal,d;a.preserveOriginalAttributes&&(c=void 0);if(void 0!=c)if("MapImage"==a.objectType)(d=a.image)&&d.setAttr("fill",c);else if("MapLine"==a.objectType){if((d=a.lineSvg)&&d.setAttr("stroke",c),d=a.arrowSvg)d.setAttr("fill",c),d.setAttr("stroke",c)}else b.setAttr("fill",c);(c=a.imageLabel)&&!a.labelInactive&&(d=a.labelRollOverColorReal,void 0!=
|
188 |
+
d&&c.setAttr("fill",d));c=a.rollOverOutlineColorReal;void 0!=c&&("MapImage"==a.objectType?(d=a.image)&&d.setAttr("stroke",c):b.setAttr("stroke",c));if("MapArea"==a.objectType){c=this.areasSettings;d=a.rollOverAlphaReal;isNaN(d)||b.setAttr("fill-opacity",d);d=c.rollOverOutlineAlpha;isNaN(d)||b.setAttr("stroke-opacity",d);d=1;this.areasSettings.adjustOutlineThickness&&(d=this.zoomLevel());var f=c.rollOverOutlineThickness;isNaN(f)||b.setAttr("stroke-width",f/d);(c=c.rollOverPattern)&&b.pattern(c,this.mapScale)}"MapImage"==
|
189 |
+
a.objectType&&(c=a.rollOverScaleReal,isNaN(c)||1==c||(a.tempScale=b.scale,b.translate(b.x,b.y,b.scale*c,!0)));this.useHandCursorOnClickableOjects&&this.checkIfClickable(a)&&b.setAttr("cursor","pointer");this.addObjectEventListeners(b,a);a.isOver=!0}},rollOverMapObject:function(a,b,c){if(this.chartCreated){this.handleMouseMove();var d=this.previouslyHovered;d&&d!=a?(!1===this.checkIfSelected(d)&&(this.returnInitialColor(d,!0),this.previouslyHovered=null),this.hideBalloon()):clearTimeout(this.hoverInt);
|
190 |
+
if(!this.preventHover){if(!1===this.checkIfSelected(a)){if(d=a.groupId){var d=this.getGroupById(d),f;for(f=0;f<d.length;f++)d[f]!=a&&this.showAsRolledOver(d[f])}this.showAsRolledOver(a)}else(d=a.displayObject)&&(this.allowClickOnSelectedObject?d.setAttr("cursor","pointer"):d.setAttr("cursor","default"));if(this.showDescriptionOnHover)this.showDescription(a);else if((this.showBalloonOnSelectedObject||!this.checkIfSelected(a))&&!1!==b&&(f=this.balloon,b=a.colorReal,d="",void 0!==b&&this.useObjectColorForBalloon||
|
191 |
+
(b=f.fillColor),(f=a.balloonTextReal)&&(d=this.formatString(f,a)),this.balloonLabelFunction&&(d=this.balloonLabelFunction(a,this)),d&&""!==d)){var e,g;"MapArea"==a.objectType&&(g=this.getAreaCenterLatitude(a),e=this.getAreaCenterLongitude(a),g=this.latitudeToY(g),e=this.longitudeToX(e));"MapImage"==a.objectType&&(e=a.displayObject.x*this.zoomLevel()+this.mapContainer.x,g=a.displayObject.y*this.zoomLevel()+this.mapContainer.y);this.showBalloon(d,b,this.mouseIsOver,e,g)}c={type:"rollOverMapObject",
|
192 |
+
mapObject:a,chart:this,event:c};this.fire(c.type,c);this.previouslyHovered=a}}},longitudeToX:function(a){return this.longitudeToCoordinate(a)*this.zoomLevel()+this.mapContainer.x},latitudeToY:function(a){return this.latitudeToCoordinate(a)*this.zoomLevel()+this.mapContainer.y},rollOutMapObject:function(a,b){this.hideBalloon();if(this.chartCreated&&a.isOver){this.checkIfSelected(a)||this.returnInitialColor(a);var c={type:"rollOutMapObject",mapObject:a,chart:this,event:b};this.fire(c.type,c)}},formatString:function(a,
|
193 |
+
b){var c=this.nf,d=this.pf,f=b.title;b.titleTr&&(f=b.titleTr);void 0==f&&(f="");var e=b.value,e=isNaN(e)?"":AmCharts.formatNumber(e,c),c=b.percents,c=isNaN(c)?"":AmCharts.formatNumber(c,d),d=b.description;void 0==d&&(d="");var g=b.customData;void 0==g&&(g="");return a=AmCharts.massReplace(a,{"[[title]]":f,"[[value]]":e,"[[percent]]":c,"[[description]]":d,"[[customData]]":g})},clickMapObject:function(a,b){this.hideBalloon();if(this.chartCreated&&!this.preventHover&&!this.mapWasDragged&&this.checkIfClickable(a)&&
|
194 |
+
!this.mapWasPinched){this.selectObject(a);var c={type:"clickMapObject",mapObject:a,chart:this,event:b};this.fire(c.type,c);this.objectWasClicked=!0}},checkIfClickable:function(a){var b=this.allowClickOnSelectedObject;return this.selectedObject==a&&b?!0:this.selectedObject!=a||b?!0===a.selectable||"MapArea"==a.objectType&&a.autoZoomReal||a.url||a.linkToObject||0<a.images.length||0<a.lines.length||!isNaN(a.zoomLevel)||!isNaN(a.zoomX)||!isNaN(a.zoomY)||a.description?!0:!1:!1},handleResize:function(){(AmCharts.isPercents(this.width)||
|
195 |
+
AmCharts.isPercents(this.height))&&this.invalidateSize();this.renderFix()},resizeMap:function(){var a=this.mapSet;if(a)if(this.fitMapToContainer){var b=a.getBBox(),c=this.realWidth,d=this.realHeight,f=b.width,e=b.height,c=f/c>e/d?c/f:d/e;a.translate(-b.x*c,-b.y*c,c);this.mapScale=c;this.mapHeight=e*c;this.mapWidth=f*c}else b=group.transform.match(/([\-]?[\d.]+)/g),a.translate(b[0],b[1],b[2])},zoomIn:function(){this.skipClick=!0;var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomTo(a)},zoomOut:function(){this.skipClick=
|
196 |
+
!0;var a=this.zoomLevel()/this.zoomControl.zoomFactor;this.zoomTo(a)},moveLeft:function(){this.skipClick=!0;var a=this.zoomX()+this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),a,this.zoomY())},moveRight:function(){this.skipClick=!0;var a=this.zoomX()-this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),a,this.zoomY())},moveUp:function(){this.skipClick=!0;var a=this.zoomY()+this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),this.zoomX(),a)},moveDown:function(){this.skipClick=!0;
|
197 |
+
var a=this.zoomY()-this.zoomControl.panStepSize;this.zoomTo(this.zoomLevel(),this.zoomX(),a)},zoomX:function(){return this.mapSet?Math.round(1E4*this.mapContainer.x/this.mapWidth)/1E4:NaN},zoomY:function(){return this.mapSet?Math.round(1E4*this.mapContainer.y/this.mapHeight)/1E4:NaN},goHome:function(){this.selectObject(this.dataProvider);var a={type:"homeButtonClicked",chart:this};this.fire(a.type,a)},zoomLevel:function(){return Math.round(1E5*this.mapContainer.scale)/1E5},showDescriptionAndGetUrl:function(){var a=
|
198 |
+
this.selectedObject;if(a){this.showDescription();var b=a.url;if(b)AmCharts.getURL(b,a.urlTarget);else if(b=a.linkToObject){if("string"==typeof b){var c=this.getObjectById(b);if(c){this.selectObject(c);return}}b&&a.passZoomValuesToTarget&&(b.zoomLatitude=this.zoomLatitude(),b.zoomLongitude=this.zoomLongitude(),b.zoomLevel=this.zoomLevel());this.extendMapData(b)||this.selectObject(b)}}},extendMapData:function(a){var b=a.objectType;if("MapImage"!=b&&"MapArea"!=b&&"MapLine"!=b)return AmCharts.extend(a,
|
199 |
+
new AmCharts.MapData,!0),this.dataProvider=a,this.zoomInstantly=!0,this.validateData(),!0},showDescription:function(a){a||(a=this.selectedObject);this.allowMultipleDescriptionWindows||this.closeAllDescriptions();if(a.description){var b=a.descriptionWindow;b&&b.close();b=new AmCharts.DescriptionWindow;a.descriptionWindow=b;var c=a.descriptionWindowWidth,d=a.descriptionWindowHeight,f=a.descriptionWindowLeft,e=a.descriptionWindowTop,g=a.descriptionWindowRight,h=a.descriptionWindowBottom;isNaN(g)||(f=
|
200 |
+
this.realWidth-g);isNaN(h)||(e=this.realHeight-h);var k=a.descriptionWindowX;isNaN(k)||(f=k);k=a.descriptionWindowY;isNaN(k)||(e=k);isNaN(f)&&(f=this.mouseX,f=f>this.realWidth/2?f-c-20:f+20);isNaN(e)&&(e=this.mouseY);b.maxHeight=d;k=a.title;a.titleTr&&(k=a.titleTr);b.show(this,this.descriptionsDiv,a.description,k);a=b.div.style;a.position="absolute";a.width=c+"px";a.maxHeight=d+"px";isNaN(h)||(e-=b.div.offsetHeight);isNaN(g)||(f-=b.div.offsetWidth);a.left=f+"px";a.top=e+"px"}},parseXMLObject:function(a){var b=
|
201 |
+
{root:{}};this.parseXMLNode(b,"root",a);this.svgData=b.root.svg;this.getBounds()},getBounds:function(){var a=this.dataProvider;try{var b=this.svgData.defs["amcharts:ammap"];a.leftLongitude=Number(b.leftLongitude);a.rightLongitude=Number(b.rightLongitude);a.topLatitude=Number(b.topLatitude);a.bottomLatitude=Number(b.bottomLatitude);a.projection=b.projection;var c=b.wrappedLongitudes;c&&(a.rightLongitude+=360);a.wrappedLongitudes=c}catch(d){}},recalcLongitude:function(a){var b=this.dataProvider.wrappedLongitudes;
|
202 |
+
return void 0!=a&&b?a<this.dataProvider.leftLongitude?Number(a)+360:a:a},latitudeToCoordinate:function(a){var b,c=this.dataProvider;if(this.mapSet){b=c.topLatitude;var d=c.bottomLatitude;"mercator"==c.projection&&(a=this.mercatorLatitudeToCoordinate(a),b=this.mercatorLatitudeToCoordinate(b),d=this.mercatorLatitudeToCoordinate(d));b=(a-b)/(d-b)*this.mapHeight}return b},longitudeToCoordinate:function(a){a=this.recalcLongitude(a);var b,c=this.dataProvider;this.mapSet&&(b=c.leftLongitude,b=(a-b)/(c.rightLongitude-
|
203 |
+
b)*this.mapWidth);return b},mercatorLatitudeToCoordinate:function(a){89.5<a&&(a=89.5);-89.5>a&&(a=-89.5);a=AmCharts.degreesToRadians(a);a=.5*Math.log((1+Math.sin(a))/(1-Math.sin(a)));return AmCharts.radiansToDegrees(a/2)},zoomLatitude:function(){return this.coordinateToLatitude((-this.mapContainer.y+this.previousHeight/2)/this.zoomLevel())},zoomLongitude:function(){return this.coordinateToLongitude((-this.mapContainer.x+this.previousWidth/2)/this.zoomLevel())},getAreaCenterLatitude:function(a){a=
|
204 |
+
a.displayObject.getBBox();var b=this.mapScale;a=-this.mapSet.getBBox().y*b+(a.y+a.height/2)*b;return this.coordinateToLatitude(a)},getAreaCenterLongitude:function(a){a=a.displayObject.getBBox();var b=this.mapScale;a=-this.mapSet.getBBox().x*b+(a.x+a.width/2)*b;return this.coordinateToLongitude(a)},coordinateToLatitude:function(a){var b;if(this.mapSet){var c=this.dataProvider,d=c.bottomLatitude,f=c.topLatitude;b=this.mapHeight;"mercator"==c.projection?(c=this.mercatorLatitudeToCoordinate(d),f=this.mercatorLatitudeToCoordinate(f),
|
205 |
+
a=2*Math.atan(Math.exp(2*(a*(c-f)/b+f)*Math.PI/180))-.5*Math.PI,b=AmCharts.radiansToDegrees(a)):b=a/b*(d-f)+f}return Math.round(1E6*b)/1E6},coordinateToLongitude:function(a){var b,c=this.dataProvider;this.mapSet&&(b=a/this.mapWidth*(c.rightLongitude-c.leftLongitude)+c.leftLongitude);return Math.round(1E6*b)/1E6},milesToPixels:function(a){var b=this.dataProvider;return this.mapWidth/(b.rightLongitude-b.leftLongitude)*a/69.172},kilometersToPixels:function(a){var b=this.dataProvider;return this.mapWidth/
|
206 |
+
(b.rightLongitude-b.leftLongitude)*a/111.325},handleBackgroundClick:function(a){if(this.backgroundZoomsToTop&&!this.mapWasDragged){var b=this.dataProvider;if(this.checkIfClickable(b))this.clickMapObject(b);else{a=b.zoomX;var c=b.zoomY,d=b.zoomLongitude,f=b.zoomLatitude,b=b.zoomLevel;isNaN(a)||isNaN(c)||this.zoomTo(b,a,c);isNaN(d)||isNaN(f)||this.zoomToLongLat(b,d,f,!0)}}},parseXMLNode:function(a,b,c,d){void 0===d&&(d="");var f,e,g;if(c){var h=c.childNodes.length;for(f=0;f<h;f++){e=c.childNodes[f];
|
207 |
+
var k=e.nodeName,l=e.nodeValue?this.trim(e.nodeValue):"",m=!1;e.attributes&&0<e.attributes.length&&(m=!0);if(0!==e.childNodes.length||""!==l||!1!==m)if(3==e.nodeType||4==e.nodeType){if(""!==l){e=0;for(g in a[b])a[b].hasOwnProperty(g)&&e++;e?a[b]["#text"]=l:a[b]=l}}else if(1==e.nodeType){var n;void 0!==a[b][k]?void 0===a[b][k].length?(n=a[b][k],a[b][k]=[],a[b][k].push(n),a[b][k].push({}),n=a[b][k][1]):"object"==typeof a[b][k]&&(a[b][k].push({}),n=a[b][k][a[b][k].length-1]):(a[b][k]={},n=a[b][k]);if(e.attributes&&
|
208 |
+
e.attributes.length)for(l=0;l<e.attributes.length;l++)n[e.attributes[l].name]=e.attributes[l].value;void 0!==a[b][k].length?this.parseXMLNode(a[b][k],a[b][k].length-1,e,d+" "):this.parseXMLNode(a[b],k,e,d+" ")}}e=0;c="";for(g in a[b])"#text"==g?c=a[b][g]:e++;0===e&&void 0===a[b].length&&(a[b]=c)}},doDoubleClickZoom:function(){if(!this.mapWasDragged){var a=this.zoomLevel()*this.zoomControl.zoomFactor;this.zoomToStageXY(a,this.mouseX,this.mouseY)}},getDevInfo:function(){var a=this.zoomLevel(),a={chart:this,
|
209 |
+
type:"writeDevInfo",zoomLevel:a,zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLatitude:this.zoomLatitude(),zoomLongitude:this.zoomLongitude(),latitude:this.coordinateToLatitude((this.mouseY-this.mapContainer.y)/a),longitude:this.coordinateToLongitude((this.mouseX-this.mapContainer.x)/a),left:this.mouseX,top:this.mouseY,right:this.realWidth-this.mouseX,bottom:this.realHeight-this.mouseY,percentLeft:Math.round(this.mouseX/this.realWidth*100)+"%",percentTop:Math.round(this.mouseY/this.realHeight*100)+"%",
|
210 |
+
percentRight:Math.round((this.realWidth-this.mouseX)/this.realWidth*100)+"%",percentBottom:Math.round((this.realHeight-this.mouseY)/this.realHeight*100)+"%"},b="zoomLevel:"+a.zoomLevel+", zoomLongitude:"+a.zoomLongitude+", zoomLatitude:"+a.zoomLatitude+"\n",b=b+("zoomX:"+a.zoomX+", zoomY:"+a.zoomY+"\n"),b=b+("latitude:"+a.latitude+", longitude:"+a.longitude+"\n"),b=b+("left:"+a.left+", top:"+a.top+"\n"),b=b+("right:"+a.right+", bottom:"+a.bottom+"\n"),b=b+('left:"'+a.percentLeft+'", top:"'+a.percentTop+
|
211 |
+
'"\n'),b=b+('right:"'+a.percentRight+'", bottom:"'+a.percentBottom+'"\n');a.str=b;this.fire(a.type,a);return a},getXY:function(a,b,c){void 0!==a&&(-1!=String(a).indexOf("%")?(a=Number(a.split("%").join("")),c&&(a=100-a),a=Number(a)*b/100):c&&(a=b-a));return a},getObjectById:function(a){var b=this.dataProvider;if(b.areas){var c=this.getObject(a,b.areas);if(c)return c}if(c=this.getObject(a,b.images))return c;if(a=this.getObject(a,b.lines))return a},getObject:function(a,b){if(b){var c;for(c=0;c<b.length;c++){var d=
|
212 |
+
b[c];if(d.id==a)return d;if(d.areas){var f=this.getObject(a,d.areas);if(f)return f}if(f=this.getObject(a,d.images))return f;if(d=this.getObject(a,d.lines))return d}}},parseData:function(){var a=this.dataProvider;this.processObject(a.areas,a,"area");this.processObject(a.images,a,"image");this.processObject(a.lines,a,"line")},processObject:function(a,b,c){if(a){var d;for(d=0;d<a.length;d++){var f=a[d];f.parentObject=b;"area"==c&&AmCharts.extend(f,new AmCharts.MapArea(this.theme),!0);"image"==c&&(f=
|
213 |
+
AmCharts.extend(f,new AmCharts.MapImage(this.theme),!0));"line"==c&&(f=AmCharts.extend(f,new AmCharts.MapLine(this.theme),!0));a[d]=f;f.areas&&this.processObject(f.areas,f,"area");f.images&&this.processObject(f.images,f,"image");f.lines&&this.processObject(f.lines,f,"line")}}},positionChanged:function(){var a={type:"positionChanged",zoomX:this.zoomX(),zoomY:this.zoomY(),zoomLevel:this.zoomLevel(),chart:this};this.fire(a.type,a)},getX:function(a,b){return this.getXY(a,this.realWidth,b)},getY:function(a,
|
214 |
+
b){return this.getXY(a,this.realHeight,b)},trim:function(a){if(a){var b;for(b=0;b<a.length;b++)if(-1===" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.charAt(b))){a=a.substring(b);break}for(b=a.length-1;0<=b;b--)if(-1===" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.charAt(b))){a=a.substring(0,b+1);break}return-1===" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.charAt(0))?
|
215 |
+
a:""}},destroy:function(){var a=this.svgAreas;if(a)for(var b=0;b<a.length;b++);AmCharts.AmMap.base.destroy.call(this)}});AmCharts.ZoomControl=AmCharts.Class({construct:function(a){this.cname="ZoomControl";this.panStepSize=.1;this.zoomFactor=2;this.maxZoomLevel=64;this.minZoomLevel=1;this.zoomControlEnabled=this.panControlEnabled=!0;this.buttonRollOverColor="#CC0000";this.buttonFillColor="#990000";this.buttonFillAlpha=1;this.buttonBorderColor="#FFFFFF";this.buttonIconAlpha=this.buttonBorderThickness=this.buttonBorderAlpha=1;this.gridColor="#FFFFFF";this.homeIconFile="homeIcon.gif";this.gridBackgroundColor="#000000";
|
216 |
+
this.gridBackgroundAlpha=.15;this.gridAlpha=1;this.buttonSize=18;this.iconSize=11;this.buttonCornerRadius=0;this.gridHeight=150;this.top=this.left=10;AmCharts.applyTheme(this,a,this.cname)},init:function(a,b){var c=this;c.chart=a;AmCharts.remove(c.set);var d=b.set();AmCharts.setCN(a,d,"zoom-control");var f=c.buttonSize,e=c.zoomControlEnabled,g=c.panControlEnabled,h=c.buttonFillColor,k=c.buttonFillAlpha,l=c.buttonBorderThickness,m=c.buttonBorderColor,n=c.buttonBorderAlpha,t=c.buttonCornerRadius,p=
|
217 |
+
c.buttonRollOverColor,z=c.gridHeight,y=c.zoomFactor,v=c.minZoomLevel,B=c.maxZoomLevel,A=c.buttonIconAlpha,w=a.getX(c.left),r=a.getY(c.top);isNaN(c.right)||(w=a.getX(c.right,!0),w=g?w-3*f:w-f);isNaN(c.bottom)||(r=a.getY(c.bottom,!0),e&&(r-=z+3*f),r=g?r-3*f:r+f);d.translate(w,r);c.previousDY=NaN;var u;if(e){u=b.set();AmCharts.setCN(a,u,"zoom-control-zoom");d.push(u);c.set=d;c.zoomSet=u;r=AmCharts.rect(b,f+6,z+2*f+6,c.gridBackgroundColor,c.gridBackgroundAlpha,0,0,0,4);AmCharts.setCN(a,r,"zoom-bg");r.translate(-3,
|
218 |
+
-3);r.mouseup(function(){c.handleBgUp()}).touchend(function(){c.handleBgUp()});u.push(r);r=new AmCharts.SimpleButton;r.setIcon(a.pathToImages+"plus.gif",c.iconSize);r.setClickHandler(a.zoomIn,a);r.init(b,f,f,h,k,l,m,n,t,p,A);AmCharts.setCN(a,r.set,"zoom-in");u.push(r.set);r=new AmCharts.SimpleButton;r.setIcon(a.pathToImages+"minus.gif",c.iconSize);r.setClickHandler(a.zoomOut,a);r.init(b,f,f,h,k,l,m,n,t,p,A);r.set.translate(0,z+f);AmCharts.setCN(a,r.set,"zoom-out");u.push(r.set);var w=Math.log(B/v)/
|
219 |
+
Math.log(y)+1,e=z/w,q;for(q=1;q<w;q++)r=f+q*e,r=AmCharts.line(b,[1,f-2],[r,r],c.gridColor,c.gridAlpha,1),AmCharts.setCN(a,r,"zoom-grid"),u.push(r);r=new AmCharts.SimpleButton;r.setDownHandler(c.draggerDown,c);r.setClickHandler(c.draggerUp,c);r.init(b,f,e,h,k,l,m,n,t,p);AmCharts.setCN(a,r.set,"zoom-dragger");u.push(r.set);c.dragger=r.set;c.previousY=NaN;z-=e;v=Math.log(v/100)/Math.log(y);y=Math.log(B/100)/Math.log(y);c.realStepSize=z/(y-v);c.realGridHeight=z;c.stepMax=y}g&&(g=b.set(),AmCharts.setCN(a,
|
220 |
+
g,"zoom-control-pan"),d.push(g),u&&u.translate(f,4*f),u=new AmCharts.SimpleButton,u.setIcon(a.pathToImages+"panLeft.gif",c.iconSize),u.setClickHandler(a.moveLeft,a),u.init(b,f,f,h,k,l,m,n,t,p,A),u.set.translate(0,f),AmCharts.setCN(a,u.set,"pan-left"),g.push(u.set),u=new AmCharts.SimpleButton,u.setIcon(a.pathToImages+"panRight.gif",c.iconSize),u.setClickHandler(a.moveRight,a),u.init(b,f,f,h,k,l,m,n,t,p,A),u.set.translate(2*f,f),AmCharts.setCN(a,u.set,"pan-right"),g.push(u.set),u=new AmCharts.SimpleButton,
|
221 |
+
u.setIcon(a.pathToImages+"panUp.gif",c.iconSize),u.setClickHandler(a.moveUp,a),u.init(b,f,f,h,k,l,m,n,t,p,A),u.set.translate(f,0),AmCharts.setCN(a,u.set,"pan-up"),g.push(u.set),u=new AmCharts.SimpleButton,u.setIcon(a.pathToImages+"panDown.gif",c.iconSize),u.setClickHandler(a.moveDown,a),u.init(b,f,f,h,k,l,m,n,t,p,A),u.set.translate(f,2*f),AmCharts.setCN(a,u.set,"pan-down"),g.push(u.set),k=new AmCharts.SimpleButton,k.setIcon(a.pathToImages+c.homeIconFile,c.iconSize),k.setClickHandler(a.goHome,a),k.init(b,
|
222 |
+
f,f,h,0,0,m,0,t,p,A),k.set.translate(f,f),AmCharts.setCN(a,k.set,"pan-home"),g.push(k.set),d.push(g))},draggerDown:function(){this.chart.stopDrag();this.isDragging=!0},draggerUp:function(){this.isDragging=!1},handleBgUp:function(){var a=this.chart,b=100*Math.pow(this.zoomFactor,this.stepMax-(a.mouseY-this.zoomSet.y-this.set.y-this.buttonSize-this.realStepSize/2)/this.realStepSize);a.zoomTo(b)},update:function(){var a,b=this.zoomFactor,c=this.realStepSize,d=this.stepMax,f=this.dragger,e=this.buttonSize,
|
223 |
+
g=this.chart;this.isDragging?(g.stopDrag(),a=f.y+(g.mouseY-this.previousY),a=AmCharts.fitToBounds(a,e,this.realGridHeight+e),c=100*Math.pow(b,d-(a-e)/c),g.zoomTo(c,NaN,NaN,!0)):(a=Math.log(g.zoomLevel()/100)/Math.log(b),a=(d-a)*c+e);this.previousY=g.mouseY;this.previousDY!=a&&f&&(f.translate(0,a),this.previousDY=a)}});AmCharts.SimpleButton=AmCharts.Class({construct:function(){},init:function(a,b,c,d,f,e,g,h,k,l,m){var n=this;n.rollOverColor=l;n.color=d;l=a.set();n.set=l;d=AmCharts.rect(a,b,c,d,f,e,g,h,k);l.push(d);if(f=n.iconPath)e=n.iconSize,a=a.image(f,(b-e)/2,(c-e)/2,e,e),l.push(a),a.setAttr("opacity",m),a.mousedown(function(){n.handleDown()}).mouseup(function(){n.handleUp()}).mouseover(function(){n.handleOver()}).mouseout(function(){n.handleOut()});d.mousedown(function(){n.handleDown()}).touchstart(function(){n.handleDown()}).mouseup(function(){n.handleUp()}).touchend(function(){n.handleUp()}).mouseover(function(){n.handleOver()}).mouseout(function(){n.handleOut()});
|
224 |
+
n.bg=d},setIcon:function(a,b){this.iconPath=a;this.iconSize=b},setClickHandler:function(a,b){this.clickHandler=a;this.scope=b},setDownHandler:function(a,b){this.downHandler=a;this.scope=b},handleUp:function(){var a=this.clickHandler;a&&a.call(this.scope)},handleDown:function(){var a=this.downHandler;a&&a.call(this.scope)},handleOver:function(){this.bg.setAttr("fill",this.rollOverColor)},handleOut:function(){this.bg.setAttr("fill",this.color)}});AmCharts.SmallMap=AmCharts.Class({construct:function(a){this.cname="SmallMap";this.mapColor="#e6e6e6";this.rectangleColor="#FFFFFF";this.top=this.right=10;this.minimizeButtonWidth=16;this.backgroundColor="#9A9A9A";this.backgroundAlpha=1;this.borderColor="#FFFFFF";this.borderThickness=3;this.borderAlpha=1;this.size=.2;this.enabled=!0;AmCharts.applyTheme(this,a,this.cname)},init:function(a,b){var c=this;if(c.enabled){c.chart=a;c.container=b;c.width=a.realWidth*c.size;c.height=a.realHeight*c.size;AmCharts.remove(c.set);
|
225 |
+
var d=b.set();c.set=d;AmCharts.setCN(a,d,"small-map");var f=b.set();c.allSet=f;d.push(f);c.buildSVGMap();var e=c.borderThickness,g=c.borderColor,h=AmCharts.rect(b,c.width+e,c.height+e,c.backgroundColor,c.backgroundAlpha,e,g,c.borderAlpha);AmCharts.setCN(a,h,"small-map-bg");h.translate(-e/2,-e/2);f.push(h);h.toBack();var k,l,h=c.minimizeButtonWidth,m=new AmCharts.SimpleButton;m.setIcon(a.pathToImages+"arrowDown.gif",h);m.setClickHandler(c.minimize,c);m.init(b,h,h,g,1,1,g,1);AmCharts.setCN(a,m.set,
|
226 |
+
"small-map-down");m=m.set;c.downButtonSet=m;d.push(m);var n=new AmCharts.SimpleButton;n.setIcon(a.pathToImages+"arrowUp.gif",h);n.setClickHandler(c.maximize,c);n.init(b,h,h,g,1,1,g,1);AmCharts.setCN(a,n.set,"small-map-up");g=n.set;c.upButtonSet=g;g.hide();d.push(g);var t,p;isNaN(c.top)||(k=a.getY(c.top)+e,p=0);isNaN(c.bottom)||(k=a.getY(c.bottom,!0)-c.height-e,p=c.height-h+e/2);isNaN(c.left)||(l=a.getX(c.left)+e,t=-e/2);isNaN(c.right)||(l=a.getX(c.right,!0)-c.width-e,t=c.width-h+e/2);e=b.set();e.clipRect(1,
|
227 |
+
1,c.width,c.height);f.push(e);c.rectangleC=e;d.translate(l,k);m.translate(t,p);g.translate(t,p);f.mouseup(function(){c.handleMouseUp()});c.drawRectangle()}else AmCharts.remove(c.allSet),AmCharts.remove(c.downButtonSet),AmCharts.remove(c.upButtonSet)},minimize:function(){this.downButtonSet.hide();this.upButtonSet.show();this.allSet.hide()},maximize:function(){this.downButtonSet.show();this.upButtonSet.hide();this.allSet.show()},buildSVGMap:function(){var a=this.chart,b={fill:this.mapColor,stroke:this.mapColor,
|
228 |
+
"stroke-opacity":1},c=a.svgData.g.path,d=this.container,f=d.set();AmCharts.setCN(a,f,"small-map-image");var e;for(e=0;e<c.length;e++){var g=d.path(c[e].d).attr(b);f.push(g)}this.allSet.push(f);b=f.getBBox();c=this.size*a.mapScale;d=-b.x*c;e=-b.y*c;var h=g=0;a.centerMap&&(g=(this.width-b.width*c)/2,h=(this.height-b.height*c)/2);this.mapWidth=b.width*c;this.mapHeight=b.height*c;this.dx=g;this.dy=h;f.translate(d+g,e+h,c)},update:function(){var a=this.chart,b=a.zoomLevel(),c=this.width,d=a.mapContainer,
|
229 |
+
a=c/(a.realWidth*b),c=c/b,b=this.height/b,f=this.rectangle;f.translate(-d.x*a+this.dx,-d.y*a+this.dy);0<c&&0<b&&(f.setAttr("width",Math.ceil(c+1)),f.setAttr("height",Math.ceil(b+1)));this.rWidth=c;this.rHeight=b},drawRectangle:function(){var a=this.rectangle;AmCharts.remove(a);a=AmCharts.rect(this.container,10,10,"#000",0,1,this.rectangleColor,1);AmCharts.setCN(this.chart,a,"small-map-rectangle");this.rectangleC.push(a);this.rectangle=a},handleMouseUp:function(){var a=this.chart,b=a.zoomLevel();a.zoomTo(b,
|
230 |
+
-((a.mouseX-this.set.x-this.dx-this.rWidth/2)/this.mapWidth)*b,-((a.mouseY-this.set.y-this.dy-this.rHeight/2)/this.mapHeight)*b)}});AmCharts.AreasProcessor=AmCharts.Class({construct:function(a){this.chart=a},process:function(a){this.updateAllAreas();this.allObjects=[];a=a.areas;var b=this.chart,c,d=a.length,f,e,g=0,h=b.svgAreasById,k=!1,l=!1,m=0;for(f=0;f<d;f++){e=a[f];e=e.value;if(!1===k||k<e)k=e;if(!1===l||l>e)l=e;isNaN(e)||(g+=Math.abs(e),m++)}isNaN(b.minValue)||(l=b.minValue);isNaN(b.maxValue)||(k=b.maxValue);b.maxValueReal=k;b.minValueReal=l;for(f=0;f<d;f++)e=a[f],isNaN(e.value)?e.percents=void 0:(e.percents=(e.value-l)/
|
231 |
+
g*100,l==k&&(e.percents=100));for(f=0;f<d;f++){e=a[f];var n=h[e.id];c=b.areasSettings;n&&n.className&&(g=b.areasClasses[n.className])&&(c=g,c=AmCharts.processObject(c,AmCharts.AreasSettings,b.theme));var t=c.color,p=c.alpha,z=c.outlineThickness,y=c.rollOverColor,v=c.selectedColor,B=c.rollOverAlpha,A=c.outlineColor,w=c.outlineAlpha,r=c.balloonText,u=c.selectable,q=c.pattern,x=c.rollOverOutlineColor,C=c.bringForwardOnHover,F=c.preserveOriginalAttributes;this.allObjects.push(e);e.chart=b;e.baseSettings=
|
232 |
+
c;e.autoZoomReal=void 0==e.autoZoom?c.autoZoom:e.autoZoom;g=e.color;void 0==g&&(g=t);m=e.alpha;isNaN(m)&&(m=p);p=e.rollOverAlpha;isNaN(p)&&(p=B);isNaN(p)&&(p=m);B=e.rollOverColor;void 0==B&&(B=y);y=e.pattern;void 0==y&&(y=q);q=e.selectedColor;void 0==q&&(q=v);(v=e.balloonText)||(v=r);void 0==c.colorSolid||isNaN(e.value)||(r=Math.floor((e.value-l)/((k-l)/b.colorSteps)),r==b.colorSteps&&r--,colorPercent=1/(b.colorSteps-1)*r,k==l&&(colorPercent=1),e.colorReal=AmCharts.getColorFade(g,c.colorSolid,colorPercent));
|
233 |
+
void 0!=e.color&&(e.colorReal=e.color);void 0==e.selectable&&(e.selectable=u);void 0==e.colorReal&&(e.colorReal=t);t=e.outlineColor;void 0==t&&(t=A);A=e.outlineAlpha;isNaN(A)&&(A=w);w=e.outlineThickness;isNaN(w)&&(w=z);z=e.rollOverOutlineColor;void 0==z&&(z=x);void 0==e.bringForwardOnHover&&(e.bringForwardOnHover=C);void 0==e.preserveOriginalAttributes&&(e.preserveOriginalAttributes=F);e.alphaReal=m;e.rollOverColorReal=B;e.rollOverAlphaReal=p;e.balloonTextReal=v;e.selectedColorReal=q;e.outlineColorReal=
|
234 |
+
t;e.outlineAlphaReal=A;e.rollOverOutlineColorReal=z;e.outlineThicknessReal=w;e.patternReal=y;AmCharts.processDescriptionWindow(c,e);if(n&&(c=n.area,x=n.title,e.enTitle=n.title,x&&!e.title&&(e.title=x),(n=b.language)?(x=AmCharts.mapTranslations)&&(n=x[n])&&n[e.enTitle]&&(e.titleTr=n[e.enTitle]):e.titleTr=void 0,c)){e.displayObject=c;e.mouseEnabled&&b.addObjectEventListeners(c,e);var D;void 0!=g&&(D=g);void 0!=e.colorReal&&(D=e.showAsSelected||b.selectedObject==e?e.selectedColorReal:e.colorReal);c.node.setAttribute("class",
|
235 |
+
"");AmCharts.setCN(b,c,"map-area");AmCharts.setCN(b,c,"map-area-"+c.id);e.preserveOriginalAttributes||(c.setAttr("fill",D),c.setAttr("stroke",t),c.setAttr("stroke-opacity",A),c.setAttr("stroke-width",w),c.setAttr("fill-opacity",m));y&&c.pattern(y,b.mapScale);e.hidden&&c.hide()}}},updateAllAreas:function(){var a=this.chart,b=a.areasSettings,c=b.unlistedAreasColor,d=b.unlistedAreasAlpha,f=b.unlistedAreasOutlineColor,e=b.unlistedAreasOutlineAlpha,g=a.svgAreas,h=a.dataProvider,k=h.areas,l={},m;for(m=
|
236 |
+
0;m<k.length;m++)l[k[m].id]=k[m];for(m=0;m<g.length;m++){k=g[m];if(b.preserveOriginalAttributes){if(k.customAttr)for(var n in k.customAttr)k.setAttr(n,k.customAttr[n])}else void 0!=c&&k.setAttr("fill",c),isNaN(d)||k.setAttr("fill-opacity",d),void 0!=f&&k.setAttr("stroke",f),isNaN(e)||k.setAttr("stroke-opacity",e),k.setAttr("stroke-width",b.outlineThickness);AmCharts.setCN(a,k,"map-area-unlisted");if(h.getAreasFromMap&&!l[k.id]){var t=new AmCharts.MapArea(a.theme);t.parentObject=h;t.id=k.id;h.areas.push(t)}}}});AmCharts.AreasSettings=AmCharts.Class({construct:function(a){this.cname="AreasSettings";this.alpha=1;this.autoZoom=!1;this.balloonText="[[title]]";this.color="#FFCC00";this.colorSolid="#990000";this.unlistedAreasAlpha=1;this.unlistedAreasColor="#DDDDDD";this.outlineColor="#FFFFFF";this.outlineAlpha=1;this.outlineThickness=.5;this.selectedColor=this.rollOverOutlineColor="#CC0000";this.unlistedAreasOutlineColor="#FFFFFF";this.unlistedAreasOutlineAlpha=1;this.descriptionWindowWidth=250;this.adjustOutlineThickness=
|
237 |
+
!1;this.bringForwardOnHover=!0;AmCharts.applyTheme(this,a,this.cname)}});AmCharts.ImagesProcessor=AmCharts.Class({construct:function(a){this.chart=a;this.reset()},process:function(a){var b=a.images,c;for(c=0;c<b.length;c++)this.createImage(b[c],c);a.parentObject&&a.remainVisible&&this.process(a.parentObject)},createImage:function(a,b){var c=this.chart,d=c.container,f=c.mapImagesContainer,e=c.stageImagesContainer,g=c.imagesSettings;a.remove&&a.remove();var h=g.color,k=g.alpha,l=g.rollOverColor,m=g.selectedColor,n=g.balloonText,t=g.outlineColor,p=g.outlineAlpha,z=g.outlineThickness,
|
238 |
+
y=g.selectedScale,v=g.labelPosition,B=g.labelColor,A=g.labelFontSize,w=g.bringForwardOnHover,r=g.labelRollOverColor,u=g.selectedLabelColor;a.index=b;a.chart=c;a.baseSettings=c.imagesSettings;var q=d.set();a.displayObject=q;var x=a.color;void 0==x&&(x=h);h=a.alpha;isNaN(h)&&(h=k);void 0==a.bringForwardOnHover&&(a.bringForwardOnHover=w);k=a.outlineAlpha;isNaN(k)&&(k=p);p=a.rollOverColor;void 0==p&&(p=l);l=a.selectedColor;void 0==l&&(l=m);(m=a.balloonText)||(m=n);n=a.outlineColor;void 0==n&&(n=t);void 0==
|
239 |
+
n&&(n=x);t=a.outlineThickness;isNaN(t)&&(t=z);(z=a.labelPosition)||(z=v);v=a.labelColor;void 0==v&&(v=B);B=a.labelRollOverColor;void 0==B&&(B=r);r=a.selectedLabelColor;void 0==r&&(r=u);u=a.labelFontSize;isNaN(u)&&(u=A);A=a.selectedScale;isNaN(A)&&(A=y);isNaN(a.rollOverScale);a.colorReal=x;a.alphaReal=h;a.rollOverColorReal=p;a.balloonTextReal=m;a.selectedColorReal=l;a.labelColorReal=v;a.labelRollOverColorReal=B;a.selectedLabelColorReal=r;a.labelFontSizeReal=u;a.labelPositionReal=z;a.selectedScaleReal=
|
240 |
+
A;a.rollOverScaleReal=A;AmCharts.processDescriptionWindow(g,a);a.centeredReal=void 0==a.centered?g.centered:a.centered;u=a.type;r=a.imageURL;B=a.svgPath;p=a.width;v=a.height;g=a.scale;isNaN(a.percentWidth)||(p=a.percentWidth/100*c.realWidth);isNaN(a.percentHeight)||(v=a.percentHeight/100*c.realHeight);var C;r||u||B||(u="circle",p=1,k=h=0);l=y=0;A=a.selectedColorReal;if(u){isNaN(p)&&(p=10);isNaN(v)&&(v=10);"kilometers"==a.widthAndHeightUnits&&(p=c.kilometersToPixels(a.width),v=c.kilometersToPixels(a.height));
|
241 |
+
"miles"==a.widthAndHeightUnits&&(p=c.milesToPixels(a.width),v=c.milesToPixels(a.height));if("circle"==u||"bubble"==u)v=p;C=this.createPredefinedImage(x,n,t,u,p,v);l=y=0;a.centeredReal?(isNaN(a.right)||(y=p*g),isNaN(a.bottom)||(l=v*g)):(y=p*g/2,l=v*g/2);C.translate(y,l,g)}else r?(isNaN(p)&&(p=10),isNaN(v)&&(v=10),C=d.image(r,0,0,p,v),C.node.setAttribute("preserveAspectRatio","none"),C.setAttr("opacity",h),a.centeredReal&&(y=isNaN(a.right)?-p/2:p/2,l=isNaN(a.bottom)?-v/2:v/2,C.translate(y,l))):B&&(C=
|
242 |
+
d.path(B),n=C.getBBox(),a.centeredReal?(y=-n.x*g-n.width*g/2,isNaN(a.right)||(y=-y),l=-n.y*g-n.height*g/2,isNaN(a.bottom)||(l=-l)):y=l=0,C.translate(y,l,g),C.x=y,C.y=l);C&&(q.push(C),a.image=C,C.setAttr("stroke-opacity",k),C.setAttr("fill-opacity",h),C.setAttr("fill",x),AmCharts.setCN(c,C,"map-image"),void 0!=a.id&&AmCharts.setCN(c,C,"map-image-"+a.id));!a.showAsSelected&&c.selectedObject!=a||void 0==A||C.setAttr("fill",A);x=null;void 0!==a.label&&(x=AmCharts.text(d,a.label,a.labelColorReal,c.fontFamily,
|
243 |
+
a.labelFontSizeReal,a.labelAlign),AmCharts.setCN(c,x,"map-image-label"),void 0!==a.id&&AmCharts.setCN(c,x,"map-image-label-"+a.id),C=a.labelBackgroundAlpha,(h=a.labelBackgroundColor)&&0<C&&(k=x.getBBox(),d=AmCharts.rect(d,k.width+16,k.height+10,h,C),AmCharts.setCN(c,d,"map-image-label-background"),void 0!=a.id&&AmCharts.setCN(c,d,"map-image-label-background-"+a.id),q.push(d),a.labelBG=d),a.imageLabel=x,q.push(x),AmCharts.setCN(c,q,"map-image-container"),void 0!=a.id&&AmCharts.setCN(c,q,"map-image-container-"+
|
244 |
+
a.id));isNaN(a.latitude)||isNaN(a.longitude)?e.push(q):f.push(q);q&&(q.rotation=a.rotation);this.updateSizeAndPosition(a);a.mouseEnabled&&c.addObjectEventListeners(q,a);a.hidden&&q.hide()},updateSizeAndPosition:function(a){var b=this.chart,c=a.displayObject,d=b.getX(a.left),f=b.getY(a.top),e=a.image.getBBox();isNaN(a.right)||(d=b.getX(a.right,!0)-e.width*a.scale);isNaN(a.bottom)||(f=b.getY(a.bottom,!0)-e.height*a.scale);var g=a.longitude,h=a.latitude,e=this.objectsToResize;this.allSvgObjects.push(c);
|
245 |
+
this.allObjects.push(a);var k=a.imageLabel;if(!isNaN(d)&&!isNaN(f))c.translate(d,f);else if(!isNaN(h)&&!isNaN(g)&&(d=b.longitudeToCoordinate(g),f=b.latitudeToCoordinate(h),c.translate(d,f,NaN,!0),a.fixedSize)){d=1;if(a.showAsSelected||b.selectedObject==a)d=a.selectedScaleReal;e.push({image:c,scale:d})}this.positionLabel(k,a,a.labelPositionReal)},positionLabel:function(a,b,c){if(a){var d=b.image,f=0,e=0,g=0,h=0;d&&(h=d.getBBox(),e=d.y,f=d.x,g=h.width,h=h.height,b.svgPath&&(g*=b.scale,h*=b.scale));
|
246 |
+
var d=a.getBBox(),k=d.width,l=d.height;"right"==c&&(f+=g+k/2+5,e+=h/2-2);"left"==c&&(f+=-k/2-5,e+=h/2-2);"top"==c&&(e-=l/2+3,f+=g/2);"bottom"==c&&(e+=h+l/2,f+=g/2);"middle"==c&&(f+=g/2,e+=h/2);a.translate(f+b.labelShiftX,e+b.labelShiftY);b.labelBG&&b.labelBG.translate(f-d.width/2+b.labelShiftX-9,e+b.labelShiftY-d.height/2-3)}},createPredefinedImage:function(a,b,c,d,f,e){var g=this.chart.container,h;switch(d){case "circle":h=AmCharts.circle(g,f/2,a,1,c,b,1);break;case "rectangle":h=AmCharts.polygon(g,
|
247 |
+
[-f/2,f/2,f/2,-f/2],[e/2,e/2,-e/2,-e/2],a,1,c,b,1);break;case "bubble":h=AmCharts.circle(g,f/2,a,1,c,b,1,!0)}return h},reset:function(){this.objectsToResize=[];this.allSvgObjects=[];this.allObjects=[];this.allLabels=[]}});AmCharts.ImagesSettings=AmCharts.Class({construct:function(a){this.cname="ImagesSettings";this.balloonText="[[title]]";this.alpha=1;this.borderAlpha=0;this.borderThickness=1;this.labelPosition="right";this.labelColor="#000000";this.labelFontSize=11;this.color="#000000";this.labelRollOverColor="#00CC00";this.centered=!0;this.rollOverScale=this.selectedScale=1;this.descriptionWindowWidth=250;this.bringForwardOnHover=!0;AmCharts.applyTheme(this,a,this.cname)}});AmCharts.LinesProcessor=AmCharts.Class({construct:function(a){this.chart=a;this.reset()},process:function(a){var b=a.lines,c=this.chart,d=c.linesSettings,f=this.objectsToResize,e=c.mapLinesContainer,g=c.stageLinesContainer,h=d.thickness,k=d.dashLength,l=d.arrow,m=d.arrowSize,n=d.arrowColor,t=d.arrowAlpha,p=d.color,z=d.alpha,y=d.rollOverColor,v=d.selectedColor,B=d.rollOverAlpha,A=d.balloonText,w=d.bringForwardOnHover,r=c.container,u;for(u=0;u<b.length;u++){var q=b[u];q.chart=c;q.baseSettings=d;var x=
|
248 |
+
r.set();q.displayObject=x;this.allSvgObjects.push(x);this.allObjects.push(q);q.mouseEnabled&&c.addObjectEventListeners(x,q);if(q.remainVisible||c.selectedObject==q.parentObject){var C=q.thickness;isNaN(C)&&(C=h);var F=q.dashLength;isNaN(F)&&(F=k);var D=q.color;void 0==D&&(D=p);var E=q.alpha;isNaN(E)&&(E=z);var G=q.rollOverAlpha;isNaN(G)&&(G=B);isNaN(G)&&(G=E);var I=q.rollOverColor;void 0==I&&(I=y);var T=q.selectedColor;void 0==T&&(T=v);var R=q.balloonText;R||(R=A);var L=q.arrow;if(!L||"none"==L&&
|
249 |
+
"none"!=l)L=l;var N=q.arrowColor;void 0==N&&(N=n);void 0==N&&(N=D);var O=q.arrowAlpha;isNaN(O)&&(O=t);isNaN(O)&&(O=E);var M=q.arrowSize;isNaN(M)&&(M=m);q.alphaReal=E;q.colorReal=D;q.rollOverColorReal=I;q.rollOverAlphaReal=G;q.balloonTextReal=R;q.selectedColorReal=T;q.thicknessReal=C;void 0==q.bringForwardOnHover&&(q.bringForwardOnHover=w);AmCharts.processDescriptionWindow(d,q);var G=this.processCoordinates(q.x,c.realWidth),I=this.processCoordinates(q.y,c.realHeight),K=q.longitudes,R=q.latitudes,J=
|
250 |
+
K.length,P;if(0<J)for(G=[],P=0;P<J;P++)G.push(c.longitudeToCoordinate(K[P]));J=R.length;if(0<J)for(I=[],P=0;P<J;P++)I.push(c.latitudeToCoordinate(R[P]));if(0<G.length){AmCharts.dx=0;AmCharts.dy=0;K=AmCharts.line(r,G,I,D,1,C,F,!1,!1,!0);AmCharts.setCN(c,K,"map-line");void 0!=q.id&&AmCharts.setCN(c,K,"map-line-"+q.id);F=AmCharts.line(r,G,I,D,.001,3,F,!1,!1,!0);AmCharts.dx=.5;AmCharts.dy=.5;x.push(K);x.push(F);x.setAttr("opacity",E);if("none"!=L){var H,Q,S;if("end"==L||"both"==L)E=G[G.length-1],D=I[I.length-
|
251 |
+
1],1<G.length?(J=G[G.length-2],H=I[I.length-2]):(J=E,H=D),H=180*Math.atan((D-H)/(E-J))/Math.PI,Q=E,S=D,H=0>E-J?H-90:H+90;"both"==L&&(E=AmCharts.polygon(r,[-M/2,0,M/2],[1.5*M,0,1.5*M],N,O,1,N,O),x.push(E),E.translate(Q,S),E.rotate(H),AmCharts.setCN(c,K,"map-line-arrow"),void 0!=q.id&&AmCharts.setCN(c,K,"map-line-arrow-"+q.id),q.fixedSize&&f.push(E));if("start"==L||"both"==L)E=G[0],S=I[0],1<G.length?(D=G[1],Q=I[1]):(D=E,Q=S),H=180*Math.atan((S-Q)/(E-D))/Math.PI,Q=E,H=0>E-D?H-90:H+90;"middle"==L&&(E=
|
252 |
+
G[G.length-1],D=I[I.length-1],1<G.length?(J=G[G.length-2],H=I[I.length-2]):(J=E,H=D),Q=J+(E-J)/2,S=H+(D-H)/2,H=180*Math.atan((D-H)/(E-J))/Math.PI,H=0>E-J?H-90:H+90);E=AmCharts.polygon(r,[-M/2,0,M/2],[1.5*M,0,1.5*M],N,O,1,N,O);AmCharts.setCN(c,K,"map-line-arrow");void 0!=q.id&&AmCharts.setCN(c,K,"map-line-arrow-"+q.id);x.push(E);E.translate(Q,S);E.rotate(H);q.fixedSize&&f.push(E);q.arrowSvg=E}q.fixedSize&&K&&(this.linesToResize.push({line:K,thickness:C}),this.linesToResize.push({line:F,thickness:3}));
|
253 |
+
q.lineSvg=K;q.showAsSelected&&!isNaN(T)&&K.setAttr("stroke",T);0<R.length?e.push(x):g.push(x);q.hidden&&x.hide()}}}a.parentObject&&a.remainVisible&&this.process(a.parentObject)},processCoordinates:function(a,b){var c=[],d;for(d=0;d<a.length;d++){var f=a[d],e=Number(f);isNaN(e)&&(e=Number(f.replace("%",""))*b/100);isNaN(e)||c.push(e)}return c},reset:function(){this.objectsToResize=[];this.allSvgObjects=[];this.allObjects=[];this.linesToResize=[]}});AmCharts.LinesSettings=AmCharts.Class({construct:function(a){this.cname="LinesSettings";this.balloonText="[[title]]";this.thickness=1;this.dashLength=0;this.arrowSize=10;this.arrowAlpha=1;this.arrow="none";this.color="#990000";this.descriptionWindowWidth=250;this.bringForwardOnHover=!0;AmCharts.applyTheme(this,a,this.cname)}});AmCharts.MapObject=AmCharts.Class({construct:function(a){this.fixedSize=this.mouseEnabled=!0;this.images=[];this.lines=[];this.areas=[];this.remainVisible=!0;this.passZoomValuesToTarget=!1;this.objectType=this.cname;AmCharts.applyTheme(this,a,"MapObject")}});AmCharts.MapArea=AmCharts.Class({inherits:AmCharts.MapObject,construct:function(a){this.cname="MapArea";AmCharts.MapArea.base.construct.call(this,a);AmCharts.applyTheme(this,a,this.cname)}});AmCharts.MapLine=AmCharts.Class({inherits:AmCharts.MapObject,construct:function(a){this.cname="MapLine";this.longitudes=[];this.latitudes=[];this.x=[];this.y=[];this.arrow="none";AmCharts.MapLine.base.construct.call(this,a);AmCharts.applyTheme(this,a,this.cname)}});AmCharts.MapImage=AmCharts.Class({inherits:AmCharts.MapObject,construct:function(a){this.cname="MapImage";this.scale=1;this.widthAndHeightUnits="pixels";this.labelShiftY=this.labelShiftX=0;AmCharts.MapImage.base.construct.call(this,a);AmCharts.applyTheme(this,a,this.cname)},remove:function(){var a=this.displayObject;a&&a.remove();(a=this.imageLabel)&&a.remove()}});AmCharts.degreesToRadians=function(a){return a/180*Math.PI};AmCharts.radiansToDegrees=function(a){return a/Math.PI*180};AmCharts.getColorFade=function(a,b,c){var d=AmCharts.hex2RGB(b);b=d[0];var f=d[1],d=d[2],e=AmCharts.hex2RGB(a);a=e[0];var g=e[1],e=e[2];a+=Math.round((b-a)*c);g+=Math.round((f-g)*c);e+=Math.round((d-e)*c);return"rgb("+a+","+g+","+e+")"};AmCharts.hex2RGB=function(a){return[parseInt(a.substring(1,3),16),parseInt(a.substring(3,5),16),parseInt(a.substring(5,7),16)]};
|
254 |
AmCharts.processDescriptionWindow=function(a,b){isNaN(b.descriptionWindowX)&&(b.descriptionWindowX=a.descriptionWindowX);isNaN(b.descriptionWindowY)&&(b.descriptionWindowY=a.descriptionWindowY);isNaN(b.descriptionWindowLeft)&&(b.descriptionWindowLeft=a.descriptionWindowLeft);isNaN(b.descriptionWindowRight)&&(b.descriptionWindowRight=a.descriptionWindowRight);isNaN(b.descriptionWindowTop)&&(b.descriptionWindowTop=a.descriptionWindowTop);isNaN(b.descriptionWindowBottom)&&(b.descriptionWindowBottom=
|
255 |
+
a.descriptionWindowBottom);isNaN(b.descriptionWindowWidth)&&(b.descriptionWindowWidth=a.descriptionWindowWidth);isNaN(b.descriptionWindowHeight)&&(b.descriptionWindowHeight=a.descriptionWindowHeight)};AmCharts.MapData=AmCharts.Class({inherits:AmCharts.MapObject,construct:function(){this.cname="MapData";AmCharts.MapData.base.construct.call(this);this.projection="mercator";this.topLatitude=90;this.bottomLatitude=-90;this.leftLongitude=-180;this.rightLongitude=180;this.zoomLevel=1;this.getAreasFromMap=!1}});AmCharts.DescriptionWindow=AmCharts.Class({construct:function(){},show:function(a,b,c,d){var f=this,e=document.createElement("div");e.style.position="absolute";var g=a.classNamePrefix+"-description-";e.className="ammapDescriptionWindow "+g+"div";f.div=e;b.appendChild(e);var h=document.createElement("img");h.className="ammapDescriptionWindowCloseButton "+g+"close-img";h.src=a.pathToImages+"xIcon.gif";h.style.cssFloat="right";h.onclick=function(){f.close()};h.onmouseover=function(){h.src=a.pathToImages+
|
256 |
+
"xIconH.gif"};h.onmouseout=function(){h.src=a.pathToImages+"xIcon.gif"};e.appendChild(h);b=document.createElement("div");b.className="ammapDescriptionTitle "+g+"title-div";b.onmousedown=function(){f.div.style.zIndex=1E3};e.appendChild(b);d=document.createTextNode(d);b.appendChild(d);d=b.offsetHeight;b=document.createElement("div");b.className="ammapDescriptionText "+g+"text-div";b.style.maxHeight=f.maxHeight-d-20+"px";e.appendChild(b);b.innerHTML=c},close:function(){try{this.div.parentNode.removeChild(this.div)}catch(a){}}});AmCharts.ValueLegend=AmCharts.Class({construct:function(a){this.cname="ValueLegend";this.enabled=!0;this.showAsGradient=!1;this.minValue=0;this.height=12;this.width=200;this.bottom=this.left=10;this.borderColor="#FFFFFF";this.borderAlpha=this.borderThickness=1;this.color="#000000";this.fontSize=11;AmCharts.applyTheme(this,a,this.cname)},init:function(a,b){if(this.enabled){var c=a.areasSettings.color,d=a.areasSettings.colorSolid,f=a.colorSteps;AmCharts.remove(this.set);var e=b.set();this.set=e;AmCharts.setCN(a,
|
257 |
+
e,"value-legend");var g=0,h=this.minValue,k=this.fontSize,l=a.fontFamily,m=this.color;void 0==h&&(h=a.minValueReal);void 0!==h&&(g=AmCharts.text(b,h,m,l,k,"left"),g.translate(0,k/2-1),AmCharts.setCN(a,g,"value-legend-min-label"),e.push(g),g=g.getBBox().height);h=this.maxValue;void 0===h&&(h=a.maxValueReal);void 0!==h&&(g=AmCharts.text(b,h,m,l,k,"right"),g.translate(this.width,k/2-1),AmCharts.setCN(a,g,"value-legend-max-label"),e.push(g),g=g.getBBox().height);if(this.showAsGradient)c=AmCharts.rect(b,
|
258 |
+
this.width,this.height,[c,d],1,this.borderThickness,this.borderColor,1,0,0),AmCharts.setCN(a,c,"value-legend-gradient"),c.translate(0,g),e.push(c);else for(k=this.width/f,l=0;l<f;l++)m=AmCharts.getColorFade(c,d,1*l/(f-1)),m=AmCharts.rect(b,k,this.height,m,1,this.borderThickness,this.borderColor,1),AmCharts.setCN(a,m,"value-legend-color"),AmCharts.setCN(a,m,"value-legend-color-"+l),m.translate(k*l,g),e.push(m);d=c=0;f=e.getBBox();g=a.getY(this.bottom,!0);k=a.getY(this.top);l=a.getX(this.right,!0);
|
259 |
+
m=a.getX(this.left);isNaN(k)||(c=k);isNaN(g)||(c=g-f.height);isNaN(m)||(d=m);isNaN(l)||(d=l-f.width);e.translate(d,c)}else AmCharts.remove(this.set)}});AmCharts.ObjectList=AmCharts.Class({construct:function(a){this.divId=a},init:function(a){this.chart=a;var b;b=this.divId;this.container&&(b=this.container);this.div=b="object"!=typeof b?document.getElementById(b):b;b=document.createElement("div");b.className="ammapObjectList "+a.classNamePrefix+"-object-list-div";this.div.appendChild(b);this.addObjects(a.dataProvider,b)},addObjects:function(a,b){var c=this.chart,d=document.createElement("ul");d.className=c.classNamePrefix+"-object-list-ul";var f;
|
260 |
+
if(a.areas)for(f=0;f<a.areas.length;f++){var e=a.areas[f];void 0===e.showInList&&(e.showInList=c.showAreasInList);this.addObject(e,d)}if(a.images)for(f=0;f<a.images.length;f++)e=a.images[f],void 0===e.showInList&&(e.showInList=c.showImagesInList),this.addObject(e,d);if(a.lines)for(f=0;f<a.lines.length;f++)e=a.lines[f],void 0===e.showInList&&(e.showInList=c.showLinesInList),this.addObject(e,d);0<d.childNodes.length&&b.appendChild(d)},addObject:function(a,b){var c=this;if(a.showInList&&void 0!==a.title){var d=
|
261 |
+
c.chart,f=document.createElement("li");f.className=d.classNamePrefix+"-object-list-li";var e=document.createTextNode(a.title),g=document.createElement("a");g.className=d.classNamePrefix+"-object-list-a";g.appendChild(e);f.appendChild(g);b.appendChild(f);this.addObjects(a,f);g.onmouseover=function(){c.chart.rollOverMapObject(a,!1)};g.onmouseout=function(){c.chart.rollOutMapObject(a)};g.onclick=function(){c.chart.clickMapObject(a)}}}});
|
admin/js/ammap/world.js
CHANGED
@@ -331,7 +331,7 @@ AmCharts.maps.worldLow={
|
|
331 |
{
|
332 |
"id":"GR",
|
333 |
"title":"Greece",
|
334 |
-
"d":"M541.7,356.71l1.53,1.16l2.18,-0.
|
335 |
},
|
336 |
{
|
337 |
"id":"GT",
|
@@ -836,7 +836,7 @@ AmCharts.maps.worldLow={
|
|
836 |
{
|
837 |
"id":"UA",
|
838 |
"title":"Ukraine",
|
839 |
-
"d":"M564.38,292.49L565.42,292.68L566.13,291.64L566.98,291.87L569.89,291.43L571.68,294L570.98,294.92L571.21,296.31L573.45,296.52L574.45,298.45L574.39,299.32L577.95,300.86L580.1,300.17L581.83,302.21L583.47,302.
|
840 |
},
|
841 |
{
|
842 |
"id":"UG",
|
331 |
{
|
332 |
"id":"GR",
|
333 |
"title":"Greece",
|
334 |
+
"d":"M541.7,356.71l1.53,1.16l2.18,-0.19l2.09,0.24l-0.07,0.6l1.53,-0.41l-0.35,1.01l-4.04,0.29l0.03,-0.56l-3.42,-0.67L541.7,356.71zM549.85,335.75l-0.87,2.33l-0.67,0.41l-1.71,-0.1l-1.46,-0.35l-3.4,0.96l1.94,2.06l-1.42,0.59l-1.56,0l-1.48,-1.88l-0.53,0.8l0.63,2.18l1.4,1.7l-1.06,0.79l1.56,1.65l1.39,1.03l0.04,2l-1.36,-1.15l-1.24,0.21l0.83,1.8l-0.92,0.19l-1,-0.69l1.2,3.95l-0.58,0l-0.45,-1.25l-0.57,-0.02l-0.26,1.32l-0.45,-0.3l0.1,-0.74l-0.56,-1.04h-0.64l0.12,0.84l-0.25,0.27l-0.62,-0.54l-0.38,-1.01l0.52,-0.57l-0.36,-0.74l-0.41,-0.38l-0.42,-0.09l-0.49,-0.94l0.58,-0.52l0.36,-0.48l0.56,0.1l0.25,-0.41l0.59,-0.16l0.68,0.46l0.55,0.17l0.39,-0.62l-0.94,-0.08l-0.56,-0.19l-1.25,0.28l-1.22,0.05l-1.09,-1.64l-0.18,-0.25l0.17,-0.64l-1.42,-1.15l-0.19,-1.03l1.3,-1.76l0.17,-1.19l0.91,-0.53l0.06,-0.97l1.83,-0.33l1.07,-0.81l1.52,0.07l0.46,-0.65l0.53,-0.12l2.07,0.11l2.25,-1.02l1.98,1.3l2.55,-0.35l0.03,-1.86L549.85,335.75z"
|
335 |
},
|
336 |
{
|
337 |
"id":"GT",
|
836 |
{
|
837 |
"id":"UA",
|
838 |
"title":"Ukraine",
|
839 |
+
"d":"M564.38,292.49L565.42,292.68L566.13,291.64L566.98,291.87L569.89,291.43L571.68,294L570.98,294.92L571.21,296.31L573.45,296.52L574.45,298.45L574.39,299.32L577.95,300.86L580.1,300.17L581.83,302.21L583.47,302.17L587.6,303.57L587.63,304.84L586.5,307.07L587.11,309.4L586.67,310.79L583.96,311.1L582.52,312.26L582.43,314.09L580.19,314.42L578.32,315.74L575.7,315.95L573.28,317.47L571.96,318.5L573.45,319.97L574.82,320.93L577.68,320.69L577.13,322.11L574.06,322.79L570.25,325.06L568.7,324.27L569.31,322.42L566.25,321.26L566.75,320.49L569.91,318.86L569.51,318.05L569.06,318.46L568.62,318.24L564.26,317.22L564.07,315.71L561.47,316.21L560.43,318.44L558.26,321.39L556.98,320.71L555.67,321.35L554.42,320.62L555.12,320.18L555.61,318.81L556.38,317.52L556.18,316.8L556.77,316.48L557.04,317.04L558.7,317.15L559.44,316.86L558.92,316.44L559.11,315.84L558.13,314.8L557.73,313.08L556.71,312.41L556.91,311L555.64,309.88L554.49,309.72L552.42,308.41L550.56,308.83L549.89,309.45L548.71,309.44L548,310.42L545.93,310.82L544.98,311.46L543.67,310.45L541.88,310.43L540.14,309.97L538.93,310.86L538.73,309.74L537.18,308.6L537.73,306.89L538.5,305.79L539.12,306.03L538.39,304.11L540.94,300.5L542.33,299.99L542.63,298.75L541.22,294.86L542.56,294.69L544.1,293.46L546.27,293.36L549.1,293.72L552.23,294.8L554.44,294.89L555.49,295.54L556.54,294.76L557.28,295.81L559.81,295.59L560.92,296.02L561.11,293.76L561.97,292.76z"
|
840 |
},
|
841 |
{
|
842 |
"id":"UG",
|
admin/view/wp-slimstat-reports.php
CHANGED
@@ -311,9 +311,7 @@ class wp_slimstat_reports {
|
|
311 |
$filters_normalized = wp_slimstat_db::parse_filters($_filters, false);
|
312 |
if (!empty($filters_normalized['columns'])){
|
313 |
foreach($filters_normalized['columns'] as $a_key => $a_filter){
|
314 |
-
|
315 |
-
$filtered_url .= "&fs%5B$a_key%5D=".urlencode($a_filter[0].' '.$a_filter[1]);
|
316 |
-
}
|
317 |
}
|
318 |
}
|
319 |
|
@@ -329,9 +327,7 @@ class wp_slimstat_reports {
|
|
329 |
// Misc filters
|
330 |
if (!empty($filters_normalized['misc'])){
|
331 |
foreach($filters_normalized['misc'] as $a_key => $a_filter){
|
332 |
-
|
333 |
-
$filtered_url .= "&fs%5B$a_key%5D=".urlencode('equals '.$a_filter);
|
334 |
-
}
|
335 |
}
|
336 |
}
|
337 |
|
311 |
$filters_normalized = wp_slimstat_db::parse_filters($_filters, false);
|
312 |
if (!empty($filters_normalized['columns'])){
|
313 |
foreach($filters_normalized['columns'] as $a_key => $a_filter){
|
314 |
+
$filtered_url .= "&fs%5B$a_key%5D=".urlencode($a_filter[0].' '.$a_filter[1]);
|
|
|
|
|
315 |
}
|
316 |
}
|
317 |
|
327 |
// Misc filters
|
328 |
if (!empty($filters_normalized['misc'])){
|
329 |
foreach($filters_normalized['misc'] as $a_key => $a_filter){
|
330 |
+
$filtered_url .= "&fs%5B$a_key%5D=".urlencode('equals '.$a_filter);
|
|
|
|
|
331 |
}
|
332 |
}
|
333 |
|
admin/wp-slimstat-admin.php
CHANGED
@@ -12,10 +12,11 @@ class wp_slimstat_admin{
|
|
12 |
*/
|
13 |
public static function init(){
|
14 |
if ((wp_slimstat::$options['enable_ads_network'] == 'yes' || wp_slimstat::$options['enable_ads_network'] == 'no')){
|
15 |
-
self::$admin_notice = "
|
16 |
-
|
17 |
-
// self::$admin_notice = "
|
18 |
-
// self::$admin_notice = "
|
|
|
19 |
}
|
20 |
else {
|
21 |
self::$admin_notice = "
|
@@ -406,17 +407,27 @@ class wp_slimstat_admin{
|
|
406 |
}
|
407 |
// --- END: Updates for version 3.8.4 ---
|
408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
// Now we can update the version stored in the database
|
410 |
wp_slimstat::$options['version'] = wp_slimstat::$version;
|
411 |
-
|
412 |
-
/* $count_posts = wp_count_posts();
|
413 |
-
$count_posts = $count_posts->publish + $count_posts->draft + $count_posts->future;
|
414 |
-
$count_pages = wp_count_posts('page');
|
415 |
-
$count_pages = $count_pages->publish + $count_pages->draft;
|
416 |
-
$total = $my_wpdb->get_var("SELECT COUNT(*) FROM {$GLOBALS['wpdb']->prefix}slim_stats");
|
417 |
-
|
418 |
-
@wp_remote_get("http://slimstat.getused.to.it/browscap.php?po=$count_posts&pa=$count_pages&t=$total&v=".wp_slimstat::$options['version']."&a=".wp_slimstat::$options['enable_ads_network'], array('timeout'=>2,'blocking'=>false,'sslverify'=>false));
|
419 |
-
*/
|
420 |
return true;
|
421 |
}
|
422 |
// end update_tables_and_options
|
@@ -940,7 +951,7 @@ class wp_slimstat_admin{
|
|
940 |
<td colspan="2">
|
941 |
<label for="<?php echo $_option_name ?>"><?php echo $_option_details['description'] ?></label>
|
942 |
<p class="description"><?php echo $_option_details['long_description'] ?></p>
|
943 |
-
<p><textarea class="large-text code" cols="50" rows="
|
944 |
</td>
|
945 |
</tr><?php
|
946 |
}
|
12 |
*/
|
13 |
public static function init(){
|
14 |
if ((wp_slimstat::$options['enable_ads_network'] == 'yes' || wp_slimstat::$options['enable_ads_network'] == 'no')){
|
15 |
+
self::$admin_notice = "The security of our users' data is our top priority, and for this reason we tightened our SQL queries and made our encryption key harder to guess. If you are using a caching plugin, please <strong>flush its cache</strong> so that the tracking code can be regenerated with the new key. Also, if you are using Slimstat to track external websites, please make sure to replace the tracking code with the new one available under Settings > Advanced. As usual, feel free to contact us if you have any questions.";
|
16 |
+
|
17 |
+
// 3.9.7 self::$admin_notice = "The wait is over: our heatmap add-on is finally available <a href='http://slimstat.getused.to.it/downloads/heatmap/' target='_blank'>on our store</a>. We would like to thank all our users who helped us shape this initial release. Go grab your own copy today! PS: have you noticed those new add-on overview videos on our website?";
|
18 |
+
// 3.9.8 self::$admin_notice = "We've been working on the documentation for Slimstat. Now you can find <a href='https://slimstat.freshdesk.com/support/solutions' target='_blank'>detailed information</a> about all the actions and filters available in our source code. Developers, use them to build your own custom add-ons! We are also adding video tours of our add-ons, and organizing the source code to make it easier to read and understand.";
|
19 |
+
// 3.9.9 self::$admin_notice = "Happy birthday, Slimstat. Nine years ago version 0.8.7 was released to the public, starting the unbelievable journey that has taken us here today. We would like to thank all the 25,000 users who appreciate and support our work in many great ways. We wouldn't have more than 1.3 million downloads, 700 5-star reviews, 16 add-ons, video tutorials, etc... if it weren't for you!";
|
20 |
}
|
21 |
else {
|
22 |
self::$admin_notice = "
|
407 |
}
|
408 |
// --- END: Updates for version 3.8.4 ---
|
409 |
|
410 |
+
// --- Updates for version 3.9.6 ---
|
411 |
+
if (version_compare(wp_slimstat::$options['version'], '3.9.6', '<')){
|
412 |
+
// Consolidate some settings
|
413 |
+
$classes = wp_slimstat::string_to_array(wp_slimstat::$options['ignore_outbound_classes']);
|
414 |
+
$rel = wp_slimstat::string_to_array(wp_slimstat::$options['ignore_outbound_rel']);
|
415 |
+
$href = wp_slimstat::string_to_array(wp_slimstat::$options['ignore_outbound_href']);
|
416 |
+
wp_slimstat::$options['ignore_outbound_classes_rel_href'] = implode(',', array_merge($classes, $rel, $href));
|
417 |
+
|
418 |
+
$classes = wp_slimstat::string_to_array(wp_slimstat::$options['do_not_track_outbound_classes']);
|
419 |
+
$rel = wp_slimstat::string_to_array(wp_slimstat::$options['do_not_track_outbound_rel']);
|
420 |
+
$href = wp_slimstat::string_to_array(wp_slimstat::$options['do_not_track_outbound_href']);
|
421 |
+
wp_slimstat::$options['do_not_track_outbound_classes_rel_href'] = implode(',', array_merge($classes, $rel, $href));
|
422 |
+
|
423 |
+
// More secure secret key
|
424 |
+
wp_slimstat::$options['secret'] = wp_hash(uniqid(time(), true));
|
425 |
+
}
|
426 |
+
// --- END: Updates for version 3.9.6 ---
|
427 |
+
|
428 |
// Now we can update the version stored in the database
|
429 |
wp_slimstat::$options['version'] = wp_slimstat::$version;
|
430 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
return true;
|
432 |
}
|
433 |
// end update_tables_and_options
|
951 |
<td colspan="2">
|
952 |
<label for="<?php echo $_option_name ?>"><?php echo $_option_details['description'] ?></label>
|
953 |
<p class="description"><?php echo $_option_details['long_description'] ?></p>
|
954 |
+
<p><textarea class="large-text code" cols="50" rows="2" name="options[<?php echo $_option_name ?>]" id="<?php echo $_option_name ?>"><?php echo !empty(wp_slimstat::$options[$_option_name])?stripslashes(wp_slimstat::$options[$_option_name]):'' ?></textarea> <span class="description"><?php echo $_option_details['after_input_field'] ?></span></p>
|
955 |
</td>
|
956 |
</tr><?php
|
957 |
}
|
databases/maxmind.dat
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 3.9.
|
8 |
|
9 |
== Description ==
|
10 |
Visit our [website](http://slimstat.getused.to.it/) for more information and to [watch our introductory videos](http://slimstat.getused.to.it/features/video-tutorials/).
|
@@ -63,6 +63,17 @@ Our knowledge base is available on our [support center](https://slimstat.freshde
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 3.9.5 =
|
67 |
* [Note] Some of our add-ons had a bug preventing them from properly checking for updates. Please [contact us](http://support.getused.to.it) if you need to obtain the latest version of your add-ons.
|
68 |
* [Update] The Save button in the settings is now always visible, so that there is no need to scroll all the way to the bottom to save your options.
|
4 |
Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 3.9.6
|
8 |
|
9 |
== Description ==
|
10 |
Visit our [website](http://slimstat.getused.to.it/) for more information and to [watch our introductory videos](http://slimstat.getused.to.it/features/video-tutorials/).
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 3.9.6 =
|
67 |
+
* [Note] The security of our users' data is our top priority, and for this reason we tightened our SQL queries and made our encryption key harder to guess. If you are using a caching plugin, please flush its cache so that the tracking code can be regenerated with the new key. Also, if you are using Slimstat to track external websites, please make sure to replace the tracking code with the new one available under Settings > Advanced. As usual, feel free to contact us if you have any questions.
|
68 |
+
* [Note] Added un-minified js tracker to the repo, for those who would like to take a look at how things work.
|
69 |
+
* [New] Introduced option to ignore bots when in Server-side mode.
|
70 |
+
* [Update] Cleaned up the Settings/Filters screen by consolidating some options.
|
71 |
+
* [Update] AmMap has been updated to version 3.13.1
|
72 |
+
* [Update] MaxMind GeoLite IP has been updated to the latest version (2015-02-04).
|
73 |
+
* [Fix] Patched a rare SQL injection vulnerability exploitable using a bruteforce attack on the secret key (used to encrypt the data between client and server).
|
74 |
+
* [Fix] Increased checks on SQL code that stores data in the database (maybe_insert_row).
|
75 |
+
* [Fix] Report filters could not be removed after being set.
|
76 |
+
|
77 |
= 3.9.5 =
|
78 |
* [Note] Some of our add-ons had a bug preventing them from properly checking for updates. Please [contact us](http://support.getused.to.it) if you need to obtain the latest version of your add-ons.
|
79 |
* [Update] The Save button in the settings is now always visible, so that there is no need to scroll all the way to the bottom to save your options.
|
wp-slimstat.js
CHANGED
@@ -1 +1,492 @@
|
|
1 |
-
var SlimStat={_id:typeof SlimStatParams.id!="undefined"?SlimStatParams.id:"-1.0",_base64_key_str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_plugins:{acrobat:{substrings:["Adobe","Acrobat"],active_x_strings:["AcroPDF.PDF","PDF.PDFCtrl.5"]},director:{substrings:["Shockwave","Director"],active_x_strings:["SWCtl.SWCtl"]},flash:{substrings:["Shockwave","Flash"],active_x_strings:["ShockwaveFlash.ShockwaveFlash"]},mediaplayer:{substrings:["Windows Media"],active_x_strings:["WMPlayer.OCX"]},quicktime:{substrings:["QuickTime"],active_x_strings:["QuickTime.QuickTime"]},real:{substrings:["RealPlayer"],active_x_strings:["rmocx.RealPlayer G2 Control","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)"]},silverlight:{substrings:["Silverlight"],active_x_strings:["AgControl.AgControl"]}},_utf8_encode:function(e){var t,n,r="";e=e.replace(/\r\n/g,"\n");for(t=0;t<e.length;t++){n=e.charCodeAt(t);if(n<128){r+=String.fromCharCode(n)}else if(n>127&&n<2048){r+=String.fromCharCode(n>>6|192);r+=String.fromCharCode(n&63|128)}else{r+=String.fromCharCode(n>>12|224);r+=String.fromCharCode(n>>6&63|128);r+=String.fromCharCode(n&63|128)}}return r},_base64_encode:function(e){var t,n,r,i,s,o,u,a="",f=0;e=SlimStat._utf8_encode(e);while(f<e.length){t=e.charCodeAt(f++);n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=t>>2;s=(t&3)<<4|n>>4;o=(n&15)<<2|r>>6;u=r&63;if(isNaN(n)){o=u=64}else if(isNaN(r)){u=64}a=a+SlimStat._base64_key_str.charAt(i)+SlimStat._base64_key_str.charAt(s)+SlimStat._base64_key_str.charAt(o)+this._base64_key_str.charAt(u)}return a},_detect_single_plugin_not_ie:function(e){var t,n,r,i,s;for(i in navigator.plugins){n=""+navigator.plugins[i].name+navigator.plugins[i].description;r=0;for(s in SlimStat._plugins[e].substrings){if(n.indexOf(SlimStat._plugins[e].substrings[s])!=-1){r++}}if(r==SlimStat._plugins[e].substrings.length){return true}}return false},_detect_single_plugin_ie:function(e){var t;for(t in SlimStat._plugins[e].active_x_strings){try{new ActiveXObject(SlimStat._plugins[e].active_x_strings[t]);return true}catch(n){return false}}},_detect_single_plugin:function(e){if(navigator.plugins.length){this.detect=this._detect_single_plugin_not_ie}else{this.detect=this._detect_single_plugin_ie}return this.detect(e)},detect_plugins:function(){var e,t="";for(e in SlimStat._plugins){if(SlimStat._detect_single_plugin(e)){t+=e+"|"}}return t},has_smoothing:function(){if(typeof screen.fontSmoothingEnabled!="undefined"){return Number(screen.fontSmoothingEnabled)}else{if(typeof SlimStatParams.detect_smoothing!="undefined")return 0;try{var e=document.createElement("canvas");e.width="35";e.height="35";e.style.display="none";document.body.appendChild(e);var t=e.getContext("2d");t.textBaseline="top";t.font="32px Arial";t.fillStyle="black";t.strokeStyle="black";t.fillText("O",0,0);for(var n=8;n<=32;n++){for(var r=1;r<=32;r++){var i=t.getImageData(r,n,1,1).data;var s=i[3];if(s!=255&&s!=0)return 1}}return 0}catch(o){return 0}}},get_page_performance:function(){slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{};if(typeof slim_performance.timing=="undefined"){return 0}return slim_performance.timing.loadEventEnd-slim_performance.timing.responseEnd},get_server_latency:function(){slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{};if(typeof slim_performance.timing=="undefined"){return 0}return slim_performance.timing.responseEnd-slim_performance.timing.connectEnd},send_to_server:function(e,t){if(typeof SlimStatParams.ajaxurl=="undefined"||typeof e=="undefined"){if(typeof t=="function"){t()}return false}try{if(window.XMLHttpRequest){request=new XMLHttpRequest}else if(window.ActiveXObject){request=new ActiveXObject("Microsoft.XMLHTTP")}}catch(n){if(typeof t=="function"){t()}return false}if(request){var r="action=slimtrack_js&data="+SlimStat._base64_encode(e);request.open("POST",SlimStatParams.ajaxurl,true);request.setRequestHeader("Content-type","application/x-www-form-urlencoded");request.send(r);request.onreadystatechange=function(){if(request.readyState==4){if(typeof SlimStatParams.id=="undefined"){parsed_id=parseInt(request.responseText);if(!isNaN(parsed_id)&&parsed_id>0){SlimStat._id=request.responseText}}else{SlimStat._id=SlimStatParams.id}if(typeof t=="function"){t()}}};return true}return false},ss_track:function(e,t,n,r){if(!e){e=window.event}code=typeof t=="undefined"?0:parseInt(t);note_array=[];parsed_id=parseInt(SlimStat._id);if(isNaN(parsed_id)||parsed_id<=0){if(typeof r=="function"){r()}return false}node=typeof e.target!="undefined"?e.target:typeof e.srcElement!="undefined"?e.srcElement:false;if(!node){if(typeof r=="function"){r()}return false}if(node.nodeType==3)node=node.parentNode;parent_node=node.parentNode;node_hostname="";node_pathname=location.pathname;switch(node.nodeName){case"FORM":if(node.action.length>0)node_pathname=escape(node.action);break;case"INPUT":while(typeof parent_node!="undefined"&&parent_node.nodeName!="FORM"&&parent_node.nodeName!="BODY")parent_node=parent_node.parentNode;if(typeof parent_node.action!="undefined"&&parent_node.action.length>0){node_pathname=escape(parent_node.action);break};default:if(node.nodeName!="A"){if(typeof node.getAttribute=="function"&&node.getAttribute("id")!="undefined"&&node.getAttribute("id")!=null&&node.getAttribute("id").length>0){node_pathname=node.getAttribute("id");break}while(typeof node.parentNode!="undefined"&&node.parentNode!=null&&node.nodeName!="A"&&node.nodeName!="BODY")node=node.parentNode}if(typeof node.hash!="undefined"&&node.hash.length>0&&node.hostname==location.hostname){node_pathname=escape(node.hash)}else{node_hostname=typeof node.hostname!="undefined"?node.hostname:"";if(typeof node.href!="undefined"){node_pathname=escape(node.href)}}if(typeof node.getAttribute=="function"){if(node.getAttribute("title")!="undefined"&&node.getAttribute("title")!=null&&node.getAttribute("title").length>0)note_array.push("Title:"+node.getAttribute("title"));if(node.getAttribute("id")!="undefined"&&node.getAttribute("id")!=null&&node.getAttribute("id").length>0)note_array.push("ID:"+node.getAttribute("id"))}}slimstat_info="&obd="+node_hostname+"&obr="+node_pathname;pos_x=-1;var i=-1;if(typeof e.pageX!="undefined"&&typeof e.pageY!="undefined"){pos_x=e.pageX;i=e.pageY}else if(typeof e.clientX!="undefined"&&typeof e.clientY!="undefined"&&typeof document.body.scrollLeft!="undefined"&&typeof document.documentElement.scrollLeft!="undefined"&&typeof document.body.scrollTop!="undefined"&&typeof document.documentElement.scrollTop!="undefined"){pos_x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;i=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}if(pos_x>0&&i>0)slimstat_info+=(slimstat_info.length>0?"&":"?")+"po="+pos_x+","+i;note_array.push("Event:"+e.type);if(typeof n!="undefined"&&n.length>0)note_array.push(n);if(e.type!="click"&&typeof e.which!="undefined"){if(e.type=="keypress")note_array.push("Key:"+String.fromCharCode(parseInt(e.which)));else note_array.push("Type:"+e.which)}SlimStat.send_to_server("id="+SlimStat._id+"&ty="+code+slimstat_info+"&no="+escape(note_array.join(", ")),r);return true},slimstat_plusone:function(e){SlimStat.send_to_server("ty=4&obr="+escape("#google-plus-"+e.state))},add_event:function(e,t,n){if(e&&e.addEventListener){e.addEventListener(t,n,false)}else if(e&&e.attachEvent){e["e"+t+n]=n;e[t+n]=function(){e["e"+t+n](window.event)};e.attachEvent("on"+t,e[t+n])}else{e["on"+t]=e["e"+t+n]}},event_fire:function(e,t){var n=e;if(document.createEvent){var r=document.createEvent("MouseEvents");r.initEvent(t,true,false);n.dispatchEvent(r)}else if(document.createEventObject){var r=document.createEventObject();n.fireEvent("on"+t,r)}},in_array:function(e,t){for(var n=0;n<t.length;n++){if(t[n].trim()==e)return true}return false},in_array_substring:function(e,t){for(var n=0;n<t.length;n++){if(e.indexOf(t[n].trim())!=-1)return true}return false}};SlimStat.add_event(window,"load",function(){if(typeof SlimStatParams.disable_outbound_tracking=="undefined"){all_links=document.getElementsByTagName("a");var e=typeof SlimStatParams.extensions_to_track!="undefined"&&SlimStatParams.extensions_to_track.length>0?SlimStatParams.extensions_to_track.split(","):[];var t=typeof SlimStatParams.outbound_classes_to_ignore!="undefined"&&SlimStatParams.outbound_classes_to_ignore.length>0?SlimStatParams.outbound_classes_to_ignore.split(","):[];var n=typeof SlimStatParams.outbound_rel_to_ignore!="undefined"&&SlimStatParams.outbound_rel_to_ignore.length>0?SlimStatParams.outbound_rel_to_ignore.split(","):[];var r=typeof SlimStatParams.outbound_href_to_ignore!="undefined"&&SlimStatParams.outbound_href_to_ignore.length>0?SlimStatParams.outbound_href_to_ignore.split(","):[];var i=typeof SlimStatParams.outbound_classes_to_not_track!="undefined"&&SlimStatParams.outbound_classes_to_not_track.length>0?SlimStatParams.outbound_classes_to_not_track.split(","):[];var s=typeof SlimStatParams.outbound_rel_to_not_track!="undefined"&&SlimStatParams.outbound_rel_to_not_track.length>0?SlimStatParams.outbound_rel_to_not_track.split(","):[];var o=typeof SlimStatParams.outbound_href_to_not_track!="undefined"&&SlimStatParams.outbound_href_to_not_track.length>0?SlimStatParams.outbound_href_to_not_track.split(","):[];for(var u=0;u<all_links.length;u++){(function(){var a=all_links[u];a.slimstat_actual_click=false;a.slimstat_type=a.href&&(a.hostname==location.hostname||a.href.indexOf("://")==-1)?2:0;a.slimstat_track_me=true;a.slimstat_callback=true;if(e.length>0&&a.pathname.indexOf(".")>0&&a.hostname==location.hostname){extension_current_link=a.pathname.split(".").pop().replace(/[\/\-]/g,"");a.slimstat_track_me=SlimStat.in_array(extension_current_link,e);a.slimstat_type=1}if(a.slimstat_track_me&&a.slimstat_type==2&&(typeof SlimStatParams.track_internal_links=="undefined"||SlimStatParams.track_internal_links=="false")){a.slimstat_track_me=false}if(a.slimstat_track_me&&t.length>0){classes_current_link=typeof a.className!="undefined"&&a.className.length>0?a.className.split(" "):[];for(var f=0;f<classes_current_link.length;f++){if(SlimStat.in_array_substring(classes_current_link[f],t)){a.slimstat_callback=false}if(SlimStat.in_array_substring(classes_current_link[f],i)){a.slimstat_track_me=false;break}}}if(a.slimstat_track_me&&typeof a.attributes.rel!="undefined"&&a.attributes.rel.value.length>0){if(SlimStat.in_array_substring(a.attributes.rel.value,n)){a.slimstat_callback=false}if(SlimStat.in_array_substring(a.attributes.rel.value,s)){a.slimstat_track_me=false}}if(a.slimstat_track_me&&typeof a.href!="undefined"&&a.href.length>0){if(SlimStat.in_array_substring(a.href,r)){a.slimstat_callback=false}if(SlimStat.in_array_substring(a.href,o)){a.slimstat_track_me=false}}if(a.slimstat_track_me&&a.target&&!a.target.match(/^_(self|parent|top)$/i)){a.slimstat_callback=false}SlimStat.add_event(a,"click",function(e){if(this.slimstat_track_me){if(!this.slimstat_actual_click){if(this.slimstat_callback){if(typeof e.preventDefault=="function"){e.preventDefault()}this.slimstat_actual_click=!this.slimstat_actual_click;SlimStat.ss_track(e,this.slimstat_type,"",function(){SlimStat.event_fire(a,"click")})}else{SlimStat.ss_track(e,this.slimstat_type,"",function(){})}}}})})()}}});var current_data="";if(typeof SlimStatParams.id!="undefined"&&parseInt(SlimStatParams.id)>0){current_data="id="+SlimStatParams.id}else if(typeof SlimStatParams.ci!="undefined"){current_data="ci="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href)}if(current_data.length){SlimStat.add_event(window,"load",function(){setTimeout(function(){SlimStat.send_to_server(current_data+"&sw="+(screen.width||window.innerWidth||document.documentElement.clientWidth||document.body.offsetWidth)+"&sh="+(screen.height||window.innerHeight||document.documentElement.clientHeight||document.body.offsetHeight)+"&cd="+screen.colorDepth+"&aa="+SlimStat.has_smoothing()+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins())},0)})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var SlimStat = {
|
2 |
+
// Private Properties
|
3 |
+
_id : (typeof SlimStatParams.id != 'undefined') ? SlimStatParams.id : "-1.0",
|
4 |
+
_base64_key_str : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
5 |
+
_plugins : {
|
6 |
+
'acrobat': { substrings: [ "Adobe", "Acrobat" ], active_x_strings: [ "AcroPDF.PDF", "PDF.PDFCtrl.5" ] },
|
7 |
+
'director': { substrings: [ "Shockwave", "Director" ], active_x_strings: [ "SWCtl.SWCtl" ] },
|
8 |
+
'flash': { substrings: [ "Shockwave", "Flash" ], active_x_strings: [ "ShockwaveFlash.ShockwaveFlash" ] },
|
9 |
+
'mediaplayer': { substrings: [ "Windows Media" ], active_x_strings: [ "WMPlayer.OCX" ] },
|
10 |
+
'quicktime': { substrings: [ "QuickTime" ], active_x_strings: [ "QuickTime.QuickTime" ] },
|
11 |
+
'real': { substrings: [ "RealPlayer" ], active_x_strings: [ "rmocx.RealPlayer G2 Control", "RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)", "RealVideo.RealVideo(tm) ActiveX Control (32-bit)" ] },
|
12 |
+
'silverlight': { substrings: [ "Silverlight" ], active_x_strings: [ "AgControl.AgControl" ] }
|
13 |
+
},
|
14 |
+
|
15 |
+
_utf8_encode : function (string) {
|
16 |
+
var n, c, utftext = "";
|
17 |
+
|
18 |
+
string = string.replace(/\r\n/g,"\n");
|
19 |
+
|
20 |
+
for (n = 0; n < string.length; n++) {
|
21 |
+
c = string.charCodeAt(n);
|
22 |
+
|
23 |
+
if (c < 128) {
|
24 |
+
utftext += String.fromCharCode(c);
|
25 |
+
}
|
26 |
+
else if((c > 127) && (c < 2048)) {
|
27 |
+
utftext += String.fromCharCode((c >> 6) | 192);
|
28 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
29 |
+
}
|
30 |
+
else {
|
31 |
+
utftext += String.fromCharCode((c >> 12) | 224);
|
32 |
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
33 |
+
utftext += String.fromCharCode((c & 63) | 128);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
return utftext;
|
37 |
+
},
|
38 |
+
|
39 |
+
// Base64 Encode - http://www.webtoolkit.info/
|
40 |
+
_base64_encode : function (input) {
|
41 |
+
var chr1, chr2, chr3, enc1, enc2, enc3, enc4, output = "", i = 0;
|
42 |
+
|
43 |
+
input = SlimStat._utf8_encode(input);
|
44 |
+
|
45 |
+
while (i < input.length) {
|
46 |
+
chr1 = input.charCodeAt(i++);
|
47 |
+
chr2 = input.charCodeAt(i++);
|
48 |
+
chr3 = input.charCodeAt(i++);
|
49 |
+
|
50 |
+
enc1 = chr1 >> 2;
|
51 |
+
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
52 |
+
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
53 |
+
enc4 = chr3 & 63;
|
54 |
+
|
55 |
+
if (isNaN(chr2)) {
|
56 |
+
enc3 = enc4 = 64;
|
57 |
+
} else if (isNaN(chr3)) {
|
58 |
+
enc4 = 64;
|
59 |
+
}
|
60 |
+
|
61 |
+
output = output + SlimStat._base64_key_str.charAt(enc1) + SlimStat._base64_key_str.charAt(enc2) + SlimStat._base64_key_str.charAt(enc3) + this._base64_key_str.charAt(enc4);
|
62 |
+
}
|
63 |
+
return output;
|
64 |
+
},
|
65 |
+
|
66 |
+
_detect_single_plugin_not_ie : function (plugin_name) {
|
67 |
+
var plugin, haystack, found, i, j;
|
68 |
+
|
69 |
+
for (i in navigator.plugins) {
|
70 |
+
haystack = '' + navigator.plugins[i].name + navigator.plugins[i].description;
|
71 |
+
found = 0;
|
72 |
+
|
73 |
+
for (j in SlimStat._plugins[plugin_name].substrings) {
|
74 |
+
if (haystack.indexOf(SlimStat._plugins[plugin_name].substrings[j]) != -1) {
|
75 |
+
found++;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
if (found == SlimStat._plugins[plugin_name].substrings.length) {
|
80 |
+
return true;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
return false;
|
84 |
+
},
|
85 |
+
|
86 |
+
_detect_single_plugin_ie : function (plugin_name) {
|
87 |
+
var i;
|
88 |
+
|
89 |
+
for (i in SlimStat._plugins[plugin_name].active_x_strings) {
|
90 |
+
try {
|
91 |
+
new ActiveXObject( SlimStat._plugins[plugin_name].active_x_strings[i] );
|
92 |
+
return true;
|
93 |
+
}
|
94 |
+
catch(e) {
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
},
|
99 |
+
|
100 |
+
_detect_single_plugin : function (plugin_name) {
|
101 |
+
if( navigator.plugins.length ) {
|
102 |
+
this.detect = this._detect_single_plugin_not_ie;
|
103 |
+
}
|
104 |
+
else {
|
105 |
+
this.detect = this._detect_single_plugin_ie;
|
106 |
+
}
|
107 |
+
return this.detect( plugin_name );
|
108 |
+
},
|
109 |
+
|
110 |
+
detect_plugins : function () {
|
111 |
+
var a_plugin, plugins = "";
|
112 |
+
|
113 |
+
for (a_plugin in SlimStat._plugins) {
|
114 |
+
if (SlimStat._detect_single_plugin(a_plugin)) {
|
115 |
+
plugins += a_plugin + "|";
|
116 |
+
}
|
117 |
+
}
|
118 |
+
return plugins;
|
119 |
+
},
|
120 |
+
|
121 |
+
// From http://www.useragentman.com/blog/2009/11/29/how-to-detect-font-smoothing-using-javascript/
|
122 |
+
has_smoothing : function () {
|
123 |
+
// IE has screen.fontSmoothingEnabled - sweet!
|
124 |
+
if (typeof screen.fontSmoothingEnabled != 'undefined'){
|
125 |
+
return Number(screen.fontSmoothingEnabled);
|
126 |
+
}
|
127 |
+
else{
|
128 |
+
if (typeof SlimStatParams.detect_smoothing != 'undefined') return 0;
|
129 |
+
|
130 |
+
try{
|
131 |
+
// Create a 35x35 Canvas block.
|
132 |
+
var canvasNode = document.createElement('canvas');
|
133 |
+
canvasNode.width = "35";
|
134 |
+
canvasNode.height = "35";
|
135 |
+
|
136 |
+
// We must put this node into the body, otherwise Safari for Windows does not report correctly.
|
137 |
+
canvasNode.style.display = 'none';
|
138 |
+
document.body.appendChild(canvasNode);
|
139 |
+
var ctx = canvasNode.getContext('2d');
|
140 |
+
|
141 |
+
// draw a black letter 'O', 32px Arial.
|
142 |
+
ctx.textBaseline = "top";
|
143 |
+
ctx.font = "32px Arial";
|
144 |
+
ctx.fillStyle = "black";
|
145 |
+
ctx.strokeStyle = "black";
|
146 |
+
|
147 |
+
ctx.fillText("O", 0, 0);
|
148 |
+
|
149 |
+
// start at (8,1) and search the canvas from left to right, top to bottom to see if we can find a non-black pixel. If so we return 1.
|
150 |
+
for (var j = 8; j <= 32; j++){
|
151 |
+
for (var i = 1; i <= 32; i++){
|
152 |
+
var imageData = ctx.getImageData(i, j, 1, 1).data;
|
153 |
+
var alpha = imageData[3];
|
154 |
+
|
155 |
+
if (alpha != 255 && alpha != 0) return 1; // font-smoothing must be on.
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
// didn't find any non-black pixels - return 0.
|
160 |
+
return 0;
|
161 |
+
}
|
162 |
+
catch (ex){
|
163 |
+
// Something went wrong (for example, Opera cannot use the canvas fillText() method.
|
164 |
+
return 0;
|
165 |
+
}
|
166 |
+
}
|
167 |
+
},
|
168 |
+
|
169 |
+
get_page_performance : function () {
|
170 |
+
slim_performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
|
171 |
+
if (typeof slim_performance.timing == 'undefined'){
|
172 |
+
return 0;
|
173 |
+
}
|
174 |
+
|
175 |
+
return slim_performance.timing.loadEventEnd - slim_performance.timing.responseEnd;
|
176 |
+
},
|
177 |
+
|
178 |
+
get_server_latency : function () {
|
179 |
+
slim_performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {};
|
180 |
+
if (typeof slim_performance.timing == 'undefined'){
|
181 |
+
return 0;
|
182 |
+
}
|
183 |
+
|
184 |
+
return slim_performance.timing.responseEnd - slim_performance.timing.connectEnd;
|
185 |
+
},
|
186 |
+
|
187 |
+
send_to_server : function (data_to_send, callback) {
|
188 |
+
if (typeof SlimStatParams.ajaxurl == 'undefined' || typeof data_to_send == 'undefined'){
|
189 |
+
if (typeof callback == 'function'){
|
190 |
+
callback();
|
191 |
+
}
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
try {
|
196 |
+
if (window.XMLHttpRequest) {
|
197 |
+
request = new XMLHttpRequest();
|
198 |
+
}
|
199 |
+
else if (window.ActiveXObject) { // code for IE6, IE5
|
200 |
+
request = new ActiveXObject("Microsoft.XMLHTTP");
|
201 |
+
}
|
202 |
+
} catch (failed) {
|
203 |
+
if (typeof callback == 'function'){
|
204 |
+
callback();
|
205 |
+
}
|
206 |
+
return false;
|
207 |
+
}
|
208 |
+
|
209 |
+
if (request) {
|
210 |
+
var data = "action=slimtrack_js&data="+SlimStat._base64_encode(data_to_send);
|
211 |
+
request.open("POST", SlimStatParams.ajaxurl, true);
|
212 |
+
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
213 |
+
request.send(data);
|
214 |
+
|
215 |
+
request.onreadystatechange = function() {
|
216 |
+
if (request.readyState == 4) {
|
217 |
+
if (typeof SlimStatParams.id == "undefined") {
|
218 |
+
parsed_id = parseInt(request.responseText);
|
219 |
+
if (!isNaN(parsed_id) && parsed_id > 0) {
|
220 |
+
SlimStat._id = request.responseText
|
221 |
+
}
|
222 |
+
} else {
|
223 |
+
SlimStat._id = SlimStatParams.id
|
224 |
+
}
|
225 |
+
if (typeof callback == "function") {
|
226 |
+
callback()
|
227 |
+
}
|
228 |
+
}
|
229 |
+
};
|
230 |
+
return true;
|
231 |
+
}
|
232 |
+
return false;
|
233 |
+
},
|
234 |
+
|
235 |
+
ss_track : function (e, c, note, callback) {
|
236 |
+
// Check function params
|
237 |
+
if (!e){
|
238 |
+
e = window.event;
|
239 |
+
}
|
240 |
+
code = (typeof c == 'undefined')?0:parseInt(c);
|
241 |
+
note_array = [];
|
242 |
+
|
243 |
+
// Do nothing if we don't have a valid SlimStat._id
|
244 |
+
parsed_id = parseInt(SlimStat._id);
|
245 |
+
if (isNaN(parsed_id) || parsed_id <= 0) {
|
246 |
+
if (typeof callback == 'function'){
|
247 |
+
callback();
|
248 |
+
}
|
249 |
+
return false;
|
250 |
+
}
|
251 |
+
|
252 |
+
node = (typeof e.target != "undefined")?e.target:(typeof e.srcElement != "undefined")?e.srcElement:false;
|
253 |
+
if (!node) {
|
254 |
+
if (typeof callback == 'function'){
|
255 |
+
callback();
|
256 |
+
}
|
257 |
+
return false;
|
258 |
+
}
|
259 |
+
|
260 |
+
// Old Safari bug
|
261 |
+
if (node.nodeType == 3) node = node.parentNode;
|
262 |
+
|
263 |
+
parent_node = node.parentNode;
|
264 |
+
node_hostname = '';
|
265 |
+
node_pathname = location.pathname;
|
266 |
+
|
267 |
+
// This handler can be attached to any element, but only A carries the extra info we need
|
268 |
+
switch (node.nodeName) {
|
269 |
+
case 'FORM':
|
270 |
+
if (node.action.length > 0) node_pathname = escape(node.action);
|
271 |
+
break;
|
272 |
+
|
273 |
+
case 'INPUT':
|
274 |
+
// Let's look for a FORM element
|
275 |
+
while (typeof parent_node != 'undefined' && parent_node.nodeName != 'FORM' && parent_node.nodeName != 'BODY') parent_node = parent_node.parentNode;
|
276 |
+
if (typeof parent_node.action != 'undefined' && parent_node.action.length > 0) {
|
277 |
+
node_pathname = escape(parent_node.action);
|
278 |
+
break;
|
279 |
+
}
|
280 |
+
|
281 |
+
default:
|
282 |
+
// Any other element
|
283 |
+
if (node.nodeName != 'A') {
|
284 |
+
if (typeof node.getAttribute == 'function' && node.getAttribute('id') != 'undefined' && node.getAttribute('id') != null && node.getAttribute('id').length > 0){
|
285 |
+
node_pathname = node.getAttribute('id');
|
286 |
+
break;
|
287 |
+
}
|
288 |
+
while (typeof node.parentNode != 'undefined' && node.parentNode != null && node.nodeName != 'A' && node.nodeName != 'BODY') node = node.parentNode;
|
289 |
+
}
|
290 |
+
|
291 |
+
// Anchor in the same page
|
292 |
+
if (typeof node.hash != 'undefined' && node.hash.length > 0 && node.hostname == location.hostname) {
|
293 |
+
node_pathname = escape(node.hash);
|
294 |
+
}
|
295 |
+
else {
|
296 |
+
node_hostname = (typeof node.hostname != 'undefined')?node.hostname:'';
|
297 |
+
if (typeof node.href != 'undefined') {
|
298 |
+
node_pathname = escape(node.href);
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
// If this element has a title, we can record that as well
|
303 |
+
if (typeof node.getAttribute == 'function'){
|
304 |
+
if (node.getAttribute('title') != 'undefined' && node.getAttribute('title') != null && node.getAttribute('title').length > 0) note_array.push('Title:'+node.getAttribute('title'));
|
305 |
+
if (node.getAttribute('id') != 'undefined' && node.getAttribute('id') != null && node.getAttribute('id').length > 0) note_array.push('ID:'+node.getAttribute('id'));
|
306 |
+
}
|
307 |
+
}
|
308 |
+
slimstat_info = "&obd="+node_hostname+"&obr="+node_pathname;
|
309 |
+
|
310 |
+
// Track mouse coordinates
|
311 |
+
pos_x = -1; var pos_y = -1;
|
312 |
+
if (typeof e.pageX != 'undefined' && typeof e.pageY != 'undefined') {
|
313 |
+
pos_x = e.pageX;
|
314 |
+
pos_y = e.pageY;
|
315 |
+
}
|
316 |
+
else if (typeof e.clientX != 'undefined' && typeof e.clientY != 'undefined' &&
|
317 |
+
typeof document.body.scrollLeft != 'undefined' && typeof document.documentElement.scrollLeft != 'undefined' &&
|
318 |
+
typeof document.body.scrollTop != 'undefined' && typeof document.documentElement.scrollTop != 'undefined') {
|
319 |
+
pos_x = e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
|
320 |
+
pos_y = e.clientY+document.body.scrollTop+document.documentElement.scrollTop;
|
321 |
+
}
|
322 |
+
if (pos_x > 0 && pos_y > 0) slimstat_info += ((slimstat_info.length > 0)?'&':'?')+'po='+pos_x+','+pos_y;
|
323 |
+
|
324 |
+
// Event type and button pressed
|
325 |
+
note_array.push('Event:'+e.type);
|
326 |
+
if (typeof note != 'undefined' && note.length > 0) note_array.push(note);
|
327 |
+
|
328 |
+
if (e.type != 'click' && typeof(e.which) != 'undefined'){
|
329 |
+
if (e.type == 'keypress')
|
330 |
+
note_array.push('Key:'+String.fromCharCode(parseInt(e.which)));
|
331 |
+
else
|
332 |
+
note_array.push('Type:'+e.which);
|
333 |
+
}
|
334 |
+
|
335 |
+
SlimStat.send_to_server("id="+SlimStat._id+"&ty="+code+slimstat_info+"&no="+escape(note_array.join(', ')), callback);
|
336 |
+
return true;
|
337 |
+
},
|
338 |
+
|
339 |
+
// Tracks Google+1 clicks
|
340 |
+
slimstat_plusone : function (obj) {
|
341 |
+
SlimStat.send_to_server('ty=4&obr='+escape('#google-plus-'+obj.state));
|
342 |
+
},
|
343 |
+
|
344 |
+
add_event : function ( obj, type, fn ) {
|
345 |
+
if (obj && obj.addEventListener) {
|
346 |
+
obj.addEventListener( type, fn, false );
|
347 |
+
}
|
348 |
+
else if (obj && obj.attachEvent) {
|
349 |
+
obj["e"+type+fn] = fn;
|
350 |
+
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
|
351 |
+
obj.attachEvent( "on"+type, obj[type+fn] );
|
352 |
+
}
|
353 |
+
else {
|
354 |
+
obj["on"+type] = obj["e"+type+fn];
|
355 |
+
}
|
356 |
+
},
|
357 |
+
event_fire : function ( obj, evt ) {
|
358 |
+
var fire_on_this = obj;
|
359 |
+
if ( document.createEvent ) {
|
360 |
+
var ev_obj = document.createEvent('MouseEvents');
|
361 |
+
ev_obj.initEvent( evt, true, false );
|
362 |
+
fire_on_this.dispatchEvent( ev_obj );
|
363 |
+
}
|
364 |
+
else if ( document.createEventObject ) {
|
365 |
+
var ev_obj = document.createEventObject();
|
366 |
+
fire_on_this.fireEvent( 'on' + evt, ev_obj );
|
367 |
+
}
|
368 |
+
},
|
369 |
+
in_array : function (needle, haystack) {
|
370 |
+
for(var i = 0; i < haystack.length; i++) {
|
371 |
+
if (haystack[i].trim() == needle) return true;
|
372 |
+
}
|
373 |
+
return false;
|
374 |
+
},
|
375 |
+
in_array_substring : function (needle, haystack_of_substrings) {
|
376 |
+
for(var i = 0; i < haystack_of_substrings.length; i++) {
|
377 |
+
if (needle.indexOf(haystack_of_substrings[i].trim()) != -1) return true;
|
378 |
+
}
|
379 |
+
return false;
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
// Attaches an event listener to all external links
|
384 |
+
SlimStat.add_event(window, 'load', function() {
|
385 |
+
if (typeof SlimStatParams.disable_outbound_tracking == 'undefined'){
|
386 |
+
all_links = document.getElementsByTagName("a");
|
387 |
+
var extensions_to_track = (typeof SlimStatParams.extensions_to_track != 'undefined' && SlimStatParams.extensions_to_track.length > 0) ? SlimStatParams.extensions_to_track.split(','):[];
|
388 |
+
var to_ignore = (typeof SlimStatParams.outbound_classes_rel_href_to_ignore != 'undefined' && SlimStatParams.outbound_classes_rel_href_to_ignore.length > 0) ? SlimStatParams.outbound_classes_rel_href_to_ignore.split(','):[];
|
389 |
+
var to_not_track = (typeof SlimStatParams.outbound_classes_rel_href_to_not_track != 'undefined' && SlimStatParams.outbound_classes_rel_href_to_not_track.length > 0) ? SlimStatParams.outbound_classes_rel_href_to_not_track.split(','):[];
|
390 |
+
|
391 |
+
for (var i=0; i<all_links.length; i++) {
|
392 |
+
// We need a closure to keep track of some variables and carry them thorughout the process
|
393 |
+
(function() {
|
394 |
+
var cur_link = all_links[i];
|
395 |
+
|
396 |
+
cur_link.slimstat_actual_click = false;
|
397 |
+
cur_link.slimstat_type = (cur_link.href && (cur_link.hostname == location.hostname || cur_link.href.indexOf('://') == -1))?2:0;
|
398 |
+
cur_link.slimstat_track_me = true;
|
399 |
+
cur_link.slimstat_callback = true;
|
400 |
+
|
401 |
+
// Track downloads (internal and external)
|
402 |
+
if (extensions_to_track.length > 0 && cur_link.pathname.indexOf('.') > 0 && cur_link.hostname == location.hostname){
|
403 |
+
extension_current_link = cur_link.pathname.split('.').pop().replace(/[\/\-]/g, '');
|
404 |
+
cur_link.slimstat_track_me = SlimStat.in_array(extension_current_link, extensions_to_track);
|
405 |
+
cur_link.slimstat_type = 1;
|
406 |
+
}
|
407 |
+
|
408 |
+
// Track ALL other internal links?
|
409 |
+
if (cur_link.slimstat_track_me && cur_link.slimstat_type == 2 && (typeof SlimStatParams.track_internal_links == 'undefined' || SlimStatParams.track_internal_links == 'false')) {
|
410 |
+
cur_link.slimstat_track_me = false;
|
411 |
+
}
|
412 |
+
|
413 |
+
// Do not invoke the callback or don't track links with given classes
|
414 |
+
if (cur_link.slimstat_track_me && to_ignore.length > 0){
|
415 |
+
classes_current_link = (typeof cur_link.className != 'undefined' && cur_link.className.length > 0) ? cur_link.className.split(' '):[];
|
416 |
+
for (var cl = 0; cl < classes_current_link.length; cl++){
|
417 |
+
if (SlimStat.in_array_substring(classes_current_link[cl], to_ignore)) {
|
418 |
+
cur_link.slimstat_callback = false;
|
419 |
+
}
|
420 |
+
if (SlimStat.in_array_substring(classes_current_link[cl], to_not_track)) {
|
421 |
+
cur_link.slimstat_track_me = false;
|
422 |
+
break;
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}
|
426 |
+
|
427 |
+
// Do not invoke the callback on links with given rel
|
428 |
+
if (cur_link.slimstat_track_me && typeof cur_link.attributes.rel != 'undefined' && cur_link.attributes.rel.value.length > 0){
|
429 |
+
if (SlimStat.in_array_substring(cur_link.attributes.rel.value, to_ignore)){
|
430 |
+
cur_link.slimstat_callback = false;
|
431 |
+
}
|
432 |
+
if (SlimStat.in_array_substring(cur_link.attributes.rel.value, to_not_track)){
|
433 |
+
cur_link.slimstat_track_me = false;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
// Do not invoke the callback on links with given href
|
438 |
+
if (cur_link.slimstat_track_me && typeof cur_link.href != 'undefined' && cur_link.href.length > 0){
|
439 |
+
if (SlimStat.in_array_substring(cur_link.href, to_ignore)){
|
440 |
+
cur_link.slimstat_callback = false;
|
441 |
+
}
|
442 |
+
if (SlimStat.in_array_substring(cur_link.href, to_not_track)){
|
443 |
+
cur_link.slimstat_track_me = false;
|
444 |
+
}
|
445 |
+
}
|
446 |
+
|
447 |
+
// Do not invoke the callback on links that open a new window
|
448 |
+
if (cur_link.slimstat_track_me && cur_link.target && !cur_link.target.match(/^_(self|parent|top)$/i)){
|
449 |
+
cur_link.slimstat_callback = false;
|
450 |
+
}
|
451 |
+
|
452 |
+
// Internal link or extension to ignore
|
453 |
+
SlimStat.add_event(cur_link, "click", function(e) {
|
454 |
+
if (this.slimstat_track_me){
|
455 |
+
if (!this.slimstat_actual_click){
|
456 |
+
if (this.slimstat_callback){
|
457 |
+
if (typeof e.preventDefault == "function") {
|
458 |
+
e.preventDefault();
|
459 |
+
}
|
460 |
+
this.slimstat_actual_click = !this.slimstat_actual_click;
|
461 |
+
SlimStat.ss_track(e, this.slimstat_type, "", function() {
|
462 |
+
SlimStat.event_fire(cur_link, 'click');
|
463 |
+
});
|
464 |
+
}
|
465 |
+
else{
|
466 |
+
SlimStat.ss_track(e, this.slimstat_type, "", function() {});
|
467 |
+
}
|
468 |
+
}
|
469 |
+
}
|
470 |
+
});
|
471 |
+
})();
|
472 |
+
}
|
473 |
+
}
|
474 |
+
});
|
475 |
+
|
476 |
+
// Is Javascript Mode active?
|
477 |
+
var current_data = '';
|
478 |
+
if (typeof SlimStatParams.id != 'undefined' && parseInt(SlimStatParams.id)>0){
|
479 |
+
current_data = "id="+SlimStatParams.id;
|
480 |
+
}
|
481 |
+
else if (typeof SlimStatParams.ci != 'undefined'){
|
482 |
+
current_data = "ci="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href);
|
483 |
+
}
|
484 |
+
|
485 |
+
// Gathers all the information and sends it to the server
|
486 |
+
if (current_data.length){
|
487 |
+
SlimStat.add_event(window, 'load', function(){
|
488 |
+
setTimeout(function(){
|
489 |
+
SlimStat.send_to_server(current_data+"&sw="+(screen.width||window.innerWidth||document.documentElement.clientWidth||document.body.offsetWidth)+"&sh="+(screen.height||window.innerHeight||document.documentElement.clientHeight||document.body.offsetHeight)+"&cd="+screen.colorDepth+"&aa="+SlimStat.has_smoothing()+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins());
|
490 |
+
}, 0)
|
491 |
+
});
|
492 |
+
}
|
wp-slimstat.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var SlimStat={_id:"undefined"!=typeof SlimStatParams.id?SlimStatParams.id:"-1.0",_base64_key_str:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_plugins:{acrobat:{substrings:["Adobe","Acrobat"],active_x_strings:["AcroPDF.PDF","PDF.PDFCtrl.5"]},director:{substrings:["Shockwave","Director"],active_x_strings:["SWCtl.SWCtl"]},flash:{substrings:["Shockwave","Flash"],active_x_strings:["ShockwaveFlash.ShockwaveFlash"]},mediaplayer:{substrings:["Windows Media"],active_x_strings:["WMPlayer.OCX"]},quicktime:{substrings:["QuickTime"],active_x_strings:["QuickTime.QuickTime"]},real:{substrings:["RealPlayer"],active_x_strings:["rmocx.RealPlayer G2 Control","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)"]},silverlight:{substrings:["Silverlight"],active_x_strings:["AgControl.AgControl"]}},_utf8_encode:function(e){var t,n,a="";for(e=e.replace(/\r\n/g,"\n"),t=0;t<e.length;t++)n=e.charCodeAt(t),128>n?a+=String.fromCharCode(n):n>127&&2048>n?(a+=String.fromCharCode(n>>6|192),a+=String.fromCharCode(63&n|128)):(a+=String.fromCharCode(n>>12|224),a+=String.fromCharCode(n>>6&63|128),a+=String.fromCharCode(63&n|128));return a},_base64_encode:function(e){var t,n,a,i,r,o,s,l="",d=0;for(e=SlimStat._utf8_encode(e);d<e.length;)t=e.charCodeAt(d++),n=e.charCodeAt(d++),a=e.charCodeAt(d++),i=t>>2,r=(3&t)<<4|n>>4,o=(15&n)<<2|a>>6,s=63&a,isNaN(n)?o=s=64:isNaN(a)&&(s=64),l=l+SlimStat._base64_key_str.charAt(i)+SlimStat._base64_key_str.charAt(r)+SlimStat._base64_key_str.charAt(o)+this._base64_key_str.charAt(s);return l},_detect_single_plugin_not_ie:function(e){var t,n,a,i;for(a in navigator.plugins){t=""+navigator.plugins[a].name+navigator.plugins[a].description,n=0;for(i in SlimStat._plugins[e].substrings)-1!=t.indexOf(SlimStat._plugins[e].substrings[i])&&n++;if(n==SlimStat._plugins[e].substrings.length)return!0}return!1},_detect_single_plugin_ie:function(e){var t;for(t in SlimStat._plugins[e].active_x_strings)try{return new ActiveXObject(SlimStat._plugins[e].active_x_strings[t]),!0}catch(n){return!1}},_detect_single_plugin:function(e){return this.detect=navigator.plugins.length?this._detect_single_plugin_not_ie:this._detect_single_plugin_ie,this.detect(e)},detect_plugins:function(){var e,t="";for(e in SlimStat._plugins)SlimStat._detect_single_plugin(e)&&(t+=e+"|");return t},has_smoothing:function(){if("undefined"!=typeof screen.fontSmoothingEnabled)return Number(screen.fontSmoothingEnabled);if("undefined"!=typeof SlimStatParams.detect_smoothing)return 0;try{var e=document.createElement("canvas");e.width="35",e.height="35",e.style.display="none",document.body.appendChild(e);var t=e.getContext("2d");t.textBaseline="top",t.font="32px Arial",t.fillStyle="black",t.strokeStyle="black",t.fillText("O",0,0);for(var n=8;32>=n;n++)for(var a=1;32>=a;a++){var i=t.getImageData(a,n,1,1).data,r=i[3];if(255!=r&&0!=r)return 1}return 0}catch(o){return 0}},get_page_performance:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},"undefined"==typeof slim_performance.timing?0:slim_performance.timing.loadEventEnd-slim_performance.timing.responseEnd},get_server_latency:function(){return slim_performance=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},"undefined"==typeof slim_performance.timing?0:slim_performance.timing.responseEnd-slim_performance.timing.connectEnd},send_to_server:function(e,t){if("undefined"==typeof SlimStatParams.ajaxurl||"undefined"==typeof e)return"function"==typeof t&&t(),!1;try{window.XMLHttpRequest?request=new XMLHttpRequest:window.ActiveXObject&&(request=new ActiveXObject("Microsoft.XMLHTTP"))}catch(n){return"function"==typeof t&&t(),!1}if(request){var a="action=slimtrack_js&data="+SlimStat._base64_encode(e);return request.open("POST",SlimStatParams.ajaxurl,!0),request.setRequestHeader("Content-type","application/x-www-form-urlencoded"),request.send(a),request.onreadystatechange=function(){4==request.readyState&&("undefined"==typeof SlimStatParams.id?(parsed_id=parseInt(request.responseText),!isNaN(parsed_id)&&parsed_id>0&&(SlimStat._id=request.responseText)):SlimStat._id=SlimStatParams.id,"function"==typeof t&&t())},!0}return!1},ss_track:function(e,t,n,a){if(e||(e=window.event),code="undefined"==typeof t?0:parseInt(t),note_array=[],parsed_id=parseInt(SlimStat._id),isNaN(parsed_id)||parsed_id<=0)return"function"==typeof a&&a(),!1;if(node="undefined"!=typeof e.target?e.target:"undefined"!=typeof e.srcElement?e.srcElement:!1,!node)return"function"==typeof a&&a(),!1;switch(3==node.nodeType&&(node=node.parentNode),parent_node=node.parentNode,node_hostname="",node_pathname=location.pathname,node.nodeName){case"FORM":node.action.length>0&&(node_pathname=escape(node.action));break;case"INPUT":for(;"undefined"!=typeof parent_node&&"FORM"!=parent_node.nodeName&&"BODY"!=parent_node.nodeName;)parent_node=parent_node.parentNode;if("undefined"!=typeof parent_node.action&&parent_node.action.length>0){node_pathname=escape(parent_node.action);break}default:if("A"!=node.nodeName){if("function"==typeof node.getAttribute&&"undefined"!=node.getAttribute("id")&&null!=node.getAttribute("id")&&node.getAttribute("id").length>0){node_pathname=node.getAttribute("id");break}for(;"undefined"!=typeof node.parentNode&&null!=node.parentNode&&"A"!=node.nodeName&&"BODY"!=node.nodeName;)node=node.parentNode}"undefined"!=typeof node.hash&&node.hash.length>0&&node.hostname==location.hostname?node_pathname=escape(node.hash):(node_hostname="undefined"!=typeof node.hostname?node.hostname:"","undefined"!=typeof node.href&&(node_pathname=escape(node.href))),"function"==typeof node.getAttribute&&("undefined"!=node.getAttribute("title")&&null!=node.getAttribute("title")&&node.getAttribute("title").length>0&¬e_array.push("Title:"+node.getAttribute("title")),"undefined"!=node.getAttribute("id")&&null!=node.getAttribute("id")&&node.getAttribute("id").length>0&¬e_array.push("ID:"+node.getAttribute("id")))}slimstat_info="&obd="+node_hostname+"&obr="+node_pathname,pos_x=-1;var i=-1;return"undefined"!=typeof e.pageX&&"undefined"!=typeof e.pageY?(pos_x=e.pageX,i=e.pageY):"undefined"!=typeof e.clientX&&"undefined"!=typeof e.clientY&&"undefined"!=typeof document.body.scrollLeft&&"undefined"!=typeof document.documentElement.scrollLeft&&"undefined"!=typeof document.body.scrollTop&&"undefined"!=typeof document.documentElement.scrollTop&&(pos_x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i=e.clientY+document.body.scrollTop+document.documentElement.scrollTop),pos_x>0&&i>0&&(slimstat_info+=(slimstat_info.length>0?"&":"?")+"po="+pos_x+","+i),note_array.push("Event:"+e.type),"undefined"!=typeof n&&n.length>0&¬e_array.push(n),"click"!=e.type&&"undefined"!=typeof e.which&¬e_array.push("keypress"==e.type?"Key:"+String.fromCharCode(parseInt(e.which)):"Type:"+e.which),SlimStat.send_to_server("id="+SlimStat._id+"&ty="+code+slimstat_info+"&no="+escape(note_array.join(", ")),a),!0},slimstat_plusone:function(e){SlimStat.send_to_server("ty=4&obr="+escape("#google-plus-"+e.state))},add_event:function(e,t,n){e&&e.addEventListener?e.addEventListener(t,n,!1):e&&e.attachEvent?(e["e"+t+n]=n,e[t+n]=function(){e["e"+t+n](window.event)},e.attachEvent("on"+t,e[t+n])):e["on"+t]=e["e"+t+n]},event_fire:function(e,t){var n=e;if(document.createEvent){var a=document.createEvent("MouseEvents");a.initEvent(t,!0,!1),n.dispatchEvent(a)}else if(document.createEventObject){var a=document.createEventObject();n.fireEvent("on"+t,a)}},in_array:function(e,t){for(var n=0;n<t.length;n++)if(t[n].trim()==e)return!0;return!1},in_array_substring:function(e,t){for(var n=0;n<t.length;n++)if(-1!=e.indexOf(t[n].trim()))return!0;return!1}};SlimStat.add_event(window,"load",function(){if("undefined"==typeof SlimStatParams.disable_outbound_tracking){all_links=document.getElementsByTagName("a");for(var e="undefined"!=typeof SlimStatParams.extensions_to_track&&SlimStatParams.extensions_to_track.length>0?SlimStatParams.extensions_to_track.split(","):[],t="undefined"!=typeof SlimStatParams.outbound_classes_rel_href_to_ignore&&SlimStatParams.outbound_classes_rel_href_to_ignore.length>0?SlimStatParams.outbound_classes_rel_href_to_ignore.split(","):[],n="undefined"!=typeof SlimStatParams.outbound_classes_rel_href_to_not_track&&SlimStatParams.outbound_classes_rel_href_to_not_track.length>0?SlimStatParams.outbound_classes_rel_href_to_not_track.split(","):[],a=0;a<all_links.length;a++)!function(){var i=all_links[a];if(i.slimstat_actual_click=!1,i.slimstat_type=!i.href||i.hostname!=location.hostname&&-1!=i.href.indexOf("://")?0:2,i.slimstat_track_me=!0,i.slimstat_callback=!0,e.length>0&&i.pathname.indexOf(".")>0&&i.hostname==location.hostname&&(extension_current_link=i.pathname.split(".").pop().replace(/[\/\-]/g,""),i.slimstat_track_me=SlimStat.in_array(extension_current_link,e),i.slimstat_type=1),!i.slimstat_track_me||2!=i.slimstat_type||"undefined"!=typeof SlimStatParams.track_internal_links&&"false"!=SlimStatParams.track_internal_links||(i.slimstat_track_me=!1),i.slimstat_track_me&&t.length>0){classes_current_link="undefined"!=typeof i.className&&i.className.length>0?i.className.split(" "):[];for(var r=0;r<classes_current_link.length;r++)if(SlimStat.in_array_substring(classes_current_link[r],t)&&(i.slimstat_callback=!1),SlimStat.in_array_substring(classes_current_link[r],n)){i.slimstat_track_me=!1;break}}i.slimstat_track_me&&"undefined"!=typeof i.attributes.rel&&i.attributes.rel.value.length>0&&(SlimStat.in_array_substring(i.attributes.rel.value,t)&&(i.slimstat_callback=!1),SlimStat.in_array_substring(i.attributes.rel.value,n)&&(i.slimstat_track_me=!1)),i.slimstat_track_me&&"undefined"!=typeof i.href&&i.href.length>0&&(SlimStat.in_array_substring(i.href,t)&&(i.slimstat_callback=!1),SlimStat.in_array_substring(i.href,n)&&(i.slimstat_track_me=!1)),i.slimstat_track_me&&i.target&&!i.target.match(/^_(self|parent|top)$/i)&&(i.slimstat_callback=!1),SlimStat.add_event(i,"click",function(e){this.slimstat_track_me&&(this.slimstat_actual_click||(this.slimstat_callback?("function"==typeof e.preventDefault&&e.preventDefault(),this.slimstat_actual_click=!this.slimstat_actual_click,SlimStat.ss_track(e,this.slimstat_type,"",function(){SlimStat.event_fire(i,"click")})):SlimStat.ss_track(e,this.slimstat_type,"",function(){})))})}()}});var current_data="";"undefined"!=typeof SlimStatParams.id&&parseInt(SlimStatParams.id)>0?current_data="id="+SlimStatParams.id:"undefined"!=typeof SlimStatParams.ci&&(current_data="ci="+SlimStatParams.ci+"&ref="+SlimStat._base64_encode(document.referrer)+"&res="+SlimStat._base64_encode(window.location.href)),current_data.length&&SlimStat.add_event(window,"load",function(){setTimeout(function(){SlimStat.send_to_server(current_data+"&sw="+(screen.width||window.innerWidth||document.documentElement.clientWidth||document.body.offsetWidth)+"&sh="+(screen.height||window.innerHeight||document.documentElement.clientHeight||document.body.offsetHeight)+"&cd="+screen.colorDepth+"&aa="+SlimStat.has_smoothing()+"&sl="+SlimStat.get_server_latency()+"&pp="+SlimStat.get_page_performance()+"&pl="+SlimStat.detect_plugins())},0)});
|
wp-slimstat.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Slimstat
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
-
Version: 3.9.
|
7 |
Author: Camu
|
8 |
Author URI: http://slimstat.getused.to.it/
|
9 |
*/
|
@@ -11,7 +11,7 @@ Author URI: http://slimstat.getused.to.it/
|
|
11 |
if (!empty(wp_slimstat::$options)) return true;
|
12 |
|
13 |
class wp_slimstat{
|
14 |
-
public static $version = '3.9.
|
15 |
public static $options = array();
|
16 |
|
17 |
public static $wpdb = '';
|
@@ -376,7 +376,7 @@ class wp_slimstat{
|
|
376 |
self::$browser = self::_get_browser();
|
377 |
|
378 |
// Are we ignoring bots?
|
379 |
-
if (self::$options['javascript_mode'] == 'yes' && self::$browser['type']%2 != 0){
|
380 |
self::$stat['id'] = -211;
|
381 |
return $_argument;
|
382 |
}
|
@@ -412,7 +412,9 @@ class wp_slimstat{
|
|
412 |
self::$stat['ip'] = sprintf("%u", self::$stat['ip']);
|
413 |
|
414 |
// Now let's save this information in the database
|
415 |
-
if (!empty($content_info))
|
|
|
|
|
416 |
self::$stat['browser_id'] = self::maybe_insert_row(self::$browser, $GLOBALS['wpdb']->base_prefix.'slim_browsers', 'browser_id', array('user_agent' => self::$browser['user_agent']));
|
417 |
self::$stat['id'] = self::insert_row(self::$stat, $GLOBALS['wpdb']->prefix.'slim_stats');
|
418 |
|
@@ -978,7 +980,7 @@ class wp_slimstat{
|
|
978 |
|
979 |
return ($_browser['platform'] = 'unknown');
|
980 |
}
|
981 |
-
// end
|
982 |
|
983 |
/**
|
984 |
* Reads the cookie to get the visit_id and sets the variable accordingly
|
@@ -1032,22 +1034,32 @@ class wp_slimstat{
|
|
1032 |
* Stores the information (array) in the appropriate table (if needed) and returns the corresponding ID
|
1033 |
*/
|
1034 |
public static function maybe_insert_row($_data = array(), $_table = '', $_id_column = '', $_not_unique = array()){
|
1035 |
-
if (empty($_data) || empty($_id_column) || empty($_table))
|
|
|
|
|
1036 |
|
1037 |
-
$select_sql = "SELECT $_id_column FROM $_table WHERE ";
|
1038 |
$data = array_diff($_data, $_not_unique);
|
1039 |
-
|
1040 |
-
|
1041 |
}
|
1042 |
-
|
|
|
1043 |
|
1044 |
// Let's see if this row is already in our lookup table
|
1045 |
$id = self::$wpdb->get_var($select_sql);
|
|
|
|
|
|
|
|
|
|
|
|
|
1046 |
if (empty($id)){
|
1047 |
$id = self::insert_row($_data, $_table);
|
1048 |
|
1049 |
// This may happen if the new content type was added just before performing the INSERT here above
|
1050 |
-
if (empty($id))
|
|
|
|
|
1051 |
}
|
1052 |
|
1053 |
return $id;
|
@@ -1058,10 +1070,12 @@ class wp_slimstat{
|
|
1058 |
* Stores the information (array) in the appropriate table and returns the corresponding ID
|
1059 |
*/
|
1060 |
public static function insert_row($_data = array(), $_table = ''){
|
1061 |
-
if (empty($_data) || empty($_table))
|
|
|
|
|
1062 |
|
1063 |
self::$wpdb->query(self::$wpdb->prepare("
|
1064 |
-
INSERT IGNORE INTO $_table (".implode("
|
1065 |
VALUES ('.substr(str_repeat('%s,', count($_data)), 0, -1).")", $_data));
|
1066 |
|
1067 |
return intval(self::$wpdb->insert_id);
|
@@ -1090,7 +1104,7 @@ class wp_slimstat{
|
|
1090 |
|
1091 |
$options = array(
|
1092 |
'version' => self::$version,
|
1093 |
-
'secret' =>
|
1094 |
'show_admin_notice' => 0,
|
1095 |
|
1096 |
// General
|
@@ -1126,18 +1140,15 @@ class wp_slimstat{
|
|
1126 |
'ignore_ip' => '',
|
1127 |
'ignore_capabilities' => '',
|
1128 |
'ignore_spammers' => $val_yes,
|
|
|
1129 |
'ignore_resources' => '',
|
1130 |
'ignore_countries' => '',
|
1131 |
'ignore_browsers' => '',
|
1132 |
'ignore_referers' => '',
|
1133 |
'enable_outbound_tracking' => $val_yes,
|
1134 |
'track_internal_links' => $val_no,
|
1135 |
-
'
|
1136 |
-
'
|
1137 |
-
'ignore_outbound_href' => '',
|
1138 |
-
'do_not_track_outbound_classes' => 'noslimstat,ab-item',
|
1139 |
-
'do_not_track_outbound_rel' => '',
|
1140 |
-
'do_not_track_outbound_href' => '',
|
1141 |
'anonymize_ip' => $val_no,
|
1142 |
'ignore_prefetch' => $val_yes,
|
1143 |
|
@@ -1257,10 +1268,10 @@ class wp_slimstat{
|
|
1257 |
public static function wp_slimstat_enqueue_tracking_script(){
|
1258 |
if (self::$options['enable_cdn'] == 'yes'){
|
1259 |
$schema = is_ssl()?'https':'http';
|
1260 |
-
wp_register_script('wp_slimstat', $schema.'://cdn.jsdelivr.net/wp/wp-slimstat/trunk/wp-slimstat.js', array(), null, true);
|
1261 |
}
|
1262 |
else{
|
1263 |
-
wp_register_script('wp_slimstat', plugins_url('/wp-slimstat.js', __FILE__), array(), null, true);
|
1264 |
}
|
1265 |
|
1266 |
// Pass some information to Javascript
|
@@ -1287,23 +1298,11 @@ class wp_slimstat{
|
|
1287 |
if (self::$options['enable_javascript'] == 'yes' && self::$options['detect_smoothing'] == 'no'){
|
1288 |
$params['detect_smoothing'] = 'false';
|
1289 |
}
|
1290 |
-
if (!empty(self::$options['
|
1291 |
-
$params['
|
1292 |
-
}
|
1293 |
-
if (!empty(self::$options['ignore_outbound_rel'])){
|
1294 |
-
$params['outbound_rel_to_ignore'] = trim(self::$options['ignore_outbound_rel']);
|
1295 |
-
}
|
1296 |
-
if (!empty(self::$options['ignore_outbound_href'])){
|
1297 |
-
$params['outbound_href_to_ignore'] = trim(self::$options['ignore_outbound_href']);
|
1298 |
-
}
|
1299 |
-
if (!empty(self::$options['do_not_track_outbound_classes'])){
|
1300 |
-
$params['outbound_classes_to_not_track'] = str_replace(' ', '', self::$options['do_not_track_outbound_classes']);
|
1301 |
-
}
|
1302 |
-
if (!empty(self::$options['do_not_track_outbound_rel'])){
|
1303 |
-
$params['outbound_rel_to_not_track'] = trim(self::$options['do_not_track_outbound_rel']);
|
1304 |
}
|
1305 |
-
if (!empty(self::$options['
|
1306 |
-
$params['
|
1307 |
}
|
1308 |
|
1309 |
$params = apply_filters('slimstat_js_params', $params);
|
3 |
Plugin Name: WP Slimstat
|
4 |
Plugin URI: http://wordpress.org/plugins/wp-slimstat/
|
5 |
Description: The leading web analytics plugin for WordPress
|
6 |
+
Version: 3.9.6
|
7 |
Author: Camu
|
8 |
Author URI: http://slimstat.getused.to.it/
|
9 |
*/
|
11 |
if (!empty(wp_slimstat::$options)) return true;
|
12 |
|
13 |
class wp_slimstat{
|
14 |
+
public static $version = '3.9.6';
|
15 |
public static $options = array();
|
16 |
|
17 |
public static $wpdb = '';
|
376 |
self::$browser = self::_get_browser();
|
377 |
|
378 |
// Are we ignoring bots?
|
379 |
+
if ((self::$options['javascript_mode'] == 'yes' || self::$options['ignore_bots'] == 'yes') && self::$browser['type']%2 != 0){
|
380 |
self::$stat['id'] = -211;
|
381 |
return $_argument;
|
382 |
}
|
412 |
self::$stat['ip'] = sprintf("%u", self::$stat['ip']);
|
413 |
|
414 |
// Now let's save this information in the database
|
415 |
+
if (!empty($content_info)){
|
416 |
+
self::$stat['content_info_id'] = self::maybe_insert_row($content_info, $GLOBALS['wpdb']->base_prefix.'slim_content_info', 'content_info_id', array());
|
417 |
+
}
|
418 |
self::$stat['browser_id'] = self::maybe_insert_row(self::$browser, $GLOBALS['wpdb']->base_prefix.'slim_browsers', 'browser_id', array('user_agent' => self::$browser['user_agent']));
|
419 |
self::$stat['id'] = self::insert_row(self::$stat, $GLOBALS['wpdb']->prefix.'slim_stats');
|
420 |
|
980 |
|
981 |
return ($_browser['platform'] = 'unknown');
|
982 |
}
|
983 |
+
// end _get_os_version
|
984 |
|
985 |
/**
|
986 |
* Reads the cookie to get the visit_id and sets the variable accordingly
|
1034 |
* Stores the information (array) in the appropriate table (if needed) and returns the corresponding ID
|
1035 |
*/
|
1036 |
public static function maybe_insert_row($_data = array(), $_table = '', $_id_column = '', $_not_unique = array()){
|
1037 |
+
if (empty($_data) || empty($_id_column) || empty($_table)){
|
1038 |
+
return -1;
|
1039 |
+
}
|
1040 |
|
|
|
1041 |
$data = array_diff($_data, $_not_unique);
|
1042 |
+
if (empty($data)){
|
1043 |
+
return -1;
|
1044 |
}
|
1045 |
+
|
1046 |
+
$select_sql = "SELECT $_id_column FROM $_table WHERE `".self::$wpdb->prepare(implode('` = %s AND `', array_keys($data)).'` = %s', $data);
|
1047 |
|
1048 |
// Let's see if this row is already in our lookup table
|
1049 |
$id = self::$wpdb->get_var($select_sql);
|
1050 |
+
|
1051 |
+
// Something went wrong while trying to determine the ID of this entry in one of the lookup tables
|
1052 |
+
if (!empty(self::$wpdb->last_error)){
|
1053 |
+
return -1;
|
1054 |
+
}
|
1055 |
+
|
1056 |
if (empty($id)){
|
1057 |
$id = self::insert_row($_data, $_table);
|
1058 |
|
1059 |
// This may happen if the new content type was added just before performing the INSERT here above
|
1060 |
+
if (empty($id)){
|
1061 |
+
$id = intval(self::$wpdb->get_var($select_sql));
|
1062 |
+
}
|
1063 |
}
|
1064 |
|
1065 |
return $id;
|
1070 |
* Stores the information (array) in the appropriate table and returns the corresponding ID
|
1071 |
*/
|
1072 |
public static function insert_row($_data = array(), $_table = ''){
|
1073 |
+
if (empty($_data) || empty($_table)){
|
1074 |
+
return -1;
|
1075 |
+
}
|
1076 |
|
1077 |
self::$wpdb->query(self::$wpdb->prepare("
|
1078 |
+
INSERT IGNORE INTO $_table (`".implode("`, `", array_keys($_data)).'`)
|
1079 |
VALUES ('.substr(str_repeat('%s,', count($_data)), 0, -1).")", $_data));
|
1080 |
|
1081 |
return intval(self::$wpdb->insert_id);
|
1104 |
|
1105 |
$options = array(
|
1106 |
'version' => self::$version,
|
1107 |
+
'secret' => wp_hash(uniqid(time(), true)),
|
1108 |
'show_admin_notice' => 0,
|
1109 |
|
1110 |
// General
|
1140 |
'ignore_ip' => '',
|
1141 |
'ignore_capabilities' => '',
|
1142 |
'ignore_spammers' => $val_yes,
|
1143 |
+
'ignore_bots' => $val_no,
|
1144 |
'ignore_resources' => '',
|
1145 |
'ignore_countries' => '',
|
1146 |
'ignore_browsers' => '',
|
1147 |
'ignore_referers' => '',
|
1148 |
'enable_outbound_tracking' => $val_yes,
|
1149 |
'track_internal_links' => $val_no,
|
1150 |
+
'ignore_outbound_classes_rel_href' => '',
|
1151 |
+
'do_not_track_outbound_classes_rel_href' => 'noslimstat,ab-item',
|
|
|
|
|
|
|
|
|
1152 |
'anonymize_ip' => $val_no,
|
1153 |
'ignore_prefetch' => $val_yes,
|
1154 |
|
1268 |
public static function wp_slimstat_enqueue_tracking_script(){
|
1269 |
if (self::$options['enable_cdn'] == 'yes'){
|
1270 |
$schema = is_ssl()?'https':'http';
|
1271 |
+
wp_register_script('wp_slimstat', $schema.'://cdn.jsdelivr.net/wp/wp-slimstat/trunk/wp-slimstat.min.js', array(), null, true);
|
1272 |
}
|
1273 |
else{
|
1274 |
+
wp_register_script('wp_slimstat', plugins_url('/wp-slimstat.min.js', __FILE__), array(), null, true);
|
1275 |
}
|
1276 |
|
1277 |
// Pass some information to Javascript
|
1298 |
if (self::$options['enable_javascript'] == 'yes' && self::$options['detect_smoothing'] == 'no'){
|
1299 |
$params['detect_smoothing'] = 'false';
|
1300 |
}
|
1301 |
+
if (!empty(self::$options['ignore_outbound_classes_rel_href'])){
|
1302 |
+
$params['outbound_classes_rel_href_to_ignore'] = str_replace(' ', '', self::$options['ignore_outbound_classes_rel_href']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1303 |
}
|
1304 |
+
if (!empty(self::$options['do_not_track_outbound_classes_rel_href'])){
|
1305 |
+
$params['outbound_classes_rel_href_to_not_track'] = str_replace(' ', '', self::$options['do_not_track_outbound_classes_rel_href']);
|
1306 |
}
|
1307 |
|
1308 |
$params = apply_filters('slimstat_js_params', $params);
|