Version Description
- [New] We increased the filter granularity to the minute, so that now you can see who visited your website between 9 am and 10.34 am (thank you, berserk77)
- [New] If admin is served over HTTPS but IP lookup service is not, don't use inline overlay dialog (thank you, 509tyler)
- [Update] Javascript libraries: qTip v2.2.1 and SlimScroll 1.3.3
- [Fix] Outbound links from within the admin were not tracked as expected (thank you mobilemindtech)
- [Fix] Firewall Fix add-on was not tracking the originating ip's country as expected (thank you, JeanLuc)
Download this release
Release Info
Developer | coolmann |
Plugin | Slimstat Analytics |
Version | 3.8 |
Comparing to | |
See all releases |
Code changes from version 3.7.5 to 3.8
- admin/config/index.php +2 -1
- admin/css/slimstat.css +5 -2
- admin/js/slimstat.admin.js +15 -6
- admin/view/index.php +31 -15
- admin/view/right-now.php +1 -1
- admin/view/wp-slimstat-db.php +54 -40
- admin/view/wp-slimstat-reports.php +12 -16
- admin/wp-slimstat-admin.php +3 -1
- readme.txt +9 -2
- wp-slimstat.js +1 -1
- wp-slimstat.php +8 -6
admin/config/index.php
CHANGED
@@ -50,7 +50,8 @@ switch ($config_tabs[$current_tab-1]){
|
|
50 |
'show_display_name' => array('description' => __('Show Display Name','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('By default, users are listed by their usernames. Use this option to visualize their display names instead.','wp-slimstat')),
|
51 |
'show_complete_user_agent_tooltip' => array('description' => __('Show User Agent','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to see the browser name or a complete user agent string when hovering on browser icons.','wp-slimstat')),
|
52 |
'convert_resource_urls_to_titles' => array('description' => __('Show Titles','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Slimstat converts your permalinks into post and page titles. Disable this feature if you need to see the URL in your reports.','wp-slimstat')),
|
53 |
-
'
|
|
|
54 |
|
55 |
'views_functionality_header' => array('description' => __('Functionality','wp-slimstat'), 'type' => 'section_header'),
|
56 |
'async_load' => array('description' => __('Asynchronous Views','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Load all the reports dynamically. It makes the reports render faster, but it increases the load on your server.','wp-slimstat')),
|
50 |
'show_display_name' => array('description' => __('Show Display Name','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('By default, users are listed by their usernames. Use this option to visualize their display names instead.','wp-slimstat')),
|
51 |
'show_complete_user_agent_tooltip' => array('description' => __('Show User Agent','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to see the browser name or a complete user agent string when hovering on browser icons.','wp-slimstat')),
|
52 |
'convert_resource_urls_to_titles' => array('description' => __('Show Titles','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Slimstat converts your permalinks into post and page titles. Disable this feature if you need to see the URL in your reports.','wp-slimstat')),
|
53 |
+
'date_format' => array('description' => __('Date Format','wp-slimstat'), 'type' => 'text', 'long_description' => __("<a href='http://php.net/manual/en/function.date.php' target='_blank'>PHP Format</a> to use when displaying a pageview's date.",'wp-slimstat')),
|
54 |
+
'time_format' => array('description' => __('Time Format','wp-slimstat'), 'type' => 'text', 'long_description' => __("<a href='http://php.net/manual/en/function.date.php' target='_blank'>PHP Format</a> to use when displaying a pageview's time.",'wp-slimstat')),
|
55 |
|
56 |
'views_functionality_header' => array('description' => __('Functionality','wp-slimstat'), 'type' => 'section_header'),
|
57 |
'async_load' => array('description' => __('Asynchronous Views','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Load all the reports dynamically. It makes the reports render faster, but it increases the load on your server.','wp-slimstat')),
|
admin/css/slimstat.css
CHANGED
@@ -63,7 +63,7 @@
|
|
63 |
position: absolute;
|
64 |
right: 0;
|
65 |
top: 30px;
|
66 |
-
width:
|
67 |
z-index: 120;
|
68 |
}
|
69 |
#slimstat-date-filters span a.slimstat-date-choice{
|
@@ -83,7 +83,10 @@
|
|
83 |
}
|
84 |
#slimstat-date-filters span select, #slimstat-date-filters span input{
|
85 |
margin-bottom: 5px;
|
86 |
-
width:
|
|
|
|
|
|
|
87 |
}
|
88 |
#slimstat-date-filters span .ui-datepicker-trigger{
|
89 |
float: right;
|
63 |
position: absolute;
|
64 |
right: 0;
|
65 |
top: 30px;
|
66 |
+
width: 450px;
|
67 |
z-index: 120;
|
68 |
}
|
69 |
#slimstat-date-filters span a.slimstat-date-choice{
|
83 |
}
|
84 |
#slimstat-date-filters span select, #slimstat-date-filters span input{
|
85 |
margin-bottom: 5px;
|
86 |
+
width: 80px;
|
87 |
+
}
|
88 |
+
#slimstat-date-filters span select.short, #slimstat-date-filters span input.short{
|
89 |
+
width: 50px;
|
90 |
}
|
91 |
#slimstat-date-filters span .ui-datepicker-trigger{
|
92 |
float: right;
|
admin/js/slimstat.admin.js
CHANGED
@@ -164,7 +164,6 @@ var SlimStatAdmin = {
|
|
164 |
if (filters_to_add[i].indexOf('fs\%5B') != 0) continue;
|
165 |
|
166 |
filter_components = filters_to_add[i].split('=');
|
167 |
-
|
168 |
filter_components[0] = decodeURIComponent(filter_components[0]);
|
169 |
jQuery('input[name="'+filter_components[0]+'"]').remove();
|
170 |
|
@@ -174,8 +173,10 @@ var SlimStatAdmin = {
|
|
174 |
},
|
175 |
|
176 |
add_filters_to_form: function(filters_parsed){
|
|
|
177 |
for (i in filters_parsed){
|
178 |
-
|
|
|
179 |
jQuery('<input>').attr('type', 'hidden').attr('name', i).attr('class', 'slimstat-post-filter slimstat-temp-filter '+filters_parsed[i][0]).val(filters_parsed[i][1]).appendTo('#slimstat-filters-form');
|
180 |
}
|
181 |
else{
|
@@ -335,6 +336,7 @@ jQuery(function(){
|
|
335 |
}
|
336 |
|
337 |
filters_parsed = SlimStatAdmin.parse_url_filters('p0', jQuery(this).attr('href'));
|
|
|
338 |
SlimStatAdmin.add_filters_to_form(filters_parsed);
|
339 |
|
340 |
jQuery('#slimstat-filters-form').submit();
|
@@ -477,6 +479,13 @@ jQuery(function(){
|
|
477 |
// Modal Window / Whois
|
478 |
jQuery(document).on('click', '.whois', function(e){
|
479 |
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
jQuery('#slimstat-modal-dialog').dialog({
|
481 |
dialogClass: 'slimstat',
|
482 |
title: jQuery(this).attr('title')
|
@@ -509,11 +518,11 @@ jQuery(function(){
|
|
509 |
jQuery('h3.hndle').on('click', function(){ jQuery(this).parent().toggleClass('closed') });
|
510 |
});
|
511 |
|
512 |
-
/* SlimScroll v1.3.
|
513 |
-
(function(
|
514 |
|
515 |
-
/* qTip2 v2.2.
|
516 |
-
!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=A,this.elements={target:a},this._id=N+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:z,attr:e,onTooltip:z,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=z}function f(a){return a===A||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?z:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?z:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==z,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,A,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||z)&&(b.title=z))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===y?{ready:y}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(M,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return Q.concat("").join(a?"-"+a+" ":" ")}function l(c){return c&&{type:c.type,pageX:c.pageX,pageY:c.pageY,target:c.target,relatedTarget:c.relatedTarget,scrollX:c.scrollX||a.pageXOffset||b.body.scrollLeft||b.documentElement.scrollLeft,scrollY:c.scrollY||a.pageYOffset||b.body.scrollTop||b.documentElement.scrollTop}||{}}function m(a,b){return b>0?setTimeout(d.proxy(a,this),b):(a.call(this),void 0)}function n(a){return this.tooltip.hasClass(X)?z:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=m.call(this,function(){this.toggle(y,a)},this.options.show.delay),void 0)}function o(a){if(this.tooltip.hasClass(X))return z;var b=d(a.relatedTarget),c=b.closest(R)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(z,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(X)||!this.options.hide.inactive?z:(clearTimeout(this.timers.inactive),this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive),void 0)}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join(cb+" "))+cb,function(){var a=t.api[d.attr(this,P)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):A,p="html5"===f.metadata.type&&o?o[f.metadata.name]:A,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(y,{},t.defaults,f,"object"==typeof q?h(q):A,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===z||!j)return z;k.content.text=j}if(i.container.length||(i.container=m),i.target===z&&(i.target=n),k.show.target===z&&(k.show.target=n),k.show.solo===y&&(k.show.solo=i.container.closest("body")),k.hide.target===z&&(k.hide.target=n),k.position.viewport===y&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new v(i.at,y),i.my=new v(i.my),a.data(N))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===z)return z;return a.attr(O,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(Z,l).attr("title",""),g=new e(a,k,c,!!j),a.data(N,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(N))&&a.destroy(!0)}),g}var t,u,v,w,x,y=!0,z=!1,A=null,B="x",C="y",D="width",E="height",F="top",G="left",H="bottom",I="right",J="center",K="flipinvert",L="shift",M={},N="qtip",O="data-hasqtip",P="data-qtip-id",Q=["ui-widget","ui-tooltip"],R="."+N,S="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),T=N+"-fixed",U=N+"-default",V=N+"-focus",W=N+"-hover",X=N+"-disabled",Y="_replacedByqTip",Z="oldtitle",$={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||z};u=e.prototype,u._when=function(a){return d.when.apply(d,a)},u.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[N,U,e.style.classes,N+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":z,"aria-describedby":this._id+"-content","aria-hidden":y}).toggleClass(X,this.disabled).attr(P,this.id).data(N,this).appendTo(k.container).append(g.content=d("<div />",{"class":N+"-content",id:this._id+"-content","aria-atomic":y})),this.rendered=-1,this.positioning=y,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,z))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,z)),this.rendered=y,this._setWidget(),d.each(M,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=z,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(y,f.event,z),c.hiddenDuringWait=z}),t.api[this.id]=this,this},u.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=y;var a=this.target,b=a.attr(Z);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(N).removeAttr(P).removeAttr(O).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(Z),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=A,delete t.api[this.id]}}return this.destroyed?this.target:(a===y&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},w=u.checks={builtin:{"^id$":function(a,b,c,e){var f=c===y?t.nextid:c,g=N+"-"+f;f!==z&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),this._updateTitle(c),void 0):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new v(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(y)||this.toggle(y))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(U,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},u.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var _=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,ab=/^prerender|show\.ready/i;u.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=z,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&ab.test(b))return delete a[b],void 0;var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=_.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=y,d.each(a,d.proxy(j,this)),this.positioning=z,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?A:this.cache.event),this},u._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=y,a.then(function(a){return e.waiting=z,c._update(a,b)},A,function(a){return c._update(a,b)})):a===z||!a&&""!==a?z:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):z},u._waitForContent=function(a){var b=this.cache;return b.waiting=y,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=z}).promise()},u._updateContent=function(a,b){this._update(a,this.elements.content,b)},u._updateTitle=function(a,b){this._update(a,this.elements.title,b)===z&&this._removeTitle(z)},u._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":N+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":N+"-title","aria-atomic":y})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},u._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=A,a!==z&&this.reposition())},u.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=y;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(z),s=i.outerHeight(z),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=o[0].ownerDocument,D=this.mouse;if(d.isArray(k)&&2===k.length)m={x:G,y:F},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:G,y:F},!D||!D.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=D,"static"!==v&&(w=o.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&A&&D&&(w.left-=(D.scrollX||0)-B.scrollLeft(),w.top-=(D.scrollY||0)-B.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=$.iOS?a.innerWidth:k.width(),u=$.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):M.imagemap&&k.is("area")?f=M.imagemap(this,k,m,M.viewport?q:z):M.svg&&k&&k[0].ownerSVGElement?f=M.svg(this,k,m,M.viewport?q:z):(t=k.outerWidth(z),u=k.outerHeight(z),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),($.iOS>3.1&&$.iOS<4.1||$.iOS>=4.3&&$.iOS<4.33||!$.iOS&&"fixed"===v)&&(w.left-=B.scrollLeft(),w.top-=B.scrollTop()),(!f||f&&f.adjustable!==z)&&(w.left+=m.x===I?t:m.x===J?t/2:0,w.top+=m.y===H?u:m.y===J?u/2:0)}return w.left+=p.x+(l.x===I?-r:l.x===J?-r/2:0),w.top+=p.y+(l.y===H?-s:l.y===J?-s/2:0),M.viewport?(w.adjusted=M.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===z||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),$.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=z,this):this},u.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!$.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var bb=(v=u.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,J).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?C:B}).prototype;bb.invert=function(a,b){this[a]=this[a]===G?I:this[a]===I?G:b||this[a]},bb.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===C||this.forceY&&"center"!==b?b+" "+a:a+" "+b},bb.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},bb.clone=function(){return new v(this.string(),this.forceY)},u.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=y),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?A:!!this._trigger(k,[90]),this.destroyed?this:(i!==z&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,z),d.isFunction(o.title)&&this._updateTitle(o.title,z),!x&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+N,this._storeMouse),x=y),p||g.css("width",g.outerWidth(z)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(R,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,x&&!d(R+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+N),x=z),this.blur(c)),j=d.proxy(function(){a?($.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===z||r===z?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},u.show=function(a){return this.toggle(y,a)},u.hide=function(a){return this.toggle(z,a)},u.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(R),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=t.zindex+b.length;return c.hasClass(V)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+V).qtip("blur",a)),c.addClass(V)[0].style.zIndex=f),this},u.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(V),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},u.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(X):this.disabled):"boolean"!=typeof a&&(a=y),this.rendered&&this.tooltip.toggleClass(X,a).attr("aria-disabled",a),this.disabled=!!a,this)},u.enable=function(){return this.disable(z)},u._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":N+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(X)||a.hide(b),z})},u._updateButton=function(a){if(!this.rendered)return z;var b=this.elements.button;a?this._createButton():b.remove()},u._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(X);c.removeClass(X),X=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(X,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(U,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(N+"-icon",!a)},u._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},u._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},u._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var cb="."+N;d(function(){r(R,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(T)&&!c.hasClass(X)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(W,b)}),r("["+P+"]",S,p)}),u._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||A,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=z,!e.isDefaultPrevented()},u._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?(h.push(a.splice(c,1)[0]),void 0):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},u._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?z:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay),void 0)}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=y}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},u._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(T)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(X)&&this.tooltip[0].offsetWidth>0,e=b.parents(R).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),t.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(X)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},u._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},t=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=A,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],N):A;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,N);if(!a)return y;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),z;a.set(b,e)}}),g!==A?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(y,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===z||c.length<1||t.api[c]?t.nextid++:c,b=s(d(this),c,k),b===z?y:(t.api[c]=b,d.each(M,function(){"initialize"===this.initialize&&this(b)}),b._assignInitialEvents(j),void 0)}))},d.qtip=e,t.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,Z):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(Z,b))}return d.fn["attr"+Y].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+Y].apply(this,arguments));return a||b.filter("["+Z+"]").attr("title",function(){return d.attr(this,Z)}).removeAttr(Z),b}},function(a,b){if(!b||d.fn[a+Y])return y;var c=d.fn[a+Y]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+Y]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(O))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+Y].apply(this,arguments)}),t.version="2.2.0",t.nextid=0,t.inactiveEvents=S,t.zindex=15e3,t.defaults={prerender:z,id:z,overwrite:y,suppress:y,content:{text:y,attr:"title",title:z,button:z},position:{my:"top left",at:"bottom right",target:z,container:z,viewport:z,adjust:{x:0,y:0,mouse:y,scroll:y,resize:y,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:z})}},show:{target:z,event:"mouseenter",effect:y,delay:90,solo:z,ready:z,autofocus:z},hide:{target:z,event:"mouseleave",effect:y,delay:0,fixed:z,inactive:z,leave:"window",distance:z},style:{classes:"",widget:z,width:z,height:z,def:y},events:{render:A,move:A,show:A,hide:A,toggle:A,visible:A,hidden:A,focus:A,blur:A}},M.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],m=v[a],t=w[a],u=c===L,x=m===f?j:m===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=r[f]+s[f]-(o?0:n[f]),A=z-k,B=k+j-(h===D?p:q)-z,C=x-(v.precedance===a||m===v[b]?y:0)-(t===J?i/2:0);return u?(C=(m===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-n[f]+s[f],k-C,Math.min(Math.max(-n[f]+s[f]+(h===D?p:q),k+C),d[f],"center"===m?k-x:1e9))):(e*=c===K?2:0,A>0&&(m!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(m!==g||A>0)&&(d[f]-=(m===J?-C:C)+e,l.invert(a,g)),d[f]<r&&-d[f]>B&&(d[f]=k,l=v.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s,t=e.target,u=c.elements.tooltip,v=e.my,w=e.at,x=e.adjust,y=x.method.split(" "),A=y[0],M=y[1]||y[0],O=e.viewport,P=e.container,Q=c.cache,R={left:0,top:0};return O.jquery&&t[0]!==a&&t[0]!==b.body&&"none"!==x.method?(n=P.offset()||R,o="static"===P.css("position"),k="fixed"===u.css("position"),p=O[0]===a?O.width():O.outerWidth(z),q=O[0]===a?O.height():O.outerHeight(z),r={left:k?0:O.scrollLeft(),top:k?0:O.scrollTop()},s=O.offset()||R,("shift"!==A||"shift"!==M)&&(l=v.clone()),R={left:"none"!==A?j(B,C,A,x.x,G,I,D,f,h):0,top:"none"!==M?j(C,B,M,x.y,F,H,E,g,i):0},l&&Q.lastClass!==(m=N+"-pos-"+l.abbrev())&&u.removeClass(c.cache.lastClass).addClass(c.cache.lastClass=m),R):R}})}(window,document);
|
517 |
|
518 |
/* flot v0.8.2 | https://github.com/flot/flot | Copyright (c) 2007-2013 IOLA and Ole Laursen. Licensed under the MIT license. */
|
519 |
(function(e){e.color={};e.color.make=function(t,n,r,i){var s={};s.r=t||0;s.g=n||0;s.b=r||0;s.a=i!=null?i:1;s.add=function(e,t){for(var n=0;n<e.length;++n)s[e.charAt(n)]+=t;return s.normalize()};s.scale=function(e,t){for(var n=0;n<e.length;++n)s[e.charAt(n)]*=t;return s.normalize()};s.toString=function(){if(s.a>=1){return"rgb("+[s.r,s.g,s.b].join(",")+")"}else{return"rgba("+[s.r,s.g,s.b,s.a].join(",")+")"}};s.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}s.r=e(0,parseInt(s.r),255);s.g=e(0,parseInt(s.g),255);s.b=e(0,parseInt(s.b),255);s.a=e(0,s.a,1);return s};s.clone=function(){return e.color.make(s.r,s.b,s.g,s.a)};return s.normalize()};e.color.extract=function(t,n){var r;do{r=t.css(n).toLowerCase();if(r!=""&&r!="transparent")break;t=t.parent()}while(t.length&&!e.nodeName(t.get(0),"body"));if(r=="rgba(0, 0, 0, 0)")r="transparent";return e.color.parse(r)};e.color.parse=function(n){var r,i=e.color.make;if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return i(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))return i(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));var s=e.trim(n).toLowerCase();if(s=="transparent")return i(255,255,255,0);else{r=t[s]||[0,0,0];return i(r[0],r[1],r[2])}};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(e){function n(t,n){var r=n.children("."+t)[0];if(r==null){r=document.createElement("canvas");r.className=t;e(r).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(n);if(!r.getContext){if(window.G_vmlCanvasManager){r=window.G_vmlCanvasManager.initElement(r)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=r;var i=this.context=r.getContext("2d");var s=window.devicePixelRatio||1,o=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1;this.pixelRatio=s/o;this.resize(n.width(),n.height());this.textContainer=null;this.text={};this._textCache={}}function r(t,r,s,o){function E(e,t){t=[w].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function S(){var t={Canvas:n};for(var r=0;r<o.length;++r){var i=o[r];i.init(w,t);if(i.options)e.extend(true,a,i.options)}}function x(n){e.extend(true,a,n);if(n&&n.colors){a.colors=n.colors}if(a.xaxis.color==null)a.xaxis.color=e.color.parse(a.grid.color).scale("a",.22).toString();if(a.yaxis.color==null)a.yaxis.color=e.color.parse(a.grid.color).scale("a",.22).toString();if(a.xaxis.tickColor==null)a.xaxis.tickColor=a.grid.tickColor||a.xaxis.color;if(a.yaxis.tickColor==null)a.yaxis.tickColor=a.grid.tickColor||a.yaxis.color;if(a.grid.borderColor==null)a.grid.borderColor=a.grid.color;if(a.grid.tickColor==null)a.grid.tickColor=e.color.parse(a.grid.color).scale("a",.22).toString();var r,i,s,o=t.css("font-size"),u=o?+o.replace("px",""):13,f={style:t.css("font-style"),size:Math.round(.8*u),variant:t.css("font-variant"),weight:t.css("font-weight"),family:t.css("font-family")};s=a.xaxes.length||1;for(r=0;r<s;++r){i=a.xaxes[r];if(i&&!i.tickColor){i.tickColor=i.color}i=e.extend(true,{},a.xaxis,i);a.xaxes[r]=i;if(i.font){i.font=e.extend({},f,i.font);if(!i.font.color){i.font.color=i.color}if(!i.font.lineHeight){i.font.lineHeight=Math.round(i.font.size*1.15)}}}s=a.yaxes.length||1;for(r=0;r<s;++r){i=a.yaxes[r];if(i&&!i.tickColor){i.tickColor=i.color}i=e.extend(true,{},a.yaxis,i);a.yaxes[r]=i;if(i.font){i.font=e.extend({},f,i.font);if(!i.font.color){i.font.color=i.color}if(!i.font.lineHeight){i.font.lineHeight=Math.round(i.font.size*1.15)}}}if(a.xaxis.noTicks&&a.xaxis.ticks==null)a.xaxis.ticks=a.xaxis.noTicks;if(a.yaxis.noTicks&&a.yaxis.ticks==null)a.yaxis.ticks=a.yaxis.noTicks;if(a.x2axis){a.xaxes[1]=e.extend(true,{},a.xaxis,a.x2axis);a.xaxes[1].position="top"}if(a.y2axis){a.yaxes[1]=e.extend(true,{},a.yaxis,a.y2axis);a.yaxes[1].position="right"}if(a.grid.coloredAreas)a.grid.markings=a.grid.coloredAreas;if(a.grid.coloredAreasColor)a.grid.markingsColor=a.grid.coloredAreasColor;if(a.lines)e.extend(true,a.series.lines,a.lines);if(a.points)e.extend(true,a.series.points,a.points);if(a.bars)e.extend(true,a.series.bars,a.bars);if(a.shadowSize!=null)a.series.shadowSize=a.shadowSize;if(a.highlightColor!=null)a.series.highlightColor=a.highlightColor;for(r=0;r<a.xaxes.length;++r)O(d,r+1).options=a.xaxes[r];for(r=0;r<a.yaxes.length;++r)O(v,r+1).options=a.yaxes[r];for(var l in b)if(a.hooks[l]&&a.hooks[l].length)b[l]=b[l].concat(a.hooks[l]);E(b.processOptions,[a])}function T(e){u=N(e);M();_()}function N(t){var n=[];for(var r=0;r<t.length;++r){var i=e.extend(true,{},a.series);if(t[r].data!=null){i.data=t[r].data;delete t[r].data;e.extend(true,i,t[r]);t[r].data=i.data}else i.data=t[r];n.push(i)}return n}function C(e,t){var n=e[t+"axis"];if(typeof n=="object")n=n.n;if(typeof n!="number")n=1;return n}function k(){return e.grep(d.concat(v),function(e){return e})}function L(e){var t={},n,r;for(n=0;n<d.length;++n){r=d[n];if(r&&r.used)t["x"+r.n]=r.c2p(e.left)}for(n=0;n<v.length;++n){r=v[n];if(r&&r.used)t["y"+r.n]=r.c2p(e.top)}if(t.x1!==undefined)t.x=t.x1;if(t.y1!==undefined)t.y=t.y1;return t}function A(e){var t={},n,r,i;for(n=0;n<d.length;++n){r=d[n];if(r&&r.used){i="x"+r.n;if(e[i]==null&&r.n==1)i="x";if(e[i]!=null){t.left=r.p2c(e[i]);break}}}for(n=0;n<v.length;++n){r=v[n];if(r&&r.used){i="y"+r.n;if(e[i]==null&&r.n==1)i="y";if(e[i]!=null){t.top=r.p2c(e[i]);break}}}return t}function O(t,n){if(!t[n-1])t[n-1]={n:n,direction:t==d?"x":"y",options:e.extend(true,{},t==d?a.xaxis:a.yaxis)};return t[n-1]}function M(){var t=u.length,n=-1,r;for(r=0;r<u.length;++r){var i=u[r].color;if(i!=null){t--;if(typeof i=="number"&&i>n){n=i}}}if(t<=n){t=n+1}var s,o=[],f=a.colors,l=f.length,c=0;for(r=0;r<t;r++){s=e.color.parse(f[r%l]||"#666");if(r%l==0&&r){if(c>=0){if(c<.5){c=-c-.2}else c=0}else c=-c}o[r]=s.scale("rgb",1+c)}var h=0,p;for(r=0;r<u.length;++r){p=u[r];if(p.color==null){p.color=o[h].toString();++h}else if(typeof p.color=="number")p.color=o[p.color].toString();if(p.lines.show==null){var m,g=true;for(m in p)if(p[m]&&p[m].show){g=false;break}if(g)p.lines.show=true}if(p.lines.zero==null){p.lines.zero=!!p.lines.fill}p.xaxis=O(d,C(p,"x"));p.yaxis=O(v,C(p,"y"))}}function _(){function x(e,t,n){if(t<e.datamin&&t!=-r)e.datamin=t;if(n>e.datamax&&n!=r)e.datamax=n}var t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.MAX_VALUE,i,s,o,a,f,l,c,h,p,d,v,m,g,y,w,S;e.each(k(),function(e,r){r.datamin=t;r.datamax=n;r.used=false});for(i=0;i<u.length;++i){l=u[i];l.datapoints={points:[]};E(b.processRawData,[l,l.data,l.datapoints])}for(i=0;i<u.length;++i){l=u[i];w=l.data;S=l.datapoints.format;if(!S){S=[];S.push({x:true,number:true,required:true});S.push({y:true,number:true,required:true});if(l.bars.show||l.lines.show&&l.lines.fill){var T=!!(l.bars.show&&l.bars.zero||l.lines.show&&l.lines.zero);S.push({y:true,number:true,required:false,defaultValue:0,autoscale:T});if(l.bars.horizontal){delete S[S.length-1].y;S[S.length-1].x=true}}l.datapoints.format=S}if(l.datapoints.pointsize!=null)continue;l.datapoints.pointsize=S.length;h=l.datapoints.pointsize;c=l.datapoints.points;var N=l.lines.show&&l.lines.steps;l.xaxis.used=l.yaxis.used=true;for(s=o=0;s<w.length;++s,o+=h){y=w[s];var C=y==null;if(!C){for(a=0;a<h;++a){m=y[a];g=S[a];if(g){if(g.number&&m!=null){m=+m;if(isNaN(m))m=null;else if(m==Infinity)m=r;else if(m==-Infinity)m=-r}if(m==null){if(g.required)C=true;if(g.defaultValue!=null)m=g.defaultValue}}c[o+a]=m}}if(C){for(a=0;a<h;++a){m=c[o+a];if(m!=null){g=S[a];if(g.autoscale!==false){if(g.x){x(l.xaxis,m,m)}if(g.y){x(l.yaxis,m,m)}}}c[o+a]=null}}else{if(N&&o>0&&c[o-h]!=null&&c[o-h]!=c[o]&&c[o-h+1]!=c[o+1]){for(a=0;a<h;++a)c[o+h+a]=c[o+a];c[o+1]=c[o-h+1];o+=h}}}}for(i=0;i<u.length;++i){l=u[i];E(b.processDatapoints,[l,l.datapoints])}for(i=0;i<u.length;++i){l=u[i];c=l.datapoints.points;h=l.datapoints.pointsize;S=l.datapoints.format;var L=t,A=t,O=n,M=n;for(s=0;s<c.length;s+=h){if(c[s]==null)continue;for(a=0;a<h;++a){m=c[s+a];g=S[a];if(!g||g.autoscale===false||m==r||m==-r)continue;if(g.x){if(m<L)L=m;if(m>O)O=m}if(g.y){if(m<A)A=m;if(m>M)M=m}}}if(l.bars.show){var _;switch(l.bars.align){case"left":_=0;break;case"right":_=-l.bars.barWidth;break;default:_=-l.bars.barWidth/2}if(l.bars.horizontal){A+=_;M+=_+l.bars.barWidth}else{L+=_;O+=_+l.bars.barWidth}}x(l.xaxis,L,O);x(l.yaxis,A,M)}e.each(k(),function(e,r){if(r.datamin==t)r.datamin=null;if(r.datamax==n)r.datamax=null})}function D(){t.css("padding",0).children().filter(function(){return!e(this).hasClass("flot-overlay")&&!e(this).hasClass("flot-base")}).remove();if(t.css("position")=="static")t.css("position","relative");f=new n("flot-base",t);l=new n("flot-overlay",t);h=f.context;p=l.context;c=e(l.element).unbind();var r=t.data("plot");if(r){r.shutdown();l.clear()}t.data("plot",w)}function P(){if(a.grid.hoverable){c.mousemove(at);c.bind("mouseleave",ft)}if(a.grid.clickable)c.click(lt);E(b.bindEvents,[c])}function H(){if(ot)clearTimeout(ot);c.unbind("mousemove",at);c.unbind("mouseleave",ft);c.unbind("click",lt);E(b.shutdown,[c])}function B(e){function t(e){return e}var n,r,i=e.options.transform||t,s=e.options.inverseTransform;if(e.direction=="x"){n=e.scale=g/Math.abs(i(e.max)-i(e.min));r=Math.min(i(e.max),i(e.min))}else{n=e.scale=y/Math.abs(i(e.max)-i(e.min));n=-n;r=Math.max(i(e.max),i(e.min))}if(i==t)e.p2c=function(e){return(e-r)*n};else e.p2c=function(e){return(i(e)-r)*n};if(!s)e.c2p=function(e){return r+e/n};else e.c2p=function(e){return s(r+e/n)}}function j(e){var t=e.options,n=e.ticks||[],r=t.labelWidth||0,i=t.labelHeight||0,s=r||(e.direction=="x"?Math.floor(f.width/(n.length||1)):null),o=e.direction+"Axis "+e.direction+e.n+"Axis",u="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+o,a=t.font||"flot-tick-label tickLabel";for(var l=0;l<n.length;++l){var c=n[l];if(!c.label)continue;var h=f.getTextInfo(u,c.label,a,null,s);r=Math.max(r,h.width);i=Math.max(i,h.height)}e.labelWidth=t.labelWidth||r;e.labelHeight=t.labelHeight||i}function F(t){var n=t.labelWidth,r=t.labelHeight,i=t.options.position,s=t.direction==="x",o=t.options.tickLength,u=a.grid.axisMargin,l=a.grid.labelMargin,c=true,h=true,p=true,g=false;e.each(s?d:v,function(e,n){if(n&&n.reserveSpace){if(n===t){g=true}else if(n.options.position===i){if(g){h=false}else{c=false}}if(!g){p=false}}});if(h){u=0}if(o==null){o=p?"full":5}if(!isNaN(+o))l+=+o;if(s){r+=l;if(i=="bottom"){m.bottom+=r+u;t.box={top:f.height-m.bottom,height:r}}else{t.box={top:m.top+u,height:r};m.top+=r+u}}else{n+=l;if(i=="left"){t.box={left:m.left+u,width:n};m.left+=n+u}else{m.right+=n+u;t.box={left:f.width-m.right,width:n}}}t.position=i;t.tickLength=o;t.box.padding=l;t.innermost=c}function I(e){if(e.direction=="x"){e.box.left=m.left-e.labelWidth/2;e.box.width=f.width-m.left-m.right+e.labelWidth}else{e.box.top=m.top-e.labelHeight/2;e.box.height=f.height-m.bottom-m.top+e.labelHeight}}function q(){var t=a.grid.minBorderMargin,n,r;if(t==null){t=0;for(r=0;r<u.length;++r)t=Math.max(t,2*(u[r].points.radius+u[r].points.lineWidth/2))}var i={left:t,right:t,top:t,bottom:t};e.each(k(),function(e,t){if(t.reserveSpace&&t.ticks&&t.ticks.length){var n=t.ticks[t.ticks.length-1];if(t.direction==="x"){i.left=Math.max(i.left,t.labelWidth/2);if(n.v<=t.max){i.right=Math.max(i.right,t.labelWidth/2)}}else{i.bottom=Math.max(i.bottom,t.labelHeight/2);if(n.v<=t.max){i.top=Math.max(i.top,t.labelHeight/2)}}}});m.left=Math.ceil(Math.max(i.left,m.left));m.right=Math.ceil(Math.max(i.right,m.right));m.top=Math.ceil(Math.max(i.top,m.top));m.bottom=Math.ceil(Math.max(i.bottom,m.bottom))}function R(){var t,n=k(),r=a.grid.show;for(var i in m){var s=a.grid.margin||0;m[i]=typeof s=="number"?s:s[i]||0}E(b.processOffset,[m]);for(var i in m){if(typeof a.grid.borderWidth=="object"){m[i]+=r?a.grid.borderWidth[i]:0}else{m[i]+=r?a.grid.borderWidth:0}}e.each(n,function(e,t){t.show=t.options.show;if(t.show==null)t.show=t.used;t.reserveSpace=t.show||t.options.reserveSpace;U(t)});if(r){var o=e.grep(n,function(e){return e.reserveSpace});e.each(o,function(e,t){z(t);W(t);X(t,t.ticks);j(t)});for(t=o.length-1;t>=0;--t)F(o[t]);q();e.each(o,function(e,t){I(t)})}g=f.width-m.left-m.right;y=f.height-m.bottom-m.top;e.each(n,function(e,t){B(t)});if(r){G()}it()}function U(e){var t=e.options,n=+(t.min!=null?t.min:e.datamin),r=+(t.max!=null?t.max:e.datamax),i=r-n;if(i==0){var s=r==0?1:.01;if(t.min==null)n-=s;if(t.max==null||t.min!=null)r+=s}else{var o=t.autoscaleMargin;if(o!=null){if(t.min==null){n-=i*o;if(n<0&&e.datamin!=null&&e.datamin>=0)n=0}if(t.max==null){r+=i*o;if(r>0&&e.datamax!=null&&e.datamax<=0)r=0}}}e.min=n;e.max=r}function z(t){var n=t.options;var r;if(typeof n.ticks=="number"&&n.ticks>0)r=n.ticks;else r=.3*Math.sqrt(t.direction=="x"?f.width:f.height);var s=(t.max-t.min)/r,o=-Math.floor(Math.log(s)/Math.LN10),u=n.tickDecimals;if(u!=null&&o>u){o=u}var a=Math.pow(10,-o),l=s/a,c;if(l<1.5){c=1}else if(l<3){c=2;if(l>2.25&&(u==null||o+1<=u)){c=2.5;++o}}else if(l<7.5){c=5}else{c=10}c*=a;if(n.minTickSize!=null&&c<n.minTickSize){c=n.minTickSize}t.delta=s;t.tickDecimals=Math.max(0,u!=null?u:o);t.tickSize=n.tickSize||c;if(n.mode=="time"&&!t.tickGenerator){throw new Error("Time mode requires the flot.time plugin.")}if(!t.tickGenerator){t.tickGenerator=function(e){var t=[],n=i(e.min,e.tickSize),r=0,s=Number.NaN,o;do{o=s;s=n+r*e.tickSize;t.push(s);++r}while(s<e.max&&s!=o);return t};t.tickFormatter=function(e,t){var n=t.tickDecimals?Math.pow(10,t.tickDecimals):1;var r=""+Math.round(e*n)/n;if(t.tickDecimals!=null){var i=r.indexOf(".");var s=i==-1?0:r.length-i-1;if(s<t.tickDecimals){return(s?r:r+".")+(""+n).substr(1,t.tickDecimals-s)}}return r}}if(e.isFunction(n.tickFormatter))t.tickFormatter=function(e,t){return""+n.tickFormatter(e,t)};if(n.alignTicksWithAxis!=null){var h=(t.direction=="x"?d:v)[n.alignTicksWithAxis-1];if(h&&h.used&&h!=t){var p=t.tickGenerator(t);if(p.length>0){if(n.min==null)t.min=Math.min(t.min,p[0]);if(n.max==null&&p.length>1)t.max=Math.max(t.max,p[p.length-1])}t.tickGenerator=function(e){var t=[],n,r;for(r=0;r<h.ticks.length;++r){n=(h.ticks[r].v-h.min)/(h.max-h.min);n=e.min+n*(e.max-e.min);t.push(n)}return t};if(!t.mode&&n.tickDecimals==null){var m=Math.max(0,-Math.floor(Math.log(t.delta)/Math.LN10)+1),g=t.tickGenerator(t);if(!(g.length>1&&/\..*0$/.test((g[1]-g[0]).toFixed(m))))t.tickDecimals=m}}}}function W(t){var n=t.options.ticks,r=[];if(n==null||typeof n=="number"&&n>0)r=t.tickGenerator(t);else if(n){if(e.isFunction(n))r=n(t);else r=n}var i,s;t.ticks=[];for(i=0;i<r.length;++i){var o=null;var u=r[i];if(typeof u=="object"){s=+u[0];if(u.length>1)o=u[1]}else s=+u;if(o==null)o=t.tickFormatter(s,t);if(!isNaN(s))t.ticks.push({v:s,label:o})}}function X(e,t){if(e.options.autoscaleMargin&&t.length>0){if(e.options.min==null)e.min=Math.min(e.min,t[0].v);if(e.options.max==null&&t.length>1)e.max=Math.max(e.max,t[t.length-1].v)}}function V(){f.clear();E(b.drawBackground,[h]);var e=a.grid;if(e.show&&e.backgroundColor)K();if(e.show&&!e.aboveData){Q()}for(var t=0;t<u.length;++t){E(b.drawSeries,[h,u[t]]);Y(u[t])}E(b.draw,[h]);if(e.show&&e.aboveData){Q()}f.render();ht()}function J(e,t){var n,r,i,s,o=k();for(var u=0;u<o.length;++u){n=o[u];if(n.direction==t){s=t+n.n+"axis";if(!e[s]&&n.n==1)s=t+"axis";if(e[s]){r=e[s].from;i=e[s].to;break}}}if(!e[s]){n=t=="x"?d[0]:v[0];r=e[t+"1"];i=e[t+"2"]}if(r!=null&&i!=null&&r>i){var a=r;r=i;i=a}return{from:r,to:i,axis:n}}function K(){h.save();h.translate(m.left,m.top);h.fillStyle=bt(a.grid.backgroundColor,y,0,"rgba(255, 255, 255, 0)");h.fillRect(0,0,g,y);h.restore()}function Q(){var t,n,r,i;h.save();h.translate(m.left,m.top);var s=a.grid.markings;if(s){if(e.isFunction(s)){n=w.getAxes();n.xmin=n.xaxis.min;n.xmax=n.xaxis.max;n.ymin=n.yaxis.min;n.ymax=n.yaxis.max;s=s(n)}for(t=0;t<s.length;++t){var o=s[t],u=J(o,"x"),f=J(o,"y");if(u.from==null)u.from=u.axis.min;if(u.to==null)u.to=u.axis.max;if(f.from==null)f.from=f.axis.min;if(f.to==null)f.to=f.axis.max;if(u.to<u.axis.min||u.from>u.axis.max||f.to<f.axis.min||f.from>f.axis.max)continue;u.from=Math.max(u.from,u.axis.min);u.to=Math.min(u.to,u.axis.max);f.from=Math.max(f.from,f.axis.min);f.to=Math.min(f.to,f.axis.max);if(u.from==u.to&&f.from==f.to)continue;u.from=u.axis.p2c(u.from);u.to=u.axis.p2c(u.to);f.from=f.axis.p2c(f.from);f.to=f.axis.p2c(f.to);if(u.from==u.to||f.from==f.to){h.beginPath();h.strokeStyle=o.color||a.grid.markingsColor;h.lineWidth=o.lineWidth||a.grid.markingsLineWidth;h.moveTo(u.from,f.from);h.lineTo(u.to,f.to);h.stroke()}else{h.fillStyle=o.color||a.grid.markingsColor;h.fillRect(u.from,f.to,u.to-u.from,f.from-f.to)}}}n=k();r=a.grid.borderWidth;for(var l=0;l<n.length;++l){var c=n[l],p=c.box,d=c.tickLength,v,b,E,S;if(!c.show||c.ticks.length==0)continue;h.lineWidth=1;if(c.direction=="x"){v=0;if(d=="full")b=c.position=="top"?0:y;else b=p.top-m.top+(c.position=="top"?p.height:0)}else{b=0;if(d=="full")v=c.position=="left"?0:g;else v=p.left-m.left+(c.position=="left"?p.width:0)}if(!c.innermost){h.strokeStyle=c.options.color;h.beginPath();E=S=0;if(c.direction=="x")E=g+1;else S=y+1;if(h.lineWidth==1){if(c.direction=="x"){b=Math.floor(b)+.5}else{v=Math.floor(v)+.5}}h.moveTo(v,b);h.lineTo(v+E,b+S);h.stroke()}h.strokeStyle=c.options.tickColor;h.beginPath();for(t=0;t<c.ticks.length;++t){var x=c.ticks[t].v;E=S=0;if(isNaN(x)||x<c.min||x>c.max||d=="full"&&(typeof r=="object"&&r[c.position]>0||r>0)&&(x==c.min||x==c.max))continue;if(c.direction=="x"){v=c.p2c(x);S=d=="full"?-y:d;if(c.position=="top")S=-S}else{b=c.p2c(x);E=d=="full"?-g:d;if(c.position=="left")E=-E}if(h.lineWidth==1){if(c.direction=="x")v=Math.floor(v)+.5;else b=Math.floor(b)+.5}h.moveTo(v,b);h.lineTo(v+E,b+S)}h.stroke()}if(r){i=a.grid.borderColor;if(typeof r=="object"||typeof i=="object"){if(typeof r!=="object"){r={top:r,right:r,bottom:r,left:r}}if(typeof i!=="object"){i={top:i,right:i,bottom:i,left:i}}if(r.top>0){h.strokeStyle=i.top;h.lineWidth=r.top;h.beginPath();h.moveTo(0-r.left,0-r.top/2);h.lineTo(g,0-r.top/2);h.stroke()}if(r.right>0){h.strokeStyle=i.right;h.lineWidth=r.right;h.beginPath();h.moveTo(g+r.right/2,0-r.top);h.lineTo(g+r.right/2,y);h.stroke()}if(r.bottom>0){h.strokeStyle=i.bottom;h.lineWidth=r.bottom;h.beginPath();h.moveTo(g+r.right,y+r.bottom/2);h.lineTo(0,y+r.bottom/2);h.stroke()}if(r.left>0){h.strokeStyle=i.left;h.lineWidth=r.left;h.beginPath();h.moveTo(0-r.left/2,y+r.bottom);h.lineTo(0-r.left/2,0);h.stroke()}}else{h.lineWidth=r;h.strokeStyle=a.grid.borderColor;h.strokeRect(-r/2,-r/2,g+r,y+r)}}h.restore()}function G(){e.each(k(),function(e,t){var n=t.box,r=t.direction+"Axis "+t.direction+t.n+"Axis",i="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+r,s=t.options.font||"flot-tick-label tickLabel",o,u,a,l,c;f.removeText(i);if(!t.show||t.ticks.length==0)return;for(var h=0;h<t.ticks.length;++h){o=t.ticks[h];if(!o.label||o.v<t.min||o.v>t.max)continue;if(t.direction=="x"){l="center";u=m.left+t.p2c(o.v);if(t.position=="bottom"){a=n.top+n.padding}else{a=n.top+n.height-n.padding;c="bottom"}}else{c="middle";a=m.top+t.p2c(o.v);if(t.position=="left"){u=n.left+n.width-n.padding;l="right"}else{u=n.left+n.padding}}f.addText(i,u,a,o.label,s,null,null,l,c)}})}function Y(e){if(e.lines.show)Z(e);if(e.bars.show)nt(e);if(e.points.show)et(e)}function Z(e){function t(e,t,n,r,i){var s=e.points,o=e.pointsize,u=null,a=null;h.beginPath();for(var f=o;f<s.length;f+=o){var l=s[f-o],c=s[f-o+1],p=s[f],d=s[f+1];if(l==null||p==null)continue;if(c<=d&&c<i.min){if(d<i.min)continue;l=(i.min-c)/(d-c)*(p-l)+l;c=i.min}else if(d<=c&&d<i.min){if(c<i.min)continue;p=(i.min-c)/(d-c)*(p-l)+l;d=i.min}if(c>=d&&c>i.max){if(d>i.max)continue;l=(i.max-c)/(d-c)*(p-l)+l;c=i.max}else if(d>=c&&d>i.max){if(c>i.max)continue;p=(i.max-c)/(d-c)*(p-l)+l;d=i.max}if(l<=p&&l<r.min){if(p<r.min)continue;c=(r.min-l)/(p-l)*(d-c)+c;l=r.min}else if(p<=l&&p<r.min){if(l<r.min)continue;d=(r.min-l)/(p-l)*(d-c)+c;p=r.min}if(l>=p&&l>r.max){if(p>r.max)continue;c=(r.max-l)/(p-l)*(d-c)+c;l=r.max}else if(p>=l&&p>r.max){if(l>r.max)continue;d=(r.max-l)/(p-l)*(d-c)+c;p=r.max}if(l!=u||c!=a)h.moveTo(r.p2c(l)+t,i.p2c(c)+n);u=p;a=d;h.lineTo(r.p2c(p)+t,i.p2c(d)+n)}h.stroke()}function n(e,t,n){var r=e.points,i=e.pointsize,s=Math.min(Math.max(0,n.min),n.max),o=0,u,a=false,f=1,l=0,c=0;while(true){if(i>0&&o>r.length+i)break;o+=i;var p=r[o-i],d=r[o-i+f],v=r[o],m=r[o+f];if(a){if(i>0&&p!=null&&v==null){c=o;i=-i;f=2;continue}if(i<0&&o==l+i){h.fill();a=false;i=-i;f=1;o=l=c+i;continue}}if(p==null||v==null)continue;if(p<=v&&p<t.min){if(v<t.min)continue;d=(t.min-p)/(v-p)*(m-d)+d;p=t.min}else if(v<=p&&v<t.min){if(p<t.min)continue;m=(t.min-p)/(v-p)*(m-d)+d;v=t.min}if(p>=v&&p>t.max){if(v>t.max)continue;d=(t.max-p)/(v-p)*(m-d)+d;p=t.max}else if(v>=p&&v>t.max){if(p>t.max)continue;m=(t.max-p)/(v-p)*(m-d)+d;v=t.max}if(!a){h.beginPath();h.moveTo(t.p2c(p),n.p2c(s));a=true}if(d>=n.max&&m>=n.max){h.lineTo(t.p2c(p),n.p2c(n.max));h.lineTo(t.p2c(v),n.p2c(n.max));continue}else if(d<=n.min&&m<=n.min){h.lineTo(t.p2c(p),n.p2c(n.min));h.lineTo(t.p2c(v),n.p2c(n.min));continue}var g=p,y=v;if(d<=m&&d<n.min&&m>=n.min){p=(n.min-d)/(m-d)*(v-p)+p;d=n.min}else if(m<=d&&m<n.min&&d>=n.min){v=(n.min-d)/(m-d)*(v-p)+p;m=n.min}if(d>=m&&d>n.max&&m<=n.max){p=(n.max-d)/(m-d)*(v-p)+p;d=n.max}else if(m>=d&&m>n.max&&d<=n.max){v=(n.max-d)/(m-d)*(v-p)+p;m=n.max}if(p!=g){h.lineTo(t.p2c(g),n.p2c(d))}h.lineTo(t.p2c(p),n.p2c(d));h.lineTo(t.p2c(v),n.p2c(m));if(v!=y){h.lineTo(t.p2c(v),n.p2c(m));h.lineTo(t.p2c(y),n.p2c(m))}}}h.save();h.translate(m.left,m.top);h.lineJoin="round";var r=e.lines.lineWidth,i=e.shadowSize;if(r>0&&i>0){h.lineWidth=i;h.strokeStyle="rgba(0,0,0,0.1)";var s=Math.PI/18;t(e.datapoints,Math.sin(s)*(r/2+i/2),Math.cos(s)*(r/2+i/2),e.xaxis,e.yaxis);h.lineWidth=i/2;t(e.datapoints,Math.sin(s)*(r/2+i/4),Math.cos(s)*(r/2+i/4),e.xaxis,e.yaxis)}h.lineWidth=r;h.strokeStyle=e.color;var o=rt(e.lines,e.color,0,y);if(o){h.fillStyle=o;n(e.datapoints,e.xaxis,e.yaxis)}if(r>0)t(e.datapoints,0,0,e.xaxis,e.yaxis);h.restore()}function et(e){function t(e,t,n,r,i,s,o,u){var a=e.points,f=e.pointsize;for(var l=0;l<a.length;l+=f){var c=a[l],p=a[l+1];if(c==null||c<s.min||c>s.max||p<o.min||p>o.max)continue;h.beginPath();c=s.p2c(c);p=o.p2c(p)+r;if(u=="circle")h.arc(c,p,t,0,i?Math.PI:Math.PI*2,false);else u(h,c,p,t,i);h.closePath();if(n){h.fillStyle=n;h.fill()}h.stroke()}}h.save();h.translate(m.left,m.top);var n=e.points.lineWidth,r=e.shadowSize,i=e.points.radius,s=e.points.symbol;if(n==0)n=1e-4;if(n>0&&r>0){var o=r/2;h.lineWidth=o;h.strokeStyle="rgba(0,0,0,0.1)";t(e.datapoints,i,null,o+o/2,true,e.xaxis,e.yaxis,s);h.strokeStyle="rgba(0,0,0,0.2)";t(e.datapoints,i,null,o/2,true,e.xaxis,e.yaxis,s)}h.lineWidth=n;h.strokeStyle=e.color;t(e.datapoints,i,rt(e.points,e.color),0,false,e.xaxis,e.yaxis,s);h.restore()}function tt(e,t,n,r,i,s,o,u,a,f,l){var c,h,p,d,v,m,g,y,b;if(f){y=m=g=true;v=false;c=n;h=e;d=t+r;p=t+i;if(h<c){b=h;h=c;c=b;v=true;m=false}}else{v=m=g=true;y=false;c=e+r;h=e+i;p=n;d=t;if(d<p){b=d;d=p;p=b;y=true;g=false}}if(h<o.min||c>o.max||d<u.min||p>u.max)return;if(c<o.min){c=o.min;v=false}if(h>o.max){h=o.max;m=false}if(p<u.min){p=u.min;y=false}if(d>u.max){d=u.max;g=false}c=o.p2c(c);p=u.p2c(p);h=o.p2c(h);d=u.p2c(d);if(s){a.fillStyle=s(p,d);a.fillRect(c,d,h-c,p-d)}if(l>0&&(v||m||g||y)){a.beginPath();a.moveTo(c,p);if(v)a.lineTo(c,d);else a.moveTo(c,d);if(g)a.lineTo(h,d);else a.moveTo(h,d);if(m)a.lineTo(h,p);else a.moveTo(h,p);if(y)a.lineTo(c,p);else a.moveTo(c,p);a.stroke()}}function nt(e){function t(t,n,r,i,s,o){var u=t.points,a=t.pointsize;for(var f=0;f<u.length;f+=a){if(u[f]==null)continue;tt(u[f],u[f+1],u[f+2],n,r,i,s,o,h,e.bars.horizontal,e.bars.lineWidth)}}h.save();h.translate(m.left,m.top);h.lineWidth=e.bars.lineWidth;h.strokeStyle=e.color;var n;switch(e.bars.align){case"left":n=0;break;case"right":n=-e.bars.barWidth;break;default:n=-e.bars.barWidth/2}var r=e.bars.fill?function(t,n){return rt(e.bars,e.color,t,n)}:null;t(e.datapoints,n,n+e.bars.barWidth,r,e.xaxis,e.yaxis);h.restore()}function rt(t,n,r,i){var s=t.fill;if(!s)return null;if(t.fillColor)return bt(t.fillColor,r,i,n);var o=e.color.parse(n);o.a=typeof s=="number"?s:.4;o.normalize();return o.toString()}function it(){if(a.legend.container!=null){e(a.legend.container).html("")}else{t.find(".legend").remove()}if(!a.legend.show){return}var n=[],r=[],i=false,s=a.legend.labelFormatter,o,f;for(var l=0;l<u.length;++l){o=u[l];if(o.label){f=s?s(o.label,o):o.label;if(f){r.push({label:f,color:o.color})}}}if(a.legend.sorted){if(e.isFunction(a.legend.sorted)){r.sort(a.legend.sorted)}else if(a.legend.sorted=="reverse"){r.reverse()}else{var c=a.legend.sorted!="descending";r.sort(function(e,t){return e.label==t.label?0:e.label<t.label!=c?1:-1})}}for(var l=0;l<r.length;++l){var h=r[l];if(l%a.legend.noColumns==0){if(i)n.push("</tr>");n.push("<tr>");i=true}n.push('<td class="legendColorBox"><div style="border:1px solid '+a.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+h.color+';overflow:hidden"></div></div></td>'+'<td class="legendLabel">'+h.label+"</td>")}if(i)n.push("</tr>");if(n.length==0)return;var p='<table style="font-size:smaller;color:'+a.grid.color+'">'+n.join("")+"</table>";if(a.legend.container!=null)e(a.legend.container).html(p);else{var d="",v=a.legend.position,g=a.legend.margin;if(g[0]==null)g=[g,g];if(v.charAt(0)=="n")d+="top:"+(g[1]+m.top)+"px;";else if(v.charAt(0)=="s")d+="bottom:"+(g[1]+m.bottom)+"px;";if(v.charAt(1)=="e")d+="right:"+(g[0]+m.right)+"px;";else if(v.charAt(1)=="w")d+="left:"+(g[0]+m.left)+"px;";var y=e('<div class="legend">'+p.replace('style="','style="position:absolute;'+d+";")+"</div>").appendTo(t);if(a.legend.backgroundOpacity!=0){var b=a.legend.backgroundColor;if(b==null){b=a.grid.backgroundColor;if(b&&typeof b=="string")b=e.color.parse(b);else b=e.color.extract(y,"background-color");b.a=1;b=b.toString()}var w=y.children();e('<div style="position:absolute;width:'+w.width()+"px;height:"+w.height()+"px;"+d+"background-color:"+b+';"> </div>').prependTo(y).css("opacity",a.legend.backgroundOpacity)}}}function ut(e,t,n){var r=a.grid.mouseActiveRadius,i=r*r+1,s=null,o=false,f,l,c;for(f=u.length-1;f>=0;--f){if(!n(u[f]))continue;var h=u[f],p=h.xaxis,d=h.yaxis,v=h.datapoints.points,m=p.c2p(e),g=d.c2p(t),y=r/p.scale,b=r/d.scale;c=h.datapoints.pointsize;if(p.options.inverseTransform)y=Number.MAX_VALUE;if(d.options.inverseTransform)b=Number.MAX_VALUE;if(h.lines.show||h.points.show){for(l=0;l<v.length;l+=c){var w=v[l],E=v[l+1];if(w==null)continue;if(w-m>y||w-m<-y||E-g>b||E-g<-b)continue;var S=Math.abs(p.p2c(w)-e),x=Math.abs(d.p2c(E)-t),T=S*S+x*x;if(T<i){i=T;s=[f,l/c]}}}if(h.bars.show&&!s){var N,C;switch(h.bars.align){case"left":N=0;break;case"right":N=-h.bars.barWidth;break;default:N=-h.bars.barWidth/2}C=N+h.bars.barWidth;for(l=0;l<v.length;l+=c){var w=v[l],E=v[l+1],k=v[l+2];if(w==null)continue;if(u[f].bars.horizontal?m<=Math.max(k,w)&&m>=Math.min(k,w)&&g>=E+N&&g<=E+C:m>=w+N&&m<=w+C&&g>=Math.min(k,E)&&g<=Math.max(k,E))s=[f,l/c]}}}if(s){f=s[0];l=s[1];c=u[f].datapoints.pointsize;return{datapoint:u[f].datapoints.points.slice(l*c,(l+1)*c),dataIndex:l,series:u[f],seriesIndex:f}}return null}function at(e){if(a.grid.hoverable)ct("plothover",e,function(e){return e["hoverable"]!=false})}function ft(e){if(a.grid.hoverable)ct("plothover",e,function(e){return false})}function lt(e){ct("plotclick",e,function(e){return e["clickable"]!=false})}function ct(e,n,r){var i=c.offset(),s=n.pageX-i.left-m.left,o=n.pageY-i.top-m.top,u=L({left:s,top:o});u.pageX=n.pageX;u.pageY=n.pageY;var f=ut(s,o,r);if(f){f.pageX=parseInt(f.series.xaxis.p2c(f.datapoint[0])+i.left+m.left,10);f.pageY=parseInt(f.series.yaxis.p2c(f.datapoint[1])+i.top+m.top,10)}if(a.grid.autoHighlight){for(var l=0;l<st.length;++l){var h=st[l];if(h.auto==e&&!(f&&h.series==f.series&&h.point[0]==f.datapoint[0]&&h.point[1]==f.datapoint[1]))vt(h.series,h.point)}if(f)dt(f.series,f.datapoint,e)}t.trigger(e,[u,f])}function ht(){var e=a.interaction.redrawOverlayInterval;if(e==-1){pt();return}if(!ot)ot=setTimeout(pt,e)}function pt(){ot=null;p.save();l.clear();p.translate(m.left,m.top);var e,t;for(e=0;e<st.length;++e){t=st[e];if(t.series.bars.show)yt(t.series,t.point);else gt(t.series,t.point)}p.restore();E(b.drawOverlay,[p])}function dt(e,t,n){if(typeof e=="number")e=u[e];if(typeof t=="number"){var r=e.datapoints.pointsize;t=e.datapoints.points.slice(r*t,r*(t+1))}var i=mt(e,t);if(i==-1){st.push({series:e,point:t,auto:n});ht()}else if(!n)st[i].auto=false}function vt(e,t){if(e==null&&t==null){st=[];ht();return}if(typeof e=="number")e=u[e];if(typeof t=="number"){var n=e.datapoints.pointsize;t=e.datapoints.points.slice(n*t,n*(t+1))}var r=mt(e,t);if(r!=-1){st.splice(r,1);ht()}}function mt(e,t){for(var n=0;n<st.length;++n){var r=st[n];if(r.series==e&&r.point[0]==t[0]&&r.point[1]==t[1])return n}return-1}function gt(t,n){var r=n[0],i=n[1],s=t.xaxis,o=t.yaxis,u=typeof t.highlightColor==="string"?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString();if(r<s.min||r>s.max||i<o.min||i>o.max)return;var a=t.points.radius+t.points.lineWidth/2;p.lineWidth=a;p.strokeStyle=u;var f=1.5*a;r=s.p2c(r);i=o.p2c(i);p.beginPath();if(t.points.symbol=="circle")p.arc(r,i,f,0,2*Math.PI,false);else t.points.symbol(p,r,i,f,false);p.closePath();p.stroke()}function yt(t,n){var r=typeof t.highlightColor==="string"?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),i=r,s;switch(t.bars.align){case"left":s=0;break;case"right":s=-t.bars.barWidth;break;default:s=-t.bars.barWidth/2}p.lineWidth=t.bars.lineWidth;p.strokeStyle=r;tt(n[0],n[1],n[2]||0,s,s+t.bars.barWidth,function(){return i},t.xaxis,t.yaxis,p,t.bars.horizontal,t.bars.lineWidth)}function bt(t,n,r,i){if(typeof t=="string")return t;else{var s=h.createLinearGradient(0,r,0,n);for(var o=0,u=t.colors.length;o<u;++o){var a=t.colors[o];if(typeof a!="string"){var f=e.color.parse(i);if(a.brightness!=null)f=f.scale("rgb",a.brightness);if(a.opacity!=null)f.a*=a.opacity;a=f.toString()}s.addColorStop(o/(u-1),a)}return s}}var u=[],a={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},f=null,l=null,c=null,h=null,p=null,d=[],v=[],m={left:0,right:0,top:0,bottom:0},g=0,y=0,b={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},w=this;w.setData=T;w.setupGrid=R;w.draw=V;w.getPlaceholder=function(){return t};w.getCanvas=function(){return f.element};w.getPlotOffset=function(){return m};w.width=function(){return g};w.height=function(){return y};w.offset=function(){var e=c.offset();e.left+=m.left;e.top+=m.top;return e};w.getData=function(){return u};w.getAxes=function(){var t={},n;e.each(d.concat(v),function(e,n){if(n)t[n.direction+(n.n!=1?n.n:"")+"axis"]=n});return t};w.getXAxes=function(){return d};w.getYAxes=function(){return v};w.c2p=L;w.p2c=A;w.getOptions=function(){return a};w.highlight=dt;w.unhighlight=vt;w.triggerRedrawOverlay=ht;w.pointOffset=function(e){return{left:parseInt(d[C(e,"x")-1].p2c(+e.x)+m.left,10),top:parseInt(v[C(e,"y")-1].p2c(+e.y)+m.top,10)}};w.shutdown=H;w.destroy=function(){H();t.removeData("plot").empty();u=[];a=null;f=null;l=null;c=null;h=null;p=null;d=[];v=[];b=null;st=[];w=null};w.resize=function(){var e=t.width(),n=t.height();f.resize(e,n);l.resize(e,n)};w.hooks=b;S(w);x(s);D();T(r);R();V();P();var st=[],ot=null}function i(e,t){return t*Math.floor(e/t)}var t=Object.prototype.hasOwnProperty;n.prototype.resize=function(e,t){if(e<=0||t<=0){throw new Error("Invalid dimensions for plot, width = "+e+", height = "+t)}var n=this.element,r=this.context,i=this.pixelRatio;if(this.width!=e){n.width=e*i;n.style.width=e+"px";this.width=e}if(this.height!=t){n.height=t*i;n.style.height=t+"px";this.height=t}r.restore();r.save();r.scale(i,i)};n.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};n.prototype.render=function(){var e=this._textCache;for(var n in e){if(t.call(e,n)){var r=this.getTextLayer(n),i=e[n];r.hide();for(var s in i){if(t.call(i,s)){var o=i[s];for(var u in o){if(t.call(o,u)){var a=o[u].positions;for(var f=0,l;l=a[f];f++){if(l.active){if(!l.rendered){r.append(l.element);l.rendered=true}}else{a.splice(f--,1);if(l.rendered){l.element.detach()}}}if(a.length==0){delete o[u]}}}}}r.show()}}};n.prototype.getTextLayer=function(t){var n=this.text[t];if(n==null){if(this.textContainer==null){this.textContainer=e("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)}n=this.text[t]=e("<div></div>").addClass(t).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)}return n};n.prototype.getTextInfo=function(t,n,r,i,s){var o,u,a,f;n=""+n;if(typeof r==="object"){o=r.style+" "+r.variant+" "+r.weight+" "+r.size+"px/"+r.lineHeight+"px "+r.family}else{o=r}u=this._textCache[t];if(u==null){u=this._textCache[t]={}}a=u[o];if(a==null){a=u[o]={}}f=a[n];if(f==null){var l=e("<div></div>").html(n).css({position:"absolute","max-width":s,top:-9999}).appendTo(this.getTextLayer(t));if(typeof r==="object"){l.css({font:o,color:r.color})}else if(typeof r==="string"){l.addClass(r)}f=a[n]={width:l.outerWidth(true),height:l.outerHeight(true),element:l,positions:[]};l.detach()}return f};n.prototype.addText=function(e,t,n,r,i,s,o,u,a){var f=this.getTextInfo(e,r,i,s,o),l=f.positions;if(u=="center"){t-=f.width/2}else if(u=="right"){t-=f.width}if(a=="middle"){n-=f.height/2}else if(a=="bottom"){n-=f.height}for(var c=0,h;h=l[c];c++){if(h.x==t&&h.y==n){h.active=true;return}}h={active:true,rendered:false,element:l.length?f.element.clone():f.element,x:t,y:n};l.push(h);h.element.css({top:Math.round(n),left:Math.round(t),"text-align":u})};n.prototype.removeText=function(e,n,r,i,s,o){if(i==null){var u=this._textCache[e];if(u!=null){for(var a in u){if(t.call(u,a)){var f=u[a];for(var l in f){if(t.call(f,l)){var c=f[l].positions;for(var h=0,p;p=c[h];h++){p.active=false}}}}}}}else{var c=this.getTextInfo(e,i,s,o).positions;for(var h=0,p;p=c[h];h++){if(p.x==n&&p.y==r){p.active=false}}}};e.plot=function(t,n,i){var s=new r(e(t),n,i,e.plot.plugins);return s};e.plot.version="0.8.2";e.plot.plugins=[];e.fn.plot=function(t,n){return this.each(function(){e.plot(this,t,n)})}})(jQuery);
|
164 |
if (filters_to_add[i].indexOf('fs\%5B') != 0) continue;
|
165 |
|
166 |
filter_components = filters_to_add[i].split('=');
|
|
|
167 |
filter_components[0] = decodeURIComponent(filter_components[0]);
|
168 |
jQuery('input[name="'+filter_components[0]+'"]').remove();
|
169 |
|
173 |
},
|
174 |
|
175 |
add_filters_to_form: function(filters_parsed){
|
176 |
+
|
177 |
for (i in filters_parsed){
|
178 |
+
console.log(i + ' ' + filters_parsed[i]);
|
179 |
+
if (jQuery.inArray(i, ['fs[minute]','fs[hour]','fs[day]','fs[month]','fs[year]','fs[interval_direction]','fs[interval]','fs[interval_hours]','fs[interval_minutes]']) == -1){
|
180 |
jQuery('<input>').attr('type', 'hidden').attr('name', i).attr('class', 'slimstat-post-filter slimstat-temp-filter '+filters_parsed[i][0]).val(filters_parsed[i][1]).appendTo('#slimstat-filters-form');
|
181 |
}
|
182 |
else{
|
336 |
}
|
337 |
|
338 |
filters_parsed = SlimStatAdmin.parse_url_filters('p0', jQuery(this).attr('href'));
|
339 |
+
|
340 |
SlimStatAdmin.add_filters_to_form(filters_parsed);
|
341 |
|
342 |
jQuery('#slimstat-filters-form').submit();
|
479 |
// Modal Window / Whois
|
480 |
jQuery(document).on('click', '.whois', function(e){
|
481 |
e.preventDefault();
|
482 |
+
|
483 |
+
// If admin is using HTTPS and IP lookup service is not, open a new window/tab, instead of an overlay dialog
|
484 |
+
if (document.location.href.substr(0, document.location.href.indexOf("://")).toLowerCase() == 'https' && jQuery(this).attr('href').substr(0, jQuery(this).attr('href').indexOf("://")).toLowerCase() == 'http'){
|
485 |
+
window.open(jQuery(this).attr('href'), '_blank');
|
486 |
+
return -1;
|
487 |
+
}
|
488 |
+
|
489 |
jQuery('#slimstat-modal-dialog').dialog({
|
490 |
dialogClass: 'slimstat',
|
491 |
title: jQuery(this).attr('title')
|
518 |
jQuery('h3.hndle').on('click', function(){ jQuery(this).parent().toggleClass('closed') });
|
519 |
});
|
520 |
|
521 |
+
/* SlimScroll v1.3.3 | http://rocha.la | Copyright (c) 2011 Piotr Rochala. Licensed MIT, GPL. */
|
522 |
+
(function(e){e.fn.extend({slimScroll:function(n){var r={width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:false,disableFadeOut:false,railVisible:false,railColor:"#333",railOpacity:.2,railDraggable:true,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:false,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"};var i=e.extend(r,n);this.each(function(){function x(t){if(!r){return}var t=t||window.event;var n=0;if(t.wheelDelta){n=-t.wheelDelta/120}if(t.detail){n=t.detail/3}var s=t.target||t.srcTarget||t.srcElement;if(e(s).closest("."+i.wrapperClass).is(m.parent())){T(n,true)}if(t.preventDefault&&!v){t.preventDefault()}if(!v){t.returnValue=false}}function T(e,t,n){v=false;var r=e;var s=m.outerHeight()-E.outerHeight();if(t){r=parseInt(E.css("top"))+e*parseInt(i.wheelStep)/100*E.outerHeight();r=Math.min(Math.max(r,0),s);r=e>0?Math.ceil(r):Math.floor(r);E.css({top:r+"px"})}c=parseInt(E.css("top"))/(m.outerHeight()-E.outerHeight());r=c*(m[0].scrollHeight-m.outerHeight());if(n){r=e;var u=r/m[0].scrollHeight*m.outerHeight();u=Math.min(Math.max(u,0),s);E.css({top:u+"px"})}m.scrollTop(r);m.trigger("slimscrolling",~~r);k();L()}function N(){if(window.addEventListener){this.addEventListener("DOMMouseScroll",x,false);this.addEventListener("mousewheel",x,false)}else{document.attachEvent("onmousewheel",x)}}function C(){l=Math.max(m.outerHeight()/m[0].scrollHeight*m.outerHeight(),d);E.css({height:l+"px"});var e=l==m.outerHeight()?"none":"block";E.css({display:e})}function k(){C();clearTimeout(a);if(c==~~c){v=i.allowPageScroll;if(h!=c){var e=~~c==0?"top":"bottom";m.trigger("slimscroll",e)}}else{v=false}h=c;if(l>=m.outerHeight()){v=true;return}E.stop(true,true).fadeIn("fast");if(i.railVisible){w.stop(true,true).fadeIn("fast")}}function L(){if(!i.alwaysVisible){a=setTimeout(function(){if(!(i.disableFadeOut&&r)&&!s&&!u){E.fadeOut("slow");w.fadeOut("slow")}},1e3)}}var r,s,u,a,f,l,c,h,p="<div></div>",d=30,v=false;var m=e(this);if(m.parent().hasClass(i.wrapperClass)){var g=m.scrollTop();E=m.parent().find("."+i.barClass);w=m.parent().find("."+i.railClass);C();if(e.isPlainObject(n)){if("height"in n&&n.height=="auto"){m.parent().css("height","auto");m.css("height","auto");var y=m.parent().parent().height();m.parent().css("height",y);m.css("height",y)}if("scrollTo"in n){g=parseInt(i.scrollTo)}else if("scrollBy"in n){g+=parseInt(i.scrollBy)}else if("destroy"in n){E.remove();w.remove();m.unwrap();return}T(g,false,true)}return}else if(e.isPlainObject(n)){if("destroy"in n){return}}i.height=i.height=="auto"?m.parent().height():i.height;var b=e(p).addClass(i.wrapperClass).css({position:"relative",overflow:"hidden",width:i.width,height:i.height});m.css({overflow:"hidden",width:i.width,height:i.height});var w=e(p).addClass(i.railClass).css({width:i.size,height:"100%",position:"absolute",top:0,display:i.alwaysVisible&&i.railVisible?"block":"none","border-radius":i.railBorderRadius,background:i.railColor,opacity:i.railOpacity,zIndex:90});var E=e(p).addClass(i.barClass).css({background:i.color,width:i.size,position:"absolute",top:0,opacity:i.opacity,display:i.alwaysVisible?"block":"none","border-radius":i.borderRadius,BorderRadius:i.borderRadius,MozBorderRadius:i.borderRadius,WebkitBorderRadius:i.borderRadius,zIndex:99});var S=i.position=="right"?{right:i.distance}:{left:i.distance};w.css(S);E.css(S);m.wrap(b);m.parent().append(E);m.parent().append(w);if(i.railDraggable){E.bind("mousedown",function(n){var r=e(document);u=true;t=parseFloat(E.css("top"));pageY=n.pageY;r.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY;E.css("top",currTop);T(0,E.position().top,false)});r.bind("mouseup.slimscroll",function(e){u=false;L();r.unbind(".slimscroll")});return false}).bind("selectstart.slimscroll",function(e){e.stopPropagation();e.preventDefault();return false})}w.hover(function(){k()},function(){L()});E.hover(function(){s=true},function(){s=false});m.hover(function(){r=true;k();L()},function(){r=false;L()});m.bind("touchstart",function(e,t){if(e.originalEvent.touches.length){f=e.originalEvent.touches[0].pageY}});m.bind("touchmove",function(e){if(!v){e.originalEvent.preventDefault()}if(e.originalEvent.touches.length){var t=(f-e.originalEvent.touches[0].pageY)/i.touchScrollStep;T(t,true);f=e.originalEvent.touches[0].pageY}});C();if(i.start==="bottom"){E.css({top:m.outerHeight()-E.outerHeight()});T(0,true)}else if(i.start!=="top"){T(e(i.start).position().top,null,true);if(!i.alwaysVisible){E.hide()}}N()});return this}});e.fn.extend({slimscroll:e.fn.slimScroll})})(jQuery);
|
523 |
|
524 |
+
/* qTip2 v2.2.1 | http://qtip2.com | Licensed MIT, GPL. */
|
525 |
+
!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=z,this.elements={target:a},this._id=I+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:y,attr:e,onTooltip:y,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=y}function f(a){return a===z||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?y:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?y:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==y,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,z,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||y)&&(b.title=y))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===x?{ready:x}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(H,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return L.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(S)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(x,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(S)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(M)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(y,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(S)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+I+" "))+"."+I,function(){var a=s.api[d.attr(this,K)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):z,p="html5"===f.metadata.type&&o?o[f.metadata.name]:z,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(x,{},s.defaults,f,"object"==typeof q?h(q):z,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===y||!j)return y;k.content.text=j}if(i.container.length||(i.container=m),i.target===y&&(i.target=n),k.show.target===y&&(k.show.target=n),k.show.solo===x&&(k.show.solo=i.container.closest("body")),k.hide.target===y&&(k.hide.target=n),k.position.viewport===x&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new u(i.at,x),i.my=new u(i.my),a.data(I))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===y)return y;return a.attr(J,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(U,l).attr("title",""),g=new e(a,k,c,!!j),a.data(I,g),g}var s,t,u,v,w,x=!0,y=!1,z=null,A="x",B="y",C="top",D="left",E="bottom",F="right",G="center",H={},I="qtip",J="data-hasqtip",K="data-qtip-id",L=["ui-widget","ui-tooltip"],M="."+I,N="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),O=I+"-fixed",P=I+"-default",Q=I+"-focus",R=I+"-hover",S=I+"-disabled",T="_replacedByqTip",U="oldtitle",V={ie:function(){for(var a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||y};t=e.prototype,t._when=function(a){return d.when.apply(d,a)},t.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),f.posClass=this._createPosClass((this.position={my:k.my,at:k.at}).my),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[I,P,e.style.classes,f.posClass].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":y,"aria-describedby":this._id+"-content","aria-hidden":x}).toggleClass(S,this.disabled).attr(K,this.id).data(I,this).appendTo(k.container).append(g.content=d("<div />",{"class":I+"-content",id:this._id+"-content","aria-atomic":x})),this.rendered=-1,this.positioning=x,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,y))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,y)),this.rendered=x,this._setWidget(),d.each(H,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=y,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(x,f.event,y),c.hiddenDuringWait=y}),s.api[this.id]=this,this},t.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=x;var a,b=this.target,c=b.attr(U);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)clearTimeout(this.timers[a]);b.removeData(I).removeAttr(K).removeAttr(J).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(U),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=z,delete s.api[this.id]}}return this.destroyed?this.target:(a===x&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},v=t.checks={builtin:{"^id$":function(a,b,c,e){var f=c===x?s.nextid:c,g=I+"-"+f;f!==y&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new u(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(x)||this.toggle(x))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(P,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},t.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var W=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,X=/^prerender|show\.ready/i;t.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=y,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&X.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=W.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=x,d.each(a,d.proxy(j,this)),this.positioning=y,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?z:this.cache.event),this},t._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=x,a.then(function(a){return e.waiting=y,c._update(a,b)},z,function(a){return c._update(a,b)})):a===y||!a&&""!==a?y:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):y},t._waitForContent=function(a){var b=this.cache;return b.waiting=x,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=y}).promise()},t._updateContent=function(a,b){this._update(a,this.elements.content,b)},t._updateTitle=function(a,b){this._update(a,this.elements.title,b)===y&&this._removeTitle(y)},t._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":I+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":I+"-title","aria-atomic":x})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},t._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=z,a!==y&&this.reposition())},t._createPosClass=function(a){return I+"-pos-"+(a||this.options.position.my).abbrev()},t.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=x;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(y),u=k.outerHeight(y),v=0,w=0,z=k.css("position"),A={left:0,top:0},B=k[0].offsetWidth>0,I=c&&"scroll"===c.type,J=d(a),K=q[0].ownerDocument,L=this.mouse;if(d.isArray(m)&&2===m.length)o={x:D,y:C},A={left:m[0],top:m[1]};else if("mouse"===m)o={x:D,y:C},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:L&&L.pageX&&(c=L),"static"!==z&&(A=q.offset()),K.body.offsetWidth!==(a.innerWidth||K.documentElement.clientWidth)&&(g=d(b.body).offset()),A={left:c.pageX-A.left+(g&&g.left||0),top:c.pageY-A.top+(g&&g.top||0)},r.mouse&&I&&L&&(A.left-=(L.scrollX||0)-J.scrollLeft(),A.top-=(L.scrollY||0)-J.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=V.iOS?a.innerWidth:m.width(),w=V.iOS?a.innerHeight:m.height(),m[0]===a&&(A={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):H.imagemap&&m.is("area")?f=H.imagemap(this,m,o,H.viewport?s:y):H.svg&&m&&m[0].ownerSVGElement?f=H.svg(this,m,o,H.viewport?s:y):(v=m.outerWidth(y),w=m.outerHeight(y),A=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,A=f.position),A=this.reposition.offset(m,A,q),(V.iOS>3.1&&V.iOS<4.1||V.iOS>=4.3&&V.iOS<4.33||!V.iOS&&"fixed"===z)&&(A.left-=J.scrollLeft(),A.top-=J.scrollTop()),(!f||f&&f.adjustable!==y)&&(A.left+=o.x===F?v:o.x===G?v/2:0,A.top+=o.y===E?w:o.y===G?w/2:0)}return A.left+=r.x+(n.x===F?-t:n.x===G?-t/2:0),A.top+=r.y+(n.y===E?-u:n.y===G?-u/2:0),H.viewport?(h=A.adjusted=H.viewport(this,A,l,v,w,t,u),g&&h.left&&(A.left+=g.left),g&&h.top&&(A.top+=g.top),h.my&&(this.position.my=h.my)):A.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&k.removeClass(j.posClass).addClass(j.posClass=i),this._trigger("move",[A,p.elem||p],c)?(delete A.adjusted,e===y||!B||isNaN(A.left)||isNaN(A.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(A):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},A)),k.queue(function(a){d(this).css({opacity:"",height:""}),V.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=y,this):this},t.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!V.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var Y=(u=t.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,G).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?B:A}).prototype;Y.invert=function(a,b){this[a]=this[a]===D?F:this[a]===F?D:b||this[a]},Y.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===B||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},Y.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},Y.clone=function(){return new u(this.string(),this.forceY)},t.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=x),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=(this.options[a?"hide":"show"],this.options.position),n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?z:!!this._trigger(k,[90]),this.destroyed?this:(i!==y&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,y),d.isFunction(n.title)&&this._updateTitle(n.title,y),!w&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+I,this._storeMouse),w=x),o||g.css("width",g.outerWidth(y)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(M,l.solo)).not(g).not(l.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,w&&!d(M+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+I),w=y),this.blur(c)),j=d.proxy(function(){a?(V.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===y||q===y?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},t.show=function(a){return this.toggle(x,a)},t.hide=function(a){return this.toggle(y,a)},t.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(M),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=s.zindex+b.length;return c.hasClass(Q)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+Q).qtip("blur",a)),c.addClass(Q)[0].style.zIndex=f),this},t.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(Q),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},t.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(S):this.disabled):"boolean"!=typeof a&&(a=x),this.rendered&&this.tooltip.toggleClass(S,a).attr("aria-disabled",a),this.disabled=!!a,this)},t.enable=function(){return this.disable(y)},t._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":I+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(S)||a.hide(b),y})},t._updateButton=function(a){if(!this.rendered)return y;var b=this.elements.button;a?this._createButton():b.remove()},t._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(S);c.removeClass(S),S=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(S,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(P,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(I+"-icon",!a)},t._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},t._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},t._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},t._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||z,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=y,!e.isDefaultPrevented()},t._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},t._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?y:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=x}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):y}),(c.show.ready||c.prerender)&&b.call(this,a)},t._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],t=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(O)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(S)&&this.tooltip[0].offsetWidth>0,e=b.parents(M).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),s.inactiveEvents,o)),this._bindEvents(r,t,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):y}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(S)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},t._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(M,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(O)&&!c.hasClass(S)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(R,b)}),q("["+K+"]",N,o)}),s=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=z,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],I):z;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,I);if(!a)return x;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),y;a.set(b,e)}}),g!==z?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(x,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===y||c.length<1||s.api[c]?s.nextid++:c,b=r(d(this),c,k),b===y?x:(s.api[c]=b,d.each(H,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,s.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,U):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(U,b))}return d.fn["attr"+T].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+T].apply(this,arguments));return a||b.filter("["+U+"]").attr("title",function(){return d.attr(this,U)}).removeAttr(U),b}},function(a,b){if(!b||d.fn[a+T])return x;var c=d.fn[a+T]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+T]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(J))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+T].apply(this,arguments)}),s.version="2.2.1",s.nextid=0,s.inactiveEvents=N,s.zindex=15e3,s.defaults={prerender:y,id:y,overwrite:x,suppress:x,content:{text:x,attr:"title",title:y,button:y},position:{my:"top left",at:"bottom right",target:y,container:y,viewport:y,adjust:{x:0,y:0,mouse:x,scroll:x,resize:x,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:y})}},show:{target:y,event:"mouseenter",effect:x,delay:90,solo:y,ready:y,autofocus:y},hide:{target:y,event:"mouseleave",effect:x,delay:0,fixed:y,inactive:y,leave:"window",distance:y},style:{classes:"",widget:y,width:y,height:y,def:x},events:{render:z,move:z,show:z,hide:z,toggle:z,visible:z,hidden:z,focus:z,blur:z}}})}(window,document);
|
526 |
|
527 |
/* flot v0.8.2 | https://github.com/flot/flot | Copyright (c) 2007-2013 IOLA and Ole Laursen. Licensed under the MIT license. */
|
528 |
(function(e){e.color={};e.color.make=function(t,n,r,i){var s={};s.r=t||0;s.g=n||0;s.b=r||0;s.a=i!=null?i:1;s.add=function(e,t){for(var n=0;n<e.length;++n)s[e.charAt(n)]+=t;return s.normalize()};s.scale=function(e,t){for(var n=0;n<e.length;++n)s[e.charAt(n)]*=t;return s.normalize()};s.toString=function(){if(s.a>=1){return"rgb("+[s.r,s.g,s.b].join(",")+")"}else{return"rgba("+[s.r,s.g,s.b,s.a].join(",")+")"}};s.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}s.r=e(0,parseInt(s.r),255);s.g=e(0,parseInt(s.g),255);s.b=e(0,parseInt(s.b),255);s.a=e(0,s.a,1);return s};s.clone=function(){return e.color.make(s.r,s.b,s.g,s.a)};return s.normalize()};e.color.extract=function(t,n){var r;do{r=t.css(n).toLowerCase();if(r!=""&&r!="transparent")break;t=t.parent()}while(t.length&&!e.nodeName(t.get(0),"body"));if(r=="rgba(0, 0, 0, 0)")r="transparent";return e.color.parse(r)};e.color.parse=function(n){var r,i=e.color.make;if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10));if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]));if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55);if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n))return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]));if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return i(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16));if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))return i(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16));var s=e.trim(n).toLowerCase();if(s=="transparent")return i(255,255,255,0);else{r=t[s]||[0,0,0];return i(r[0],r[1],r[2])}};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(e){function n(t,n){var r=n.children("."+t)[0];if(r==null){r=document.createElement("canvas");r.className=t;e(r).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(n);if(!r.getContext){if(window.G_vmlCanvasManager){r=window.G_vmlCanvasManager.initElement(r)}else{throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.")}}}this.element=r;var i=this.context=r.getContext("2d");var s=window.devicePixelRatio||1,o=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1;this.pixelRatio=s/o;this.resize(n.width(),n.height());this.textContainer=null;this.text={};this._textCache={}}function r(t,r,s,o){function E(e,t){t=[w].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function S(){var t={Canvas:n};for(var r=0;r<o.length;++r){var i=o[r];i.init(w,t);if(i.options)e.extend(true,a,i.options)}}function x(n){e.extend(true,a,n);if(n&&n.colors){a.colors=n.colors}if(a.xaxis.color==null)a.xaxis.color=e.color.parse(a.grid.color).scale("a",.22).toString();if(a.yaxis.color==null)a.yaxis.color=e.color.parse(a.grid.color).scale("a",.22).toString();if(a.xaxis.tickColor==null)a.xaxis.tickColor=a.grid.tickColor||a.xaxis.color;if(a.yaxis.tickColor==null)a.yaxis.tickColor=a.grid.tickColor||a.yaxis.color;if(a.grid.borderColor==null)a.grid.borderColor=a.grid.color;if(a.grid.tickColor==null)a.grid.tickColor=e.color.parse(a.grid.color).scale("a",.22).toString();var r,i,s,o=t.css("font-size"),u=o?+o.replace("px",""):13,f={style:t.css("font-style"),size:Math.round(.8*u),variant:t.css("font-variant"),weight:t.css("font-weight"),family:t.css("font-family")};s=a.xaxes.length||1;for(r=0;r<s;++r){i=a.xaxes[r];if(i&&!i.tickColor){i.tickColor=i.color}i=e.extend(true,{},a.xaxis,i);a.xaxes[r]=i;if(i.font){i.font=e.extend({},f,i.font);if(!i.font.color){i.font.color=i.color}if(!i.font.lineHeight){i.font.lineHeight=Math.round(i.font.size*1.15)}}}s=a.yaxes.length||1;for(r=0;r<s;++r){i=a.yaxes[r];if(i&&!i.tickColor){i.tickColor=i.color}i=e.extend(true,{},a.yaxis,i);a.yaxes[r]=i;if(i.font){i.font=e.extend({},f,i.font);if(!i.font.color){i.font.color=i.color}if(!i.font.lineHeight){i.font.lineHeight=Math.round(i.font.size*1.15)}}}if(a.xaxis.noTicks&&a.xaxis.ticks==null)a.xaxis.ticks=a.xaxis.noTicks;if(a.yaxis.noTicks&&a.yaxis.ticks==null)a.yaxis.ticks=a.yaxis.noTicks;if(a.x2axis){a.xaxes[1]=e.extend(true,{},a.xaxis,a.x2axis);a.xaxes[1].position="top"}if(a.y2axis){a.yaxes[1]=e.extend(true,{},a.yaxis,a.y2axis);a.yaxes[1].position="right"}if(a.grid.coloredAreas)a.grid.markings=a.grid.coloredAreas;if(a.grid.coloredAreasColor)a.grid.markingsColor=a.grid.coloredAreasColor;if(a.lines)e.extend(true,a.series.lines,a.lines);if(a.points)e.extend(true,a.series.points,a.points);if(a.bars)e.extend(true,a.series.bars,a.bars);if(a.shadowSize!=null)a.series.shadowSize=a.shadowSize;if(a.highlightColor!=null)a.series.highlightColor=a.highlightColor;for(r=0;r<a.xaxes.length;++r)O(d,r+1).options=a.xaxes[r];for(r=0;r<a.yaxes.length;++r)O(v,r+1).options=a.yaxes[r];for(var l in b)if(a.hooks[l]&&a.hooks[l].length)b[l]=b[l].concat(a.hooks[l]);E(b.processOptions,[a])}function T(e){u=N(e);M();_()}function N(t){var n=[];for(var r=0;r<t.length;++r){var i=e.extend(true,{},a.series);if(t[r].data!=null){i.data=t[r].data;delete t[r].data;e.extend(true,i,t[r]);t[r].data=i.data}else i.data=t[r];n.push(i)}return n}function C(e,t){var n=e[t+"axis"];if(typeof n=="object")n=n.n;if(typeof n!="number")n=1;return n}function k(){return e.grep(d.concat(v),function(e){return e})}function L(e){var t={},n,r;for(n=0;n<d.length;++n){r=d[n];if(r&&r.used)t["x"+r.n]=r.c2p(e.left)}for(n=0;n<v.length;++n){r=v[n];if(r&&r.used)t["y"+r.n]=r.c2p(e.top)}if(t.x1!==undefined)t.x=t.x1;if(t.y1!==undefined)t.y=t.y1;return t}function A(e){var t={},n,r,i;for(n=0;n<d.length;++n){r=d[n];if(r&&r.used){i="x"+r.n;if(e[i]==null&&r.n==1)i="x";if(e[i]!=null){t.left=r.p2c(e[i]);break}}}for(n=0;n<v.length;++n){r=v[n];if(r&&r.used){i="y"+r.n;if(e[i]==null&&r.n==1)i="y";if(e[i]!=null){t.top=r.p2c(e[i]);break}}}return t}function O(t,n){if(!t[n-1])t[n-1]={n:n,direction:t==d?"x":"y",options:e.extend(true,{},t==d?a.xaxis:a.yaxis)};return t[n-1]}function M(){var t=u.length,n=-1,r;for(r=0;r<u.length;++r){var i=u[r].color;if(i!=null){t--;if(typeof i=="number"&&i>n){n=i}}}if(t<=n){t=n+1}var s,o=[],f=a.colors,l=f.length,c=0;for(r=0;r<t;r++){s=e.color.parse(f[r%l]||"#666");if(r%l==0&&r){if(c>=0){if(c<.5){c=-c-.2}else c=0}else c=-c}o[r]=s.scale("rgb",1+c)}var h=0,p;for(r=0;r<u.length;++r){p=u[r];if(p.color==null){p.color=o[h].toString();++h}else if(typeof p.color=="number")p.color=o[p.color].toString();if(p.lines.show==null){var m,g=true;for(m in p)if(p[m]&&p[m].show){g=false;break}if(g)p.lines.show=true}if(p.lines.zero==null){p.lines.zero=!!p.lines.fill}p.xaxis=O(d,C(p,"x"));p.yaxis=O(v,C(p,"y"))}}function _(){function x(e,t,n){if(t<e.datamin&&t!=-r)e.datamin=t;if(n>e.datamax&&n!=r)e.datamax=n}var t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.MAX_VALUE,i,s,o,a,f,l,c,h,p,d,v,m,g,y,w,S;e.each(k(),function(e,r){r.datamin=t;r.datamax=n;r.used=false});for(i=0;i<u.length;++i){l=u[i];l.datapoints={points:[]};E(b.processRawData,[l,l.data,l.datapoints])}for(i=0;i<u.length;++i){l=u[i];w=l.data;S=l.datapoints.format;if(!S){S=[];S.push({x:true,number:true,required:true});S.push({y:true,number:true,required:true});if(l.bars.show||l.lines.show&&l.lines.fill){var T=!!(l.bars.show&&l.bars.zero||l.lines.show&&l.lines.zero);S.push({y:true,number:true,required:false,defaultValue:0,autoscale:T});if(l.bars.horizontal){delete S[S.length-1].y;S[S.length-1].x=true}}l.datapoints.format=S}if(l.datapoints.pointsize!=null)continue;l.datapoints.pointsize=S.length;h=l.datapoints.pointsize;c=l.datapoints.points;var N=l.lines.show&&l.lines.steps;l.xaxis.used=l.yaxis.used=true;for(s=o=0;s<w.length;++s,o+=h){y=w[s];var C=y==null;if(!C){for(a=0;a<h;++a){m=y[a];g=S[a];if(g){if(g.number&&m!=null){m=+m;if(isNaN(m))m=null;else if(m==Infinity)m=r;else if(m==-Infinity)m=-r}if(m==null){if(g.required)C=true;if(g.defaultValue!=null)m=g.defaultValue}}c[o+a]=m}}if(C){for(a=0;a<h;++a){m=c[o+a];if(m!=null){g=S[a];if(g.autoscale!==false){if(g.x){x(l.xaxis,m,m)}if(g.y){x(l.yaxis,m,m)}}}c[o+a]=null}}else{if(N&&o>0&&c[o-h]!=null&&c[o-h]!=c[o]&&c[o-h+1]!=c[o+1]){for(a=0;a<h;++a)c[o+h+a]=c[o+a];c[o+1]=c[o-h+1];o+=h}}}}for(i=0;i<u.length;++i){l=u[i];E(b.processDatapoints,[l,l.datapoints])}for(i=0;i<u.length;++i){l=u[i];c=l.datapoints.points;h=l.datapoints.pointsize;S=l.datapoints.format;var L=t,A=t,O=n,M=n;for(s=0;s<c.length;s+=h){if(c[s]==null)continue;for(a=0;a<h;++a){m=c[s+a];g=S[a];if(!g||g.autoscale===false||m==r||m==-r)continue;if(g.x){if(m<L)L=m;if(m>O)O=m}if(g.y){if(m<A)A=m;if(m>M)M=m}}}if(l.bars.show){var _;switch(l.bars.align){case"left":_=0;break;case"right":_=-l.bars.barWidth;break;default:_=-l.bars.barWidth/2}if(l.bars.horizontal){A+=_;M+=_+l.bars.barWidth}else{L+=_;O+=_+l.bars.barWidth}}x(l.xaxis,L,O);x(l.yaxis,A,M)}e.each(k(),function(e,r){if(r.datamin==t)r.datamin=null;if(r.datamax==n)r.datamax=null})}function D(){t.css("padding",0).children().filter(function(){return!e(this).hasClass("flot-overlay")&&!e(this).hasClass("flot-base")}).remove();if(t.css("position")=="static")t.css("position","relative");f=new n("flot-base",t);l=new n("flot-overlay",t);h=f.context;p=l.context;c=e(l.element).unbind();var r=t.data("plot");if(r){r.shutdown();l.clear()}t.data("plot",w)}function P(){if(a.grid.hoverable){c.mousemove(at);c.bind("mouseleave",ft)}if(a.grid.clickable)c.click(lt);E(b.bindEvents,[c])}function H(){if(ot)clearTimeout(ot);c.unbind("mousemove",at);c.unbind("mouseleave",ft);c.unbind("click",lt);E(b.shutdown,[c])}function B(e){function t(e){return e}var n,r,i=e.options.transform||t,s=e.options.inverseTransform;if(e.direction=="x"){n=e.scale=g/Math.abs(i(e.max)-i(e.min));r=Math.min(i(e.max),i(e.min))}else{n=e.scale=y/Math.abs(i(e.max)-i(e.min));n=-n;r=Math.max(i(e.max),i(e.min))}if(i==t)e.p2c=function(e){return(e-r)*n};else e.p2c=function(e){return(i(e)-r)*n};if(!s)e.c2p=function(e){return r+e/n};else e.c2p=function(e){return s(r+e/n)}}function j(e){var t=e.options,n=e.ticks||[],r=t.labelWidth||0,i=t.labelHeight||0,s=r||(e.direction=="x"?Math.floor(f.width/(n.length||1)):null),o=e.direction+"Axis "+e.direction+e.n+"Axis",u="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+o,a=t.font||"flot-tick-label tickLabel";for(var l=0;l<n.length;++l){var c=n[l];if(!c.label)continue;var h=f.getTextInfo(u,c.label,a,null,s);r=Math.max(r,h.width);i=Math.max(i,h.height)}e.labelWidth=t.labelWidth||r;e.labelHeight=t.labelHeight||i}function F(t){var n=t.labelWidth,r=t.labelHeight,i=t.options.position,s=t.direction==="x",o=t.options.tickLength,u=a.grid.axisMargin,l=a.grid.labelMargin,c=true,h=true,p=true,g=false;e.each(s?d:v,function(e,n){if(n&&n.reserveSpace){if(n===t){g=true}else if(n.options.position===i){if(g){h=false}else{c=false}}if(!g){p=false}}});if(h){u=0}if(o==null){o=p?"full":5}if(!isNaN(+o))l+=+o;if(s){r+=l;if(i=="bottom"){m.bottom+=r+u;t.box={top:f.height-m.bottom,height:r}}else{t.box={top:m.top+u,height:r};m.top+=r+u}}else{n+=l;if(i=="left"){t.box={left:m.left+u,width:n};m.left+=n+u}else{m.right+=n+u;t.box={left:f.width-m.right,width:n}}}t.position=i;t.tickLength=o;t.box.padding=l;t.innermost=c}function I(e){if(e.direction=="x"){e.box.left=m.left-e.labelWidth/2;e.box.width=f.width-m.left-m.right+e.labelWidth}else{e.box.top=m.top-e.labelHeight/2;e.box.height=f.height-m.bottom-m.top+e.labelHeight}}function q(){var t=a.grid.minBorderMargin,n,r;if(t==null){t=0;for(r=0;r<u.length;++r)t=Math.max(t,2*(u[r].points.radius+u[r].points.lineWidth/2))}var i={left:t,right:t,top:t,bottom:t};e.each(k(),function(e,t){if(t.reserveSpace&&t.ticks&&t.ticks.length){var n=t.ticks[t.ticks.length-1];if(t.direction==="x"){i.left=Math.max(i.left,t.labelWidth/2);if(n.v<=t.max){i.right=Math.max(i.right,t.labelWidth/2)}}else{i.bottom=Math.max(i.bottom,t.labelHeight/2);if(n.v<=t.max){i.top=Math.max(i.top,t.labelHeight/2)}}}});m.left=Math.ceil(Math.max(i.left,m.left));m.right=Math.ceil(Math.max(i.right,m.right));m.top=Math.ceil(Math.max(i.top,m.top));m.bottom=Math.ceil(Math.max(i.bottom,m.bottom))}function R(){var t,n=k(),r=a.grid.show;for(var i in m){var s=a.grid.margin||0;m[i]=typeof s=="number"?s:s[i]||0}E(b.processOffset,[m]);for(var i in m){if(typeof a.grid.borderWidth=="object"){m[i]+=r?a.grid.borderWidth[i]:0}else{m[i]+=r?a.grid.borderWidth:0}}e.each(n,function(e,t){t.show=t.options.show;if(t.show==null)t.show=t.used;t.reserveSpace=t.show||t.options.reserveSpace;U(t)});if(r){var o=e.grep(n,function(e){return e.reserveSpace});e.each(o,function(e,t){z(t);W(t);X(t,t.ticks);j(t)});for(t=o.length-1;t>=0;--t)F(o[t]);q();e.each(o,function(e,t){I(t)})}g=f.width-m.left-m.right;y=f.height-m.bottom-m.top;e.each(n,function(e,t){B(t)});if(r){G()}it()}function U(e){var t=e.options,n=+(t.min!=null?t.min:e.datamin),r=+(t.max!=null?t.max:e.datamax),i=r-n;if(i==0){var s=r==0?1:.01;if(t.min==null)n-=s;if(t.max==null||t.min!=null)r+=s}else{var o=t.autoscaleMargin;if(o!=null){if(t.min==null){n-=i*o;if(n<0&&e.datamin!=null&&e.datamin>=0)n=0}if(t.max==null){r+=i*o;if(r>0&&e.datamax!=null&&e.datamax<=0)r=0}}}e.min=n;e.max=r}function z(t){var n=t.options;var r;if(typeof n.ticks=="number"&&n.ticks>0)r=n.ticks;else r=.3*Math.sqrt(t.direction=="x"?f.width:f.height);var s=(t.max-t.min)/r,o=-Math.floor(Math.log(s)/Math.LN10),u=n.tickDecimals;if(u!=null&&o>u){o=u}var a=Math.pow(10,-o),l=s/a,c;if(l<1.5){c=1}else if(l<3){c=2;if(l>2.25&&(u==null||o+1<=u)){c=2.5;++o}}else if(l<7.5){c=5}else{c=10}c*=a;if(n.minTickSize!=null&&c<n.minTickSize){c=n.minTickSize}t.delta=s;t.tickDecimals=Math.max(0,u!=null?u:o);t.tickSize=n.tickSize||c;if(n.mode=="time"&&!t.tickGenerator){throw new Error("Time mode requires the flot.time plugin.")}if(!t.tickGenerator){t.tickGenerator=function(e){var t=[],n=i(e.min,e.tickSize),r=0,s=Number.NaN,o;do{o=s;s=n+r*e.tickSize;t.push(s);++r}while(s<e.max&&s!=o);return t};t.tickFormatter=function(e,t){var n=t.tickDecimals?Math.pow(10,t.tickDecimals):1;var r=""+Math.round(e*n)/n;if(t.tickDecimals!=null){var i=r.indexOf(".");var s=i==-1?0:r.length-i-1;if(s<t.tickDecimals){return(s?r:r+".")+(""+n).substr(1,t.tickDecimals-s)}}return r}}if(e.isFunction(n.tickFormatter))t.tickFormatter=function(e,t){return""+n.tickFormatter(e,t)};if(n.alignTicksWithAxis!=null){var h=(t.direction=="x"?d:v)[n.alignTicksWithAxis-1];if(h&&h.used&&h!=t){var p=t.tickGenerator(t);if(p.length>0){if(n.min==null)t.min=Math.min(t.min,p[0]);if(n.max==null&&p.length>1)t.max=Math.max(t.max,p[p.length-1])}t.tickGenerator=function(e){var t=[],n,r;for(r=0;r<h.ticks.length;++r){n=(h.ticks[r].v-h.min)/(h.max-h.min);n=e.min+n*(e.max-e.min);t.push(n)}return t};if(!t.mode&&n.tickDecimals==null){var m=Math.max(0,-Math.floor(Math.log(t.delta)/Math.LN10)+1),g=t.tickGenerator(t);if(!(g.length>1&&/\..*0$/.test((g[1]-g[0]).toFixed(m))))t.tickDecimals=m}}}}function W(t){var n=t.options.ticks,r=[];if(n==null||typeof n=="number"&&n>0)r=t.tickGenerator(t);else if(n){if(e.isFunction(n))r=n(t);else r=n}var i,s;t.ticks=[];for(i=0;i<r.length;++i){var o=null;var u=r[i];if(typeof u=="object"){s=+u[0];if(u.length>1)o=u[1]}else s=+u;if(o==null)o=t.tickFormatter(s,t);if(!isNaN(s))t.ticks.push({v:s,label:o})}}function X(e,t){if(e.options.autoscaleMargin&&t.length>0){if(e.options.min==null)e.min=Math.min(e.min,t[0].v);if(e.options.max==null&&t.length>1)e.max=Math.max(e.max,t[t.length-1].v)}}function V(){f.clear();E(b.drawBackground,[h]);var e=a.grid;if(e.show&&e.backgroundColor)K();if(e.show&&!e.aboveData){Q()}for(var t=0;t<u.length;++t){E(b.drawSeries,[h,u[t]]);Y(u[t])}E(b.draw,[h]);if(e.show&&e.aboveData){Q()}f.render();ht()}function J(e,t){var n,r,i,s,o=k();for(var u=0;u<o.length;++u){n=o[u];if(n.direction==t){s=t+n.n+"axis";if(!e[s]&&n.n==1)s=t+"axis";if(e[s]){r=e[s].from;i=e[s].to;break}}}if(!e[s]){n=t=="x"?d[0]:v[0];r=e[t+"1"];i=e[t+"2"]}if(r!=null&&i!=null&&r>i){var a=r;r=i;i=a}return{from:r,to:i,axis:n}}function K(){h.save();h.translate(m.left,m.top);h.fillStyle=bt(a.grid.backgroundColor,y,0,"rgba(255, 255, 255, 0)");h.fillRect(0,0,g,y);h.restore()}function Q(){var t,n,r,i;h.save();h.translate(m.left,m.top);var s=a.grid.markings;if(s){if(e.isFunction(s)){n=w.getAxes();n.xmin=n.xaxis.min;n.xmax=n.xaxis.max;n.ymin=n.yaxis.min;n.ymax=n.yaxis.max;s=s(n)}for(t=0;t<s.length;++t){var o=s[t],u=J(o,"x"),f=J(o,"y");if(u.from==null)u.from=u.axis.min;if(u.to==null)u.to=u.axis.max;if(f.from==null)f.from=f.axis.min;if(f.to==null)f.to=f.axis.max;if(u.to<u.axis.min||u.from>u.axis.max||f.to<f.axis.min||f.from>f.axis.max)continue;u.from=Math.max(u.from,u.axis.min);u.to=Math.min(u.to,u.axis.max);f.from=Math.max(f.from,f.axis.min);f.to=Math.min(f.to,f.axis.max);if(u.from==u.to&&f.from==f.to)continue;u.from=u.axis.p2c(u.from);u.to=u.axis.p2c(u.to);f.from=f.axis.p2c(f.from);f.to=f.axis.p2c(f.to);if(u.from==u.to||f.from==f.to){h.beginPath();h.strokeStyle=o.color||a.grid.markingsColor;h.lineWidth=o.lineWidth||a.grid.markingsLineWidth;h.moveTo(u.from,f.from);h.lineTo(u.to,f.to);h.stroke()}else{h.fillStyle=o.color||a.grid.markingsColor;h.fillRect(u.from,f.to,u.to-u.from,f.from-f.to)}}}n=k();r=a.grid.borderWidth;for(var l=0;l<n.length;++l){var c=n[l],p=c.box,d=c.tickLength,v,b,E,S;if(!c.show||c.ticks.length==0)continue;h.lineWidth=1;if(c.direction=="x"){v=0;if(d=="full")b=c.position=="top"?0:y;else b=p.top-m.top+(c.position=="top"?p.height:0)}else{b=0;if(d=="full")v=c.position=="left"?0:g;else v=p.left-m.left+(c.position=="left"?p.width:0)}if(!c.innermost){h.strokeStyle=c.options.color;h.beginPath();E=S=0;if(c.direction=="x")E=g+1;else S=y+1;if(h.lineWidth==1){if(c.direction=="x"){b=Math.floor(b)+.5}else{v=Math.floor(v)+.5}}h.moveTo(v,b);h.lineTo(v+E,b+S);h.stroke()}h.strokeStyle=c.options.tickColor;h.beginPath();for(t=0;t<c.ticks.length;++t){var x=c.ticks[t].v;E=S=0;if(isNaN(x)||x<c.min||x>c.max||d=="full"&&(typeof r=="object"&&r[c.position]>0||r>0)&&(x==c.min||x==c.max))continue;if(c.direction=="x"){v=c.p2c(x);S=d=="full"?-y:d;if(c.position=="top")S=-S}else{b=c.p2c(x);E=d=="full"?-g:d;if(c.position=="left")E=-E}if(h.lineWidth==1){if(c.direction=="x")v=Math.floor(v)+.5;else b=Math.floor(b)+.5}h.moveTo(v,b);h.lineTo(v+E,b+S)}h.stroke()}if(r){i=a.grid.borderColor;if(typeof r=="object"||typeof i=="object"){if(typeof r!=="object"){r={top:r,right:r,bottom:r,left:r}}if(typeof i!=="object"){i={top:i,right:i,bottom:i,left:i}}if(r.top>0){h.strokeStyle=i.top;h.lineWidth=r.top;h.beginPath();h.moveTo(0-r.left,0-r.top/2);h.lineTo(g,0-r.top/2);h.stroke()}if(r.right>0){h.strokeStyle=i.right;h.lineWidth=r.right;h.beginPath();h.moveTo(g+r.right/2,0-r.top);h.lineTo(g+r.right/2,y);h.stroke()}if(r.bottom>0){h.strokeStyle=i.bottom;h.lineWidth=r.bottom;h.beginPath();h.moveTo(g+r.right,y+r.bottom/2);h.lineTo(0,y+r.bottom/2);h.stroke()}if(r.left>0){h.strokeStyle=i.left;h.lineWidth=r.left;h.beginPath();h.moveTo(0-r.left/2,y+r.bottom);h.lineTo(0-r.left/2,0);h.stroke()}}else{h.lineWidth=r;h.strokeStyle=a.grid.borderColor;h.strokeRect(-r/2,-r/2,g+r,y+r)}}h.restore()}function G(){e.each(k(),function(e,t){var n=t.box,r=t.direction+"Axis "+t.direction+t.n+"Axis",i="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+r,s=t.options.font||"flot-tick-label tickLabel",o,u,a,l,c;f.removeText(i);if(!t.show||t.ticks.length==0)return;for(var h=0;h<t.ticks.length;++h){o=t.ticks[h];if(!o.label||o.v<t.min||o.v>t.max)continue;if(t.direction=="x"){l="center";u=m.left+t.p2c(o.v);if(t.position=="bottom"){a=n.top+n.padding}else{a=n.top+n.height-n.padding;c="bottom"}}else{c="middle";a=m.top+t.p2c(o.v);if(t.position=="left"){u=n.left+n.width-n.padding;l="right"}else{u=n.left+n.padding}}f.addText(i,u,a,o.label,s,null,null,l,c)}})}function Y(e){if(e.lines.show)Z(e);if(e.bars.show)nt(e);if(e.points.show)et(e)}function Z(e){function t(e,t,n,r,i){var s=e.points,o=e.pointsize,u=null,a=null;h.beginPath();for(var f=o;f<s.length;f+=o){var l=s[f-o],c=s[f-o+1],p=s[f],d=s[f+1];if(l==null||p==null)continue;if(c<=d&&c<i.min){if(d<i.min)continue;l=(i.min-c)/(d-c)*(p-l)+l;c=i.min}else if(d<=c&&d<i.min){if(c<i.min)continue;p=(i.min-c)/(d-c)*(p-l)+l;d=i.min}if(c>=d&&c>i.max){if(d>i.max)continue;l=(i.max-c)/(d-c)*(p-l)+l;c=i.max}else if(d>=c&&d>i.max){if(c>i.max)continue;p=(i.max-c)/(d-c)*(p-l)+l;d=i.max}if(l<=p&&l<r.min){if(p<r.min)continue;c=(r.min-l)/(p-l)*(d-c)+c;l=r.min}else if(p<=l&&p<r.min){if(l<r.min)continue;d=(r.min-l)/(p-l)*(d-c)+c;p=r.min}if(l>=p&&l>r.max){if(p>r.max)continue;c=(r.max-l)/(p-l)*(d-c)+c;l=r.max}else if(p>=l&&p>r.max){if(l>r.max)continue;d=(r.max-l)/(p-l)*(d-c)+c;p=r.max}if(l!=u||c!=a)h.moveTo(r.p2c(l)+t,i.p2c(c)+n);u=p;a=d;h.lineTo(r.p2c(p)+t,i.p2c(d)+n)}h.stroke()}function n(e,t,n){var r=e.points,i=e.pointsize,s=Math.min(Math.max(0,n.min),n.max),o=0,u,a=false,f=1,l=0,c=0;while(true){if(i>0&&o>r.length+i)break;o+=i;var p=r[o-i],d=r[o-i+f],v=r[o],m=r[o+f];if(a){if(i>0&&p!=null&&v==null){c=o;i=-i;f=2;continue}if(i<0&&o==l+i){h.fill();a=false;i=-i;f=1;o=l=c+i;continue}}if(p==null||v==null)continue;if(p<=v&&p<t.min){if(v<t.min)continue;d=(t.min-p)/(v-p)*(m-d)+d;p=t.min}else if(v<=p&&v<t.min){if(p<t.min)continue;m=(t.min-p)/(v-p)*(m-d)+d;v=t.min}if(p>=v&&p>t.max){if(v>t.max)continue;d=(t.max-p)/(v-p)*(m-d)+d;p=t.max}else if(v>=p&&v>t.max){if(p>t.max)continue;m=(t.max-p)/(v-p)*(m-d)+d;v=t.max}if(!a){h.beginPath();h.moveTo(t.p2c(p),n.p2c(s));a=true}if(d>=n.max&&m>=n.max){h.lineTo(t.p2c(p),n.p2c(n.max));h.lineTo(t.p2c(v),n.p2c(n.max));continue}else if(d<=n.min&&m<=n.min){h.lineTo(t.p2c(p),n.p2c(n.min));h.lineTo(t.p2c(v),n.p2c(n.min));continue}var g=p,y=v;if(d<=m&&d<n.min&&m>=n.min){p=(n.min-d)/(m-d)*(v-p)+p;d=n.min}else if(m<=d&&m<n.min&&d>=n.min){v=(n.min-d)/(m-d)*(v-p)+p;m=n.min}if(d>=m&&d>n.max&&m<=n.max){p=(n.max-d)/(m-d)*(v-p)+p;d=n.max}else if(m>=d&&m>n.max&&d<=n.max){v=(n.max-d)/(m-d)*(v-p)+p;m=n.max}if(p!=g){h.lineTo(t.p2c(g),n.p2c(d))}h.lineTo(t.p2c(p),n.p2c(d));h.lineTo(t.p2c(v),n.p2c(m));if(v!=y){h.lineTo(t.p2c(v),n.p2c(m));h.lineTo(t.p2c(y),n.p2c(m))}}}h.save();h.translate(m.left,m.top);h.lineJoin="round";var r=e.lines.lineWidth,i=e.shadowSize;if(r>0&&i>0){h.lineWidth=i;h.strokeStyle="rgba(0,0,0,0.1)";var s=Math.PI/18;t(e.datapoints,Math.sin(s)*(r/2+i/2),Math.cos(s)*(r/2+i/2),e.xaxis,e.yaxis);h.lineWidth=i/2;t(e.datapoints,Math.sin(s)*(r/2+i/4),Math.cos(s)*(r/2+i/4),e.xaxis,e.yaxis)}h.lineWidth=r;h.strokeStyle=e.color;var o=rt(e.lines,e.color,0,y);if(o){h.fillStyle=o;n(e.datapoints,e.xaxis,e.yaxis)}if(r>0)t(e.datapoints,0,0,e.xaxis,e.yaxis);h.restore()}function et(e){function t(e,t,n,r,i,s,o,u){var a=e.points,f=e.pointsize;for(var l=0;l<a.length;l+=f){var c=a[l],p=a[l+1];if(c==null||c<s.min||c>s.max||p<o.min||p>o.max)continue;h.beginPath();c=s.p2c(c);p=o.p2c(p)+r;if(u=="circle")h.arc(c,p,t,0,i?Math.PI:Math.PI*2,false);else u(h,c,p,t,i);h.closePath();if(n){h.fillStyle=n;h.fill()}h.stroke()}}h.save();h.translate(m.left,m.top);var n=e.points.lineWidth,r=e.shadowSize,i=e.points.radius,s=e.points.symbol;if(n==0)n=1e-4;if(n>0&&r>0){var o=r/2;h.lineWidth=o;h.strokeStyle="rgba(0,0,0,0.1)";t(e.datapoints,i,null,o+o/2,true,e.xaxis,e.yaxis,s);h.strokeStyle="rgba(0,0,0,0.2)";t(e.datapoints,i,null,o/2,true,e.xaxis,e.yaxis,s)}h.lineWidth=n;h.strokeStyle=e.color;t(e.datapoints,i,rt(e.points,e.color),0,false,e.xaxis,e.yaxis,s);h.restore()}function tt(e,t,n,r,i,s,o,u,a,f,l){var c,h,p,d,v,m,g,y,b;if(f){y=m=g=true;v=false;c=n;h=e;d=t+r;p=t+i;if(h<c){b=h;h=c;c=b;v=true;m=false}}else{v=m=g=true;y=false;c=e+r;h=e+i;p=n;d=t;if(d<p){b=d;d=p;p=b;y=true;g=false}}if(h<o.min||c>o.max||d<u.min||p>u.max)return;if(c<o.min){c=o.min;v=false}if(h>o.max){h=o.max;m=false}if(p<u.min){p=u.min;y=false}if(d>u.max){d=u.max;g=false}c=o.p2c(c);p=u.p2c(p);h=o.p2c(h);d=u.p2c(d);if(s){a.fillStyle=s(p,d);a.fillRect(c,d,h-c,p-d)}if(l>0&&(v||m||g||y)){a.beginPath();a.moveTo(c,p);if(v)a.lineTo(c,d);else a.moveTo(c,d);if(g)a.lineTo(h,d);else a.moveTo(h,d);if(m)a.lineTo(h,p);else a.moveTo(h,p);if(y)a.lineTo(c,p);else a.moveTo(c,p);a.stroke()}}function nt(e){function t(t,n,r,i,s,o){var u=t.points,a=t.pointsize;for(var f=0;f<u.length;f+=a){if(u[f]==null)continue;tt(u[f],u[f+1],u[f+2],n,r,i,s,o,h,e.bars.horizontal,e.bars.lineWidth)}}h.save();h.translate(m.left,m.top);h.lineWidth=e.bars.lineWidth;h.strokeStyle=e.color;var n;switch(e.bars.align){case"left":n=0;break;case"right":n=-e.bars.barWidth;break;default:n=-e.bars.barWidth/2}var r=e.bars.fill?function(t,n){return rt(e.bars,e.color,t,n)}:null;t(e.datapoints,n,n+e.bars.barWidth,r,e.xaxis,e.yaxis);h.restore()}function rt(t,n,r,i){var s=t.fill;if(!s)return null;if(t.fillColor)return bt(t.fillColor,r,i,n);var o=e.color.parse(n);o.a=typeof s=="number"?s:.4;o.normalize();return o.toString()}function it(){if(a.legend.container!=null){e(a.legend.container).html("")}else{t.find(".legend").remove()}if(!a.legend.show){return}var n=[],r=[],i=false,s=a.legend.labelFormatter,o,f;for(var l=0;l<u.length;++l){o=u[l];if(o.label){f=s?s(o.label,o):o.label;if(f){r.push({label:f,color:o.color})}}}if(a.legend.sorted){if(e.isFunction(a.legend.sorted)){r.sort(a.legend.sorted)}else if(a.legend.sorted=="reverse"){r.reverse()}else{var c=a.legend.sorted!="descending";r.sort(function(e,t){return e.label==t.label?0:e.label<t.label!=c?1:-1})}}for(var l=0;l<r.length;++l){var h=r[l];if(l%a.legend.noColumns==0){if(i)n.push("</tr>");n.push("<tr>");i=true}n.push('<td class="legendColorBox"><div style="border:1px solid '+a.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+h.color+';overflow:hidden"></div></div></td>'+'<td class="legendLabel">'+h.label+"</td>")}if(i)n.push("</tr>");if(n.length==0)return;var p='<table style="font-size:smaller;color:'+a.grid.color+'">'+n.join("")+"</table>";if(a.legend.container!=null)e(a.legend.container).html(p);else{var d="",v=a.legend.position,g=a.legend.margin;if(g[0]==null)g=[g,g];if(v.charAt(0)=="n")d+="top:"+(g[1]+m.top)+"px;";else if(v.charAt(0)=="s")d+="bottom:"+(g[1]+m.bottom)+"px;";if(v.charAt(1)=="e")d+="right:"+(g[0]+m.right)+"px;";else if(v.charAt(1)=="w")d+="left:"+(g[0]+m.left)+"px;";var y=e('<div class="legend">'+p.replace('style="','style="position:absolute;'+d+";")+"</div>").appendTo(t);if(a.legend.backgroundOpacity!=0){var b=a.legend.backgroundColor;if(b==null){b=a.grid.backgroundColor;if(b&&typeof b=="string")b=e.color.parse(b);else b=e.color.extract(y,"background-color");b.a=1;b=b.toString()}var w=y.children();e('<div style="position:absolute;width:'+w.width()+"px;height:"+w.height()+"px;"+d+"background-color:"+b+';"> </div>').prependTo(y).css("opacity",a.legend.backgroundOpacity)}}}function ut(e,t,n){var r=a.grid.mouseActiveRadius,i=r*r+1,s=null,o=false,f,l,c;for(f=u.length-1;f>=0;--f){if(!n(u[f]))continue;var h=u[f],p=h.xaxis,d=h.yaxis,v=h.datapoints.points,m=p.c2p(e),g=d.c2p(t),y=r/p.scale,b=r/d.scale;c=h.datapoints.pointsize;if(p.options.inverseTransform)y=Number.MAX_VALUE;if(d.options.inverseTransform)b=Number.MAX_VALUE;if(h.lines.show||h.points.show){for(l=0;l<v.length;l+=c){var w=v[l],E=v[l+1];if(w==null)continue;if(w-m>y||w-m<-y||E-g>b||E-g<-b)continue;var S=Math.abs(p.p2c(w)-e),x=Math.abs(d.p2c(E)-t),T=S*S+x*x;if(T<i){i=T;s=[f,l/c]}}}if(h.bars.show&&!s){var N,C;switch(h.bars.align){case"left":N=0;break;case"right":N=-h.bars.barWidth;break;default:N=-h.bars.barWidth/2}C=N+h.bars.barWidth;for(l=0;l<v.length;l+=c){var w=v[l],E=v[l+1],k=v[l+2];if(w==null)continue;if(u[f].bars.horizontal?m<=Math.max(k,w)&&m>=Math.min(k,w)&&g>=E+N&&g<=E+C:m>=w+N&&m<=w+C&&g>=Math.min(k,E)&&g<=Math.max(k,E))s=[f,l/c]}}}if(s){f=s[0];l=s[1];c=u[f].datapoints.pointsize;return{datapoint:u[f].datapoints.points.slice(l*c,(l+1)*c),dataIndex:l,series:u[f],seriesIndex:f}}return null}function at(e){if(a.grid.hoverable)ct("plothover",e,function(e){return e["hoverable"]!=false})}function ft(e){if(a.grid.hoverable)ct("plothover",e,function(e){return false})}function lt(e){ct("plotclick",e,function(e){return e["clickable"]!=false})}function ct(e,n,r){var i=c.offset(),s=n.pageX-i.left-m.left,o=n.pageY-i.top-m.top,u=L({left:s,top:o});u.pageX=n.pageX;u.pageY=n.pageY;var f=ut(s,o,r);if(f){f.pageX=parseInt(f.series.xaxis.p2c(f.datapoint[0])+i.left+m.left,10);f.pageY=parseInt(f.series.yaxis.p2c(f.datapoint[1])+i.top+m.top,10)}if(a.grid.autoHighlight){for(var l=0;l<st.length;++l){var h=st[l];if(h.auto==e&&!(f&&h.series==f.series&&h.point[0]==f.datapoint[0]&&h.point[1]==f.datapoint[1]))vt(h.series,h.point)}if(f)dt(f.series,f.datapoint,e)}t.trigger(e,[u,f])}function ht(){var e=a.interaction.redrawOverlayInterval;if(e==-1){pt();return}if(!ot)ot=setTimeout(pt,e)}function pt(){ot=null;p.save();l.clear();p.translate(m.left,m.top);var e,t;for(e=0;e<st.length;++e){t=st[e];if(t.series.bars.show)yt(t.series,t.point);else gt(t.series,t.point)}p.restore();E(b.drawOverlay,[p])}function dt(e,t,n){if(typeof e=="number")e=u[e];if(typeof t=="number"){var r=e.datapoints.pointsize;t=e.datapoints.points.slice(r*t,r*(t+1))}var i=mt(e,t);if(i==-1){st.push({series:e,point:t,auto:n});ht()}else if(!n)st[i].auto=false}function vt(e,t){if(e==null&&t==null){st=[];ht();return}if(typeof e=="number")e=u[e];if(typeof t=="number"){var n=e.datapoints.pointsize;t=e.datapoints.points.slice(n*t,n*(t+1))}var r=mt(e,t);if(r!=-1){st.splice(r,1);ht()}}function mt(e,t){for(var n=0;n<st.length;++n){var r=st[n];if(r.series==e&&r.point[0]==t[0]&&r.point[1]==t[1])return n}return-1}function gt(t,n){var r=n[0],i=n[1],s=t.xaxis,o=t.yaxis,u=typeof t.highlightColor==="string"?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString();if(r<s.min||r>s.max||i<o.min||i>o.max)return;var a=t.points.radius+t.points.lineWidth/2;p.lineWidth=a;p.strokeStyle=u;var f=1.5*a;r=s.p2c(r);i=o.p2c(i);p.beginPath();if(t.points.symbol=="circle")p.arc(r,i,f,0,2*Math.PI,false);else t.points.symbol(p,r,i,f,false);p.closePath();p.stroke()}function yt(t,n){var r=typeof t.highlightColor==="string"?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),i=r,s;switch(t.bars.align){case"left":s=0;break;case"right":s=-t.bars.barWidth;break;default:s=-t.bars.barWidth/2}p.lineWidth=t.bars.lineWidth;p.strokeStyle=r;tt(n[0],n[1],n[2]||0,s,s+t.bars.barWidth,function(){return i},t.xaxis,t.yaxis,p,t.bars.horizontal,t.bars.lineWidth)}function bt(t,n,r,i){if(typeof t=="string")return t;else{var s=h.createLinearGradient(0,r,0,n);for(var o=0,u=t.colors.length;o<u;++o){var a=t.colors[o];if(typeof a!="string"){var f=e.color.parse(i);if(a.brightness!=null)f=f.scale("rgb",a.brightness);if(a.opacity!=null)f.a*=a.opacity;a=f.toString()}s.addColorStop(o/(u-1),a)}return s}}var u=[],a={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false,zero:true},shadowSize:3,highlightColor:null},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},f=null,l=null,c=null,h=null,p=null,d=[],v=[],m={left:0,right:0,top:0,bottom:0},g=0,y=0,b={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},w=this;w.setData=T;w.setupGrid=R;w.draw=V;w.getPlaceholder=function(){return t};w.getCanvas=function(){return f.element};w.getPlotOffset=function(){return m};w.width=function(){return g};w.height=function(){return y};w.offset=function(){var e=c.offset();e.left+=m.left;e.top+=m.top;return e};w.getData=function(){return u};w.getAxes=function(){var t={},n;e.each(d.concat(v),function(e,n){if(n)t[n.direction+(n.n!=1?n.n:"")+"axis"]=n});return t};w.getXAxes=function(){return d};w.getYAxes=function(){return v};w.c2p=L;w.p2c=A;w.getOptions=function(){return a};w.highlight=dt;w.unhighlight=vt;w.triggerRedrawOverlay=ht;w.pointOffset=function(e){return{left:parseInt(d[C(e,"x")-1].p2c(+e.x)+m.left,10),top:parseInt(v[C(e,"y")-1].p2c(+e.y)+m.top,10)}};w.shutdown=H;w.destroy=function(){H();t.removeData("plot").empty();u=[];a=null;f=null;l=null;c=null;h=null;p=null;d=[];v=[];b=null;st=[];w=null};w.resize=function(){var e=t.width(),n=t.height();f.resize(e,n);l.resize(e,n)};w.hooks=b;S(w);x(s);D();T(r);R();V();P();var st=[],ot=null}function i(e,t){return t*Math.floor(e/t)}var t=Object.prototype.hasOwnProperty;n.prototype.resize=function(e,t){if(e<=0||t<=0){throw new Error("Invalid dimensions for plot, width = "+e+", height = "+t)}var n=this.element,r=this.context,i=this.pixelRatio;if(this.width!=e){n.width=e*i;n.style.width=e+"px";this.width=e}if(this.height!=t){n.height=t*i;n.style.height=t+"px";this.height=t}r.restore();r.save();r.scale(i,i)};n.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};n.prototype.render=function(){var e=this._textCache;for(var n in e){if(t.call(e,n)){var r=this.getTextLayer(n),i=e[n];r.hide();for(var s in i){if(t.call(i,s)){var o=i[s];for(var u in o){if(t.call(o,u)){var a=o[u].positions;for(var f=0,l;l=a[f];f++){if(l.active){if(!l.rendered){r.append(l.element);l.rendered=true}}else{a.splice(f--,1);if(l.rendered){l.element.detach()}}}if(a.length==0){delete o[u]}}}}}r.show()}}};n.prototype.getTextLayer=function(t){var n=this.text[t];if(n==null){if(this.textContainer==null){this.textContainer=e("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)}n=this.text[t]=e("<div></div>").addClass(t).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)}return n};n.prototype.getTextInfo=function(t,n,r,i,s){var o,u,a,f;n=""+n;if(typeof r==="object"){o=r.style+" "+r.variant+" "+r.weight+" "+r.size+"px/"+r.lineHeight+"px "+r.family}else{o=r}u=this._textCache[t];if(u==null){u=this._textCache[t]={}}a=u[o];if(a==null){a=u[o]={}}f=a[n];if(f==null){var l=e("<div></div>").html(n).css({position:"absolute","max-width":s,top:-9999}).appendTo(this.getTextLayer(t));if(typeof r==="object"){l.css({font:o,color:r.color})}else if(typeof r==="string"){l.addClass(r)}f=a[n]={width:l.outerWidth(true),height:l.outerHeight(true),element:l,positions:[]};l.detach()}return f};n.prototype.addText=function(e,t,n,r,i,s,o,u,a){var f=this.getTextInfo(e,r,i,s,o),l=f.positions;if(u=="center"){t-=f.width/2}else if(u=="right"){t-=f.width}if(a=="middle"){n-=f.height/2}else if(a=="bottom"){n-=f.height}for(var c=0,h;h=l[c];c++){if(h.x==t&&h.y==n){h.active=true;return}}h={active:true,rendered:false,element:l.length?f.element.clone():f.element,x:t,y:n};l.push(h);h.element.css({top:Math.round(n),left:Math.round(t),"text-align":u})};n.prototype.removeText=function(e,n,r,i,s,o){if(i==null){var u=this._textCache[e];if(u!=null){for(var a in u){if(t.call(u,a)){var f=u[a];for(var l in f){if(t.call(f,l)){var c=f[l].positions;for(var h=0,p;p=c[h];h++){p.active=false}}}}}}}else{var c=this.getTextInfo(e,i,s,o).positions;for(var h=0,p;p=c[h];h++){if(p.x==n&&p.y==r){p.active=false}}}};e.plot=function(t,n,i){var s=new r(e(t),n,i,e.plot.plugins);return s};e.plot.version="0.8.2";e.plot.plugins=[];e.fn.plot=function(t,n){return this.each(function(){e.plot(this,t,n)})}})(jQuery);
|
admin/view/index.php
CHANGED
@@ -44,25 +44,27 @@
|
|
44 |
|
45 |
<fieldset id="slimstat-date-filters" class="wp-ui-highlight">
|
46 |
<a href="#"><?php
|
47 |
-
if (!empty(wp_slimstat_db::$filters_normalized['date']['hour'])){
|
48 |
-
echo
|
|
|
|
|
49 |
}
|
50 |
else if (!empty(wp_slimstat_db::$filters_normalized['date']['day']) && empty(wp_slimstat_db::$filters_normalized['date']['interval'])){
|
51 |
-
echo ucwords(gmdate(
|
52 |
}
|
53 |
else{
|
54 |
-
echo ucwords(gmdate(
|
55 |
}
|
56 |
?></a>
|
57 |
<span>
|
58 |
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals 0') ?>"><?php _e('Today','wp-slimstat') ?></a>
|
59 |
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d', mktime(0, 0, 0, date_i18n('m'), date_i18n('d')-1, date_i18n('Y'))).'&&&month equals '.date_i18n('m', mktime(0, 0, 0, date_i18n('m'), date_i18n('d')-1, date_i18n('Y'))).'&&&year equals '.date_i18n('Y', mktime(0, 0, 0, date_i18n('m'), date_i18n('d')-1, date_i18n('Y'))).'&&&interval equals 0') ?>"><?php _e('Yesterday','wp-slimstat') ?></a>
|
60 |
-
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals
|
61 |
-
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals
|
62 |
-
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals
|
63 |
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals 0&&&month equals 0&&&year equals '.date_i18n('Y').'&&&interval equals 0') ?>"><?php _e('This Year So Far','wp-slimstat') ?></a>
|
64 |
<strong><?php _e('Date Range','wp-slimstat') ?></strong>
|
65 |
-
<select name="day" id="slimstat-filter-day"
|
66 |
<option value="0"><?php _e('Day','wp-slimstat') ?></option><?php
|
67 |
for($i=1;$i<=31;$i++){
|
68 |
if(!empty(wp_slimstat_db::$filters_normalized['date']['day']) && wp_slimstat_db::$filters_normalized['date']['day'] == $i)
|
@@ -72,22 +74,36 @@
|
|
72 |
}
|
73 |
?>
|
74 |
</select>
|
75 |
-
<select name="month" id="slimstat-filter-month"
|
76 |
<option value="0"><?php _e('Month','wp-slimstat') ?></option><?php
|
77 |
for($i=1;$i<=12;$i++){
|
78 |
if(!empty(wp_slimstat_db::$filters_normalized['date']['month']) && wp_slimstat_db::$filters_normalized['date']['month'] == $i)
|
79 |
-
echo "<option value='$i' selected='selected'>
|
80 |
else
|
81 |
-
echo "<option value='$i'>
|
82 |
}
|
83 |
?>
|
84 |
</select>
|
85 |
-
<input type="text" name="year" id="slimstat-filter-year" placeholder="<?php _e('Year','wp-slimstat') ?>" class="empty-on-focus
|
|
|
|
|
86 |
<input type="hidden" class="slimstat-filter-date" name="slimstat-filter-date" value=""/>
|
87 |
-
<br
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
<input type="submit" value="<?php _e('Apply','wp-slimstat') ?>" class="button-secondary">
|
89 |
-
<?php if (!empty(wp_slimstat_db::$filters_normalized['date']['day']) ||
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
91 |
<?php endif ?>
|
92 |
</span>
|
93 |
</fieldset><!-- .slimstat-date-filters -->
|
44 |
|
45 |
<fieldset id="slimstat-date-filters" class="wp-ui-highlight">
|
46 |
<a href="#"><?php
|
47 |
+
if (!empty(wp_slimstat_db::$filters_normalized['date']['hour']) || !empty(wp_slimstat_db::$filters_normalized['date']['interval_hours'])){
|
48 |
+
echo gmdate(wp_slimstat::$options['date_format'].' '.wp_slimstat::$options['time_format'], wp_slimstat_db::$filters_normalized['utime']['start']).' - ';
|
49 |
+
$end_format = (date('Ymd', wp_slimstat_db::$filters_normalized['utime']['start']) != date('Ymd', wp_slimstat_db::$filters_normalized['utime']['end']))?wp_slimstat::$options['date_format'].' '.wp_slimstat::$options['time_format']:wp_slimstat::$options['time_format'];
|
50 |
+
echo gmdate($end_format, wp_slimstat_db::$filters_normalized['utime']['end']);
|
51 |
}
|
52 |
else if (!empty(wp_slimstat_db::$filters_normalized['date']['day']) && empty(wp_slimstat_db::$filters_normalized['date']['interval'])){
|
53 |
+
echo ucwords(gmdate(wp_slimstat::$options['date_format'], wp_slimstat_db::$filters_normalized['utime']['start']));
|
54 |
}
|
55 |
else{
|
56 |
+
echo ucwords(gmdate(wp_slimstat::$options['date_format'], wp_slimstat_db::$filters_normalized['utime']['start']).' - '.gmdate(wp_slimstat::$options['date_format'], wp_slimstat_db::$filters_normalized['utime']['end']));
|
57 |
}
|
58 |
?></a>
|
59 |
<span>
|
60 |
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals 0') ?>"><?php _e('Today','wp-slimstat') ?></a>
|
61 |
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d', mktime(0, 0, 0, date_i18n('m'), date_i18n('d')-1, date_i18n('Y'))).'&&&month equals '.date_i18n('m', mktime(0, 0, 0, date_i18n('m'), date_i18n('d')-1, date_i18n('Y'))).'&&&year equals '.date_i18n('Y', mktime(0, 0, 0, date_i18n('m'), date_i18n('d')-1, date_i18n('Y'))).'&&&interval equals 0') ?>"><?php _e('Yesterday','wp-slimstat') ?></a>
|
62 |
+
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals 7&&&interval_direction equals minus') ?>"><?php _e('Last 7 Days','wp-slimstat') ?></a>
|
63 |
+
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals 60&&&interval_direction equals minus') ?>"><?php _e('Last 60 Days','wp-slimstat') ?></a>
|
64 |
+
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals '.date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals 90&&&interval_direction equals minus') ?>"><?php _e('Last 90 Days','wp-slimstat') ?></a>
|
65 |
<a class="slimstat-filter-link slimstat-date-choice" href="<?php echo wp_slimstat_reports::fs_url('hour equals 0&&&day equals 0&&&month equals 0&&&year equals '.date_i18n('Y').'&&&interval equals 0') ?>"><?php _e('This Year So Far','wp-slimstat') ?></a>
|
66 |
<strong><?php _e('Date Range','wp-slimstat') ?></strong>
|
67 |
+
<select name="day" id="slimstat-filter-day">
|
68 |
<option value="0"><?php _e('Day','wp-slimstat') ?></option><?php
|
69 |
for($i=1;$i<=31;$i++){
|
70 |
if(!empty(wp_slimstat_db::$filters_normalized['date']['day']) && wp_slimstat_db::$filters_normalized['date']['day'] == $i)
|
74 |
}
|
75 |
?>
|
76 |
</select>
|
77 |
+
<select name="month" id="slimstat-filter-month">
|
78 |
<option value="0"><?php _e('Month','wp-slimstat') ?></option><?php
|
79 |
for($i=1;$i<=12;$i++){
|
80 |
if(!empty(wp_slimstat_db::$filters_normalized['date']['month']) && wp_slimstat_db::$filters_normalized['date']['month'] == $i)
|
81 |
+
echo "<option value='$i' selected='selected'>".substr($GLOBALS['month'][zeroise($i, 2)], 0, 3)."</option>";
|
82 |
else
|
83 |
+
echo "<option value='$i'>".substr($GLOBALS['month'][zeroise($i, 2)], 0, 3)."</option>";
|
84 |
}
|
85 |
?>
|
86 |
</select>
|
87 |
+
<input type="text" name="year" id="slimstat-filter-year" placeholder="<?php _e('Year','wp-slimstat') ?>" class="empty-on-focus" value="<?php echo !empty(wp_slimstat_db::$filters_normalized['date']['year'])?wp_slimstat_db::$filters_normalized['date']['year']:'' ?>"> @
|
88 |
+
<input type="text" name="hour" id="slimstat-filter-hour" placeholder="<?php _e('Hour','wp-slimstat') ?>" class="short empty-on-focus" value="<?php echo !empty(wp_slimstat_db::$filters_normalized['date']['hour'])?wp_slimstat_db::$filters_normalized['date']['hour']:'' ?>">:
|
89 |
+
<input type="text" name="minute" id="slimstat-filter-minute" placeholder="<?php _e('Min','wp-slimstat') ?>" class="short empty-on-focus" value="<?php echo !empty(wp_slimstat_db::$filters_normalized['date']['minute'])?wp_slimstat_db::$filters_normalized['date']['minute']:'' ?>">
|
90 |
<input type="hidden" class="slimstat-filter-date" name="slimstat-filter-date" value=""/>
|
91 |
+
<br/>
|
92 |
+
<select name="interval_direction" class="short" id="slimstat-filter-interval_direction">
|
93 |
+
<option value="minus"<?php echo (wp_slimstat_db::$filters_normalized['date']['interval_direction'] == 'minus')?' selected="selected"':''; ?>>-</option>
|
94 |
+
<option value="plus"<?php echo (wp_slimstat_db::$filters_normalized['date']['interval_direction'] == 'plus')?' selected="selected"':''; ?>>+</option>
|
95 |
+
</select>
|
96 |
+
<input type="text" name="interval" id="slimstat-filter-interval" placeholder="<?php _e('days', 'wp-slimstat') ?>" class="short empty-on-focus" value="<?php echo !empty(wp_slimstat_db::$filters_normalized['date']['interval'])?wp_slimstat_db::$filters_normalized['date']['interval']:'' ?>">,
|
97 |
+
<input type="text" name="interval_hours" id="slimstat-filter-interval_hours" placeholder="<?php _e('hours', 'wp-slimstat') ?>" class="short empty-on-focus" value="<?php echo !empty(wp_slimstat_db::$filters_normalized['date']['interval_hours'])?wp_slimstat_db::$filters_normalized['date']['interval_hours']:'' ?>">:
|
98 |
+
<input type="text" name="interval_minutes" id="slimstat-filter-interval_minutes" placeholder="<?php _e('mins', 'wp-slimstat') ?>" class="short empty-on-focus" value="<?php echo !empty(wp_slimstat_db::$filters_normalized['date']['interval_minutes'])?wp_slimstat_db::$filters_normalized['date']['interval_minutes']:'' ?>">
|
99 |
<input type="submit" value="<?php _e('Apply','wp-slimstat') ?>" class="button-secondary">
|
100 |
+
<?php if (!(empty(wp_slimstat_db::$filters_normalized['date']['day']) || wp_slimstat_db::$filters_normalized['date']['day'] == date_i18n('j')) ||
|
101 |
+
!(empty(wp_slimstat_db::$filters_normalized['date']['month']) || wp_slimstat_db::$filters_normalized['date']['month'] == date_i18n('n')) ||
|
102 |
+
!(empty(wp_slimstat_db::$filters_normalized['date']['year']) || wp_slimstat_db::$filters_normalized['date']['year'] == date_i18n('Y')) ||
|
103 |
+
!empty(wp_slimstat_db::$filters_normalized['date']['interval']) ||
|
104 |
+
!empty(wp_slimstat_db::$filters_normalized['date']['interval_hours']) ||
|
105 |
+
!empty(wp_slimstat_db::$filters_normalized['date']['interval_minutes'])): ?>
|
106 |
+
<a class="slimstat-filter-link button-secondary" href="<?php echo wp_slimstat_reports::fs_url('minute equals 0&&&hour equals 0&&&day equals 0&&&month equals '.date_i18n('n').'&&&year equals '.date_i18n('Y').'&&&interval_direction equals future&&&interval equals 0&&&interval_hours equals 0&&&interval_minutes equals 0') ?>"><?php _e('Reset Filters','wp-slimstat') ?></a>
|
107 |
<?php endif ?>
|
108 |
</span>
|
109 |
</fieldset><!-- .slimstat-date-filters -->
|
admin/view/right-now.php
CHANGED
@@ -44,7 +44,7 @@ else if (wp_slimstat::$options['async_load'] != 'yes' || !empty($_POST['report_i
|
|
44 |
if ($gethostbyaddr != $host_by_ip && !empty($gethostbyaddr)) $host_by_ip .= ', '.$gethostbyaddr;
|
45 |
}
|
46 |
|
47 |
-
$results[$i]['dt'] = date_i18n(wp_slimstat::$options['
|
48 |
|
49 |
// Print session header?
|
50 |
if ($i == 0 || $results[$i-1]['visit_id'] != $results[$i]['visit_id'] || ($results[$i]['visit_id'] == 0 && ($results[$i-1]['ip'] != $results[$i]['ip'] || $results[$i-1]['browser'] != $results[$i]['browser'] || $results[$i-1]['platform'] != $results[$i]['platform']))){
|
44 |
if ($gethostbyaddr != $host_by_ip && !empty($gethostbyaddr)) $host_by_ip .= ', '.$gethostbyaddr;
|
45 |
}
|
46 |
|
47 |
+
$results[$i]['dt'] = date_i18n(wp_slimstat::$options['date_format'].' '.wp_slimstat::$options['time_format'], $results[$i]['dt'], true);
|
48 |
|
49 |
// Print session header?
|
50 |
if ($i == 0 || $results[$i-1]['visit_id'] != $results[$i]['visit_id'] || ($results[$i]['visit_id'] == 0 && ($results[$i-1]['ip'] != $results[$i]['ip'] || $results[$i-1]['browser'] != $results[$i]['browser'] || $results[$i-1]['platform'] != $results[$i]['platform']))){
|
admin/view/wp-slimstat-db.php
CHANGED
@@ -26,10 +26,6 @@ class wp_slimstat_db {
|
|
26 |
self::$formats['thousand'] = ',';
|
27 |
}
|
28 |
|
29 |
-
// Use WordPress' settings for date and time format
|
30 |
-
self::$formats['date_format'] = get_option('date_format', 'd-m-Y');
|
31 |
-
self::$formats['time_format'] = get_option('time_format', 'd-m-Y');
|
32 |
-
|
33 |
// Filters are defined as: browser equals Chrome|country starts_with en
|
34 |
if (!is_string($_filters) || empty($_filters)){
|
35 |
$_filters = '';
|
@@ -69,11 +65,15 @@ class wp_slimstat_db {
|
|
69 |
'visit_id' => __('Visit ID','wp-slimstat'),
|
70 |
|
71 |
// The following filters will not be displayed in the dropdown
|
|
|
72 |
'hour' => __('Hour','wp-slimstat'),
|
73 |
'day' => __('Day','wp-slimstat'),
|
74 |
'month' => __('Month','wp-slimstat'),
|
75 |
'year' => __('Year','wp-slimstat'),
|
|
|
76 |
'interval' => __('days','wp-slimstat'),
|
|
|
|
|
77 |
|
78 |
'direction' => __('Order Direction','wp-slimstat'),
|
79 |
'limit_results' => __('Limit Results','wp-slimstat'),
|
@@ -92,8 +92,21 @@ class wp_slimstat_db {
|
|
92 |
// Hook for the array of normalized filters
|
93 |
self::$filters_normalized = apply_filters('slimstat_db_filters_normalized', self::$filters_normalized, $_filters);
|
94 |
|
95 |
-
if (empty(self::$filters_normalized['date']['interval'])){
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
self::$filters_normalized['utime']['start'] = mktime(
|
98 |
self::$filters_normalized['date']['hour'],
|
99 |
0,
|
@@ -140,40 +153,31 @@ class wp_slimstat_db {
|
|
140 |
self::$filters_normalized['utime']['type'] = 'm';
|
141 |
}
|
142 |
}
|
143 |
-
else{
|
144 |
self::$filters_normalized['utime']['type'] = 'interval';
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
);
|
169 |
-
self::$filters_normalized['utime']['end'] = mktime(
|
170 |
-
23,
|
171 |
-
59,
|
172 |
-
59,
|
173 |
-
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:intval(date_i18n('n')),
|
174 |
-
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:intval(date_i18n('j')),
|
175 |
-
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:intval(date_i18n('Y'))
|
176 |
-
);
|
177 |
}
|
178 |
}
|
179 |
|
@@ -523,7 +527,7 @@ class wp_slimstat_db {
|
|
523 |
switch (self::$filters_normalized['utime']['type']){
|
524 |
case 'H':
|
525 |
$previous['start'] = self::$filters_normalized['utime']['start'] - 3600;
|
526 |
-
$label_date_format =
|
527 |
$group_by = array('HOUR', 'MINUTE', 'i');
|
528 |
$values_in_interval = array(60, 60, 0);
|
529 |
break;
|
@@ -622,6 +626,7 @@ class wp_slimstat_db {
|
|
622 |
}
|
623 |
|
624 |
public static function parse_filters($_filters = '', $_init_misc = true){
|
|
|
625 |
$filters_normalized = array(
|
626 |
'columns' => array(),
|
627 |
'date' => array(),
|
@@ -654,6 +659,7 @@ class wp_slimstat_db {
|
|
654 |
$filters_normalized['date']['month'] = date('n', $custom_date);
|
655 |
$filters_normalized['date']['year'] = date('Y', $custom_date);
|
656 |
break;
|
|
|
657 |
case 'hour':
|
658 |
case 'day':
|
659 |
case 'month':
|
@@ -664,6 +670,9 @@ class wp_slimstat_db {
|
|
664 |
else{
|
665 |
// Try to apply strtotime to value
|
666 |
switch($a_filter[1]){
|
|
|
|
|
|
|
667 |
case 'hour':
|
668 |
$filters_normalized['date'][$a_filter[1]] = date('H', strtotime($a_filter[3], intval(date_i18n('U'))));
|
669 |
break;
|
@@ -685,8 +694,13 @@ class wp_slimstat_db {
|
|
685 |
}
|
686 |
break;
|
687 |
case 'interval':
|
|
|
|
|
688 |
$filters_normalized['date'][$a_filter[1]] = intval($a_filter[3]);
|
689 |
break;
|
|
|
|
|
|
|
690 |
case 'direction':
|
691 |
case 'limit_results':
|
692 |
case 'start_from':
|
26 |
self::$formats['thousand'] = ',';
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
29 |
// Filters are defined as: browser equals Chrome|country starts_with en
|
30 |
if (!is_string($_filters) || empty($_filters)){
|
31 |
$_filters = '';
|
65 |
'visit_id' => __('Visit ID','wp-slimstat'),
|
66 |
|
67 |
// The following filters will not be displayed in the dropdown
|
68 |
+
'minute' => __('Minute','wp-slimstat'),
|
69 |
'hour' => __('Hour','wp-slimstat'),
|
70 |
'day' => __('Day','wp-slimstat'),
|
71 |
'month' => __('Month','wp-slimstat'),
|
72 |
'year' => __('Year','wp-slimstat'),
|
73 |
+
'interval_direction' => __('+/-','wp-slimstat'),
|
74 |
'interval' => __('days','wp-slimstat'),
|
75 |
+
'interval_hours' => __('hours','wp-slimstat'),
|
76 |
+
'interval_minutes' => __('minutes','wp-slimstat'),
|
77 |
|
78 |
'direction' => __('Order Direction','wp-slimstat'),
|
79 |
'limit_results' => __('Limit Results','wp-slimstat'),
|
92 |
// Hook for the array of normalized filters
|
93 |
self::$filters_normalized = apply_filters('slimstat_db_filters_normalized', self::$filters_normalized, $_filters);
|
94 |
|
95 |
+
if (empty(self::$filters_normalized['date']['interval']) && empty(self::$filters_normalized['date']['interval_hours']) && empty(self::$filters_normalized['date']['interval_minutes'])){
|
96 |
+
|
97 |
+
if (!empty(self::$filters_normalized['date']['minute'])){
|
98 |
+
self::$filters_normalized['utime']['start'] = mktime(
|
99 |
+
!empty(self::$filters_normalized['date']['hour'])?self::$filters_normalized['date']['hour']:0,
|
100 |
+
self::$filters_normalized['date']['minute'],
|
101 |
+
0,
|
102 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:intval(date_i18n('n')),
|
103 |
+
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:intval(date_i18n('j')),
|
104 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:intval(date_i18n('Y'))
|
105 |
+
);
|
106 |
+
self::$filters_normalized['utime']['end'] = self::$filters_normalized['utime']['start'] + 60;
|
107 |
+
self::$filters_normalized['utime']['type'] = 'H';
|
108 |
+
}
|
109 |
+
else if (!empty(self::$filters_normalized['date']['hour'])){
|
110 |
self::$filters_normalized['utime']['start'] = mktime(
|
111 |
self::$filters_normalized['date']['hour'],
|
112 |
0,
|
153 |
self::$filters_normalized['utime']['type'] = 'm';
|
154 |
}
|
155 |
}
|
156 |
+
else{ // An interval was specified
|
157 |
self::$filters_normalized['utime']['type'] = 'interval';
|
158 |
+
|
159 |
+
self::$filters_normalized['utime']['start'] = mktime(
|
160 |
+
!empty(self::$filters_normalized['date']['hour'])?self::$filters_normalized['date']['hour']:intval(date_i18n('G')),
|
161 |
+
!empty(self::$filters_normalized['date']['minute'])?self::$filters_normalized['date']['minute']:intval(date_i18n('i')),
|
162 |
+
0,
|
163 |
+
!empty(self::$filters_normalized['date']['month'])?self::$filters_normalized['date']['month']:intval(date_i18n('n')),
|
164 |
+
!empty(self::$filters_normalized['date']['day'])?self::$filters_normalized['date']['day']:intval(date_i18n('j')),
|
165 |
+
!empty(self::$filters_normalized['date']['year'])?self::$filters_normalized['date']['year']:intval(date_i18n('Y'))
|
166 |
+
);
|
167 |
+
|
168 |
+
$sign = (self::$filters_normalized['date']['interval_direction'] == 'plus')?'+':'-';
|
169 |
+
|
170 |
+
self::$filters_normalized['utime']['end'] = date('U',
|
171 |
+
strtotime($sign.(
|
172 |
+
(!empty(self::$filters_normalized['date']['interval'])?intval(self::$filters_normalized['date']['interval']):0) * 1440 +
|
173 |
+
(!empty(self::$filters_normalized['date']['interval_hours'])?intval(self::$filters_normalized['date']['interval_hours']):0) * 60 +
|
174 |
+
(!empty(self::$filters_normalized['date']['interval_minutes'])?intval(self::$filters_normalized['date']['interval_minutes']):0)
|
175 |
+
).' minutes', self::$filters_normalized['utime']['start'])
|
176 |
+
);
|
177 |
+
|
178 |
+
// Swap boundaries if we're going back
|
179 |
+
if (self::$filters_normalized['date']['interval_direction'] == 'minus'){
|
180 |
+
list(self::$filters_normalized['utime']['start'], self::$filters_normalized['utime']['end']) = array(self::$filters_normalized['utime']['end'], self::$filters_normalized['utime']['start']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
}
|
183 |
|
527 |
switch (self::$filters_normalized['utime']['type']){
|
528 |
case 'H':
|
529 |
$previous['start'] = self::$filters_normalized['utime']['start'] - 3600;
|
530 |
+
$label_date_format = wp_slimstat::$options['time_format'];
|
531 |
$group_by = array('HOUR', 'MINUTE', 'i');
|
532 |
$values_in_interval = array(60, 60, 0);
|
533 |
break;
|
626 |
}
|
627 |
|
628 |
public static function parse_filters($_filters = '', $_init_misc = true){
|
629 |
+
|
630 |
$filters_normalized = array(
|
631 |
'columns' => array(),
|
632 |
'date' => array(),
|
659 |
$filters_normalized['date']['month'] = date('n', $custom_date);
|
660 |
$filters_normalized['date']['year'] = date('Y', $custom_date);
|
661 |
break;
|
662 |
+
case 'minute':
|
663 |
case 'hour':
|
664 |
case 'day':
|
665 |
case 'month':
|
670 |
else{
|
671 |
// Try to apply strtotime to value
|
672 |
switch($a_filter[1]){
|
673 |
+
case 'minute':
|
674 |
+
$filters_normalized['date'][$a_filter[1]] = date('i', strtotime($a_filter[3], intval(date_i18n('U'))));
|
675 |
+
break;
|
676 |
case 'hour':
|
677 |
$filters_normalized['date'][$a_filter[1]] = date('H', strtotime($a_filter[3], intval(date_i18n('U'))));
|
678 |
break;
|
694 |
}
|
695 |
break;
|
696 |
case 'interval':
|
697 |
+
case 'interval_hours':
|
698 |
+
case 'interval_minutes':
|
699 |
$filters_normalized['date'][$a_filter[1]] = intval($a_filter[3]);
|
700 |
break;
|
701 |
+
case 'interval_direction':
|
702 |
+
$filters_normalized['date'][$a_filter[1]] = in_array($a_filter[3], array('plus', 'minus'))?$a_filter[3]:'plus';
|
703 |
+
break;
|
704 |
case 'direction':
|
705 |
case 'limit_results':
|
706 |
case 'start_from':
|
admin/view/wp-slimstat-reports.php
CHANGED
@@ -183,17 +183,13 @@ class wp_slimstat_reports {
|
|
183 |
if (!empty($_POST['f']) && !empty($_POST['o'])){
|
184 |
$filters[] = "{$_POST['f']} {$_POST['o']} ".(isset($_POST['v'])?$_POST['v']:'');
|
185 |
}
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
$filters[] = "year equals {$_POST['year']}";
|
194 |
-
}
|
195 |
-
if (!empty($_POST['interval'])){
|
196 |
-
$filters[] = "interval equals {$_POST['interval']}";
|
197 |
}
|
198 |
|
199 |
// Hidden Filters
|
@@ -213,7 +209,7 @@ class wp_slimstat_reports {
|
|
213 |
wp_slimstat_db::init($filters);
|
214 |
|
215 |
// Some of the filters supported by the API do not appear in the dropdown
|
216 |
-
self::$dropdown_filter_names = array_diff_key(wp_slimstat_db::$filter_names, array('hour' => 1, 'day' => 1, 'month' => 1, 'year' => 1, 'interval' => 1, 'direction' => 1, 'limit_results' => 1, 'start_from' => 1, 'strtotime' => 1));
|
217 |
|
218 |
// Default text for the inline help associated to the chart
|
219 |
self::$chart_tooltip = '<strong>'.__('Chart controls','wp-slimstat').'</strong><ul><li>'.__('Use your mouse wheel to zoom in and out','wp-slimstat').'</li><li>'.__('While zooming in, drag the chart to move to a different area','wp-slimstat').'</li><li>'.__('Double click on an empty region to reset the zoom level','wp-slimstat').'</li>';
|
@@ -534,7 +530,7 @@ class wp_slimstat_reports {
|
|
534 |
$element_value = "<a class='slimstat-filter-link' href='".self::fs_url($_column.' '.$_args['filter_op'].' '.$results[$i][$_column])."'>$element_value</a>";
|
535 |
|
536 |
if ($_type == 'recent'){
|
537 |
-
$row_details = date_i18n(wp_slimstat::$options['
|
538 |
}
|
539 |
else{
|
540 |
$percentage = ' <span>'.(($_args['total_for_percentage'] > 0)?number_format(sprintf("%01.2f", (100*$results[$i]['counthits']/$_args['total_for_percentage'])), 2, wp_slimstat_db::$formats['decimal'], wp_slimstat_db::$formats['thousand']):0).'%</span>';
|
@@ -710,7 +706,7 @@ class wp_slimstat_reports {
|
|
710 |
$host_by_ip .= ($host_by_ip != $results[$i]['ip'])?" ({$results[$i]['ip']})":'';
|
711 |
}
|
712 |
|
713 |
-
$results[$i]['dt'] = date_i18n(wp_slimstat::$options['
|
714 |
if (!empty($results[$i]['searchterms']) && empty($results[$i]['resource'])){
|
715 |
$results[$i]['resource'] = __('Search for','wp-slimstat').': '.htmlentities($results[$i]['searchterms'], ENT_QUOTES, 'UTF-8');
|
716 |
}
|
@@ -778,8 +774,8 @@ class wp_slimstat_reports {
|
|
778 |
<p><?php _e('Javascript Mode', 'wp-slimstat') ?> <span><?php _e(ucfirst(wp_slimstat::$options['javascript_mode']), 'wp-slimstat') ?></span></p>
|
779 |
<p><?php _e('Tracking Browser Caps', 'wp-slimstat') ?> <span><?php _e(ucfirst(wp_slimstat::$options['enable_javascript']), 'wp-slimstat') ?></span></p>
|
780 |
<p><?php _e('Auto purge', 'wp-slimstat') ?> <span><?php echo (wp_slimstat::$options['auto_purge'] > 0)?wp_slimstat::$options['auto_purge'].' '.__('days','wp-slimstat'):__('No','wp-slimstat') ?></span></p>
|
781 |
-
<p><?php _e('Oldest pageview', 'wp-slimstat') ?> <span><?php $dt = wp_slimstat_db::get_oldest_visit('1=1', false); echo ($dt == null)?__('No visits','wp-slimstat'):date_i18n(
|
782 |
-
<p>Geo IP <span><?php echo date_i18n(
|
783 |
}
|
784 |
|
785 |
public static function show_overview_summary($_id = 'p0', $_current_pageviews = 0, $_chart_data = array()){
|
183 |
if (!empty($_POST['f']) && !empty($_POST['o'])){
|
184 |
$filters[] = "{$_POST['f']} {$_POST['o']} ".(isset($_POST['v'])?$_POST['v']:'');
|
185 |
}
|
186 |
+
|
187 |
+
$date_time_filters = array('minute', 'hour', 'day', 'month', 'year', 'interval_direction', 'interval', 'interval_hours', 'interval_minutes');
|
188 |
+
|
189 |
+
foreach ($date_time_filters as $a_date_time_filter_name){
|
190 |
+
if (!empty($_POST[$a_date_time_filter_name])){
|
191 |
+
$filters[] = "$a_date_time_filter_name equals {$_POST[$a_date_time_filter_name]}";
|
192 |
+
}
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
|
195 |
// Hidden Filters
|
209 |
wp_slimstat_db::init($filters);
|
210 |
|
211 |
// Some of the filters supported by the API do not appear in the dropdown
|
212 |
+
self::$dropdown_filter_names = array_diff_key(wp_slimstat_db::$filter_names, array('minute' => 1, 'hour' => 1, 'day' => 1, 'month' => 1, 'year' => 1, 'interval' => 1, 'interval_hours' => 1, 'interval_minutes' => 1, 'direction' => 1, 'limit_results' => 1, 'start_from' => 1, 'strtotime' => 1));
|
213 |
|
214 |
// Default text for the inline help associated to the chart
|
215 |
self::$chart_tooltip = '<strong>'.__('Chart controls','wp-slimstat').'</strong><ul><li>'.__('Use your mouse wheel to zoom in and out','wp-slimstat').'</li><li>'.__('While zooming in, drag the chart to move to a different area','wp-slimstat').'</li><li>'.__('Double click on an empty region to reset the zoom level','wp-slimstat').'</li>';
|
530 |
$element_value = "<a class='slimstat-filter-link' href='".self::fs_url($_column.' '.$_args['filter_op'].' '.$results[$i][$_column])."'>$element_value</a>";
|
531 |
|
532 |
if ($_type == 'recent'){
|
533 |
+
$row_details = date_i18n(wp_slimstat::$options['date_format'].' '.wp_slimstat::$options['time_format'], $results[$i]['dt'], true).$row_details;
|
534 |
}
|
535 |
else{
|
536 |
$percentage = ' <span>'.(($_args['total_for_percentage'] > 0)?number_format(sprintf("%01.2f", (100*$results[$i]['counthits']/$_args['total_for_percentage'])), 2, wp_slimstat_db::$formats['decimal'], wp_slimstat_db::$formats['thousand']):0).'%</span>';
|
706 |
$host_by_ip .= ($host_by_ip != $results[$i]['ip'])?" ({$results[$i]['ip']})":'';
|
707 |
}
|
708 |
|
709 |
+
$results[$i]['dt'] = date_i18n(wp_slimstat::$options['date_format'].' '.wp_slimstat::$options['time_format'], $results[$i]['dt'], true);
|
710 |
if (!empty($results[$i]['searchterms']) && empty($results[$i]['resource'])){
|
711 |
$results[$i]['resource'] = __('Search for','wp-slimstat').': '.htmlentities($results[$i]['searchterms'], ENT_QUOTES, 'UTF-8');
|
712 |
}
|
774 |
<p><?php _e('Javascript Mode', 'wp-slimstat') ?> <span><?php _e(ucfirst(wp_slimstat::$options['javascript_mode']), 'wp-slimstat') ?></span></p>
|
775 |
<p><?php _e('Tracking Browser Caps', 'wp-slimstat') ?> <span><?php _e(ucfirst(wp_slimstat::$options['enable_javascript']), 'wp-slimstat') ?></span></p>
|
776 |
<p><?php _e('Auto purge', 'wp-slimstat') ?> <span><?php echo (wp_slimstat::$options['auto_purge'] > 0)?wp_slimstat::$options['auto_purge'].' '.__('days','wp-slimstat'):__('No','wp-slimstat') ?></span></p>
|
777 |
+
<p><?php _e('Oldest pageview', 'wp-slimstat') ?> <span><?php $dt = wp_slimstat_db::get_oldest_visit('1=1', false); echo ($dt == null)?__('No visits','wp-slimstat'):date_i18n(wp_slimstat::$options['date_format'], $dt) ?></span></p>
|
778 |
+
<p>Geo IP <span><?php echo date_i18n(wp_slimstat::$options['date_format'], @filemtime(WP_PLUGIN_DIR.'/wp-slimstat/databases/maxmind.dat')) ?></span></p><?php
|
779 |
}
|
780 |
|
781 |
public static function show_overview_summary($_id = 'p0', $_current_pageviews = 0, $_chart_data = array()){
|
admin/wp-slimstat-admin.php
CHANGED
@@ -12,7 +12,7 @@ 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 |
else {
|
18 |
self::$admin_notice = "
|
@@ -399,6 +399,8 @@ class wp_slimstat_admin{
|
|
399 |
$count_pages = $count_pages->publish + $count_pages->draft;
|
400 |
$total = $my_wpdb->get_var("SELECT COUNT(*) FROM {$GLOBALS['wpdb']->prefix}slim_stats");
|
401 |
|
|
|
|
|
402 |
return true;
|
403 |
}
|
404 |
// end update_tables_and_options
|
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 = "Would you like to be able to "archive" old pageviews after X days, instead of just deleting them like it is now? If we get <a href='http://support.getused.to.it/' target='_blank'>enough interest</a>, we will add this feature to Slimstat. In the meanwhile, please test your new time filters: no other analytics plugin out there has such a detailed granularity!";
|
16 |
}
|
17 |
else {
|
18 |
self::$admin_notice = "
|
399 |
$count_pages = $count_pages->publish + $count_pages->draft;
|
400 |
$total = $my_wpdb->get_var("SELECT COUNT(*) FROM {$GLOBALS['wpdb']->prefix}slim_stats");
|
401 |
|
402 |
+
@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));
|
403 |
+
|
404 |
return true;
|
405 |
}
|
406 |
// end update_tables_and_options
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
=== WP Slimstat ===
|
2 |
Contributors: coolmann
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BNJR5EZNY3W38
|
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.0
|
7 |
-
Stable tag: 3.
|
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/).
|
@@ -271,6 +271,13 @@ foreach ($results...`
|
|
271 |
|
272 |
== Changelog ==
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
= 3.7.5 =
|
275 |
* [Fix] Some plugins are not considerate of the shared environment they use, and don't return data in the right format ;) We added some extra code to make sure the data Slimstat needs is of the correct type (thank you, [p30m](https://wordpress.org/support/topic/slim-stat-dosnt-work-after-wordpress-ugrade))
|
276 |
* [Fix] Compatibility issue with our Firewall Fix add-on
|
1 |
+
=== WP Slimstat ===
|
2 |
Contributors: coolmann
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BNJR5EZNY3W38
|
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.0
|
7 |
+
Stable tag: 3.8
|
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/).
|
271 |
|
272 |
== Changelog ==
|
273 |
|
274 |
+
= 3.8 =
|
275 |
+
* [New] We increased the filter granularity to the minute, so that now you can see who visited your website between 9 am and 10.34 am (thank you, [berserk77](https://wordpress.org/support/topic/need-help-with-some-filtering-features))
|
276 |
+
* [New] If admin is served over HTTPS but IP lookup service is not, don't use inline overlay dialog (thank you, [509tyler](https://wordpress.org/support/topic/https-overlay-suggestion))
|
277 |
+
* [Update] Javascript libraries: qTip v2.2.1 and SlimScroll 1.3.3
|
278 |
+
* [Fix] Outbound links from within the admin were not tracked as expected (thank you [mobilemindtech](https://wordpress.org/support/topic/outbound-links-problem-in-version-374))
|
279 |
+
* [Fix] Firewall Fix add-on was not tracking the originating ip's country as expected (thank you, JeanLuc)
|
280 |
+
|
281 |
= 3.7.5 =
|
282 |
* [Fix] Some plugins are not considerate of the shared environment they use, and don't return data in the right format ;) We added some extra code to make sure the data Slimstat needs is of the correct type (thank you, [p30m](https://wordpress.org/support/topic/slim-stat-dosnt-work-after-wordpress-ugrade))
|
283 |
* [Fix] Compatibility issue with our Firewall Fix add-on
|
wp-slimstat.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
|
1 |
+
var SlimStat={_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"]}},_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},_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},_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"){return false}if(typeof n=="undefined")var n=true;try{if(window.XMLHttpRequest){request=new XMLHttpRequest}else if(window.ActiveXObject){request=new ActiveXObject("Microsoft.XMLHTTP")}}catch(r){return false}if(request){var i="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(i);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){parsed_id=parseInt(SlimStat._id);if(isNaN(parsed_id)||parsed_id<=0)return true;if(typeof e=="undefined")var e=window.event;var i=typeof t=="undefined"?0:parseInt(t);var s=[];var o=typeof e.target!="undefined"?e.target:typeof e.srcElement!="undefined"?e.srcElement:false;if(!o)return false;if(o.nodeType==3)o=o.parentNode;var u=o.parentNode;var a="";var f=location.pathname;var l="";switch(o.nodeName){case"FORM":if(o.action.length>0)f=escape(o.action);break;case"INPUT":while(typeof u!="undefined"&&u.nodeName!="FORM"&&u.nodeName!="BODY")u=u.parentNode;if(typeof u.action!="undefined"&&u.action.length>0){f=escape(u.action);break};default:if(o.nodeName!="A"){if(typeof o.getAttribute=="function"&&o.getAttribute("id")!="undefined"&&o.getAttribute("id")!=null&&o.getAttribute("id").length>0){f=o.getAttribute("id");break}while(typeof o.parentNode!="undefined"&&o.parentNode!=null&&o.nodeName!="A"&&o.nodeName!="BODY")o=o.parentNode}if(typeof o.hash!="undefined"&&o.hash.length>0&&o.hostname==location.hostname){f=escape(o.hash)}else{a=typeof o.hostname!="undefined"?o.hostname:"";if(typeof o.href!="undefined"){f=escape(o.href)}}if(typeof o.getAttribute=="function"){if(o.getAttribute("title")!="undefined"&&o.getAttribute("title")!=null&&o.getAttribute("title").length>0)s.push("Title:"+o.getAttribute("title"));if(o.getAttribute("id")!="undefined"&&o.getAttribute("id")!=null&&o.getAttribute("id").length>0)s.push("ID:"+o.getAttribute("id"))}}l="&obd="+a+"&obr="+f;var c=-1;var h=-1;if(typeof e.pageX!="undefined"&&typeof e.pageY!="undefined"){c=e.pageX;h=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"){c=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;h=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}if(c>0&&h>0)l+=(l.length>0?"&":"?")+"po="+c+","+h;s.push("Event:"+e.type);if(typeof n!="undefined"&&n.length>0)s.push(n);if(e.type!="click"&&typeof e.which!="undefined"){if(e.type=="keypress")s.push("Key:"+String.fromCharCode(parseInt(e.which)));else s.push("Type:"+e.which)}SlimStat.send_to_server("id="+SlimStat._id+"&ty="+i+l+"&no="+escape(s.join(", ")),r);return true},slimstat_plusone:function(e){SlimStat.send_to_server("ty=4&obr="+escape("#google-plus-"+e.state))},in_array:function(e,t){for(var n=0;n<t.length;n++){if(t[n]==e)return true}return false}};if(typeof SlimStatParams.disable_outbound_tracking=="undefined"){var links_in_this_page=document.getElementsByTagName("a");var extensions_to_track=typeof SlimStatParams.extensions_to_track!="undefined"&&SlimStatParams.extensions_to_track.length>0?SlimStatParams.extensions_to_track.split(","):[];var type;var track_extension;for(var i=0;i<links_in_this_page.length;i++){track_extension=false;type=0;if(extensions_to_track.length>0&&links_in_this_page[i].pathname.indexOf(".")>0&&links_in_this_page[i].hostname==location.hostname){extension_current_link=links_in_this_page[i].pathname.split(".").pop().replace(/[\/\-]/g,"");track_extension=SlimStat.in_array(extension_current_link,extensions_to_track);type=1}if(!track_extension&&(links_in_this_page[i].hostname==location.hostname||links_in_this_page[i].href.indexOf("://")==-1||links_in_this_page[i].className.indexOf("noslimstat")!=-1)){continue}if(links_in_this_page[i].addEventListener){links_in_this_page[i].addEventListener("click",function(e,t){return function(n){event.preventDefault?event.preventDefault():event.returnValue=false;SlimStat.ss_track(n,t,"A:"+(e+1),function(){document.location=links_in_this_page[e].href})}}(i,type),false)}else if(links_in_this_page[i].attachEvent){links_in_this_page[i].attachEvent("onclick",function(e,t){return function(n){event.preventDefault?event.preventDefault():event.returnValue=false;SlimStat.ss_track(n,t,"A:"+(e+1),function(){document.location=links_in_this_page[e].href})}}(i,type))}}}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){window.onload=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.
|
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.
|
15 |
public static $options = array();
|
16 |
|
17 |
public static $wpdb = '';
|
@@ -106,6 +106,7 @@ class wp_slimstat{
|
|
106 |
}
|
107 |
}
|
108 |
else{
|
|
|
109 |
list(self::$data_js['id'], $nonce) = explode('.', self::$data_js['id']);
|
110 |
if ($nonce != md5(self::$data_js['id'].self::$options['secret'])){
|
111 |
do_action('slimstat_track_exit_104');
|
@@ -340,7 +341,7 @@ class wp_slimstat{
|
|
340 |
|
341 |
// Country and Language
|
342 |
self::$stat['language'] = self::_get_language();
|
343 |
-
self::$stat['country'] = self::
|
344 |
|
345 |
// Anonymize IP Address?
|
346 |
if (self::$options['anonymize_ip'] == 'yes'){
|
@@ -443,7 +444,7 @@ class wp_slimstat{
|
|
443 |
/**
|
444 |
* Searches for country associated to a given IP address
|
445 |
*/
|
446 |
-
|
447 |
$float_ipnum = (float)sprintf("%u", $_ipnum);
|
448 |
|
449 |
// Is this a RFC1918 (local) IP?
|
@@ -487,7 +488,7 @@ class wp_slimstat{
|
|
487 |
fclose($handle);
|
488 |
return 'xx';
|
489 |
}
|
490 |
-
// end
|
491 |
|
492 |
/**
|
493 |
* Tries to find the user's REAL IP address
|
@@ -1095,7 +1096,8 @@ class wp_slimstat{
|
|
1095 |
'show_display_name' => $val_no,
|
1096 |
'show_complete_user_agent_tooltip' => $val_no,
|
1097 |
'convert_resource_urls_to_titles' => $val_yes,
|
1098 |
-
'
|
|
|
1099 |
'async_load' => $val_no,
|
1100 |
'use_slimscroll' => $val_yes,
|
1101 |
'expand_details' => $val_no,
|
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.8
|
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.8';
|
15 |
public static $options = array();
|
16 |
|
17 |
public static $wpdb = '';
|
106 |
}
|
107 |
}
|
108 |
else{
|
109 |
+
self::$stat = array();
|
110 |
list(self::$data_js['id'], $nonce) = explode('.', self::$data_js['id']);
|
111 |
if ($nonce != md5(self::$data_js['id'].self::$options['secret'])){
|
112 |
do_action('slimstat_track_exit_104');
|
341 |
|
342 |
// Country and Language
|
343 |
self::$stat['language'] = self::_get_language();
|
344 |
+
self::$stat['country'] = self::get_country(self::$stat['ip']);
|
345 |
|
346 |
// Anonymize IP Address?
|
347 |
if (self::$options['anonymize_ip'] == 'yes'){
|
444 |
/**
|
445 |
* Searches for country associated to a given IP address
|
446 |
*/
|
447 |
+
public static function get_country($_ipnum = 0){
|
448 |
$float_ipnum = (float)sprintf("%u", $_ipnum);
|
449 |
|
450 |
// Is this a RFC1918 (local) IP?
|
488 |
fclose($handle);
|
489 |
return 'xx';
|
490 |
}
|
491 |
+
// end get_country
|
492 |
|
493 |
/**
|
494 |
* Tries to find the user's REAL IP address
|
1096 |
'show_display_name' => $val_no,
|
1097 |
'show_complete_user_agent_tooltip' => $val_no,
|
1098 |
'convert_resource_urls_to_titles' => $val_yes,
|
1099 |
+
'date_format' => ($val_yes == 'null')?'':'m-d-y',
|
1100 |
+
'time_format' => ($val_yes == 'null')?'':'h:i a',
|
1101 |
'async_load' => $val_no,
|
1102 |
'use_slimscroll' => $val_yes,
|
1103 |
'expand_details' => $val_no,
|